Patchwork MTD: add missing put_chip() in cfi_intelext_reset()

login
register
mail settings
Submitter Nicolas Pitre
Date Oct. 23, 2009, 8:02 p.m.
Message ID <alpine.LFD.2.00.0910231559320.21460@xanadu.home>
Download mbox | patch
Permalink /patch/36824/
State New
Headers show

Comments

Nicolas Pitre - Oct. 23, 2009, 8:02 p.m.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>

---

On Fri, 23 Oct 2009, Antonio Ospite wrote:

> Hi,
> 
> I am attaching a trace of a possible recursive locking in
> cfi_cmdset_0001.c

This patch should fix it.
Antonio Ospite - Oct. 23, 2009, 8:37 p.m.
On Fri, 23 Oct 2009 16:02:42 -0400 (EDT)
Nicolas Pitre <nico@fluxnic.net> wrote:

> 
> Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
> 
> ---
> 
> On Fri, 23 Oct 2009, Antonio Ospite wrote:
> 
> > Hi,
> > 
> > I am attaching a trace of a possible recursive locking in
> > cfi_cmdset_0001.c
> 
> This patch should fix it.
> 
> diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
> index e7563a9..d923a2d 100644
> --- a/drivers/mtd/chips/cfi_cmdset_0001.c
> +++ b/drivers/mtd/chips/cfi_cmdset_0001.c
> @@ -2564,6 +2564,7 @@ static int cfi_intelext_reset(struct mtd_info *mtd)
>  		if (!ret) {
>  			map_write(map, CMD(0xff), chip->start);
>  			chip->state = FL_SHUTDOWN;
> +			put_chip(map, chip, chip->start);
>  		}
>  		spin_unlock(chip->mutex);
>  	}

I've just tested this and it seems to fix the issue, indeed.

Many thanks,
   Antonio
Antonio Ospite - Nov. 20, 2009, 10:14 a.m.
On Fri, 23 Oct 2009 16:02:42 -0400 (EDT)
Nicolas Pitre <nico@fluxnic.net> wrote:

> 
> Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
>

Hi, has this fix been submitted yet?
I can't see it in 2.6.32-rc8.

Thanks,
   Antonio

> ---
> 
> On Fri, 23 Oct 2009, Antonio Ospite wrote:
> 
> > Hi,
> > 
> > I am attaching a trace of a possible recursive locking in
> > cfi_cmdset_0001.c
> 
> This patch should fix it.
> 
> diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
> index e7563a9..d923a2d 100644
> --- a/drivers/mtd/chips/cfi_cmdset_0001.c
> +++ b/drivers/mtd/chips/cfi_cmdset_0001.c
> @@ -2564,6 +2564,7 @@ static int cfi_intelext_reset(struct mtd_info *mtd)
>  		if (!ret) {
>  			map_write(map, CMD(0xff), chip->start);
>  			chip->state = FL_SHUTDOWN;
> +			put_chip(map, chip, chip->start);
>  		}
>  		spin_unlock(chip->mutex);
>  	}
Artem Bityutskiy - Nov. 26, 2009, 7:01 a.m.
On Fri, 2009-11-20 at 11:14 +0100, Antonio Ospite wrote:
> On Fri, 23 Oct 2009 16:02:42 -0400 (EDT)
> Nicolas Pitre <nico@fluxnic.net> wrote:
> 
> > 
> > Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
> >
> 
> Hi, has this fix been submitted yet?
> I can't see it in 2.6.32-rc8.

The current situation indicates it is not going to be there.

This patch is in my l2-mtd tree, though.
Antonio Ospite - Nov. 26, 2009, 9:22 a.m.
On Thu, 26 Nov 2009 09:01:18 +0200
Artem Bityutskiy <dedekind1@gmail.com> wrote:

> On Fri, 2009-11-20 at 11:14 +0100, Antonio Ospite wrote:
> > On Fri, 23 Oct 2009 16:02:42 -0400 (EDT)
> > Nicolas Pitre <nico@fluxnic.net> wrote:
> > 
> > > 
> > > Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
> > >
> > 
> > Hi, has this fix been submitted yet?
> > I can't see it in 2.6.32-rc8.
> 
> The current situation indicates it is not going to be there.
> 
> This patch is in my l2-mtd tree, though.
>

Ok, thanks, I just want to be sure this will find its way to
mainline, I don't care which path it takes :)

> -- 
> Best Regards,
> Artem Bityutskiy (Артём Битюцкий)
> 

Regards,
   Antonio

Patch

diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index e7563a9..d923a2d 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -2564,6 +2564,7 @@  static int cfi_intelext_reset(struct mtd_info *mtd)
 		if (!ret) {
 			map_write(map, CMD(0xff), chip->start);
 			chip->state = FL_SHUTDOWN;
+			put_chip(map, chip, chip->start);
 		}
 		spin_unlock(chip->mutex);
 	}