From: Ben Cheatham <benjamin.cheatham@amd.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: linux-cxl@vger.kernel.org, linux-pci@vger.kernel.org,
dave@stgolabs.net, jonathan.cameron@huawei.com,
dave.jiang@intel.com, alison.schofield@intel.com,
vishal.l.verma@intel.com, ira.weiny@intel.com,
dan.j.williams@intel.com, bhelgaas@google.com
Subject: Re: [RFC PATCH 3/6] pcie/cxl_timeout: Add CXL.mem timeout range programming
Date: Thu, 15 Feb 2024 16:21:48 -0600 [thread overview]
Message-ID: <ca61e1cc-5c72-4c56-b5d4-7442f25119a2@amd.com> (raw)
In-Reply-To: <20240215213519.GA1309984@bhelgaas>
On 2/15/24 3:35 PM, Bjorn Helgaas wrote:
> On Thu, Feb 15, 2024 at 01:40:45PM -0600, Ben Cheatham wrote:
>> Add programming of CXL.mem transaction timeout range (CXL 3.0 8.2.4.23.1
>> bits 4 & 11:8) through sysfs. To program the device, read the ranges
>> supported from "available_timeout_ranges" in the PCIe service device
>> directory, then write the desired value to "timeout_range". The current
>> value can be found by reading from "timeout_range".
>>
>> Example for CXL-enabled PCIe port 0000:0c:00.0, with CXL timeout
>> service as 020:
>> # cd /sys/bus/pci_express/devices/0000:0c:00.0:pcie020
>
> I would really, really like to avoid adding sysfs dependences on
> portdrv. Is there any chance these files could go in the normal
> /sys/bus/pci/devices/ hierarchy instead?
>
This was just the first place I tried putting it that seemed ok. I'll take a look
at moving them over to pci/devices instead.
>> +/* CXL 3.0 8.2.4.23.2 CXL Timeout and Isolation Control Register, bits 3:0 */
>> +#define CXL_TIMEOUT_TIMEOUT_RANGE_DEFAULT 0x0
>
>> +#define CXL_TIMEOUT_TIMEOUT_RANGE_D2 0xE
>
> Looks like the single other example in this file of hex constants
> using A-F uses lower-case.
>
> Does "TIMEOUT_TIMEOUT" add information over just "TIMEOUT"?
>
TIMEOUT_TIMEOUT is supposed to specify transaction timeout, but I'll agree it is
confusing. I could try changing to CXL_TRANSACTION_TIMEOUT_RANGE_* instead, but
it would break the convention of CXL timeout & isolation defines starting with
CXL_TIMEOUT.
>> +#define NUM_CXL_TIMEOUT_RANGES 9
>
> I don't think we actually need this constant, do we?
>
Not really, just gets rid of a magic number (as well as makes sure anyone who
changes that array remembers to update the array size).
>> +static bool cxl_validate_timeout_range(struct cxl_timeout *cxlt, u8 range)
>
> "validate" is not a very name for a function returning "bool" because
> you can't tell what true/false means from the name. "valid" would be
> fine.
>
Will change.
>> + pci_dbg(cxlt->dev->port,
>> + "Timeout & isolation timeout set to range 0x%x\n", range);
>
> I don't know CXL, but "timeout ... timeout" reads sort of strange. Is
> it actually a timeout for a timeout? Maybe it was supposed to be
> "transaction timeout"?
>
Yeah it's the same as above. I'll change it to "Timeout & isolation transaction timeout ..." instead.
>> +const struct cxl_timeout_range {
>> + const char *str;
>> + u8 range_val;
>> +} cxl_timeout_ranges[NUM_CXL_TIMEOUT_RANGES] = {
>
> Static?
>
Yep, I'll change it.
> Bjorn
>
next prev parent reply other threads:[~2024-02-15 22:21 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-15 19:40 [RFC PATCH 0/6] Implement initial CXL Timeout & Isolation support Ben Cheatham
2024-02-15 19:40 ` [RFC PATCH 1/6] cxl/core: Add CXL Timeout & Isolation capability parsing Ben Cheatham
2024-02-15 19:40 ` [RFC PATCH 2/6] pcie/cxl_timeout: Add CXL Timeout & Isolation service driver Ben Cheatham
2024-02-15 21:13 ` Bjorn Helgaas
2024-02-15 22:21 ` Ben Cheatham
2024-02-15 22:26 ` Bjorn Helgaas
2024-02-15 19:40 ` [RFC PATCH 3/6] pcie/cxl_timeout: Add CXL.mem timeout range programming Ben Cheatham
2024-02-15 21:35 ` Bjorn Helgaas
2024-02-15 22:21 ` Ben Cheatham [this message]
2024-02-15 22:29 ` Bjorn Helgaas
2024-02-15 22:30 ` Ben Cheatham
2024-02-15 19:40 ` [RFC PATCH 4/6] pcie/cxl_timeout: Add CXL.mem error isolation support Ben Cheatham
2024-02-15 21:49 ` Bjorn Helgaas
2024-02-15 22:21 ` Ben Cheatham
2024-02-15 19:40 ` [RFC PATCH 5/6] pcie/portdrv: Add CXL MSI/-X allocation Ben Cheatham
2024-02-15 21:51 ` Bjorn Helgaas
2024-02-15 22:22 ` Ben Cheatham
2024-02-15 19:40 ` [RFC PATCH 6/6] pcie/cxl_timeout: Add CXL.mem Timeout & Isolation interrupt support Ben Cheatham
2024-02-15 21:57 ` Bjorn Helgaas
2024-02-15 22:22 ` Ben Cheatham
2024-02-17 21:31 ` kernel test robot
2024-02-17 22:44 ` kernel test robot
2024-02-17 22:55 ` kernel test robot
2024-02-15 23:43 ` [RFC PATCH 0/6] Implement initial CXL Timeout & Isolation support Dan Williams
2024-03-25 15:15 ` Ben Cheatham
2024-03-25 15:54 ` Dan Williams
2024-04-01 19:41 ` 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=ca61e1cc-5c72-4c56-b5d4-7442f25119a2@amd.com \
--to=benjamin.cheatham@amd.com \
--cc=alison.schofield@intel.com \
--cc=bhelgaas@google.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=helgaas@kernel.org \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=vishal.l.verma@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.