Re: [PATCH v2] serial: stm32: optimize spin lock usage

2021-04-16 Thread Johan Hovold
On Tue, Apr 13, 2021 at 07:44:39AM +0800, dillon min wrote: > Hi Johan, Erwan > > It seems still a bit of a problem in the current version, not deadlock > but access register at the same time. > > For driver , we should consider it running under smp, let's think > about it for this case: > > sta

Re: [PATCH v2] serial: stm32: optimize spin lock usage

2021-04-16 Thread Johan Hovold
[ Please avoid top-posting. ] On Thu, Apr 15, 2021 at 07:09:14PM +0200, Erwan LE RAY wrote: > Hi Dillon, > > STM32MP151 is mono-core, but both STM32MP153 and STM32MP157 are > dual-core (see > https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm32-arm-cortex-mpus.ht

Re: [PATCH v3] serial: stm32: optimize spin lock usage

2021-04-16 Thread Johan Hovold
ock); > ... > uart_unlock_and_check_sysrq(); > spin_unlock_irqrestore(); > handle_sysrq(sysrq_ch); > stm32_usart_threaded_interrupt()//stm32_usart_interrupt() return > > Cc: Johan Hovold > Cc: Alexandre Torgue > Cc: Maxime Coquelin > Cc: Geral

[PATCH 1/3] serial: do not restore interrupt state in sysrq helper

2021-04-16 Thread Johan Hovold
ysrq() and update its callers to no longer explicitly disable interrupts in their interrupt handlers. Cc: Joel Stanley Cc: Andrew Jeffery Cc: Andy Gross Cc: Bjorn Andersson Signed-off-by: Johan Hovold --- drivers/tty/serial/8250/8250_aspeed_vuart.c | 5 ++--- drivers/tty/serial/8250/

[PATCH 3/3] serial: stm32: defer sysrq processing

2021-04-16 Thread Johan Hovold
makes the console code work with PREEMPT_RT by no longer relying on local_irq_save(). Signed-off-by: Johan Hovold --- drivers/tty/serial/stm32-usart.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32

[PATCH 0/3] serial: sysrq cleanup and stm32 fixes

2021-04-16 Thread Johan Hovold
commit. The third patch cleans up the stm32 console implementation by switching to deferred sysrq processing, thereby making the console code more robust and allowing it to be used with PREEMPT_RT. This series is against tty-next and and have only been compile tested. Johan Johan Hovold (3

[PATCH 2/3] serial: stm32: fix threaded interrupt handling

2021-04-16 Thread Johan Hovold
c: Gerald Baeza Signed-off-by: Johan Hovold --- drivers/tty/serial/stm32-usart.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 4d277804c63e..3524ed2c0c73 100644 --- a/drivers/

Re: [PATCH 2/3] serial: stm32: fix threaded interrupt handling

2021-04-16 Thread Johan Hovold
On Fri, Apr 16, 2021 at 04:05:56PM +0200, Johan Hovold wrote: > When DMA is enabled the receive handler runs in a threaded handler, but > the primary handler up until very recently neither disabled interrupts Scratch the "up until very recently" bit here since the driver still

Re: [PATCH 2/3] serial: stm32: fix threaded interrupt handling

2021-04-16 Thread Johan Hovold
On Fri, Apr 16, 2021 at 10:35:25PM +0800, dillon min wrote: > Hi Johan > > Thanks for share your patch. > > Johan Hovold 于2021年4月16日 周五22:11写道: > > > When DMA is enabled the receive handler runs in a threaded handler, but > > the primary handler up until

[PATCH 2/4] USB: serial: io_ti: document reason for drain delay

2021-04-12 Thread Johan Hovold
Document that the device line-status register doesn't tell when the transmitter shift register has emptied and that this is why the one-character drain delay is needed. Signed-off-by: Johan Hovold --- drivers/usb/serial/io_ti.c | 4 1 file changed, 4 insertions(+) diff --git a/driver

[PATCH 1/4] USB: serial: f81232: drop time-based drain delay

2021-04-12 Thread Johan Hovold
The f81232 driver now waits for the transmit FIFO to drain during close so there is no need to keep the time-based drain delay, which would add up to two seconds on every close for low line speeds. Fixes: 98405f81036d ("USB: serial: f81232: add tx_empty function") Signed-off-by: Jo

[PATCH 4/4] USB: serial: ti_usb_3410_5052: drop drain delay for 3410

2021-04-12 Thread Johan Hovold
needed (e.g. 90 ms at 110 bps). Signed-off-by: Johan Hovold --- drivers/usb/serial/ti_usb_3410_5052.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 8ed64115987f..d9bffb2de8bf

[PATCH 3/4] USB: serial: ti_usb_3410_5052: reduce drain delay to one char

2021-04-12 Thread Johan Hovold
meout (e.g. 33 ms at 300 bps) should be enough to compensate for the lack of a transmitter empty bit in the TUSB5052 line-status register. Signed-off-by: Johan Hovold --- drivers/usb/serial/ti_usb_3410_5052.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/

[PATCH 0/4] USB: serial: closing-wait fixes and cleanups

2021-04-12 Thread Johan Hovold
eason for two other uses where such a delay is needed to let the transmitter shift register clear. As it turns out, this is really only needed for one of the two device types handled by the ti_usb_3410_5052 driver. Johan Johan Hovold (4): USB: serial: f81232: drop time-based drain delay USB: s

[PATCH 03/12] USB: serial: xr: rename GPIO-pin defines

2021-04-12 Thread Johan Hovold
Rename the GPIO-pin defines so that they reflect how they are used. Signed-off-by: Johan Hovold --- drivers/usb/serial/xr_serial.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial

[PATCH 05/12] USB: serial: xr: drop type prefix from shared defines

2021-04-12 Thread Johan Hovold
In preparation for adding support for further types, drop the type prefix from defines that are not specific to XR21V141X. Signed-off-by: Johan Hovold --- drivers/usb/serial/xr_serial.c | 122 - 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a

[PATCH RESEND 00/12] USB: serial: xr: add support for more device types

2021-04-12 Thread Johan Hovold
e recently posted multi-interface-function series. Johan Johan Hovold (11): USB: serial: xr: add support for XR21V1412 and XR21V1414 USB: serial: xr: rename GPIO-mode defines USB: serial: xr: rename GPIO-pin defines USB: serial: xr: move pin configuration to probe USB: serial: xr: drop t

[PATCH 04/12] USB: serial: xr: move pin configuration to probe

2021-04-12 Thread Johan Hovold
There's no need to configure the pins on every open and judging from the vendor driver and datasheet it can be done before enabling the UART. Move pin configuration from open() to port probe and make sure to deassert DTR and RTS after configuring all pins as GPIO. Signed-off-by: Johan H

[PATCH 01/12] USB: serial: xr: add support for XR21V1412 and XR21V1414

2021-04-12 Thread Johan Hovold
reside in separate blocks per channel, while the UART Manager functionality is implemented using per-channel registers. Signed-off-by: Johan Hovold --- drivers/usb/serial/xr_serial.c | 55 +++--- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/drivers/usb

[PATCH 06/12] USB: serial: xr: add type abstraction

2021-04-12 Thread Johan Hovold
registers and that these will need to be handled specifically. Similarly, XR21V141X is the only type which has the divisor registers and that needs to use the format register when configuring the line settings. Signed-off-by: Johan Hovold --- drivers/usb/serial/xr_serial.c | 128

[PATCH 02/12] USB: serial: xr: rename GPIO-mode defines

2021-04-12 Thread Johan Hovold
Rename the GPIO mode defines so that they reflect the datasheet and how they are used. Signed-off-by: Johan Hovold --- drivers/usb/serial/xr_serial.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial

[PATCH 10/12] USB: serial: xr: reset FIFOs on open

2021-04-12 Thread Johan Hovold
Reset the transmit and receive FIFOs before enabling the UARTs as part of open() in order to flush any stale data. Note that the XR21V141X needs a type-specific implementation due to its UART Manager registers. Signed-off-by: Johan Hovold --- drivers/usb/serial/xr_serial.c | 51

[PATCH 09/12] USB: serial: xr: add support for XR22801, XR22802, XR22804

2021-04-12 Thread Johan Hovold
the device rather than interface, and 5 and 6-bit words are not supported. Signed-off-by: Johan Hovold --- drivers/usb/serial/xr_serial.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c index

[PATCH 11/12] USB: serial: xr: add copyright notice

2021-04-12 Thread Johan Hovold
Add another copyright notice for the work done in 2021. Signed-off-by: Johan Hovold --- drivers/usb/serial/xr_serial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c index 1b7b3c70a9b3..6853cd56d8dc 100644 --- a/drivers/usb

[PATCH 07/12] USB: serial: xr: add support for XR21B1421, XR21B1422 and XR21B1424

2021-04-12 Thread Johan Hovold
though it is otherwise supported. The UART enable sequence for XR21B142X does not involve explicitly enabling the FIFOs, but according to datasheet the UART must be disabled when writing any register but GPIO_SET, GPIO_CLEAR, TX_BREAK and ERROR_STATUS. Signed-off-by: Johan Hovold --- drivers/usb

[PATCH 12/12] USB: cdc-acm: add more Maxlinear/Exar models to ignore list

2021-04-12 Thread Johan Hovold
erial driver is enabled. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/5155887a764cbc11f8da0217fe08a24a77d120b4.1616571453.git.mchehab+hua...@kernel.org [ johan: rewrite commit message, clean up entries ] Cc: Oliver Neukum Signed-off-by: Johan Hovold --- drivers/usb/class

[PATCH 08/12] USB: serial: xr: add support for XR21B1411

2021-04-12 Thread Johan Hovold
except that most registers are offset by 0xc00 (corresponding to a channel index of 12 in the MSB of wIndex). As the device is single-port so that the derived channel index is 0, the current register accessors can be reused after simply changing the address width. Signed-off-by: Johan Hovold

Re: [PATCH 0/2] USB: serial: cp210x: provide gpio valid mask

2021-04-12 Thread Johan Hovold
On Fri, Apr 09, 2021 at 07:23:11PM +0300, Andy Shevchenko wrote: > On Fri, Apr 9, 2021 at 6:52 PM Johan Hovold wrote: > > > > Use the new GPIO valid-mask feature to inform gpiolib which pins are > > available for use instead of handling that in a request callback. > >

Re: [PATCH] USB: Add LPM quirk for Lenovo ThinkPad USB-C Dock Gen2 Ethernet

2021-04-12 Thread Johan Hovold
On Mon, Apr 12, 2021 at 08:37:52PM +0800, Kai-Heng Feng wrote: > This is another branded 8153 device that doesn't work well with LPM > enabled: > [ 400.597506] r8152 5-1.1:1.0 enx482ae3a2a6f0: Tx status -71 > > So disable LPM to resolve the issue. > BugLink: https://bugs.launchpad.net/bugs/1922651

Re: [PATCH v2] serial: stm32: optimize spin lock usage

2021-04-12 Thread Johan Hovold
On Mon, Apr 12, 2021 at 05:31:38PM +0800, dillon.min...@gmail.com wrote: > From: dillon min > > To avoid potential deadlock in spin_lock usage, use spin_lock_irqsave, > spin_trylock_irqsave(), spin_unlock_irqrestore() in process context. This doesn't make much sense as console_write can be calle

Re: [PATCH v2] USB: Add LPM quirk for Lenovo ThinkPad USB-C Dock Gen2 Ethernet

2021-04-12 Thread Johan Hovold
On Mon, Apr 12, 2021 at 09:05:20PM +0800, Kai-Heng Feng wrote: > This is another branded 8153 device that doesn't work well with LPM > enabled: > [ 400.597506] r8152 5-1.1:1.0 enx482ae3a2a6f0: Tx status -71 > > So disable LPM to resolve the issue. > > BugLink: https://bugs.launchpad.net/bugs/1922

[PATCH 3/8] tty: fix return value for unsupported termiox ioctls

2021-04-07 Thread Johan Hovold
nrecognised- ioctl handling. Fixes: 1d65b4a088de ("tty: Add termiox") Signed-off-by: Johan Hovold --- drivers/tty/tty_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index deffaefcf41d..420e7678330f 100644 --

[PATCH 0/8] tty: ioctl fixes and cleanups

2021-04-07 Thread Johan Hovold
This series fixes and cleans up a few (serial-) ioctl-related issues. Johan Johan Hovold (8): tty: actually undefine superseded ASYNC flags tty: fix return value for unsupported ioctls tty: fix return value for unsupported termiox ioctls tty: use pr_warn_ratelimited() for deprecated

[PATCH 1/8] tty: actually undefine superseded ASYNC flags

2021-04-07 Thread Johan Hovold
"tty: core: Undefine ASYNC_* flags superceded by TTY_PORT* flags") Signed-off-by: Johan Hovold --- include/uapi/linux/tty_flags.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/tty_flags.h b/include/uapi/linux/tty_flags.h index 900a32e63424..6a3ac

[PATCH 8/8] serial: core: return early on unsupported ioctls

2021-04-07 Thread Johan Hovold
. Fixes: a5f276f10ff7 ("serial_core: Handle TIOC[GS]RS485 ioctls.") Fixes: ad8c0eaa0a41 ("tty/serial_core: add ISO7816 infrastructure") Signed-off-by: Johan Hovold --- drivers/tty/serial/serial_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH 6/8] tty: add ASYNC_SPLIT_TERMIOS to deprecation mask

2021-04-07 Thread Johan Hovold
Callout devices are long-gone, but the ASYNC_SPLIT_TERMIOS flag was never added to the deprecation mask. Add it so that a warning is printed if it is ever used. Fixes: 8a8ae62f8296 ("tty: warn on deprecated serial flags") Signed-off-by: Johan Hovold --- include/uapi/linux/tty_f

[PATCH 5/8] tty: refactor TIOCSSERIAL handling

2021-04-07 Thread Johan Hovold
Factor out the deprecated serial flags handling and tty-operation check shared with the compat TIOCSSERIAL handler. Signed-off-by: Johan Hovold --- drivers/tty/tty_io.c | 33 - 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/drivers/tty/tty_io.c b

[PATCH 7/8] serial: core: drop redundant TIOCGSERIAL memset

2021-04-07 Thread Johan Hovold
Since commit 5099d234a52a ("serial_core: switch to ->[sg]et_serial()") the serial structure passed to uart_get_info() has already have been cleared by the tty layer so drop the redundant memset. Signed-off-by: Johan Hovold --- drivers/tty/serial/serial_core.c | 2 -- 1 file changed

[PATCH 4/8] tty: use pr_warn_ratelimited() for deprecated serial flags

2021-04-07 Thread Johan Hovold
Use pr_warn_ratelimited() when warning about deprecated serial flags instead of open coding. Signed-off-by: Johan Hovold --- drivers/tty/tty_io.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index

[PATCH 2/8] tty: fix return value for unsupported ioctls

2021-04-07 Thread Johan Hovold
erations. Note that the TIOCMGET and TIOCMSET helpers predate git and do not get a corresponding Fixes tag below. Fixes: d281da7ff6f7 ("tty: Make tiocgicount a handler") Signed-off-by: Johan Hovold --- drivers/tty/tty_io.c | 10 +- include/linux/tty_driver.h | 2 +- 2 fi

[PATCH 01/16] staging: fwserial: fix TIOCSSERIAL jiffies conversions

2021-04-07 Thread Johan Hovold
-over-Firewire serial driver") Cc: sta...@vger.kernel.org # 3.8 Signed-off-by: Johan Hovold --- drivers/staging/fwserial/fwserial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index c3

[PATCH 00/16] tty: TIOCSSERIAL fixes and clean ups

2021-04-07 Thread Johan Hovold
ASYNC_USR flags (and custom divisor) by returning -EPERM. These patches are against tty-next, but the staging ones could otherwise go through either tree. I'll be sending the corresponding USB fixes separately. Johan Johan Hovold (16): staging: fwserial: fix TIOCSSERIAL jiffies conver

[PATCH 05/16] staging: greybus: uart: fix TIOCSSERIAL jiffies conversions

2021-04-07 Thread Johan Hovold
;) Cc: sta...@vger.kernel.org # 4.9 Signed-off-by: Johan Hovold --- drivers/staging/greybus/uart.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index 607378bfebb7..29846dc1e1bf 100644 --- a/drive

[PATCH 02/16] staging: fwserial: fix TIOCSSERIAL permission check

2021-04-07 Thread Johan Hovold
Changing the port close-delay parameter is a privileged operation so make sure to return -EPERM if a regular user tries to change it. Fixes: 7355ba3445f2 ("staging: fwserial: Add TTY-over-Firewire serial driver") Cc: sta...@vger.kernel.org # 3.8 Signed-off-by: Johan Hovold --

[PATCH 09/16] tty: amiserial: add missing TIOCSSERIAL jiffies conversions

2021-04-07 Thread Johan Hovold
100. Signed-off-by: Johan Hovold --- drivers/tty/amiserial.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index ec6802ba2bf8..ca48ce5a0862 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty

[PATCH 08/16] tty: amiserial: fix TIOCSSERIAL permission check

2021-04-07 Thread Johan Hovold
Changing the port closing_wait parameter is a privileged operation. Add the missing check to TIOCSSERIAL so that -EPERM is returned in case an unprivileged user tries to change the closing-wait setting. Cc: sta...@vger.kernel.org Signed-off-by: Johan Hovold --- drivers/tty/amiserial.c | 1 + 1

[PATCH 07/16] staging: greybus: uart: clean up TIOCGSERIAL

2021-04-07 Thread Johan Hovold
erial drivers like ftdi_sio have been using PORT_UNKNOWN for twenty years without any problems. Drop the bogus values provided by the greybus implementation. Signed-off-by: Johan Hovold --- drivers/staging/greybus/uart.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/greybus/u

[PATCH 11/16] tty: moxa: fix TIOCSSERIAL permission check

2021-04-07 Thread Johan Hovold
Changing the port close delay or type are privileged operations so make sure to return -EPERM if a regular user tries to change them. Cc: sta...@vger.kernel.org Signed-off-by: Johan Hovold --- drivers/tty/moxa.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git

[PATCH 04/16] staging: fwserial: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
ire serial driver") Signed-off-by: Johan Hovold --- drivers/staging/fwserial/fwserial.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index 2888b80a2c1a..0f4655d7d520 100644 --- a/drivers/s

[PATCH 10/16] tty: moxa: fix TIOCSSERIAL jiffies conversions

2021-04-07 Thread Johan Hovold
The port close_delay parameter set by TIOCSSERIAL is specified in jiffies, while the value returned by TIOCGSERIAL is specified in centiseconds. Add the missing conversions so that TIOCGSERIAL works as expected also when HZ is not 100. Cc: sta...@vger.kernel.org Signed-off-by: Johan Hovold

[PATCH 12/16] tty: moxa: fix TIOCSSERIAL implementation

2021-04-07 Thread Johan Hovold
consistently. Signed-off-by: Johan Hovold --- drivers/tty/moxa.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 63e440d900ff..4d4f15b5cd29 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -2055,11 +2055,6 @@ static int moxa_set_serial_info

[PATCH 06/16] staging: greybus: uart: fix unprivileged TIOCCSERIAL

2021-04-07 Thread Johan Hovold
: e68453ed28c5 ("greybus: uart-gb: now builds, more framework added") Signed-off-by: Johan Hovold --- drivers/staging/greybus/uart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index 29846dc1e1bf..a520f7f213db 100644 ---

[PATCH 03/16] staging: fwserial: fix TIOCSSERIAL implementation

2021-04-07 Thread Johan Hovold
consistently. Fixes: 7355ba3445f2 ("staging: fwserial: Add TTY-over-Firewire serial driver") Signed-off-by: Johan Hovold --- drivers/staging/fwserial/fwserial.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwseri

[PATCH 13/16] tty: mxser: fix TIOCSSERIAL jiffies conversions

2021-04-07 Thread Johan Hovold
-by: Johan Hovold --- drivers/tty/mxser.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 4203b64bccdb..914b23071961 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -1208,19 +1208,26 @@ static

[PATCH 14/16] tty: mxser: fix TIOCSSERIAL permission check

2021-04-07 Thread Johan Hovold
Signed-off-by: Johan Hovold --- drivers/tty/mxser.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 914b23071961..2d8e76263a25 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -1270,6 +1270,7 @@ static int

[PATCH 15/16] pcmcia: synclink_cs: drop redundant tty-port initialisation

2021-04-07 Thread Johan Hovold
The port close_delay and closing_wait parameters have already been by tty_port_init() so drop the redundant driver initialisation to the default values. Signed-off-by: Johan Hovold --- drivers/char/pcmcia/synclink_cs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/char/pcmcia

[PATCH 16/16] tty: synclink_gt: drop redundant tty-port initialisation

2021-04-07 Thread Johan Hovold
The port close_delay and closing_wait parameters have already been by tty_port_init() so drop the redundant driver initialisation to the default values. Signed-off-by: Johan Hovold --- drivers/tty/synclink_gt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/synclink_gt.c b

[PATCH 1/3] Revert "USB: cdc-acm: fix rounding error in TIOCSSERIAL"

2021-04-07 Thread Johan Hovold
. Cc: Anthony Mallet Cc: sta...@vger.kernel.org Signed-off-by: Johan Hovold --- drivers/usb/class/cdc-acm.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 3fda1ec961d7..96e221803fa6 100644 --- a/drivers

[PATCH 3/3] USB: cdc-acm: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
users to run setserial with cdc-acm") Signed-off-by: Johan Hovold --- drivers/usb/class/cdc-acm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 43e31dad4831..b74713518b3a 100644 --- a/drivers/usb/class

[PATCH 2/3] USB: cdc-acm: fix unprivileged TIOCCSERIAL

2021-04-07 Thread Johan Hovold
: ba2d8ce9db0a ("cdc-acm: implement TIOCSSERIAL to avoid blocking close(2)") Signed-off-by: Johan Hovold --- drivers/usb/class/cdc-acm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 96e221803fa6..43e31dad4831 100644 --- a/d

[PATCH 0/3] USB: cdc-acm: TIOCSSERIAL fixes

2021-04-07 Thread Johan Hovold
This series fixes up a few issues with cdc-acm TIOCSSERIAL implementation. Johan Johan Hovold (3): Revert "USB: cdc-acm: fix rounding error in TIOCSSERIAL" USB: cdc-acm: fix unprivileged TIOCCSERIAL USB: cdc-acm: fix TIOCGSERIAL implementation drivers/usb/class/cdc-

[PATCH 00/24] USB: serial: TIOCSSERIAL fixes and generic support

2021-04-07 Thread Johan Hovold
serial drivers. Johan Johan Hovold (24): USB: serial: ark3116: fix TIOCGSERIAL implementation USB: serial: f81232: fix TIOCGSERIAL implementation USB: serial: f81534: fix TIOCGSERIAL implementation USB: serial: ftdi_sio: fix TIOCGSERIAL implementation USB: serial: io_edgeport: fix

[PATCH 07/24] USB: serial: mos7720: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
Fixes: 0f64478cbc7a ("USB: add USB serial mos7720 driver") Signed-off-by: Johan Hovold --- drivers/usb/serial/mos7720.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index bb3d39307d93..db90ce560d42 10064

[PATCH 01/24] USB: serial: ark3116: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
fault values actually used (0.5 and 30 seconds, respectively). Fixes: 2f430b4bbae7 ("USB: ark3116: Add TIOCGSERIAL and TIOCSSERIAL ioctl calls.") Signed-off-by: Johan Hovold --- drivers/usb/serial/ark3116.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dri

[PATCH 06/24] USB: serial: io_ti: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
left unset when it is not known. The close_delay and closing_wait parameters returned by TIOCGSERIAL are specified in centiseconds (not jiffies). The driver does not yet support changing close_delay, but let's report back the default value actually used (0.5 seconds). Signed-off-by: Johan H

[PATCH 05/24] USB: serial: io_edgeport: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
ff-by: Johan Hovold --- drivers/usb/serial/io_edgeport.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 68401adcffde..471a1a04c9c3 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/driver

[PATCH 02/24] USB: serial: f81232: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
) Signed-off-by: Johan Hovold --- drivers/usb/serial/f81232.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c index 6a8f39147d8e..af0fe2a82eb2 100644 --- a/drivers/usb/serial/f81232.c +++ b/drivers/usb/serial/f81

[PATCH 03/24] USB: serial: f81534: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
) Signed-off-by: Johan Hovold --- drivers/usb/serial/f81534.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c index a763b362f081..c9f90d437e3a 100644 --- a/drivers/usb/serial/f81534.c +++ b/drivers/usb/serial/f815

[PATCH 10/24] USB: serial: pl2303: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
fault values actually used (0.5 and 30 seconds, respectively). Signed-off-by: Johan Hovold --- drivers/usb/serial/pl2303.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index eed9acd1ae08..0455add8593a 100644

[PATCH 04/24] USB: serial: ftdi_sio: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
conds, respectively). Signed-off-by: Johan Hovold --- drivers/usb/serial/ftdi_sio.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index c867592477c9..f8a0911f90ea 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/s

[PATCH 09/24] USB: serial: opticon: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
specified in centiseconds (not jiffies). The driver does not yet support changing these, but let's report back the default values actually used (0.5 and 30 seconds, respectively). Fixes: faac64ad9c7b ("USB: serial: opticon: add serial line ioctls") Signed-off-by: Johan Hovold --- dri

[PATCH 08/24] USB: serial: mos7840: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
Fixes: 3f5429746d91 ("USB: Moschip 7840 USB-Serial Driver") Signed-off-by: Johan Hovold --- drivers/usb/serial/mos7840.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 1bf0d066f55a..77cbe18a16

[PATCH 14/24] USB: serial: ti_usb_3410_5052: fix TIOCSSERIAL permission check

2021-04-07 Thread Johan Hovold
Changing the port closing-wait parameter is a privileged operation so make sure to return -EPERM if a regular user tries to change it. Cc: sta...@vger.kernel.org Signed-off-by: Johan Hovold --- drivers/usb/serial/ti_usb_3410_5052.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions

[PATCH 13/24] USB: serial: ti_usb_3410_5052: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
not yet support changing close_delay, but let's report back the default value actually used (0.5 seconds). Signed-off-by: Johan Hovold --- drivers/usb/serial/ti_usb_3410_5052.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/dr

[PATCH 12/24] USB: serial: ssu100: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
specified in centiseconds (not jiffies). The driver does not yet support changing these, but let's report back the default values actually used (0.5 and 30 seconds, respectively). Fixes: 52af95459939 ("USB: add USB serial ssu100 driver") Signed-off-by: Johan Hovold --- drivers/usb/seri

[PATCH 18/24] USB: serial: whiteheat: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
driver does not yet support changing these, but let's report back the default values actually used (0.5 and 30 seconds, respectively). Signed-off-by: Johan Hovold --- drivers/usb/serial/whiteheat.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/s

[PATCH 15/24] USB: serial: usb_wwan: fix TIOCSSERIAL jiffies conversions

2021-04-07 Thread Johan Hovold
avoid blocking close(2)") Cc: sta...@vger.kernel.org # 2.6.38 Signed-off-by: Johan Hovold --- drivers/usb/serial/usb_wwan.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 46d46a4f99c9..4e9c994a9

[PATCH 16/24] USB: serial: usb_wwan: fix unprivileged TIOCCSERIAL

2021-04-07 Thread Johan Hovold
: 02303f73373a ("usb-wwan: implement TIOCGSERIAL and TIOCSSERIAL to avoid blocking close(2)") Signed-off-by: Johan Hovold --- drivers/usb/serial/usb_wwan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 4e9c994a972a..e7

[PATCH 11/24] USB: serial: quatech2: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
specified in centiseconds (not jiffies). The driver does not yet support changing these, but let's report back the default values actually used (0.5 and 30 seconds, respectively). Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver") Signed-off-by: Johan Hovold --- dri

[PATCH 17/24] USB: serial: usb_wwan: fix TIOCGSERIAL implementation

2021-04-07 Thread Johan Hovold
, respectively. Fixes: 02303f73373a ("usb-wwan: implement TIOCGSERIAL and TIOCSSERIAL to avoid blocking close(2)") Signed-off-by: Johan Hovold --- drivers/usb/serial/usb_wwan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_ww

[PATCH 22/24] USB: serial: ftdi_sio: ignore baud_base changes

2021-04-07 Thread Johan Hovold
consistency. Signed-off-by: Johan Hovold --- drivers/usb/serial/ftdi_sio.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 16d3e50487e6..3fd7875200b9 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c

[PATCH 23/24] USB: serial: ftdi_sio: simplify TIOCGSERIAL permission check

2021-04-07 Thread Johan Hovold
for ASYNC flags so there's no need to try to retain any other bits when updating the flags. Signed-off-by: Johan Hovold --- drivers/usb/serial/ftdi_sio.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_

[PATCH 24/24] USB: serial: ftdi_sio: clean up TIOCSSERIAL

2021-04-07 Thread Johan Hovold
The TIOCSSERIAL implementation needs to compare the old flag and divisor settings with the new to detect ASYNC_SPD changes, but there's no need to copy all driver state to the stack for that. While at it, unbreak the function parameter list. Signed-off-by: Johan Hovold --- drivers/usb/s

[PATCH 20/24] USB: serial: add generic support for TIOCSSERIAL

2021-04-07 Thread Johan Hovold
interface; an interface which only the FTDI driver actually implements. Some drivers have also been reporting back a fake UART type, something which should no longer be needed and will be dropped by a follow-on patch. Signed-off-by: Johan Hovold --- drivers/usb/serial/ark3116.c | 9

[PATCH 21/24] USB: serial: stop reporting legacy UART types

2021-04-07 Thread Johan Hovold
In the unlikely event that this do cause problems, this should be fixed tree-wide anyway (e.g. for all USB serial drivers and also CDC-ACM). Signed-off-by: Johan Hovold --- drivers/usb/serial/ark3116.c | 7 --- drivers/usb/serial/f81232.c | 1 - drivers/usb/serial/f81534.c

[PATCH 19/24] USB: serial: fix return value for unsupported ioctls

2021-04-07 Thread Johan Hovold
ponding methods. Note that the TIOCMGET and TIOCMSET helpers predate git and do not get a corresponding Fixes tag below. Fixes: d281da7ff6f7 ("tty: Make tiocgicount a handler") Signed-off-by: Johan Hovold --- drivers/usb/serial/usb-serial.c | 6 +++--- 1 file changed, 3 insertions(+), 3 d

[PATCH 2/4] USB: serial: io_ti: switch to 30-second closing wait

2021-04-07 Thread Johan Hovold
Switch to using the system-wide default 30-second closing-wait timeout instead of the driver specific 40-second timeout. The timeout can be changed per port using TIOCSSERIAL (setserial) if needed. Signed-off-by: Johan Hovold --- drivers/usb/serial/io_ti.c | 3 --- 1 file changed, 3 deletions

[PATCH 1/4] USB: serial: io_ti: drop closing_wait module parameter

2021-04-07 Thread Johan Hovold
Now that all USB serial drivers supports setting the closing_wait parameter through TIOCSSERIAL (setserial) it's time to drop the corresponding io_ti module parameter. Signed-off-by: Johan Hovold --- drivers/usb/serial/io_ti.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-)

[PATCH 3/4] USB: serial: ti_usb_3410_5052: drop closing_wait module parameter

2021-04-07 Thread Johan Hovold
The ti_usb_3410_5052 has supported changing the closing_wait parameter through TIOCSSERIAL (setserial) for about a decade and commit f1175daa5312 ("USB: ti_usb_3410_5052: kill custom closing_wait"). It's time to drop the corresponding driver-specific module parameter. Signed-off-b

[PATCH 4/4] USB: serial: ti_usb_3410_5052: switch to 30-second closing wait

2021-04-07 Thread Johan Hovold
Switch to using the system-wide default 30-second closing-wait timeout instead of the driver specific 40-second timeout. The timeout can be changed per port using TIOCSSERIAL (setserial) if needed. Signed-off-by: Johan Hovold --- drivers/usb/serial/ti_usb_3410_5052.c | 3 --- 1 file changed, 3

[PATCH 0/4] USB: serial: closing-wait cleanups

2021-04-07 Thread Johan Hovold
Now that all USB serial drivers supports changing the closing_wait parameter through TIOCSSERIAL (setserial), we can remove the related driver-specific module parameters and settings. These depend on the recently posted TIOCSSERIAL series. Johan Johan Hovold (4): USB: serial: io_ti: drop

[PATCH net-next] net: wan: z85230: drop unused async state

2021-04-07 Thread Johan Hovold
According to the changelog, asynchronous mode was dropped sometime before v2.2. Let's get rid of the unused driver-specific async state as well so that it doesn't show up when doing tree-wide tty work. Signed-off-by: Johan Hovold --- drivers/net/wan/z85

Re: [PATCH 1/3] Revert "USB: cdc-acm: fix rounding error in TIOCSSERIAL"

2021-04-07 Thread Johan Hovold
On Wed, Apr 07, 2021 at 01:04:31PM +0200, Anthony Mallet wrote: > On Wednesday 7 Apr 2021, at 12:28, Johan Hovold wrote: > > With HZ=250, the default 0.5 second value of close_delay is converted to > > 125 jiffies when set and is converted back to 50 centiseconds by > > TI

Re: [PATCH 3/4] USB: serial: add support for multi-interface functions

2021-04-01 Thread Johan Hovold
On Wed, Mar 31, 2021 at 01:21:15PM +0200, Oliver Neukum wrote: > Am Mittwoch, den 31.03.2021, 09:08 +0200 schrieb Oliver Neukum: > > Am Dienstag, den 30.03.2021, 17:22 +0200 schrieb Johan Hovold: > > > On Tue, Mar 30, 2021 at 04:44:32PM +0200, Oliver Neukum wrote: > &

Re: [PATCH] USB: serial: iuu_phoenix: remove redundant variable 'error'

2021-04-01 Thread Johan Hovold
On Sat, Mar 27, 2021 at 11:27:44PM +, Colin King wrote: > From: Colin Ian King > > The variable error is initialized to 0 and is set to 1 this > value is never read as it is on an immediate return path. The > only read of error is to check it is 0 and this check is always > true at that point

Re: [PATCH 0/4] USB: serial: add support for multi-interface functions

2021-04-01 Thread Johan Hovold
On Tue, Mar 30, 2021 at 04:50:02PM +0200, Greg Kroah-Hartman wrote: > On Tue, Mar 30, 2021 at 04:38:16PM +0200, Johan Hovold wrote: > > A single USB function can be implemented using a group of interfaces and > > this is for example commonly used for Communication Class devices. &g

Re: [PATCHv2] gnss: motmdm: Add support for Motorola Mapphone MDM6600 modem

2021-04-01 Thread Johan Hovold
On Sun, Feb 28, 2021 at 09:46:01PM +0100, Pavel Machek wrote: > Hi! > > > Motorola is using a custom TS 27.010 based multiplexer protocol > > for various devices on the modem. These devices can be accessed on > > dedicated channels using Linux kernel serdev-ngsm driver. > > > > For the GNSS on th

Re: [PATCH 3/6] dt-bindings: serdev: ngsm: Add binding for GNSS child node

2021-04-01 Thread Johan Hovold
On Fri, Mar 05, 2021 at 11:46:35AM +0100, Pavel Machek wrote: > Hi! > > > > > For motorola modem case, we may have a GNSS device on channel 4. > > > > Let's add that to the binding and example. > > > > > > > > Signed-off-by: Tony Lindgren > > > > --- > > > > .../devicetree/bindings/serdev/serde

Re: [PATCH v9] USB: serial: cp210x: Add support for GPIOs on CP2108

2021-04-19 Thread Johan Hovold
7;t add any value. You left out a few changes here. You changed how the altfunctions were detected and fixed the gpio_init error handling. Please include all relevant changes in your changelogs. > 03/12/2021: Patch v4 used git send-mail instead of send patch by manual > follow the instructions of Jo

Re: threadirqs deadlocks

2021-03-17 Thread Johan Hovold
On Wed, Mar 17, 2021 at 02:24:04PM +0100, Thomas Gleixner wrote: > On Tue, Mar 16 2021 at 11:56, Johan Hovold wrote: > > It seems to me that forced interrupt threading cannot generally work > > without updating drivers that expose locks that can be taken by other > > in

<    4   5   6   7   8   9   10   11   12   13   >