From patchwork Fri Sep 20 05:54:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ronak Jain X-Patchwork-Id: 13808142 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30E31CF58D1 for ; Fri, 20 Sep 2024 05:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=nlXS9fviuLiUQ9FZhH6T8KRixKRvCOYtkcKZEZ1IlDk=; b=WWTUidzluMOMJYZkPE79qsmFvi fUCuynKIMp/8ytT8aap3PfW3WuOuZsQ1ShiqJBUuKOLOdjxPdrkyP0EF036cXKdPtjyRSBAy9C9cS vU5q64egM7WFvRWz3y1sT0PkeQ8BWu71htG5l/vHbzs1du7aRLJwvrRurXd4QenVtulFw+H41adzn aUvimjA7pg1n9Et/IxtoX+4eoY/FAZZ17PFf8JheQXGgBWpnJ9VG6y6fQ82p0TN6z99MXTWdq17mw GKfMI35kCm5U9kQ32sSiPs8zlvmhzP9HYFkUMamYZt5y+/xZ+VpX7whsbxDXA6vWF6/9gn6+kxhfR QxfK9Tvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srWcD-0000000BVVT-1Fcy; Fri, 20 Sep 2024 05:55:37 +0000 Received: from mail-bn8nam12on2062f.outbound.protection.outlook.com ([2a01:111:f403:2418::62f] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1srWb5-0000000BVOu-1E6W for linux-arm-kernel@lists.infradead.org; Fri, 20 Sep 2024 05:54:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IS9lemMaaFdZD+JSyENk5et5ks3dH6FXYPDO0KBFz1E7TilwI/l0GgZKfZ5qGKHunk4nbwnLU4mJIc05g1/pvMBbUmG3jFvKhWn3CYnbJW02p2BFoOyD7SunE4cPGUfb5A3seXldyFQ+3/FBrogriuOFDfbD+VEGX7oxCpAQV0WNzLe7jd3jaLtb2CkqQs8xea9KwaXop0TnLq1q5rgeZvZxfMpEWe+s3QrTv26hRDl1FX99zGPcqviYPCn3Z4asHMAaL5HX03QjdatdYtfuFzblcdLm295hHKqeVhT+N7/k3BO+o2dE9LpEIuOmP3FPwfKqdSnz1mYl0z6FbYEBqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nlXS9fviuLiUQ9FZhH6T8KRixKRvCOYtkcKZEZ1IlDk=; b=WcNLmTf0LY1z893Hrm8c3Ybn8pOrmNEcytnfPqRMsmwwxCkO1TXwZf4Vo0PlBZ/NhBiykP8Cg3IoGy2z2HM58BVATSWqMyhOZv4JI4PEPZzFh9xOVLvgDgwqRBnKGEtIqdNJe+HoVOYZidmrTXu4fkn12q8crHFJvktZX1EgbNZ2sn+4tjcT3HtQgYQC6Wg9mj+DGLUkXCNbcks/822KLBK9dYGR0/dLHu5aJn1LKIJ76M3ex9aa23+96Tn67K5tdjQai4M+gu5+H/sICRNqGE4lM/jvpdIv6ctFKiUWnPZr31ogm7yNL4sQTw7vZhBTomvl+1ykTLIhvJgNWT/9dQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nlXS9fviuLiUQ9FZhH6T8KRixKRvCOYtkcKZEZ1IlDk=; b=1GDsyHZb8KdLGlHpx5Aal/3Z2EEhU0WBBfi6uXx8RR2ahGzZhPpKkykbfDM00LIr1ebOj/j6js19nYcMigbsImqV1hPiV8r0J/z/bud4XBMmu52RtGEK6q0t2tVyxSORaFHdGc1s4pkRce6a1wAORRaExVROovDFfWRAxsW/K4E= Received: from PH7P220CA0164.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:33b::7) by SJ2PR12MB8781.namprd12.prod.outlook.com (2603:10b6:a03:4d0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.22; Fri, 20 Sep 2024 05:54:12 +0000 Received: from MWH0EPF000A6734.namprd04.prod.outlook.com (2603:10b6:510:33b:cafe::12) by PH7P220CA0164.outlook.office365.com (2603:10b6:510:33b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.26 via Frontend Transport; Fri, 20 Sep 2024 05:54:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000A6734.mail.protection.outlook.com (10.167.249.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Fri, 20 Sep 2024 05:54:11 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 20 Sep 2024 00:54:10 -0500 Received: from xsjwillw50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Fri, 20 Sep 2024 00:54:10 -0500 From: Ronak Jain To: CC: , Subject: [PATCH] firmware: xilinx: add a warning print for unsupported feature Date: Thu, 19 Sep 2024 22:54:10 -0700 Message-ID: <20240920055410.2658465-1-ronak.jain@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: ronak.jain@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A6734:EE_|SJ2PR12MB8781:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f02f858-4114-4991-61ca-08dcd938a6b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: FgE751C2yDp0z+D7sNfiLxDNqh7bk7vWz93g3AOqhwaqv+Cr5PqCE3++syavkNFHyFD2gRmol/bq3MzNlo4WdikQJbSvAseSytrrf77Ssv7h7VnKdTn9hbouU2qSjqgrWjI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3pM0h3GJ1YYvwuvMGO5DD3mIGPWA9DKxf6P6zVx6wimla9sCfMy0Z1PkOZo3f3JJXd5yTraKYB9P1gUJg8WvbVmesSJsieDEfg4BkyDkNjipxx7FrXtzwBcsWLc0OJ3swcDUNxZ5jLSEAgmZYayiDh+VGy1b67hh4W++8ecr827WhOvNpecTEuHrBeGi+79BXeLvmRRcolXsKkbayGuuOYAakvzx28wPmyJu1j8NbindIWK5MEoiNe+9ixI6LtYVZ X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2024 05:54:11.6178 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f02f858-4114-4991-61ca-08dcd938a6b0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000A6734.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8781 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240919_225427_338993_4F1450AB X-CRM114-Status: GOOD ( 19.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As per the current code base, feature check API is used to check the version in zynqmp_pm_pinctrl_set_config() before requesting the firmware, and if the expected version is not found then it will return an error. So now when the latest kernel tries to access the tri-state functionality with older firmware, observe failure prints during booting. The failure prints, [ 1.204850] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 37 param 2 value 0 [ 2.699455] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 44 param 2 value 0 [ 2.708424] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 46 param 2 value 0 [ 2.717387] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 48 param 2 value 0 Now, these error prints mislead the user whether it is an actual failure or the feature itself is not there in the firmware. So, just to avoid confusion around this, add some debug prints before returning an error code. With that, it is easier to know whether it is an actual failure or the feature is unsupported. Signed-off-by: Ronak Jain --- drivers/firmware/xilinx/zynqmp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 0b2ad46c8bce..cdb565c41119 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -1245,8 +1245,11 @@ int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, if (pm_family_code == ZYNQMP_FAMILY_CODE && param == PM_PINCTRL_CONFIG_TRI_STATE) { ret = zynqmp_pm_feature(PM_PINCTRL_CONFIG_PARAM_SET); - if (ret < PM_PINCTRL_PARAM_SET_VERSION) + if (ret < PM_PINCTRL_PARAM_SET_VERSION) { + pr_warn("The requested pinctrl feature is not supported in the current firmware.\n" + "Expected firmware version is 2023.1 and above for this feature to work.\r\n"); return -EOPNOTSUPP; + } } return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, NULL, 3, pin, param, value);