Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2823586rda; Wed, 25 Oct 2023 13:25:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4n2qmr1w3WqtMcL45xMA0GrsBGN+Sr3Zvdszlib15VXIkloq70Iqsil62aRrZ7OpJmfPv X-Received: by 2002:a81:ad1d:0:b0:5a8:1a54:ba4b with SMTP id l29-20020a81ad1d000000b005a81a54ba4bmr1370829ywh.13.1698265518284; Wed, 25 Oct 2023 13:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698265518; cv=none; d=google.com; s=arc-20160816; b=o11Gz8+GrRP44RNNOLJ0vDW0h73Lkqh6llpJBep6qJFEa+rFH5Ikcmhz4UXcoxs2PY 56f6t3mqkKwnaDHPHonjuHDyVJ/LmrdTQyZSAiOniISCaXuHScq5cBjDq4jti17TcXMF my+3mHjD8hpAkIY9uOmfoA+xbfw69KHLS/lj4G0w48TNRPXMwDG6RxfF/2QeLsFD/6oh lFwCBaeJW5QJqWXbOrL6Czf+goNpItKoM43Yc0limlHgEmTHGWophkfFz9B6HW7jEvjA JRtxyAbFfPkamY2qrqU5myxwqG9dv/x9q165t6cX+9DJyNabPDyX6EAfJtWrn0L0dAwe /IRQ== 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 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id v134-20020a81488c000000b005a7b9e995bfsi12757636ywa.294.2023.10.25.13.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 13:25:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; 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 2620:137:e000::3:3 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 4FEAD817C8BD; Wed, 25 Oct 2023 13:25:14 -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 S234182AbjJYUY6 (ORCPT + 99 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 ); 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 ; Wed, 25 Oct 2023 13:24:38 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6bd73395bceso116562b3a.0 for ; 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 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 , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Anup Patel , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , Conor Dooley , Andrew Jones , Atish Kumar Patra , Haibo Xu , Sunil V L 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: 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:14 -0700 (PDT) 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 --- 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 + return res->start; + } return -1; } -- 2.39.2