From patchwork Fri Jan 15 03:24:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 363524 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp1049532jap; Thu, 14 Jan 2021 18:56:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwS1aLW9toNd2TyTAtl3QDOHnIV+CoAb3FcJaWgmw1EP3J/seOswcSJYXYv1/J/Br0q4Qa7 X-Received: by 2002:a17:906:c00c:: with SMTP id e12mr7152329ejz.103.1610679410261; Thu, 14 Jan 2021 18:56:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1610679410; cv=pass; d=google.com; s=arc-20160816; b=LCZTJUfZn8I+tO93yqYiZo8rxbngqiKrvjCYz4+dRtOHxd39DTe3hFkisyhTnxGouA AT5Mce7QsT1E8U4Y6oFNz6VP5y6j9Uy+7s69BU4wfImMGIHSrUQEUf8X/BBqAAnDtxbo Zrw2Yp8rTtEzbr4l9JmiGE2zMU59nyhedsDHJX3iWFoB2SAB4WF0V/dnG25pTQ49ZF42 nr3oCAHXjiSuGiD/m7If++mmNKmqoNSSVlYlQoMJ6YpiIi7keYeFdu4pZZ43DKKUfX85 VLZRaTW+TMgPZJ+Wc7cxBfdyHB71OYyhJjF9EWPcU1OrI9uGOSSSIovBRGko/ammXOkt z20w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=oDw0tsx8K+Btrx73PfUj0hSlKS3l8KQdV8eUXMyigKI=; b=zuvgA/Vn2m+FCUMmfxzizIm/3Dsjn8RGmWkMj/Pc0wubzC4HxhfoaCkjrGH2N5SGT8 S8/Er5YrXnYj0BcbblHnGU/a7nDj/jqY/ShID5BKMQqTr3/M1Z+1rt3chkBf8ePhUdmY F2U/3UU+oDIUPOuRF6Y+3azJ82uJv2miprSgY05z9DOLEFsbgn0lJWY6JAkX8C/FuIGO ZeyAqF6dLu1NHKSOgHPt/F7ROSRKsQroMastWmcyO9jdzL1uO2usgsMKgXTbrYRyPPUC wIZnl6GQULMaRxBNjwisboLAuhiAOMukTZfmANROJV22EfTmd7wcca2VU2uA1GMxeGKn HoLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=bXg0ev2G; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga14si1015817ejb.267.2021.01.14.18.56.49; Thu, 14 Jan 2021 18:56:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-mmc-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=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=bXg0ev2G; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727196AbhAOCz4 (ORCPT + 3 others); Thu, 14 Jan 2021 21:55:56 -0500 Received: from mail-eopbgr00077.outbound.protection.outlook.com ([40.107.0.77]:38531 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726894AbhAOCz4 (ORCPT ); Thu, 14 Jan 2021 21:55:56 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lJ4jwtM0X28sB6CQqUKEE6jOoXRWPgteQF/4MxhDmbX9tlVWQFHQwiQUFV3ZKABzVow5aHq81T53zbg+iCDfloEFw/Ix+T4gJsa2WiMdRcFIwB3wDmidYPkpuN/HR3TZ+CKPIvLxsT17OfB3Jw3+UBU3q+XDP8uuW4BGWgUQ7lmPyVXtxqsTEAHQnmjzrakBuLv7UwGrEbh7fETDYXcqGTFeOC9SatITJ7JEiTTzl/qepVnqs6UTS0xrPAP35Wwm3fgKrpN4qiKWSDbHzju9el6pDGBCySSKwUAXETiXReVR4KxkieV3X48ap1d+YpzqIbQHA2T8lyZaJo0jDT/VPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oDw0tsx8K+Btrx73PfUj0hSlKS3l8KQdV8eUXMyigKI=; b=FkhX26JFt8lt0WYewLiwowzBVhem7K7vRrowlS2vLsTjzdqz0kL8oXvUAzTug5Bi/it3qGKsSdCQAP9g2doVRm74y201e7CVMtrC6ZP+ZOXbHlhjbhAGF62IOqrgYN5DcrCLlrziXeiuydsVUVgh+wg72BQUcRhbuUKAA3gAYokpSRlnw5yLmIrqVhd2axec7wi1yAY+sPsEL9LhdOLVyW16JmS9Aawde6bev+N/78pSYhRPJ+MCjo/tGtB4a0RHTFtxRxOSJs4qeTyQlBxvFYBqzW+1swmV90aF+qdWpkOK+2Owx2vc97GywWyl9r0E+5ky11BG+nPVMdlneqjLpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oDw0tsx8K+Btrx73PfUj0hSlKS3l8KQdV8eUXMyigKI=; b=bXg0ev2GLQVQHTf5uBsfAUuKnHkMKiI2Nak1XPjplRF46HZiRzEoZyFKYaF32aaVHELgevmfHGpU6VZxnQo7SfnTfP42OMCsTBh+xP5XHUxB5j8f2buggnTzENfX6I8QwneqbracnG7ctpWXKOSJCNCUWnbJR5QynXQJQ/oIxY8= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none; intel.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR04MB3013.eurprd04.prod.outlook.com (2603:10a6:6:4::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.12; Fri, 15 Jan 2021 02:55:07 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3742.012; Fri, 15 Jan 2021 02:55:07 +0000 From: "Peng Fan (OSS)" To: adrian.hunter@intel.com, ulf.hansson@linaro.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan , Bough Chen , Alice Guo Subject: [PATCH] mmc: sdhci-esdhc-imx: validate pinctrl before use it Date: Fri, 15 Jan 2021 11:24:23 +0800 Message-Id: <20210115032423.15108-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.28.0 X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR03CA0085.apcprd03.prod.outlook.com (2603:1096:4:7c::13) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR03CA0085.apcprd03.prod.outlook.com (2603:1096:4:7c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.6 via Frontend Transport; Fri, 15 Jan 2021 02:55:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8b393ace-f25a-4346-bfa6-08d8b900f6cb X-MS-TrafficTypeDiagnostic: DB6PR04MB3013: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:546; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1d6yKk5wyRpcW4OFb923+M02fPNrgt+TnJgsQ94OqsRFMfQnIbUBK3Kqk+e0SpYgc50pGmiQQeavMGbhTv8GzdOmCZkNC+gSGXLOeb1hfzgnIqJF8/+tjmBAtmVcsHcOVj64dt5ZQA5y5ZxtwZVC/0Pg+4R+SlacJ/1Sx8qtngOF/JI6xLkgzqhKgEp82ZoqOREMJWiZeWKUdHjtwTw9RG7gHZk7VmrGGE0Vlwe5dK1DHxQjFBrKy+FeqpBeerLk/+xGNKcK3Oq+xXuBvtJMMQJdahha8zN01xEfYPIBKNsuBtytzIiPl9LxlKYq/Key6JElhQCtn7nBl84qJPY1icMLDWuM7Ab9WSZbHB75zcSuh8Nm02buYBJ9xulBpc2cuMQOZzH8PadyDt3mS7hTVw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(366004)(376002)(396003)(346002)(136003)(186003)(8676002)(16526019)(6512007)(6486002)(4326008)(1076003)(66946007)(86362001)(66476007)(6666004)(8936002)(2906002)(83380400001)(66556008)(956004)(2616005)(478600001)(6506007)(26005)(5660300002)(54906003)(52116002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wOOVPwhZFHypLGLU6Y/pMzI51mb0eIchZUXXw2qpnDd/HSTkGzmLrpnVhGqFOIxgPkBOP8bFl/L7Xb/ydA+tfhayC+0rvW/dtqNC4HjiL1mnK8pzGYHvISHGb8FslK6fIDffchuV7P43aaHozY2EZALL6ZPc343hpekLQMlMP5LH86pMw4qgxVZhZ/dkA+Lg5VmhSZogENPOU0s1k5BIJVKBx4F3KBCDajCSPK66DH1jdd0hRlUmApBUUoTlOrGQGRLy8dIqhupgjSxsuqgoSWl5xUVzrfIQeNUWwkOcGdmDhj0QBumGPuX4+dA3ju01di6kPfq3DFu47ZF99mgm3ltzlIKtqtSGs+JR8Tjh4rpeGe5iD2GUn/flcrHr8Te3hVzpsFWIdYrIA52Ht+TiV2b/2/xyJqUl72rtxl042TW3OETkd69+3CULTgqV0GABmsiX74PL7Gvv7gRSAMhwPwPQWMArj8fqeMHExpWdxroQRR+080vJ5fnF3LDbZ7K5poiNFQk3MLaJzdaZEjnx57FhXM/zBDPe+wXNBiVKEKA6KfFQXUsaCj6z9QMKnhn356XjDdhcQix39QC437LKV96FWSFeHP+UuzM0FNa5v9bDyZyqz8d5vDrCsWOBJlBfUSUwRFnW7jTa1cCgIsxBXd9C42DdQ41zlZBo3qPzYXecg5XJa7x0XvEfMExbBBWFV2GaDFrI6BbiW42+T+sOD+2Ej2db7WcsDC1cBsvZYUFOXQddCyE4fIq9cvVl85wxP6hwPNASNX3TcLb5QFJSSw+Y9R5IQmzM/kQxQyLbI9RLB/WuammwKoSV2QNZRaqeHIhJCnJ3YdLQwxZF5T+Biy6o3mI4N7WlXuFd8fuOOfwmUQSV/WFr1Zmr19BbnZwIlp1svVLv/PsxiCFwpQh3dk548y65jo6iePXIDH5nVASkl5jN1RSJ9byoLrEwdgoubzJXv1z1Rd/LrmzPX9ojsOEUw//+OrXrq7at4gl6R80JwjeoRCi5wpxIhvGWv9DP X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b393ace-f25a-4346-bfa6-08d8b900f6cb X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2021 02:55:06.9489 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Mt/hC7gcY+mXfewx0W3QPn2bAZNZ2RlU/S54y371EYLR3uyE0ySSwZgGfkntCyDsd3Jhhul1cafTPia+oE8vGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR04MB3013 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Peng Fan 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 --- drivers/mmc/host/sdhci-esdhc-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.28.0 diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 16ed19f47939..11d3a2244b36 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1488,7 +1488,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,