mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Linus Walleij <linus.walleij@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Stephen Warren <swarren@nvidia.com>,
	Anmar Oueja <anmar.oueja@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] pinctrl: sink pinctrldev_list_mutex
Date: Mon, 20 May 2013 14:40:55 -0600	[thread overview]
Message-ID: <519A8A57.9060007@wwwdotorg.org> (raw)
In-Reply-To: <1368690525-32252-1-git-send-email-linus.walleij@stericsson.com>

On 05/16/2013 01:48 AM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
> 
> The pinctrldev_list_mutex is sinked into the functions that
> actually traverse the list and lock it there. The code makes
> much more sense in this way. All the callers are in
> non-performance critical paths and the code is way more
> readable this way.
> 
> Also refactor the function get_pinctrl_dev_from_devname() to
> follow the design pattern of get_pinctrl_dev_from_of_node()
> which is slightly simpler.

This seems fine on the surface, but I do have one question:

I think the pinctrl lock serves a couple of purposes:

1) Basic protection for accesses to the pinctrldev_list itself.

This patch seems just fine w.r.t. this point.

2) Preventing pinctrl drivers from being unregistered (and their modules
unloaded) when some operation is being performed on/to them.

So, that means some code is written as follows:

lock
find pinctrl device
perform operation on pinctrl device
unlock
// only now could the found pinctrl device be unregistered

However, I think this patch changes that to the following for some
operations:

lock
find pinctrl device
unlock
// now the found pinctrl device can be unregistered
perform operation on pinctrl device

Is this true here, or am I off-base?

If this isn't an issue, then the patch is fine by me. But, how is the
unregistration prevented while the device is being operated on then?

  reply	other threads:[~2013-05-20 20:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16  7:48 Linus Walleij
2013-05-20 20:40 ` Stephen Warren [this message]
2013-05-24  8:04   ` Linus Walleij
2013-05-24 15:45     ` Stephen Warren
2013-05-25  9:09       ` Linus Walleij
2013-05-28 15:14         ` Stephen Warren
2013-05-29 16:28           ` Linus Walleij

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=519A8A57.9060007@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=anmar.oueja@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swarren@nvidia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome