linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sbranden@broadcom.com (Scott Branden)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/2] hwrng: iproc-rng200 - Add Broadcom IPROC RNG driver
Date: Thu, 26 Feb 2015 11:37:20 -0800	[thread overview]
Message-ID: <54EF75F0.7000901@broadcom.com> (raw)
In-Reply-To: <3062825.7b1oYP4yuL@wuerfel>

Response inline.

On 15-02-25 11:17 AM, Arnd Bergmann wrote:
> On Wednesday 25 February 2015 10:16:24 Scott Branden wrote:
>> This adds a driver for random number generator present on Broadcom
>> IPROC devices.
>>
>> Reviewed-by: Ray Jui <rjui@broadcom.com>
>> Signed-off-by: Scott Branden <sbranden@broadcom.com>
>
> The driver looks reasonable overall, I have just one question about
> something that sticks out:
>
>> +	while ((num_remaining > 0) && time_before(jiffies, idle_endtime)) {
> ...
>> +
>> +		/* Are there any random numbers available? */
>> +		if ((ioread32(rng_base + RNG_FIFO_COUNT_OFFSET) &
>> +				RNG_FIFO_COUNT_RNG_FIFO_COUNT_MASK) > 0) {
> ...
>> +		} else {
>> +			if (!wait)
>> +				/* Cannot wait, return immediately */
>> +				return max - num_remaining;
>> +
>> +			/* Can wait, give others chance to run */
>> +			cpu_relax();
>> +		}
>> +	}
>> +
>
> It looks like you do a busy-loop around cpu_relax here if asked to wait.
> Is this intentional? I would normally expect either cond_resched() or
> some msleep() instead.

This code was following examples of other open source drivers - bcm2835 
and exynos both use cpu_relax.  I'll have to look into this more to 
understand.

>
> 	Arnd
>

  reply	other threads:[~2015-02-26 19:37 UTC|newest]

Thread overview: 182+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Scott Branden <sbranden@broadcom.com>
2014-10-08  5:26 ` [PATCH V3 0/6] Add initial support for Broadcom Cygnus SoC Scott Branden
2014-10-08  5:27   ` [PATCH 1/6] ARM: cygnus: Initial " Scott Branden
2014-10-08  7:54     ` Arnd Bergmann
2014-10-08 12:27       ` Scott Branden
2014-10-08 13:28         ` Arnd Bergmann
2014-10-08 16:27           ` Scott Branden
2014-10-08 18:12             ` Arnd Bergmann
2014-10-08 18:45               ` Scott Branden
2014-10-08 22:16               ` Scott Branden
2014-10-09  7:32                 ` Arnd Bergmann
2014-10-08  8:11     ` Russell King - ARM Linux
2014-10-08 11:17       ` Scott Branden
2014-10-08 11:41         ` Russell King - ARM Linux
2014-10-08 13:10     ` Rob Herring
2014-10-08 16:34       ` Scott Branden
2014-10-08  5:27   ` [PATCH 2/6] clk: Clock driver " Scott Branden
2014-10-08  5:27   ` [PATCH 3/6] dt-bindings: Document Broadcom Cygnus SoC and clock driver Scott Branden
2014-10-08  7:57     ` Arnd Bergmann
2014-10-08 10:58       ` Scott Branden
2014-10-08 13:35         ` Arnd Bergmann
2014-10-08  5:27   ` [PATCH 4/6] ARM: cygnus defconfig : Initial defconfig for Broadcom Cygnus SoC Scott Branden
2014-10-08  7:58     ` Arnd Bergmann
2014-10-08 11:01       ` Scott Branden
2014-10-08  5:27   ` [PATCH 5/6] ARM: dts: Enable " Scott Branden
2014-10-08  5:27   ` [PATCH 6/6] MAINTAINERS: Entry for Cygnus/iproc arm architecture and clock drivers Scott Branden
2014-10-09 22:44 ` [PATCH V4 0/7] Add initial support for Broadcom Cygnus SoC Scott Branden
2014-10-09 22:44   ` [PATCH V4 1/7] ARM: cygnus: Initial " Scott Branden
2014-10-10  9:50     ` Arnd Bergmann
2014-10-10 19:08       ` Scott Branden
2014-10-09 22:44   ` [PATCH V4 2/7] clk: Clock driver " Scott Branden
2014-10-09 22:44   ` [PATCH V4 3/7] dt-bindings: Document Broadcom Cygnus SoC and clock driver Scott Branden
2014-10-09 22:44   ` [PATCH V4 4/7] ARM: cygnus defconfig : Initial defconfig for Broadcom Cygnus SoC Scott Branden
2014-10-09 22:44   ` [PATCH V4 5/7] ARM: dts: Enable " Scott Branden
2014-10-10 10:08     ` Arnd Bergmann
2014-10-10 19:11       ` Scott Branden
2014-10-09 22:44   ` [PATCH V4 6/7] MAINTAINERS: Entry for Cygnus/iproc arm architecture and clock drivers Scott Branden
2014-10-09 23:00     ` Joe Perches
2014-10-09 23:18       ` Scott Branden
2014-10-09 22:44   ` [PATCH V4 7/7] ARM: multi_v7_defconfig: Enable ARCH_BCM_CYGNUS config Scott Branden
2014-10-10  9:59     ` Arnd Bergmann
2014-10-10 19:12       ` Scott Branden
2014-10-15  2:58 ` [PATCH v5 0/6] Add initial support for Broadcom Cygnus SoC Scott Branden
2014-10-15  2:58   ` [PATCH v5 1/6] ARM: cygnus: Initial " Scott Branden
2014-10-20 19:55     ` Arnd Bergmann
2014-10-20 22:59       ` Scott Branden
2014-10-21  5:48         ` Arnd Bergmann
2014-10-22  0:11           ` Scott Branden
2014-10-22  8:22             ` Arnd Bergmann
2014-10-22 17:12               ` Scott Branden
2014-10-15  2:58   ` [PATCH v5 2/6] dt-bindings: Document Broadcom Cygnus SoC and clocks Scott Branden
2014-10-15  2:58   ` [PATCH v5 3/6] ARM: cygnus defconfig : Initial defconfig for Broadcom Cygnus SoC Scott Branden
2014-10-15  2:58   ` [PATCH v5 4/6] ARM: dts: Enable " Scott Branden
2014-10-15  2:58   ` [PATCH v5 5/6] MAINTAINERS: Entry for Cygnus/iproc arm architecture Scott Branden
2014-10-15  2:58   ` [PATCH v5 6/6] ARM: mach-bcm: Consolidate currently supported IPROC SoCs Scott Branden
2014-10-22  2:09 ` [PATCH v6 0/6] Add initial support for Broadcom Cygnus SoC Scott Branden
2014-10-22  2:09   ` [PATCH v6 1/6] ARM: cygnus: Initial " Scott Branden
2014-10-22  2:09   ` [PATCH v6 2/6] dt-bindings: Document Broadcom Cygnus SoC and clocks Scott Branden
2014-10-22  2:09   ` [PATCH v6 3/6] ARM: cygnus defconfig : Initial defconfig for Broadcom Cygnus SoC Scott Branden
2014-10-22  2:09   ` [PATCH v6 4/6] ARM: dts: Enable " Scott Branden
2014-10-22  2:09   ` [PATCH v6 5/6] MAINTAINERS: Entry for Cygnus/iproc arm architecture Scott Branden
2014-10-22  2:09   ` [PATCH v6 6/6] ARM: mach-bcm: Consolidate currently supported IPROC SoCs Scott Branden
2014-10-22 20:57 ` [PATCH v7 0/7] Add initial support for Broadcom Cygnus SoC Scott Branden
2014-10-22 20:57   ` [PATCH v7 1/7] ARM: cygnus: Initial " Scott Branden
2014-10-22 20:57   ` [PATCH v7 2/7] dt-bindings: Document Broadcom Cygnus SoC and clocks Scott Branden
2014-10-22 20:57   ` [PATCH v7 3/7] ARM: cygnus defconfig : Initial defconfig for Broadcom Cygnus SoC Scott Branden
2014-10-22 20:57   ` [PATCH v7 4/7] ARM: dts: Enable " Scott Branden
2014-10-28 16:10     ` Arnd Bergmann
2014-10-28 19:41       ` Scott Branden
2014-10-22 20:57   ` [PATCH v7 5/7] MAINTAINERS: Entry for Cygnus/iproc arm architecture Scott Branden
2014-10-22 20:57   ` [PATCH v7 6/7] ARM: mach-bcm: Consolidate currently supported IPROC SoCs Scott Branden
2014-10-22 20:57   ` [PATCH v7 7/7] ARM: mach-bcm: ARCH_BCM_MOBILE: remove one level of menu from Kconfig Scott Branden
2014-10-28 19:53 ` [PATCH v8 0/8] Add initial support for Broadcom Cygnus SoC Scott Branden
2014-10-28 19:53   ` [PATCH v8 1/8] ARM: cygnus: Initial " Scott Branden
2014-10-28 19:53   ` [PATCH v8 2/8] dt-bindings: Document Broadcom Cygnus SoC and clocks Scott Branden
2014-10-28 19:53   ` [PATCH v8 3/8] ARM: cygnus defconfig : Initial defconfig for Broadcom Cygnus SoC Scott Branden
2014-10-28 19:53   ` [PATCH v8 4/8] ARM: dts: Enable " Scott Branden
2014-11-09  0:22     ` Olof Johansson
2014-11-09  6:13       ` Scott Branden
2014-11-09  6:49         ` Olof Johansson
2014-11-09 17:23           ` Greg Kroah-Hartman
2014-11-09 20:38             ` Arnd Bergmann
2014-11-10  5:17               ` Scott Branden
2014-11-10  8:11                 ` Arnd Bergmann
2014-11-10 18:28                   ` Scott Branden
2014-10-28 19:53   ` [PATCH v8 5/8] MAINTAINERS: Entry for Cygnus/iproc arm architecture Scott Branden
2014-10-28 19:53   ` [PATCH v8 6/8] ARM: mach-bcm: Consolidate currently supported IPROC SoCs Scott Branden
2014-10-28 19:53   ` [PATCH v8 7/8] ARM: mach-bcm: ARCH_BCM_MOBILE: remove one level of menu from Kconfig Scott Branden
2014-10-28 19:53   ` [PATCH v8 8/8] ARM: multi_v7_defconfig: Enable Broadcom Cygnus Scott Branden
2014-10-28 20:01     ` Arnd Bergmann
2014-10-28 20:06       ` Scott Branden
2014-10-28 20:13         ` Arnd Bergmann
2014-10-28 23:15 ` [PATCH v9 0/8] Add initial support for Broadcom Cygnus SoC Scott Branden
2014-10-28 23:15   ` [PATCH v9 1/8] ARM: cygnus: Initial " Scott Branden
2014-10-28 23:15   ` [PATCH v9 2/8] dt-bindings: Document Broadcom Cygnus SoC and clocks Scott Branden
2014-11-20  1:05     ` Mike Turquette
2014-10-28 23:15   ` [PATCH v9 3/8] ARM: cygnus defconfig : Initial defconfig for Broadcom Cygnus SoC Scott Branden
2014-10-28 23:15   ` [PATCH v9 4/8] ARM: dts: Enable " Scott Branden
2014-11-10 10:50     ` Paul Bolle
2014-11-10 18:35       ` Olof Johansson
2014-11-10 19:23         ` Paul Bolle
2014-10-28 23:15   ` [PATCH v9 5/8] MAINTAINERS: Entry for Cygnus/iproc arm architecture Scott Branden
2014-10-28 23:15   ` [PATCH v9 6/8] ARM: mach-bcm: Consolidate currently supported IPROC SoCs Scott Branden
2014-10-28 23:15   ` [PATCH v9 7/8] ARM: mach-bcm: ARCH_BCM_MOBILE: remove one level of menu from Kconfig Scott Branden
2014-10-28 23:15   ` [PATCH v9 8/8] ARM: multi_v7_defconfig: Enable Broadcom Cygnus Scott Branden
2014-11-10  5:55 ` [PATCH 1/2] ARM: multi_v7_defconfig: remove one level of menu from Kconfig Scott Branden
2014-11-10  5:55   ` [PATCH 2/2] ARM: multi_v7_defconfig: Enable Broadcom Cygnus Scott Branden
2015-02-10  0:06 ` [PATCH 0/4] Add support for IPROC SDHCI controller Scott Branden
2015-02-10  0:06   ` [PATCH 1/4] mmc: sdhci: add quirk for ACMD23 broken Scott Branden
2015-02-10  0:06   ` [PATCH 2/4] mmc: sdhci: do not set AUTO_CMD12 for multi-block CMD53 Scott Branden
2015-02-10  0:06   ` [PATCH 3/4] mmc: sdhci-iproc: add IPROC SDHCI driver Scott Branden
2015-02-10  0:06   ` [PATCH 4/4] mmc: sdhci-iproc: add device tree bindings Scott Branden
2015-03-02 23:50     ` Florian Fainelli
2015-03-04 23:14       ` Scott Branden
2015-02-26 17:28   ` [PATCH 0/4] Add support for IPROC SDHCI controller Scott Branden
2015-02-10  0:07 ` [PATCH 0/2] Add support for Broadcom RNG200 Scott Branden
2015-02-10  0:07   ` [PATCH 1/2] hwrng: iproc-rng200 - Add Broadcom IPROC RNG driver Scott Branden
2015-02-10  0:27     ` Joe Perches
2015-02-14 16:36       ` Scott Branden
2015-02-14 17:02         ` Scott Branden
2015-02-10  0:07   ` [PATCH 2/2] hwrng: iproc-rng200 - Add device tree bindings Scott Branden
2015-02-10  0:07 ` [PATCH 0/2] Add support for Broadcom keypad controller Scott Branden
2015-02-10  0:07   ` [PATCH 1/2] Input: bcm-keypad: add device tree bindings Scott Branden
2015-02-10  0:51     ` Dmitry Torokhov
2015-02-14 16:49       ` Scott Branden
2015-02-16  5:17         ` Dmitry Torokhov
2015-02-23 17:49           ` Dmitry Torokhov
2015-02-26 16:13             ` Scott Branden
2015-02-10  0:07   ` [PATCH 2/2] Input: bcm-keypad: Add Broadcom keypad controller Scott Branden
2015-02-10  1:02     ` Dmitry Torokhov
2015-02-14 17:12       ` Scott Branden
2015-02-25 18:16 ` [PATCH v2 0/2] Add support for Broadcom RNG200 Scott Branden
2015-02-25 18:16   ` [PATCH v2 1/2] hwrng: iproc-rng200 - Add device tree bindings Scott Branden
2015-03-02 23:47     ` Florian Fainelli
2015-02-25 18:16   ` [PATCH v2 2/2] hwrng: iproc-rng200 - Add Broadcom IPROC RNG driver Scott Branden
2015-02-25 18:43     ` Dmitry Torokhov
2015-03-03  0:50       ` Scott Branden
2015-02-25 19:17     ` Arnd Bergmann
2015-02-26 19:37       ` Scott Branden [this message]
2015-02-26 20:15         ` Arnd Bergmann
2015-02-26 22:26           ` Scott Branden
2015-02-27  9:14             ` Arnd Bergmann
2015-02-28 16:01               ` Scott Branden
2015-02-28 19:31                 ` Arnd Bergmann
2015-03-02 19:41                   ` Scott Branden
2015-03-02 10:23   ` [PATCH v2 0/2] Add support for Broadcom RNG200 Herbert Xu
2015-02-26 16:08 ` [PATCH v2 0/2] Add support for Broadcom keypad controller Scott Branden
2015-02-26 16:08   ` [PATCH v2 1/2] Input: bcm-keypad: add device tree bindings Scott Branden
2015-02-27 23:39     ` Dmitry Torokhov
2015-02-28 15:41       ` Scott Branden
2015-02-26 16:08   ` [PATCH v2 2/2] Input: bcm-keypad: Add Broadcom keypad controller Scott Branden
2015-02-27 23:44     ` Dmitry Torokhov
2015-02-28 15:52       ` Scott Branden
2015-02-28 14:16     ` Paul Bolle
2015-02-28 15:36       ` Scott Branden
2015-02-28 16:03 ` [PATCH v3 0/2] Add support for " Scott Branden
2015-02-28 16:03   ` [PATCH v3 1/2] Input: bcm-keypad: add device tree bindings Scott Branden
2015-02-28 16:03   ` [PATCH v3 2/2] Input: bcm-keypad: Add Broadcom keypad controller Scott Branden
2015-02-28 16:35 ` [PATCH v4 0/2] Add support for " Scott Branden
2015-02-28 16:35   ` [PATCH v4 1/2] Input: bcm-keypad: add device tree bindings Scott Branden
2015-03-03  0:04     ` Dmitry Torokhov
2015-02-28 16:35   ` [PATCH v4 2/2] Input: bcm-keypad: Add Broadcom keypad controller Scott Branden
2015-02-28 22:10     ` Dmitry Torokhov
2015-02-28 22:15       ` Dmitry Torokhov
2015-03-02 19:37         ` Scott Branden
2015-03-02 20:23           ` Dmitry Torokhov
2015-03-02 21:59             ` Scott Branden
2015-03-02 19:38         ` Scott Branden
2015-03-04 20:42 ` [PATCH v3 0/2] Add support for Broadcom RNG200 Scott Branden
2015-03-04 20:42   ` [PATCH v3 1/2] hwrng: iproc-rng200 - Add device tree bindings Scott Branden
2015-03-04 20:42   ` [PATCH v3 2/2] hwrng: iproc-rng200 - Add Broadcom IPROC RNG driver Scott Branden
2015-03-06 11:53   ` [PATCH v3 0/2] Add support for Broadcom RNG200 Herbert Xu
2015-03-05 15:59 ` [PATCH RESEND 0/4] Add support for IPROC SDHCI controller Scott Branden
2015-03-05 15:59   ` [PATCH 1/4] mmc: sdhci: add quirk for ACMD23 broken Scott Branden
2015-03-05 15:59   ` [PATCH 2/4] mmc: sdhci: do not set AUTO_CMD12 for multi-block CMD53 Scott Branden
2015-03-05 15:59   ` [PATCH 3/4] mmc: sdhci-iproc: add IPROC SDHCI driver Scott Branden
2015-03-05 15:59   ` [PATCH 4/4] mmc: sdhci-iproc: add device tree bindings Scott Branden
2015-03-05 16:16   ` [PATCH RESEND 0/4] Add support for IPROC SDHCI controller Ulf Hansson
2015-03-05 19:57     ` Florian Fainelli
2015-03-16 18:19 ` [PATCH] ARM: amba: Increase number of IRQs Scott Branden
2015-03-16 21:08   ` Russell King - ARM Linux
2015-03-16 21:18     ` Scott Branden
2015-03-16 21:16 ` [PATCH v2 1/1] " Scott Branden

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54EF75F0.7000901@broadcom.com \
    --to=sbranden@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).