Skip to contentSkip to conversation

2.6.x libata updates

PATCH New Jeff Garzik 1 participant 1 message Oct 19, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.6.x libata updates

Today's libata updates. Fun stuff:
* AHCI driver (finally a nice, clean, open piece of h/w)
* Bart gets ATAPI working, which is a big step towards libata being able to be useful for users with PATA.

Please do a

bk pull bk://gkernel.bkbits.net/libata-2.6

This will update the following files:

 drivers/scsi/Kconfig       |    8 
 drivers/scsi/Makefile      |    1 
 drivers/scsi/ahci.c        | 1023 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/scsi/libata-core.c |  204 +++++++-
 drivers/scsi/libata-scsi.c |   12 
 drivers/scsi/sata_vsc.c    |    8 
 include/linux/libata.h     |    4 
 7 files changed, 1217 insertions(+), 43 deletions(-)

through these ChangeSets:

<[email protected]> (04/10/18 1.2131.12.6)
[PATCH] make ATAPI PIO work

If "BSY=0, DRQ=0" condition happens on ATAPI just complete the command as this condition happens for:
* the end of the PIO transfer (ie. REQUEST_SENSE seems to return only 18 of 96 requested bytes)
* unsupported ATAPI commands (ie. REPORT_LUNS)

<[email protected]> (04/10/18 1.2131.12.5)
[PATCH] arbitrary size ATAPI PIO support bugfixes

* sg was incorrectly used instead of qc->sg in __atapi_pio_bytes()
* due to obvious typo qc->curbytes wasn't zeroed in ata_qc_new_init()

<[email protected]> (04/10/15 1.2131.12.4)
[libata] arbitrary size ATAPI PIO support

<[email protected]> (04/10/15 1.2131.12.3)
[PATCH] REQUEST_SENSE support for ATAPI

It is quite different from your patch:
* uses ata_qc_issue()
* supports both DMA and PIO
* ->sense_buffer[] mangling dropped for now

Now libata works with ATAPI devices (yeah!)... ...unless PIO is used, then it fails in mysterious way.

<[email protected]> (04/10/15 1.2131.11.1)
[PATCH] per-port LED control for sata_vsc

<[email protected]> (04/10/15 1.2131.1.39)
[libata ahci] more updates

* allocate DMA areas in better order
* remove unneeded hooks

<[email protected]> (04/10/15 1.2131.1.38)
[libata ahci] fix several bugs

* PCI IDs from test version didn't make it into mainline... doh
* do all command setup in ->qc_prep
* phy_reset routine that does signature check
* check SATA phy for errors
* reset hardware from scratch, in case card BIOS didn't run
* implement staggered spinup by default
* adding additional debugging output

<[email protected]> (04/10/15 1.2131.1.37)
[libata] add AHCI driver

drivers/scsi/Kconfig +8 -0
diff -Nru a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
@@ -406,6 +406,14 @@
 
 	  If unsure, say N.
 
+config SCSI_SATA_AHCI
+	tristate "AHCI SATA support"
+	depends on SCSI_SATA && PCI && EXPERIMENTAL
+	help
+	  This option enables support for AHCI Serial ATA.
+
+	  If unsure, say N.
+
 config SCSI_SATA_SVW
 	tristate "ServerWorks Frodo / Apple K2 SATA support (EXPERIMENTAL)"
 	depends on SCSI_SATA && PCI && EXPERIMENTAL
drivers/scsi/Makefile +1 -0
diff -Nru a/drivers/scsi/Makefile b/drivers/scsi/Makefile
@@ -121,6 +121,7 @@
 obj-$(CONFIG_SCSI_NSP32)	+= nsp32.o
 obj-$(CONFIG_SCSI_IPR)		+= ipr.o
 obj-$(CONFIG_SCSI_IBMVSCSI)	+= ibmvscsi/
+obj-$(CONFIG_SCSI_SATA_AHCI)	+= libata.o ahci.o
 obj-$(CONFIG_SCSI_SATA_SVW)	+= libata.o sata_svw.o
 obj-$(CONFIG_SCSI_ATA_PIIX)	+= libata.o ata_piix.o
 obj-$(CONFIG_SCSI_SATA_PROMISE)	+= libata.o sata_promise.o
drivers/scsi/ahci.c new file +1023 -0

1,023 lines not on this page · raw message

drivers/scsi/libata-core.c +163 -41

287 lines not on this page · raw message

drivers/scsi/libata-scsi.c +10 -2
diff -Nru a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
@@ -1248,9 +1248,15 @@
 {
 	struct scsi_cmnd *cmd = qc->scsicmd;
 
-	if (unlikely(drv_stat & (ATA_ERR | ATA_BUSY | ATA_DRQ)))
+	if (unlikely(drv_stat & (ATA_ERR | ATA_BUSY | ATA_DRQ))) {
+		DPRINTK("request check condition\n");
+
 		cmd->result = SAM_STAT_CHECK_CONDITION;
-	else {
+
+		qc->scsidone(cmd);
+
+		return 1;
+	} else {
 		u8 *scsicmd = cmd->cmnd;
 
 		if (scsicmd[0] == INQUIRY) {
@@ -1321,6 +1327,8 @@
 			qc->tf.feature |= ATAPI_DMADIR;
 #endif
 	}
+
+	qc->nbytes = cmd->bufflen;
 
 	return 0;
 }
drivers/scsi/sata_vsc.c +8 -0
diff -Nru a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c
@@ -333,6 +333,14 @@
 
 	pci_set_master(pdev);
 
+	/* 
+	 * Config offset 0x98 is "Extended Control and Status Register 0"
+	 * Default value is (1 << 28).  All bits except bit 28 are reserved in
+	 * DPA mode.  If bit 28 is set, LED 0 reflects all ports' activity.
+	 * If bit 28 is clear, each port has its own LED.
+	 */
+	pci_write_config_dword(pdev, 0x98, 0);
+
 	/* FIXME: check ata_device_add return value */
 	ata_device_add(probe_ent);
 	kfree(probe_ent);
include/linux/libata.h +4 -0
diff -Nru a/include/linux/libata.h b/include/linux/libata.h
@@ -230,6 +230,10 @@
 
 	unsigned int		nsect;
 	unsigned int		cursect;
+
+	unsigned int		nbytes;
+	unsigned int		curbytes;
+
 	unsigned int		cursg;
 	unsigned int		cursg_ofs;