All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>
To: Jan Niehusmann <jan@gondor.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Oops in usb-storage.c
Date: Tue, 16 Oct 2001 18:32:43 -0700	[thread overview]
Message-ID: <20011016183243.B18541@one-eyed-alien.net> (raw)
In-Reply-To: <20011017005822.A2161@gondor.com> <20011016175640.A18541@one-eyed-alien.net> <20011017031113.A3072@gondor.com>
In-Reply-To: <20011017031113.A3072@gondor.com>; from jan@gondor.com on Wed, Oct 17, 2001 at 03:11:13AM +0200

[-- Attachment #1: Type: text/plain, Size: 2592 bytes --]

No, I think something different is best.

Your first change to push the US_FL_FIX_INQUIRY code down after the test
for pusb_dev is good.. but, in the case where that pointer is bad, we need
to cook up something totally fake, like INQUIRY data that says
"DISCONNECTED" "USB-STORAGE DEVICE" or somesuch.....

Matt

On Wed, Oct 17, 2001 at 03:11:13AM +0200, Jan Niehusmann wrote:
> On Tue, Oct 16, 2001 at 05:56:40PM -0700, Matthew Dharm wrote:
> > Actually, this is a side-effect of another problem, which is that INQUIRY
> > is legal for a device at any time (at least, to SCSI).  What we really need
> > to do is fake an INQURIY response for detached devices, separate from also
> > those devices which need a faked-inquiry all the time.
> 
> Ok, then the fix could look like the following, I think. The INQUIRY
> response in the disconnected case is a little bit different, as the
> information from pusb_dev is not available, but the INQUIRY works and
> the oops is fixed.
> 
> Jan
> 
> 
> --- linux-2.4.12-ac3/drivers/usb/storage/usb.c.orig	Mon Oct  1 12:15:29 2001
> +++ linux-2.4.12-ac3/drivers/usb/storage/usb.c	Wed Oct 17 03:04:32 2001
> @@ -268,10 +268,12 @@
>  	memcpy(data+16, us->unusual_dev->productName, 
>  		strlen(us->unusual_dev->productName) > 16 ? 16 :
>  		strlen(us->unusual_dev->productName));
> -	data[32] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>12) & 0x0F);
> -	data[33] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>8) & 0x0F);
> -	data[34] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>4) & 0x0F);
> -	data[35] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice) & 0x0F);
> +	if(us->pusb_dev) {
> +		data[32] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>12) & 0x0F);
> +		data[33] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>8) & 0x0F);
> +		data[34] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>4) & 0x0F);
> +		data[35] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice) & 0x0F);
> +	}
>  
>  	if (us->srb->use_sg) {
>  		sg = (struct scatterlist *)us->srb->request_buffer;
> 
> 
> 
> -
> 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/

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

It's not that hard.  No matter what the problem is, tell the customer 
to reinstall Windows.
					-- Nurse
User Friendly, 3/22/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

  reply	other threads:[~2001-10-17  1:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-16 22:58 [PATCH] Oops in usb-storage.c Jan Niehusmann
2001-10-17  0:56 ` Matthew Dharm
2001-10-17  1:11   ` Jan Niehusmann
2001-10-17  1:32     ` Matthew Dharm [this message]
2001-10-17  1:44       ` Jan Niehusmann
2001-10-17  6:24         ` Matthew Dharm
2001-10-17 10:42           ` Jan Niehusmann
2001-10-17 19:15             ` Matthew Dharm
2001-10-17 21:03               ` Jan Niehusmann
2001-10-18 19:06               ` Jan Niehusmann

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=20011016183243.B18541@one-eyed-alien.net \
    --to=mdharm-kernel@one-eyed-alien.net \
    --cc=jan@gondor.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.