From patchwork Sun Sep 15 10:22:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 829458 Received: from msa.smtpout.orange.fr (msa-209.smtpout.orange.fr [193.252.23.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 540AE198A03 for ; Sun, 15 Sep 2024 10:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.252.23.209 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726395752; cv=none; b=DmLfcwZQDSjWyKwMTvibfE/0XDvkW4m9cwHgb+wMj51+NKVeWI1hmpCuYYohcUjQHXbc7WGG9FkN64iHNF9CC6FEwHJQS5IhuqOMQVVicwlm3WJtRDuN79eq6L4VjM3hyaVWtBhxkzwHqCoaYZiR+Fq3fHqAfSPBKwZ2G+opgqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726395752; c=relaxed/simple; bh=OU121EH3o4oNFUMkKEQJk2Axn51rBYd2m3eyMY5uI+0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Z6CJoJiCbT8Jk3+w8TO7kkHjUNCRIqstBBBsYHYvfNKfVbVZopY+bNo2BuPP1ASqTHi+Dj662mps16OACCNz7zy6n476ivUaY5mpCLB/T6bX9bPI4BeWm1pEqHuTzLpls+fEeMorRV2EOskayorvwnzl4Zfg0ldOItb8dFbvAFk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=bmtKmoke; arc=none smtp.client-ip=193.252.23.209 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="bmtKmoke" Received: from fedora.home ([90.11.132.44]) by smtp.orange.fr with ESMTPA id pmOdsbBSBEyYjpmOds4NCu; Sun, 15 Sep 2024 12:22:26 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1726395746; bh=pf3gB7OINiM24+3hvi+hf8vNJkXkS4txKpVd54g/XEk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=bmtKmokedW7XLT6H76D4hhh4SycDGMbapwut5bWGn8EZ78Pd2vzVs0WtPBqluEgMj qMYDbadJ0Imru+KPx3ascteN4xiMHNpg+TlsybVPM9tbyef5lYU9H5vITEDqCaCUCd 5IPQJyHnABNT/yWfyRXgII6W3BAoza05EE7DnStniJ0nHG0km/oSIxcnH1v6nRQAWE Z6Zg2glkYjswINBbeRTzfsPPpWe1pFHQJB1kc/aQIx37ELhsDVV/Lk8YBiwnvmowhQ 7O1fKecDUXjZyrUqVbJblBCdO5cVH2RIBql0UWHGa86GDfAUnTWh2Qfv6H5YsmXfd/ Q1/kSdUbexPnA== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 15 Sep 2024 12:22:26 +0200 X-ME-IP: 90.11.132.44 From: Christophe JAILLET To: =?utf-8?q?Horia_Geant=C4=83?= , Pankaj Gupta , Gaurav Jain , Herbert Xu , "David S. Miller" , Andrey Smirnov Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-crypto@vger.kernel.org Subject: [PATCH 1/2] crypto: caam: Fix the pointer passed to caam_qi_shutdown() Date: Sun, 15 Sep 2024 12:22:12 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The type of the last parameter given to devm_add_action_or_reset() is "struct caam_drv_private *", but in caam_qi_shutdown(), it is casted to "struct device *". Pass the correct parameter to devm_add_action_or_reset() so that the resources are released as expected. Fixes: f414de2e2fff ("crypto: caam - use devres to de-initialize QI") Signed-off-by: Christophe JAILLET --- This patch is speculative review with care. --- drivers/crypto/caam/qi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c index f6111ee9ed34..8ed2bb01a619 100644 --- a/drivers/crypto/caam/qi.c +++ b/drivers/crypto/caam/qi.c @@ -794,7 +794,7 @@ int caam_qi_init(struct platform_device *caam_pdev) caam_debugfs_qi_init(ctrlpriv); - err = devm_add_action_or_reset(qidev, caam_qi_shutdown, ctrlpriv); + err = devm_add_action_or_reset(qidev, caam_qi_shutdown, qidev); if (err) goto fail2; From patchwork Sun Sep 15 10:22:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 828892 Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9189A1C3F34 for ; Sun, 15 Sep 2024 10:22:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726395760; cv=none; b=VunJkNQNt+Lk4mCicER2AmaZK3CMIPXDOPu2jFWDUEs7PUkdZYvU6MpkwotaGs3Lc3KoTgV4XvWEms685cYuN/2zCipgFt+6L/U5JPUzAeewXudwvrQNO71V4/kk7HF6cAQMsFoi/dowOZZhz3OvQ532ksVUBsqGzSekowdeOtY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726395760; c=relaxed/simple; bh=S74zkBCTJVoMvfgdF3C8kbmEEtlOZke6fPgWm/7apxA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fZj+PuU9LAJ3au0eWgmeBygGpJrKnnXIoeXrPS0tOqIZQm3W41UFVr03kR9WblWfLT0KGstbF05tGeC6+3PC5vNA2O84pW3I/sYhOOSKVIwQC2QUB/DgJpQkU40CsKdI4ViuKXEO9MH+jFUoEaI9UC59Z1c7zEnLMi/kxwSgMMw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=bYwi5Jui; arc=none smtp.client-ip=80.12.242.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="bYwi5Jui" Received: from fedora.home ([90.11.132.44]) by smtp.orange.fr with ESMTPA id pmOdsbBSBEyYjpmOjs4NDf; Sun, 15 Sep 2024 12:22:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1726395750; bh=QJU9nstI/6k1pq+QgbDB9umkGIEs7lvcbyaDAjb6GFA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=bYwi5JuiVnX7Uxf1k9AANeU5InksWPESh2I3OXVqhDQUe5fcHmS9qtJwoSmHO3sSc kmCxh15yDntdRBLPrwFRvMUOYToMPXvFEWl/3ZfyMRE0jxuCRyaQ7FO6n6XxXHJXKF QjdXZiAID4h9ezA65mr0kWaLV6ITSJW4fn7Sjlu0Edw4gPI/ArUfihjmkorK5viseV x7aOXTkeRoL5GNdLjWggDjmaRO10bKWOAcHnDq/9Tqou7gu7vlHvZxsRssP2XgHVpN ZLHr5L3iQ5gjYtmU3n8jHDU0QA5VekHoLj5XNG7nQyx7YSulBntSMO4WsMzL57Hb+1 upMZTpu5q6TEw== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 15 Sep 2024 12:22:30 +0200 X-ME-IP: 90.11.132.44 From: Christophe JAILLET To: =?utf-8?q?Horia_Geant=C4=83?= , Pankaj Gupta , Gaurav Jain , Herbert Xu , "David S. Miller" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-crypto@vger.kernel.org Subject: [PATCH 2/2] crypto: caam: Slightly simplify platform_device() Date: Sun, 15 Sep 2024 12:22:13 +0200 Message-ID: <27c5e9ef2c4b1d40470e4ea41988840e5d12926c.1726395689.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'ctrldev' and 'qidev' are the same. Remove the former to slightly simplify the code. Signed-off-by: Christophe JAILLET --- This is a follow up to commit 6b175685b4a1 ("crypto: caam/qi - don't allocate an extra platform device") --- drivers/crypto/caam/qi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c index 8ed2bb01a619..7701d00bcb3a 100644 --- a/drivers/crypto/caam/qi.c +++ b/drivers/crypto/caam/qi.c @@ -733,7 +733,7 @@ static void free_caam_qi_pcpu_netdev(const cpumask_t *cpus) int caam_qi_init(struct platform_device *caam_pdev) { int err, i; - struct device *ctrldev = &caam_pdev->dev, *qidev; + struct device *qidev = &caam_pdev->dev; struct caam_drv_private *ctrlpriv; const cpumask_t *cpus = qman_affine_cpus(); cpumask_var_t clean_mask; @@ -742,8 +742,7 @@ int caam_qi_init(struct platform_device *caam_pdev) if (!zalloc_cpumask_var(&clean_mask, GFP_KERNEL)) goto fail_cpumask; - ctrlpriv = dev_get_drvdata(ctrldev); - qidev = ctrldev; + ctrlpriv = dev_get_drvdata(qidev); /* Initialize the congestion detection */ err = init_cgr(qidev);