пт, 5 окт. 2018 г. в 17:58, Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>: > > On Fri, Oct 05, 2018 at 05:36:56PM +0300, Matwey V. Kornilov wrote: > > пт, 5 окт. 2018 г. в 17:33, Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>: > > > > > > 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(). > > > > Right. But serial8250_em485_init() is never called for your port > > device. So, em485 is always NULL for you, isn't it? > > Ok, you're right. (Testing of this patch wasn't in my hand. I just got > an error description, found the above mentioned issue and provided the > patch. The tester updated from 4.9 to 4.16 + my patch and reported the > issue gone. So the problem was obviously already fixed by the kernel > update.) > > Still the issue is real for omap, isn't it? Sorry for delay with answer. I am on business trip now. In my opinion there are two questions: 1) What is really meant to be fixed? Could the tester check 4.16 without the patch and try if the initial issue is gone? 2) Is the issue present at 8250_omap? Is the issue fixed at 8250_omap by the patch? This should be checked with real omap hardware. > > Best regards > Uwe > > -- > Pengutronix e.K. | Uwe Kleine-König | > Industrial Linux Solutions | http://www.pengutronix.de/ | > -- With best regards, Matwey V. Kornilov. Sternberg Astronomical Institute, Lomonosov Moscow State University, Russia 119234, Moscow, Universitetsky pr-k 13, +7 (495) 9392382