From patchwork Tue Oct 1 23:25:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13819010 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (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 1A6DA194AD1; Tue, 1 Oct 2024 23:25:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727825152; cv=none; b=q+/3c9UcaHdgTuHezHgw4DfoODORflokAeG+iBI+gCk9AzUmWSPWmrCr4Pxr1cfJNTxYFYLeySQXxUk3gHwgoLBz/82m2fbcfj9g9+r9Sn2Y88rEIiSMi1AuXJxlzCol0LX+pHbsM80i8q2yn307xV9xsTe6l0NzUgmHTTXqoAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727825152; c=relaxed/simple; bh=8tEpKzuJJod0wz3ZcPjN+AayChvMMlQKA3FkFqFp7Jc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cZehetutr1nvJYdc50uX8cejHGCRfzUgETQ5Wyt9yjsZokaOyMqyTTPH3lw+H5R8WM4rcg/lmeEqrwXMGYVUy0JMvPTR5QbbVf944S/iry8A8p1iTnxddM4SlXuhl2ZGW+kRpLhPZnjAz8KZbUa37PDPIArY0mFD+doYEO+9IPE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E6cK5iNB; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E6cK5iNB" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-7ae3d7222d4so5173441a12.3; Tue, 01 Oct 2024 16:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727825150; x=1728429950; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=q/vVq5169u7i4biYWRH+U02krdapDJFUv5/71gKhc60=; b=E6cK5iNBdFuBOAsjJ+jmJEba4Bi9irSxpR7FZJ3eye9J9C7nf3KUA+0ImBe/cdETx0 EHsmn864n4HsKr5yBx3kb3rhOrNwnXUaqtnL4dUZRJx6DW3wjZSB78qN5PkyEgpfv9wP VhbYLo1GC+wSHgTV+4vyAWVCz6KFKW0yzB6DpInwrlqil3OveYzdcuJqnTereisR56nT wKwieyMf03QKaNsqtfMzZR7f0hNkcKzR7M2FYPMUk9u5+569r/Nz9k+qQURz2QXzSyjd VpbmH8QHTvdqRDfjuEdKh6UVAprD0gxNhlNagAoe7hJbDw5VOEe44OvXij6vMA0Zwd5P kToQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727825150; x=1728429950; 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=q/vVq5169u7i4biYWRH+U02krdapDJFUv5/71gKhc60=; b=LYntOVR8WOqdlmlZTDabcEOfpzBCMb/71dn4W2RIRgshQAj47asog6YW7e1IfIyGqh BTo0HIjIZExotwwkypXLTAJWN98tjxXAEnNOBTQ3MpjvPJ1/Rqe9X8wBEZkk/sfE8dKQ Zy1/5coOn7UPg7DndEYI76SZtuSPHfenGz87phqy5S9QA851D6SDrfN2EeaM1x74ExBv gT5LSJdA3V3Ht9dSllLByf7vQexa08kYBT9mQsZ4sEevqrjhrrAQ8K5f8Xj8UykpcloE LcmSMPBnIecJrPkGV6VWGP4bWshFMj4i9SLIeKRMrYZIOgqLIPfj12JQ88iLLkKjNQGB /fwA== X-Forwarded-Encrypted: i=1; AJvYcCWumrofxUB592Z6j3E6G7NTIMTAGXdDkI62fYyehtz+CgxrkmsRIK66c7b8XZ0DPw3aUfJi9eetI94VJxs=@vger.kernel.org X-Gm-Message-State: AOJu0YylGOmnuYXcwHwRBQTzukavcK4V2+RzyN6Cxz6HxRv5tCcykxQh Ep1Hpo1o/03f0/H18aHk0GlpSwe+LQlOtcGsXFqJIMwAETlVypL9p9rCgIyQ X-Google-Smtp-Source: AGHT+IE1E2KWyzgwB8LlkbX3Ajc/4on2xVRaGQhje8ITWVkxBHFS5d5erJB8YF7nQ6durH3H08gA5w== X-Received: by 2002:a05:6a21:e86:b0:1d2:bcba:70b7 with SMTP id adf61e73a8af0-1d5db196560mr1913875637.27.1727825150244; Tue, 01 Oct 2024 16:25:50 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b26539c5asm8628143b3a.210.2024.10.01.16.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 16:25:49 -0700 (PDT) From: Rosen Penev To: linux-crypto@vger.kernel.org Cc: Boris Brezillon , Arnaud Ebalard , Srujana Challa , Herbert Xu , "David S. Miller" , Rosen Penev , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/5] crypto: cesa: add COMPILE_TEST Date: Tue, 1 Oct 2024 16:25:43 -0700 Message-ID: <20241001232547.355947-2-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001232547.355947-1-rosenp@gmail.com> References: <20241001232547.355947-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This can build on x86. Allows more CI coverage. Signed-off-by: Rosen Penev --- drivers/crypto/marvell/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/marvell/Kconfig b/drivers/crypto/marvell/Kconfig index 78217577aa54..4c25a78ab3ed 100644 --- a/drivers/crypto/marvell/Kconfig +++ b/drivers/crypto/marvell/Kconfig @@ -7,7 +7,7 @@ config CRYPTO_DEV_MARVELL config CRYPTO_DEV_MARVELL_CESA tristate "Marvell's Cryptographic Engine driver" - depends on PLAT_ORION || ARCH_MVEBU + depends on PLAT_ORION || ARCH_MVEBU || COMPILE_TEST select CRYPTO_LIB_AES select CRYPTO_LIB_DES select CRYPTO_SKCIPHER From patchwork Tue Oct 1 23:25:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13819011 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 CAC361CF5E1; Tue, 1 Oct 2024 23:25:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727825154; cv=none; b=iBnpMwP1+OyzsZMcC+wWNI1EqkT10wNtisH1+9BR5S/QXTW0aDIHVXaQEKlOAiEnIXywIgaM5Ju0sxxbwsITKKGgpCzdwEkhNygNIeg2m/MBJznwEM5QqrXN3fpsXrbrmWKeMREHz8Pr9NLqZMsx3ihCTW0OB0U0D8QzTmNGC5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727825154; c=relaxed/simple; bh=lo5OoE5NS4ZISLM1Q/pBTOCgK83yqQClyBy/YM3R3WA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MaXJiusZeiLJ9EMApv77pNG5+kI6XIUsdTN2Kh8DsBqI8hunwPzYhP2YKjKeEod5w30y51KwX+Wjp9FoY23iMAwkI3yazNg+kbsP3mXfmuJMFvojWWWRQnsltdrNbE1uhC2J+w+mTTBJLVuJLMBy88vXI1/nn+FePomWXshf1/8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WoTyHoXk; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WoTyHoXk" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-718d704704aso5124909b3a.3; Tue, 01 Oct 2024 16:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727825152; x=1728429952; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+BRLeIPOzKlGspJqEHRBhJfVfhiwh5nKq1NYIieIKaI=; b=WoTyHoXk5PVsFRgQ4K3YqBkHVgqzL2vZblBy8sfRMTdH+iC4mAKEiBTDJQneCxZa+/ 33G3OyhDe9hRB9tU5/skbn21hAPe4ZHhFggjQdCFNqULh0a8fwsLgqI0Nje3aY6mzmpZ njXO9y3JZ4xGrANrEFEzkXA+L9IivLglP97NuB6q6/K3TswQw/cdfRfiVqFa197s4f7d 01EhNWHvaKMB/UGMbDLr1gd8Cuf9d0qmK7FsV//6j+yioJOPR4peXlkwCBTXd1KgEQSD QsiBfs5pAnCLSvlFFXzHnW8vv4/rgAjehg3mpNu9qcMBuMDje4lHN8vUD1L8pNlgMi+c Y0Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727825152; x=1728429952; 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=+BRLeIPOzKlGspJqEHRBhJfVfhiwh5nKq1NYIieIKaI=; b=oWvQ+8QRSEzhZ23RPV76ij+PpOE01Q/YvCIspHmX37rfPtOnvArmHVG4l0VYwkDpiK yQ4YZFNxUenfatjjDs6FV5XIA7PqI9jJDs3ZrJau6Oa9WHpjl/lgVaEPdOKmNRUMirQW unwTRMD4EsywWYc7P9MiCeAy3jbA6OAusnxIRjkwg2oak4bJO5xgBqdZxWORgIs/fGFq 3htebzkn/YCiJ3CbcMkJqndTfAQb+0gHTm5zr+W6/7g64X/oFp6QjzuGC1eNw4vVQKVt yahCr7l98RgGDOByka7V51m+MgxwKELjSzbeLquSDlVXpobY1gTXMi7H1iPsRSD9KN2v hVEQ== X-Forwarded-Encrypted: i=1; AJvYcCWt0P2fYUcrcybVL/T30VikyS0ntmpGO+g8DrTSjYPVCPQweroZo9+KwO3L5yc6m4C6c/ex5BX221S/+7U=@vger.kernel.org X-Gm-Message-State: AOJu0YwUPPnQTdGfJyDb9u8qMCpcK2zQIQAa2Fs+gXMkMYC5nVwGUmls XT12pCG7RwijcpZFyAbZoK/TupnT8Fhr4uKCHsvJxtm7im9Z6dtPFwMLPhIr X-Google-Smtp-Source: AGHT+IEGDOZSxoHLPpL3dnePzf4QIR+MpUVPpmP/+mTzgJ4JYTkFuoN42YY9m7oXr4jXRtTXQ85bkw== X-Received: by 2002:a05:6a00:3e04:b0:718:ddd9:a8fa with SMTP id d2e1a72fcca58-71dc5c93cd5mr1965247b3a.16.1727825151874; Tue, 01 Oct 2024 16:25:51 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b26539c5asm8628143b3a.210.2024.10.01.16.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 16:25:51 -0700 (PDT) From: Rosen Penev To: linux-crypto@vger.kernel.org Cc: Boris Brezillon , Arnaud Ebalard , Srujana Challa , Herbert Xu , "David S. Miller" , Rosen Penev , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/5] crypto: cesa: use enabled variants for clk_get Date: Tue, 1 Oct 2024 16:25:44 -0700 Message-ID: <20241001232547.355947-3-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001232547.355947-1-rosenp@gmail.com> References: <20241001232547.355947-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Avoids manual frees. Also simplifiies the code with _optional Signed-off-by: Rosen Penev --- drivers/crypto/marvell/cesa/cesa.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c index 5fd31ba715c2..1c90e65c89d8 100644 --- a/drivers/crypto/marvell/cesa/cesa.c +++ b/drivers/crypto/marvell/cesa/cesa.c @@ -510,24 +510,16 @@ static int mv_cesa_probe(struct platform_device *pdev) * if the clock does not exist. */ snprintf(res_name, sizeof(res_name), "cesa%u", i); - engine->clk = devm_clk_get(dev, res_name); + engine->clk = devm_clk_get_optional_enabled(dev, res_name); if (IS_ERR(engine->clk)) { - engine->clk = devm_clk_get(dev, NULL); + engine->clk = devm_clk_get_optional_enabled(dev, NULL); if (IS_ERR(engine->clk)) - engine->clk = NULL; + goto err_cleanup; } snprintf(res_name, sizeof(res_name), "cesaz%u", i); - engine->zclk = devm_clk_get(dev, res_name); + engine->zclk = devm_clk_get_optional_enabled(dev, res_name); if (IS_ERR(engine->zclk)) - engine->zclk = NULL; - - ret = clk_prepare_enable(engine->clk); - if (ret) - goto err_cleanup; - - ret = clk_prepare_enable(engine->zclk); - if (ret) goto err_cleanup; engine->regs = cesa->regs + CESA_ENGINE_OFF(i); @@ -571,8 +563,6 @@ static int mv_cesa_probe(struct platform_device *pdev) err_cleanup: for (i = 0; i < caps->nengines; i++) { - clk_disable_unprepare(cesa->engines[i].zclk); - clk_disable_unprepare(cesa->engines[i].clk); mv_cesa_put_sram(pdev, i); if (cesa->engines[i].irq > 0) irq_set_affinity_hint(cesa->engines[i].irq, NULL); @@ -589,8 +579,6 @@ static void mv_cesa_remove(struct platform_device *pdev) mv_cesa_remove_algs(cesa); for (i = 0; i < cesa->caps->nengines; i++) { - clk_disable_unprepare(cesa->engines[i].zclk); - clk_disable_unprepare(cesa->engines[i].clk); mv_cesa_put_sram(pdev, i); irq_set_affinity_hint(cesa->engines[i].irq, NULL); } From patchwork Tue Oct 1 23:25:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13819012 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 1C8591CF7B0; Tue, 1 Oct 2024 23:25:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727825155; cv=none; b=Jhk2SeZpTi/anLZqp6jubnfZK9je2EJdfSNOMTb9e4yJphaAoHids5dI25SIj4epUiZNq51xrDAnoecQ9fvNzqm8NCpStAH8/XAiYcVs0IVdRAyRl094kh2JveBtjNQasBmeItmp4jEmPeE356DRUSKcumjEtEeRo3tRyfJuwec= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727825155; c=relaxed/simple; bh=ArRz35Yt7ZFFgfkFYLXbuIMfBfmHY/Q182Ohi1Zp3o4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bfn0nuo0WIuVt/BFfDrxlhc3p4t1R4M0nhBpElnHKfVAXUdsgMvQx1TUqFEjIlEzi58iUfW5lNYabDRhkf1QFzCrsTMmu/3+Whia8Knc5y2u/jtqgcZfDbA6pNwxA4+pmXs2cSlVb5I7ST+LZ9I5V0kSzZqMjpqlLG8JOVreNNc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=l1QbBcko; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l1QbBcko" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-71b20ffd809so4608771b3a.0; Tue, 01 Oct 2024 16:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727825153; x=1728429953; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1dl0UbOAYtW+oGiWzYdokj0qHo7wDE4qgLOCCPNp8yc=; b=l1QbBckojdyvYzbuM7GeZ8VfQ64haFiZoqXbNYZVbeiYspVsfAJNvBbaiDhdaw4Ijw Ju72eHiPiVLERVip316BQtV0JiyGhw349VggktLlOQepqJYjn8MuTiqpxg504wZG/H9Z ICXDOOywpZvezpThxbKh1q8HS8grcfP93Jz8ajYwR8u4idIkiLKqKCXo/GJ91+obBdyk TUztJ2ZfERZl4FD5f1/RLzbc0W28sHB0I6ZTt9mguzFvHwD0BuYHwYwiPx20ABqp+vmh lsbfAzjrOLkW+SvSMyN5oMARKgSpjS6oGy6F+t8pUe8vpy7i9s+w/ULJE+APdQ97/osh 3nWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727825153; x=1728429953; 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=1dl0UbOAYtW+oGiWzYdokj0qHo7wDE4qgLOCCPNp8yc=; b=Y3zrRK918nBqtxd32EgO4Ulb+5LiJqGnIbm2zzhCR6wXUs/o14hWXz5mZYpWGJ3uE+ DY1/wmS6NjquDtPF4A6xE4ogsRqxJi7K9C9zgN7FxkmxA9jqo9rrhalBH0R44e5y2nfS 50DXV6lZMuC1GaZsCuAcupHMkvju5wOFw+IFO6cByrlf/kHgDqkxL+GM/bBQpYzvUC6O s5YTyxbnlZWaOXMO3cL+LJ5RvmU7njLJ8wYVxRp4XgcTEe9OBB/lESKAtTNqc8j98tV0 yCQPc47VxmHRCleFekEflXycZM5xfmjH6qlPDLO+2hAWwQbLWGbeATbShBFLHnOvPvNj jJOg== X-Forwarded-Encrypted: i=1; AJvYcCWrBEIkJc0sWvlVRxp/6GzoRQFV68GNUVIAowzMiiie6c15URGUG4OiezO86BgToD3nlqO+of+dNCx47RE=@vger.kernel.org X-Gm-Message-State: AOJu0YxaLHMRW5O7dk7nLtKd5Ugg5pOd8s+85I7xTwwjyQTPt9mBF7/H v10cmKGUg29s+WmgjenXR6qEPPyPF9A+ulkWiWDDlWCP8Dpdz+bCHqtMRW3q X-Google-Smtp-Source: AGHT+IGdwiKi4+brGE+41TPt+Grt9y/Wi4E/nZjbXQyz8LCkFNHssRNb+gk+ncqBZiTrAP319TOXwA== X-Received: by 2002:a05:6a00:1496:b0:714:1bce:913a with SMTP id d2e1a72fcca58-71dc5d5312fmr1931972b3a.21.1727825153244; Tue, 01 Oct 2024 16:25:53 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b26539c5asm8628143b3a.210.2024.10.01.16.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 16:25:52 -0700 (PDT) From: Rosen Penev To: linux-crypto@vger.kernel.org Cc: Boris Brezillon , Arnaud Ebalard , Srujana Challa , Herbert Xu , "David S. Miller" , Rosen Penev , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/5] crypto: cesa: remove irq_set_affinity_hint Date: Tue, 1 Oct 2024 16:25:45 -0700 Message-ID: <20241001232547.355947-4-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001232547.355947-1-rosenp@gmail.com> References: <20241001232547.355947-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This is unnecessary as the irqs are devm managed. Signed-off-by: Rosen Penev --- drivers/crypto/marvell/cesa/cesa.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c index 1c90e65c89d8..6098518e136e 100644 --- a/drivers/crypto/marvell/cesa/cesa.c +++ b/drivers/crypto/marvell/cesa/cesa.c @@ -562,11 +562,8 @@ static int mv_cesa_probe(struct platform_device *pdev) return 0; err_cleanup: - for (i = 0; i < caps->nengines; i++) { + for (i = 0; i < caps->nengines; i++) mv_cesa_put_sram(pdev, i); - if (cesa->engines[i].irq > 0) - irq_set_affinity_hint(cesa->engines[i].irq, NULL); - } return ret; } @@ -578,10 +575,8 @@ static void mv_cesa_remove(struct platform_device *pdev) mv_cesa_remove_algs(cesa); - for (i = 0; i < cesa->caps->nengines; i++) { + for (i = 0; i < cesa->caps->nengines; i++) mv_cesa_put_sram(pdev, i); - irq_set_affinity_hint(cesa->engines[i].irq, NULL); - } } static const struct platform_device_id mv_cesa_plat_id_table[] = { From patchwork Tue Oct 1 23:25:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13819013 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 9E14A1CFEA2; Tue, 1 Oct 2024 23:25:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727825157; cv=none; b=dzaPgrwsgpf6l9QrZhcS8ViipyBFsxbpslFkoeeFFckGkVQi59w2b2ePaP8o0zq56+gg/2skfYI4CuHUJTa4PzXWkTFL/Nkr1RyvgTTJdTqECLpdEyubk7TGaniSQSGp7ASmY8XU2GsDSR3GIfwMfM4a1XqQapLz3LwSD3oehiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727825157; c=relaxed/simple; bh=va2VM1Kx0bEZi2np1B9hWqdoRpyE9ylYPhVmxGhoS00=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OuxinwHyi1x3fwjzcBXj7suR1dCliW4Ua+r7COHKxUpQVLzI7apsJLk6/MI6i7fCBsrcmHQzwb3yA6hQ0aaxxkXiA38izeGOf4FYrtBDd6Ci8GHR9c0XMJmccZV3b32Y9AC9bIJ/I3DNsnJAXM9BrEcNfyRB5BmduIXmlDAIAKo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dgcBB1mk; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dgcBB1mk" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-718d704704aso5124927b3a.3; Tue, 01 Oct 2024 16:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727825155; x=1728429955; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ap2wC5QiwJQNfwy7ZlBVUJpCk6c8LIQbmbBdGbf3UjA=; b=dgcBB1mk+2KcnPt5dYVlrVO4gkK+yHwDsvfofICX2Kx6MtorHFCMzficsnGVreg7q4 y4VsKkTwsucr6JL2oK6wmBvFvj4RtahrHoIcPDRbYAqLbWbjyQC7+SwO+iWrjeAKTr4T Ev1DuEvD7qN0hMaNPdpePKbWX6hwDwb2x8QxpoRNG5Lk0OXsc8C+G/jmKYT00wkQ2Qrs L6Alc/2mvDzikoMRoHl2fzfZXC9IFZA7XBdo9SpP3pzhou5PmNGnlR4zlpd+DzO3m0gZ Sl+IrYnDMibJYf2UbkTNwJ4Gj09rqv7bD/R3GY2wdhsB3cZXyvW5etAQ2Q+pLqIFeKLO ejjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727825155; x=1728429955; 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=ap2wC5QiwJQNfwy7ZlBVUJpCk6c8LIQbmbBdGbf3UjA=; b=uGj3AManoUZyNUMFBa4wJI68xcndkPDNg9xmYU3Ky3imqwhZ0wNVLOTRfYg4oZ8Z9O a11qkoPKqpr4JZXSygc+4EN8cQhFPz8skuTO6tHdBjKAdvKr9vnHxTmzeMRLItR4muXJ MS2ngIN6ZYSciESF18qu02ll5OUy+7BP7/i31vvcH+Iz933aj12a6Ud06rzx+6ZgzaMN mKWM4zVsgXtbLa6srE0WTrHGh8s1f9YrHn9S736kdVBcTfEFifAyrp34qVxkU3pxRkA9 52RQMECXCkFUFbL/JmMQ0cIdZedO3pLn82FC/z49NReEbiUT8UAhiEMTscJjmcGPVcKK e0qA== X-Forwarded-Encrypted: i=1; AJvYcCVcraJk9AMD1vqf190L+LKzosMcobYMnAbqF4K7JehZ1Y4yDUmWmNQUniB575L4DhTbejJdqk4s99fb6z4=@vger.kernel.org X-Gm-Message-State: AOJu0Yxh3iPglSVDFS0airrKuBIeYp6PMSOB1F9H5VRdBkBDj3bABzEj CLe1pLuAtTxMpeQoFEx71YegsqGxOH92gOsIHK8/RbY7cmju0zg2XMH5pl+0 X-Google-Smtp-Source: AGHT+IH3Hc6Qddyg7UCnLzWw1vhPHLpVABqaFDRF9F8dEQ3A48Nz6NdzTE9PHR3Qqx8EkvdKrSfgcg== X-Received: by 2002:a05:6a00:4f92:b0:718:dd80:c2bc with SMTP id d2e1a72fcca58-71dc5d57ee8mr1646652b3a.19.1727825154703; Tue, 01 Oct 2024 16:25:54 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b26539c5asm8628143b3a.210.2024.10.01.16.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 16:25:54 -0700 (PDT) From: Rosen Penev To: linux-crypto@vger.kernel.org Cc: Boris Brezillon , Arnaud Ebalard , Srujana Challa , Herbert Xu , "David S. Miller" , Rosen Penev , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 4/5] crypto: cesa: move loop to mv_cesa_put_sram Date: Tue, 1 Oct 2024 16:25:46 -0700 Message-ID: <20241001232547.355947-5-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001232547.355947-1-rosenp@gmail.com> References: <20241001232547.355947-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Simpler to move it there. More readable remove. Signed-off-by: Rosen Penev --- drivers/crypto/marvell/cesa/cesa.c | 31 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c index 6098518e136e..3dc74d1a8514 100644 --- a/drivers/crypto/marvell/cesa/cesa.c +++ b/drivers/crypto/marvell/cesa/cesa.c @@ -416,17 +416,23 @@ static int mv_cesa_get_sram(struct platform_device *pdev, int idx) return 0; } -static void mv_cesa_put_sram(struct platform_device *pdev, int idx) +static void mv_cesa_put_sram(struct platform_device *pdev) { struct mv_cesa_dev *cesa = platform_get_drvdata(pdev); - struct mv_cesa_engine *engine = &cesa->engines[idx]; + const struct mv_cesa_caps *caps = &orion_caps; + int i; - if (engine->pool) - gen_pool_free(engine->pool, (unsigned long)engine->sram_pool, - cesa->sram_size); - else - dma_unmap_resource(cesa->dev, engine->sram_dma, - cesa->sram_size, DMA_BIDIRECTIONAL, 0); + for (i = 0; i < caps->nengines; i++) { + struct mv_cesa_engine *engine = &cesa->engines[i]; + if (engine->pool) + gen_pool_free(engine->pool, + (unsigned long)engine->sram_pool, + cesa->sram_size); + else + dma_unmap_resource(cesa->dev, engine->sram_dma, + cesa->sram_size, DMA_BIDIRECTIONAL, + 0); + } } static int mv_cesa_probe(struct platform_device *pdev) @@ -562,21 +568,16 @@ static int mv_cesa_probe(struct platform_device *pdev) return 0; err_cleanup: - for (i = 0; i < caps->nengines; i++) - mv_cesa_put_sram(pdev, i); - + mv_cesa_put_sram(pdev); return ret; } static void mv_cesa_remove(struct platform_device *pdev) { struct mv_cesa_dev *cesa = platform_get_drvdata(pdev); - int i; mv_cesa_remove_algs(cesa); - - for (i = 0; i < cesa->caps->nengines; i++) - mv_cesa_put_sram(pdev, i); + mv_cesa_put_sram(pdev); } static const struct platform_device_id mv_cesa_plat_id_table[] = { From patchwork Tue Oct 1 23:25:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13819014 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (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 A7F241CFEC2; Tue, 1 Oct 2024 23:25:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727825158; cv=none; b=NFpjLSOLhKj5QYZ8M8HLemOOFr89P8lpbk0Y0RaHH2wNAgFW0w2u94ZXA2wofFkHSdKTt2n1XrrO1jlCFWdaf+zL3n0X/iyy8RC8MtRbpSSEdvCjlPnXMg8ljfJrRurID41xQWEVvRuEhYtJ5yTRN5ZB9dQzqlDWZvG50psUoiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727825158; c=relaxed/simple; bh=FfyDs1TC5dH9vKpYzlHY/EKwJnCmVg4259BQUa5YcYY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JsiiTtAUuSgciOB026aJqV+uGKcWOAX2YhKxWGsFlK9w10AgZWA2zWgoU9bncKZfsPNofvaAZiA2xQot7NBlDPZ5Z5YrbyRFabebg8RcR2gM/4PipgPXJycrmkEJ9Ko4jA2//zovrgJvKVuFz6NXBIGB9pC6X3N/G5AEUUHo3N4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=W9rxST40; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W9rxST40" Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-7e6cbf6cd1dso4154123a12.3; Tue, 01 Oct 2024 16:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727825156; x=1728429956; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d7A11XDgxNYin/VkwABPFnYDQbab1NvKclWfdZ0MPzI=; b=W9rxST40BZnjeZrQ0GNwxdRa1UYL+tCrNvVCDUhMl6pxNgbG7fdVEOrlJCDiF6Oita V+hRjCtIrKaytql4iv3p5liOWluzJMKpW1vu1KwCkGzedOJxmTGnRP4VnSTiTPe2jkR2 Lx8gF0dD54w+uVt+ppgxuHGM4A4gjFh/uBDvCsLAhjSLAly/Ke2auS9PkcnLLMAayeY7 vmWxfnj0hUzyT+WbGQKSd/GpAUCEaS4BSQ5whOrwfvYURYjyxUABb/HxiuaB6oP/jrw2 gUTem7ts4Rlp+EnIqzpdNPFIDoUc80CQW48KqvFu/K3Sig6qvb6taj5D/nKJPruBvkl1 RztA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727825156; x=1728429956; 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=d7A11XDgxNYin/VkwABPFnYDQbab1NvKclWfdZ0MPzI=; b=gMPMDV/SwomSWd3kMpJlLPyM+TVcwETVMXANDKwfjrNKeGpQzJ3l6u1pR/S0yhX5Y9 Q59TG5ud7zbenfXCQYWJKUuERFXLwtxvstK6sDQpKvMeLfa41NsxYdJt3F5SjM+aRX3N XGczibYotWBBjO+kN4MX55ghWKeS60rt5KOOYVf9UYpSmouBcz1ZOHXFade2CNBLOFzr slXUNDvPOqKSLGSMBwXD7Kq62J1HbaakUwqyaLr3aUdQ47yvZLmw1L+YT+5qqDfxA5wM PSIQJBWAbpxov75emEuf2D9c1U1oUJ9JcaS86QSfWxyZfHcdTqUYhT2k8E/O388OYt2h m4FA== X-Forwarded-Encrypted: i=1; AJvYcCUGx0hoEiJ0BYoS4f+vwOXoqV37yyK/7rijLZ/Lo2+aBCIUsSTrfaYeH/dO/nunCvBDLurxtSUjhtOXpE0=@vger.kernel.org X-Gm-Message-State: AOJu0Yx10WROi/Tp6JU5RhuAXbjf8CACpXUhEhfyTiNTVYnguDi+3kiM 8SzYB+FY0vfW87f4lQbaFZK4Cj0vcXCbGSHgc9FsR9pAWXOrkCgBfwmJUZp5 X-Google-Smtp-Source: AGHT+IFZHRTl5EAhvQKFyHclozxa+8AxkxZSFrzbQ+m5Ud6J0wQJEYd435ynTrzb90hJnJQ/RJIx5g== X-Received: by 2002:a05:6a20:c6ce:b0:1d2:e888:3982 with SMTP id adf61e73a8af0-1d5db13e781mr2037818637.19.1727825155866; Tue, 01 Oct 2024 16:25:55 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b26539c5asm8628143b3a.210.2024.10.01.16.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 16:25:55 -0700 (PDT) From: Rosen Penev To: linux-crypto@vger.kernel.org Cc: Boris Brezillon , Arnaud Ebalard , Srujana Challa , Herbert Xu , "David S. Miller" , Rosen Penev , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 5/5] crypto: use devm_platform_get_and_ioremap_resource Date: Tue, 1 Oct 2024 16:25:47 -0700 Message-ID: <20241001232547.355947-6-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241001232547.355947-1-rosenp@gmail.com> References: <20241001232547.355947-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Removes separate steps. Requires index instead of name. Signed-off-by: Rosen Penev --- drivers/crypto/marvell/cesa/cesa.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c index 3dc74d1a8514..e2d31b9c35d9 100644 --- a/drivers/crypto/marvell/cesa/cesa.c +++ b/drivers/crypto/marvell/cesa/cesa.c @@ -375,7 +375,6 @@ static int mv_cesa_get_sram(struct platform_device *pdev, int idx) { struct mv_cesa_dev *cesa = platform_get_drvdata(pdev); struct mv_cesa_engine *engine = &cesa->engines[idx]; - const char *res_name = "sram"; struct resource *res; engine->pool = of_gen_pool_get(cesa->dev->of_node, @@ -391,19 +390,7 @@ static int mv_cesa_get_sram(struct platform_device *pdev, int idx) return -ENOMEM; } - if (cesa->caps->nengines > 1) { - if (!idx) - res_name = "sram0"; - else - res_name = "sram1"; - } - - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, - res_name); - if (!res || resource_size(res) < cesa->sram_size) - return -EINVAL; - - engine->sram = devm_ioremap_resource(cesa->dev, res); + engine->sram = devm_platform_get_and_ioremap_resource(pdev, idx, &res); if (IS_ERR(engine->sram)) return PTR_ERR(engine->sram);