Re: [PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-21 Thread Stephen Boyd
Quoting Timur Tabi (2018-06-21 08:17:55) > @@ -96,11 +110,39 @@ static int msm_rng_read(struct hwrng *hwrng, void *data, > size_t max, bool wait) > > /* read random data from hardware */ > do { > - val = readl_relaxed(rng->base + PRNG_STATUS); > - if

Re: [PATCH 2/2] hwrng: msm: add ACPI support

2018-06-21 Thread Vinod
On 21-06-18, 23:46, Timur Tabi wrote: > On 6/21/18 11:44 PM, Vinod wrote: > > So this make me think you should do 2 level support for ACPI, one ACPI > > support and one V2 support where we dont touch CONFIG register. That way > > both regions will work > > The ACPI system is a v2 system. If you

Re: [PATCH 2/2] hwrng: msm: add ACPI support

2018-06-21 Thread Timur Tabi
On 6/21/18 11:44 PM, Vinod wrote: So this make me think you should do 2 level support for ACPI, one ACPI support and one V2 support where we dont touch CONFIG register. That way both regions will work The ACPI system is a v2 system. If you want, I can just remove the read of the CONFIG

Re: [PATCH 2/2] hwrng: msm: add ACPI support

2018-06-21 Thread Vinod
On 21-06-18, 23:26, Timur Tabi wrote: > On 6/21/18 11:23 PM, Vinod wrote: > > On 21-06-18, 10:17, Timur Tabi wrote: > > > Add support for probing on ACPI systems, with ACPI HID QCOM8160. > > > > > > On ACPI systems, clocks are always enabled, the PRNG should > > > already be enabled, and the

Re: [PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-21 Thread Timur Tabi
On 6/21/18 11:24 PM, Vinod wrote: On 21-06-18, 23:18, Timur Tabi wrote: On 6/21/18 11:17 PM, Vinod wrote: this should be a separate patch What exactly should be a separate patch? This part? - rng->hwrng.name = KBUILD_MODNAME, - rng->hwrng.init = msm_rng_init, -

Re: [PATCH 2/2] hwrng: msm: add ACPI support

2018-06-21 Thread Timur Tabi
On 6/21/18 11:23 PM, Vinod wrote: On 21-06-18, 10:17, Timur Tabi wrote: Add support for probing on ACPI systems, with ACPI HID QCOM8160. On ACPI systems, clocks are always enabled, the PRNG should already be enabled, and the register region is read-only. The driver only verifies that the

Re: [PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-21 Thread Vinod
On 21-06-18, 23:18, Timur Tabi wrote: > On 6/21/18 11:17 PM, Vinod wrote: > > this should be a separate patch > > What exactly should be a separate patch? This part? > > - rng->hwrng.name = KBUILD_MODNAME, > - rng->hwrng.init = msm_rng_init, > - rng->hwrng.cleanup = msm_rng_cleanup,

Re: [PATCH 2/2] hwrng: msm: add ACPI support

2018-06-21 Thread Vinod
On 21-06-18, 10:17, Timur Tabi wrote: > Add support for probing on ACPI systems, with ACPI HID QCOM8160. > > On ACPI systems, clocks are always enabled, the PRNG should > already be enabled, and the register region is read-only. > The driver only verifies that the hardware is already > enabled

Re: [PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-21 Thread Timur Tabi
On 6/21/18 11:17 PM, Vinod wrote: this should be a separate patch What exactly should be a separate patch? This part? - rng->hwrng.name = KBUILD_MODNAME, - rng->hwrng.init = msm_rng_init, - rng->hwrng.cleanup = msm_rng_cleanup, - rng->hwrng.read = msm_rng_read, +

Re: [PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-21 Thread Vinod
On 21-06-18, 10:17, Timur Tabi wrote: > The hwrng.read callback includes a boolean parameter called 'wait' > which indicates whether the function should block and wait for > more data. > > When 'wait' is true, the driver spins on the DATA_AVAIL bit or until > a reasonable timeout. The timeout

[PATCH 2/2] hwrng: msm: add ACPI support

2018-06-21 Thread Timur Tabi
Add support for probing on ACPI systems, with ACPI HID QCOM8160. On ACPI systems, clocks are always enabled, the PRNG should already be enabled, and the register region is read-only. The driver only verifies that the hardware is already enabled never tries to disable or configure it.

[PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-21 Thread Timur Tabi
The hwrng.read callback includes a boolean parameter called 'wait' which indicates whether the function should block and wait for more data. When 'wait' is true, the driver spins on the DATA_AVAIL bit or until a reasonable timeout. The timeout can occur if there is a heavy load on reading the