From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0168C43381 for ; Mon, 25 Mar 2019 18:10:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94D9F2087C for ; Mon, 25 Mar 2019 18:10:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Hld2az/d"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="CMfIJ1N9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94D9F2087C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xBcnRpaYBdgg+2QiQqX2V17pBSVjncb4+crlj1opm4E=; b=Hld2az/d2zVQCf 83MqwfcsiltjUqoPNjzlOAARUmYR9beaw5EX8/NkUcAK6VE3B/jtkuKCuG6fRp2Afcnmh86NgU2cW fyTBZiY7c8rfZfHNSquaUxJhjpJK2MeYSZqIMWM9y3pPEY8zfg8QoisTNsvjq8lAJ/bfAQF4vXyQn 99UG+f2NsWSZ5bPylSkxSSc3pBmNmbbBj4h/CsnIh/Sfmhuup7NZ1RnZYHPn9Hm/QJSrkatPk5vF+ LC5hiBNoGLh8NtgeLbsLwM/5HNHQm6dUNGFi5KluLLLRtthBzWftyEuIoLDUzSjCPU6aCdye+sEsy T0WeP1vRNtq7HBJBnsSQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8U3P-0004KV-G9; Mon, 25 Mar 2019 18:10:35 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8U3L-0004JN-V2 for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2019 18:10:33 +0000 Received: by mail-pg1-x541.google.com with SMTP id g8so6983575pgf.2 for ; Mon, 25 Mar 2019 11:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Yb28Rwinu3HSqUzQsmebPya8geO3DXE7wlrC3tIKi+s=; b=CMfIJ1N9fYf2S1BxTbN4KcumvqcrzuIgYkVaX0/qwf8DdFzO2V16CBFRGqPs8NkwEq cvyHSnLWI+3VcH5p72b1kuGwk6T59e01GxI391CQRY9eHLgVkmJktjU6Fn6ejA1rmWx1 vVsdfYucRwc14TpWfcsK/4Ee21n9w5Kz7yb0Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Yb28Rwinu3HSqUzQsmebPya8geO3DXE7wlrC3tIKi+s=; b=oxfpcyE/Omw5/xvfdTJPArbxFMeb2Q0MZOdF3bgWYCkxUStkzv5+r2lesgitbQglp/ M/yvc+zVkCng9QWgDVtDPI5AwvIcWxTAN0PZe1dqV2G4/LqckuZV7T4yKLKxyd4AEu34 AvLQSLRpkybX6Xj+2PUKsK98Dh9iCsZIQanqhPoY2d3+D5MIoZLy9kLmO8z7s8G/gkcJ LVJpfJvHwI41/Es5lVgPPkFInVPBSX5vYOGOShAPb205ZrSTbNH1/VnAio0C7BgsRsfd qwya7LComoEILXoVrRljdw4NZoFGaj2SSFvzIctfOnl1mzUM2lzpUzT+SqsQsZKOPjWa 9zgw== X-Gm-Message-State: APjAAAW4tkRQmy6vfialga5e2ee3DBReNLsxyGl64eDmMtcGrGTihRF+ QvQNcZDC+ClXwS2x00VOsrpQSg== X-Google-Smtp-Source: APXvYqwkovfcoPcSEStWz2FRXMwRJX+XjUasMbEGVKVM2bN53Im7S0mIm9RI4tNg9tSejg2aVCv98g== X-Received: by 2002:a63:c804:: with SMTP id z4mr23633612pgg.228.1553537427975; Mon, 25 Mar 2019 11:10:27 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id g2sm37882575pfm.144.2019.03.25.11.10.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 11:10:27 -0700 (PDT) From: Stephen Boyd To: Thomas Gleixner Subject: [PATCH v2] genirq: Respect IRQCHIP_SKIP_SET_WAKE in irq_chip_set_wake_parent() Date: Mon, 25 Mar 2019 11:10:26 -0700 Message-Id: <20190325181026.247796-1-swboyd@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190325_111032_058405_0D4C7833 X-CRM114-Status: GOOD ( 14.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Lina Iyer Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. 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(). 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: ARM GIC (skip) -> QCOM PDC (skip) -> QCOM GPIO 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. 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. Cc: Lina Iyer Cc: Marc Zyngier Signed-off-by: Stephen Boyd --- Changes from v1: - Rewrote commit text - Changed to only look at parent flags instead of walking parent chain kernel/irq/chip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 3faef4a77f71..51128bea3846 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -1449,6 +1449,10 @@ int irq_chip_set_vcpu_affinity_parent(struct irq_data *data, void *vcpu_info) int irq_chip_set_wake_parent(struct irq_data *data, unsigned int on) { data = data->parent_data; + + if (data->chip->flags & IRQCHIP_SKIP_SET_WAKE) + return 0; + if (data->chip->irq_set_wake) return data->chip->irq_set_wake(data, on); -- Sent by a computer through tubes _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel