From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "dave@stgolabs.net" <dave@stgolabs.net>
Cc: lkp <lkp@intel.com>, "rafael@kernel.org" <rafael@kernel.org>,
"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
"Jonathan.Cameron@Huawei.com" <Jonathan.Cameron@Huawei.com>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
"Moore, Robert" <robert.moore@intel.com>,
"bhelgaas@google.com" <bhelgaas@google.com>
Subject: Re: [PATCH 2/2] acpi/pci_root: negotiate CXL _OSC
Date: Wed, 23 Mar 2022 18:29:16 +0000 [thread overview]
Message-ID: <86f0bc64bc2173f7c061a96a290b540b2710f614.camel@intel.com> (raw)
In-Reply-To: <20220323004753.qkngm4yctprcgvoc@offworld>
On Tue, 2022-03-22 at 17:47 -0700, Davidlohr Bueso wrote:
> On Fri, 18 Mar 2022, Vishal Verma wrote:
>
> > +/* Max possible _OSC capability DWORDS */
> > +#define OSC_CAPABILITY_DWORDS_MAX 5
> > +
> > /* Indexes into _OSC Capabilities Buffer (DWORDs 2 & 3 are device-specific) */
> > #define OSC_QUERY_DWORD 0 /* DWORD 1 */
> > #define OSC_SUPPORT_DWORD 1 /* DWORD 2 */
> > #define OSC_CONTROL_DWORD 2 /* DWORD 3 */
> > +#define OSC_CXL_SUPPORT_DWORD 3 /* DWORD 4 */
> > +#define OSC_CXL_CONTROL_DWORD 4 /* DWORD 5 */
>
> Shouldn't all this be in patch 1/2 (and also as enum maybe)? Or at least
> the define OSC_CAPABILITY_DWORDS_MAX instead of having to do:
Yeah moving DWORDS_MAX and the associated changes to patch 1 makes
sense.
>
> > -static acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 support)
> > +static acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask,
> > + u32 support, u32 *cxl_mask,
> > + u32 cxl_support)
> > {
> > u32 req = OSC_PCI_EXPRESS_CAPABILITY_CONTROL;
> > struct acpi_pci_root *root;
> > acpi_status status;
> > - u32 ctrl, capbuf[6];
> > + u32 ctrl, cxl_ctrl = 0, capbuf[OSC_CAPABILITY_DWORDS_MAX];
>
> ... which btw why is capbuf 6 in the previous patch and now 5 in this one?
> Sorry if I missed anything obvious here, just seems odd.
Oh, I just noticed patch 1 changes it to 6 in the first place (I
thought it was just 6 even before this set), that is wrong. Previously,
the PCI only _OSC had 3, and with CXL it becomes 5. I'll fix this up.
>
> And also it's ugly to just add extra params to acpi_pci_osc_control_set()
> and have callers do do:
>
> > + status = acpi_pci_osc_control_set(handle, &control, support,
> > + &cxl_control, cxl_support);
>
> And this sort of thing happens all over the patch with struct acpi_pci_root.
> So the whole handling of the _OSC state of support/control bits imo really
> wants to be consolidated between CXL and non-CXL.
I don't disagree :) - Any thoughts on what can be done to consolidate
things further? This seemed like the lowest touch approach that kept
existing PCI-only paths as-is.
>
> Thanks,
> Davidlohr
Thanks for the review!
next prev parent reply other threads:[~2022-03-23 18:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 21:30 [PATCH 0/2] acpi: add support for CXL _OSC Vishal Verma
2022-03-18 21:30 ` [PATCH 1/2] PCI/ACPI: Use CXL _OSC instead of PCIe _OSC Vishal Verma
2022-03-22 18:01 ` Rafael J. Wysocki
2022-03-22 18:08 ` Dan Williams
2022-03-23 19:23 ` Rafael J. Wysocki
2022-03-23 20:39 ` Dan Williams
2022-03-18 21:30 ` [PATCH 2/2] acpi/pci_root: negotiate CXL _OSC Vishal Verma
2022-03-22 18:22 ` Rafael J. Wysocki
2022-03-23 0:47 ` Davidlohr Bueso
2022-03-23 18:29 ` Verma, Vishal L [this message]
2022-03-23 19:02 ` Dan Williams
2022-03-23 19:25 ` Rafael J. Wysocki
2022-03-25 23:11 ` Verma, Vishal L
2022-03-18 21:34 ` [PATCH 0/2] acpi: add support for " Verma, Vishal L
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=86f0bc64bc2173f7c061a96a290b540b2710f614.camel@intel.com \
--to=vishal.l.verma@intel.com \
--cc=Jonathan.Cameron@Huawei.com \
--cc=bhelgaas@google.com \
--cc=dan.j.williams@intel.com \
--cc=dave@stgolabs.net \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=lkp@intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.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