xiaoxiang781216 commented on code in PR #16031: URL: https://github.com/apache/nuttx/pull/16031#discussion_r2007997947
########## arch/risc-v/src/mpfs/mpfs_dsn.c: ########## @@ -91,9 +98,7 @@ int mpfs_read_dsn(uint8_t *dsn, size_t len) while ((getreg32(SERVICES_SR) & SCBCTRL_SERVICESSR_BUSY) && --retries > 0) { - leave_critical_section(flags); nxsig_usleep(1000); Review Comment: it's wrong to sleep while holding spinlock ########## arch/risc-v/src/mpfs/mpfs_coremmc.c: ########## @@ -525,7 +526,7 @@ static void mpfs_configxfrints(struct mpfs_dev_s *priv, uint32_t xfrmask, { irqstate_t flags; - flags = enter_critical_section(); + flags = spin_lock_irqsave(&priv->lock); priv->xfrmask = xfrmask; priv->xfr_blkmask = xfr_blkmask; Review Comment: mcinfo may sleep ########## arch/risc-v/src/mpfs/mpfs_emmcsd.c: ########## @@ -3112,5 +3109,5 @@ void mpfs_emmcsd_sdio_wrprotect(struct sdio_dev_s *dev, bool wrprotect) mcinfo("cdstatus: %02" PRIx8 "\n", priv->cdstatus); Review Comment: ditto ########## arch/risc-v/src/mpfs/mpfs_usb.c: ########## @@ -477,7 +478,7 @@ static void mpfs_disableclk(void) 0); Review Comment: ditto ########## arch/risc-v/src/mpfs/mpfs_coremmc.c: ########## @@ -2411,5 +2412,5 @@ void mpfs_coremmc_sdio_wrprotect(struct sdio_dev_s *dev, bool wrprotect) mcinfo("cdstatus: %02" PRIx8 "\n", priv->cdstatus); Review Comment: ditto ########## arch/risc-v/src/mpfs/mpfs_emmcsd.c: ########## @@ -644,14 +645,14 @@ static void mpfs_configxfrints(struct mpfs_dev_s *priv, uint32_t xfrmask) { irqstate_t flags; - flags = enter_critical_section(); + flags = spin_lock_irqsave(&priv->lock); priv->xfrmask = xfrmask; mcinfo("Mask: %08" PRIx32 "\n", priv->xfrmask | priv->waitmask); Review Comment: ditto -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org