Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2823523rda; Wed, 25 Oct 2023 13:25:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGjwY/FwK3aF5zE5kyL3chQHWPejsMcvvxJhdvEcCimYOUwWwhowe9S8NIdoap7UuMyy2Qk X-Received: by 2002:a54:4017:0:b0:3af:583d:3c5d with SMTP id x23-20020a544017000000b003af583d3c5dmr14821532oie.52.1698265511727; Wed, 25 Oct 2023 13:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698265511; cv=none; d=google.com; s=arc-20160816; b=iDfU+vLpzXDX56qAidzewHzDYoiyWq9Gv90fX17wQV4rxGVSlJt1JpBiHQb2ALKkY+ mSm+FJIq5PCd8FDZghMPXZ8xn6ehKubmNZbs3G1CsFruF8jq8jpM+flSVP6+7Hq6k9DF 4Rw5olhK1PetcrCbXgi0v69YHV5aAuFnutVmaoI7w3+8M9CjCjW+UeazVhAh8WbIV7aV NAa/zfPRH+dzUxHw1trv/gsewyRBZCBQb3zM4vdd6kBMbKYa0eM8JNv6sLI2fdxZMiTu kv+ZJMD1t16pIZy5f8S2mlIVVTE5MnQkVHZr3REsn/ZRd36H25UrHw7GO8CSB0i6ikk2 384A== 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=6XsFHpyMSXpsQo/vHxUfuExbd7P0HKVdbzIKlbRfdpg=; fh=/fEAwM0ftwV2z3MN/iSYq1lv8IFPZ2fY8Kg8RoFcxjU=; b=Xe53cCp9XtvAdD0THKJgsikeIdg9Bkuz5BziAiDF2agLkJR8K7rtSmKGXeelW6gr0N J4H0ZUvllDo6ROLJN9fwaLOOdSpz7bp9MWD8YOz8RgatYv95GYstOSOdVu0Sq87jvZ7H vRkysPqoptbG2c5d4v1RWvpcmJS4F8pCGV/EdE9MqP58uIQE3bGLUtlXxi1cPGX0IANX GwTYtQlVXd2eOKnti2R6a4/iVVo9dU1bYY9B1db8REeYVZDPSWJJMICvhQCCGF9Bf9b/ ahzvdzBh8QkXbWqHBZ02+X864DfdmQgr7RL2NoZO33QW4DQ9IDMN2meAvvhtntSfpIDN J6AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=IFtzf0U2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id r3-20020a254403000000b00d86e61ececasi11063876yba.712.2023.10.25.13.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 13:25:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=IFtzf0U2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id C2F3A81653B6; Wed, 25 Oct 2023 13:25:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234602AbjJYUYo (ORCPT + 99 others); Wed, 25 Oct 2023 16:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234863AbjJYUYe (ORCPT ); Wed, 25 Oct 2023 16:24:34 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 445D818D for ; Wed, 25 Oct 2023 13:24:32 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6b5e6301a19so144286b3a.0 for ; Wed, 25 Oct 2023 13:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1698265472; x=1698870272; 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=6XsFHpyMSXpsQo/vHxUfuExbd7P0HKVdbzIKlbRfdpg=; b=IFtzf0U28RD+GSQFbYyzqFLKa6bFdIIzW112ahFh3jc6XjWupq1EfHGncUr3/acJN2 xKkmXVXxG7yatZXJkIhLGItwrgVD0Shu6ZTXXUD3qqhwkOdQUdlLTtpvF94vrXozoQ// 7vYVru2vVcy5/m8p39WgVLXSfjDQTxXvsOry+mE87DCmz6tmOiX2VGR6bUCogS+y03ht aDoqwfgMZbvOU9gvHx6lvPJie+sezYV/17tHuqIsG3LsWt1nW3LjOC1fi2ZJGbIytPdX Nf49mk5iCdvFgyh9zAOJEnJxrAbxkpp8H3h/bPzVJ1EM9s+nVXXbBH8rkanHNFu/0ibM he6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698265472; x=1698870272; 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=6XsFHpyMSXpsQo/vHxUfuExbd7P0HKVdbzIKlbRfdpg=; b=GtfR46GqqZepzR6aTAWWvC9KITGdO740yqFct+9O/uDRVXK34kh5LxVaJ6S+VSmxv6 beZsL1xNqglOTJkcEzQ0G7swE1AI0TtDgVzrFe0NmsZOIKXiPMRDXty3sOoY1R/irfAQ mjVF3YwvSatm5kavE++R/4jm4N8eICUeVB5KuWPagnGQFQEs6NJKKTxFYUXHOJCwZdHk U0YuGqSBhkZ3JRP3+UqSB/ku2W0Gt3AB1CjMga4mgqr685UCCsB0RAMi3YhTj7wSu54J mjwG+X/FZqwkb77iSVgFTHmjs2rOOueZ81Hb235xH+o+tRdh8hVsHAf8Ikbp+RATHz/w PsVA== X-Gm-Message-State: AOJu0Yxpryu3QZH5sGM14LLJ9mxtu75R53QNj2zg6cIZZ1Vp00muMhZR pz6cfuHyHiY7VXeMmac2qs4azg== X-Received: by 2002:a05:6a00:2d86:b0:68a:59c6:c0a6 with SMTP id fb6-20020a056a002d8600b0068a59c6c0a6mr18973480pfb.24.1698265471729; Wed, 25 Oct 2023 13:24:31 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 13:24:31 -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 04/21] ACPI: irq: Add support for deferred probe in acpi_register_gsi() Date: Thu, 26 Oct 2023 01:53:27 +0530 Message-Id: <20231025202344.581132-5-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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 25 Oct 2023 13:25:08 -0700 (PDT) The chip which provides the GSI support may not be initialized at the time of acpi_register_gsi(). Return -EPROBE_DEFER to support deferred probing similar to acpi_irq_get(). Signed-off-by: Sunil V L --- drivers/acpi/irq.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c index 1687483ff319..c06cfc9725cb 100644 --- a/drivers/acpi/irq.c +++ b/drivers/acpi/irq.c @@ -51,19 +51,23 @@ EXPORT_SYMBOL_GPL(acpi_gsi_to_irq); * @polarity: polarity of the GSI to be mapped * * Returns: a valid linux IRQ number on success + * -EPROBE_DEFER if irqdomain is not available. * -EINVAL on failure */ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity) { + struct irq_domain *domain; struct irq_fwspec fwspec; unsigned int irq; fwspec.fwnode = acpi_get_gsi_domain_id(gsi); - if (WARN_ON(!fwspec.fwnode)) { - pr_warn("GSI: No registered irqchip, giving up\n"); - return -EINVAL; - } + if (!fwspec.fwnode) + return -EPROBE_DEFER; + + domain = irq_find_matching_fwnode(fwspec.fwnode, DOMAIN_BUS_ANY); + if (!domain) + return -EPROBE_DEFER; fwspec.param[0] = gsi; fwspec.param[1] = acpi_dev_get_irq_type(trigger, polarity); -- 2.39.2