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: <ira.weiny@intel.com>
Subject: Re: [PATCH v2 1/4] cxl/pci: Remove unnecessary device reference management in sanitize work
Date: Mon, 2 Oct 2023 09:48:31 -0700	[thread overview]
Message-ID: <a056b96f-2f73-4d0e-8947-be0d1e3eeb7a@intel.com> (raw)
In-Reply-To: <169602897366.904193.9449207727775648546.stgit@dwillia2-xfh.jf.intel.com>



On 9/29/23 16:09, Dan Williams wrote:
> Given that any particular put_device() could be the final put of the
> device, the fact that there are usages of cxlds->dev after
> put_device(cxlds->dev) is a red flag. Drop the reference counting since
> the device is pinned by being registered and will not be unregistered
> without triggering the driver + workqueue to shutdown.
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  drivers/cxl/pci.c |    5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index 44a21ab7add5..aa1b3dd9e64c 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -152,8 +152,6 @@ static void cxl_mbox_sanitize_work(struct work_struct *work)
>  	mutex_lock(&mds->mbox_mutex);
>  	if (cxl_mbox_background_complete(cxlds)) {
>  		mds->security.poll_tmo_secs = 0;
> -		put_device(cxlds->dev);
> -
>  		if (mds->security.sanitize_node)
>  			sysfs_notify_dirent(mds->security.sanitize_node);
>  
> @@ -296,9 +294,6 @@ static int __cxl_pci_mbox_send_cmd(struct cxl_memdev_state *mds,
>  		 */
>  		if (mbox_cmd->opcode == CXL_MBOX_OP_SANITIZE) {
>  			if (mds->security.poll) {
> -				/* hold the device throughout */
> -				get_device(cxlds->dev);
> -
>  				/* give first timeout a second */
>  				timeout = 1;
>  				mds->security.poll_tmo_secs = timeout;
> 

  parent reply	other threads:[~2023-10-02 16:48 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29 23:09 [PATCH v2 0/4] cxl/mem: Fix shutdown order Dan Williams
2023-09-29 23:09 ` [PATCH v2 1/4] cxl/pci: Remove unnecessary device reference management in sanitize work Dan Williams
2023-09-29 23:41   ` Ira Weiny
2023-10-02  9:55   ` Jonathan Cameron
2023-10-02 15:27   ` Davidlohr Bueso
2023-10-02 16:48   ` Dave Jiang [this message]
2023-09-29 23:09 ` [PATCH v2 2/4] cxl/pci: Cleanup 'sanitize' to always poll Dan Williams
2023-09-29 23:49   ` Ira Weiny
2023-09-29 23:51   ` Ira Weiny
2023-10-02 10:02   ` Jonathan Cameron
2023-10-04  0:55     ` Dan Williams
2023-10-02 15:49   ` Davidlohr Bueso
2023-10-04  1:01     ` Dan Williams
2023-10-04  1:13       ` Davidlohr Bueso
2023-10-02 16:57   ` Dave Jiang
2023-09-29 23:09 ` [PATCH v2 3/4] cxl/pci: Fix sanitize notifier setup Dan Williams
2023-09-30  2:42   ` Ira Weiny
2023-10-02 10:10   ` Jonathan Cameron
2023-10-04  0:59     ` Dan Williams
2023-10-04 10:12       ` Jonathan Cameron
2023-10-04 18:47         ` Dan Williams
2023-10-02 16:59   ` Dave Jiang
2023-10-04  0:52   ` Davidlohr Bueso
2023-10-04  1:09     ` Dan Williams
2023-10-04 16:21       ` Davidlohr Bueso
2023-10-04 18:48         ` Dan Williams
2023-10-04 18:50         ` Dan Williams
2023-10-04 18:54         ` Dan Williams
2023-10-04 19:23           ` Davidlohr Bueso
2023-09-29 23:09 ` [PATCH v2 4/4] cxl/mem: Fix shutdown order Dan Williams
2023-09-29 23:52   ` Ira Weiny
2023-10-02 10:11     ` Jonathan Cameron
2023-10-02 16:59   ` Dave Jiang
2023-10-03 17:40   ` Davidlohr Bueso

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=a056b96f-2f73-4d0e-8947-be0d1e3eeb7a@intel.com \
    --to=dave.jiang@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    /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