Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2483275pxj; Mon, 10 May 2021 04:11:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya59fTlpsNKnn7YGFh11EHyZlchmxifMH6LQjxhTa34LknTpMautbqFkQDhsHU58Ij0OzM X-Received: by 2002:a17:906:6801:: with SMTP id k1mr24637757ejr.137.1620645072794; Mon, 10 May 2021 04:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645072; cv=none; d=google.com; s=arc-20160816; b=q/FA/OF9+i6CfqnQ0LxscwoAFap3tpuEzalvoxcGb7Af5z2U1zn2+1gtFHRHc9ML8w U0g/3MAJAC3jAKlwUcSHcZgEJ3JugspF6QOk7MRD9dC2S1HqHCM/7R4MgTgd9ok2Nt/Q bGAbePfaan3Cmza+YXnDhnRDMcTMsdZZGkvyiiyPRAxgGBEscaPs6CpLq97lJ7A61jqB dvH0QiKSK7NNKmErdl8jtkOGTYnD+QAovTbo0YvTBiC58Nn+kRiXq8uhzbxWE7sUUVfN OlyWvojjAUQx7W8CZevNBnPTo2eoOo0dBd7mEohIl3UT84OOfWuW89t/fRQCwCjJlWfa L16Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nqy4nsKCtj0uEjHW/n0ZpEmTnlR+p/4O6J4lBttJv4s=; b=BVtsRQuc5hE6b1xObw1Ljox9uZWYNp63PwIGCXyFC9gFZyI6wxwqz5Lnw4/6o+njFo ij/BBBgAvaPKYWepPhKmwqX4fXrBxXFThUZw4hgePSvnWIGK4Obn9IfxAyRlN7p2OUpn 9hHJb1zvtSqxTKW9bmt7tNovu2tbwmZP5FJBSzjKwx/k9SI0jeSUpZljbgVQbSnebCdc 81W1ZM+wiT1rj5VxkPYhJThOT9vAggwbXm9nJccj8SUIEnI+11LbP1JUsXqhVkJVUYx/ k2S6F6eexbaG/ySrwjslL6T/XURzPOX2TjQW5fYqgnNm8++1tUEQ82qGBHBimrFRQnhQ lnBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T53ug5qV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n24si12779931eds.571.2021.05.10.04.10.47; Mon, 10 May 2021 04:11:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T53ug5qV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236169AbhEJLHk (ORCPT + 99 others); Mon, 10 May 2021 07:07:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:59362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232764AbhEJKrM (ORCPT ); Mon, 10 May 2021 06:47:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E352B619AC; Mon, 10 May 2021 10:37:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643038; bh=c1XL8kzC2yP2Nq+PsuvD7ah+97YXIbGx7cHbBa2zjqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T53ug5qVB1xA/0zfQsj3jmShXjaOTxD74E8eNF9CrHrLWBk4XkKlcTdI3rgGk36G8 DKYVFAYQukDuW9gahojDIh6ZqliT4E98R6m8Y4ZMSl+HBymunyjTgUcEO6hcwL6mRG aUYrh9ijpO5Wwu48VoNKNLZryGk3x7KUQTFeGSno= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bough Chen , Alice Guo , Peng Fan , Ulf Hansson , Sasha Levin Subject: [PATCH 5.10 151/299] mmc: sdhci-esdhc-imx: validate pinctrl before use it Date: Mon, 10 May 2021 12:19:08 +0200 Message-Id: <20210510102009.943657449@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Fan [ 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 Reviewed-by: Alice Guo Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/1614222604-27066-6-git-send-email-peng.fan@oss.nxp.com Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/sdhci-esdhc-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.30.2