From: Jonathan Cameron <jic23@kernel.org>
To: Corentin Labbe <clabbe.montjoie@gmail.com>
Cc: Quentin Schulz <quentin.schulz@free-electrons.com>,
knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
maxime.ripard@free-electrons.com, wens@csie.org,
linux-iio@vger.kernel.org, thomas.petazzoni@free-electrons.com,
linux-sunxi@googlegroups.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] iio: adc: sun4i-gpadc-iio: fix parent device being used in devm function
Date: Wed, 24 May 2017 21:01:24 +0100 [thread overview]
Message-ID: <20170524210124.058072b6@kernel.org> (raw)
In-Reply-To: <20170521190632.GB13344@Red>
On Sun, 21 May 2017 21:06:32 +0200
Corentin Labbe <clabbe.montjoie@gmail.com> wrote:
> On Thu, May 18, 2017 at 08:36:07AM +0200, Quentin Schulz wrote:
> > For the sake of DT binding stability, this IIO driver is a child of an
> > MFD driver for Allwinner A10, A13 and A31 because there already exists a
> > DT binding for this IP. The MFD driver has a DT node but the IIO driver
> > does not.
> >
> > The IIO device registers the temperature sensor in the thermal framework
> > using the DT node of the parent, the MFD device, so the thermal
> > framework could match the phandle to the MFD device in the DT and the
> > struct device used to register in the thermal framework.
> >
> > devm_thermal_zone_of_sensor_register was previously used to register the
> > thermal sensor with the parent struct device of the IIO device,
> > representing the MFD device. By doing so, we registered actually the
> > parent in the devm routine and not the actual IIO device.
> >
> > This lead to the devm unregister function not being called when the IIO
> > module driver is removed. It resulted in the thermal framework still
> > polling the get_temp function of the IIO module while the device doesn't
> > exist anymore, thus generated a kernel panic.
> >
> > Use the non-devm function instead and do the unregister manually in the
> > remove function.
> >
> > Fixes: d1caa9905538 ("iio: adc: add support for Allwinner SoCs ADC")
> >
> > Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
> > Reported-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> > ---
>
> Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Thanks. I'm afraid this has gone into a non rebasing tree
(and upstream for that matter) so I can't now apply this.
We will have to fall back on the email record.
Thanks
Jonathan
>
> Thanks
WARNING: multiple messages have this Message-ID (diff)
From: jic23@kernel.org (Jonathan Cameron)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] iio: adc: sun4i-gpadc-iio: fix parent device being used in devm function
Date: Wed, 24 May 2017 21:01:24 +0100 [thread overview]
Message-ID: <20170524210124.058072b6@kernel.org> (raw)
In-Reply-To: <20170521190632.GB13344@Red>
On Sun, 21 May 2017 21:06:32 +0200
Corentin Labbe <clabbe.montjoie@gmail.com> wrote:
> On Thu, May 18, 2017 at 08:36:07AM +0200, Quentin Schulz wrote:
> > For the sake of DT binding stability, this IIO driver is a child of an
> > MFD driver for Allwinner A10, A13 and A31 because there already exists a
> > DT binding for this IP. The MFD driver has a DT node but the IIO driver
> > does not.
> >
> > The IIO device registers the temperature sensor in the thermal framework
> > using the DT node of the parent, the MFD device, so the thermal
> > framework could match the phandle to the MFD device in the DT and the
> > struct device used to register in the thermal framework.
> >
> > devm_thermal_zone_of_sensor_register was previously used to register the
> > thermal sensor with the parent struct device of the IIO device,
> > representing the MFD device. By doing so, we registered actually the
> > parent in the devm routine and not the actual IIO device.
> >
> > This lead to the devm unregister function not being called when the IIO
> > module driver is removed. It resulted in the thermal framework still
> > polling the get_temp function of the IIO module while the device doesn't
> > exist anymore, thus generated a kernel panic.
> >
> > Use the non-devm function instead and do the unregister manually in the
> > remove function.
> >
> > Fixes: d1caa9905538 ("iio: adc: add support for Allwinner SoCs ADC")
> >
> > Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
> > Reported-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> > ---
>
> Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Thanks. I'm afraid this has gone into a non rebasing tree
(and upstream for that matter) so I can't now apply this.
We will have to fall back on the email record.
Thanks
Jonathan
>
> Thanks
next prev parent reply other threads:[~2017-05-24 20:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-18 6:36 [PATCH v2] iio: adc: sun4i-gpadc-iio: fix parent device being used in devm function Quentin Schulz
2017-05-18 6:36 ` Quentin Schulz
2017-05-18 6:51 ` Maxime Ripard
2017-05-18 6:51 ` Maxime Ripard
2017-05-21 14:18 ` Jonathan Cameron
2017-05-21 14:18 ` Jonathan Cameron
2017-05-21 19:06 ` Corentin Labbe
2017-05-21 19:06 ` Corentin Labbe
2017-05-24 20:01 ` Jonathan Cameron [this message]
2017-05-24 20:01 ` Jonathan Cameron
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=20170524210124.058072b6@kernel.org \
--to=jic23@kernel.org \
--cc=clabbe.montjoie@gmail.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=maxime.ripard@free-electrons.com \
--cc=pmeerw@pmeerw.net \
--cc=quentin.schulz@free-electrons.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=wens@csie.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.