Patch "mmc: sdhci-esdhc-imx: validate pinctrl before use it" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mmc: sdhci-esdhc-imx: validate pinctrl before use it

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mmc-sdhci-esdhc-imx-validate-pinctrl-before-use-it.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1ace56ddddd7fedc89e1cfac42ab7221665729c9
Author: Peng Fan <peng.fan@xxxxxxx>
Date:   Thu Feb 25 11:10:04 2021 +0800

    mmc: sdhci-esdhc-imx: validate pinctrl before use it
    
    [ Upstream commit f410ee0aa2df050a9505f5c261953e9b18e21206 ]
    
    When imx_data->pinctrl is not a valid pointer, pinctrl_lookup_state
    will trigger kernel panic.
    
    When we boot Dual OS on Jailhouse hypervisor, we let the 1st Linux to
    configure pinmux ready for the 2nd OS, so the 2nd OS not have pinctrl
    settings.
    
    Similar to this commit b62eee9f804e ("mmc: sdhci-esdhc-imx: no fail when no pinctrl available").
    
    Reviewed-by: Bough Chen <haobo.chen@xxxxxxx>
    Reviewed-by: Alice Guo <alice.guo@xxxxxxx>
    Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
    Link: https://lore.kernel.org/r/1614222604-27066-6-git-send-email-peng.fan@xxxxxxxxxxx
    Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 5d9b3106d2f7..d28809e47962 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1504,7 +1504,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
 
 	mmc_of_parse_voltage(np, &host->ocr_mask);
 
-	if (esdhc_is_usdhc(imx_data)) {
+	if (esdhc_is_usdhc(imx_data) && !IS_ERR(imx_data->pinctrl)) {
 		imx_data->pins_100mhz = pinctrl_lookup_state(imx_data->pinctrl,
 						ESDHC_PINCTRL_STATE_100MHZ);
 		imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux