Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755495AbbLKQu0 (ORCPT ); Fri, 11 Dec 2015 11:50:26 -0500 Received: from mail-vk0-f68.google.com ([209.85.213.68]:34361 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752745AbbLKQuW (ORCPT ); Fri, 11 Dec 2015 11:50:22 -0500 MIME-Version: 1.0 In-Reply-To: <20151211161008.056a0f47@bbrezillon> References: <1449734442-18672-2-git-send-email-boris.brezillon@free-electrons.com> <1449842554-29898-1-git-send-email-boris.brezillon@free-electrons.com> <20151211161008.056a0f47@bbrezillon> Date: Fri, 11 Dec 2015 10:50:21 -0600 Message-ID: Subject: Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove() From: Dinh Nguyen To: Boris Brezillon Cc: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org, Andrew Lunn , Krzysztof Kozlowski , "linux-doc@vger.kernel.org" , Tony Lindgren , Nicolas Ferre , Stefan Agner , linux-sunxi@googlegroups.com, Alexandre Belloni , Robert Jarzmik , Alexander Clouter , "devel@driverdev.osuosl.org" , Jesper Nilsson , linux-samsung-soc@vger.kernel.org, Maxim Levitsky , Jonathan Corbet , Marek Vasut , Chen-Yu Tsai , Kukjin Kim , Ezequiel Garcia , Jean-Christophe Plagniol-Villard , Dinh Nguyen , Sebastian Hesselbarth , Jason Cooper , Wan ZongShun , Steven Miao , Haojian Zhuang , Mikael Starvik , Krzysztof Halasa , Gregory CLEMENT , linux-omap@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , Thomas Petazzoni , Ryan Mallon , linux-cris-kernel@axis.com, Greg Kroah-Hartman , Linux List , Hartley Sweeten , Dan Carpenter , Sascha Hauer , Maxime Ripard , Imre Kaloz , Shawn Guo , Daniel Mack Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1982 Lines: 54 Hi Boris, On Fri, Dec 11, 2015 at 9:10 AM, Boris Brezillon wrote: > + Dinh (who made commit 2a0a288ec258) > > Also added back the Fixes tag. > > On Fri, 11 Dec 2015 15:02:34 +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 > > Fixes: 2a0a288ec258 ("mtd: denali: split the generic driver and PCI layer") > >> --- >> Changes since v4: >> - remove Cc stable and fixes tags >> - calculate the dma buffer size before calling nand_release() >> >> drivers/mtd/nand/denali.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c >> index 67eb2be..fdfea05 100644 >> --- a/drivers/mtd/nand/denali.c >> +++ b/drivers/mtd/nand/denali.c >> @@ -1622,9 +1622,11 @@ EXPORT_SYMBOL(denali_init); >> /* driver exit point */ >> void denali_remove(struct denali_nand_info *denali) >> { >> + int bufsize = denali->mtd.writesize + denali->mtd.oobsize; >> + >> + 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, >> + dma_unmap_single(denali->dev, denali->buf.dma_buf, bufsize, >> DMA_BIDIRECTIONAL); Not sure what is the need to add bufsize here, but the commit message doesn't reflect the change. Dinh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/