From patchwork Thu Feb 24 16:10:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 12758839 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 E4657C433EF for ; Thu, 24 Feb 2022 16:12:21 +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: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=64rXUC71azpUxvVrZda3WZVBavgAjt1E8zcASQo8HfI=; b=usRdEteD8okriY anFPv/hu3IE3sdDRKgYxa9NJxgePFtw0kMtKhnq7jD8xhjMoW+bEwzE1C0oOQY54y6lCRNgYufBCV /KIKsFWCFu197rmUbkwlxbnCGu6/evjIw6+soEhBORUhNTHlHbG7ZnjOr/z8jnzCH9ysM/HG+u2lS KTIRtF7BVXO4AF01+igW/KNpVtbme7alaoqs+nk0kRblNDj0BRMcM2sYpNGHhP685pYJ2W4csU1mT d+ZC4yleOc00LStOnUD0E4HQKD8zFpD97xzl1sck2EZHH/8mprtxzoHBJzJIyLYn3XBKcmQWHF1+t zDL8S0b6n1ZURFCG02lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNGhf-001UVX-NI; Thu, 24 Feb 2022 16:10:52 +0000 Received: from ssl.serverraum.org ([2a01:4f8:151:8464::1:2]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNGhT-001URr-RF for linux-arm-kernel@lists.infradead.org; Thu, 24 Feb 2022 16:10:45 +0000 Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 4DA5022236; Thu, 24 Feb 2022 17:10:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1645719037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3AVbMEK1Kj2Wq9B+4ntgjAAH5iOrMVQj74iBl24oPtw=; b=ITei4q9+8nn/DYKLqakBypCqB2YpmgMFhVkxmsND14t8x2SN3jXGfW0/oVaGBvbnwN+dX3 vwOanXjcD2um8NA8npBeore3XYI+pRrYa/vfRZ1hqYI/NKnX18vbOoWJOP/xTsCQF+Rdf7 ZsNKPmPLk2WuLgaho/Vlt601Xapzg8k= From: Michael Walle To: Lars Povlsen , Steen Hegelund , Linus Walleij Cc: UNGLinuxDriver@microchip.com, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Colin Foster , Michael Walle Subject: [PATCH v1 0/5] pinctrl: microchip-sgpio: locking and synchronous output Date: Thu, 24 Feb 2022 17:10:16 +0100 Message-Id: <20220224161021.2197263-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220224_081040_086573_CFD71083 X-CRM114-Status: GOOD ( 10.53 ) 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 There are boards which use the output of the SGPIO to drive I2C muxers. SGPIO right now is broken in a way that when the software sets this bit there is a rather large delay until that value ends up on the hardware pin. While digging into this, I've noticed that there is no locking at all in this driver. Add locking for all RWM accesses. Please note, that parts of the modification of the first patch are removed again in a later patch. This is because the first patch is intended to be backported to the stable trees. Michael Walle (5): pinctrl: microchip-sgpio: lock RMW access pinctrl: microchip-sgpio: don't do RMW for interrupt ack register pinctrl: microchip-sgpio: use regmap_update_bits() pinctrl: microchip-sgpio: return error in spgio_output_set() pinctrl: microchip-sgpio: wait until output is actually set drivers/pinctrl/pinctrl-microchip-sgpio.c | 101 ++++++++++++++++++---- 1 file changed, 86 insertions(+), 15 deletions(-)