Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Dan Williams <dan.j.williams@intel.com>, linux-cxl@vger.kernel.org
Cc: vishal.l.verma@intel.com, ira.weiny@intel.com,
	alison.schofield@intel.com, Jonathan.Cameron@huawei.com
Subject: Re: [PATCH] cxl/region: Move coherence tracking into cxl_region_attach()
Date: Wed, 29 Mar 2023 10:40:30 -0700	[thread overview]
Message-ID: <07c64a6b-57dd-a63d-ef05-276774a43996@intel.com> (raw)
In-Reply-To: <168002858817.50647.1217607907088920888.stgit@dwillia2-xfh.jf.intel.com>



On 3/28/23 11:36 AM, Dan Williams wrote:
> Each time the contents of a given HPA are potentially changed in a cache
> incoherent manner the CXL core sets CXL_REGION_F_INCOHERENT to
> invalidate CPU caches before the region is used.
> 
> Successful invocation of attach_target() indicates that DPA has been
> newly assigned to a given HPA in the dynamic region creation flow.
> However, attach_target() is also reused in the autodiscovery flow where
> the region was activated by platform firmware. In that case there is no
> need to invalidate caches because that region is already in active use
> and nothing about the autodiscovery flow modifies the HPA-to-DPA
> relationship.
> 
> Fixes: a32320b71f08 ("cxl/region: Add region autodiscovery")
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>

> ---
>   drivers/cxl/core/region.c |    3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 52bbf6268d5f..b2fd67fcebfb 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -1674,6 +1674,7 @@ static int cxl_region_attach(struct cxl_region *cxlr,
>   		if (rc)
>   			goto err_decrement;
>   		p->state = CXL_CONFIG_ACTIVE;
> +		set_bit(CXL_REGION_F_INCOHERENT, &cxlr->flags);
>   	}
>   
>   	cxled->cxld.interleave_ways = p->interleave_ways;
> @@ -1775,8 +1776,6 @@ static int attach_target(struct cxl_region *cxlr,
>   
>   	down_read(&cxl_dpa_rwsem);
>   	rc = cxl_region_attach(cxlr, cxled, pos);
> -	if (rc == 0)
> -		set_bit(CXL_REGION_F_INCOHERENT, &cxlr->flags);
>   	up_read(&cxl_dpa_rwsem);
>   	up_write(&cxl_region_rwsem);
>   	return rc;
> 

  reply	other threads:[~2023-03-29 17:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230329180937uscas1p2aee5d0c49e66d2de6e5dbd884acb5705@uscas1p2.samsung.com>
2023-03-28 18:36 ` [PATCH] cxl/region: Move coherence tracking into cxl_region_attach() Dan Williams
2023-03-29 17:40   ` Dave Jiang [this message]
2023-03-29 18:09   ` Fan Ni
2023-03-30 17:28   ` Jonathan Cameron
2023-03-30 18:16     ` Dan Williams
2023-03-30 18:25       ` Jonathan Cameron

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=07c64a6b-57dd-a63d-ef05-276774a43996@intel.com \
    --to=dave.jiang@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox