From: Sasha Levin Date: Fri, 7 Feb 2020 02:08:04 +0000 (-0500) Subject: fixes for 4.19 X-Git-Tag: v4.19.103~110 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f659450de83485d57444e57c8fef352a368d2398;p=thirdparty%2Fkernel%2Fstable-queue.git fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/mmc-sdhci-of-at91-fix-memleak-on-clk_get-failure.patch b/queue-4.19/mmc-sdhci-of-at91-fix-memleak-on-clk_get-failure.patch new file mode 100644 index 00000000000..e57c02624c8 --- /dev/null +++ b/queue-4.19/mmc-sdhci-of-at91-fix-memleak-on-clk_get-failure.patch @@ -0,0 +1,60 @@ +From ea56b8f5a8babd7b717bb419e3b11e39aaa9b8ae Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 2 Jan 2020 11:42:16 +0100 +Subject: mmc: sdhci-of-at91: fix memleak on clk_get failure +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Michał Mirosław + +[ Upstream commit a04184ce777b46e92c2b3c93c6dcb2754cb005e1 ] + +sdhci_alloc_host() does its work not using managed infrastructure, so +needs explicit free on error path. Add it where needed. + +Cc: +Fixes: bb5f8ea4d514 ("mmc: sdhci-of-at91: introduce driver for the Atmel SDMMC") +Signed-off-by: Michał Mirosław +Acked-by: Ludovic Desroches +Acked-by: Adrian Hunter +Link: https://lore.kernel.org/r/b2a44d5be2e06ff075f32477e466598bb0f07b36.1577961679.git.mirq-linux@rere.qmqm.pl +Signed-off-by: Ulf Hansson +Signed-off-by: Sasha Levin +--- + drivers/mmc/host/sdhci-of-at91.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c +index 1ebcf0eb781ea..04e88d4796fa9 100644 +--- a/drivers/mmc/host/sdhci-of-at91.c ++++ b/drivers/mmc/host/sdhci-of-at91.c +@@ -332,19 +332,22 @@ static int sdhci_at91_probe(struct platform_device *pdev) + priv->mainck = devm_clk_get(&pdev->dev, "baseclk"); + if (IS_ERR(priv->mainck)) { + dev_err(&pdev->dev, "failed to get baseclk\n"); +- return PTR_ERR(priv->mainck); ++ ret = PTR_ERR(priv->mainck); ++ goto sdhci_pltfm_free; + } + + priv->hclock = devm_clk_get(&pdev->dev, "hclock"); + if (IS_ERR(priv->hclock)) { + dev_err(&pdev->dev, "failed to get hclock\n"); +- return PTR_ERR(priv->hclock); ++ ret = PTR_ERR(priv->hclock); ++ goto sdhci_pltfm_free; + } + + priv->gck = devm_clk_get(&pdev->dev, "multclk"); + if (IS_ERR(priv->gck)) { + dev_err(&pdev->dev, "failed to get multclk\n"); +- return PTR_ERR(priv->gck); ++ ret = PTR_ERR(priv->gck); ++ goto sdhci_pltfm_free; + } + + ret = sdhci_at91_set_clks_presets(&pdev->dev); +-- +2.20.1 + diff --git a/queue-4.19/pci-keystone-fix-link-training-retries-initiation.patch b/queue-4.19/pci-keystone-fix-link-training-retries-initiation.patch new file mode 100644 index 00000000000..a1260b55eb6 --- /dev/null +++ b/queue-4.19/pci-keystone-fix-link-training-retries-initiation.patch @@ -0,0 +1,40 @@ +From 6b1398a0d73bc2fbb3ed441919341acc960cfc14 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 17 Dec 2019 14:38:36 +0300 +Subject: PCI: keystone: Fix link training retries initiation + +From: Yurii Monakov + +[ Upstream commit 6df19872d881641e6394f93ef2938cffcbdae5bb ] + +ks_pcie_stop_link() function does not clear LTSSM_EN_VAL bit so +link training was not triggered more than once after startup. +In configurations where link can be unstable during early boot, +for example, under low temperature, it will never be established. + +Fixes: 0c4ffcfe1fbc ("PCI: keystone: Add TI Keystone PCIe driver") +Signed-off-by: Yurii Monakov +Signed-off-by: Lorenzo Pieralisi +Acked-by: Andrew Murray +Cc: stable@vger.kernel.org +Signed-off-by: Sasha Levin +--- + drivers/pci/controller/dwc/pci-keystone-dw.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/pci/controller/dwc/pci-keystone-dw.c b/drivers/pci/controller/dwc/pci-keystone-dw.c +index 0682213328e93..15c612e853afb 100644 +--- a/drivers/pci/controller/dwc/pci-keystone-dw.c ++++ b/drivers/pci/controller/dwc/pci-keystone-dw.c +@@ -425,7 +425,7 @@ void ks_dw_pcie_initiate_link_train(struct keystone_pcie *ks_pcie) + /* Disable Link training */ + val = ks_dw_app_readl(ks_pcie, CMD_STATUS); + val &= ~LTSSM_EN_VAL; +- ks_dw_app_writel(ks_pcie, CMD_STATUS, LTSSM_EN_VAL | val); ++ ks_dw_app_writel(ks_pcie, CMD_STATUS, val); + + /* Initiate Link Training */ + val = ks_dw_app_readl(ks_pcie, CMD_STATUS); +-- +2.20.1 + diff --git a/queue-4.19/series b/queue-4.19/series index 563929ba921..e05c8e806ac 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -66,3 +66,5 @@ ubifs-don-t-trigger-assertion-on-invalid-no-key-filename.patch ubifs-fix-fs_ioc_setflags-unexpectedly-clearing-encrypt-flag.patch ubifs-fix-deadlock-in-concurrent-bulk-read-and-writepage.patch crypto-geode-aes-convert-to-skcipher-api-and-make-thread-safe.patch +pci-keystone-fix-link-training-retries-initiation.patch +mmc-sdhci-of-at91-fix-memleak-on-clk_get-failure.patch