Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4469347img; Tue, 26 Mar 2019 10:00:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyyF231cd3ppo7Of5GBrq/EgotQ9NpyS8B2iHfti2G9Y34DqzeR5Easrs+e9mFK2nUuA0I X-Received: by 2002:a62:6c43:: with SMTP id h64mr30806046pfc.123.1553619605145; Tue, 26 Mar 2019 10:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553619605; cv=none; d=google.com; s=arc-20160816; b=CfU5xrI5QR1Lmtosd9kD5AgdVGoQ2c/s1Ky8nblB9BUllr3SKb0t3SJLinkDGq5Tlm Gwuo6Scq6zU0sXt8elAOUTi/RoFx2J0NujsCts5AZ5cfiAm5hSutca4a/JOYaqd6ooid WW//B4ecKNoWHhbUUc+Y/daRDmEAP5VIqa+JyPFsRqU3b8RyqHRH8lcb15zHvbcRoRNr ykOq/TFvlWmEW56/jdGlcnVkP1yQV5Lf2D4mx/AfdZVnF4cyiktiEyp5tHVsfNhs9jMk CP/Fr/FW5s3ruxY35aIlKAXR0r1+rohuwcJmvUUbKbpt1J45O4HCmjVaDUPHhVQ08VtM ktCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:message-id:to:cc:subject :from:references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=/qyfPsW7gKCbvRlxk8/hqHHM+WTgixIZCzfz1ObNHKw=; b=wQEHkC+cVhTYNGWDBPFZay3tgRuWFTiUBCyJWzxCj/jEPshDB1IwEC1MG0xs4xcImN h3IbbRq4LR3Bfuat45DaOFzeVpx6fsBUNMxNmAMSbQhalwloh7rr9UnERq21IIv/DIEr cnDjkzLMkWke6ea3nWMgP81xyWbpDCY3ITaH53VoxSvMq4b7BZ6b4FaXkNFW55CnzPod ZQsLT1/HLyxQHilZJKYY0fjtsd0nZyo2wLKn3iskvUACmbSUyWa+qB4l/vNVX4Uk5QRA JK5xHhC8lil3dna4UWLxv/ts/ogHVqta8tSEO6nFS10DH+Dwxr0S7a0wULM2pntQWqMX /hbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Kj77aelH; 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 y2si10163954pgl.527.2019.03.26.09.59.49; Tue, 26 Mar 2019 10:00:05 -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; dkim=pass header.i=@chromium.org header.s=google header.b=Kj77aelH; 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 S1731761AbfCZQ64 (ORCPT + 99 others); Tue, 26 Mar 2019 12:58:56 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43659 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729633AbfCZQ64 (ORCPT ); Tue, 26 Mar 2019 12:58:56 -0400 Received: by mail-pg1-f196.google.com with SMTP id z9so2245154pgu.10 for ; Tue, 26 Mar 2019 09:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references:from :subject:cc:to:message-id:user-agent:date; bh=/qyfPsW7gKCbvRlxk8/hqHHM+WTgixIZCzfz1ObNHKw=; b=Kj77aelHKEp5JKhJMzxvuv+6XzDAuJmYWOsBSd+cR6RJ4b3x5UctW5f4l45xdMwwTC xFGuueoyCPWEHkBYZZQ3HQFY0MKfmHq282iTio95b/pkj3e38CAxC/h1Gg/4HskOc4IZ nKuB8eTwNIrm8YWXHZxugiCPsZGhyGnWOBK+w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:from:subject:cc:to:message-id:user-agent :date; bh=/qyfPsW7gKCbvRlxk8/hqHHM+WTgixIZCzfz1ObNHKw=; b=Gww4UWebYAqpKAibxSA4U7vZtecsMfLvIAY7y1VcMNcKOlgU+YBs5PCp0/M73T3Lxw F5knvja1tI4bUx+7ryWyoMgaHjktNschksGvogcMgiwEu1gzPL9BORyD57+TReayOyGZ /kQH6lFDt/94r9u4QVOOP6jFC0A7h3vRWzRnDYKGV6JDE4ISmGrbPWNQ1Cl3ljIWAClj UAK88pwBc4AqWOlsPj94TamZ6Yw4M+/Z1ouOdvqsF41TxB+70CwesK8b+nc8gdOt2SEZ 4sXjhGesfmNhVHSM75XhpIrrRegmKpvhHrZVhXs4or17Fuou8BtkZiUTt/7tpPWe6wLf LbvA== X-Gm-Message-State: APjAAAXK0W0H6Lb6K/kWm2A1hTTY4IRHGgss1/HqElcWk3e1kxYInhBu Woap6c3lZDbzrAgJtd5cqS36uMwFG2nsqQ== X-Received: by 2002:a65:4547:: with SMTP id x7mr28976718pgr.350.1553619535776; Tue, 26 Mar 2019 09:58:55 -0700 (PDT) Received: from localhost ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id c130sm30405631pfb.145.2019.03.26.09.58.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2019 09:58:55 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20190325181026.247796-1-swboyd@chromium.org> From: Stephen Boyd Subject: Re: [PATCH v2] genirq: Respect IRQCHIP_SKIP_SET_WAKE in irq_chip_set_wake_parent() Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, Lina Iyer To: Marc Zyngier , Thomas Gleixner Message-ID: <155361953432.20095.14563397546308928190@swboyd.mtv.corp.google.com> User-Agent: alot/0.8 Date: Tue, 26 Mar 2019 09:58:54 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Marc Zyngier (2019-03-26 04:11:56) > Hi Stephen, >=20 > On 25/03/2019 18:10, Stephen Boyd wrote: > > This function returns an error if a child irqchip calls > > irq_chip_set_wake_parent() but its parent irqchip has the > > IRQCHIP_SKIP_SET_WAKE flag set. Let's return 0 for success here instead > > because there isn't anything to do. > >=20 > > This keeps the behavior consistent with how set_irq_wake_real() is > > implemented. That function returns 0 when the irqchip has the > > IRQCHIP_SKIP_SET_WAKE flag set. It doesn't attempt to walk the chain of > > parents and set irq wake on any chips that don't have the flag set > > either. If the intent is to call the .irq_set_wake() callback of the > > parent irqchip, then we expect irqchip implementations to omit the > > IRQCHIP_SKIP_SET_WAKE flag and implement an .irq_set_wake() function > > that calls irq_chip_set_wake_parent(). > >=20 > > This fixes a problem on my Qualcomm sdm845 device where I can't set wake > > on any GPIO interrupts after I apply work in progress wakeup irq patches > > to the GPIO driver. The chain of chips looks like this: > >=20 > > ARM GIC (skip) -> QCOM PDC (skip) -> QCOM GPIO >=20 > nit: the parenting chain is actually built the other way around (we > don't express the 'child' relationship). This doesn't change anything to > the patch, but would make the reasoning a but easier to understand. I take it you want the sentence below to say 'parent' instead of 'child' then? >=20 > >=20 > > The GPIO controller is a child of the QCOM PDC irqchip which is a child > > of the ARM GIC irqchip. The QCOM PDC irqchip has the > > IRQCHIP_SKIP_SET_WAKE flag set, and so does the grandparent ARM GIC. > >=20 > > The GPIO driver doesn't know if the parent needs to set wake or not, so > > it unconditionally calls irq_chip_set_wake_parent() causing this > > function to return a failure because the parent irqchip (PDC) doesn't > > have the .irq_set_wake() callback set. Returning 0 instead makes > > everything work and irqs from the GPIO controller can be configured for > > wakeup. > >=20 > > Cc: Lina Iyer > > Cc: Marc Zyngier > > Signed-off-by: Stephen Boyd >=20 > Fixes: 08b55e2a9208e ("genirq: Add irqchip_set_wake_parent") > Acked-by: Marc Zyngier >=20 I'm happy to resend with the commit text clarified more and the above tags added.