Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp828698imj; Thu, 7 Feb 2019 12:30:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IZZJkd0wuIIXSzvirVjnTcy2SnIG4feq5ZobySI6yucBfzxxU1dB40T56KrRnlim5y5rnoR X-Received: by 2002:a62:9419:: with SMTP id m25mr18818797pfe.147.1549571438979; Thu, 07 Feb 2019 12:30:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549571438; cv=none; d=google.com; s=arc-20160816; b=cCISO2AjXO7dkOUvcu0tpNfHgBsXxrW/2FYYc0hOcvQF7sDaz3MOH1XPtO80U+pejE 1Rz+Y4fcYn9QdL865jfF5TOlOCRI4FTh0EK4nn8e+cPYmUoOANdkB33FYPzg3e6zFzER mZtYdYKhK9qCK8x9Ibth+IQY+rpCmN1bcASvk3vYHKTVgR5jOL/NBl7w+L15PvSNFSs1 YRbu3Qb+TakZWpBkcIqhEFVam+xK02xHTqzfdnMtbJhRPtco4lEGo8t0na0YfH6vP1RK RN7f53YX5lMm9BLTADT+VchzIDjyWiI4gxWq79U06Hmi2jCmV2bzgEPeo59bNtaaIXPg mJwg== 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=Bs5aframrMddA9aAdMAvLmi9jddHh2qt8Hvh1nB2Cyg=; b=q/kLXXVCTK5t0rvwAgpOwWU7DBTTk1mpjm6u9H0p/8DkI4UuEbizEtSQivsoQoRGgK e2imq3K0gP+VAMg/FbbMe5d8PAcGNWiwJJgkjQS/snPWpCrC016Q64vYkBt5D8SbGHdb dNZMXDWEWbpWXR8BoukX+k824tblZVb6Jg5TdqOHvRRaswdhMMZlOLIHFHdBC42phuyS aO8yuZtXgfp2vh84cSp5sWR49fOChXEjQ9OJtWRNvJiW6hA2gaS1yDuKm4hew+7AdUPJ XYT3MlbcowEk+FTMSgD3bairCWcYRA0V9HhAXc6jGGdWl7s1Iq6760pM/uLYUxLp931M FpGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YQArrIzH; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 38si9327205pgx.460.2019.02.07.12.30.21; Thu, 07 Feb 2019 12:30:38 -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=@chromium.org header.s=google header.b=YQArrIzH; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726764AbfBGU3d (ORCPT + 99 others); Thu, 7 Feb 2019 15:29:33 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:34360 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbfBGU3d (ORCPT ); Thu, 7 Feb 2019 15:29:33 -0500 Received: by mail-lj1-f193.google.com with SMTP id v14-v6so1087667ljv.1 for ; Thu, 07 Feb 2019 12:29:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Bs5aframrMddA9aAdMAvLmi9jddHh2qt8Hvh1nB2Cyg=; b=YQArrIzHcvxvvv2fEUccRbF7wewJGzG+8eQchPcxPhU3InQergLTp434vKraHaloCN YCDJMrMaZkPeyAiH/Z0+3Ymhg+GhI1A1pU4cEkp/GUJKx6N+uTwW1yzVpYXTDe5lb7K/ h+tFz+zPk5fh0SowU3qdP9OTTnaHTEJcUV3Oo= 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=Bs5aframrMddA9aAdMAvLmi9jddHh2qt8Hvh1nB2Cyg=; b=VheEzA/LbLxQIBtW55oYhmXvH4P86RrUqa8Kljv5XRHCNEEPEN4X0ZiqfHbe35GLFA KSStEdI40/ePa+8yKooIyJZMrBuq3v+mEmkfm0Uz/zZFgOomX9UyuBM2Z8WyVO6Avq13 BlFPitpIL1xcrMOEk3BoM3+xGKZ8mvilikRYdh6YOavLEo1Axi2U3v+fVCtzWA8S5PYl 436C+dskFHl6uiS0IDlk/gG8gJDwv1Ybm1drY9zNAEh0fMVXMtLGAN6DOVUw8A8C6QVz QweeJUGGbr0ztQ+xh2c/c8z3IcbrBXFjMn+SzZHLz0hn/3GcwM0ZcK0yvWGbh7SLw8EZ IJzQ== X-Gm-Message-State: AHQUAuZywjCxwuFSLcJzY6TZlofLJG6+BxtYnoBhILOOFi3DiU4jANga Hz4lQ9bbHWe2E5yqNaeJHVSwn/erUBg= X-Received: by 2002:a2e:5816:: with SMTP id m22-v6mr5094168ljb.177.1549571370596; Thu, 07 Feb 2019 12:29:30 -0800 (PST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id a18sm3256659lfb.57.2019.02.07.12.29.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 12:29:29 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id q11so919359lfd.3 for ; Thu, 07 Feb 2019 12:29:29 -0800 (PST) X-Received: by 2002:a19:aa87:: with SMTP id t129mr11683850lfe.139.1549571368976; Thu, 07 Feb 2019 12:29:28 -0800 (PST) MIME-Version: 1.0 References: <20190207185917.167829-1-egranata@google.com> In-Reply-To: From: Dmitry Torokhov Date: Thu, 7 Feb 2019 12:29:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] driver: platform: Add support for GpioInt() ACPI to platform_get_irq() To: Andy Shevchenko Cc: Enrico Granata , "Rafael J. Wysocki" , Greg Kroah-Hartman , Enric Balletbo i Serra , Linux Kernel Mailing List , Gwendal Grignou , 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 12:18 PM Andy Shevchenko wrote: > > 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 w= rote: > > >> > > This is not currently done for the platform drivers, as platform_g= et_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 sys= tems that directly expose the interrupt, > > or systems where the interrupt goes through a GPIO controller. On the f= ormer, firmware provides an Interrupt resource > > and platform_get_irq() finds it. On the latter, firmware provides a Gpi= oInt 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 exten= d platform_get_irq() instead. > > Looking briefly into the driver I found third scenario =E2=80=94 no resou= rce 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. No, no DMI rules please, they are more pain than anything. > > 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. This is simply kicking the can down the road. > > > Do you have a suggestion as to how to write ACPI tables to avoid the is= sue? > > 1. Allocate new ID and use it (perhaps not the best path). > 2. Use GPE(s). > Or just solve the issue of intermixing Interrupt() with GpioInt(). We have similar issue with i2c and spi, but we sidestep that there as we only parse the first interrupt and do not give option of fetching 2nd, 3rd, etc. Maybe we should only GpioInt parsing for the first interrupt in platform_get_irq() as well for the first iteration and then see if we need to improve it if we see devices with multiple interrupts. Thanks, Dmitry