Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753527AbdCOSRL convert rfc822-to-8bit (ORCPT ); Wed, 15 Mar 2017 14:17:11 -0400 Received: from gloria.sntech.de ([95.129.55.99]:51340 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753270AbdCOSRH (ORCPT ); Wed, 15 Mar 2017 14:17:07 -0400 From: Heiko Stuebner To: John Keeping Cc: Julia Cartwright , Linus Walleij , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/4] pinctrl: rockchip: convert to raw spinlock Date: Wed, 15 Mar 2017 19:16:53 +0100 Message-ID: <8564532.G8NNa9Oa4k@phil> User-Agent: KMail/5.2.3 (Linux/4.9.0-1-amd64; KDE/5.27.0; x86_64; ; ) In-Reply-To: <20170315180806.3714af56.john@metanate.com> References: <20170315174654.15128-1-john@metanate.com> <20170315180137.GB682@jcartwri.amer.corp.natinst.com> <20170315180806.3714af56.john@metanate.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2183 Lines: 61 Am Mittwoch, 15. M?rz 2017, 18:08:06 CET schrieb John Keeping: > On Wed, 15 Mar 2017 13:01:37 -0500, Julia Cartwright wrote: > > On Wed, Mar 15, 2017 at 05:46:52PM +0000, John Keeping wrote: > > > This lock is used from rockchip_irq_set_type() which is part of the > > > irq_chip implementation and thus must use raw_spinlock_t as documented > > > in Documentation/gpio/driver.txt. > > > > > > Signed-off-by: John Keeping > > > Reviewed-by: Heiko Stuebner > > > Tested-by: Heiko Stuebner > > > --- > > > v2: unchanged > > > --- > > > > > > drivers/pinctrl/pinctrl-rockchip.c | 30 +++++++++++++++--------------- > > > 1 file changed, 15 insertions(+), 15 deletions(-) > > > > > > diff --git a/drivers/pinctrl/pinctrl-rockchip.c > > > b/drivers/pinctrl/pinctrl-rockchip.c index 128c383ea7ba..8c1cae6d78d7 > > > 100644 > > > --- a/drivers/pinctrl/pinctrl-rockchip.c > > > +++ b/drivers/pinctrl/pinctrl-rockchip.c > > > @@ -163,7 +163,7 @@ struct rockchip_pin_bank { > > > > > > struct irq_domain *domain; > > > struct gpio_chip gpio_chip; > > > struct pinctrl_gpio_range grange; > > > > > > - spinlock_t slock; > > > + raw_spinlock_t slock; > > > > > > u32 toggle_edge_mode; > > > > > > }; > > > > > > @@ -1295,14 +1295,14 @@ static int rockchip_set_pull(struct > > > rockchip_pin_bank *bank,> > > > > switch (ctrl->type) { > > > > > > case RK2928: > > > - spin_lock_irqsave(&bank->slock, flags); > > > + raw_spin_lock_irqsave(&bank->slock, flags); > > > > > > data = BIT(bit + 16); > > > if (pull == PIN_CONFIG_BIAS_DISABLE) > > > > > > data |= BIT(bit); > > > > This should be lifted out from under the lock. > > > > > ret = regmap_write(regmap, reg, data); > > > > How is this legal? The regmap_write() here is going to end up acquiring > > the regmap mutex. > > It's not, the spinlock can be deleted here. I only have RK3288 hardware > to test and I missed this when checking the uses of slock. That part could very well also use regmap_update_bits like the other parts. Not really sure, why we use regmap_write here, but I'm also not sure, if it matters at all.