Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1354498pxm; Sat, 26 Feb 2022 12:45:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwth51n8ZqRkzadlVQT0aWKpIdtMGA6RdYoMBUkQwOS6gfl6OGyb82/h6hFV9uaqxW708xd X-Received: by 2002:a17:90a:e28e:b0:1bc:ce44:c9de with SMTP id d14-20020a17090ae28e00b001bcce44c9demr9347904pjz.0.1645908350232; Sat, 26 Feb 2022 12:45:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645908350; cv=none; d=google.com; s=arc-20160816; b=K82owzG4/yekioRbuDM7hlraDTk7J+I+HLaKmKuI/lznlRRx9lK+hkX2d9avmVMI/g v6hvX+hRUjoLHVreLLcR1QU/tn56R2c4jWj/eHbBZCQCna9c0IoEWFix9Y4z6qsoJ6w5 9Toe/5IsNboQmoKF2c5+PIdRV/7PWYo4VgfMP0NBta3tzTp69ECzruO6NZgoTncxG1cK KP4XosVq/5+viJKPd3/B/oZxz9nAkncl0Uf/asrljIsFgkIzLOk2LxYdGBiyfvZrlZtm Z9FJL/Qy6DYCeRubO+3xlzOLF9DHqVRjiWLhTSQQtvu4THPaPTlhJ5uHLyw3DbTpf+dt ZjDw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=zfmHvO4bszehQ082Y/9bfCsKjhj2g/yezRDipNTYzxM=; b=B6y+iJG8OCJkJCrGllQUBCr7EFaYVKvRMjIuYbahP1/cGdwf7FI7Zn2Mv5T5Xb2A8o K4HvHeYLzL4rG4hFnkn6MP35TnNuNa4dSzaLkXmkg9ufsrhtSjJkc3rGE7aB3fgYXNlG hvGalH3smd/JKnGJgpbIH2M7yiTJjdI8Qf/26PcnjOj1p30i2MgZaCWugFRTRx+KDY/z B5ZoEoHtWeMEuZxJfRLEJPPOeQMEUatKwdcV/XIHuvvBdUvjc4RyxNw+S0hyiiV3rlMN Kk0UNI/DMpNLvxzRiDLeZsw+NsVeI8IcM1Wr2V/n6OlmlNBLCB2mDBHxejLomk3HagdO q8Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="oPFkyD/c"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h9-20020a17090a130900b001bcb5b3471bsi5156238pja.187.2022.02.26.12.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 12:45:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="oPFkyD/c"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6C47C1B7548; Sat, 26 Feb 2022 12:45:25 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbiBZUp6 (ORCPT + 99 others); Sat, 26 Feb 2022 15:45:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbiBZUp4 (ORCPT ); Sat, 26 Feb 2022 15:45:56 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D2ED1B4035; Sat, 26 Feb 2022 12:45:20 -0800 (PST) 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 B06D32223E; Sat, 26 Feb 2022 21:45:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1645908318; 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=zfmHvO4bszehQ082Y/9bfCsKjhj2g/yezRDipNTYzxM=; b=oPFkyD/cXbecBViD08SNc2TScbiUMLeJJq7NBT9IWis/4jib06hEhSh9mjASAWVyuKmDBl u4lsngYZzGg2G9hkZGCaFwx0ATXM5xWJzLkYDOxvJagp4ZGUUtBgkvjNSu21BU/OKct4Yf oop6LQ57nKlu+7zaoR/fDT9KAMB/dE4= 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 v2 0/5] pinctrl: microchip-sgpio: locking and synchronous output Date: Sat, 26 Feb 2022 21:45:02 +0100 Message-Id: <20220226204507.2511633-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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. This was also just tested on a LAN9668 SoC. If you have additional hardware, please test. Changes since v1: - add Ocelot support 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 | 112 +++++++++++++++++++--- 1 file changed, 97 insertions(+), 15 deletions(-) -- 2.30.2