Subject: Re: CVS commit: src/sys/dev/scsipi
To: Christos Zoulas <christos@netbsd.org>
From: None <khym@azeotrope.org>
List: source-changes
Date: 11/30/2006 20:46:10
On Thu, Nov 30, 2006 at 04:23:21PM +0000, Christos Zoulas wrote:
> 
> Module Name:	src
> Committed By:	christos
> Date:		Thu Nov 30 16:23:21 UTC 2006
> 
> Modified Files:
> 	src/sys/dev/scsipi: scsipi_all.h scsipi_cd.h scsipi_disk.h
> 
> Log Message:
> PR/34202: Dave Huang: Accessing cd device on alpha causes kernel trap
> 
> From the PR:
>   Since struct scsipi_read_discinfo_data is an odd number of bytes long
>   (35 bytes), ti ends up being unaligned. wdc_datain_pio() uses
>   bus_space_read_multi_4() to read the response from the drive, and
>   since ti is unaligned, it causes an unaligned access fault.
> 
> Add __aligned__(4) to all the structures.

Uh oh... I wonder if maybe putting it on all the structures wasn't such
a good idea after all... while the ATA/ATAPI devices seem OK, SCSI seems
broken now:

esiop0 at pci0 dev 6 function 0: Symbios Logic 53c875 (ultra-wide scsi)
esiop0: using on-board RAM
esiop0: interrupting at eb164 irq 0
scsibus0 at esiop0: 16 targets, 8 luns per target
[ ... ]
scsibus0: waiting 2 seconds for devices to settle...
esiop0: unexpected phase mismatch 1
esiop0: unhandled scsi interrupt, sist=0xc0 sstat1=0x9 DSA=0x401ce000 DSP=0x580
wd0 at atabus0 drive 0: <MAXTOR 6L080J4>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 76345 MB, 155114 cyl, 16 head, 63 sec, 512 bytes/sect x 156355584 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd0(pdcide0:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)
atapibus0 at atabus2: 2 targets
cd0 at atapibus0 drive 0: <DVD-RW IDE1008, , VER 006> cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
cd0(cmdide0:0:0): using PIO mode 4, DMA mode 2 (using DMA)
probe(esiop0:0:1:0): command timeout, CDB: 0x12 00 00 00 24 00
esiop0: scsi bus reset
probe(esiop0:0:1:0): command with tag id -1 reset
esiop0: unexpected phase mismatch 1
esiop0: unhandled scsi interrupt, sist=0xc0 sstat1=0x9 DSA=0x401ce2c0 DSP=0x580
probe(esiop0:0:5:0): command timeout, CDB: 0x12 00 00 00 24 00
esiop0: scsi bus reset
probe(esiop0:0:5:0): command with tag id -1 reset
WARNING: can't figure what device matches "SCSI 0 6 0 0 0 0 0"
root device: halt
syncing disks... done
unmounting file systems... done
halted.

What it should show is:

scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 0 lun 0: <FUJITSU, MAS3184NC, 0104> disk fixed
sd0: 17524 MB, 27206 cyl, 2 head, 659 sec, 512 bytes/sect x 35890512 sectors
sd0: sync (50.00ns offset 16), 16-bit (40.000MB/s) transfers, tagged queueing
cd0 at scsibus0 target 4 lun 0: <PLEXTOR, CD-R   PX-R412C, 1.07> cdrom removable
cd0: sync (100.00ns offset 8), 8-bit (10.000MB/s) transfers
wd0 at atabus0 drive 0: <MAXTOR 6L080J4>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 76345 MB, 155114 cyl, 16 head, 63 sec, 512 bytes/sect x 156355584 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd0(pdcide0:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)
atapibus0 at atabus2: 2 targets
cd1 at atapibus0 drive 0: <DVD-RW IDE1008, , VER 006> cdrom removable
cd1: 32-bit data port
cd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
cd1(cmdide0:0:0): using PIO mode 4, DMA mode 2 (using DMA)
root on sd0a dumps on sd0b
root file system type: ffs