RE: [PATCH] serial: sh-sci: correct units in comment about DMA timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 04/09/2021 2:16 PM Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx> wrote:
> Thank you for the patch!
> 
> > From: Ulrich Hecht, Sent: Friday, April 9, 2021 5:25 PM
> > 
> > Since the transition to hrtimers, the calculation does not involve jiffies
> > any longer, which has led to confusion. State the times in ms instead.
> 
> IIUC, the unit of rx_timeout was changed from milliseconds to microseconds
> when hrtimer is used.

D'oh!

> So, almost all comments was not needed.
> 
> Also, I'm wondering if the following condition is not needed or not.
> This is because this was "20ms". But, perhaps, the driver will not
> set rx_timeout to "20us" or small.
> 
>         if (s->rx_timeout < 20)
>                 s->rx_timeout = 20;

A more helpful version of the comment is in 3089f381fbaf5:

/*
 * Calculate delay for 1.5 DMA buffers: see
 * drivers/serial/serial_core.c::uart_update_timeout(). With 10 bits
 * (CS8), 250Hz, 115200 baud and 64 bytes FIFO, the above function
 * calculates 1 jiffie for the data plus 5 jiffies for the "slop(e)."
 * Then below we calculate 3 jiffies (12ms) for 1.5 DMA buffers (3 FIFO
 * sizes), but it has been found out experimentally, that this is not
 * enough: the driver too often needlessly runs on a DMA timeout. 20ms
 * as a minimum seem to work perfectly.
 */

I think we still want that, but it should of course be 20000, not 20.

CU
Uli



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux