[patch 0/3] Asynchronous Notification for SATA ATAPI devices

2007-03-28 Thread Kristen Carlson Accardi
This patch series implements Asynchronous Notification (AN) for SATA ATAPI
devices as defined in SATA 2.5 and AHCI 1.1.  Drives which support this
feature will send a notification when new media is inserted into the
drive, preventing the need for user space to poll for new media.  This
support is exposed to user space via a file in sysfs (/sys/block/sr*)
called "media_change_events".  If the drive supports AN, this file will
read 1, otherwise 0.  User space can disable polling for new media if this
file reads 1.  When new media is inserted into the ATAPI drive, the ahci
driver will send a KOBJ_CHANGE event.

I would really like feedback on the user interface - both the location
of the sysfs file which indicates AN support, as well as the type of
uevent etc.  I have not yet tested AN on eject (I assume it doesn't require
anything special) as my test drive which supports AN is a bit "quirky" in 
this respect.  Please take a look and let me know what you think.

Thanks,
Kristen

-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: SATA/ATAPI

2005-04-22 Thread Tais M. Hansen
On Friday 22 April 2005 13:14, Wakko Warner wrote:
> > One of my linux boxes has a Plextor DVD-RW drive with a SATA interface.
> > The kernel sees this drive (ata3) but apparently doesn't tie it to a sdx
> > device. The box also have a SATA harddisk, which is working just fine.
> > The relevant dmesg output is pasted below.
> I thought all SCSI cdroms were using /dev/scdx or /dev/srx.  Atleast all
> mine are (I use ide-scsi for ide disks)

You thought right. The "/dev/sdx" was just a typo on my side.

-- 
Regards,
Tais M. Hansen
OSD

___
"If people had understood how patents would be granted when most of today's 
ideas were invented and had taken out patents, the industry would be at a 
complete standstill today." -Bill Gates (1991)


pgpm8QwR40TEj.pgp
Description: PGP signature


Re: SATA/ATAPI

2005-04-22 Thread Wakko Warner
Tais M. Hansen wrote:
> I know there has been some talking about SATA/ATAPI being experimental and 
> might not work at all under kernel-2.6.x.
> 
> One of my linux boxes has a Plextor DVD-RW drive with a SATA interface. The 
> kernel sees this drive (ata3) but apparently doesn't tie it to a sdx device. 
> The box also have a SATA harddisk, which is working just fine. The relevant 
> dmesg output is pasted below.
> 
> Is there anything I can do to help the development of SATA/ATAPI devices?

I thought all SCSI cdroms were using /dev/scdx or /dev/srx.  Atleast all
mine are (I use ide-scsi for ide disks)

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: SATA/ATAPI

2005-04-22 Thread Tais M. Hansen
On Friday 22 April 2005 01:51, Brian Jackson wrote:
> > One of my linux boxes has a Plextor DVD-RW drive with a SATA interface.
> > The kernel sees this drive (ata3) but apparently doesn't tie it to a sdx
> > device. The box also have a SATA harddisk, which is working just fine.
> > The relevant dmesg output is pasted below.
> Just to check, you do have scsi cdrom support enabled right?

Yes. cdrom and sr_mod are both loaded as modules. I'm assuming having compiled 
them as modules doesn't change anything. I'm probably going to try messing 
with the SCSI cdrom driver, just to see if I can figure out what's going on.

-- 
Regards,
Tais M. Hansen
OSD

___
"If people had understood how patents would be granted when most of today's 
ideas were invented and had taken out patents, the industry would be at a 
complete standstill today." -Bill Gates (1991)


pgpfsRwjrqXR4.pgp
Description: PGP signature


Re: SATA/ATAPI

2005-04-21 Thread Brian Jackson
Just to check, you do have scsi cdrom support enabled right?

On 4/21/05, Tais M. Hansen <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I know there has been some talking about SATA/ATAPI being experimental and
> might not work at all under kernel-2.6.x.
> 
> One of my linux boxes has a Plextor DVD-RW drive with a SATA interface. The
> kernel sees this drive (ata3) but apparently doesn't tie it to a sdx device.
> The box also have a SATA harddisk, which is working just fine. The relevant
> dmesg output is pasted below.
> 
> Is there anything I can do to help the development of SATA/ATAPI devices?
> 
> libata version 1.10 loaded.
> sata_promise version 1.01
> ACPI: PCI interrupt :00:08.0[A] -> GSI 18 (level, low) -> IRQ 18
> ata1: SATA max UDMA/133 cmd 0xF8804200 ctl 0xF8804238 bmdma 0x0 irq 18
> ata2: SATA max UDMA/133 cmd 0xF8804280 ctl 0xF88042B8 bmdma 0x0 irq 18
> ata1: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01 87:4003
> 88:407f
> ata1: dev 0 ATA, max UDMA/133, 240121728 sectors:
> ata1: dev 0 configured for UDMA/133
> scsi0 : sata_promise
> ata2: no device found (phy stat )
> scsi1 : sata_promise
>   Vendor: ATA   Model: Maxtor 6Y120M0Rev: YAR5
>   Type:   Direct-Access  ANSI SCSI revision: 05
> sata_via version 1.1
> ACPI: PCI interrupt :00:0f.0[B] -> GSI 20 (level, low) -> IRQ 20
> sata_via(:00:0f.0): routed to hard irq line 4
> ata3: SATA max UDMA/133 cmd 0xE800 ctl 0xE402 bmdma 0xD400 irq 20
> ata4: SATA max UDMA/133 cmd 0xE000 ctl 0xD802 bmdma 0xD408 irq 20
> ata3: dev 0 cfg 49:0f00 82: 83: 84: 85: 86: 87:
> 88:0007
> ata3: dev 0 ATAPI, max UDMA/33
> ata3: dev 0 configured for UDMA/33
> scsi2 : sata_via
> ata4: no device found (phy stat )
> scsi3 : sata_via
> SCSI device sda: 240121728 512-byte hdwr sectors (122942 MB)
> SCSI device sda: drive cache: write back
> SCSI device sda: 240121728 512-byte hdwr sectors (122942 MB)
> SCSI device sda: drive cache: write back
>  sda: sda1 sda2 sda3 < sda5 sda6 sda7 >
> Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
> 
> --
> Regards,
> Tais M. Hansen
> OSD
> 
> ___
> "If people had understood how patents would be granted when most of today's
> ideas were invented and had taken out patents, the industry would be at a
> complete standstill today." -Bill Gates (1991)
> 
> 
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


SATA/ATAPI

2005-04-21 Thread Tais M. Hansen
Hi,

I know there has been some talking about SATA/ATAPI being experimental and 
might not work at all under kernel-2.6.x.

One of my linux boxes has a Plextor DVD-RW drive with a SATA interface. The 
kernel sees this drive (ata3) but apparently doesn't tie it to a sdx device. 
The box also have a SATA harddisk, which is working just fine. The relevant 
dmesg output is pasted below.

Is there anything I can do to help the development of SATA/ATAPI devices?



libata version 1.10 loaded.
sata_promise version 1.01
ACPI: PCI interrupt :00:08.0[A] -> GSI 18 (level, low) -> IRQ 18
ata1: SATA max UDMA/133 cmd 0xF8804200 ctl 0xF8804238 bmdma 0x0 irq 18
ata2: SATA max UDMA/133 cmd 0xF8804280 ctl 0xF88042B8 bmdma 0x0 irq 18
ata1: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01 87:4003 
88:407f
ata1: dev 0 ATA, max UDMA/133, 240121728 sectors:
ata1: dev 0 configured for UDMA/133
scsi0 : sata_promise
ata2: no device found (phy stat )
scsi1 : sata_promise
  Vendor: ATA   Model: Maxtor 6Y120M0Rev: YAR5
  Type:   Direct-Access  ANSI SCSI revision: 05
sata_via version 1.1
ACPI: PCI interrupt :00:0f.0[B] -> GSI 20 (level, low) -> IRQ 20
sata_via(:00:0f.0): routed to hard irq line 4
ata3: SATA max UDMA/133 cmd 0xE800 ctl 0xE402 bmdma 0xD400 irq 20
ata4: SATA max UDMA/133 cmd 0xE000 ctl 0xD802 bmdma 0xD408 irq 20
ata3: dev 0 cfg 49:0f00 82: 83: 84: 85: 86: 87: 
88:0007
ata3: dev 0 ATAPI, max UDMA/33
ata3: dev 0 configured for UDMA/33
scsi2 : sata_via
ata4: no device found (phy stat )
scsi3 : sata_via
SCSI device sda: 240121728 512-byte hdwr sectors (122942 MB)
SCSI device sda: drive cache: write back
SCSI device sda: 240121728 512-byte hdwr sectors (122942 MB)
SCSI device sda: drive cache: write back
 sda: sda1 sda2 sda3 < sda5 sda6 sda7 >
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0

-- 
Regards,
Tais M. Hansen
OSD

___
"If people had understood how patents would be granted when most of today's 
ideas were invented and had taken out patents, the industry would be at a 
complete standstill today." -Bill Gates (1991)


pgp2lSFQp2sGj.pgp
Description: PGP signature


Re: Banging my head on SATA / ATAPI DMA problem. Help?

2005-01-27 Thread Jeff Garzik
Rick Bressler wrote:
ata_piix version 1.03
ata_piix: combined mode detected

Combined mode == DMA impossible.
Jeff
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Banging my head on SATA / ATAPI DMA problem. Help?

2005-01-26 Thread Lennart Sorensen
On Tue, Jan 25, 2005 at 07:57:58PM -0800, Rick Bressler wrote:
> I've played with a lot of hardware since the Linux 1.0.9 days but not
> yet run into something quite like this.  Alan has been talking a lot
> lately about ATA/SATA patches, and while I mostly lurk on this list,
> thought this one might be interesting enough for somebody to give me
> some advice.
> 
> A friend of mine won an IBM 8482-2RU at Linux World last year and he is
> trying to get it working with a 2.6.x kernel.
> 
> The problem I'm unable to resolve is that his primary drive, a Seagate
> ST3160023AS (SATA) works fine in DMA mode, but whenever it is plugged
> in, he can't get his PLEXTOR PX-716A DVD/CD-RW (PATA) to come up in DMA
> mode.  (Works in PIO mode.)
> 
> At first I was wondering if it wasn't a BIOS setting (legacy mode ATA
> etc) but he swears he can't find anything like that in his BIOS.  (He's
> on the latest BIOS that IBM has for the box.)
> 
> He's in California and I'm in Washington so I have to take his word for
> it.
> 
> hdparm says the DVD/CD can do DMA, and in theory is being configured by the
> BIOS
> 
>   DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4
> 
> The kernel doesn't detect it.  It can't be turned on manually with
> hdparm.  If the hard drive is unplugged, I note that it is recognizes
> the CD as as being on an ICH5 chipset, but it doesn't seem to identify
> it as such with the hard drive plugged in.  Odd hardware?  Strange
> hardware detection?  Something subtle in the kernel config that I keep
> missing?  (BLK_DEV_PIIX is turned on.)
> 
> Both drives come up DMA on 2.4.x (no libata). but no 2.6 kernel we've
> tried (2.6.6, 2.6.9, 2.6.10 2.6.10-ac10) seems to be able to manage it.
> 
> I've been working with him for a couple of weeks, but have exhausted my
> luck on Google, list archives etc. and decided it is time to see if
> anybody can give me some ideas on how to proceed.  Maybe it is just
> flakey hardware...
> 
> Any help, pointers or suggestions  that you may care to offer would be
> appreciated.
> 
> I monitor the list (in nightly batch mode) so feel free to reply any way
> you like, list or email...
> 
> Thanks in advance.
> 
> His PCI layout:
> 
> # lspci
> :00:00.0 Host bridge: Intel Corp. 82875P/E7210 Memory Controller Hub (rev 
> 02)
> :00:03.0 PCI bridge: Intel Corp. 82875P/E7210 Processor to PCI to CSA 
> Bridge (rev 02)
> :00:1c.0 PCI bridge: Intel Corp. 6300ESB 64-bit PCI-X Bridge (rev 02)
> :00:1d.0 USB Controller: Intel Corp. 6300ESB USB Universal Host 
> Controller (rev 02)
> :00:1d.1 USB Controller: Intel Corp. 6300ESB USB Universal Host 
> Controller (rev 02)
> :00:1d.4 System peripheral: Intel Corp. 6300ESB Watchdog Timer (rev 02)
> :00:1d.5 PIC: Intel Corp. 6300ESB I/O Advanced Programmable Interrupt 
> Controller (rev 02)
> :00:1d.7 USB Controller: Intel Corp. 6300ESB USB2 Enhanced Host 
> Controller (rev 02)
> :00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev 0a)
> :00:1f.0 ISA bridge: Intel Corp. 6300ESB LPC Interface Controller (rev 02)
> :00:1f.2 IDE interface: Intel Corp. 6300ESB SATA Storage Controller (rev 
> 02)
> :00:1f.3 SMBus: Intel Corp. 6300ESB SMBus Controller (rev 02)
> :02:01.0 Ethernet controller: Intel Corp. 82547GI Gigabit Ethernet 
> Controller
> :03:04.0 SCSI storage controller: Adaptec AIC-7901 U320 (rev 10)
> :04:02.0 VGA compatible controller: ATI Technologies Inc Radeon RV100 QY 
> [Radeon 7000/VE]
> :04:08.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 
> 10)
> 
> A boot from a Knoppix CD with the hard drive unplugged yielded a working
> DMA enabled CDROM with a 2.6.9 kernel.
> 
> ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
> ICH5: IDE controller at PCI slot :00:1f.1
> ACPI: PCI interrupt :00:1f.1[A] -> GSI 18 (level, low) -> IRQ 18
> ICH5: chipset revision 2
> ICH5: not 100% native mode: will probe irqs later
> ide0: BM-DMA at 0x1460-0x1467, BIOS settings: hda:DMA, hdb:pio
> ide1: BM-DMA at 0x1468-0x146f, BIOS settings: hdc:pio, hdd:pio
> Probing IDE interface ide0...
> hda: PLEXTOR DVDR PX-716A, ATAPI CD/DVD-ROM drive

Above the piix drive was loaded and took care of the IDE channel.

> Bits of dmesg for the failure case:
> 
> No DMA on CD-ROM with hd plugged in
> 
> Probing IDE interface ide0...
> hda: PLEXTOR DVDR PX-716A, ATAPI CD/DVD-ROM drive
> ide1: I/O resource 0x170-0x177 not free.
> ide1: ports already in use, skipping probe
> ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
> hda: ATAPI 40X DVD-ROM DVD-R CD-R/RW drive, 8192kB Cache
> Uniform CD-ROM driver Revision: 3.20

This looks like ide-generic which doesn't do DMA since it isn't chipset
specific.  Make SURE you load the piix driver for the PATA channels, and
don't let the system auto load ide-generic when you try to access the
CD.  On debian I add these lines to /etc/modules to ensure they are
loaded in that order early in boot:

piix
ide-generic
ide-cd

W

Banging my head on SATA / ATAPI DMA problem. Help?

2005-01-25 Thread Rick Bressler
I've played with a lot of hardware since the Linux 1.0.9 days but not
yet run into something quite like this.  Alan has been talking a lot
lately about ATA/SATA patches, and while I mostly lurk on this list,
thought this one might be interesting enough for somebody to give me
some advice.

A friend of mine won an IBM 8482-2RU at Linux World last year and he is
trying to get it working with a 2.6.x kernel.

The problem I'm unable to resolve is that his primary drive, a Seagate
ST3160023AS (SATA) works fine in DMA mode, but whenever it is plugged
in, he can't get his PLEXTOR PX-716A DVD/CD-RW (PATA) to come up in DMA
mode.  (Works in PIO mode.)

At first I was wondering if it wasn't a BIOS setting (legacy mode ATA
etc) but he swears he can't find anything like that in his BIOS.  (He's
on the latest BIOS that IBM has for the box.)

He's in California and I'm in Washington so I have to take his word for
it.

hdparm says the DVD/CD can do DMA, and in theory is being configured by the
BIOS

DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4

The kernel doesn't detect it.  It can't be turned on manually with
hdparm.  If the hard drive is unplugged, I note that it is recognizes
the CD as as being on an ICH5 chipset, but it doesn't seem to identify
it as such with the hard drive plugged in.  Odd hardware?  Strange
hardware detection?  Something subtle in the kernel config that I keep
missing?  (BLK_DEV_PIIX is turned on.)

Both drives come up DMA on 2.4.x (no libata). but no 2.6 kernel we've
tried (2.6.6, 2.6.9, 2.6.10 2.6.10-ac10) seems to be able to manage it.

I've been working with him for a couple of weeks, but have exhausted my
luck on Google, list archives etc. and decided it is time to see if
anybody can give me some ideas on how to proceed.  Maybe it is just
flakey hardware...

Any help, pointers or suggestions  that you may care to offer would be
appreciated.

I monitor the list (in nightly batch mode) so feel free to reply any way
you like, list or email...

Thanks in advance.

His PCI layout:

# lspci
:00:00.0 Host bridge: Intel Corp. 82875P/E7210 Memory Controller Hub (rev 
02)
:00:03.0 PCI bridge: Intel Corp. 82875P/E7210 Processor to PCI to CSA 
Bridge (rev 02)
:00:1c.0 PCI bridge: Intel Corp. 6300ESB 64-bit PCI-X Bridge (rev 02)
:00:1d.0 USB Controller: Intel Corp. 6300ESB USB Universal Host Controller 
(rev 02)
:00:1d.1 USB Controller: Intel Corp. 6300ESB USB Universal Host Controller 
(rev 02)
:00:1d.4 System peripheral: Intel Corp. 6300ESB Watchdog Timer (rev 02)
:00:1d.5 PIC: Intel Corp. 6300ESB I/O Advanced Programmable Interrupt 
Controller (rev 02)
:00:1d.7 USB Controller: Intel Corp. 6300ESB USB2 Enhanced Host Controller 
(rev 02)
:00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev 0a)
:00:1f.0 ISA bridge: Intel Corp. 6300ESB LPC Interface Controller (rev 02)
:00:1f.2 IDE interface: Intel Corp. 6300ESB SATA Storage Controller (rev 02)
:00:1f.3 SMBus: Intel Corp. 6300ESB SMBus Controller (rev 02)
:02:01.0 Ethernet controller: Intel Corp. 82547GI Gigabit Ethernet 
Controller
:03:04.0 SCSI storage controller: Adaptec AIC-7901 U320 (rev 10)
:04:02.0 VGA compatible controller: ATI Technologies Inc Radeon RV100 QY 
[Radeon 7000/VE]
:04:08.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 
10)

A boot from a Knoppix CD with the hard drive unplugged yielded a working
DMA enabled CDROM with a 2.6.9 kernel.

ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ICH5: IDE controller at PCI slot :00:1f.1
ACPI: PCI interrupt :00:1f.1[A] -> GSI 18 (level, low) -> IRQ 18
ICH5: chipset revision 2
ICH5: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0x1460-0x1467, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0x1468-0x146f, BIOS settings: hdc:pio, hdd:pio
Probing IDE interface ide0...
hda: PLEXTOR DVDR PX-716A, ATAPI CD/DVD-ROM drive

Bits of dmesg for the failure case:

No DMA on CD-ROM with hd plugged in

Probing IDE interface ide0...
hda: PLEXTOR DVDR PX-716A, ATAPI CD/DVD-ROM drive
ide1: I/O resource 0x170-0x177 not free.
ide1: ports already in use, skipping probe
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: ATAPI 40X DVD-ROM DVD-R CD-R/RW drive, 8192kB Cache
Uniform CD-ROM driver Revision: 3.20

The SATA drive comes up fine.

libata version 1.10 loaded.
ata_piix version 1.03
ata_piix: combined mode detected
ACPI: PCI interrupt :00:1f.2[A] -> GSI 18 (level, low) -> IRQ 18
ata: 0x1f0 IDE port busy
PCI: Setting latency timer of device :00:1f.2 to 64
ata1: SATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0x1478 irq 15
ata1: dev 0 cfg 49:2f00 82:346b 83:7d01 84:4003 85:3469 86:3c01 87:4003 88:207f
ata1: dev 0 ATA, max UDMA/133, 312581808 sectors: lba48
ata1: dev 0 configured for UDMA/133
scsi0 : ata_piix
  Vendor: ATA   Model: ST3160023AS   Rev: 3.18
  Type:   Direct-Access  ANSI SCSI revision: 05
SCSI device sda: 312581808 512-byte hdw