linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Move RS485 implementation from drivers to serial core (v4 RESEND)
@ 2022-04-10 10:46 Lino Sanfilippo
  2022-04-10 10:46 ` [PATCH v4 RESEND 1/9] serial: core: move RS485 configuration tasks from drivers into core Lino Sanfilippo
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Lino Sanfilippo @ 2022-04-10 10:46 UTC (permalink / raw)
  To: gregkh, jirislaby, u.kleine-koenig
  Cc: linux, richard.genoud, nicolas.ferre, alexandre.belloni,
	ludovic.desroches, shawnguo, s.hauer, kernel, festevam,
	linux-imx, mcoquelin.stm32, alexandre.torgue, linux-serial,
	linux-kernel, linux-arm-kernel, linux-stm32, lukas,
	p.rosenberger

This patch series is an attempt to simplify rs485 implementation in drivers
by moving the following tasks out of the drivers into the serial core:

- ensure sane RTS settings: in case of an invalid configuration (both RTS
  after send and RTS on send set or both unset) enable RTS on send and
  disable RTS after send

- nullify the padding field of the serial_rs485 struct before it is
  returned to userspace

- copy the configuration stored in the serial_rs485 struct to the port
  configuration if setting the configuration in the driver was successfull

- limit the RTS delay to 100ms


Redundant code has been removed from the following drivers for now:

- atmel
- fsl_lpuart
- amba
- imx
- max310x
- omap-serial
- sc16is7xx
- stm32-usart

The code has been tested with the amba pl011 driver. This series applies
against Gregs tty-testing branch.

Changes in v2:
- use a makro for max RTS delays and comment it (as requested by Jiri)
- add a comment concerning the memset of a structures padding field - correct
  typos in the commit message (found by Uwe) 
- rephrase all commit messages to make more clear that function
  uart_set_rs485_config() has been extended by checks and other functionalities
  (as requested by Uwe)

Changes in v3:
- add warning messages if the serial core corrects RS485 values (as requested by
  Lukas Wunner)
- dont expose the macro for max RTS delays to userspace (as requested by Greg)

Changes in v4:
- use ratelimit warning messages and also print device, uart port name and line
  (as requested by Jiri)




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-09-20 11:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-10 10:46 Move RS485 implementation from drivers to serial core (v4 RESEND) Lino Sanfilippo
2022-04-10 10:46 ` [PATCH v4 RESEND 1/9] serial: core: move RS485 configuration tasks from drivers into core Lino Sanfilippo
2022-04-10 10:46 ` [PATCH v4 RESEND 2/9] serial: amba-pl011: remove redundant code in rs485_config Lino Sanfilippo
2022-04-10 10:46 ` [PATCH v4 RESEND 3/9] serial: stm32: " Lino Sanfilippo
2022-04-10 10:46 ` [PATCH v4 RESEND 4/9] serial: sc16is7xx: remove redundant check " Lino Sanfilippo
2022-04-10 10:46 ` [PATCH v4 RESEND 5/9] serial: omap: remove redundant code " Lino Sanfilippo
2022-04-10 10:46 ` [PATCH v4 RESEND 6/9] serial: max310: remove redundant memset " Lino Sanfilippo
2022-04-10 10:46 ` [PATCH v4 RESEND 7/9] serial: imx: remove redundant assignment " Lino Sanfilippo
2022-04-10 10:46 ` [PATCH v4 RESEND 8/9] serial: fsl_lpuart: remove redundant code in rs485_config functions Lino Sanfilippo
2022-04-10 10:46 ` [PATCH v4 RESEND 9/9] serial: atmel: remove redundant assignment in rs485_config Lino Sanfilippo
2022-04-11  8:27   ` Claudiu.Beznea
2022-09-20 11:43 ` Move RS485 implementation from drivers to serial core (v4 RESEND) Lukas Wunner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).