From: Greg Kroah-Hartman Date: Mon, 13 Jun 2022 07:31:26 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.9.318~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d18fdbb0eb68a4599f766a50015c272e2a4d80e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: ata-libata-transport-fix-dma-pio-xfer-_mode-sysfs-files.patch mmc-block-fix-cqe-recovery-reset-success.patch net-phy-dp83867-retrigger-sgmii-an-when-link-change.patch --- diff --git a/queue-5.10/ata-libata-transport-fix-dma-pio-xfer-_mode-sysfs-files.patch b/queue-5.10/ata-libata-transport-fix-dma-pio-xfer-_mode-sysfs-files.patch new file mode 100644 index 00000000000..57b7f0c7165 --- /dev/null +++ b/queue-5.10/ata-libata-transport-fix-dma-pio-xfer-_mode-sysfs-files.patch @@ -0,0 +1,74 @@ +From 72aad489f992871e908ff6d9055b26c6366fb864 Mon Sep 17 00:00:00 2001 +From: Sergey Shtylyov +Date: Wed, 8 Jun 2022 22:51:07 +0300 +Subject: ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files + +From: Sergey Shtylyov + +commit 72aad489f992871e908ff6d9055b26c6366fb864 upstream. + +The {dma|pio}_mode sysfs files are incorrectly documented as having a +list of the supported DMA/PIO transfer modes, while the corresponding +fields of the *struct* ata_device hold the transfer mode IDs, not masks. + +To match these docs, the {dma|pio}_mode (and even xfer_mode!) sysfs +files are handled by the ata_bitfield_name_match() macro which leads to +reading such kind of nonsense from them: + +$ cat /sys/class/ata_device/dev3.0/pio_mode +XFER_UDMA_7, XFER_UDMA_6, XFER_UDMA_5, XFER_UDMA_4, XFER_MW_DMA_4, +XFER_PIO_6, XFER_PIO_5, XFER_PIO_4, XFER_PIO_3, XFER_PIO_2, XFER_PIO_1, +XFER_PIO_0 + +Using the correct ata_bitfield_name_search() macro fixes that: + +$ cat /sys/class/ata_device/dev3.0/pio_mode +XFER_PIO_4 + +While fixing the file documentation, somewhat reword the {dma|pio}_mode +file doc and add a note about being mostly useful for PATA devices to +the xfer_mode file doc... + +Fixes: d9027470b886 ("[libata] Add ATA transport class") +Signed-off-by: Sergey Shtylyov +Cc: stable@vger.kernel.org +Signed-off-by: Damien Le Moal +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/ABI/testing/sysfs-ata | 11 ++++++----- + drivers/ata/libata-transport.c | 2 +- + 2 files changed, 7 insertions(+), 6 deletions(-) + +--- a/Documentation/ABI/testing/sysfs-ata ++++ b/Documentation/ABI/testing/sysfs-ata +@@ -107,13 +107,14 @@ Description: + described in ATA8 7.16 and 7.17. Only valid if + the device is not a PM. + +- pio_mode: (RO) Transfer modes supported by the device when +- in PIO mode. Mostly used by PATA device. ++ pio_mode: (RO) PIO transfer mode used by the device. ++ Mostly used by PATA devices. + +- xfer_mode: (RO) Current transfer mode ++ xfer_mode: (RO) Current transfer mode. Mostly used by ++ PATA devices. + +- dma_mode: (RO) Transfer modes supported by the device when +- in DMA mode. Mostly used by PATA device. ++ dma_mode: (RO) DMA transfer mode used by the device. ++ Mostly used by PATA devices. + + class: (RO) Device class. Can be "ata" for disk, + "atapi" for packet device, "pmp" for PM, or +--- a/drivers/ata/libata-transport.c ++++ b/drivers/ata/libata-transport.c +@@ -196,7 +196,7 @@ static struct { + { XFER_PIO_0, "XFER_PIO_0" }, + { XFER_PIO_SLOW, "XFER_PIO_SLOW" } + }; +-ata_bitfield_name_match(xfer,ata_xfer_names) ++ata_bitfield_name_search(xfer, ata_xfer_names) + + /* + * ATA Port attributes diff --git a/queue-5.10/mmc-block-fix-cqe-recovery-reset-success.patch b/queue-5.10/mmc-block-fix-cqe-recovery-reset-success.patch new file mode 100644 index 00000000000..5c1cc49d2bc --- /dev/null +++ b/queue-5.10/mmc-block-fix-cqe-recovery-reset-success.patch @@ -0,0 +1,41 @@ +From a051246b786af7e4a9d9219cc7038a6e8a411531 Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Tue, 31 May 2022 20:19:22 +0300 +Subject: mmc: block: Fix CQE recovery reset success + +From: Adrian Hunter + +commit a051246b786af7e4a9d9219cc7038a6e8a411531 upstream. + +The intention of the use of mmc_blk_reset_success() in +mmc_blk_cqe_recovery() was to prevent repeated resets when retrying and +getting the same error. However, that may not be the case - any amount +of time and I/O may pass before another recovery is needed, in which +case there would be no reason to deny it the opportunity to recover via +a reset if necessary. CQE recovery is expected seldom and failure to +recover (if the clear tasks command fails), even more seldom, so it is +better to allow the reset always, which can be done by calling +mmc_blk_reset_success() always. + +Fixes: 1e8e55b67030c6 ("mmc: block: Add CQE support") +Cc: stable@vger.kernel.org +Signed-off-by: Adrian Hunter +Link: https://lore.kernel.org/r/20220531171922.76080-1-adrian.hunter@intel.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/core/block.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/mmc/core/block.c ++++ b/drivers/mmc/core/block.c +@@ -1442,8 +1442,7 @@ void mmc_blk_cqe_recovery(struct mmc_que + err = mmc_cqe_recovery(host); + if (err) + mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY); +- else +- mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY); ++ mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY); + + pr_debug("%s: CQE recovery done\n", mmc_hostname(host)); + } diff --git a/queue-5.10/net-phy-dp83867-retrigger-sgmii-an-when-link-change.patch b/queue-5.10/net-phy-dp83867-retrigger-sgmii-an-when-link-change.patch new file mode 100644 index 00000000000..14261b4d0c0 --- /dev/null +++ b/queue-5.10/net-phy-dp83867-retrigger-sgmii-an-when-link-change.patch @@ -0,0 +1,89 @@ +From c76acfb7e19dcc3a0964e0563770b1d11b8d4540 Mon Sep 17 00:00:00 2001 +From: Tan Tee Min +Date: Thu, 26 May 2022 17:03:47 +0800 +Subject: net: phy: dp83867: retrigger SGMII AN when link change + +From: Tan Tee Min + +commit c76acfb7e19dcc3a0964e0563770b1d11b8d4540 upstream. + +There is a limitation in TI DP83867 PHY device where SGMII AN is only +triggered once after the device is booted up. Even after the PHY TPI is +down and up again, SGMII AN is not triggered and hence no new in-band +message from PHY to MAC side SGMII. + +This could cause an issue during power up, when PHY is up prior to MAC. +At this condition, once MAC side SGMII is up, MAC side SGMII wouldn`t +receive new in-band message from TI PHY with correct link status, speed +and duplex info. + +As suggested by TI, implemented a SW solution here to retrigger SGMII +Auto-Neg whenever there is a link change. + +v2: Add Fixes tag in commit message. + +Fixes: 2a10154abcb7 ("net: phy: dp83867: Add TI dp83867 phy") +Cc: # 5.4.x +Signed-off-by: Sit, Michael Wei Hong +Reviewed-by: Voon Weifeng +Signed-off-by: Tan Tee Min +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/20220526090347.128742-1-tee.min.tan@linux.intel.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/phy/dp83867.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +--- a/drivers/net/phy/dp83867.c ++++ b/drivers/net/phy/dp83867.c +@@ -137,6 +137,7 @@ + #define DP83867_DOWNSHIFT_2_COUNT 2 + #define DP83867_DOWNSHIFT_4_COUNT 4 + #define DP83867_DOWNSHIFT_8_COUNT 8 ++#define DP83867_SGMII_AUTONEG_EN BIT(7) + + /* CFG3 bits */ + #define DP83867_CFG3_INT_OE BIT(7) +@@ -802,6 +803,32 @@ static int dp83867_phy_reset(struct phy_ + DP83867_PHYCR_FORCE_LINK_GOOD, 0); + } + ++static void dp83867_link_change_notify(struct phy_device *phydev) ++{ ++ /* There is a limitation in DP83867 PHY device where SGMII AN is ++ * only triggered once after the device is booted up. Even after the ++ * PHY TPI is down and up again, SGMII AN is not triggered and ++ * hence no new in-band message from PHY to MAC side SGMII. ++ * This could cause an issue during power up, when PHY is up prior ++ * to MAC. At this condition, once MAC side SGMII is up, MAC side ++ * SGMII wouldn`t receive new in-band message from TI PHY with ++ * correct link status, speed and duplex info. ++ * Thus, implemented a SW solution here to retrigger SGMII Auto-Neg ++ * whenever there is a link change. ++ */ ++ if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { ++ int val = 0; ++ ++ val = phy_clear_bits(phydev, DP83867_CFG2, ++ DP83867_SGMII_AUTONEG_EN); ++ if (val < 0) ++ return; ++ ++ phy_set_bits(phydev, DP83867_CFG2, ++ DP83867_SGMII_AUTONEG_EN); ++ } ++} ++ + static struct phy_driver dp83867_driver[] = { + { + .phy_id = DP83867_PHY_ID, +@@ -826,6 +853,8 @@ static struct phy_driver dp83867_driver[ + + .suspend = genphy_suspend, + .resume = genphy_resume, ++ ++ .link_change_notify = dp83867_link_change_notify, + }, + }; + module_phy_driver(dp83867_driver); diff --git a/queue-5.10/series b/queue-5.10/series index 58c47dc1565..edb93e3ac70 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -153,3 +153,6 @@ alsa-hda-conexant-fix-loopback-issue-with-cx20632.patch alsa-hda-realtek-fix-for-quirk-to-enable-speaker-output-on-the-lenovo-yoga-duetitl-2021.patch cifs-return-errors-during-session-setup-during-reconnects.patch cifs-fix-reconnect-on-smb3-mount-types.patch +ata-libata-transport-fix-dma-pio-xfer-_mode-sysfs-files.patch +mmc-block-fix-cqe-recovery-reset-success.patch +net-phy-dp83867-retrigger-sgmii-an-when-link-change.patch