[Orinoco-devel] 2.6.28-rc2: new PCMCIA device instance after resume - orinoco can't download firmware

Andrey Borzenkov arvidjaar at mail.ru
Thu Oct 30 14:39:36 EDT 2008


On Thursday 30 October 2008, Dave wrote:
> After much faffing about, I managed to bisect this. In retrospect the
> above hint (thanks Russell) and a code inspection ought to have made the
> bug obvious. The offending commit is:
> 
> commit 1168386aa7d850ead2ae135d5a7949a592c6e9a0
> pcmcia: deprecate CS_OUT_OF_RESOURCE
> 
> in which the following change is made (among others):
> 
> @@ -352,7 +352,9 @@ int verify_cis_cache(struct pcmcia_socket *s)
> 
>         buf = kmalloc(256, GFP_KERNEL);
>         if (buf == NULL)
> -               return -1;
> +               dev_printk(KERN_WARNING, &s->dev,
> +                          "no memory for verifying CIS\n");
> +               return -ENOMEM;
>         list_for_each_entry(cis, &s->cis_cache, node) {
>                 int len = cis->len;
> 

Oh, my ... I have been looking over this dozens of times ... it just
proves how addictive to bisecting in place of proper debugging we became :(
Dave, thank you!

Rafael, this falls in obvious "regression with patches" case I think.

Tested-by: Andrey Borzenkov <arvidjaar at mail.ru>


> 
> The attached patch should fix things.
> 
> Regards,
> 
> Dave.
> ---
> pcmcia: Actually verify against the cached CIS
> 
> Commit 1168386aa7d850ead2ae135d5a7949a592c6e9a0 introduced a printk into
> a single line if without adding braces, resulting in PCMCIA devices
> being added as new on resume.
> 
> Add the necessary braces.
> 
> Reported by: Andrey Borzenkov <arvidjaar at mail.ru>
> Signed-off by: David Kilroy <kilroyd at gmail.com>
> ---
> diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
> index 8d37768..91a00ec 100644
> --- a/drivers/pcmcia/cistpl.c
> +++ b/drivers/pcmcia/cistpl.c
> @@ -351,10 +351,12 @@ int verify_cis_cache(struct pcmcia_socket *s)
>         char *buf;
> 
>         buf = kmalloc(256, GFP_KERNEL);
> -       if (buf == NULL)
> +       if (buf == NULL) {
>                 dev_printk(KERN_WARNING, &s->dev,
>                            "no memory for verifying CIS\n");
>                 return -ENOMEM;
> +       }
> +
>         list_for_each_entry(cis, &s->cis_cache, node) {
>                 int len = cis->len;
> 
> 
> 
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20081030/fd98d00d/attachment.bin 


More information about the linux-pcmcia mailing list