Re: [PATCH] serial: 8250: respect rts_before_send before sending chars

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

 



On Fri, Oct 05, 2018 at 01:27:34PM +0300, Matwey V. Kornilov wrote:
> чт, 4 окт. 2018 г. в 11:55, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>:
> >
> > On Thu, Oct 04, 2018 at 09:23:16AM +0200, Uwe Kleine-König wrote:
> > > serial8250_tx_chars() is called from several places and the callers don't
> > > consider that sending might not be allowed yet because the
> > > rts_before_send delay isn't over yet.
> > >
> > > So teach serial8250_tx_chars() about rts_before_send and delay the
> > > request accordingly if required.
> > >
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> > > ---
> > > Cc: Tomas Melin <tomas.melin@xxxxxxxxxxx>
> > > Cc: Daniel Golle <daniel@xxxxxxxxxxxxxx>
> > > Cc: Ricardo Ribalda Delgado <ricardo.ribalda@xxxxxxxxx>
> > > Cc: Lukas Wunner <lukas@xxxxxxxxx>
> > > Cc: Aaron Sierra <asierra@xxxxxxxxxxx>
> > > Cc: Rafael Gago <rafael.gago@xxxxxxxxx>
> > > Cc: Daniel Jedrychowski <avistel@xxxxxxxxx>
> > >
> > > Hello,
> > >
> > > on a powerpc (MPC8313) this patch prevents sending characters too early
> > > after an edge on CTS is detected. As the 8250 driver is quite "advanced"
> > > I'd welcome testing feedback for other chip variants, so I added a few
> > > people to Cc who did rs485 stuff in the past.
> >
> > You pretty much missed the author of contribution of RS485 emulation
> > to 8250 driver.
> >
> > Cc'ed to Matwey.
> 
> I still don't understand the following. The only one user for this
> code is 8250_omap which is armv7l. Where did MPC8313 came from?

It's a device tree based system. On my machine it looks similar to
arch/powerpc/boot/dts/mpc8313erdb.dts:

                serial0: serial@4500 {
                        cell-index = <0>;
                        device_type = "serial";
                        compatible = "fsl,ns16550", "ns16550";
                        reg = <0x4500 0x100>;
                        clock-frequency = <132000000>;
                        interrupts = <9 0x8>;
                        interrupt-parent = <&ipic>;
                };

The corresponding device is instantiated from
drivers/tty/serial/8250/8250_of.c.

There is:

	port->handle_irq = fsl8250_handle_irq;

and in this function there is a call to serial8250_tx_chars().

But there is also serial8250_handle_irq() in
drivers/tty/serial/8250/8250_port.c which calls serial8250_tx_chars().

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux