From: Ben Cheatham <benjamin.cheatham@amd.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: rafael@kernel.org, dan.j.williams@intel.com,
linux-cxl@vger.kernel.org, linux-acpi@vger.kernel.org,
bhelgaas@google.com, yazen.ghannam@amd.com
Subject: Re: [PATCH v5 1/3] CXL, PCIE: Add cxl_rcrb_addr file to dport_dev
Date: Wed, 27 Sep 2023 10:30:27 -0500 [thread overview]
Message-ID: <f449aa4c-11ac-89a4-7f45-c32d44ac366c@amd.com> (raw)
In-Reply-To: <20230926202343.GA419574@bhelgaas>
Hi Bjorn, thanks for taking a look!
On 9/26/23 3:23 PM, Bjorn Helgaas wrote:
> On Mon, Sep 25, 2023 at 03:01:25PM -0500, Ben Cheatham wrote:
>> Add cxl_rcrb_addr to the dport_dev (normally represented by a pcie
>> device) for CXL RCH root ports. The file will print the RCRB base
>> MMIO address of the root port when read and will be used by
>> users looking to inject CXL EINJ error types for RCH hosts.
>
> I guess this is talking about a sysfs file? If so, maybe mention that
> explicitly in the subject and commit log.
>
> I don't know how you decided to capitalize CXL initialisms and not
> "pcie", but I usually use "PCIe".
>
Sorry about that, it's a typo. I should've written PCIE/PCIe.
>> +static struct cxl_port *cxl_root;
>> +
>> +void set_cxl_root(struct cxl_port *root_port)
>> +{
>> + cxl_root = root_port;
>> +}
>
> Is there always at most one cxl_root? Seems worth a one-line comment
> at the static data item, since in the world of devices, data is
> usually in a per-device struct, not in a single static item.
>
I thought that the root was a singleton, but per Dan's comment it seems
that isn't the case.
>> @@ -1021,6 +1074,11 @@ __devm_cxl_add_dport(struct cxl_port *port, struct device *dport_dev,
>> if (rc)
>> return ERR_PTR(rc);
>>
>> + rc = sysfs_create_group(&dport_dev->kobj, &cxl_rcrb_addr_group);
>> + if (rc)
>> + dev_dbg(dport_dev, "Couldn't create cxl_rcrb_addr group: %d\n",
>> + rc);
>
> Is there any way to create this with an attribute group that the sysfs
> infrastructure adds automatically? I'm not suggesting you have a race
> condition here, but using the sysfs infrastructure avoids a lot of
> potential problems.
>
I would need to look into it more. I did it this way because I wasn't sure
there was a way to set it up statically since the dport_dev can match a
couple of different device types. After looking at Dan's comments I will
probably move away from making this file altogether and move the functionality
under sysfs/debug/cxl.
> Bjorn
next prev parent reply other threads:[~2023-09-27 15:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 20:01 [PATCH v5 0/3] CXL, ACPI, APEI, EINJ: Update EINJ for CXL 1.1 error types Ben Cheatham
2023-09-25 20:01 ` [PATCH v5 1/3] CXL, PCIE: Add cxl_rcrb_addr file to dport_dev Ben Cheatham
2023-09-26 10:50 ` Jonathan Cameron
2023-09-26 16:00 ` Ben Cheatham
2023-09-26 20:23 ` Bjorn Helgaas
2023-09-27 15:30 ` Ben Cheatham [this message]
2023-09-26 21:15 ` Dan Williams
2023-09-27 15:31 ` Ben Cheatham
2023-09-25 20:01 ` [PATCH v5 2/3] ACPI, APEI, EINJ: Add CXL 1.1 EINJ error type support Ben Cheatham
2023-09-26 11:04 ` Jonathan Cameron
2023-09-26 16:00 ` Ben Cheatham
2023-09-26 20:22 ` Bjorn Helgaas
2023-09-27 15:31 ` Ben Cheatham
2023-09-26 21:36 ` Dan Williams
2023-09-27 15:32 ` Ben Cheatham
2023-09-25 20:01 ` [PATCH v5 3/3] ACPI, APEI, EINJ: Update EINJ documentation Ben Cheatham
2023-09-26 11:05 ` Jonathan Cameron
2023-09-26 16:00 ` Ben Cheatham
2023-09-26 20:24 ` Bjorn Helgaas
2023-09-27 15:31 ` Ben Cheatham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f449aa4c-11ac-89a4-7f45-c32d44ac366c@amd.com \
--to=benjamin.cheatham@amd.com \
--cc=bhelgaas@google.com \
--cc=dan.j.williams@intel.com \
--cc=helgaas@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=yazen.ghannam@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox