Received: by 10.223.176.5 with SMTP id f5csp1135689wra; Tue, 6 Feb 2018 13:22:03 -0800 (PST) X-Google-Smtp-Source: AH8x2269+A4GSN4uT9vt59OOvVgohoy1r0SluPX7ZDzrghXfb8TmxYYBJsqE7+8EfZMnyrtZvHgq X-Received: by 10.99.67.133 with SMTP id q127mr3005534pga.365.1517952122946; Tue, 06 Feb 2018 13:22:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517952122; cv=none; d=google.com; s=arc-20160816; b=VH5aK+o1iLjIdmCyFot174g+lyCFJA9S2ctT24mBdKKLBS6lMX/652E81v2/O1CES6 2KMAjZOI3HWFMbrrvgbbEZpirRPw+ChEzisBY3PSsMhvgmXJaBTvizm0p1L6Ap/ePd0a OGigjG75CsftOcdFqbMe7xLnzz1t3uqk5dhoFiuSE96jw7sLZo+jEjcFD/3H1X8LFvnJ neDm5xEGO6NVclT/LL/dc/ujCSysoj9nq7iD1QtX5D4/2DHCBa4gavLfPbMtB13bMTSq Z0i2HRoiLmiimEwyxwWPyT4WPOULIYICOLvuyECSAvm5cuQX3fXByYLLKHiSm0J1Mi0s cN/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=hVtG3jfvyM1oZP/Xy4MFLTrfC1YYQBXb+Q3XAZEC7NM=; b=MCYE3Kc6kvaupEcP0OkNaLaxUaYWIjXKruw22uySYXJGDNu5TYrb+m8TVPR3z2RnK6 Yz5LkVvpplNqB1C5MX/4wmx8/doNAZ4ECWJbN14vfcO258lSEVT+iJ5zHA7ybNKICXjz S6CwPIYnJjcvTH+e+GCbs9sXvX8ATfnwMc8+B36T0za8SXrRkzNaAjEUnxUcTZv2tEGE 7NqSG34+c0TdpHcGuczg296Vu6J+CWqEcFS4Sww+Mq2NWMwnNmuXPRPVXG8qv3FQE1xT UUmCVhpBsN6SwxVKph6sPxp9K7k8RIKupQEP3F9yozb49j1ru1Wh/LDEL1Wg0wTauS1l fUBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mkNHgR7d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x65si952711pfa.74.2018.02.06.13.21.49; Tue, 06 Feb 2018 13:22:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mkNHgR7d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754077AbeBFVUk (ORCPT + 99 others); Tue, 6 Feb 2018 16:20:40 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:39697 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753971AbeBFVUg (ORCPT ); Tue, 6 Feb 2018 16:20:36 -0500 Received: by mail-wr0-f194.google.com with SMTP id f6so3462350wra.6; Tue, 06 Feb 2018 13:20:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hVtG3jfvyM1oZP/Xy4MFLTrfC1YYQBXb+Q3XAZEC7NM=; b=mkNHgR7dOQt/tAtIbHu778yH4LxfB1erpF9utsUoi8aGturtRjHbt/H/94zV5un2Rm 8U0wveVYR+cTZC0vY5EUTKKRQcmZPMuz25fP7UzI5BmNClBuMr6W3Ar0Wdujo8tOn/3g DU/6IPUpy8t5nHeEaZZryNfx3RrNAr2lRaVxXL+RFlGPUt+O2OtnSbzOKD3ut5IEy8fH rWKh1wk6SAZ2Z6bZrajxREl2nB6F9+dVCXAQucys9uTpNZR+1Ij7E+PGPYtiDBDhpuO3 yACXIPRqN4TAInFEl//PPHEfkFh7b//awnHeEyp5lZ/TqpZKUZUl0ZADkoL4v2BeSn6y BEUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hVtG3jfvyM1oZP/Xy4MFLTrfC1YYQBXb+Q3XAZEC7NM=; b=ite/SSmPJQUJ3MecHCKOrrykw6XAMFlgXeU2yxUgc4feP5rkDb91BRUMjZRbAlWQ8e ziu88G09N21S/68XCDLMHayQCewZ2n3yADcMZ7uUIj4jKhw2aaqGQSk5juGNscyiwWQI 00YwSNR/fITfjgLAHs+6wMT89VknY6ZVc05olNahfegjtcjM2Pl2Rs3hugnedfutmhL6 OU1rltDKQ/iTSTprg9o2ylZ+oV+enDFDTy6VWpqcmGTiIlJ28hAUytKtWIO4UR3gl8ur MvBYnOr/BT7YyWGFHQolw4s6k5Sh2ZHQWPNjr7/b2rauQ3bwD1y9vXGDsMvhAx43HVFL H5hg== X-Gm-Message-State: APf1xPAU3n6KZf2h5Fjaqksl/gHH/7j362qhcbmRNksRRd9uCE6FeBku pw3ZoC8pXQ5Zm5WqWlM5W04= X-Received: by 10.223.139.131 with SMTP id o3mr3434449wra.279.1517952035481; Tue, 06 Feb 2018 13:20:35 -0800 (PST) Received: from localhost ([176.74.128.122]) by smtp.gmail.com with ESMTPSA id 56sm6842056wrt.23.2018.02.06.13.20.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Feb 2018 13:20:34 -0800 (PST) From: Artem Savkov To: Corentin Labbe Cc: Herbert Xu , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Artem Savkov Subject: [PATCH 2/2] sun4i_ss_prng: convert lock to _bh in sun4i_ss_prng_generate Date: Tue, 6 Feb 2018 22:20:22 +0100 Message-Id: <20180206212022.1309-3-artem.savkov@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180206212022.1309-1-artem.savkov@gmail.com> References: <20180206212022.1309-1-artem.savkov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Lockdep detects a possible deadlock in sun4i_ss_prng_generate() and throws an "inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage" warning. Disabling softirqs to fix this. Fixes: b8ae5c7387ad ("crypto: sun4i-ss - support the Security System PRNG") Signed-off-by: Artem Savkov --- drivers/crypto/sunxi-ss/sun4i-ss-prng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-prng.c b/drivers/crypto/sunxi-ss/sun4i-ss-prng.c index 5754e0b92fb0..63d636424161 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-prng.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-prng.c @@ -28,7 +28,7 @@ int sun4i_ss_prng_generate(struct crypto_rng *tfm, const u8 *src, algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng); ss = algt->ss; - spin_lock(&ss->slock); + spin_lock_bh(&ss->slock); writel(mode, ss->base + SS_CTL); @@ -51,6 +51,6 @@ int sun4i_ss_prng_generate(struct crypto_rng *tfm, const u8 *src, } writel(0, ss->base + SS_CTL); - spin_unlock(&ss->slock); + spin_unlock_bh(&ss->slock); return 0; } -- 2.15.1