Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1484318

Re: lockdep: incorrect deadlock warning with two GPIO expanders

From Bartosz Golaszewski <bgolaszewski@baylibre.com>
Newsgroups linux.kernel
Subject Re: lockdep: incorrect deadlock warning with two GPIO expanders
Date 2016-09-15 17:30 +0200
Message-ID <shGLU-hb-15@gated-at.bofh.it> (permalink)
References (6 earlier) <shEh4-75Z-29@gated-at.bofh.it> <shETM-7yO-13@gated-at.bofh.it> <shF3r-7Ca-13@gated-at.bofh.it> <shFG9-85o-5@gated-at.bofh.it> <shFZw-8bW-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2016-09-15 16:38 GMT+02:00 Peter Zijlstra <peterz@infradead.org>:
> On Thu, Sep 15, 2016 at 04:08:52PM +0200, Bartosz Golaszewski wrote:
>> 2016-09-15 15:39 GMT+02:00 Peter Zijlstra <peterz@infradead.org>:
>
>> > In any case, if this fails, we can always punt and simply count the
>> > total number of instances of this driver on the system and go with that.
>> >
>>
>> But for __mutex_init() to work with the key argument you need to know
>> it at compile time, right?
>
> You can do something like:
>
>         mutex_init(&mutex);
>         lockdep_set_subclass(&mutex, nr);
>
> which will of course fail at runtime the moment nr >= 8, but is that
> really a concern?
>
> Equally you can do:
>
> static struct lock_class_key my_keys[NR];
>
>         mutex_init(&mutex);
>         BUG_ON(nr > NR);
>         lockdep_set_class(&mutex, my_keys + nr);
>
> and have a bigger limit.

Thanks, I was not aware of this API.

Best regards,
Bartosz Golaszewski

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

lockdep: incorrect deadlock warning with two GPIO expanders Bartosz Golaszewski <bgolaszewski@baylibre.com> - 2016-09-12 14:00 +0200
  Re: lockdep: incorrect deadlock warning with two GPIO expanders Peter Zijlstra <peterz@infradead.org> - 2016-09-12 14:10 +0200
    Re: lockdep: incorrect deadlock warning with two GPIO expanders Bartosz Golaszewski <bgolaszewski@baylibre.com> - 2016-09-12 17:20 +0200
      Re: lockdep: incorrect deadlock warning with two GPIO expanders Peter Zijlstra <peterz@infradead.org> - 2016-09-12 17:40 +0200
        Re: lockdep: incorrect deadlock warning with two GPIO expanders Linus Walleij <linus.walleij@linaro.org> - 2016-09-13 14:30 +0200
          Re: lockdep: incorrect deadlock warning with two GPIO expanders Peter Zijlstra <peterz@infradead.org> - 2016-09-15 10:00 +0200
            Re: lockdep: incorrect deadlock warning with two GPIO expanders Linus Walleij <linus.walleij@linaro.org> - 2016-09-15 14:50 +0200
              Re: lockdep: incorrect deadlock warning with two GPIO expanders Bartosz Golaszewski <bgolaszewski@baylibre.com> - 2016-09-15 15:30 +0200
                Re: lockdep: incorrect deadlock warning with two GPIO expanders Peter Zijlstra <peterz@infradead.org> - 2016-09-15 15:40 +0200
                Re: lockdep: incorrect deadlock warning with two GPIO expanders Bartosz Golaszewski <bgolaszewski@baylibre.com> - 2016-09-15 16:20 +0200
                Re: lockdep: incorrect deadlock warning with two GPIO expanders Peter Zijlstra <peterz@infradead.org> - 2016-09-15 16:40 +0200
                Re: lockdep: incorrect deadlock warning with two GPIO expanders Bartosz Golaszewski <bgolaszewski@baylibre.com> - 2016-09-15 17:30 +0200
                Re: lockdep: incorrect deadlock warning with two GPIO expanders Peter Zijlstra <peterz@infradead.org> - 2016-09-16 13:00 +0200
                Re: lockdep: incorrect deadlock warning with two GPIO expanders Bartosz Golaszewski <bgolaszewski@baylibre.com> - 2016-09-16 13:20 +0200
                Re: lockdep: incorrect deadlock warning with two GPIO expanders Bartosz Golaszewski <bgolaszewski@baylibre.com> - 2016-09-16 14:10 +0200
              Re: lockdep: incorrect deadlock warning with two GPIO expanders Bartosz Golaszewski <bgolaszewski@baylibre.com> - 2016-09-16 16:30 +0200

csiph-web