From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8E03C2BB3F for ; Wed, 15 Nov 2023 19:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234329AbjKOTem (ORCPT ); Wed, 15 Nov 2023 14:34:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234351AbjKOTel (ORCPT ); Wed, 15 Nov 2023 14:34:41 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8C9C9E for ; Wed, 15 Nov 2023 11:34:38 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CC8AC433C9; Wed, 15 Nov 2023 19:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700076877; bh=hmOMq9I2mr9o9I2oFaId+79xOdDHIgxjpPVA+lD+VxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FcEk5TZWDLmTF3+05f3HorTHRZNGtB+ZkIMFJGX4X7xzsW/tLzm1sSYJqtUfaUdim Z96fpT5eE1sxLq0PORDVIbv4c623oIA6926kLAcNWs2ZNjUM0zO9Ux2MuE/5ZL026r ocyy9u3Zs77oslANlT65F1EpAMEprIfgky2gW8LI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dave Jiang , Davidlohr Bueso , Jonathan Cameron , Ira Weiny , Dan Williams , Sasha Levin Subject: [PATCH 6.5 451/550] cxl/pci: Remove unnecessary device reference management in sanitize work Date: Wed, 15 Nov 2023 14:17:15 -0500 Message-ID: <20231115191632.087904642@linuxfoundation.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231115191600.708733204@linuxfoundation.org> References: <20231115191600.708733204@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 6.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Williams [ Upstream commit 76fe8713dd0a1331d84d767e8e5d3f365d959e8a ] 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. Reviewed-by: Dave Jiang Reviewed-by: Davidlohr Bueso Reviewed-by: Jonathan Cameron Reviewed-by: Ira Weiny Signed-off-by: Dan Williams Stable-dep-of: 5f2da1971446 ("cxl/pci: Fix sanitize notifier setup") Signed-off-by: Sasha Levin --- drivers/cxl/pci.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 2323169b6e5fe..51dbd0c81497b 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; -- 2.42.0