Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1289669

Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()

From Boris Brezillon <boris.brezillon@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()
Date 2015-12-11 16:20 +0100
Message-ID <qExEe-6dr-3@gated-at.bofh.it> (permalink)
References <qE4sB-3sW-89@gated-at.bofh.it> <qEwyv-5wq-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


+ Dinh (who made commit 2a0a288ec258)

Also added back the Fixes tag.

On Fri, 11 Dec 2015 15:02:34 +0100
Boris Brezillon <boris.brezillon@free-electrons.com> 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>

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);
>  }
>  EXPORT_SYMBOL(denali_remove);



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-10 09:10 +0100
  Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Brian Norris <computersforpeace@gmail.com> - 2015-12-11 01:50 +0100
    Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 15:00 +0100
      Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-11 15:50 +0100
        Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 16:20 +0100
    Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 23:10 +0100
      Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Brian Norris <computersforpeace@gmail.com> - 2015-12-11 23:20 +0100
  [PATCH v5 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 15:10 +0100
    Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 16:20 +0100
      Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Dinh Nguyen <dinh.linux@gmail.com> - 2015-12-11 18:00 +0100
        Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-11 18:10 +0100
          Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release()  call in denali_remove() Dinh Nguyen <dinh.linux@gmail.com> - 2015-12-11 18:30 +0100

csiph-web