Re: [PATCH v2 6/7] USB: serial: ftdi_sio: Fix custom_divisor and c_*speed for ASYNC_SPD_CUST

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

 



On Sunday 24 July 2022 15:08:09 Johan Hovold wrote:
> On Sun, Jul 24, 2022 at 02:59:08PM +0200, Pali Rohár wrote:
> > On Sunday 24 July 2022 14:54:58 Johan Hovold wrote:
> > > On Sun, Jul 24, 2022 at 02:33:51PM +0200, Pali Rohár wrote:
> 
> > > > What is updated is the real baudrate in c_ispeed and c_ospeed
> > > > extensions.
> > > > 
> > > > It is really wrong? I thought that c_cflag should stay unchanged at
> > > > B38400 when ASYNC_SPD_CUST is used.
> > > 
> > > Yeah, cflags stay unchanged, but you shouldn't touch those fields when
> > > using the deprecated ASYNC_SPD_CUST hack.
> > 
> > Hm... Why? I thought that new extended fields (c_ispeed and c_ospeed)
> > should contain current real speed. What is the reason that c_*speed
> > fields should have 38400 when ASYNC_SPD_CUST hack is set?
> 
> Because we shouldn't go adding new features built around the deprecated
> ASYNC_SPD_CUST hack.

But this is not a new feature in the old deprecated hack. It for the
new interface.

> User picks 38400, sets that flag and magic happens with some drivers for
> a while still while we look the other way.
> 
> This is not something that we should need to care about when using the
> new interfaces.

Exactly and with this patch it work like to described. User of new
interface does not have to care about old deprecated stuff and new
interface would always reports correct value.

> > > Note that this currently only works because the ftdi driver uses
> > > tty_get_baud_rate() instead of c_ospeed directly which is the
> > > recommended (new) way.
> > 
> > Yes, tty_get_baud_rate() helper function is there for this purpose,
> > right?
> 
> No.
> 
> Johan

So for what otherwise?



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux