From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
linux-mtd@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org,
Hartley Sweeten <hsweeten@visionengravers.com>,
Ryan Mallon <rmallon@gmail.com>, Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <kernel@pengutronix.de>,
Imre Kaloz <kaloz@openwrt.org>,
Krzysztof Halasa <khalasa@piap.pl>,
Tony Lindgren <tony@atomide.com>,
linux-omap@vger.kernel.org,
Alexander Clouter <alex@digriz.org.uk>,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Gregory CLEMENT <gregory.clement@free-electrons.com>,
Jason Cooper <jason@lakedaemon.net>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Andrew Lunn <andrew@lunn.ch>, Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Marek Vasut <marek.vasut@gmail.com>,
Steven Miao <realmz6@gmail.com>,
adi-buildroot-devel@lists.sourceforge.net,
Mikael Starvik <starvik@axis.com>,
Jesper Nilsson <jesper.nilsson@axis.com>,
linux-cris-kernel@axis.com, Josh Wu <josh.wu@atmel.com>,
Wan ZongShun <mcuos.com@gmail.com>,
Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
Maxim Levitsky <maximlevitsky@gmail.com>,
Kukjin Kim <kgene@kernel.org>,
Krzysztof Kozlowski <k.kozlowski@samsung.com>,
linux-samsung-soc@vger.kernel.org,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Chen-Yu Tsai <wens@csie.org>,
linux-sunxi@googlegroups.com, Stefan Agner <stefan@agner.ch>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org, stable@vger.kernel.org
Subject: Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()
Date: Fri, 11 Dec 2015 14:53:20 +0100 [thread overview]
Message-ID: <20151211145320.1560fac3@bbrezillon> (raw)
In-Reply-To: <20151211004008.GQ144338@google.com>
Hi Brian,
On Thu, 10 Dec 2015 16:40:08 -0800
Brian Norris <computersforpeace@gmail.com> wrote:
> On Thu, Dec 10, 2015 at 08:59:45AM +0100, Boris Brezillon wrote:
> > Unregister the NAND device from the NAND subsystem when removing a denali
> > NAND controller, otherwise the MTD attached to the NAND device is still
> > exposed by the MTD layer, and accesses to this device will likely crash
> > the system.
> >
> > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > Cc: <stable@vger.kernel.org> #3.8+
>
> Does this follow these rules, from
> Documentation/stable_kernel_rules.txt?
>
> - It must be obviously correct and tested.
>
> - It must fix a real bug that bothers people (not a, "This could be a
> problem..." type thing).
As you wish, I'll remove those Cc and Fixes tags, or just drop the
patch if you think it's useless...
I just noticed the bug while reworking this series, and thought it
would be useful to fix it, but I honestly don't care if it's applied
or not (I don't use this platform).
>
> > Fixes: 2a0a288ec258 ("mtd: denali: split the generic driver and PCI layer")
> > ---
> > drivers/mtd/nand/denali.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
> > index 67eb2be..8feece3 100644
> > --- a/drivers/mtd/nand/denali.c
> > +++ b/drivers/mtd/nand/denali.c
> > @@ -1622,6 +1622,7 @@ EXPORT_SYMBOL(denali_init);
> > /* driver exit point */
> > void denali_remove(struct denali_nand_info *denali)
> > {
> > + nand_release(&denali->mtd);
> > denali_irq_cleanup(denali->irq, denali);
> > dma_unmap_single(denali->dev, denali->buf.dma_buf,
> > denali->mtd.writesize + denali->mtd.oobsize,
>
> It feels a bit odd to allow usage of MTD fields after it has been
> unregistered. Maybe precompute this before the nand_release()?
nand_realease() is not releasing the mtd instance or re-initialazing
its field, so it should be safe, but I agree that pre-computing the DMA
buffer size is more future-proof.
I'll fix that, send a v5 and let you decide whether it's needed or not.
Best Regards,
Boris
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2015-12-11 13:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1449734442-18672-1-git-send-email-boris.brezillon@free-electrons.com>
2015-12-10 7:59 ` [PATCH v4 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove() Boris Brezillon
2015-12-11 0:40 ` Brian Norris
2015-12-11 13:53 ` Boris Brezillon [this message]
2015-12-11 14:39 ` Dan Carpenter
2015-12-11 15:15 ` Boris Brezillon
2015-12-11 22:03 ` Boris Brezillon
2015-12-11 22:11 ` Brian Norris
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=20151211145320.1560fac3@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=adi-buildroot-devel@lists.sourceforge.net \
--cc=alex@digriz.org.uk \
--cc=andrew@lunn.ch \
--cc=computersforpeace@gmail.com \
--cc=corbet@lwn.net \
--cc=daniel@zonque.org \
--cc=devel@driverdev.osuosl.org \
--cc=dwmw2@infradead.org \
--cc=ezequiel.garcia@free-electrons.com \
--cc=gregkh@linuxfoundation.org \
--cc=gregory.clement@free-electrons.com \
--cc=haojian.zhuang@gmail.com \
--cc=hsweeten@visionengravers.com \
--cc=jason@lakedaemon.net \
--cc=jesper.nilsson@axis.com \
--cc=josh.wu@atmel.com \
--cc=k.kozlowski@samsung.com \
--cc=kaloz@openwrt.org \
--cc=kernel@pengutronix.de \
--cc=kgene@kernel.org \
--cc=khalasa@piap.pl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-cris-kernel@axis.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=marek.vasut@gmail.com \
--cc=maxime.ripard@free-electrons.com \
--cc=maximlevitsky@gmail.com \
--cc=mcuos.com@gmail.com \
--cc=realmz6@gmail.com \
--cc=rmallon@gmail.com \
--cc=robert.jarzmik@free.fr \
--cc=sebastian.hesselbarth@gmail.com \
--cc=shawnguo@kernel.org \
--cc=stable@vger.kernel.org \
--cc=starvik@axis.com \
--cc=stefan@agner.ch \
--cc=thomas.petazzoni@free-electrons.com \
--cc=tony@atomide.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).