From f7d4e39e2c83adf9f287af12ddb5fa3d11a6eca0 Mon Sep 17 00:00:00 2001 From: linzhenxing Date: Wed, 16 Feb 2022 13:53:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?mmc=E5=88=9D=E5=A7=8B=E5=8C=96bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drivers/sdio/mmc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/components/drivers/sdio/mmc.c b/components/drivers/sdio/mmc.c index 0a41eee594..e3e09d8bcc 100644 --- a/components/drivers/sdio/mmc.c +++ b/components/drivers/sdio/mmc.c @@ -321,12 +321,15 @@ static int mmc_select_bus_width(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd) * bail out early if corresponding bus capable wasn't * set by drivers. */ - if ((!(host->flags & MMCSD_BUSWIDTH_8) && + + if (!(((host->flags & MMCSD_BUSWIDTH_8) && ext_csd_bits[idx] == EXT_CSD_BUS_WIDTH_8) || - (!(host->flags & MMCSD_BUSWIDTH_4) && - (ext_csd_bits[idx] == EXT_CSD_BUS_WIDTH_4 || - ext_csd_bits[idx] == EXT_CSD_BUS_WIDTH_8))) - continue; + ((host->flags & MMCSD_BUSWIDTH_4) && + ext_csd_bits[idx] == EXT_CSD_BUS_WIDTH_4) || + !(ext_csd_bits[idx] == EXT_CSD_BUS_WIDTH_8))) + { + continue; + } err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, -- Gitee From 3c305857b17ee9533500f3611b15098aa61617fd Mon Sep 17 00:00:00 2001 From: linzhenxing Date: Wed, 16 Feb 2022 13:53:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?tty=E5=9C=A8=E5=A4=9A=E6=A0=B8=E4=B8=8B?= =?UTF-8?q?=E5=8D=A1=E6=AD=BB=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drivers/tty/n_tty.c | 6 +++--- components/drivers/tty/pty.c | 3 +-- components/drivers/tty/tty.c | 2 ++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/components/drivers/tty/n_tty.c b/components/drivers/tty/n_tty.c index f44f0cdf8f..38bfd90060 100644 --- a/components/drivers/tty/n_tty.c +++ b/components/drivers/tty/n_tty.c @@ -791,7 +791,8 @@ static size_t __process_echoes(struct tty_struct *tty) size_t tail = 0; unsigned char c = 0; char ch = 0; - + unsigned char num_chars = 0, num_bs = 0; + tail = ldata->echo_tail; while (ldata->echo_commit != tail) { @@ -809,8 +810,6 @@ static size_t __process_echoes(struct tty_struct *tty) switch (op) { - unsigned char num_chars = 0, num_bs = 0; - case ECHO_OP_ERASE_TAB: num_chars = echo_buf(ldata, tail + 2); @@ -1846,6 +1845,7 @@ static int n_tty_read(struct dfs_fd *fd, void *buf, size_t count) c = job_control(tty); if (c < 0) { + rt_hw_interrupt_enable(level); return c; } diff --git a/components/drivers/tty/pty.c b/components/drivers/tty/pty.c index 2c147b21c2..7233c17566 100644 --- a/components/drivers/tty/pty.c +++ b/components/drivers/tty/pty.c @@ -308,8 +308,7 @@ static int ptmx_register(void) level = rt_hw_interrupt_disable(); RT_ASSERT(ptm_drv->init_flag == TTY_INIT_FLAG_NONE); - - level = rt_hw_interrupt_disable(); + device = &(ptm_drv->parent); device->type = RT_Device_Class_Char; diff --git a/components/drivers/tty/tty.c b/components/drivers/tty/tty.c index b88a4b700f..6ba733f778 100644 --- a/components/drivers/tty/tty.c +++ b/components/drivers/tty/tty.c @@ -79,11 +79,13 @@ int __tty_check_change(struct tty_struct *tty, int sig) level = rt_hw_interrupt_disable(); if (current == RT_NULL) { + rt_hw_interrupt_enable(level); return 0; } if (current->tty != tty) { + rt_hw_interrupt_enable(level); return 0; } -- Gitee