public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Li Zhijian <lizhijian@fujitsu.com>, <alison.schofield@intel.com>,
	<vishal.l.verma@intel.com>, <ira.weiny@intel.com>,
	<bwidawsk@kernel.org>, <dan.j.williams@intel.com>,
	<linux-cxl@vger.kernel.org>
Cc: <dave.jiang@intel.com>, <Jonathan.Cameron@huawei.com>,
	<fan.ni@samsung.com>, <linux-kernel@vger.kernel.org>,
	Li Zhijian <lizhijian@fujitsu.com>
Subject: Re: [PATCH] cxl/region: Fix cxl_region_rwsem lock held when returning to user space
Date: Wed, 25 Oct 2023 13:55:47 -0700	[thread overview]
Message-ID: <653980d35bdb1_14ef4e294e1@iweiny-mobl.notmuch> (raw)
In-Reply-To: <20231025085450.2514906-1-lizhijian@fujitsu.com>

Li Zhijian wrote:
> goto out to release cxl_region_rwsem. Fix below warning:
> ================================================
> WARNING: lock held when returning to user space!
> 6.6.0-rc3-lizhijian+ #213 Not tainted
> ------------------------------------------------
> cxl/673 is leaving the kernel with locks still held!
> 1 lock held by cxl/673:
>  #0: ffffffffa013b9d0 (cxl_region_rwsem){++++}-{3:3}, at: commit_store+0x7d/0x3e0 [cxl_core]
> 
> Fixes: d1257d098a5a ("cxl/region: Move cache invalidation before region teardown, and before setup")
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  drivers/cxl/core/region.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 6d63b8798c29..18da77f8f22b 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -294,7 +294,7 @@ static ssize_t commit_store(struct device *dev, struct device_attribute *attr,
>  	 */
>  	rc = cxl_region_invalidate_memregion(cxlr);
>  	if (rc)
> -		return rc;
> +		goto out;
>  
>  	if (commit) {
>  		rc = cxl_region_decode_commit(cxlr);
> -- 
> 2.29.2
> 



  reply	other threads:[~2023-10-25 20:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25  8:54 [PATCH] cxl/region: Fix cxl_region_rwsem lock held when returning to user space Li Zhijian
2023-10-25 20:55 ` Ira Weiny [this message]
2023-10-25 22:04 ` Dan Williams

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=653980d35bdb1_14ef4e294e1@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=bwidawsk@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=fan.ni@samsung.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhijian@fujitsu.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