hujun260 commented on code in PR #15426: URL: https://github.com/apache/nuttx/pull/15426#discussion_r1904980636
########## arch/arm/src/am335x/am335x_can.c: ########## @@ -205,6 +207,8 @@ static struct can_dev_s g_can1dev = }; #endif +static volatile spinlock_t g_can_lock = SP_UNLOCKED; Review Comment: remove volatile ########## arch/arm/src/am335x/am335x_can.c: ########## @@ -1151,7 +1157,7 @@ void am335x_can_uninitialize(struct can_dev_s *dev) canerr("Not a CAN device: %p\n", dev); Review Comment: context switch ########## arch/arm/src/am335x/am335x_can.c: ########## @@ -1109,11 +1114,12 @@ struct can_dev_s *am335x_can_initialize(int port) { canerr("Unsupported port: %d\n", port); - leave_critical_section(flags); + spin_unlock_irqrestore(&g_can_lock, flags); Review Comment: add sched_unlock(); ########## arch/arm/src/am335x/am335x_i2c.c: ########## @@ -185,6 +186,7 @@ struct am335x_i2c_priv_s int refs; /* Reference count */ mutex_t lock; /* Mutual exclusion mutex */ + spinlock_t spinlock; /* Spinlock */ Review Comment: where init spinlock? -- 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