Re: [PATCH] hwrng: Pass entropy to add_hwgenerator_randomness() in bits, not bytes

2014-08-05 Thread Theodore Ts'o
On Mon, Jul 28, 2014 at 11:49:29AM +0200, Torsten Duwe wrote:
> On Fri, Jul 25, 2014 at 03:19:18PM -0700, Stephen Boyd wrote:
> > rng_get_data() returns the number of bytes read from the hardware.
> > The entropy argument to add_hwgenerator_randomness() is passed
> > directly to credit_entropy_bits() so we should be passing the
> > number of bits, not bytes here.
> 
> Absolutely correct.
> 
> Acked-by: Torsten Duwe 

Applied, thanks.

- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] hwrng: Pass entropy to add_hwgenerator_randomness() in bits, not bytes

2014-08-05 Thread Theodore Ts'o
On Mon, Jul 28, 2014 at 11:49:29AM +0200, Torsten Duwe wrote:
 On Fri, Jul 25, 2014 at 03:19:18PM -0700, Stephen Boyd wrote:
  rng_get_data() returns the number of bytes read from the hardware.
  The entropy argument to add_hwgenerator_randomness() is passed
  directly to credit_entropy_bits() so we should be passing the
  number of bits, not bytes here.
 
 Absolutely correct.
 
 Acked-by: Torsten Duwe d...@suse.de

Applied, thanks.

- Ted
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] hwrng: Pass entropy to add_hwgenerator_randomness() in bits, not bytes

2014-07-28 Thread Torsten Duwe
On Fri, Jul 25, 2014 at 03:19:18PM -0700, Stephen Boyd wrote:
> rng_get_data() returns the number of bytes read from the hardware.
> The entropy argument to add_hwgenerator_randomness() is passed
> directly to credit_entropy_bits() so we should be passing the
> number of bits, not bytes here.

Absolutely correct.

Acked-by: Torsten Duwe 

> Fixes: be4000bc464 "hwrng: create filler thread"
> Cc: Torsten Duwe 
> Signed-off-by: Stephen Boyd 
> ---
>  drivers/char/hw_random/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
> index dc80cdab733d..6e02ec103cc7 100644
> --- a/drivers/char/hw_random/core.c
> +++ b/drivers/char/hw_random/core.c
> @@ -362,7 +362,7 @@ static int hwrng_fillfn(void *unused)
>   continue;
>   }
>   add_hwgenerator_randomness((void *)rng_fillbuf, rc,
> -(rc*current_quality)>>10);
> +rc * current_quality * 8 >> 10);
>   }
>   hwrng_fill = NULL;
>   return 0;
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] hwrng: Pass entropy to add_hwgenerator_randomness() in bits, not bytes

2014-07-28 Thread Torsten Duwe
On Fri, Jul 25, 2014 at 03:19:18PM -0700, Stephen Boyd wrote:
 rng_get_data() returns the number of bytes read from the hardware.
 The entropy argument to add_hwgenerator_randomness() is passed
 directly to credit_entropy_bits() so we should be passing the
 number of bits, not bytes here.

Absolutely correct.

Acked-by: Torsten Duwe d...@suse.de

 Fixes: be4000bc464 hwrng: create filler thread
 Cc: Torsten Duwe d...@suse.de
 Signed-off-by: Stephen Boyd sb...@codeaurora.org
 ---
  drivers/char/hw_random/core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
 index dc80cdab733d..6e02ec103cc7 100644
 --- a/drivers/char/hw_random/core.c
 +++ b/drivers/char/hw_random/core.c
 @@ -362,7 +362,7 @@ static int hwrng_fillfn(void *unused)
   continue;
   }
   add_hwgenerator_randomness((void *)rng_fillbuf, rc,
 -(rc*current_quality)10);
 +rc * current_quality * 8  10);
   }
   hwrng_fill = NULL;
   return 0;
 -- 
 The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
 hosted by The Linux Foundation
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] hwrng: Pass entropy to add_hwgenerator_randomness() in bits, not bytes

2014-07-25 Thread Stephen Boyd
rng_get_data() returns the number of bytes read from the hardware.
The entropy argument to add_hwgenerator_randomness() is passed
directly to credit_entropy_bits() so we should be passing the
number of bits, not bytes here.

Fixes: be4000bc464 "hwrng: create filler thread"
Cc: Torsten Duwe 
Signed-off-by: Stephen Boyd 
---
 drivers/char/hw_random/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index dc80cdab733d..6e02ec103cc7 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -362,7 +362,7 @@ static int hwrng_fillfn(void *unused)
continue;
}
add_hwgenerator_randomness((void *)rng_fillbuf, rc,
-  (rc*current_quality)>>10);
+  rc * current_quality * 8 >> 10);
}
hwrng_fill = NULL;
return 0;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] hwrng: Pass entropy to add_hwgenerator_randomness() in bits, not bytes

2014-07-25 Thread Stephen Boyd
rng_get_data() returns the number of bytes read from the hardware.
The entropy argument to add_hwgenerator_randomness() is passed
directly to credit_entropy_bits() so we should be passing the
number of bits, not bytes here.

Fixes: be4000bc464 hwrng: create filler thread
Cc: Torsten Duwe d...@suse.de
Signed-off-by: Stephen Boyd sb...@codeaurora.org
---
 drivers/char/hw_random/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index dc80cdab733d..6e02ec103cc7 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -362,7 +362,7 @@ static int hwrng_fillfn(void *unused)
continue;
}
add_hwgenerator_randomness((void *)rng_fillbuf, rc,
-  (rc*current_quality)10);
+  rc * current_quality * 8  10);
}
hwrng_fill = NULL;
return 0;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/