Re: [PATCH] regulator: simplify locking

2020-08-10 Thread Mark Brown
On Mon, Aug 10, 2020 at 12:30:30AM +0200, Michał Mirosław wrote: > On Mon, Aug 10, 2020 at 12:40:04AM +0300, Dmitry Osipenko wrote: > > 10.08.2020 00:16, Michał Mirosław пишет: > > > - mutex_lock(_nesting_mutex); > > > + if (ww_ctx || !mutex_trylock_recursive(>mutex.base)) > > Have you seen

Re: [PATCH] regulator: simplify locking

2020-08-10 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 08:14:20AM +0300, Dmitry Osipenko wrote: > 10.08.2020 03:59, Michał Mirosław пишет: > > On Mon, Aug 10, 2020 at 03:21:47AM +0300, Dmitry Osipenko wrote: > >> 10.08.2020 01:30, Michał Mirosław пишет: > >>> On Mon, Aug 10, 2020 at 12:40:04AM +0300, Dmitry Osipenko wrote: >

Re: [PATCH] regulator: simplify locking

2020-08-09 Thread Dmitry Osipenko
10.08.2020 03:59, Michał Mirosław пишет: > On Mon, Aug 10, 2020 at 03:21:47AM +0300, Dmitry Osipenko wrote: >> 10.08.2020 01:30, Michał Mirosław пишет: >>> On Mon, Aug 10, 2020 at 12:40:04AM +0300, Dmitry Osipenko wrote: 10.08.2020 00:16, Michał Mirosław пишет: > Simplify regulator

Re: [PATCH] regulator: simplify locking

2020-08-09 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 03:21:47AM +0300, Dmitry Osipenko wrote: > 10.08.2020 01:30, Michał Mirosław пишет: > > On Mon, Aug 10, 2020 at 12:40:04AM +0300, Dmitry Osipenko wrote: > >> 10.08.2020 00:16, Michał Mirosław пишет: > >>> Simplify regulator locking by removing locking around locking.

Re: [PATCH] regulator: simplify locking

2020-08-09 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 03:21:47AM +0300, Dmitry Osipenko wrote: > 10.08.2020 01:30, Michał Mirosław пишет: > > On Mon, Aug 10, 2020 at 12:40:04AM +0300, Dmitry Osipenko wrote: > >> 10.08.2020 00:16, Michał Mirosław пишет: > >>> Simplify regulator locking by removing locking around locking.

Re: [PATCH] regulator: simplify locking

2020-08-09 Thread Dmitry Osipenko
10.08.2020 01:30, Michał Mirosław пишет: > On Mon, Aug 10, 2020 at 12:40:04AM +0300, Dmitry Osipenko wrote: >> 10.08.2020 00:16, Michał Mirosław пишет: >>> Simplify regulator locking by removing locking around locking. rdev->ref >>> is now accessed only when the lock is taken. The code still

Re: [PATCH] regulator: simplify locking

2020-08-09 Thread Michał Mirosław
On Mon, Aug 10, 2020 at 12:40:04AM +0300, Dmitry Osipenko wrote: > 10.08.2020 00:16, Michał Mirosław пишет: > > Simplify regulator locking by removing locking around locking. rdev->ref > > is now accessed only when the lock is taken. The code still smells fishy, > > but now its obvious why. > > >

Re: [PATCH] regulator: simplify locking

2020-08-09 Thread Dmitry Osipenko
10.08.2020 00:16, Michał Mirosław пишет: > Simplify regulator locking by removing locking around locking. rdev->ref > is now accessed only when the lock is taken. The code still smells fishy, > but now its obvious why. > > Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators

[PATCH] regulator: simplify locking

2020-08-09 Thread Michał Mirosław
Simplify regulator locking by removing locking around locking. rdev->ref is now accessed only when the lock is taken. The code still smells fishy, but now its obvious why. Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking") Signed-off-by: Michał Mirosław ---