From patchwork Thu Oct 10 19:45:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13830997 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 4C96B1CF5C3; Thu, 10 Oct 2024 19:45:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728589524; cv=none; b=Te5l2AZemWsF4ZXs+JD2hqQ7o7x0vzwYw2qaBD2GU9eOgrlRwj+b7sAUU7TSqtcpKut152S03kUP71zA4o+1Rzb74Fg61SB9hKnRMCysrjW0MJpfGZ+gxz2Rou+a8hNXug8NgP58M+yXTyPZyUTFEVR0TY7oWgz1kvDowCeGabo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728589524; c=relaxed/simple; bh=8tEpKzuJJod0wz3ZcPjN+AayChvMMlQKA3FkFqFp7Jc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W0W8JNvNv++VjHo7jJFTG/gmJrvxqBBixVxV4nidgzCkheH6Y9nzlBfsqbzeztM8ZfIf9/In7Dld5ZgtagieRFbZTAlHBTHvWBaeRW2DCUdoiG4bfLDVVTNpYneDZUqXxzmNwxmUMzJUaR/Ztt/zF87E4CVvQnUEMJ/hY5K4Drw= 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=MzRc4Jgi; arc=none smtp.client-ip=209.85.215.173 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="MzRc4Jgi" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-7e6ed072cdaso950824a12.0; Thu, 10 Oct 2024 12:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728589522; x=1729194322; 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=MzRc4Jgifk3kUgx6mtSHn7J7IQJtZ/wD7VEDSCFG5zj8/2tyOV2qGUOFPGHH+jTWfl g67o7UXCnDPpDobKKgy5CEkWuWDrUcQ+4pHH2g8fM5RNyOrQjPodPfwpzeAzA5d/OjtL Am3czQuFiMNM1FvLM0SdTrYFNtou427MQfJzoHbPPkHq2K0gi/i+Z0oCVifXLgtfW2Jx kFNRwc/Nw7mg40UWb2fet5db7PS5FcW/WqdnnwOfstj7wvlHItoo7y4OB9swXi46JFb3 nVftVm6UzKBHyoDS4lLHMOLDJ7jzmDlOD8PKf5lyBz4e3UgQ5adtbR0f7D7kKRIJZTIR PWjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728589522; x=1729194322; 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=Fuw08d0xSWDsWuyI8/wtGUmS2niImBGVdO7XVy0UHqkl9AtaRoiZauBIJESk1V2Hij Sc53kJDLhyvCw+4hJrPckU+eBuBdnYzLnIKLTZButASW9bBhzmZwWPp3J5XoASKZNj1j lQJ0mFlW8Le2MjAutMEei4XNfcAoP4jnODORVOKtq3xNQX1ozrPvhho2NkWY0Q5oEQlJ stbIpMwa+dC637jb50DT1hUB2gNAf0xUqIOJoGp+y1tWl62hN0vFDRG6Cgu9UQPnm9BF 2VjKZe80XqTENgstFFDYiekxKMeis2B/2Sz42CEHM64kiBpXMQahqZuhXFKd7lst0br8 vyew== X-Forwarded-Encrypted: i=1; AJvYcCUOybhJHd4GewSa3ddG1aZsmyA0UGBI/kefQpgiYBIAu1RbTEWEB25Schm+45M4bvqMxI6csGrXZ0DlKss=@vger.kernel.org X-Gm-Message-State: AOJu0YwwIyuDbvE+1tkqk38GPvFAxqSSzL87lhJDsAAXieH/ZJ0yLTGt 9qlxvtitOW672/rpSphwf/KjIIBquFr8fvu5AjjHHm2c7nFQ81/DeCETN/v+ X-Google-Smtp-Source: AGHT+IFkP32W5FTePBxbjmQ6asSjg+DfGIyQ+ZyXqTnfkEwDw0+8Ev+wAy1piA16dz4RUdZcSOnBNw== X-Received: by 2002:a05:6a21:1190:b0:1d8:a18e:177d with SMTP id adf61e73a8af0-1d8bceef578mr176044637.4.1728589520893; Thu, 10 Oct 2024 12:45:20 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea448fe50csm1374762a12.29.2024.10.10.12.45.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 12:45:20 -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: [PATCHv2 1/5] crypto: cesa: add COMPILE_TEST Date: Thu, 10 Oct 2024 12:45:13 -0700 Message-ID: <20241010194517.18635-2-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241010194517.18635-1-rosenp@gmail.com> References: <20241010194517.18635-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 Thu Oct 10 19:45:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13830998 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (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 551751E47BE; Thu, 10 Oct 2024 19:45:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728589525; cv=none; b=VSEXTQXzgGqgqtVmMN78sQuEJvPb3w5etTdenGuH3sKwTLIIpCZAS+2ULr3+quyXONHWPRXuOyOlnniU6GlFUu78U0AHt22fZ9HLxcYiDzACRJySTE3McAN+oNiE3sW23woQcpKqJrdj1K8iRDfSrhJi8+oC/DfG0uj90cIdVs8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728589525; c=relaxed/simple; bh=Nx8VNWN+Ged3O1ECbBqO6R/sGi7JiDO0mxBfjYcGi+I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T38xaQ0eQi02FWSdlXa9Dth3W11xcspC2iUcmtXrIS/D+YTjprwNdnWDpy/+NAEZUo4aY6Q0iNfxCHIwUYRNiKJ2cdcdi/7fActLYcWoOh6MHQM66A49FYGeaWOrfzsdYV2r0qU6A2wDg+HPsqpqHa7WoHcE6RzeBw50I+HVz/4= 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=TzaqbktZ; arc=none smtp.client-ip=209.85.215.177 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="TzaqbktZ" Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-7e9fdad5af8so924987a12.3; Thu, 10 Oct 2024 12:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728589523; x=1729194323; 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=amc+Up8qxLrazdJMaZGvOUoweFN2ceImAtncendD8oY=; b=TzaqbktZv/TiCfEMPEMK/lbkNIrdK9BqKQA7u33j2WJD6a/GBYUbXMJ3ozzwCsbY/Z KJK2H7BApa2laOdevpD11DYWuYaFlgycnuoHPcv1RQES5Fi+2ErxMLOKOk9d8phGyexU WA09gVw1IycIQbycIh4YKEmYxim6PdkZdWmsLdkZmtYPMI9M48UoJIMqj/u8bjovmU+9 2dsgK/MTUMidbPzP3ufs9LjqM0GaxqNhg9UChnye3m8fY3UbBhHz39VlgRdpKrI00c4K 9pP/EriHALYekI2zG6jodGrm6cUssOmCHs/tD5iu8cBRE/mmYnMgPuYr7f2nsRauPUmc w9Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728589523; x=1729194323; 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=amc+Up8qxLrazdJMaZGvOUoweFN2ceImAtncendD8oY=; b=r/xxBLC5sWM+Hhowu7tnvWG4xWMa7m7fk+S4QzkKCoy4jh5XV9GVNmFP3WHqRAOlhT jQRbD9gvwmUOT8gWmsD1GyKrPDcmOvQovUy/SWedm1EL0nhP5m111fBo8NlXJVrueCmj UkepdyefovKZ9B0n6w442hNMALVe5tbz6GHw5i5c10XcMgqIegLWN33Q/5trNqM5q9nu M5X2vxa9lauFUn1Qn9a7HK37i8r4XBanx83HiOp3/CxeMqBxy6t5u4ApMr6ZtcZv5aLV ZcQ45viu3odG+XshplipN4tiFo6A3FlVkwb4E6CIOjLo3VPg8vt65Vrn9TaPgbgxDeCn cJXA== X-Forwarded-Encrypted: i=1; AJvYcCVPJCdKRLYut178KUXl8jekG4PkQbpOs8apax22S9STf36nKw9AyevXUQtLdmDq9Rm3D986w/EfNbTIc2g=@vger.kernel.org X-Gm-Message-State: AOJu0YzoyJydwnbboW2DYgwtRxoGvWyTN5IsK2ukE/U1AszuRzeouYli wLJExL7xNsf1gZcZh0J7F6RtbOZd+CmexKH5VqvoBu09rBTTiarKDCHAhIQU X-Google-Smtp-Source: AGHT+IFkirpTzTrqn2x77L+6KEBiz+UL2XhWYWjOstJb/n8nW3QzKgmGPGSB/e1AeS2U+BH360ea+A== X-Received: by 2002:a05:6a21:3990:b0:1d2:bb49:63ac with SMTP id adf61e73a8af0-1d8bcfaa073mr151956637.40.1728589522067; Thu, 10 Oct 2024 12:45:22 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea448fe50csm1374762a12.29.2024.10.10.12.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 12:45:21 -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: [PATCHv2 2/5] crypto: cesa: use enabled variants for clk_get Date: Thu, 10 Oct 2024 12:45:14 -0700 Message-ID: <20241010194517.18635-3-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241010194517.18635-1-rosenp@gmail.com> References: <20241010194517.18635-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 | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c index 5fd31ba715c2..74a1d1ad67d3 100644 --- a/drivers/crypto/marvell/cesa/cesa.c +++ b/drivers/crypto/marvell/cesa/cesa.c @@ -510,25 +510,21 @@ 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); - if (IS_ERR(engine->clk)) - engine->clk = NULL; + engine->clk = devm_clk_get_optional_enabled(dev, NULL); + if (IS_ERR(engine->clk)) { + ret = PTR_ERR(engine->clk); + goto err_cleanup; + } } snprintf(res_name, sizeof(res_name), "cesaz%u", i); - engine->zclk = devm_clk_get(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) + engine->zclk = devm_clk_get_optional_enabled(dev, res_name); + if (IS_ERR(engine->zclk)) { + ret = PTR_ERR(engine->zclk); goto err_cleanup; + } engine->regs = cesa->regs + CESA_ENGINE_OFF(i); @@ -571,8 +567,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 +583,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 Thu Oct 10 19:45:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13830999 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 B3FBB1E47CE; Thu, 10 Oct 2024 19:45:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728589526; cv=none; b=d46FhFviASvdST5kdgt6UUwJM07ZZRGQPhBkmBOho3RUghUyFhtsgnacgmViszz6qL0K5U9KiG5tmghCSZmXSg2jtlizxdHuQhbqQ/xCnxvY7D11BU2SMsq8JpFxuG3Fw/I+D7GW/x0xfE68rVJ1VrM9GPwt59yMFHnPPfsTnUk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728589526; c=relaxed/simple; bh=v2wQYF9MfkRR/XoJQpT+R25t14mcfTyXt6lelenjPVE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EmjAhOmalVtNV4bnmtHZB7X8mTya3s2Y9YN/vS71L65Dycln2r1BD0Xv7VC/Lbno2P77aH9cJzXJ5WRKCv7isbSAHJyoAfht5sXa1Mh5MkPsA67MeGPbryXQnphz08msnjNqzY7Qs4g/m4xoO3eri7Y6wykA8GceIC1/q6vQFcE= 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=kNNSo06h; arc=none smtp.client-ip=209.85.215.173 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="kNNSo06h" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-7db54269325so1091762a12.2; Thu, 10 Oct 2024 12:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728589524; x=1729194324; 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=AHFPYc/2pWWDgXQYD+cnOLFqpwx1O8WplMBHy/xRbmY=; b=kNNSo06hc+iBmJARFm3ZiDNJRJHxxxYdwHRMqVSfNVFq+wQgaGptLeQL8EsCrhEE7i Hz07NdOWnZRe5FhqQOJWOQ3ZjUbGmqnS+VCOgsX6NZJlZRTGr7DdXSn483CONvlszz6S UIesIIMGkIRRGqar/LIpMbUO3LzJYxYW+1JwMTKeiZazoU3kxxzOgpxZZ/+qWos/akf0 bIjd2jS+31Jm+tFKzgyEGB3m54JfYoJPdy6aFdkSDSi/IggZLkiNmyWXgCu16x6W3d2D xaAsuFuhkHeT/iwri/cC7nFOxUxa7VZUAGVBJacgh0uyqu68PhVEoGPxHKLnl9P/+a6v 1JxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728589524; x=1729194324; 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=AHFPYc/2pWWDgXQYD+cnOLFqpwx1O8WplMBHy/xRbmY=; b=lAp9DdRDBK1Atepb5L7NQoQ9ayuQDAzZySIYJ3m5/2ZWYlPr+1zbEdE5iN6PiFxmss e9xo+xP24OFg7q9IDvoOuDSDzcftoRhrTyJFBtW58xGI1fuh+7hVNwYUw/SeTFZMayAn 1cIQhk5Jtx+ZmuIHznuro+K/0tkDqTZob1K7kp/jDxYoom0ya5w37D/uc+qNP6mb1Bq8 sMbIC4SG1PTpxIHHuUHh9sXj3kjLz+9gGQQ+0BFeFBIzJYJTpN8s54vD7007PAsQLnz6 wT9MQrYy3BgxG9IGghsMG75nCDfs9ttwIx08LP5ai9CWV0M09J+eC10S3fos6J/jX6Qp yLhQ== X-Forwarded-Encrypted: i=1; AJvYcCUw/yj47f8cmBSCe6X/xJaXdERWAwJaOVwZzfwVY+d52cLJqyW+hGuNXoNBuHZcM5dNBRCZWckfpbttoOY=@vger.kernel.org X-Gm-Message-State: AOJu0Yw0YSU4NMQFoIwKN+UgCS88iCqp/AxkfoxENG/1Flv4vrIIIMfM xCZEzuEBs9aPu71c671tT5Gd3s2WzRJV8EzQnjK108UZXWLyQX+RnOkLqwOL X-Google-Smtp-Source: AGHT+IEHDCRqtAVf5XduzxtBkZ47GOrAxKwWorGFM60H6Hy1D/4x5ZJC28d+E2rsGb3XRmGjIHLRrQ== X-Received: by 2002:a05:6a21:393:b0:1d3:45c1:ad1a with SMTP id adf61e73a8af0-1d8bcfada46mr149320637.39.1728589523594; Thu, 10 Oct 2024 12:45:23 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea448fe50csm1374762a12.29.2024.10.10.12.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 12:45:23 -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: [PATCHv2 3/5] crypto: cesa: remove irq_set_affinity_hint Date: Thu, 10 Oct 2024 12:45:15 -0700 Message-ID: <20241010194517.18635-4-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241010194517.18635-1-rosenp@gmail.com> References: <20241010194517.18635-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 74a1d1ad67d3..21e13f4a1f48 100644 --- a/drivers/crypto/marvell/cesa/cesa.c +++ b/drivers/crypto/marvell/cesa/cesa.c @@ -566,11 +566,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; } @@ -582,10 +579,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 Thu Oct 10 19:45:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13831000 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.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 1286C1E7C27; Thu, 10 Oct 2024 19:45:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728589529; cv=none; b=EFPhTyWvc0F5dhCANxva9Id1igBWC+POh1AuFPu5z+BeQgZpuE0zHDUCRIY6EmU+u4OAlvamwYZk/knyDgxag1GiplSUWgR1SdwlxRu1l2lyDpU2/AKee1T20PyZit5MKB7/4okD8sKlHEbC/hn7hrHfndYWNn/5aNZC2rg4mKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728589529; c=relaxed/simple; bh=Av1xCzAK+uKt7P3u8vHTcsZRd7/NW6AnUr8uFgMtcA8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AGoUSLQNMYcwwXkNi8bjJx8TO4wqWLMjy/NZ2ajrPUmxdfgNHzzxE1fUntwiF3ioV7KJ7UCU6CpQ8UXtWpx/mrmJVk7cc8GMNq49J26GVBePzYQizlonhG2qUEWEZrykb7kmATpX3aJFPzCCFRpTD08t0joMwVTN2GZQXgGUCsM= 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=geSU3+U9; arc=none smtp.client-ip=209.85.210.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="geSU3+U9" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-71e05198d1dso964630b3a.1; Thu, 10 Oct 2024 12:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728589525; x=1729194325; 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=3nfabQEDdcv7hLN1dH0q/bo0Hp0JIO5gPIPoowAAauU=; b=geSU3+U9uzNM6dFi8QiolUdgvZhysunDI0GZGmb4bZKbEy72be9SO7egQA7QJamzE4 tv/tXJmTnSIOa+j+BFN4MRanLW8o4PVeZjBwqNj74SCOfPDBIeudlCDsdjS47i9aS0Yb JOmbJg/+SzL34B5L0gLlkU3S2uiQ06zNYR0wgXOXL/eSX2bYtYbpJlmT/YG8UcJn0cf8 FKnGt/BKKaqrlNJ2Hf/21ZBDQVXzw+sxRohiadV/mlANIC3AW0PRutGXmyqSYYRnTHBe cecaCu2eZfZ09BT/0moUv1mUjGiVhyDTWBsLP5VzGfpFyJbkTlreLlOTdRr1c2jU/BmN fNEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728589525; x=1729194325; 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=3nfabQEDdcv7hLN1dH0q/bo0Hp0JIO5gPIPoowAAauU=; b=u31gu/Qnko4cQ0kFUougTrUNZuGXjTHo+1gsQnAE31xOkFgW7ohpgRuLooydqdXV+t lfq5H1JvyY9+bcyeutZQsoWrD/E6f8O1t+zH/tDn4dpHB3iiz/hNhhNjxRdTxlEruF6O DVKEJcpPbhlKExZmSDTIAFPVpCK6v3YzzL38tvyH77XYczDxmq2r6BIOULABoqqi9fUh gJi36WpO9ZQu4BZGdNgqGeFAt87D22bUo815vR03vM202KO+Vw4ghY0N6kOfqgbABA1S rvma3Vo5YNH0k5itHkkxFfGsPEP2Tmj8jjQm5/EBQckEY9GI+oFo0KyZYRnwRuTpRgXx j27w== X-Forwarded-Encrypted: i=1; AJvYcCUgv0tNQHPJz7p1fyT5Koqr7ZcLT4qaP9dR9RhWy9eu9Zyb88aC3t0nVsF0rbTHe/ChI6ARCfkwPbeDkV0=@vger.kernel.org X-Gm-Message-State: AOJu0YyYYJTP+EQyvr1c1UUmq/ClJ92vphYE8j14dkoTwkFxL4gCnIgL 0yPUQLOcXq1UP6PHBH815G+fLcOO644OOX/1QJtRSNyQ7XAlhWRUZ73wLL6h X-Google-Smtp-Source: AGHT+IHlqQU/t6YV4KmGc30H4lcfsZuM7HVN21cEg0okeM9ski00r/ZlMssJcZnNTe+yZdSU1TWQJQ== X-Received: by 2002:a05:6a00:2314:b0:71d:fbff:a4b6 with SMTP id d2e1a72fcca58-71e380c5f82mr264766b3a.28.1728589525085; Thu, 10 Oct 2024 12:45:25 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea448fe50csm1374762a12.29.2024.10.10.12.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 12:45:24 -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: [PATCHv2 4/5] crypto: cesa: move loop to mv_cesa_put_sram Date: Thu, 10 Oct 2024 12:45:16 -0700 Message-ID: <20241010194517.18635-5-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241010194517.18635-1-rosenp@gmail.com> References: <20241010194517.18635-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 21e13f4a1f48..a65f328b7094 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) @@ -566,21 +572,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 Thu Oct 10 19:45:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 13831001 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 3B5131E572D; Thu, 10 Oct 2024 19:45:26 +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=1728589529; cv=none; b=rLts7WgEuyQc6olFSyPptuzQPFIbtD64zgQZc+I7x/t2A9l6VhsLfLTrlPaAclCfdNs1NaKT8J8uxaeDHnwv0ajeoGsf9GXlK8PqF8A17TjQYd4OULTKc2wT183RAmgLIsj1wyPvqnxsm4uJ+qlcneDbLKBfXDFh+eOgGyLjpvI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728589529; c=relaxed/simple; bh=Z/AKn3jdK5QJr21NEh6M/axjNX6uEKUZyzNVe8ZBoCA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XDEIYNOdmH5Ut7hBiFwVpOGY2bwI1ApiRGTJrAfZIdIbsmwZIV/h7g3RVBFplDJJvCk4XmnR/d6ggkFPNPqbWTDhFGKA7CSXMD/+zf1rPUgWJhg2zaiR7WhWMMg5dtwpKfkklyCg82zGPjJ1SDR+DkRTr3HTMC8GGtvhbr1Dcek= 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=OzD9dJEq; 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="OzD9dJEq" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-71e038f3835so1274507b3a.0; Thu, 10 Oct 2024 12:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728589526; x=1729194326; 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=+3EI4XTDmYBqzGsZ4sox7/pa5h3v/nZZ5pZc9pzFM5I=; b=OzD9dJEqCKwLN184uh9UGd+Ratf/TbPdmh4oo2vButKohat7orITGKpyvDzCquzh4q FsRRAFrPB3n9yyMosz1BQW8I0H7Bqt1VsNkMuzvWp0DipcMd7cEUj07zHKwtLnL94kS+ W2ijaVRlMdvFqbCe/8O/DBhFe9Lkym4NNPnIH+tc4iZZfWTsTSxCcbd1QSGiCOKsWstt Rkq10uqaUxFgk6byR+iNBXU9iEelfMpHo6H4Jvglu+6QQ/TZt3APe4cMYc86NYUvQSIV tDrh/gz3IV8meGca4Uipx4eqUZGnp1+WP00DNCOGhq8qgyi1kT/O9hzn+c8mQaIJ+Sy2 f4Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728589526; x=1729194326; 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=+3EI4XTDmYBqzGsZ4sox7/pa5h3v/nZZ5pZc9pzFM5I=; b=G4HOYW36XZ1mQ0guE8oxzuNaF1Zw05HU8cBrWPcHJQ/Bw2gfFvfFNc2Tb+8diQamJY ypOwRA7IcMMydOAxPIkOOIhW39qpY1bYJ5SDUL7tE/b3jS18XkqbXqgpy4WA2V0R5wrr YfPKY83TDRkp+hqOYLaiy063AojL88gPoXP0Mc8FWmpDo2ZIDatOmDKhoohoYebPGU6I d6RWGyYjAQMklGEVU6I0Ovpxzlh12HYJBhkMkdZ0AoOhEIEwGuMBMdYdK5rxgbInBwhj E3FfLRLYgQPw0ClWvLsGiAfhLXiTssNFH4CI7q7yVwcJ8TdNT+8rNdynMmDC2kbyk497 zlrQ== X-Forwarded-Encrypted: i=1; AJvYcCX8WpcwfRn++aSnH1zMVE40GwmSh6rSoifR2IJx+Thgav8j4w0JLobolohw/jnqhqaP3FyAekxgDcjnYyw=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0RYrYw19/isXrHL4Qa/rJFQYg+YgS5eJu+6l2cK2HNQEKMeWI EbQYEYmdhhMt+iUnoVLzduyoP6NONiyJCSx2TwWdTkWORPRmU/dpirteUqO4 X-Google-Smtp-Source: AGHT+IHJuZRDWcftnPRua4fr9uRoKs7TTb6YTz0GeS+hpwkLoxjCCAZmkRNuK3lfqm3lBYPdzs0xWQ== X-Received: by 2002:a05:6a21:4006:b0:1c8:a5ba:d2ba with SMTP id adf61e73a8af0-1d8bcf356admr168084637.22.1728589526287; Thu, 10 Oct 2024 12:45:26 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea448fe50csm1374762a12.29.2024.10.10.12.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 12:45:26 -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: [PATCHv2 5/5] crypto: cesa: use devm_platform_get_and_ioremap_resource Date: Thu, 10 Oct 2024 12:45:17 -0700 Message-ID: <20241010194517.18635-6-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241010194517.18635-1-rosenp@gmail.com> References: <20241010194517.18635-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 a65f328b7094..ef4b1c2336bb 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);