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


Groups > linux.kernel > #1509711

Re: [RFC PATCH 1/5] of: introduce the overlay manager

From Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 1/5] of: introduce the overlay manager
Date 2016-10-26 21:10 +0200
Message-ID <swBKi-809-31@gated-at.bofh.it> (permalink)
References <swxQl-57S-5@gated-at.bofh.it> <swxQl-57S-9@gated-at.bofh.it> <swzp8-6mF-11@gated-at.bofh.it>
Organization Free Electrons

Show all headers | View raw


Hello,

On Wed, 26 Oct 2016 10:29:59 -0600, Mathieu Poirier wrote:

> > +       overlay = devm_kzalloc(dev, sizeof(*overlay), GFP_KERNEL);  
> 
> Function devm_kzalloc() can sleep but you're holding a spinlock - I'm
> surprised the kernel didn't complain here.  Allocate the memory before
> holding the lock.  If the overly is already loaded simply free it on
> the error path.

Actually, I'm not sure using a spinlock here is appropriate. Using a
mutex would probably be better.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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


Thread

[RFC PATCH 1/5] of: introduce the overlay manager Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-10-26 17:00 +0200
  Re: [RFC PATCH 1/5] of: introduce the overlay manager Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-10-26 18:40 +0200
    Re: [RFC PATCH 1/5] of: introduce the overlay manager Thomas Petazzoni <thomas.petazzoni@free-electrons.com> - 2016-10-26 21:10 +0200
    Re: [RFC PATCH 1/5] of: introduce the overlay manager Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-10-27 16:20 +0200
      Re: [RFC PATCH 1/5] of: introduce the overlay manager Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-10-27 17:00 +0200
        Re: [RFC PATCH 1/5] of: introduce the overlay manager Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-10-27 17:00 +0200
  Re: [RFC PATCH 1/5] of: introduce the overlay manager Matthias Brugger <mbrugger@suse.com> - 2016-10-27 16:20 +0200
  Re: [RFC PATCH 1/5] of: introduce the overlay manager Pantelis Antoniou <pantelis.antoniou@konsulko.com> - 2016-10-27 17:00 +0200
  Re: [RFC PATCH 1/5] of: introduce the overlay manager Pantelis Antoniou <pantelis.antoniou@konsulko.com> - 2016-10-27 17:10 +0200

csiph-web