Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1702570imu; Thu, 10 Jan 2019 01:19:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN43uEgPf7pdcd2lw8pqg2VJYnMT/AGQQDOI2s9LPw4ShMvZsYfPEMoCITvikssW6g4bD0DC X-Received: by 2002:a63:ee0e:: with SMTP id e14mr8508096pgi.8.1547111963792; Thu, 10 Jan 2019 01:19:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547111963; cv=none; d=google.com; s=arc-20160816; b=vPsbOjQHdujVMhWp2AzDZ6d7TsB5wcq1GKPO3UbTdDmE0vdR0hytHa0ATkYIr3aXJj dTy8oh3cZRCEwiwlTrcuSsPsCK9a4fEjW79s5wJrmrL8+y5Q5EroTQ1rzOV48aMGCZ0C 1bncI3ugP3zJGv+Zjz5alyg/9xyonVf0RYwNLQ+kSHr+IDiqk2IksvEDyeGv0CRMoG7u ljkBhaIUv3vkmrCZSBrmJjujVA1JTlS2rQtxpuVcWuBsMk/elofdr3eAXY16yw1+bSMx FIPzYjyNi34Jv5ukswyoUb59pxPwmwrGdLBYFE+/BilF6UOMNG79/N5oqSd4uG1IRJNK qNWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=dOmLRyZtj3/sPUbQ1xP8RMBb2GJ7QUphf2etkaln8Io=; b=sbfKIB5wUpCkGE8kJr8dS7jrS6s2KaEsaEvMl/jDUB3VsZ0RGYm3LIXOUyrXTc54M5 K77C7V0ajCWM6znmy5li6amWYM+KrxxznjiXqT3mkmupqFFw3r7MhB16xKqhhnuFgHUn Xfwi6s+eOXhou71ToTjA6vNnVa0f0rUmL52sNTiR7NoPEple6KDS7eLj3ir4ekVooujt 0Yr/2kTPjHZyo2IXbWYss26DxPpglq8yVTxCk0x9gSJhg4P/URuRquJk2mzeOCKEUQGl ytd+kI2pp/6ROL7KY5lqbkcmujdy9pJTS0S5eIL15pAJaAiTw3NZ9gj8CeJt7x9ZJtLv USlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=AX1ubFKN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32si4780000ple.72.2019.01.10.01.19.06; Thu, 10 Jan 2019 01:19:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=AX1ubFKN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727816AbfAJJRp (ORCPT + 99 others); Thu, 10 Jan 2019 04:17:45 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:40179 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfAJJRo (ORCPT ); Thu, 10 Jan 2019 04:17:44 -0500 Received: by mail-ot1-f67.google.com with SMTP id s5so9307479oth.7 for ; Thu, 10 Jan 2019 01:17:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=dOmLRyZtj3/sPUbQ1xP8RMBb2GJ7QUphf2etkaln8Io=; b=AX1ubFKNApW1qErnFf1wV3nJ9mDVaM4RGgqIWpo/y5PARBmwz1P+xiB6lJA3qY0gTS go7N2O2wVkLFxCaE8eUN1o6Uro3eqE64ifoBRMADsL5yRttX5xr296laPIdlarf11mCK iEmMzsRyclIZBwMw0Bi3JeDGfm3sYpD2QAsH8+qvT+0D7Gkxd0+bBFRFX6u7gIZG9cgl Mal7D8mCHU8Yqb/7Y99CiybMyvuq0/rgVLBrysoKcFS8De5SRbAYlg8FPEcqBi9QKYmK Tm2M7Ue+vPNxLSC1E8wFShh0AEnaVAVicMu6OllykmT4Us+PcDIpgksVq/YR2SJ9NwkU wK4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=dOmLRyZtj3/sPUbQ1xP8RMBb2GJ7QUphf2etkaln8Io=; b=dgcyLxYtmu1NzPkjkk1pZSV588Iq9CsihlVsS4ndnNl6noMS84bIW3Ppnj8LlHBZjZ s6GZFFSLsFWMvEMpT0jkqDCOVyXMfv3PvRW2loLCeA6ZcAYYBKzmmXnKWAnw1+oGKHmy 9TttOEpDdQw0HKxPf+6VtsHjUqz2NuXOrRt7UGVUdbZ+gZI/4zXDmhBom1GXvPGnhp+u ZJaOCg81W1zWlSb3twDbpL/FuXn6RY8jqQwXgE5x6UOFjeY7YUqOv7s+On9yUfyeU5Yx vVRnqwhTbmHnoZCnPOEhrcP8AR8avDgTAJlBgw9Rm1A02n1E5IHrf2b8pSo3jGSBSqrF EO1A== X-Gm-Message-State: AJcUukfca+mJGVL2LS68QQoz/GTphLf9pWm8K++5By8zF5WuK26PlrWz VmAm3zP9qPNBfZFtJSaLnqyeOGo2n4BH1AJ4ldHz5w== X-Received: by 2002:a9d:70d5:: with SMTP id w21mr5815134otj.301.1547111863804; Thu, 10 Jan 2019 01:17:43 -0800 (PST) MIME-Version: 1.0 References: <1547025084-16999-1-git-send-email-rogerq@ti.com> In-Reply-To: <1547025084-16999-1-git-send-email-rogerq@ti.com> From: Bartosz Golaszewski Date: Thu, 10 Jan 2019 10:17:33 +0100 Message-ID: Subject: Re: [PATCH] gpio: pcf857x: Fix interrupts on multiple instances To: Roger Quadros Cc: Linus Walleij , linux-gpio , LKML , "Stable # 4 . 20+" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =C5=9Br., 9 sty 2019 o 10:11 Roger Quadros napisa=C5=82(a): > > When multiple instances of pcf857x chips are present, a fix up > message [1] is printed during the probe of the 2nd and later > instances. > > The issue is that the driver is using the same irq_chip data > structure between multiple instances. > > Fix this by allocating the irq_chip data structure per instance. > > [1] fix up message addressed by this patch > [ 1.212100] gpio gpiochip9: (pcf8575): detected irqchip that is shared= with multiple gpiochips: please fix the driver. > > Cc: Stable # 4.20+ > Signed-off-by: Roger Quadros > --- > drivers/gpio/gpio-pcf857x.c | 26 ++++++++++++-------------- > 1 file changed, 12 insertions(+), 14 deletions(-) > > diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c > index adf72dd..68a35b6 100644 > --- a/drivers/gpio/gpio-pcf857x.c > +++ b/drivers/gpio/gpio-pcf857x.c > @@ -84,6 +84,7 @@ MODULE_DEVICE_TABLE(of, pcf857x_of_table); > */ > struct pcf857x { > struct gpio_chip chip; > + struct irq_chip irqchip; > struct i2c_client *client; > struct mutex lock; /* protect 'out' */ > unsigned out; /* software latch */ > @@ -252,18 +253,6 @@ static void pcf857x_irq_bus_sync_unlock(struct irq_d= ata *data) > mutex_unlock(&gpio->lock); > } > > -static struct irq_chip pcf857x_irq_chip =3D { > - .name =3D "pcf857x", > - .irq_enable =3D pcf857x_irq_enable, > - .irq_disable =3D pcf857x_irq_disable, > - .irq_ack =3D noop, > - .irq_mask =3D noop, > - .irq_unmask =3D noop, > - .irq_set_wake =3D pcf857x_irq_set_wake, > - .irq_bus_lock =3D pcf857x_irq_bus_lock, > - .irq_bus_sync_unlock =3D pcf857x_irq_bus_sync_unlock, > -}; > - > /*----------------------------------------------------------------------= ---*/ > > static int pcf857x_probe(struct i2c_client *client, > @@ -376,8 +365,17 @@ static int pcf857x_probe(struct i2c_client *client, > > /* Enable irqchip if we have an interrupt */ > if (client->irq) { > + gpio->irqchip.name =3D "pcf857x", > + gpio->irqchip.irq_enable =3D pcf857x_irq_enable, > + gpio->irqchip.irq_disable =3D pcf857x_irq_disable, > + gpio->irqchip.irq_ack =3D noop, > + gpio->irqchip.irq_mask =3D noop, > + gpio->irqchip.irq_unmask =3D noop, > + gpio->irqchip.irq_set_wake =3D pcf857x_irq_set_wake, > + gpio->irqchip.irq_bus_lock =3D pcf857x_irq_bus_lock, > + gpio->irqchip.irq_bus_sync_unlock =3D pcf857x_irq_bus_syn= c_unlock, > status =3D gpiochip_irqchip_add_nested(&gpio->chip, > - &pcf857x_irq_chip, > + &gpio->irqchip, > 0, handle_level_irq, > IRQ_TYPE_NONE); > if (status) { > @@ -392,7 +390,7 @@ static int pcf857x_probe(struct i2c_client *client, > if (status) > goto fail; > > - gpiochip_set_nested_irqchip(&gpio->chip, &pcf857x_irq_chi= p, > + gpiochip_set_nested_irqchip(&gpio->chip, &gpio->irqchip, > client->irq); > gpio->irq_parent =3D client->irq; > } > -- > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki > Applied to fixes. Thanks! Bart