From patchwork Mon Jun 24 16:21:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 13709800 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A61A1C2D0D1 for ; Mon, 24 Jun 2024 16:22:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=z5dYSmS+UlMvDH3osanHRgj0IFMR5noB3hmhQYLwPF0=; b=ExhdFb7pvRG/AXT/27jEvg2s9i /MRnBhA1h5if4ZdNGD1xC0fkwIpD2/HXVLRQ7ASH3GFyUNjJnug4HN87Si9mquNQFapNxxPW+L4/a 6wiyBTOGXkx4cIDu0mPF0KEHhody5MuOF6CDTyRgfrGIUEkyzM/3mNie/YZzgVmpoRegdyzHQQ06E CcqOfQvgMOrEGErC1KWy2htdgdzrV9nkMNzGhgQYRFHIYO0cvlZN6Vg7qZmqJrTXXnDYL8CAeTZG/ 0Y7UNft/cTZXRBID+qHWeSMIAf090SK2tdV+OzN/5MhepHG/pLqHJmbP6uYDbGObb7LGuL996tKR9 cTgyM76w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLmSI-0000000HTcD-0HgF; Mon, 24 Jun 2024 16:22:10 +0000 Received: from mail-ej1-f48.google.com ([209.85.218.48]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLmS3-0000000HTTM-2FxL for linux-arm-kernel@lists.infradead.org; Mon, 24 Jun 2024 16:21:57 +0000 Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a7252bfe773so143183866b.1 for ; Mon, 24 Jun 2024 09:21:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719246114; x=1719850914; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=z5dYSmS+UlMvDH3osanHRgj0IFMR5noB3hmhQYLwPF0=; b=m0/3v0uJHZePaBo4eT3oPUoXhg+JofoKMVdQ5LIg8W9tGQ2Vh6a5Berc6ehKu3VcXA yox22JvL1gaEiakxbIiFaGYNqM3ek746h5KTxfCOCsbpINC+5LngISqhsFGP5x9zXXh5 bJWB5hHDnaDx4+N7VnbnqKoc88Aq2B7CvKTwHMnLRqieBRWGYU4Qiwhgl0Ya/UVcePpY iMSnEhBROxWAS56VC3Zl92wRduFd0Uw+PtyuR5sbhoav11dVbvGQwdq+xIHzIUPXTqWv ep7RERGtIQ+SGY51R6JUH4kCRFbPnB/KpHXfUMEjnfREvt2i/KdvAtSamYMS0199Ocb8 xBxQ== X-Forwarded-Encrypted: i=1; AJvYcCUjEAufPICF4yPGRja9Z/9p2gstaNpQGovx+7MLBY2y9Rx86txB/XaAlq6afEKRhl6HurnZsNEs1EyQDMV6eEtYZclglXVvKDIcZzwI2+yLgsyHV2k= X-Gm-Message-State: AOJu0YyRZOQRX7WNA7+L9Fh5jRENuQbhXDHorHVhsEN1tv475pfYh0Au c4C76WugTA/OCikJ9O/X8LehR1zYUBYy3fi/nQlKASDLBUQXZrEc X-Google-Smtp-Source: AGHT+IGAirccbr9ebRQ4r1Bpr+wLTdNcrvrtLbrlxOOhudvRIZe2BWJOZZT0opPHnukDV9nHPaB2Zg== X-Received: by 2002:a17:907:8e93:b0:a6e:f62d:bd02 with SMTP id a640c23a62f3a-a7245c84f2emr309572466b.7.1719246113524; Mon, 24 Jun 2024 09:21:53 -0700 (PDT) Received: from localhost (fwdproxy-lla-001.fbsv.net. [2a03:2880:30ff:1::face:b00c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a724d8a362fsm173519666b.158.2024.06.24.09.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 09:21:53 -0700 (PDT) From: Breno Leitao To: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Cc: kuba@kernel.org, horms@kernel.org, Roy.Pledge@nxp.com, linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/4] soc: fsl: qbman: FSL_DPAA depends on COMPILE_TEST Date: Mon, 24 Jun 2024 09:21:19 -0700 Message-ID: <20240624162128.1665620-1-leitao@debian.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240624_092155_700807_F1A7EF96 X-CRM114-Status: GOOD ( 11.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As most of the drivers that depend on ARCH_LAYERSCAPE, make FSL_DPAA depend on COMPILE_TEST for compilation and testing. # grep -r depends.\*ARCH_LAYERSCAPE.\*COMPILE_TEST | wc -l 29 Signed-off-by: Breno Leitao --- drivers/soc/fsl/qbman/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qbman/Kconfig b/drivers/soc/fsl/qbman/Kconfig index bdecb86bb656..27774ec6ff90 100644 --- a/drivers/soc/fsl/qbman/Kconfig +++ b/drivers/soc/fsl/qbman/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only menuconfig FSL_DPAA bool "QorIQ DPAA1 framework support" - depends on ((FSL_SOC_BOOKE || ARCH_LAYERSCAPE) && ARCH_DMA_ADDR_T_64BIT) + depends on ((FSL_SOC_BOOKE || ARCH_LAYERSCAPE || COMPILE_TEST) && ARCH_DMA_ADDR_T_64BIT) select GENERIC_ALLOCATOR help The Freescale Data Path Acceleration Architecture (DPAA) is a set of From patchwork Mon Jun 24 16:21:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 13709801 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AABDDC2D0D1 for ; Mon, 24 Jun 2024 16:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ShLo8usNRCEFu5wG7vvAmQF6Nr70DMxisgaHAPu+cb8=; b=m1TR90KrOCd1Hwm4Wy6ep08902 QO3Z/Keac5Yzfee3yJDn87mMC1axcPbNkpD8bVbaAQZ0Blbtwih1+ocKwTJEzAyzQiciiIVgmkLNe RoNpiwWYn+jJvsBLQCEqC4XcJI0LrUdfxXiK3yzHuNjwVJD+seTySQGJoc2nE/FOyf/bNgsPGyDWK WRGHhvT1sFk6TZpKjfNNQjoi3Gq979a21TWTUsqIffrcqX55p1D2+IF1xV7rZXCw17AOp74fpVBqp rdrsMA+f15CWe4+2Axn6oQGjinY6ueb5/Q7xMtSANFuBqrvj0k/x0PLJLUDZ0Op2ISsJ+3ZWAX8XF ASv3vDgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLmSM-0000000HTfC-1r57; Mon, 24 Jun 2024 16:22:14 +0000 Received: from mail-ej1-f42.google.com ([209.85.218.42]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLmS5-0000000HTUy-0SE5 for linux-arm-kernel@lists.infradead.org; Mon, 24 Jun 2024 16:21:58 +0000 Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a725d756d41so123327466b.0 for ; Mon, 24 Jun 2024 09:21:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719246115; x=1719850915; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ShLo8usNRCEFu5wG7vvAmQF6Nr70DMxisgaHAPu+cb8=; b=m/hJuRYwEymFm5xrKob6HBcCmCPiR1l/v/5dy1wZQz+Uw97TSSh8/VEaUF2jqTKdck xkDcB5xg9HWDN/8hEeGJgaiAqy3KHo4xT7C93MOB/sE8i2MDj6KasXguxt0F4lN3vLAC +TCL2Kdm0y7QzgM8Nf0YbU74Jv6DelVQ1BXxMtL8It/dsETKzIkAdgkdD9abrnglYl4G zZm/pC92CaERcQsm8VIQhdf+fYwThoua8fZI/lth9F+qIPWjlSkR1Ed+fQ6J+ldJ0Qj1 HZYjYeEKwQMCXZWeNh1xcHuOEeJ8iMPebcdakTFazniWNuTvhCJ0naQrCxJheaCu0c72 6GuA== X-Forwarded-Encrypted: i=1; AJvYcCXY/GnKf2j38IwKj/Uu9VVElXUnDAQNEBTpK2FRwxYCfQWfJ1ng/oAct5CV4FkCs5tKLAj1e+iqASF0TxN4c2dx1ntXxeyCO+LXVXE1TaBvIqsM9Ig= X-Gm-Message-State: AOJu0YwP0vYTeqou2SrEq7WLVVPi1JfIUl7V7LW3vsUEZWDU0ab4y/LH IIZIR203ZtcUX9HqmudZdaIl/aQ9SOIZiGHgoW+DoZ+VU9U8S5Fy X-Google-Smtp-Source: AGHT+IHtN7PVpKI1Bv6EZwPIbNhldtK+jt6XAQQqnMxsDG/fcv/XeasNmP2zn3fSmCQDg4rud7njSg== X-Received: by 2002:a17:906:c0c9:b0:a6f:dcb6:223d with SMTP id a640c23a62f3a-a6ffe27056amr503424866b.8.1719246115138; Mon, 24 Jun 2024 09:21:55 -0700 (PDT) Received: from localhost (fwdproxy-lla-113.fbsv.net. [2a03:2880:30ff:71::face:b00c]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d30535005sm4848954a12.69.2024.06.24.09.21.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 09:21:54 -0700 (PDT) From: Breno Leitao To: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, =?utf-8?q?Horia_Geant=C4=83?= , Pankaj Gupta , Gaurav Jain , Herbert Xu , "David S. Miller" Cc: kuba@kernel.org, horms@kernel.org, Roy.Pledge@nxp.com, linux-crypto@vger.kernel.org (open list:FREESCALE CAAM (Cryptographic Acceleration and...), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/4] crypto: caam: Depend on COMPILE_TEST also Date: Mon, 24 Jun 2024 09:21:20 -0700 Message-ID: <20240624162128.1665620-2-leitao@debian.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240624162128.1665620-1-leitao@debian.org> References: <20240624162128.1665620-1-leitao@debian.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240624_092157_236344_7B7125E5 X-CRM114-Status: GOOD ( 11.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As most of the drivers that depend on ARCH_LAYERSCAPE, make CRYPTO_DEV_FSL_CAAM depend on COMPILE_TEST for compilation and testing. # grep -r depends.\*ARCH_LAYERSCAPE.\*COMPILE_TEST | wc -l 29 Signed-off-by: Breno Leitao --- drivers/crypto/caam/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/caam/Kconfig b/drivers/crypto/caam/Kconfig index c631f99e415f..05210a0edb8a 100644 --- a/drivers/crypto/caam/Kconfig +++ b/drivers/crypto/caam/Kconfig @@ -10,7 +10,7 @@ config CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC config CRYPTO_DEV_FSL_CAAM tristate "Freescale CAAM-Multicore platform driver backend" - depends on FSL_SOC || ARCH_MXC || ARCH_LAYERSCAPE + depends on FSL_SOC || ARCH_MXC || ARCH_LAYERSCAPE || COMPILE_TEST select SOC_BUS select CRYPTO_DEV_FSL_CAAM_COMMON imply FSL_MC_BUS From patchwork Mon Jun 24 16:21:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 13709802 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 11DB1C2BD09 for ; Mon, 24 Jun 2024 16:22:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SNRZatXFYSvT7dWA5Z47QsnQSl5EsRqGGJzSsqaHcYY=; b=Xebayp+EwElV1q5Ttij+K4wDUG rS7kgX8CjgILW08w+2ryjvegw4lMVFTXMN4oXQel70lCf6Oqt8YRQ5n6fi5zf86ylsQKHEhP3aDxx 5q+y4HBeqWGRpI/992w58t8fo7HSErMgbMn8SKQil/a8MVPyBD94AjPORkFQTqDNdfxccWWprjZpy 1akL5Ge1SAoRuXzs8V9UnM7k3IFi3Mi0p/hsR1FF05QHDlQ2UzaP47N39I/oUuB120uL2CM6Bybsg Y6wZaVesjXGeKsrUf5a2BjL6AkYwo8OJOnCWr0Iiti2EhoUTnPefx0LHvj+TONGiGnXi7eI6wdEZJ xjtLUxMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLmSQ-0000000HThv-0UVZ; Mon, 24 Jun 2024 16:22:18 +0000 Received: from mail-ej1-f48.google.com ([209.85.218.48]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLmS9-0000000HTXX-26dX for linux-arm-kernel@lists.infradead.org; Mon, 24 Jun 2024 16:22:03 +0000 Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a689ad8d1f6so574145166b.2 for ; Mon, 24 Jun 2024 09:22:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719246120; x=1719850920; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SNRZatXFYSvT7dWA5Z47QsnQSl5EsRqGGJzSsqaHcYY=; b=fgxump8ds89bg4tHH6pq0EHd6XTnCLAN/4O4zVWkzglm64H8ObdVbQpq4QbijFqce6 QNcFbWPSx8Nyr+o7vv2wtY0QJLkeFLNZcfzXjQBvqIa3f3x0j6MG6w902ATmDYBoYxSd At0VCYgDkoRYjo0rrDpTpy8nKQXeIImUtvo7e4kEf+fFyG2QjpUzF0Dyzuwk/nRBvgqJ b5d9BQeqZMiCITsa6bZdAgrKMNLRvHdvx8C5mWbgmleLKfQLmuTIs4li1t78Y7QAFaRj rUe6EhpPozPAFEd9rR3NXfTGguieDE1oPUEH+oddF25F8bJvGjzFExE1HUslYkccvWgQ Uj4Q== X-Forwarded-Encrypted: i=1; AJvYcCUaj7bMIs6ghbeCFD8a41yUnEkapmsafSY8blOyEGx3cNWUGGMXcrgzAsi111ow3PX6RlltlCEZiO14hyMl8H5I4z/RMwTpJ+kCUxzOaSIg9Dcqe78= X-Gm-Message-State: AOJu0Yw5n/ZILIy6ypuhXD49vWfy+Dc/FY+Hd1l19RXDJThEcOn2kMeb 35uK4m9CcCZdaGG4Com344DUKVSJkVO8bAcKQLYzzUmjSXCglgsr X-Google-Smtp-Source: AGHT+IGzJL+qgZxR9ubJMoPUs7gDPXfWNurJaThSzu++EbZAe9YtGjEOTHF/GkySo3VJEwJszmtBpw== X-Received: by 2002:a17:907:d509:b0:a6f:27e6:8892 with SMTP id a640c23a62f3a-a7245dc9697mr402052666b.60.1719246116948; Mon, 24 Jun 2024 09:21:56 -0700 (PDT) Received: from localhost (fwdproxy-lla-003.fbsv.net. [2a03:2880:30ff:3::face:b00c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72541fc49asm132301866b.74.2024.06.24.09.21.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 09:21:56 -0700 (PDT) From: Breno Leitao To: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, =?utf-8?q?Horia_Geant=C4=83?= , Pankaj Gupta , Gaurav Jain , Herbert Xu , "David S. Miller" Cc: kuba@kernel.org, horms@kernel.org, Roy.Pledge@nxp.com, linux-crypto@vger.kernel.org (open list:FREESCALE CAAM (Cryptographic Acceleration and...), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/4] crypto: caam: Unembed net_dev structure from qi Date: Mon, 24 Jun 2024 09:21:21 -0700 Message-ID: <20240624162128.1665620-3-leitao@debian.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240624162128.1665620-1-leitao@debian.org> References: <20240624162128.1665620-1-leitao@debian.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240624_092201_692723_9621B95F X-CRM114-Status: GOOD ( 17.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Embedding net_device into structures prohibits the usage of flexible arrays in the net_device structure. For more details, see the discussion at [1]. Un-embed the net_devices from struct caam_qi_pcpu_priv by converting them into pointers, and allocating them dynamically. Use the leverage alloc_netdev_dummy() to allocate the net_device object at caam_qi_init(). The free of the device occurs at caam_qi_shutdown(). Link: https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/ [1] Signed-off-by: Breno Leitao --- PS: Unfortunately due to lack of hardware, this was not tested in real hardware. drivers/crypto/caam/qi.c | 43 ++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c index 46a083849a8e..0c13ffc81862 100644 --- a/drivers/crypto/caam/qi.c +++ b/drivers/crypto/caam/qi.c @@ -57,7 +57,7 @@ struct caam_napi { */ struct caam_qi_pcpu_priv { struct caam_napi caam_napi; - struct net_device net_dev; + struct net_device *net_dev; struct qman_fq *rsp_fq; } ____cacheline_aligned; @@ -144,7 +144,7 @@ static void caam_fq_ern_cb(struct qman_portal *qm, struct qman_fq *fq, { const struct qm_fd *fd; struct caam_drv_req *drv_req; - struct device *qidev = &(raw_cpu_ptr(&pcpu_qipriv)->net_dev.dev); + struct device *qidev = &(raw_cpu_ptr(&pcpu_qipriv)->net_dev->dev); struct caam_drv_private *priv = dev_get_drvdata(qidev); fd = &msg->ern.fd; @@ -530,6 +530,7 @@ static void caam_qi_shutdown(void *data) if (kill_fq(qidev, per_cpu(pcpu_qipriv.rsp_fq, i))) dev_err(qidev, "Rsp FQ kill failed, cpu: %d\n", i); + free_netdev(pcpu_qipriv.net_dev); } qman_delete_cgr_safe(&priv->cgr); @@ -573,7 +574,7 @@ static enum qman_cb_dqrr_result caam_rsp_fq_dqrr_cb(struct qman_portal *p, struct caam_napi *caam_napi = raw_cpu_ptr(&pcpu_qipriv.caam_napi); struct caam_drv_req *drv_req; const struct qm_fd *fd; - struct device *qidev = &(raw_cpu_ptr(&pcpu_qipriv)->net_dev.dev); + struct device *qidev = &(raw_cpu_ptr(&pcpu_qipriv)->net_dev->dev); struct caam_drv_private *priv = dev_get_drvdata(qidev); u32 status; @@ -718,12 +719,24 @@ static void free_rsp_fqs(void) kfree(per_cpu(pcpu_qipriv.rsp_fq, i)); } +static void free_caam_qi_pcpu_netdev(const cpumask_t *cpus) +{ + struct caam_qi_pcpu_priv *priv; + int i; + + for_each_cpu(i, cpus) { + priv = per_cpu_ptr(&pcpu_qipriv, i); + free_netdev(priv->net_dev); + } +} + int caam_qi_init(struct platform_device *caam_pdev) { int err, i; struct device *ctrldev = &caam_pdev->dev, *qidev; struct caam_drv_private *ctrlpriv; const cpumask_t *cpus = qman_affine_cpus(); + cpumask_t clean_mask; ctrlpriv = dev_get_drvdata(ctrldev); qidev = ctrldev; @@ -743,6 +756,8 @@ int caam_qi_init(struct platform_device *caam_pdev) return err; } + cpumask_clear(&clean_mask); + /* * Enable the NAPI contexts on each of the core which has an affine * portal. @@ -751,10 +766,16 @@ int caam_qi_init(struct platform_device *caam_pdev) struct caam_qi_pcpu_priv *priv = per_cpu_ptr(&pcpu_qipriv, i); struct caam_napi *caam_napi = &priv->caam_napi; struct napi_struct *irqtask = &caam_napi->irqtask; - struct net_device *net_dev = &priv->net_dev; + struct net_device *net_dev; + net_dev = alloc_netdev_dummy(0); + if (!net_dev) { + err = -ENOMEM; + goto fail; + } + cpumask_set_cpu(i, &clean_mask); + priv->net_dev = net_dev; net_dev->dev = *qidev; - INIT_LIST_HEAD(&net_dev->napi_list); netif_napi_add_tx_weight(net_dev, irqtask, caam_qi_poll, CAAM_NAPI_WEIGHT); @@ -766,16 +787,22 @@ int caam_qi_init(struct platform_device *caam_pdev) dma_get_cache_alignment(), 0, NULL); if (!qi_cache) { dev_err(qidev, "Can't allocate CAAM cache\n"); - free_rsp_fqs(); - return -ENOMEM; + err = -ENOMEM; + goto fail2; } caam_debugfs_qi_init(ctrlpriv); err = devm_add_action_or_reset(qidev, caam_qi_shutdown, ctrlpriv); if (err) - return err; + goto fail2; dev_info(qidev, "Linux CAAM Queue I/F driver initialised\n"); return 0; + +fail2: + free_rsp_fqs(); +fail: + free_caam_qi_pcpu_netdev(&clean_mask); + return err; } From patchwork Mon Jun 24 16:21:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 13709803 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED2B8C2D0D1 for ; Mon, 24 Jun 2024 16:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lI0lpN6kx7yRxic2Ty5k5Kh7yOrOrpZPNGmNxWXyvto=; b=LZ1muEfjMxDMZ+3YQuI2VPzhYF KMCDGP1KxR3YALm8aTub8oJvKtIB0qT8rWs7X27rledwErQgGpIslZaBXrLyIhBE1f/gH7eaGa1KZ rvYySwJMGoa3c/+f5bTpmhgAlIOe4GFCcQbYXlHFfDYngBLahg3d5iJ6GkY81DVDrtJZd31v/ixmW gU9OIQHZHf7IpjMqlApLmP26A3or90nffKwuqH++aIEu4famG6OvO5sFTdxg++48gg6vt7RYdKqNl Hq3hzVNLBEi/JVHZUrc6qRV6PhgPd/Epe3R8tDWFChgeWWeNBTa2Wbz/2tpdMl75ik655bU2zgbFa ffmTg09w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLmST-0000000HTjs-1R30; Mon, 24 Jun 2024 16:22:21 +0000 Received: from mail-ed1-f51.google.com ([209.85.208.51]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLmSB-0000000HTYM-2bZQ for linux-arm-kernel@lists.infradead.org; Mon, 24 Jun 2024 16:22:05 +0000 Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-57d10354955so4994964a12.1 for ; Mon, 24 Jun 2024 09:22:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719246122; x=1719850922; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lI0lpN6kx7yRxic2Ty5k5Kh7yOrOrpZPNGmNxWXyvto=; b=QT8QptcFV9OnKWW9JtfftS2XA73wd/ycWBw5jeEFS6XS5JY3sfD/9Qv5uv4jOURlaO vqn+3QthfDvWXesMKWP3IRvRIlUgswRZVhvjPp2HUClNhfmKZU2ydtYSgCbpYIRLI4vh Z197/E80V5CI/bLQ8GMHt5aqiAnsXCYrmd9F+K5nYTYU52yg4X6FXa7DfqLkEvqUWR2V AMPBbn1+PG1WVPZMx6Tftal+Wz+Wrl/senU0GTfGC02iVptGbpFuw0FHk9Kc+aJklk40 krJjgToKfuFMzVI36khjTDvInBCqy/KJeOi7PyAKXVwO85fWU1vxYI/DjckJeVF59/UN xI1w== X-Forwarded-Encrypted: i=1; AJvYcCVv6sNKIOWSfEEwxxk9EIl9O0GIqcstS56fmR8Ys8v9SK9ouhyjJuAYwANQ/xvALHHnkNajzvGBUSnipaGV5mLyAAbdbJrNP83Ab/laH+6RhqpY9DY= X-Gm-Message-State: AOJu0YzycqT0jkFZjpw/dDEEhqAfHYphMLc3JoDGo2I1BdUilH6X4knH C9jPRFMMlXEF50O7CS3Cd+BaoCHubmPwNtZSD0qocUBtwKDVfhEP X-Google-Smtp-Source: AGHT+IEwMy3K4qn6NThj+xHIEW9HQLoF5ZMgOFTPxFANNhr7dKPUd+SfBDJ7IMkyk+RxYL401G7l8g== X-Received: by 2002:a50:cc85:0:b0:57c:8027:534d with SMTP id 4fb4d7f45d1cf-57d4a01f393mr3282346a12.27.1719246121917; Mon, 24 Jun 2024 09:22:01 -0700 (PDT) Received: from localhost (fwdproxy-lla-114.fbsv.net. [2a03:2880:30ff:72::face:b00c]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d303d7aecsm4854506a12.20.2024.06.24.09.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 09:22:01 -0700 (PDT) From: Breno Leitao To: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, =?utf-8?q?Horia_Geant=C4=83?= , Pankaj Gupta , Gaurav Jain , Herbert Xu , "David S. Miller" Cc: kuba@kernel.org, horms@kernel.org, Roy.Pledge@nxp.com, linux-crypto@vger.kernel.org (open list:FREESCALE CAAM (Cryptographic Acceleration and...), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 4/4] crypto: caam: Unembed net_dev structure in dpaa2 Date: Mon, 24 Jun 2024 09:21:22 -0700 Message-ID: <20240624162128.1665620-4-leitao@debian.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240624162128.1665620-1-leitao@debian.org> References: <20240624162128.1665620-1-leitao@debian.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240624_092203_869660_B37A92DE X-CRM114-Status: GOOD ( 15.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Embedding net_device into structures prohibits the usage of flexible arrays in the net_device structure. For more details, see the discussion at [1]. Un-embed the net_devices from struct dpaa2_caam_priv_per_cpu by converting them into pointers, and allocating them dynamically. Use the leverage alloc_netdev_dummy() to allocate the net_device object at dpaa2_dpseci_setup(). The free of the device occurs at dpaa2_dpseci_disable(). Link: https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/ [1] Signed-off-by: Breno Leitao --- PS: Unfortunately due to lack of hardware, this was not tested in real hardware. drivers/crypto/caam/caamalg_qi2.c | 28 +++++++++++++++++++++++++--- drivers/crypto/caam/caamalg_qi2.h | 2 +- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c index a4f6884416a0..207dc422785a 100644 --- a/drivers/crypto/caam/caamalg_qi2.c +++ b/drivers/crypto/caam/caamalg_qi2.c @@ -4990,11 +4990,23 @@ static int dpaa2_dpseci_congestion_setup(struct dpaa2_caam_priv *priv, return err; } +static void free_dpaa2_pcpu_netdev(struct dpaa2_caam_priv *priv, const cpumask_t *cpus) +{ + struct dpaa2_caam_priv_per_cpu *ppriv; + int i; + + for_each_cpu(i, cpus) { + ppriv = per_cpu_ptr(priv->ppriv, i); + free_netdev(ppriv->net_dev); + } +} + static int __cold dpaa2_dpseci_setup(struct fsl_mc_device *ls_dev) { struct device *dev = &ls_dev->dev; struct dpaa2_caam_priv *priv; struct dpaa2_caam_priv_per_cpu *ppriv; + cpumask_t clean_mask; int err, cpu; u8 i; @@ -5073,6 +5085,7 @@ static int __cold dpaa2_dpseci_setup(struct fsl_mc_device *ls_dev) } } + cpumask_clear(&clean_mask); i = 0; for_each_online_cpu(cpu) { u8 j; @@ -5096,15 +5109,23 @@ static int __cold dpaa2_dpseci_setup(struct fsl_mc_device *ls_dev) priv->rx_queue_attr[j].fqid, priv->tx_queue_attr[j].fqid); - ppriv->net_dev.dev = *dev; - INIT_LIST_HEAD(&ppriv->net_dev.napi_list); - netif_napi_add_tx_weight(&ppriv->net_dev, &ppriv->napi, + ppriv->net_dev = alloc_netdev_dummy(0); + if (!ppriv->net_dev) { + err = -ENOMEM; + goto err_alloc_netdev; + } + cpumask_set_cpu(cpu, &clean_mask); + ppriv->net_dev->dev = *dev; + + netif_napi_add_tx_weight(ppriv->net_dev, &ppriv->napi, dpaa2_dpseci_poll, DPAA2_CAAM_NAPI_WEIGHT); } return 0; +err_alloc_netdev: + free_dpaa2_pcpu_netdev(priv, &clean_mask); err_get_rx_queue: dpaa2_dpseci_congestion_free(priv); err_get_vers: @@ -5153,6 +5174,7 @@ static int __cold dpaa2_dpseci_disable(struct dpaa2_caam_priv *priv) ppriv = per_cpu_ptr(priv->ppriv, i); napi_disable(&ppriv->napi); netif_napi_del(&ppriv->napi); + free_netdev(ppriv->net_dev); } return 0; diff --git a/drivers/crypto/caam/caamalg_qi2.h b/drivers/crypto/caam/caamalg_qi2.h index abb502bb675c..61d1219a202f 100644 --- a/drivers/crypto/caam/caamalg_qi2.h +++ b/drivers/crypto/caam/caamalg_qi2.h @@ -81,7 +81,7 @@ struct dpaa2_caam_priv { */ struct dpaa2_caam_priv_per_cpu { struct napi_struct napi; - struct net_device net_dev; + struct net_device *net_dev; int req_fqid; int rsp_fqid; int prio;