Subject: Re: kern/18065: i386/1.6RC1 umass crash with "Dazzle" SCM eUSB SmartMedia reader
To: None <tburns@ualberta.ca>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-bugs
Date: 08/25/2002 21:54:26
On Sun, Aug 25, 2002 at 03:29:49PM -0400, tburns@ualberta.ca wrote:
> System: NetBSD hammerfell.dhs.org 1.6_RC1 NetBSD 1.6_RC1 (GENERIC) #0: Tue Aug 20 12:25:05 UTC 2002 autobuild@tgm.daemon.org:/autobuild/i386/OBJ/autobuild/src/sys/arch/i386/compile/GENERIC i386
> Architecture: i386
> Machine: i386
> >Description:
> Attach 64MB SmartMedia card to the computer (either insert while running or
> have inserted when booting) using "Dazzle" SCM eUSB SmartMedia reader.
> 
> Both my cards' size is reported incorrectly (the 8MB card as
> 244MB, and the 64MB card as 15625MB), but only the 64MB card is
> causing the machine to lock up (or just not finish booting).  It
> seems that the geometry detection is messed up.  It's interesting
> to notice that the bytes/sect and sectors counts do add up to the
> correct sizes assuming 512-byte sectors; it's just the total
> size, cyl, and head counts that are fubar (and identical
> regardless of which card I use).
> 
> When I boot with an 8MB SmartMedia card in the device, I get the
> following in dmesg:
> umass0 at uhub0 port 2 configuration 1 interface 0
> umass0: SCM Microsystems Inc. eUSB SmartMedia Reader, rev
> 1.10/5.04, addr 3
> umass0: using SCSI over Bulk-Only
> scsibus0 at umass0: 2 targets, 1 luns per target
> scsibus0: waiting 2 seconds for devices to settle...
> sd0 at scsibus0 target 1 lun 0: <eUSB, SmartMedia, 5.04> SCSI2
> 0/direct removable
> sd0: 244 MB, 131076 cyl, 22 head, 0 sec, 16000 bytes/sect x 16000
> sectors
> warning: double match for boot device (wd0, sd0)
> sd0: no disk label
> 
> However, when I boot with my 64MB card, I get this:
> umass0 at uhub0 port 2 configuration 1 interface 0
> umass0: SCM Microsystems Inc. eUSB SmartMedia Reader, rev 1.10/5.04, addr 3
> umass0: using SCSI over Bulk-Only
> scsibus0 at umass0: 2 targets, 1 luns per target
> scsibus0: waiting 2 seconds for devices to settle...
> sd0 at scsibus  0 target 1 lun 0: <eUSB, SmartMedia, 4.05> SCSI 2 0/direct remov
> eable
> sd0: 15625MB, 131076 cyl, 22 head, 0 sec, 128000 bytes/sect x 128000 sectors
> panic: alloc buf: buffer larger than MAXBSIZE requested
> Stopped in pid 0 (swapper) at cpu_Debugger+0x4: leave

I suspect this is related to the insane bytes/sect returned.
MAXBSIZE is 64k, and only 512 bytes/sect are really supported.
You could hack sd.c to force bytes/sect to 512.
Also note that the size printed by the driver is wrong; however 128000*512
gives 64k. So the number of sectors returned by the device is OK,
only bytes/sect is bad.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
--