From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752589AbbHMMnw (ORCPT ); Thu, 13 Aug 2015 08:43:52 -0400 Received: from mga02.intel.com ([134.134.136.20]:54432 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752346AbbHMMnt (ORCPT ); Thu, 13 Aug 2015 08:43:49 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,670,1432623600"; d="scan'208";a="747851521" Date: Thu, 13 Aug 2015 15:43:46 +0300 From: Mika Westerberg To: Linus Walleij Cc: "linux-gpio@vger.kernel.org" , Heikki Krogerus , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] pinctrl: cherryview: Serialize all register access Message-ID: <20150813124346.GC1541@lahna.fi.intel.com> References: <1438595198-44230-1-git-send-email-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13, 2015 at 01:24:13PM +0200, Linus Walleij wrote: > On Mon, Aug 3, 2015 at 11:46 AM, Mika Westerberg > wrote: > > > There is a hardware issue in Intel Braswell/Cherryview where concurrent > > GPIO register access might results reads of 0xffffffff and writes might get > > dropped. > > > > Prevent this from happening by taking the serializing lock for all places > > where it is possible that more than one thread might be accessing the > > hardware concurrently. > > > > Signed-off-by: Mika Westerberg > > Patch applied. Thanks! > When we are on the topic of this spinlock, I noticed that you > take it in some IRQ functions: > > static void chv_gpio_irq_ack(struct irq_data *d) > { > struct gpio_chip *gc = irq_data_get_irq_chip_data(d); > struct chv_pinctrl *pctrl = gpiochip_to_pinctrl(gc); > int pin = chv_gpio_offset_to_pin(pctrl, irqd_to_hwirq(d)); > u32 intr_line; > > spin_lock(&pctrl->lock); > (...) > > The Realtime tree have recently started to push raw spinlocks > into GPIO drivers that handle IRQs. Can you look into this > for the Intel drivers, I think maybe this needs to be a raw > spinlock to play nicely with realtime. > > Cf: > http://marc.info/?l=linux-gpio&m=143749603401220&w=2 Sure, I'll look into that.