Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp11658rdh; Mon, 18 Dec 2023 02:49:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDBVqZ7XVN/QGbn9NWwN0DL6g09yb6IFjWG08t6Tl8AeLwYSnCJNBtsF4MAGL4ugnm656j X-Received: by 2002:a05:622a:1388:b0:423:843a:e311 with SMTP id o8-20020a05622a138800b00423843ae311mr25546935qtk.23.1702896596092; Mon, 18 Dec 2023 02:49:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702896596; cv=none; d=google.com; s=arc-20160816; b=nyQKnccW9iUTUgY1ShzQYehV/7abjWEXdUrtdc5sPpYcTPepEPt7Rv6wkrfrPD0+yx oSmz09VEGkp+aPsswe0K5TEuG1Rp/Iipu5jjxh45o6YnwYVeLEzKUCwG6a4SWbsdVn2C omj0k5RhwARTAmPRNiAgoomClqO0RYnP1VQ68viQUoTUxdNyAm0Es784sjjZbaMm+4MG /zOAymkJRtqAQ44xrL44ln4rUtKb7tppY/KbbmSZGZAsulzCZm5IDCU5I8O1zl16xplJ 8MoabrdadBjBfp+xlGUd6gfZ9VInDZGFpo4nxY8+/kIsyQ2MSOUjIkftC2vavIc5yq1f /UUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=W+Me9F1jv74UMq7T07LVSEAvwEjMjZR1Wwxe+I0WNtM=; fh=pOiyVLIybPu6wvJt7u8fj7W9CH3Y23GN0yIbvAhxftU=; b=ZFHF8Nzhk3ozuAoMhjelebaVIt3lcQKxTi1BHcDxkdk2koTwXpKt/2U2jLybXJ2gfi nMiafEcUaMQAc9nKKALeK+Yr/X9maFrhXJfejKekCgHgoS34gyBlaXeoWYxSDS8Xodej 9d4YDKaUk6n4epvNFzmfiE/zoGEFmhUaPqZLG5PPeKZ6ePSb3nvJCTJjA63lqB29sVx3 8tYATtFz/bdyFn8HxnXsjhEAlIOh8DaQvrz08qr+XzncfMSI/inxRDBha/txEw0qaDYs 86sRMObdSZu0xQxeYn0Gf2HLG38XoYNpqexeoCEAVmRCqM4ZqGz0eh50OnQTrY90l2FS f4TQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3367-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ki23-20020a05622a771700b0042560e940dfsi21938055qtb.138.2023.12.18.02.49.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 02:49:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3367-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3367-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D35FC1C22AB9 for ; Mon, 18 Dec 2023 10:49:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B54918025; Mon, 18 Dec 2023 10:49:50 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7EC51945D; Mon, 18 Dec 2023 10:49:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CA8641FB; Mon, 18 Dec 2023 02:50:31 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5BEBD3F738; Mon, 18 Dec 2023 02:49:46 -0800 (PST) Date: Mon, 18 Dec 2023 10:49:43 +0000 From: Sudeep Holla To: Mark Hasemeyer Cc: Rob Herring , LKML , Raul Rangel , Sudeep Holla , Frank Rowand , devicetree@vger.kernel.org Subject: Re: [PATCH v1 3/6] of: irq: add wake capable bit to of_irq_resource() Message-ID: References: <20231213110009.v1.1.Ifd0903f1c351e84376d71dbdadbd43931197f5ea@changeid> <20231213110009.v1.3.I29b26a7f3b80fac0a618707446a10b6cc974fdaf@changeid> <20231213221959.GC2115075-robh@kernel.org> <20231215153035.GA3996646-robh@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Dec 15, 2023 at 01:56:47PM -0700, Mark Hasemeyer wrote: > On Fri, Dec 15, 2023 at 8:30 AM Rob Herring wrote: > > > > On Thu, Dec 14, 2023 at 02:05:16PM -0700, Mark Hasemeyer wrote: > > > > If a device has multiple interrupts, but none named "wakeup" you are > > > > saying all the interrupts are wakeup capable. That's not right though. > > > > Only the device knows which interrupts are wakeup capable. You need: > > > > Agreed. > > > > return wakeindex >= 0 && wakeindex == index; > > > > > > I was assuming logic described in the DT bindings: > > > https://www.kernel.org/doc/Documentation/devicetree/bindings/power/wakeup-source.txt > > > "Also, if device is marked as a wakeup source, then all the primary > > > interrupt(s) can be used as wakeup interrupt(s)." At the time it was written, the intention was not to fix any particular interrupt as wakeup but leave those details to the device. Also this was just to consolidate various variation of similar bindings/support for the same wake feature. It didn't enforce any rules as what can be or can't be wakeup interrupt. > > > > Also not the best wording I think. > > > > Which interrupts are primary interrupts? > > > > If we can't determine which interrupt, then we should just leave it up > > to the device. > > Again I agree with this. > +Sudeep who authored the documentation and Rob Ack'd: a68eee4c748c > ("Documentation: devicetree: standardize/consolidate on "wakeup-source" > property") > > I think what Rob is suggesting more closely matches what ACPI supports: where > interrupt resources are individually marked as wake capable. The binding > documentation should be updated though. > > Something like: > ``` > If the device is marked as a wakeup-source, interrupt wake capability depends > on the device specific "interrupt-names" property. If no interrupts are labeled > as wake capable, then it is up to the device to determine which interrupts can > wake the system. > > However if a device has a dedicated interrupt as the wakeup source, then it > needs to specify/identify it using a device specific interrupt name. In such > cases only that interrupt can be used as a wakeup interrupt. > > While various legacy interrupt names exist, new devices should use "wakeup" as > the canonical interrupt name. > ``` > > Parts of the kernel (I2C, bluetooth, MMC) assume "wakeup" as the > interrupt-name. I added some wording to clarify the assumption. > > Thoughts? Above wordings sounds good to me. -- Regards, Sudeep