public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Jon Hunter <jonathanh@nvidia.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH] pinctrl: core: Fix panic when pinctrl devices with hogs are unregistered
Date: Thu, 5 Jan 2017 11:27:48 -0800	[thread overview]
Message-ID: <20170105192748.GS4310@atomide.com> (raw)
In-Reply-To: <CACRpkdbAv8UiqWBH5mUNpOzBeAee4ZbdF=M_AvOPz5imbv26uA@mail.gmail.com>

* Linus Walleij <linus.walleij@linaro.org> [170105 08:16]:
> On Thu, Jan 5, 2017 at 4:52 PM, Jon Hunter <jonathanh@nvidia.com> wrote:
> 
> > Commit df61b366af26 ('pinctrl: core: Use delayed work for hogs')
> > deferred part of the registration for pinctrl devices if the pinctrl
> > device has hogs. This introduced a window where if the pinctrl device
> > with hogs was sucessfully registered, but then unregistered again
> > (which could be caused by parent device being probe deferred) before
> > the delayed work has chanced to run, then this will cause a kernel
> > panic to occur because:
> >
> > 1. The 'pctldev->p' has not yet been initialised and when unregistering
> >    the pinctrl device we only check to see if it is an error value, but
> >    now it could also be NULL.
> > 2. The pinctrl device may not have been added to the 'pinctrldev_list'
> >    list and we don't check to see if it was added before removing.
> >
> > Fix up the above by checking to see if the 'pctldev->p' pointer is an
> > error value or NULL before putting the pinctrl device and verifying
> > that the pinctrl device is present in 'pinctrldev_list' before removing.
> >
> > Fixes: df61b366af26 ('pinctrl: core: Use delayed work for hogs')
> >
> > Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> 
> Oops. Patch applied.

OK, did not see that with my testing of hogs with omap4-duovero-parlor.
Thanks for fixing that.

Tony

      reply	other threads:[~2017-01-05 19:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05 15:52 [PATCH] pinctrl: core: Fix panic when pinctrl devices with hogs are unregistered Jon Hunter
2017-01-05 16:15 ` Linus Walleij
2017-01-05 19:27   ` Tony Lindgren [this message]

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=20170105192748.GS4310@atomide.com \
    --to=tony@atomide.com \
    --cc=jonathanh@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox