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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25A8CC61DA4 for ; Mon, 6 Feb 2023 22:27:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229515AbjBFW1J (ORCPT ); Mon, 6 Feb 2023 17:27:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjBFW1I (ORCPT ); Mon, 6 Feb 2023 17:27:08 -0500 X-Greylist: delayed 565 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 06 Feb 2023 14:27:05 PST Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37AF113500 for ; Mon, 6 Feb 2023 14:27:05 -0800 (PST) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 76C3D100D940E; Mon, 6 Feb 2023 23:17:38 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 3E3222EE138; Mon, 6 Feb 2023 23:17:38 +0100 (CET) Date: Mon, 6 Feb 2023 23:17:38 +0100 From: Lukas Wunner To: Dave Jiang Cc: linux-cxl@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, dan.j.williams@intel.com, ira.weiny@intel.com, vishal.l.verma@intel.com, alison.schofield@intel.com, rafael@kernel.org, bhelgaas@google.com, robert.moore@intel.com Subject: Re: [PATCH 16/18] cxl: Move reading of CDAT data from device to after media is ready Message-ID: <20230206221738.GB21823@wunner.de> References: <167571650007.587790.10040913293130712882.stgit@djiang5-mobl3.local> <167571670516.587790.14112456054041985666.stgit@djiang5-mobl3.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <167571670516.587790.14112456054041985666.stgit@djiang5-mobl3.local> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org On Mon, Feb 06, 2023 at 01:51:46PM -0700, Dave Jiang wrote: > --- a/drivers/cxl/port.c > +++ b/drivers/cxl/port.c > @@ -109,6 +106,8 @@ static int cxl_port_probe(struct device *dev) > return rc; > } > > + /* Cache the data early to ensure is_visible() works */ > + read_cdat_data(port); > if (port->cdat.table) { > rc = cdat_table_parse_dsmas(port->cdat.table, > cxl_dsmas_parse_entry, Which branch is this patch based on? I'm not seeing a function called cdat_table_parse_dsmas() in cxl/next. cxl_cdat_read_table() could be amended with a switch/case ladder which compares entry->type to acpi_cdat_type values and stores a pointer to an entry of interest e.g. in port->cdat->dsmas. Then you can use that pointer directly to find the dsmas in the CDAT and parse it. Note however that cxl_cdat_read_table() is refactored heavily by my DOE rework series (will submit v3 later this week): https://github.com/l1k/linux/commits/doe Thanks, Lukas