All of lore.kernel.org
 help / color / mirror / Atom feed
From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/5] of: introduce the overlay manager
Date: Wed, 26 Oct 2016 21:02:12 +0200	[thread overview]
Message-ID: <20161026210212.09cd85f4@free-electrons.com> (raw)
In-Reply-To: <CANLsYkyszsn2TLYhUjHMt2ZnEUmE9eSc71W2KWBL0fWhh3PPBw@mail.gmail.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Antoine Tenart <antoine.tenart@free-electrons.com>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	pantelis.antoniou@konsulko.com,
	Mark Rutland <mark.rutland@arm.com>,
	sboyd@codeaurora.org,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [RFC PATCH 1/5] of: introduce the overlay manager
Date: Wed, 26 Oct 2016 21:02:12 +0200	[thread overview]
Message-ID: <20161026210212.09cd85f4@free-electrons.com> (raw)
In-Reply-To: <CANLsYkyszsn2TLYhUjHMt2ZnEUmE9eSc71W2KWBL0fWhh3PPBw@mail.gmail.com>

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

  reply	other threads:[~2016-10-26 19:02 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 14:57 [RFC PATCH 0/5] Add an overlay manager to handle board capes Antoine Tenart
2016-10-26 14:57 ` Antoine Tenart
2016-10-26 14:57 ` Antoine Tenart
2016-10-26 14:57 ` [RFC PATCH 1/5] of: introduce the overlay manager Antoine Tenart
2016-10-26 14:57   ` Antoine Tenart
2016-10-26 16:29   ` Mathieu Poirier
2016-10-26 16:29     ` Mathieu Poirier
2016-10-26 16:29     ` Mathieu Poirier
2016-10-26 19:02     ` Thomas Petazzoni [this message]
2016-10-26 19:02       ` Thomas Petazzoni
2016-10-27 14:03     ` Antoine Tenart
2016-10-27 14:03       ` Antoine Tenart
2016-10-27 14:03       ` Antoine Tenart
2016-10-27 14:49       ` Mathieu Poirier
2016-10-27 14:49         ` Mathieu Poirier
2016-10-27 14:49         ` Mathieu Poirier
2016-10-27 14:54         ` Antoine Tenart
2016-10-27 14:54           ` Antoine Tenart
2016-10-27 14:54           ` Antoine Tenart
2016-10-27  9:10   ` Matthias Brugger
2016-10-27  9:10     ` Matthias Brugger
2016-10-27 14:56   ` Pantelis Antoniou
2016-10-27 14:56     ` Pantelis Antoniou
2016-10-27 15:07   ` Pantelis Antoniou
2016-10-27 15:07     ` Pantelis Antoniou
2016-10-27 15:07     ` Pantelis Antoniou
2016-10-26 14:57 ` [RFC PATCH 2/5] of: overlay-mgr: add the CHIP format Antoine Tenart
2016-10-26 14:57   ` Antoine Tenart
2016-10-26 14:57   ` Antoine Tenart
2016-10-26 14:57 ` [RFC PATCH 3/5] w1: report errors returned by w1_family_notify Antoine Tenart
2016-10-26 14:57   ` Antoine Tenart
2016-10-26 14:57   ` Antoine Tenart
2016-10-26 16:39   ` Mathieu Poirier
2016-10-26 16:39     ` Mathieu Poirier
2016-10-26 16:39     ` Mathieu Poirier
2016-10-26 14:57 ` [RFC PATCH 4/5] w1: add a callback to call slave when a new device is connected Antoine Tenart
2016-10-26 14:57   ` Antoine Tenart
2016-10-26 16:42   ` Mathieu Poirier
2016-10-26 16:42     ` Mathieu Poirier
2016-10-26 16:42     ` Mathieu Poirier
2016-10-26 17:30     ` Antoine Tenart
2016-10-26 17:30       ` Antoine Tenart
2016-10-26 17:30       ` Antoine Tenart
2016-10-26 14:57 ` [RFC PATCH 5/5] of: overlay-mgr: add a detector for headers stored on a ds2431 eeprom over w1 Antoine Tenart
2016-10-26 14:57   ` Antoine Tenart
2016-10-27  9:18   ` Matthias Brugger
2016-10-27  9:18     ` Matthias Brugger
2016-10-27  9:19   ` Matthias Brugger
2016-10-27  9:19     ` Matthias Brugger
2016-10-27 13:55     ` Antoine Tenart
2016-10-27 13:55       ` Antoine Tenart
2016-10-27 13:55       ` Antoine Tenart
2016-10-27 13:41 ` [RFC PATCH 0/5] Add an overlay manager to handle board capes Rob Herring
2016-10-27 13:41   ` Rob Herring
2016-10-27 13:41   ` Rob Herring
2016-10-27 14:25   ` Antoine Tenart
2016-10-27 14:25     ` Antoine Tenart
2016-10-27 14:25     ` Antoine Tenart
2016-10-27 15:13   ` Hans de Goede
2016-10-27 15:13     ` Hans de Goede
2016-10-27 15:13     ` Hans de Goede
2016-10-27 17:30     ` Rob Herring
2016-10-27 17:30       ` Rob Herring
2016-10-27 17:30       ` Rob Herring
2016-10-27 20:51       ` Hans de Goede
2016-10-27 20:51         ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161026210212.09cd85f4@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.