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=-8.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 2D4F8C48BDF for ; Fri, 18 Jun 2021 08:00:02 +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 E862D61139 for ; Fri, 18 Jun 2021 08:00:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E862D61139 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ld+KGV/UFKyzq2rEQuMjwbw7+s/qFv2RwTwTSg8o1a4=; b=N0i0rRbzjwz+ue r9zTPVRpKRr2iPwbDknnTqXUyo74S5GpJWsY+JXwY4QF4saKwo6Ka5LPm97DdigGQEe/5EOwLWjB/ 4SdoIXx1kFd5hMIgYuh62STs3QfN0lEayZENj08YI2bmZ0DJ70+njqEMy/5A+ZdCA7DvnU2HTMjoB K3j7CmBekbaC0WCgQuyachpbun3RD7G28VrJwy7B08hj3ufrqmR9ZRzpMR/zcDL0VGEuCgAbmoB4M cmyIIOodeUfLE9B8TxLmYWPNPgxLfo5DEs7UN89rHWo1fE2opQoiSUKEJsp9guuDgOB9CO2zrGTnW TEK2vYrjvNHYwi4mQLBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lu9Nj-00DBDV-1V; Fri, 18 Jun 2021 07:57:40 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lu9L0-00D9oj-3l for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 07:54:51 +0000 Received: by mail-ed1-x530.google.com with SMTP id t3so7362044edc.7 for ; Fri, 18 Jun 2021 00:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=o2WQZjhwoaHMxBb+srOde8YwelPLzLRldEZbtvlgRGU=; b=k1T0ECGGh1W0dhEm5YpW3R4tr4w2ouXUmoAkc4fnu+nm3wfGl1D/XzfrjxPVvNpD9R GUN87sw+XheVvqk6OE0++OuYZdogI1z1/Z+Lp7EcaWueCIl0eiIDcgBLTpL+k3ODqRRi o1irouPqfd1Q1/YN2nVPDXvXxcg204pgHRGlmEY1D6DM1HPSCvgbILp/o8l/Wvkr0Iw3 rGuOE9LxvMTkCXpX5w0+1LTUHt3sZIF4mC2s2Skw8CTsGlTa12/M8ao345z4GdUAlnPd JDFt5F5xmanD8rpTrdfn3E8eDxfl207dVuGecnb6ZmTyEXAW4IxIunr2hSUFxui1Sf+u +S/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=o2WQZjhwoaHMxBb+srOde8YwelPLzLRldEZbtvlgRGU=; b=rtLv1l4JM5H29bokXnO39aX0z+LQ1AsBVuzBENgrcbBc0RnyiefZStYf57pxfoaY9G F6uApHVFH7Jd2rr7V/VjcRc532Nm1anpKNZPeDDc1coKKUo0PyVCevzI7ZCD3o7ukTUh 3GxpGlAWDX6Vqdr8KkRUE+blbgUqUHWRUKTgybwLnpVlb0wXiftMLiPUJQRYi5Fyd7Cn gUf5xK3zuqRXCI9C4TTL7DofPPAI6Lpzz3cKkyJT2KZ3HzGftlv5xlX19Dbib0Yz65CH npAK4RXjZlNKiFe+7W0Z4Sk95+SGBX8e8aFJ8w9EOM9ImHhVMyT09qvJIkIoHcjJs4xF 8KTw== X-Gm-Message-State: AOAM53220x4zPFlapPZP4DKHbL0SuB1dodxiugoox0re4UtawhcJXNJf w1F58eCjVwYeAfUkKW6tpHHUCw== X-Google-Smtp-Source: ABdhPJw47GTVGsZ2XZZsLWgVTPMHWXGLZ9JfMKbH6mO4cozlyWGnWGY9YGBYGbYr6USC4QNEMkKYww== X-Received: by 2002:a05:6402:4395:: with SMTP id o21mr3261040edc.163.1624002887797; Fri, 18 Jun 2021 00:54:47 -0700 (PDT) Received: from myrica (adsl-84-226-111-173.adslplus.ch. [84.226.111.173]) by smtp.gmail.com with ESMTPSA id j22sm680988eje.123.2021.06.18.00.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 00:54:47 -0700 (PDT) Date: Fri, 18 Jun 2021 09:54:28 +0200 From: Jean-Philippe Brucker To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Len Brown , Joerg Roedel , "Michael S. Tsirkin" , Will Deacon , Catalin Marinas , Lu Baolu , David Woodhouse , ACPI Devel Maling List , "open list:AMD IOMMU (AMD-VI)" , virtualization@lists.linux-foundation.org, Linux ARM , Eric Auger , sebastien.boeuf@intel.com, Robin Murphy , kevin.tian@intel.com, Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla Subject: Re: [PATCH v4 3/6] ACPI: Add driver for the VIOT table Message-ID: References: <20210610075130.67517-1-jean-philippe@linaro.org> <20210610075130.67517-4-jean-philippe@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_005450_216263_6260AB3A X-CRM114-Status: GOOD ( 23.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 17, 2021 at 01:50:59PM +0200, Rafael J. Wysocki wrote: > > diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c > > index be7da23fad76..b835ca702ff0 100644 > > --- a/drivers/acpi/bus.c > > +++ b/drivers/acpi/bus.c > > @@ -27,6 +27,7 @@ > > #include > > #endif > > #include > > +#include > > #include > > #include > > #include > > @@ -1339,6 +1340,7 @@ static int __init acpi_init(void) > > pci_mmcfg_late_init(); > > acpi_iort_init(); > > acpi_scan_init(); > > + acpi_viot_init(); > > Is there a specific reason why to call it right here? > > In particular, does it need to be called after acpi_scan_init()? And > does it need to be called before the subsequent functions? If so, > then why? It does need to be called after acpi_scan_init(), because it relies on struct device and their fwnode to be initialized. In particular to find a PCI device we call pci_get_domain_bus_and_slot(), which needs the PCI topology made available by acpi_scan_init(). It does not need to be before the subsequent functions however, I can move it at the end. > > +void __init acpi_viot_init(void) > > +{ > > + int i; > > + acpi_status status; > > + struct acpi_table_header *hdr; > > + struct acpi_viot_header *node; > > + > > + status = acpi_get_table(ACPI_SIG_VIOT, 0, &hdr); > > + if (ACPI_FAILURE(status)) { > > + if (status != AE_NOT_FOUND) { > > + const char *msg = acpi_format_exception(status); > > + > > + pr_err("Failed to get table, %s\n", msg); > > + } > > + return; > > + } > > + > > + viot = (void *)hdr; > > + > > + node = ACPI_ADD_PTR(struct acpi_viot_header, viot, viot->node_offset); > > + for (i = 0; i < viot->node_count; i++) { > > + if (viot_parse_node(node)) > > + return; > > + > > + node = ACPI_ADD_PTR(struct acpi_viot_header, node, > > + node->length); > > + } > > Do you still need the table after the above is complete? If not, > release the reference on it acquired above. We don't need the table anymore, I'll drop the reference Thanks, Jean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel