Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp818706imj; Thu, 7 Feb 2019 12:19:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IaWvM75o4jUunt4lgv9uGC+xgBqJUw4wFRMet4g0LIWmWP8JS97OGHi0MWY7X3fM3US6lxV X-Received: by 2002:a63:bf4c:: with SMTP id i12mr12522690pgo.382.1549570795192; Thu, 07 Feb 2019 12:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549570795; cv=none; d=google.com; s=arc-20160816; b=YFirtjAGBER5X/sGIK33QNxkU3Gn2/jkTr7dGjKaa4CB+suILf/uTnn+Do1xJx0OPc JaSCCosOrKFsPRNRQsO0oejgdMXqQjbs5Bz5o2ruLhzC4D3IRMX2YKILyMAIKIknbusS wfWDWfbomWgZRKgvRgyICOQ+sAX9Y+4BzluZFCintulglwPxQSC6nx5rgNj4rHgRhCWb c2+OTLf4f/bJ5XDo1qqvhQrS5TpnX63mfz05e9Os29VR5GfV1XNAYydGiekiA+0kc5jm 4kxQjdmRo+EgL0UdIlR7iB2f09u1hZDQvUwJylKjtysRw7AiFw/SG8kY5jClIM9uJGdk 5mHg== 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=Y6GW/TynmP9/Wu+Nq5EnfUHpaUSTiqwx8XVGEI0ypy4=; b=ZDirgEksKQYEC5gUhdDGGGqn8x5HDdX4G5qCYQ4cBkHlvQ6o6Ov9So2GHT6EFCpQ5i n5hgnxzUnnerMp0qN0sbAzISkmDWl40dWYB6kb13UAKlr26q4QDywpJmcPfqTQ0ARFLp ymw09OqfCe50Z7cdbT8uVoE/ikYKpovvGubVjMjxxS2pF4QV/D2Z3KDN3TaowyVOpWOS O6dPGaRCYmR4hfw+IG0ovQ+HSJDcJtwIWymQ5N1o+RY7UazfhMhMZcctn2rQxUzHnmQw nwGrhxGPukj8uw8BelMOM9STuN7mY8wDlv+yNcPDQxqSZeE1uB7tmHdxpjb/Q6lWCHQw JDSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BOdtVZoE; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si3094069plb.290.2019.02.07.12.19.39; Thu, 07 Feb 2019 12:19:55 -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=@gmail.com header.s=20161025 header.b=BOdtVZoE; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727368AbfBGUSR (ORCPT + 99 others); Thu, 7 Feb 2019 15:18:17 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:44186 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727214AbfBGUSR (ORCPT ); Thu, 7 Feb 2019 15:18:17 -0500 Received: by mail-pg1-f193.google.com with SMTP id y1so427238pgk.11; Thu, 07 Feb 2019 12:18:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Y6GW/TynmP9/Wu+Nq5EnfUHpaUSTiqwx8XVGEI0ypy4=; b=BOdtVZoEqTz6tEfV9xPFNVeA6Y4D5UTXasYCvntYqieKU4/NJEToQETy1WcnxLbLIy xVPN3fqb2M2OpYESzM8jp79+DeAHWVeuLZhBFxN5lUn6d5vpU2KJGqy/0nhU2gGS11WM ROE8ix4pwoLAz7Sp1OdSyvIfQgT7SaN7ogWxmQKZ+h4xC+GvT5gkP/c0v2KkAnEj49SZ 1yZEfJpgEaUB1q/yYBoAvhrdgzCLeyFLbRyr7+zw6PoC2hi0oHe/JYzGaD3cFaKvpZKR nhwHf5LRcD1y2dkyYPutLyyejbUKPzxMhmUIx9ABpT+kuVRB9iUo0fJqfEDtWiqtENZo 1SkQ== 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=Y6GW/TynmP9/Wu+Nq5EnfUHpaUSTiqwx8XVGEI0ypy4=; b=dbpHEVXpr0R3L5kXTcUsHi9HLQmBmxAbZobQVHmjpOVuCqvFqKXjC+S25BuHqXk9GS cnDqR32Ckk/lCPtMOeG5FXghTWkNGiY8exdESsqa3th+6jNlhWbb8bANYFGFO8+TcJKH GmFpO/Gd/TQWpeMQb+EJ0n7LvAimqiJZQaiYqStAwUNL8b7tc6xOQXhjlwDUqywJpN0L gUkBc3n9t6SeD/nsWKk9fxBVfTp5YboBNYJEatUF+P/6W3HuuFz7yd+6J9PACC+B5REd dQPLnyDntze3/4tIsfSnV2JsFrMhK0ZkYVRufuWeF/oy428qltLcfZNRld1blxPK4lAX rJFw== X-Gm-Message-State: AHQUAuZ9Ksitbqe88E8DGNGZoUDJIDFiKjzGviHk5bujjszt+zoE3W/s C36ThYxncRHCRyTHi3H+kE6qJ0Iq7RbdWDFbe5n85HI5 X-Received: by 2002:a62:d005:: with SMTP id p5mr18108743pfg.175.1549570696236; Thu, 07 Feb 2019 12:18:16 -0800 (PST) MIME-Version: 1.0 References: <20190207185917.167829-1-egranata@google.com> In-Reply-To: From: Andy Shevchenko Date: Thu, 7 Feb 2019 22:18:05 +0200 Message-ID: Subject: Re: [PATCH] driver: platform: Add support for GpioInt() ACPI to platform_get_irq() To: Enrico Granata 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" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 7, 2019 at 9:45 PM Enrico Granata wrote: > On Thu, Feb 7, 2019 at 11:39 AM Andy Shevchenko wrote: >> On Thu, Feb 7, 2019 at 9:04 PM Rafael J. Wysocki wro= te: >> > > 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 syste= ms that directly expose the interrupt, > or systems where the interrupt goes through a GPIO controller. On the for= mer, firmware provides an Interrupt resource > and platform_get_irq() finds it. On the latter, firmware provides a GpioI= nt resource and platform_get_irq does not > find it. We could work around this in the driver by probing both paths, b= ut since other subsystems seem to directly > look for GpioInt resources, it seemed to us to make more sense to extend = platform_get_irq() instead. Looking briefly into the driver I found third scenario =E2=80=94 no resourc= e at all. So, you already have a quirk for that. Now it's the question either you go for global quirk (trying to find an IRQ via iterating over GpioInt() resources like in this patch, but in the driver), or use DMI table for more stricter rules. Either way you choose, I don't see a necessity to put this to the driver core for now since it would be the only (let's assume properly written ACPI tables) driver needs such. > Do you have a suggestion as to how to write ACPI tables to avoid the issu= e? 1. Allocate new ID and use it (perhaps not the best path). 2. Use GPE(s). -- With Best Regards, Andy Shevchenko