From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751303AbdKTKgf (ORCPT ); Mon, 20 Nov 2017 05:36:35 -0500 Received: from mga11.intel.com ([192.55.52.93]:48348 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751068AbdKTKgd (ORCPT ); Mon, 20 Nov 2017 05:36:33 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,426,1505804400"; d="scan'208";a="3842236" Date: Mon, 20 Nov 2017 12:32:07 +0200 From: Mika Westerberg To: Chris Chiu Cc: Daniel Drake , heikki.krogerus@linux.intel.com, linux-gpio@vger.kernel.org, Linux Kernel , Endless Linux Upstreaming Team , Jarkko Nikula Subject: Re: intel-gpio interrupts stop firing with Focaltech I2C-HID touchpad Message-ID: <20171120103207.GB22431@lahna.fi.intel.com> References: <20171116130743.GT17200@lahna.fi.intel.com> <20171117091134.GB17200@lahna.fi.intel.com> <20171117110057.GD17200@lahna.fi.intel.com> <20171117133518.GF17200@lahna.fi.intel.com> <20171117135225.GG17200@lahna.fi.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.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 20, 2017 at 01:18:51PM +0800, Chris Chiu wrote: > On Fri, Nov 17, 2017 at 9:52 PM, Mika Westerberg > wrote: > > On Fri, Nov 17, 2017 at 03:35:18PM +0200, Mika Westerberg wrote: > >> > pin 18 (GPIO_18) GPIO 0x40900100 0x00024075 > > > > Hmm, > > > > If I decode 0x40900100 correctly PADCFG0_GPIROUTIOXAPIC (BIT 20) flag is > > set for the pin. This means the interrupt is routed to IO-APIC instead. > > > > Now, we do clear that flag along with the others when the GPIO is > > requested through gpio_request() but in this case we go through irqchip > > instead so the flag is not cleared. > > > > I wonder if the following patch changes anything? > > > > diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c > > index 71df0f70b61f..06af096f5768 100644 > > --- a/drivers/pinctrl/intel/pinctrl-intel.c > > +++ b/drivers/pinctrl/intel/pinctrl-intel.c > > @@ -939,6 +939,10 @@ static int intel_gpio_irq_type(struct irq_data *d, unsigned type) > > > > value &= ~(PADCFG0_RXEVCFG_MASK | PADCFG0_RXINV); > > > > + /* Disable SCI/SMI/NMI generation */ > > + value &= ~(PADCFG0_GPIROUTIOXAPIC | PADCFG0_GPIROUTSCI); > > + value &= ~(PADCFG0_GPIROUTSMI | PADCFG0_GPIROUTNMI); > > + > > if ((type & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) { > > value |= PADCFG0_RXEVCFG_EDGE_BOTH << PADCFG0_RXEVCFG_SHIFT; > > } else if (type & IRQ_TYPE_EDGE_FALLING) { > > It does change after the patch. I didn't have the touchpad stopping > things after a long time test. > The INT3452:00/pins under /sys/kernel/debug/pinctrl shows the > following for GPIO 18. > pin 18 (GPIO_18) GPIO 0x40800102 0x00024075 Great, thanks for testing! > Anything else you need from me? Nope, I'll make a proper patch and send it out this week.