public inbox for linux-cxl@vger.kernel.org
 help / color / mirror / Atom feed
From: Yanfei Xu <yanfei.xu@intel.com>
To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: <linux-cxl@vger.kernel.org>, <dave@stgolabs.net>,
	<dave.jiang@intel.com>, <alison.schofield@intel.com>,
	<vishal.l.verma@intel.com>, <ira.weiny@intel.com>,
	<dan.j.williams@intel.com>, <ming4.li@intel.com>
Subject: Re: [v3 3/4] cxl/pci: Check Mem_info_valid bit for each applicable DVSEC
Date: Wed, 28 Aug 2024 10:54:11 +0800	[thread overview]
Message-ID: <42548dc4-5b88-4d68-a46e-540027fe015b@intel.com> (raw)
In-Reply-To: <20240827172228.00001207@Huawei.com>



On 8/28/2024 12:22 AM, Jonathan Cameron wrote:
> On Tue, 13 Aug 2024 19:05:31 +0800
> Yanfei Xu <yanfei.xu@intel.com> wrote:
> 
>> The right way is to checking Mem_info_valid bit for each applicable
>> DVSEC range against HDM_COUNT, not only for the DVSEC range 1, hence
>> let's move the check into the "for loop" of handling each DVSEC range.
> Say why it's the 'right' way.   I agree it probably is, but more
> detail in this patch description would be good.
> I assume it's as simple as
> "In theory a device might set the mem_info_valid bit for a first range
>   after it is ready but before as second range has reached that state."
> 
> If so looks fine to me and with that additional detail,
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Make sense, will do in v4. Thanks for your review!

> 
> 
>>
>> Signed-off-by: Yanfei Xu <yanfei.xu@intel.com>
>> ---
>>   drivers/cxl/core/pci.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c
>> index 38c567727dbb..519989ada48e 100644
>> --- a/drivers/cxl/core/pci.c
>> +++ b/drivers/cxl/core/pci.c
>> @@ -324,10 +324,6 @@ int cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
>>   	if (!hdm_count || hdm_count > 2)
>>   		return -EINVAL;
>>   
>> -	rc = cxl_dvsec_mem_range_valid(cxlds, 0);
>> -	if (rc)
>> -		return rc;
>> -
>>   	/*
>>   	 * The current DVSEC values are moot if the memory capability is
>>   	 * disabled, and they will remain moot after the HDM Decoder
>> @@ -345,6 +341,10 @@ int cxl_dvsec_rr_decode(struct device *dev, struct cxl_port *port,
>>   		u64 base, size;
>>   		u32 temp;
>>   
>> +		rc = cxl_dvsec_mem_range_valid(cxlds, i);
>> +		if (rc)
>> +			return rc;
>> +
>>   		rc = pci_read_config_dword(
>>   			pdev, d + CXL_DVSEC_RANGE_SIZE_HIGH(i), &temp);
>>   		if (rc)
> 
> 


  reply	other threads:[~2024-08-28  2:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 11:05 [v3 0/4] Fixes for hdm docoder initialization from DVSEC ranges Yanfei Xu
2024-08-13 11:05 ` [v3 1/4] cxl/pci: Fix to record only non-zero ranges Yanfei Xu
2024-08-27 16:11   ` Jonathan Cameron
2024-08-13 11:05 ` [v3 2/4] cxl/pci: Remove duplicated implementation of waiting for memory_info_valid Yanfei Xu
2024-08-27 16:16   ` Jonathan Cameron
2024-08-28  2:49     ` Yanfei Xu
2024-08-13 11:05 ` [v3 3/4] cxl/pci: Check Mem_info_valid bit for each applicable DVSEC Yanfei Xu
2024-08-27 16:22   ` Jonathan Cameron
2024-08-28  2:54     ` Yanfei Xu [this message]
2024-08-13 11:05 ` [v3 4/4] cxl/pci: simplify the check of mem_enabled in cxl_hdm_decode_init() Yanfei Xu
2024-08-27 16:25   ` Jonathan Cameron
2024-08-27  5:04 ` [v3 0/4] Fixes for hdm docoder initialization from DVSEC ranges Yanfei Xu
2024-08-27 16:08 ` Jonathan Cameron
2024-08-28  2:45   ` Yanfei Xu

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=42548dc4-5b88-4d68-a46e-540027fe015b@intel.com \
    --to=yanfei.xu@intel.com \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ming4.li@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox