From patchwork Tue Feb 6 21:20:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Savkov X-Patchwork-Id: 10204145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C623D60247 for ; Tue, 6 Feb 2018 21:21:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B731B205FD for ; Tue, 6 Feb 2018 21:21:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABA3F288A3; Tue, 6 Feb 2018 21:21:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 67B2528657 for ; Tue, 6 Feb 2018 21:21:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=M/iiCALXivm9i5H7v01OQW5lMKBwFkzwRASyLUoMz38=; b=CIuOLsF/Tkr0cONFKdhXT6RLl5 oP05UG8dAbSRdBJNfG5g+1jlTkb8ljTcajjM14o1uT5oYuD2L81sMiqPI8g0RbNpfqJvOuox0sGiB KUEgICxBOQQ3qTlSpzuStNdgZ8u8miX8xYxxaA192bs9i1I9jK4HY1oDVSRQwfI0zB2RIwG7foiKj CpNyWEViLM9unbpwhEhq4QJWhugElSyX+rMF/3nHChpOyzrOTQeRX910uTpMz8KZ7dYHqyFXT8aDs qUbNk2MtNEEQ1uo+k0cDOA3RTyP9v0SaEooLIQvUuKRnkEPlPk4p/swteUd10J8i9E5cAsw5QOYvW 9vS2bJJA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ejAfk-0005oF-Uz; Tue, 06 Feb 2018 21:21:00 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ejAfX-0005bj-Na for linux-arm-kernel@lists.infradead.org; Tue, 06 Feb 2018 21:20:49 +0000 Received: by mail-wr0-x242.google.com with SMTP id v31so3453348wrc.11 for ; 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=r75h1Hi07SfRfAq9KDkjMFM51eA48aMMmrMlmauiRNdvBL4eFqfLiSmJEOv7aMohkf dkGeceC2c7Z8o0n4Cp/RnirNcpzeSJITHkJID8DUxsRK5einoZnylCbzL7cjOCGchnjN xNBy2h9Gkdc0QGKnfFvwkFQjvL0iqK5BWtaIgXqk8ebbogcPLqqLmXovI/rlmx9hbt88 E1uZuzcoFfVbvjjmVonm7KCGoWE6E+qzImUDSEH1HYHos7gQ5yRssTM9lvqlWLWd+BTs bbShf7HhjYXivWuG7KqhhDIe64kclz0TUJBlrrvKQwXLo8yRCIIoCuzQLHuLAhlCTdUz NLow== X-Gm-Message-State: APf1xPCOqyra9rFLCQnGCXhzjNMKhVwqbdiz9yKQG1kD2X/55mUjhL9G 2dHW58PMBQRBl571dH1t4U82FQ3K X-Google-Smtp-Source: AH8x227kI1YlKOPvJ92M+/h2rwAEJBAKeEIPPt2z8d6B5L2BNbbmpFlo6KsvpRfbLuKM1+BLKF6n3Q== 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 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> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Artem Savkov , Herbert Xu , linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }