On 2/6/23 3:17 PM, Lukas Wunner wrote:
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.
v6.2-rc7. See commit 4/18. That's where it's introduced. I adapted it
from ACPI entries parsing code.
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.
Yes, but we may have more than 1 DSMAS right? Plus having to parse the
DSLBIS entries as well, may be better to just have a common parsing
routine to deal with all that.
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