Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2292203pxu; Fri, 18 Dec 2020 09:40:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyO0KF2HJkyrdUpTJxAuHKFzQKs3O4zs+iUNqFajh69PnyS0g8dDngE4IZ32JVZwoTBLpid X-Received: by 2002:a17:906:c289:: with SMTP id r9mr4973599ejz.311.1608313229243; Fri, 18 Dec 2020 09:40:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608313229; cv=none; d=google.com; s=arc-20160816; b=KgIo6W2OLS+EwDgjVrDnhhTDPaYvlie1ru9VR1TNp1o6xmdAdX3Q06fd6SQXYmAZwB viwYTW8iOgfefXsxzDcI2Xq6VeUxS3PPq+U6WUtfaAS5zatWmaCsQzYA00OyaqTSz7Ht iwDrCf+qqO88yw8nR+f3mtqjLF8cTiYj+dQCvqHXAxUMZocIfKumX7p8waRzmYswgLEm NBEfweuhae1ITc+Juq/07xR4RN8g3TGq6J6MfMK6PUd+KrBkgfBBBPKyoYUStFgZ5JXH EXt7lC/2hXfBAVyeqrJSUoP7pfm9xtsJ++2roYeUmEgTkTVCRNd0+FMyUb6Zfn3noESb ncCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-filter; bh=Lp6Xd3kegSw7+c7X93TTTVKIJ3OvG866Ny4QilEH+gs=; b=iNxBfDyP7/MbbzAEli6NRGxb/raJD3p1DgP7PuEkGcfKudD0g7S5PHW3ntnimUgYyR mXkZg/mpG2g+PXIYrIGD1Tb8CaAU10/UKzA3c00JX1TgRlXngBeKPIujCNRqZ2v0MxNQ fpiPIhdZ9loP2XHOYM54zXS5ML8IMgHJkD0pN6CE8SIus6XafbufPi70VMdRetYszO/4 QonwVE1pQcQ8XGscyfuv4wC6vOnLCuU6gNCj2LiQ8mAqJMLV4DUWhN/NLsSxajSzNqC6 C6J8zxPoknIuh0UtkUifSDXOzqdhBIWbH3kTHZQYblVTCf58WSBrW+PjGOlUOWQYev+P 2OpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b="kSV+/mkS"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si8091446edv.597.2020.12.18.09.40.10; Fri, 18 Dec 2020 09:40:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b="kSV+/mkS"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728019AbgLRRi7 (ORCPT + 99 others); Fri, 18 Dec 2020 12:38:59 -0500 Received: from relay.smtp-ext.broadcom.com ([192.19.232.172]:42726 "EHLO relay.smtp-ext.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728013AbgLRRi7 (ORCPT ); Fri, 18 Dec 2020 12:38:59 -0500 X-Greylist: delayed 415 seconds by postgrey-1.27 at vger.kernel.org; Fri, 18 Dec 2020 12:38:58 EST Received: from [10.136.13.65] (lbrmn-lnxub113.ric.broadcom.net [10.136.13.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by relay.smtp-ext.broadcom.com (Postfix) with ESMTPS id AD18380E2; Fri, 18 Dec 2020 09:31:00 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com AD18380E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1608312662; bh=ASc3+eHClKI6umumcLf09VzAeUQYT7bLZu87KGeByM4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=kSV+/mkSOaWepR6vm/S+hVi0wHDKslY0xrBaLOW/MbqmnfjYeo3sNNAB7vSn/5p9J MMMIq0VqulmPS7TiwifhjfFcz8jrikCRE1bVDXqFM9H/TjE+pnOKWPUWHQJGS8mX9m nhLq1CIJI4oO4N+uZt7DzzB9muCi5F4pDGTFsNMo= Subject: Re: [PATCH v2 1/2] hwrng: iproc-rng200: Fix disable of the block. To: matthias.bgg@kernel.org, mpm@selenic.com, herbert@gondor.apana.org.au, rjui@broadcom.com, sbranden@broadcom.com, f.fainelli@gmail.com Cc: linux-kernel@vger.kernel.org, Julia.Lawall@inria.fr, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, nsaenzjulienne@suse.de, linux-crypto@vger.kernel.org, Matthias Brugger References: <20201218105708.28480-1-matthias.bgg@kernel.org> From: Scott Branden Message-ID: Date: Fri, 18 Dec 2020 09:30:59 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201218105708.28480-1-matthias.bgg@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-CA Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2020-12-18 2:57 a.m., matthias.bgg@kernel.org wrote: > From: Matthias Brugger > > When trying to disable the block we bitwise or the control > register with value zero. This is confusing as using bitwise or with > value zero doesn't have any effect at all. Drop this as we already set > the enable bit to zero by appling inverted RNG_RBGEN_MASK. > > Signed-off-by: Matthias Brugger Acked-by: Scott Branden > > --- > > Changes in v2: > - fix commit message, dropping Fixes tag > - drop inverted RNT_RBGEN_ENABLE in disable case > > drivers/char/hw_random/iproc-rng200.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/char/hw_random/iproc-rng200.c b/drivers/char/hw_random/iproc-rng200.c > index 01583faf9893..70cd818a0f31 100644 > --- a/drivers/char/hw_random/iproc-rng200.c > +++ b/drivers/char/hw_random/iproc-rng200.c > @@ -28,7 +28,6 @@ > #define RNG_CTRL_OFFSET 0x00 > #define RNG_CTRL_RNG_RBGEN_MASK 0x00001FFF > #define RNG_CTRL_RNG_RBGEN_ENABLE 0x00000001 > -#define RNG_CTRL_RNG_RBGEN_DISABLE 0x00000000 > > #define RNG_SOFT_RESET_OFFSET 0x04 > #define RNG_SOFT_RESET 0x00000001 > @@ -61,7 +60,6 @@ static void iproc_rng200_restart(void __iomem *rng_base) > /* Disable RBG */ > val = ioread32(rng_base + RNG_CTRL_OFFSET); > val &= ~RNG_CTRL_RNG_RBGEN_MASK; > - val |= RNG_CTRL_RNG_RBGEN_DISABLE; > iowrite32(val, rng_base + RNG_CTRL_OFFSET); > > /* Clear all interrupt status */ > @@ -174,7 +172,6 @@ static void iproc_rng200_cleanup(struct hwrng *rng) > /* Disable RNG hardware */ > val = ioread32(priv->base + RNG_CTRL_OFFSET); > val &= ~RNG_CTRL_RNG_RBGEN_MASK; > - val |= RNG_CTRL_RNG_RBGEN_DISABLE; > iowrite32(val, priv->base + RNG_CTRL_OFFSET); > } >