public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Todd Poynor <tpoynor@mvista.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: rpurdie@rpsys.net, lenz@cs.wisc.edu,
	kernel list <linux-kernel@vger.kernel.org>,
	Russell King <rmk@arm.linux.org.uk>,
	dwmw2@infradead.org, Andrew Morton <akpm@osdl.org>
Subject: Re: latest mtd changes broke collie
Date: Wed, 09 Nov 2005 18:59:52 -0800	[thread overview]
Message-ID: <4372B7A8.5060904@mvista.com> (raw)
In-Reply-To: <20051109221712.GA28385@elf.ucw.cz>

Pavel Machek wrote:
> Latest mtd changes break collie...it now oopses during boot. This
> reverts the bad patch.

What tree was this generated against?  It doesn't seem to match recent 
linux-mtd or kernel.org trees.  It looks like the tree used had 
different version of a couple fixes recently added to linux-mtd (removal 
of bogus udelays and 32-bit status datatype).

I'm guessing the important part is to add a missing spin_unlock_bh(), 
which is definitely a bug in the mtd code, but this code is so different 
than linux-mtd CVS that it seems more resyncing is needed.  As it stands 
now, force-fitting this patch would still leave an unbalanced 
spin_lock_bh() without other changes.  And it does look like this driver 
hasn't been converted to modern mtd apis.

> 
> Signed-off-by: Pavel Machek <pavel@suse.cz>
> 
> diff --git a/drivers/mtd/chips/sharp.c b/drivers/mtd/chips/sharp.c
> --- a/drivers/mtd/chips/sharp.c
> +++ b/drivers/mtd/chips/sharp.c
> @@ -4,7 +4,7 @@
>   * Copyright 2000,2001 David A. Schleef <ds@schleef.org>
>   *           2000,2001 Lineo, Inc.
>   *
> - * $Id: sharp.c,v 1.16 2005/11/07 11:14:23 gleixner Exp $
> + * $Id: sharp.c,v 1.14 2004/08/09 13:19:43 dwmw2 Exp $
>   *
>   * Devices supported:
>   *   LH28F016SCT Symmetrical block flash memory, 2Mx8
> @@ -32,7 +32,6 @@
>  #include <linux/mtd/cfi.h>
>  #include <linux/delay.h>
>  #include <linux/init.h>
> -#include <linux/slab.h>
>  
>  #define CMD_RESET		0xffffffff
>  #define CMD_READ_ID		0x90909090
> @@ -234,7 +233,7 @@ static int sharp_probe_map(struct map_in
>  /* This function returns with the chip->mutex lock held. */
>  static int sharp_wait(struct map_info *map, struct flchip *chip)
>  {
> -	int status, i;
> +	__u32 status;
>  	unsigned long timeo = jiffies + HZ;
>  	DECLARE_WAITQUEUE(wait, current);
>  	int adr = 0;
> @@ -247,11 +246,13 @@ retry:
>  		map_write32(map, CMD_READ_STATUS, adr);
>  		chip->state = FL_STATUS;
>  	case FL_STATUS:
> -		for(i=0;i<100;i++){
> -			status = map_read32(map,adr);
> -			if((status & SR_READY)==SR_READY)
> -				break;
> -			udelay(1);
> +		status = map_read32(map,adr);
> +		if ((status & SR_READY) == SR_READY)
> +			break;
> +		spin_unlock_bh(chip->mutex);
> +		if (time_after(jiffies, timeo)) {
> +			printk("Waiting for chip to be ready timed out in erase\n");
> +			return -EIO;
>  		}
>  		sharp_udelay(1);
>  		goto retry;
> @@ -491,11 +492,7 @@ static inline int sharp_do_wait_for_read
>  		spin_lock_bh(chip->mutex);
>  
>  		remove_wait_queue(&chip->wq, &wait);
> -
> -		if (signal_pending(current)){
> -			ret = -EINTR;
> -			goto out;
> -		}
> +		set_current_state(TASK_RUNNING);
>  	}
>  	ret = -ETIME;
>  out:
> 
> 
> 


-- 
Todd

  parent reply	other threads:[~2005-11-10  2:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-09 22:17 latest mtd changes broke collie Pavel Machek
2005-11-10  0:19 ` Josh Boyer
2005-11-10  9:48   ` Pavel Machek
2005-11-10  2:59 ` Todd Poynor [this message]
2005-11-10  9:50   ` Pavel Machek
2005-11-10 10:02     ` David Woodhouse
2005-11-10 10:38       ` Pavel Machek
2005-11-10 10:51         ` David Woodhouse
2005-11-10 10:59           ` Pavel Machek
2005-11-10 11:11             ` David Woodhouse
2005-11-10 11:44               ` Pavel Machek
2005-11-10 12:07               ` Pavel Machek
2005-11-10 13:02                 ` David Vrabel
2005-11-10 13:09                   ` Pavel Machek
2005-11-10 17:41                     ` Richard Purdie
2005-11-10 18:09                       ` Richard Purdie
2005-11-10 22:06                         ` Pavel Machek
2005-11-10 22:41               ` Pavel Machek
2005-11-10 23:58                 ` Todd Poynor
2005-11-11  0:16                   ` Pavel Machek
2005-11-11  7:01                     ` Ian Campbell
2005-11-12 21:33                       ` Pavel Machek
2005-11-13 10:35                         ` Ian Campbell
2005-11-14 12:10                           ` Pavel Machek
2005-11-13 19:40                         ` Todd Poynor
2005-11-14 12:08                           ` Pavel Machek

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=4372B7A8.5060904@mvista.com \
    --to=tpoynor@mvista.com \
    --cc=akpm@osdl.org \
    --cc=dwmw2@infradead.org \
    --cc=lenz@cs.wisc.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rmk@arm.linux.org.uk \
    --cc=rpurdie@rpsys.net \
    /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