Message ID | 20231025202344.581132-6-sunilvl@ventanamicro.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp217748vqb; Wed, 25 Oct 2023 13:25:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbYbxXpltIuJ/zXQ+yUzrC71CQB2N4rP1zL7p+Uzsrz/64u+ogejF6VEWj2n8V/Z3/ulXC X-Received: by 2002:a81:4cc2:0:b0:59b:cd92:779f with SMTP id z185-20020a814cc2000000b0059bcd92779fmr1271002ywa.6.1698265510861; Wed, 25 Oct 2023 13:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698265510; cv=none; d=google.com; s=arc-20160816; b=YMtpjTw0OZy/Np+zMpoqbu8REq72jA/Rz9ga50sSdjzFCFk06uvWQcGQWyzxXqKqy1 iRsBLoKUmsDu5jLnWdWweHOpBKzBLp2zpimCCz+F+ip9mE2nO95bNh6IJEzCy0LzS+5U +XJsJHhVixDkNM31/dGjR9qhObPcMK9Jfaj34rqkNClPWuCIBz/hBZpXWN7gSmNsDmIB Gojj9v5vxyZdW+8LCmXhGMn5tKtfcPwhuHCvEaAw2rut3ock3X9FwJSOysRHlKyrq2aN tA5biIbqnJXyMY9KToRodZXThq1gUyxZWAxGOpmylcl+V5L3AqsPACD8eO7lAJRBRcPk QYjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=J8S/JDCmwBJX/s4tcuif01AJjqTYAtUjVSzvHHCYv3Q=; fh=/fEAwM0ftwV2z3MN/iSYq1lv8IFPZ2fY8Kg8RoFcxjU=; b=V9f2+SpDyponSbBoUWQsHyVLR7WtWJe9Atyt5p2JnjnW6gkXUDvjR+kjZWSPq19rQ6 smSe6MPHF20v9Od6nOIptUXGiTuhpGQDYe4Y1IK+Y3ghV7YgFVzLAFCPPJwo0DADavTF 2P8YLMDy+WOL099aUuT3NGb3poFIShHOIBQ71sJYnA9m56Sy8jIPEEjjPBnqCQRJ6nLZ PKZU9SLQeyyakdHDw+G4f4S6vWW7qtS1KvmfRBTqJuC2ENVQFtCfNyvwxL/zl5v7zz7D MHow/6Nk4c/ZzaMzXVZ2TKMq+HePNCURPELem29pJUlPmxVxR+ArCZfODr2bmjo3+CWg Xp8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=nNqvGjA6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id u10-20020a81470a000000b0056953ab0638si11637104ywa.392.2023.10.25.13.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 13:25:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=nNqvGjA6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 854418053616; Wed, 25 Oct 2023 13:25:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234894AbjJYUY6 (ORCPT <rfc822;a1648639935@gmail.com> + 25 others); Wed, 25 Oct 2023 16:24:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234833AbjJYUYl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Oct 2023 16:24:41 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B7BF183 for <linux-kernel@vger.kernel.org>; Wed, 25 Oct 2023 13:24:38 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6bd73395bceso116562b3a.0 for <linux-kernel@vger.kernel.org>; Wed, 25 Oct 2023 13:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1698265477; x=1698870277; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J8S/JDCmwBJX/s4tcuif01AJjqTYAtUjVSzvHHCYv3Q=; b=nNqvGjA6QPmPkU0pIK+PisNTyVgj2VgA4U5e51WIi1UAtB68oOcDrAFNkopUNesM5k x5L/8RGmTh7GA0rwpMIDrGTAfFijRQogXgvaxhxfntL7XlcCcztZsFKcL45pLMhuRGcP HDaG3Z2kIzvvvvrPWQh+rvSak5AwjfkNG5+O6B6BLQxWc+MTHPvMxYWttNwgWppF25vJ glcd/sy1FvIwxr7bfe//85NgZBsIJ+qhTJAByTugflLc9l77og8LLV94aKgAb/i72lJx V4qVcEQj5eXnFn3BigSXcUMY7LN3Zr7E5hveMCoS84pk0QvbHq4XbsyfXz85Gezfp/m6 Tuvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698265477; x=1698870277; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J8S/JDCmwBJX/s4tcuif01AJjqTYAtUjVSzvHHCYv3Q=; b=E40DiD5HY6sbrwxKjOcn/Q+x3z9itz1WhMPaMn7IJSuSLrzx8rAw37lyFCMmtEpTXX XJd8l2yM/QOIt9qzd12FN9ayUE/5UNk8h480s3ILGVynyEOZd12L7JGFpbzqhoky/g0I 8wl85HHfhm5j9lSJL7MIRXi4uqtIOkhuEdOMs89xX7hlz5GhqSOVDddSDfSEz7WWCF38 8zi5anjRDt68sEcRwO+wTrJ2OquiaW6IJdwxed0KH4+W+cMsVFwPEvt5oh85l5a09XWO drSagMXrtUkNV+O06I1HivJxS/1TMirnJp0nWxvY0JZxZXGekBAk/CT7hT5LRXdk/78Q iGQQ== X-Gm-Message-State: AOJu0Yx6ZNcZ+B7UkFHRp/G/W9oQngOiy9jcO10VJQsR5iIyz1OkIYbR 3d9Z44wcexo2cpQqrUeHF+CqMQ== X-Received: by 2002:a05:6a00:1396:b0:68f:b015:ea99 with SMTP id t22-20020a056a00139600b0068fb015ea99mr913751pfg.10.1698265477463; Wed, 25 Oct 2023 13:24:37 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.188.78]) by smtp.gmail.com with ESMTPSA id y3-20020aa79423000000b006b84ed9371esm10079590pfo.177.2023.10.25.13.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 13:24:37 -0700 (PDT) From: Sunil V L <sunilvl@ventanamicro.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-serial@vger.kernel.org Cc: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, "Rafael J . Wysocki" <rafael@kernel.org>, Len Brown <lenb@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Anup Patel <anup@brainfault.org>, Thomas Gleixner <tglx@linutronix.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, Conor Dooley <conor.dooley@microchip.com>, Andrew Jones <ajones@ventanamicro.com>, Atish Kumar Patra <atishp@rivosinc.com>, Haibo Xu <haibo1.xu@intel.com>, Sunil V L <sunilvl@ventanamicro.com> Subject: [RFC PATCH v2 05/21] pnp.h: Return -EPROBE_DEFER for disabled IRQ resource in pnp_irq() Date: Thu, 26 Oct 2023 01:53:28 +0530 Message-Id: <20231025202344.581132-6-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231025202344.581132-1-sunilvl@ventanamicro.com> References: <20231025202344.581132-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 25 Oct 2023 13:25:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780760456161281915 X-GMAIL-MSGID: 1780760456161281915 |
Series |
RISC-V: ACPI: Add external interrupt controller support
|
|
Commit Message
Sunil V L
Oct. 25, 2023, 8:23 p.m. UTC
To support deferred PNP driver probe, pnp_irq() must return -EPROBE_DEFER
so that the device driver can do deferred probe if the interrupt controller
is not probed early.
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
---
include/linux/pnp.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
Comments
On Wed, Oct 25, 2023 at 10:24 PM Sunil V L <sunilvl@ventanamicro.com> wrote: > > To support deferred PNP driver probe, pnp_irq() must return -EPROBE_DEFER > so that the device driver can do deferred probe if the interrupt controller > is not probed early. > > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> > --- > include/linux/pnp.h | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/include/linux/pnp.h b/include/linux/pnp.h > index c2a7cfbca713..21cf833789fb 100644 > --- a/include/linux/pnp.h > +++ b/include/linux/pnp.h > @@ -147,12 +147,18 @@ static inline resource_size_t pnp_mem_len(struct pnp_dev *dev, > } > > > -static inline resource_size_t pnp_irq(struct pnp_dev *dev, unsigned int bar) > +static inline int pnp_irq(struct pnp_dev *dev, unsigned int bar) > { > struct resource *res = pnp_get_resource(dev, IORESOURCE_IRQ, bar); > > - if (pnp_resource_valid(res)) > + if (pnp_resource_valid(res)) { > +#if IS_ENABLED(CONFIG_ARCH_ACPI_DEFERRED_GSI) > + if (!pnp_resource_enabled(res)) > + return -EPROBE_DEFER; > +#endif What would be wrong with if (IS_ENABLED(CONFIG_ARCH_ACPI_DEFERRED_GSI) && !pnp_resource_enabled(res)) return -EPROBE_DEFER; ? > + > return res->start; > + } > return -1; > } > > -- > 2.39.2 >
On Thu, Feb 01, 2024 at 07:00:51PM +0100, Rafael J. Wysocki wrote: > On Wed, Oct 25, 2023 at 10:24 PM Sunil V L <sunilvl@ventanamicro.com> wrote: > > > > To support deferred PNP driver probe, pnp_irq() must return -EPROBE_DEFER > > so that the device driver can do deferred probe if the interrupt controller > > is not probed early. > > > > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> > > --- > > include/linux/pnp.h | 10 ++++++++-- > > 1 file changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/include/linux/pnp.h b/include/linux/pnp.h > > index c2a7cfbca713..21cf833789fb 100644 > > --- a/include/linux/pnp.h > > +++ b/include/linux/pnp.h > > @@ -147,12 +147,18 @@ static inline resource_size_t pnp_mem_len(struct pnp_dev *dev, > > } > > > > > > -static inline resource_size_t pnp_irq(struct pnp_dev *dev, unsigned int bar) > > +static inline int pnp_irq(struct pnp_dev *dev, unsigned int bar) > > { > > struct resource *res = pnp_get_resource(dev, IORESOURCE_IRQ, bar); > > > > - if (pnp_resource_valid(res)) > > + if (pnp_resource_valid(res)) { > > +#if IS_ENABLED(CONFIG_ARCH_ACPI_DEFERRED_GSI) > > + if (!pnp_resource_enabled(res)) > > + return -EPROBE_DEFER; > > +#endif > > What would be wrong with > > if (IS_ENABLED(CONFIG_ARCH_ACPI_DEFERRED_GSI) && !pnp_resource_enabled(res)) > return -EPROBE_DEFER; > > ? Hi Rafael, Actually, this is v2 version of the patch and there is recent v3. Please take a look at [1] for the latest version. However, your comment is still valid for v3. I will update as you mentioned. [1] - https://lore.kernel.org/linux-arm-kernel/20231219174526.2235150-7-sunilvl@ventanamicro.com/ Thanks, Sunil > > > + > > return res->start; > > + } > > return -1; > > } > > > > -- > > 2.39.2 > >
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index c2a7cfbca713..21cf833789fb 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -147,12 +147,18 @@ static inline resource_size_t pnp_mem_len(struct pnp_dev *dev, } -static inline resource_size_t pnp_irq(struct pnp_dev *dev, unsigned int bar) +static inline int pnp_irq(struct pnp_dev *dev, unsigned int bar) { struct resource *res = pnp_get_resource(dev, IORESOURCE_IRQ, bar); - if (pnp_resource_valid(res)) + if (pnp_resource_valid(res)) { +#if IS_ENABLED(CONFIG_ARCH_ACPI_DEFERRED_GSI) + if (!pnp_resource_enabled(res)) + return -EPROBE_DEFER; +#endif + return res->start; + } return -1; }