From patchwork Thu Aug 18 10:18:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Billy Tsai X-Patchwork-Id: 12947497 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 DF3AFC00140 for ; Thu, 18 Aug 2022 17:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jbXp/YGd0AqMIwNg5wRa4UIDg9sSSoBJmBjNiNolT2E=; b=iztCz9SuYIadYM z1hs0zW9rOwNOgJoglohwN96NmBXtVNK8gDT0/t0YNtVZ8StGaGMFtm5ph2QVW6WMwNv65A41MYxv yUtrTk7sBplVYAZpmCcZ0klHwSoWtyJDo77KyfHa+FlHgJWOcfYMzFfbgcor93fu36ybrKx6ELv3V UOuBqDDOS1uq6yTEkRumGfpGED0n6YCPnK0kHuZnT+Rgh0Bj4x+VFU11NOn8saOiSYVH0KJXAIHnL nKZtmwhS7wMbFUD2nivjNVNdNfS/ktWCS5iuwGbnrUQnQzpEREiEJaGIrJ+z7zQ7e+KTLuivDc36u OFQrCGK9W+gOnm5l/ezg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOiqs-007L7K-3U; Thu, 18 Aug 2022 16:58:38 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOigJ-007Eyt-4k for linux-arm-kernel@bombadil.infradead.org; Thu, 18 Aug 2022 16:47:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:In-Reply-To:References; bh=++bantH9fYIZl5CdKYOINBUjZCs0P/BNlvlQU/4q2N4=; b=IIbYsA6iTHuCJ7ID4FB+ORxf9P +CtrLBzwbR8uFGp5XU139ptpBIoiSKQG/Xor/jhPtVN6+zkBb7H6K2EZ819fB5JT1MSdg3/tw0i2S I8Db6gadktgyANtI3THf91R6onVRob2HAtcA/3kvEXwOrHYXxpMpVVHkosETCwG9fJeiqm2c4aCXm KtEk3UhCfLlOpMhrTX9jV0vmNJ6zh0ReOIVKEw+tMiqtDCGF+4uHRlTR9cEDBCp+n0imYL+KV9kVk gLswQDpDqzbmf1L/RPxWO9/mDrWaD2h0A6KrAcTeepHCkh+5gbDG8BsBtXlHihcU4aSquwJNuGCeC IkCEDzTA==; Received: from twspam01.aspeedtech.com ([211.20.114.71]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOcbt-003YSz-QM for linux-arm-kernel@lists.infradead.org; Thu, 18 Aug 2022 10:18:48 +0000 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 27I9xIau030186; Thu, 18 Aug 2022 17:59:19 +0800 (GMT-8) (envelope-from billy_tsai@aspeedtech.com) Received: from BillyTsai-pc.aspeed.com (192.168.2.149) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 18 Aug 2022 18:18:11 +0800 From: Billy Tsai To: , , , , , , , Subject: [PATCH] pinctrl: aspeed: Force to disable the function's signal Date: Thu, 18 Aug 2022 18:18:39 +0800 Message-ID: <20220818101839.28860-1-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [192.168.2.149] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 27I9xIau030186 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220818_111846_529453_9418B005 X-CRM114-Status: GOOD ( 10.28 ) 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 When the driver want to disable the signal of the function, it doesn't need to query the state of the mux function's signal on a pin. The condition below will miss the disable of the signal: Ball | Default | P0 Signal | P0 Expression | Other -----+---------+-----------+-----------------------------+---------- E21 GPIOG0 SD2CLK SCU4B4[16]=1 & SCU450[1]=1 GPIOG0 -----+---------+-----------+-----------------------------+---------- B22 GPIOG1 SD2CMD SCU4B4[17]=1 & SCU450[1]=1 GPIOG1 -----+---------+-----------+-----------------------------+---------- Assume the register status like below: SCU4B4[16] == 1 & SCU4B4[17] == 1 & SCU450[1]==1 After the driver set the Ball E21 to the GPIOG0: SCU4B4[16] == 0 & SCU4B4[17] == 1 & SCU450[1]==0 When the driver want to set the Ball B22 to the GPIOG1, the condition of the SD2CMD will be false causing SCU4B4[17] not to be cleared. Signed-off-by: Billy Tsai Acked-by: Andrew Jeffery --- drivers/pinctrl/aspeed/pinctrl-aspeed.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.c b/drivers/pinctrl/aspeed/pinctrl-aspeed.c index 83d47ff1cea8..a30912a92f05 100644 --- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c +++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c @@ -92,19 +92,10 @@ static int aspeed_sig_expr_enable(struct aspeed_pinmux_data *ctx, static int aspeed_sig_expr_disable(struct aspeed_pinmux_data *ctx, const struct aspeed_sig_expr *expr) { - int ret; - pr_debug("Disabling signal %s for %s\n", expr->signal, expr->function); - ret = aspeed_sig_expr_eval(ctx, expr, true); - if (ret < 0) - return ret; - - if (ret) - return aspeed_sig_expr_set(ctx, expr, false); - - return 0; + return aspeed_sig_expr_set(ctx, expr, false); } /**