Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp792788imj; Thu, 7 Feb 2019 11:56:01 -0800 (PST) X-Google-Smtp-Source: AHgI3IZjqOB5it5VnTfo30y770XUpePLAkxeIq7IaZUvg0pouvo0HnEQxJaqev+BFmELaZ7XmARb X-Received: by 2002:a17:902:541:: with SMTP id 59mr18652149plf.88.1549569361534; Thu, 07 Feb 2019 11:56:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549569361; cv=none; d=google.com; s=arc-20160816; b=g78Sx0KzpqCmoMkKOw7tYRmO4veLl7FGHZFOTI9xzoRqQ9/Mrct2q5jZ5sE7ah+6SO cmgyWldKStD1mM3pHK7sLn28NM8KljSV9RS4aWvJ7c9JfTnpiqvJWlNMsRpMxTs/pD9n hBBnpXD3ZQ7eG/m3z8Uqy/llwGDZY67qyJdiRAyVkSR/sk0am6La16UY3EnplrQ+oVPa /8AoSKchfsoPbeBw160L+OdaJjzlebPosbBNO4uItuO08DYRkoKFPsgjgxQmDWcaeQuM TzBbw+HAGdxLbkmNyG1sYhETFM9NgojYC+h11eJj30cF0Do2XajD4w+m8dnaz/5pagqx yVUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Yuwb+5FOI6hWVyTZ/nLpjSNm5TPH0/gmq35Pv0UCtNk=; b=UdlXXrcdX7WpWZ+S16087ZoL7+b1L8HTnr+RQyK6vAhE1qbNf8pxFlfFZjs6EpSCgK 5yjP8ht1eR8XOj98tMlNCJvm7grP+6Snfcv/TZNwFUf1yaTe7NzqQQeYhogOF6+1++JX lGLwieZq+O68Z3ZIhCd4c61Ajn5Z8ln/aG1Zyg3einkWcoRzcLKrKFgAfn00rNEpOtfg zYvk8n/f+L8qcnp/P/4C8QDaKattdBbEHNJCTvLYPDCxi9XrMMJOHRQPg+OY0bOvhaLm ImzaKr9xmPqdzO3jyJctre1e5Yg33uWW0xED9j2cYg2hv8qYuHCtFpjeO2Qs9e6UOq1/ S+4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HNsOwq+w; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si10375374pld.353.2019.02.07.11.55.45; Thu, 07 Feb 2019 11:56:01 -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=@google.com header.s=20161025 header.b=HNsOwq+w; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727200AbfBGTzg (ORCPT + 99 others); Thu, 7 Feb 2019 14:55:36 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:39396 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727122AbfBGTzf (ORCPT ); Thu, 7 Feb 2019 14:55:35 -0500 Received: by mail-it1-f195.google.com with SMTP id a6so2905439itl.4 for ; Thu, 07 Feb 2019 11:55:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yuwb+5FOI6hWVyTZ/nLpjSNm5TPH0/gmq35Pv0UCtNk=; b=HNsOwq+wJ8HKOEW3kDCnKXq7K11ens5V2X0pjzTUjS5uRiOA6xtWfWIAD8fiLLCZw1 x0BQLv5H9JyE7BWPW2f58U69j2bpEKSumwr4mxGPB9pufQg/ZnVwKpzVyMY9wLUjxMz0 Vy6I+yE2UNQ9GSE2R89qeglqTgkmoGm31hGaldUxePxJk0wMUEtye5DAnwNNOlTaci3n 8dgNERlOsn9wKIy2j2hGt1ZXeZ7P9cSABqCjw0fMzidbtG6OwS4s6IW14BvRazXjqjXF hjhGm/77bdybLxzkEpz2/CCwOnr+k5dftZwg1o8ak5BhcTbFhUB99fIjlQKzEDcL2Vt7 wGZQ== 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; bh=Yuwb+5FOI6hWVyTZ/nLpjSNm5TPH0/gmq35Pv0UCtNk=; b=D0EdkBdTJZWuuSXp3zyvJM/QyNETpAu55BZa8OTnLR+zehtYuqltPzcsLGkrGwmBwI 3gY4fkK42kY0PWdAYKvhp9ChmQcQ5gOQUUDVFm94GFw45ZEyfZ1uk9D13ALIa0Bjpbfz CsFObsX6TWL2x+ndtXBjyswNF0qPzMFFjv2DZLRl0ZGxS61XXw69utV+OP7/ELBXi1ZN JhdKiy2zUSZ/89e/RmDX5j4bC5pjP93Z75kdqhxLIr1oGID1bHIGJdTFTiqT1FrBnNn4 90n3UwQ7Tq1gCouPBnR0ibfTkcCcCte8FV8Q1U7Svf/ZT1xvm6Z4rcdD6oZF5VDTZyCv 4Ogw== X-Gm-Message-State: AHQUAuZWAU5m1J2y/5yvHnMj3HHoKfTVGcnbEbVLx1IwPrrfOyFZNgXv B2gKb/bkcpLIPO6vNOo2dRjzzCFHoFVLsjTFv1jQnw== X-Received: by 2002:a02:9549:: with SMTP id y67mr9885238jah.4.1549569334272; Thu, 07 Feb 2019 11:55:34 -0800 (PST) MIME-Version: 1.0 References: <20190207185917.167829-1-egranata@google.com> In-Reply-To: From: Enrico Granata Date: Thu, 7 Feb 2019 11:55:22 -0800 Message-ID: Subject: Re: [PATCH] driver: platform: Add support for GpioInt() ACPI to platform_get_irq() To: Andy Shevchenko Cc: "Rafael J. Wysocki" , Greg Kroah-Hartman , Enric Balletbo i Serra , Linux Kernel Mailing List , Gwendal Grignou , Dmitry Torokhov , ACPI Devel Maling List , Brian Norris , Enrico Granata , Mika Westerberg , Andy Shevchenko , Hans de Goede Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Resending as plain text; comments inlined. On Thu, Feb 7, 2019 at 11:39 AM Andy Shevchenko wrote: > > On Thu, Feb 7, 2019 at 9:04 PM Rafael J. Wysocki wrote: > > > > +Mika Westerberg > > +Andy Shevchenko > > +Hans de Goede > > Thanks, Rafael. > My comments below. > > > On Thu, Feb 7, 2019 at 7:59 PM wrote: > > > > > > From: Enrico Granata > > > > > > ACPI 5 added support for GpioInt resources as a way to provide > > > information about interrupts mediated via a GPIO controller. > > > > > > Several device buses (e.g. SPI, I2C) have support for retrieving > > > an IRQ specified via this type of resource, and providing it > > > directly to the driver as an IRQ number. > > > > This is not currently done for the platform drivers, as platform_get_irq() > > > does not try to parse GpioInt() resources. > > And why is this a problem? In ChromeOS, we have a driver (cros_ec_lpc) which can run either on systems that directly expose the interrupt, or systems where the interrupt goes through a GPIO controller. On the former, firmware provides an Interrupt resource and platform_get_irq() finds it. On the latter, firmware provides a GpioInt resource and platform_get_irq does not find it. We could work around this in the driver by probing both paths, but since other subsystems seem to directly look for GpioInt resources, it seemed to us to make more sense to extend platform_get_irq() instead. > > > This commit adds that functionality. > > How that can override the configuration / BIOS flavour when driver > needs to register an interrupt out of GpioIo() resource? > > P.S. Have you looked at drivers/platform/x86/i2c-multi-instantiate.c > and intel_cht_int33fe.c? Those drivers seem to only ever expect a GpioInt(). Our case is one where both are possible, depending on the system we're running on. We are trying not to put ad-hoc logic in the driver, but if you think that doing so would be our best course of action, please do let us know. > They are the only drivers which needs something like this for now and > I would rather say it's a bad BIOS decision to write a table like > that. Do you have any suggestions to write proper firmware tables to avoid this issue? > > -- > With Best Regards, > Andy Shevchenko