Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp406370yba; Wed, 24 Apr 2019 03:25:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4ovs118JbIc50t2+33OWtgI0BBpQ/dRA0kVDj94EKKtjmsDnDZlbidyQB/RD+MyLhJ/d3 X-Received: by 2002:a17:902:684a:: with SMTP id f10mr5992297pln.286.1556101520082; Wed, 24 Apr 2019 03:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556101520; cv=none; d=google.com; s=arc-20160816; b=cAr3sUoFU68RFnBytpfr9iCiNo8ckKdpJb5qtZK+grarwI0fqrhbvNSH19ulIgf2LU n/Th9rAuaBOooGJkFfU3Jq6/b2g9MwJ/F/jwiwU11UiukZ3ZjVm4SQvrTscmsPp0qpsl v3+2rdGPQjpKykz9fqFHP8f3MqElEGY+8eC76NW3eo6sRosTOVZt8EVybSLTfIDsfdVD 5MBssuBh2cmnzKSlxdfCOK8XOlT8iC/0ZqC6F/jz5PF7LHSp9ypim1B/92kDUaDudgC8 lH1au1mK0wNQZDVpQtYOo876KHjdNkg9gM46mK2flxuTfMfMkIACT5OH/IEzww4OWA6M FHtQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=/Z261mDHII7Hsmj+mj0wKFqL2Z23V4TaH30tLBHOCwA=; b=mLBKxRuG3Cdw4dXGVIcy6FWkNFg2uPog8rGRyFL6huafdgbAASBjLSL9oyU43F1MiO kk2WrffpAXmHlZbuXCk/45e5YpVGFtcxRvKawejVyG3VKhPmKDSK1s7a08M6D3ZlTFFX tiL+Up44D1kzOTWF6y+iJvU3VEEHqCMV7Bl2pAXW1j3NYmttsYlMuWCNPLl8E7HTw+Vz 0uPO+kecxBQsT/jRw0pCwJaXNAR5FWjVMiZOeq5MvxM9NCWIOwl/m20qgJCAAhEgoWQK MkKSM6v4XGA1B45uZRxr5wVsMdp2F8z2c/mggdM8RULckQ4AX/g0g90HIt8OqnslQ/WN frdg== ARC-Authentication-Results: i=1; mx.google.com; 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 a36si17639665pgb.165.2019.04.24.03.25.04; Wed, 24 Apr 2019 03:25:20 -0700 (PDT) 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; 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 S1727892AbfDXKTR (ORCPT + 99 others); Wed, 24 Apr 2019 06:19:17 -0400 Received: from gecko.sbs.de ([194.138.37.40]:58231 "EHLO gecko.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbfDXKTR (ORCPT ); Wed, 24 Apr 2019 06:19:17 -0400 Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id x3OAJ379014948 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Apr 2019 12:19:03 +0200 Received: from [139.22.114.195] ([139.22.114.195]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x3OAJ2vF026053; Wed, 24 Apr 2019 12:19:02 +0200 Subject: Re: [PATCH 2/2] gpio: sch: Add interrupt support To: Mika Westerberg Cc: Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , Linux Kernel Mailing List , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, "Rafael J. Wysocki" References: <20190424075816.GU2654@lahna.fi.intel.com> <8999d3f8-d169-eb85-bd2f-08c99d184ea2@siemens.com> <20190424081802.GV2654@lahna.fi.intel.com> <5a28f22c-22f7-760a-d076-68ff19800d44@siemens.com> <20190424084259.GW2654@lahna.fi.intel.com> <7e328b7e-f4f0-851a-4152-a9ffd058201c@siemens.com> <20190424094506.GA2654@lahna.fi.intel.com> <292e6eff-82cc-6e4d-925b-77a60399e2e0@siemens.com> <20190424100130.GB2654@lahna.fi.intel.com> From: Jan Kiszka Message-ID: <1200464b-f969-ebc2-ae82-1f8ca98aaca1@siemens.com> Date: Wed, 24 Apr 2019 12:19:02 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20190424100130.GB2654@lahna.fi.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24.04.19 12:01, Mika Westerberg wrote: > On Wed, Apr 24, 2019 at 11:48:09AM +0200, Jan Kiszka wrote: >> On 24.04.19 11:45, Mika Westerberg wrote: >>> On Wed, Apr 24, 2019 at 11:36:58AM +0200, Jan Kiszka wrote: >>>> OK, there is that table, but what is it supposed to tell me about the >>>> event and where to hook into it better? >>> ... >>>> [02Eh 0046 2] SCI Interrupt : 0009 >>> >>> This is the SCI interrupt GSI number. IIRC it maps 1:1 to Linux >>> interrupt number so you should see it in /proc/interrupts. When a GPE >>> event is triggered it should be handled in the ACPI core. >>> >> >> Yes, clear, all this happens already. But I need to link the core with the >> sch gpio handler so that the gpio event is filtered out and the right >> virtual gpio interrupt is triggered. So, other than >> acpi_install_sci_handler, how should I establish that link? > > I think what you want is "GPIO signaled ACPI event". It works so that > you declare _AEI method below the GPIO controller listing the GPIOs you > want to trigger events for and then either _Lxx, _Exx or _EVT method for > each of them under the same controller. GPIO core then handles it > automatically when you register the GPIO chip. See also > acpi_gpiochip_request_interrupts(). > Right, that is was I read as well. Let's assume I would be able to patch the tables: Would I describe all the logic of this patch in ACPI terms? Where to enable interrupts, how to dispatch the SCI event, how to acknowledge it etc.? Will it also take care of locking? (BTW, my locking seems to have some remaining inconsistency, on second look.) And even if that were possible, we would be back to the square of existing devices without those definitions. If this were a recent chipset, I would say, "go, fix future firmware versions". But this one is legacy. Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux