xiaoxiang781216 commented on code in PR #16466:
URL: https://github.com/apache/nuttx/pull/16466#discussion_r2140510794


##########
drivers/serial/Kconfig-usart:
##########
@@ -705,13 +723,15 @@ menu "USART9 Configuration"
 
 config USART9_RXBUFSIZE
        int "Receive buffer size"
+       default 128 if ARCH_LD_16BIT_NOT_ATOMIC
        default 256
        ---help---
                Characters are buffered as they are received. This specifies
                the size of the receive buffer.
 
 config USART9_TXBUFSIZE
        int "Transmit buffer size"
+       default 128 if ARCH_LD_16BIT_NOT_ATOMIC

Review Comment:
   > I am not sure if that means to a) change the name from 
ARCH_LD_16BIT_NOT_ATOMIC to ARCH_HAVE_8BIT_BUFSIZE or b) add 
ARCH_HAVE_8BIT_BUFSIZE and have it selected by ARCH_LD_16BIT_NOT_ATOMIC? 
Neither seems fully correct though.
   > 
   
   change to ARCH_HAVE_SERIAL_8BIT_BUFSIZE and put after:
   https://github.com/apache/nuttx/blob/master/drivers/serial/Kconfig#L6
   select it from AVR serial driver Kconfig option.
   
   > The first variant reduces the problem to buffers only but that is too 
narrow. Essentially, any other value that is simultaneously written in 
interrupt code and read in non-interrupt code needs the be treated in the same 
manner as buffer head/tail here. The current name reflects that. Also, adding 
ARCH_LD_32BIT_NOT_ATOMIC may be needed as well (possibly not only for AVR but 
for 16 bit microcontrollers too - if I understand it correctly, that applies to 
Freescale M9S12.)
   > 
   
   16bit arch normally support the atomic access to 16bit data, it's strange 
that AVR doesn't support it.
   
   > The second variant implies that all of the arch has 8 bit buffer size for 
all buffers everywhere which is not true and may not be desirable.
   > 
   > How about adding ARCH_HAVE_8BIT_SERIAL_BUFSIZE to serial/Kconfig and have 
it selected by 
   
   yes, it's better name.
   
   > ARCH_LD_16BIT_NOT_ATOMIC?
   
   if you consider to other module may have the similar issue, 
ARCH_LD_16BIT_NOT_ATOMIC is better to keep, but should we remove LD_ from name 
since store shouldn't be atomic too.



-- 
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

Reply via email to