[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87iktz9xae.fsf@yhuang6-desk2.ccr.corp.intel.com>
Date: Fri, 11 Oct 2024 10:40:57 +0800
From: "Huang, Ying" <ying.huang@...el.com>
To: Gregory Price <gourry@...rry.net>
Cc: Dan Williams <dan.j.williams@...el.com>, Dave Jiang
<dave.jiang@...el.com>, linux-cxl@...r.kernel.org,
linux-kernel@...r.kernel.org, Jonathan Cameron
<Jonathan.Cameron@...wei.com>, Davidlohr Bueso <dave@...olabs.net>,
Alison Schofield <alison.schofield@...el.com>, Vishal Verma
<vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>, Alejandro
Lucero <alucerop@....com>
Subject: Re: [RFC 3/5] cxl: Separate coherence from target type
"Huang, Ying" <ying.huang@...el.com> writes:
> Gregory Price <gourry@...rry.net> writes:
>
>> On Wed, Sep 25, 2024 at 10:46:45AM +0800, Huang Ying wrote:
[snip]
>
>>> @@ -1925,6 +1933,29 @@ static int cxl_region_attach(struct cxl_region *cxlr,
>>> return -ENXIO;
>>> }
>>>
>>> + /* Set the coherence of region to that of the first endpoint */
>>> + if (cxlr->coherence == CXL_DECODER_INVALIDCOH) {
>>> + unsigned long flags = cxlrd->cxlsd.cxld.flags;
>>> + enum cxl_decoder_coherence coherence = cxled->cxld.coherence;
>>> +
>>> + cxlr->coherence = coherence;
>>> + if ((coherence == CXL_DECODER_HOSTONLYCOH &&
>>> + !(flags & CXL_DECODER_F_HOSTONLYCOH)) ||
>>> + (coherence == CXL_DECODER_DEVCOH &&
>>> + !(flags & CXL_DECODER_F_DEVCOH))) {
>>
>> silly nit but my gut tells me we can make this less ugly.
>> Not a blocker though.
>
> Yes. This looks urgly. Will think about how to improve it.
Reviewed the code again. However, I don't have any idea to improve
this. Do you have some suggestion?
>>> + dev_dbg(&cxlr->dev,
>>> +"%s:%s endpoint coherence: %d isn't supported by root decoder: %#lx\n",
>>> + dev_name(&cxlmd->dev), dev_name(&cxled->cxld.dev),
>>> + coherence, flags);
>>> + return -ENXIO;
>>> + }
>
--
Best Regards,
Huang, Ying
Powered by blists - more mailing lists