public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [stble-kernel][5.15.y][5.10.y][PATCH v2] serial: sc16is7xx: the reg needs to shift in regmap_noinc
@ 2024-12-10 11:31 Hui Wang
  2024-12-10 12:15 ` Greg KH
  2024-12-10 19:25 ` Sasha Levin
  0 siblings, 2 replies; 4+ messages in thread
From: Hui Wang @ 2024-12-10 11:31 UTC (permalink / raw)
  To: stable, patches, gregkh, sashal; +Cc: hvilleneuve, hui.wang

Recently we found the fifo_read() and fifo_write() are broken in our
5.15 and 5.4 kernels after cherry-pick the commit e635f652696e
("serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions
for FIFO"), that is because the reg needs to shift if we don't
cherry-pick a prerequisite commit 3837a0379533 ("serial: sc16is7xx:
improve regmap debugfs by using one regmap per port").

It is hard to backport the prerequisite commit to 5.15.y and 5.10.y
due to the significant conflict. To be safe, here fix it by shifting
the reg as regmap_volatile() does.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
in the V2:
 add Cc:
 fix a typo on prerequisite
 add explanation for not backporting the prerequisite patch to 5.15.y and 5.10.y

 drivers/tty/serial/sc16is7xx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index d274a847c6ab..87e34099f369 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -487,7 +487,14 @@ static bool sc16is7xx_regmap_precious(struct device *dev, unsigned int reg)
 
 static bool sc16is7xx_regmap_noinc(struct device *dev, unsigned int reg)
 {
-	return reg == SC16IS7XX_RHR_REG;
+	switch (reg >> SC16IS7XX_REG_SHIFT) {
+	case SC16IS7XX_RHR_REG:
+		return true;
+	default:
+		break;
+	}
+
+	return false;
 }
 
 /*
-- 
2.34.1


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

* Re: [stble-kernel][5.15.y][5.10.y][PATCH v2] serial: sc16is7xx: the reg needs to shift in regmap_noinc
  2024-12-10 11:31 [stble-kernel][5.15.y][5.10.y][PATCH v2] serial: sc16is7xx: the reg needs to shift in regmap_noinc Hui Wang
@ 2024-12-10 12:15 ` Greg KH
  2024-12-10 12:51   ` Hui Wang
  2024-12-10 19:25 ` Sasha Levin
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2024-12-10 12:15 UTC (permalink / raw)
  To: Hui Wang; +Cc: stable, patches, sashal, hvilleneuve

On Tue, Dec 10, 2024 at 07:31:26PM +0800, Hui Wang wrote:
> Recently we found the fifo_read() and fifo_write() are broken in our
> 5.15 and 5.4 kernels after cherry-pick the commit e635f652696e
> ("serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions
> for FIFO"), that is because the reg needs to shift if we don't
> cherry-pick a prerequisite commit 3837a0379533 ("serial: sc16is7xx:
> improve regmap debugfs by using one regmap per port").
> 
> It is hard to backport the prerequisite commit to 5.15.y and 5.10.y
> due to the significant conflict. To be safe, here fix it by shifting
> the reg as regmap_volatile() does.

Please try, submit the series of upstream commits first and then if it's
too rough, we can evaluate it later.  As-is, I can't take this, sorry.

greg k-h

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

* Re: [stble-kernel][5.15.y][5.10.y][PATCH v2] serial: sc16is7xx: the reg needs to shift in regmap_noinc
  2024-12-10 12:15 ` Greg KH
@ 2024-12-10 12:51   ` Hui Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Hui Wang @ 2024-12-10 12:51 UTC (permalink / raw)
  To: Greg KH; +Cc: stable, patches, sashal, hvilleneuve


On 12/10/24 20:15, Greg KH wrote:
> On Tue, Dec 10, 2024 at 07:31:26PM +0800, Hui Wang wrote:
>> Recently we found the fifo_read() and fifo_write() are broken in our
>> 5.15 and 5.4 kernels after cherry-pick the commit e635f652696e
>> ("serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions
>> for FIFO"), that is because the reg needs to shift if we don't
>> cherry-pick a prerequisite commit 3837a0379533 ("serial: sc16is7xx:
>> improve regmap debugfs by using one regmap per port").
>>
>> It is hard to backport the prerequisite commit to 5.15.y and 5.10.y
>> due to the significant conflict. To be safe, here fix it by shifting
>> the reg as regmap_volatile() does.
> Please try, submit the series of upstream commits first and then if it's
> too rough, we can evaluate it later.  As-is, I can't take this, sorry.
OK, got it, I will have a try.
> greg k-h

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

* Re: [stble-kernel][5.15.y][5.10.y][PATCH v2] serial: sc16is7xx: the reg needs to shift in regmap_noinc
  2024-12-10 11:31 [stble-kernel][5.15.y][5.10.y][PATCH v2] serial: sc16is7xx: the reg needs to shift in regmap_noinc Hui Wang
  2024-12-10 12:15 ` Greg KH
@ 2024-12-10 19:25 ` Sasha Levin
  1 sibling, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2024-12-10 19:25 UTC (permalink / raw)
  To: stable; +Cc: Hui Wang, Sasha Levin

[ Sasha's backport helper bot ]

Hi,

No upstream commit was identified. Using temporary commit for testing.

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.15.y       |  Success    |  Success   |
| stable/linux-5.10.y       |  Success    |  Success   |

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

end of thread, other threads:[~2024-12-10 19:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-10 11:31 [stble-kernel][5.15.y][5.10.y][PATCH v2] serial: sc16is7xx: the reg needs to shift in regmap_noinc Hui Wang
2024-12-10 12:15 ` Greg KH
2024-12-10 12:51   ` Hui Wang
2024-12-10 19:25 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox