From patchwork Wed Oct 7 12:23:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 54581 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 1902C22FF8 for ; Wed, 7 Oct 2015 12:25:47 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf7343006wic.1 for ; Wed, 07 Oct 2015 05:25:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=tnwq0OgdGuxVZHBVB1T52QqJgj3/on9h9xwB4wGZp7w=; b=gGecJK7n/k2ZD2tKTTKZoKIEImPDDSTic2LLUJ9erbevnvMJFbZWdXnTW/QxbBU/9+ xdgjpDV30u2FsER3I4VQwFTXzz4nnqXBOMYoIsZ7e6QGVeZm8NXSQfe0YXAPabaLoXex 4XOHerzI36E6sVAldYyL49usinUbd+VN+pB0QiFijhwLYI8pBN61tDVFJS6vQLkvXo4n pwV5T8PZOX9BkvJbAmV96OlTrgG3IkO2Iulm0XKktJgs6FWvXD49dORHvtwo+gDdad88 T5Dzw4Ox6WRViaR2cZC645Wwx0gNYmFIi6KPikTdMcbhMKh8rILnKAwShee7oVECC2zQ BA0A== X-Gm-Message-State: ALoCoQnjMem3xrlXAAT81iuXYLTOM223dMoLl5QZHf1w8EuVyhRBQ6P+WOuhM0Q7ev4fmV+qlKBb X-Received: by 10.112.142.195 with SMTP id ry3mr174901lbb.22.1444220746337; Wed, 07 Oct 2015 05:25:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.24.158 with SMTP id 30ls60633lfy.3.gmail; Wed, 07 Oct 2015 05:25:46 -0700 (PDT) X-Received: by 10.112.158.38 with SMTP id wr6mr430733lbb.25.1444220746160; Wed, 07 Oct 2015 05:25:46 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id k81si24950020lfi.90.2015.10.07.05.25.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Oct 2015 05:25:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbwt4 with SMTP id wt4so8920299lbb.1 for ; Wed, 07 Oct 2015 05:25:46 -0700 (PDT) X-Received: by 10.112.202.35 with SMTP id kf3mr425817lbc.19.1444220746033; Wed, 07 Oct 2015 05:25:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2417257lbq; Wed, 7 Oct 2015 05:25:45 -0700 (PDT) X-Received: by 10.50.61.137 with SMTP id p9mr1429344igr.37.1444220745113; Wed, 07 Oct 2015 05:25:45 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si2231218igt.39.2015.10.07.05.25.44; Wed, 07 Oct 2015 05:25:45 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753967AbbJGMZj (ORCPT + 30 others); Wed, 7 Oct 2015 08:25:39 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:32948 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753082AbbJGMZh (ORCPT ); Wed, 7 Oct 2015 08:25:37 -0400 Received: by wiclk2 with SMTP id lk2so210701259wic.0 for ; Wed, 07 Oct 2015 05:25:35 -0700 (PDT) X-Received: by 10.194.174.227 with SMTP id bv3mr952954wjc.142.1444220735401; Wed, 07 Oct 2015 05:25:35 -0700 (PDT) Received: from localhost.localdomain (host81-129-171-83.range81-129.btcentralplus.com. [81.129.171.83]) by smtp.gmail.com with ESMTPSA id jq10sm38925455wjc.40.2015.10.07.05.25.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Oct 2015 05:25:34 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, pankaj.dev@st.com, daniel.thompson@linaro.org, linux@arm.linux.org.uk, Lee Jones Subject: [PATCH v2 3/3] hwrng: st: Improve FIFO size/depth description Date: Wed, 7 Oct 2015 13:23:29 +0100 Message-Id: <1444220609-31251-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444220609-31251-1-git-send-email-lee.jones@linaro.org> References: <1444220609-31251-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The original representation of FIFO size in the driver coupled with the ambiguity in the documentation meant that it was easy to confuse readers. This lead to a false positive BUG-find and subsequently time wastage debugging this phantom issue. Hopefully this patch can prevent future readers from falling into the same trap. Signed-off-by: Lee Jones --- drivers/char/hw_random/st-rng.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/hw_random/st-rng.c b/drivers/char/hw_random/st-rng.c index 17f0a09..1d35363 100644 --- a/drivers/char/hw_random/st-rng.c +++ b/drivers/char/hw_random/st-rng.c @@ -29,8 +29,9 @@ #define ST_RNG_STATUS_BAD_ALTERNANCE BIT(1) #define ST_RNG_STATUS_FIFO_FULL BIT(5) -#define ST_RNG_FIFO_SIZE 8 #define ST_RNG_SAMPLE_SIZE 2 /* 2 Byte (16bit) samples */ +#define ST_RNG_FIFO_DEPTH 4 +#define ST_RNG_FIFO_SIZE (ST_RNG_FIFO_DEPTH * ST_RNG_SAMPLE_SIZE) /* * Samples are documented to be available every 0.667us, so in theory