Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread Dmitry Torokhov
On Tue, Oct 24, 2017 at 11:37:57AM -0600, Jason Gunthorpe wrote: > On Tue, Oct 24, 2017 at 10:02:00AM -0700, Dmitry Torokhov wrote: > > tpm-rng is abomination that should be kicked out as soon as possible. > > It wrecks havoc with the power management (TPM chip drivers may go &

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread Dmitry Torokhov
On Tue, Oct 24, 2017 at 9:11 AM, Jason Gunthorpe wrote: > On Tue, Oct 24, 2017 at 09:37:33PM +0530, PrasannaKumar Muralidharan wrote: >> Hi Jason, >> >> On 24 October 2017 at 21:25, Jason Gunthorpe >> wrote: >> > On Tue, Oct 24,

Re: [PATCH v5 REPOST 1/6] hw_random: place mutex around read functions and buffers.

2017-09-26 Thread Dmitry Torokhov
On Tue, Sep 26, 2017 at 02:36:57AM -0400, Pankaj Gupta wrote: > > > > > A bit late to a party, but: > > > > On Mon, Dec 8, 2014 at 12:50 AM, Amos Kong wrote: > > > From: Rusty Russell > > > > > > There's currently a big lock around everything, and it

Re: [PATCH v5 REPOST 1/6] hw_random: place mutex around read functions and buffers.

2017-09-25 Thread Dmitry Torokhov
A bit late to a party, but: On Mon, Dec 8, 2014 at 12:50 AM, Amos Kong wrote: > From: Rusty Russell > > There's currently a big lock around everything, and it means that we > can't query sysfs (eg /sys/devices/virtual/misc/hw_random/rng_current) > while

[PATCH 3/6] hwrng: exynos - make use of devm_hwrng_register

2015-03-12 Thread Dmitry Torokhov
This allows us to get rid of remove() method. Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/char/hw_random/exynos-rng.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos

[PATCH 5/6] hwrng: iproc-rng200 - do not use static structure

2015-03-12 Thread Dmitry Torokhov
Instead of using static hwrng structure that is reused between binds/unbinds of the device let's embed it into driver's private structure that we allocate. This way we are guaranteed not to stumble onto something left from previous bind attempt. Signed-off-by: Dmitry Torokhov dmitry.torok

[PATCH 2/6] hwrng: bcm63xx - make use of devm_hwrng_register

2015-03-12 Thread Dmitry Torokhov
() and move clock enabling/disabling into hwrnd inti(0 and cleanup() methods so the clock stays off until rng is used. Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/char/hw_random/bcm63xx-rng.c | 87 +--- 1 file changed, 31 insertions(+), 56 deletions

[PATCH 6/6] hwrng: iproc-rng200 - make use of devm_hwrng_register

2015-03-12 Thread Dmitry Torokhov
This allows us to get rid of driver's remove() method. Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/char/hw_random/iproc-rng200.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/char/hw_random/iproc-rng200.c b/drivers/char

[PATCH 4/6] hwrng: msm - make use of devm_hwrng_register

2015-03-12 Thread Dmitry Torokhov
This allows us to get rid of remove() method. Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/char/hw_random/msm-rng.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/char/hw_random/msm-rng.c b/drivers/char/hw_random/msm-rng.c index

[PATCH 1/6] hwrng: add devm_* interfaces

2015-03-12 Thread Dmitry Torokhov
This change adds devm_hwrng_register and devm_hwrng_unregister which use can simplify error unwinding and unbinding code paths in device drivers. Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/char/hw_random/core.c | 42 ++ include

[PATCH 0/6] Introduce devm_hwrng_register and convert a few dirvers

2015-03-12 Thread Dmitry Torokhov
A few drivers can benefit from devm-style interface for hwrng since it is quite often the last thing that isn't automatically managed. Using devm_hwrng_register() in such drivers allows get rid of manual error unwinding and drivers' remove() methods. I tested changes to iproc-rng200, the rest are

Re: [PATCH 2/4] hwrng: omap - remove #ifdefery around PM methods

2015-03-11 Thread Dmitry Torokhov
Hi Herbert, On Wed, Mar 11, 2015 at 09:59:57PM +1100, Herbert Xu wrote: On Mon, Mar 09, 2015 at 10:36:36AM -0700, Dmitry Torokhov wrote: Instead of using #ifdefs let's mark suspend and resume methods as __maybe_unused which will suppress compiler warnings about them being unused

[RESEND PATCH] hwrng: omap - remove #ifdefery around PM methods

2015-03-11 Thread Dmitry Torokhov
omap_rng_suspend nor omap_rng_resume will end up being referenced and the change will not result in increasing image size. Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/char/hw_random/omap-rng.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers

Re: [PATCH 2/4] hwrng: omap - remove #ifdefery around PM methods

2015-03-11 Thread Dmitry Torokhov
On Thu, Mar 12, 2015 at 08:00:35AM +1100, Herbert Xu wrote: On Wed, Mar 11, 2015 at 08:44:07AM -0700, Dmitry Torokhov wrote: SIMPLE_DEV_PM_OPS() produces an empty omap_rng_pm structure in case of !CONFIG_PM_SLEEP so neither omap_rng_suspend nor omap_rng_resume will end up being

[PATCH 1/4] hwrng: omap - remove incorrect __exit markups

2015-03-09 Thread Dmitry Torokhov
-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/char/hw_random/omap-rng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index d14dcf7..7f3597d 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b

[PATCH 2/4] hwrng: omap - remove #ifdefery around PM methods

2015-03-09 Thread Dmitry Torokhov
Instead of using #ifdefs let's mark suspend and resume methods as __maybe_unused which will suppress compiler warnings about them being unused and provide better compile coverage. This will not increase image size. Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/char

[PATCH 3/4] hwrng: octeon - remove incorrect __exit markups

2015-03-09 Thread Dmitry Torokhov
-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/char/hw_random/octeon-rng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/hw_random/octeon-rng.c b/drivers/char/hw_random/octeon-rng.c index be1c3f6..6234a4a 100644 --- a/drivers/char/hw_random/octeon-rng.c

[PATCH 4/4] hwrng: pseries-rng - remove incorrect __init/__exit markups

2015-03-09 Thread Dmitry Torokhov
() methods should not be marked __init unless platform_driver_probe() is used. Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/char/hw_random/pseries-rng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/hw_random/pseries-rng.c b/drivers

[PATCH] crypto: qat - remove incorrect __exit markup

2015-03-09 Thread Dmitry Torokhov
PCI bus is hot-pluggable, and even if it wasn't one can still unbind the device from driver via sysfs, so we should not make driver's remove method as __exit. Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/crypto/qat/qat_dh895xcc/adf_drv.c | 2 +- 1 file changed, 1

[PATCH] crypto: amcc: remove incorrect __init/__exit markups

2015-03-09 Thread Dmitry Torokhov
attributes. Signed-off-by: Dmitry Torokhov dmitry.torok...@gmail.com --- drivers/crypto/amcc/crypto4xx_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index d02b771..3b28e8c 100644