[PATCHv3 2/2] hwrng: optee: fix wait use case

2020-08-06 Thread Jorge Ramirez-Ortiz
first read. Worth noticing that since msleep(0) schedules a one jiffy timeout is better to skip such a call. Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Sumit Garg --- drivers/char/hw_random/optee-rng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char

[PATCHv3 1/2] hwrng: optee: handle unlimited data rates

2020-08-06 Thread Jorge Ramirez-Ortiz
Data rates of MAX_UINT32 will schedule an unnecessary one jiffy timeout on the call to msleep. Avoid this scenario by using 0 as the unlimited data rate. Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Sumit Garg --- drivers/char/hw_random/optee-rng.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCHv3 2/2] hwrng: optee: fix wait use case

2020-08-06 Thread Jorge Ramirez-Ortiz
first read. Worth noticing that since msleep(0) schedules a one jiffy timeout is better to skip such a call. Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Sumit Garg --- drivers/char/hw_random/optee-rng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char

Re: [PATCHv2 2/2] hwrng: optee: fix wait use case

2020-08-06 Thread Jorge Ramirez-Ortiz, Foundries
On 06/08/20, Sumit Garg wrote: > On Thu, 6 Aug 2020 at 12:00, Jorge Ramirez-Ortiz, Foundries > wrote: > > > > On 06/08/20, Sumit Garg wrote: > > > On Thu, 6 Aug 2020 at 02:08, Jorge Ramirez-Ortiz, Foundries > > > wrote: > > > > > > > &g

Re: [PATCHv2 2/2] hwrng: optee: fix wait use case

2020-08-05 Thread Jorge Ramirez-Ortiz, Foundries
On 06/08/20, Sumit Garg wrote: > On Thu, 6 Aug 2020 at 02:08, Jorge Ramirez-Ortiz, Foundries > wrote: > > > > On 05/08/20, Sumit Garg wrote: > > > Apologies for my delayed response as I was busy with some other tasks > > > along with holidays. > >

Re: [PATCHv2 2/2] hwrng: optee: fix wait use case

2020-08-05 Thread Jorge Ramirez-Ortiz, Foundries
On 05/08/20, Sumit Garg wrote: > Apologies for my delayed response as I was busy with some other tasks > along with holidays. no pb! was just making sure this wasnt falling through some cracks. > > On Fri, 24 Jul 2020 at 19:53, Jorge Ramirez-Ortiz, Foundries > wrote: > > &

Re: [PATCHv2 2/2] hwrng: optee: fix wait use case

2020-08-05 Thread Jorge Ramirez-Ortiz, Foundries
On 23/07/20, Jorge Ramirez-Ortiz wrote: > The current code waits for data to be available before attempting a > second read. However the second read would not be executed as the > while loop exits. > > This fix does not wait if all data has been read and reads a second > time if

Re: [PATCHv2 2/2] hwrng: optee: fix wait use case

2020-07-28 Thread Jorge Ramirez-Ortiz, Foundries
On 24/07/20, Jorge Ramirez-Ortiz, Foundries wrote: > On 24/07/20, Sumit Garg wrote: > > On Thu, 23 Jul 2020 at 14:16, Jorge Ramirez-Ortiz > > wrote: > > > > > > The current code waits for data to be available before attempting a > > > second read. Howeve

Re: [PATCHv2 2/2] hwrng: optee: fix wait use case

2020-07-24 Thread Jorge Ramirez-Ortiz, Foundries
On 24/07/20, Sumit Garg wrote: > On Thu, 23 Jul 2020 at 14:16, Jorge Ramirez-Ortiz wrote: > > > > The current code waits for data to be available before attempting a > > second read. However the second read would not be executed as the > > while loop exits. > >

[PATCHv2 2/2] hwrng: optee: fix wait use case

2020-07-23 Thread Jorge Ramirez-Ortiz
does not attempt to read if not data is requested. Signed-off-by: Jorge Ramirez-Ortiz --- v2: tidy up the while loop to avoid reading when no data is requested drivers/char/hw_random/optee-rng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/hw_random/optee

[PATCHv2 1/2] hwrng: optee: handle unlimited data rates

2020-07-23 Thread Jorge Ramirez-Ortiz
Data rates of MAX_UINT32 will schedule an unnecessary one jiffy timeout on the call to msleep. Avoid this scenario by using 0 as the unlimited data rate. Signed-off-by: Jorge Ramirez-Ortiz --- drivers/char/hw_random/optee-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH 1/2] hwrng: optee: handle unlimited data rates

2020-07-23 Thread Jorge Ramirez-Ortiz
Data rates of MAX_UINT32 will schedule an unnecessary one jiffy timeout on the call to msleep. Avoid this scenario by using 0 as the unlimited data rate. Signed-off-by: Jorge Ramirez-Ortiz --- drivers/char/hw_random/optee-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH 2/2] hwrng: optee: fix wait use case

2020-07-23 Thread Jorge Ramirez-Ortiz
: Jorge Ramirez-Ortiz --- drivers/char/hw_random/optee-rng.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c index 5bc4700c4dae..967d58bb9fda 100644 --- a/drivers/char/hw_random/optee-rng.c +++ b/drivers