From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian Norris Subject: Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove() Date: Thu, 10 Dec 2015 16:40:08 -0800 Message-ID: <20151211004008.GQ144338@google.com> References: <1449734442-18672-1-git-send-email-boris.brezillon@free-electrons.com> <1449734442-18672-2-git-send-email-boris.brezillon@free-electrons.com> Reply-To: computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Content-Disposition: inline In-Reply-To: <1449734442-18672-2-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Boris Brezillon Cc: David Woodhouse , linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Jonathan Corbet , linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Hartley Sweeten , Ryan Mallon , Shawn Guo , Sascha Hauer , Imre Kaloz , Krzysztof Halasa , Tony Lindgren , linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Alexander Clouter , Thomas Petazzoni , Gregory CLEMENT , Jason Cooper , Sebastian Hesselbarth , Andrew Lunn , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Marek List-Id: linux-omap@vger.kernel.org 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 > Cc: #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). > 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()? Brian