FAILED: patch "[PATCH] serial: sc16is7xx: declare MCR and IER as volatile registers" failed to apply to 6.1-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 1c41d09dcd07ee9648e20aa8238e404c2e6a12fb
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 1c41d09dcd07ee9648e20aa8238e404c2e6a12fb Mon Sep 17 00:00:00 2001
From: Hugo Villeneuve <[email protected]>
Date: Tue, 6 Oct 2026 15:25:37 -0400
Subject: [PATCH] serial: sc16is7xx: declare MCR and IER as volatile registers
MCR register has the same address as XON1 register. IER register has the same address as DLH register.
Which register is accessed depends on bits configuration in some other registers.
To prevent potential access errors, declare MCR and IER as volatile registers.
--- drivers/tty/serial/sc16is7xx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/tty/serial/sc16is7xx.c +2 -0
@@ -501,7 +501,9 @@ static bool sc16is7xx_regmap_volatile(struct device *dev, unsigned int reg) {switch (reg) {case SC16IS7XX_RHR_REG :/* Shared address space with THR & DLL */ +case SC16IS7XX_IER_REG :/* Shared address space with DLH */ case SC16IS7XX_IIR_REG :/* Shared address space with FCR & EFR */ +case SC16IS7XX_MCR_REG :/* Shared address space with XON1 */ case SC16IS7XX_LSR_REG :/* Shared address space with XON2 */ case SC16IS7XX_MSR_REG :/* Shared address space with TCR & XOFF1 */ case SC16IS7XX_SPR_REG :/* Shared address space with TLR & XOFF2 */
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/3 serial: sc16is7xx: declare SPR/TLR/XOFF2 register as volatile
From: Hugo Villeneuve <[email protected]>
[ Upstream commit 983f91e5f13149ade6dbd9568053ecd0ab5e9265 ]
SPR shares the same address space as TLR and XOFF2. If SPR or TLR were to be used eventually, this could lead to incorrect read value from the cache.
Prevent this potential bug by declaring SPR/TLR/XOFF2 as volatile.
Stable-dep-of: 1c41d09dcd07 ("serial: sc16is7xx: declare MCR and IER as volatile registers")
--- drivers/tty/serial/sc16is7xx.c | 1 + 1 file changed, 1 insertion(+)
drivers/tty/serial/sc16is7xx.c +1 -0
@@ -534,6 +534,7 @@ static bool sc16is7xx_regmap_volatile(struct device *dev, unsigned int reg)case SC16IS7XX_IIR_REG :case SC16IS7XX_LSR_REG :case SC16IS7XX_MSR_REG : +case SC16IS7XX_SPR_REG :/* Shared address space with TLR & XOFF2 */ case SC16IS7XX_TXLVL_REG :case SC16IS7XX_RXLVL_REG :case SC16IS7XX_IOSTATE_REG :
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/3 serial: sc16is7xx: add comments for lock requirements
From: Hugo Villeneuve <[email protected]>
[ Upstream commit 42405cb77fd35b5acc0e5a11d74eef68c2afa484 ]
Indicate why lock needs to be asserted when accessing
MSR register, as this is not immediately obvious when looking at this register in the device datasheet.
Stable-dep-of: 1c41d09dcd07 ("serial: sc16is7xx: declare MCR and IER as volatile registers")
--- drivers/tty/serial/sc16is7xx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/tty/serial/sc16is7xx.c +5 -4
@@ -530,10 +530,10 @@ static const struct sc16is7xx_devtype sc16is762_devtype = {static bool sc16is7xx_regmap_volatile (struct device *dev,unsigned int reg) {switch (reg) { -case SC16IS7XX_RHR_REG : -case SC16IS7XX_IIR_REG : -case SC16IS7XX_LSR_REG : -case SC16IS7XX_MSR_REG : +case SC16IS7XX_RHR_REG :/* Shared address space with THR & DLL */ +case SC16IS7XX_IIR_REG :/* Shared address space with FCR & EFR */ +case SC16IS7XX_LSR_REG :/* Shared address space with XON2 */ +case SC16IS7XX_MSR_REG :/* Shared address space with TCR & XOFF1 */ case SC16IS7XX_SPR_REG :/* Shared address space with TLR & XOFF2 */ case SC16IS7XX_TXLVL_REG :case SC16IS7XX_RXLVL_REG :
@@ -768,6 +768,7 @@ static void sc16is7xx_update_mlines(struct sc16is7xx_one *one)unsigned long flags;unsigned int status, changed; +/* Lock required as MSR address is shared with TCR and XOFF1. */ lockdep_assert_held_once (&one->lock); status =sc16is7xx_get_hwmctrl (port);
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 3/3 serial: sc16is7xx: declare MCR and IER as volatile registers
In reply to Sasha LevinFrom: Hugo Villeneuve <[email protected]>
[ Upstream commit 1c41d09dcd07ee9648e20aa8238e404c2e6a12fb ]
MCR register has the same address as XON1 register. IER register has the same address as DLH register.
Which register is accessed depends on bits configuration in some other registers.
To prevent potential access errors, declare MCR and IER as volatile registers.
--- drivers/tty/serial/sc16is7xx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/tty/serial/sc16is7xx.c +2 -0
@@ -531,7 +531,9 @@ static bool sc16is7xx_regmap_volatile(struct device *dev, unsigned int reg) {switch (reg) {case SC16IS7XX_RHR_REG :/* Shared address space with THR & DLL */ +case SC16IS7XX_IER_REG :/* Shared address space with DLH */ case SC16IS7XX_IIR_REG :/* Shared address space with FCR & EFR */ +case SC16IS7XX_MCR_REG :/* Shared address space with XON1 */ case SC16IS7XX_LSR_REG :/* Shared address space with XON2 */ case SC16IS7XX_MSR_REG :/* Shared address space with TCR & XOFF1 */ case SC16IS7XX_SPR_REG :/* Shared address space with TLR & XOFF2 */
Signature · 1 line
2.53.0