Skip to contentSkip to conversation

libata updates

PATCH New Jeff Garzik 1 participant 1 message Jan 25, 2008

Subsystems (7)
SCSI PCI libata SCSI libsas +3 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata updates

Honestly, this is the least interesting merge push I've had in a while. We're all doing debugging and such, so nothing major is below.

I have some queued stuff (notably a sata_mv update) still to come, but this is the stuff that's been pending and in -mm for a while.

Please pull from 'upstream-linus' branch of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git upstream-linus

to receive the following updates:

 drivers/ata/Kconfig             |    9 +
 drivers/ata/Makefile            |    1 +
 drivers/ata/ahci.c              |   72 ++--
 drivers/ata/ata_generic.c       |   51 ++-
 drivers/ata/ata_piix.c          |  393 ++++++++++++++----
 drivers/ata/libata-acpi.c       |  117 ++++--
 drivers/ata/libata-core.c       |  805 ++++++++++++++++------------------
 drivers/ata/libata-eh.c         |  299 ++++++++++---
 drivers/ata/libata-scsi.c       |   40 ++-
 drivers/ata/libata-sff.c        |  199 +++++----
 drivers/ata/libata.h            |    6 +-
 drivers/ata/pata_acpi.c         |   67 +---
 drivers/ata/pata_ali.c          |    2 +-
 drivers/ata/pata_amd.c          |  128 ++++--
 drivers/ata/pata_bf54x.c        |   41 +-
 drivers/ata/pata_cs5520.c       |    2 +-
 drivers/ata/pata_hpt37x.c       |    7 +-
 drivers/ata/pata_icside.c       |    3 +-
 drivers/ata/pata_it821x.c       |   35 ++-
 drivers/ata/pata_ixp4xx_cf.c    |   26 +-
 drivers/ata/pata_legacy.c       |  912 +++++++++++++++++++++++++++++++--------
 drivers/ata/pata_mpc52xx.c      |    2 +-
 drivers/ata/pata_ninja32.c      |  214 +++++++++
 drivers/ata/pata_pcmcia.c       |  101 ++++-
 drivers/ata/pata_pdc2027x.c     |    2 +-
 drivers/ata/pata_pdc202xx_old.c |    5 +-
 drivers/ata/pata_qdi.c          |   30 +-
 drivers/ata/pata_scc.c          |   30 +-
 drivers/ata/pata_serverworks.c  |    9 +-
 drivers/ata/pata_via.c          |    3 +-
 drivers/ata/pata_winbond.c      |   30 +-
 drivers/ata/pdc_adma.c          |    5 +-
 drivers/ata/sata_fsl.c          |    5 +-
 drivers/ata/sata_inic162x.c     |    2 +-
 drivers/ata/sata_mv.c           |    3 +-
 drivers/ata/sata_nv.c           |   25 +-
 drivers/ata/sata_promise.c      |   98 ++---
 drivers/ata/sata_promise.h      |    2 +-
 drivers/ata/sata_qstor.c        |   15 +-
 drivers/ata/sata_sil.c          |   10 +-
 drivers/ata/sata_sil24.c        |   30 +-
 drivers/ata/sata_sx4.c          |   15 +-
 drivers/scsi/ipr.c              |    9 +-
 drivers/scsi/libsas/sas_ata.c   |   14 +-
 include/linux/ata.h             |  110 ++++-
 include/linux/cdrom.h           |    3 +
 include/linux/libata.h          |  184 +++++---
 include/linux/pci_ids.h         |    3 +
 48 files changed, 2851 insertions(+), 1323 deletions(-)
 create mode 100644 drivers/ata/pata_ninja32.c

Al Viro (1):
libata annotations and fixes

Alan Cox (13):
libata: Disable ATA8-ACS proposed Trusted Computing features by default
libata: IORDY handling
libata-sff: tf_load
pata_ninja32: Cardbus ATA initial support
pata_pcmcia: Add support for dumb 8bit IDE emulations libata/pata_it821x: Improve handling of poorly compatible emulations
pata_pcmcia: Minor cleanups and support for dual channel cards
pata_legacy: resychronize with upstream changes and resubmit
pata_mpc52xx: remove un-needed assignment
pata_serverworks: Fix cable types and cosmetics
pata_winbond: error return
ata_generic: Cenatek support
pata_legacy: Merge winbond support

Albert Lee (1):
libata: zero xfer length on ATAPI data xfer IRQ is HSM violation

Andrew Morton (4):
drivers/ata/libata-eh.c: fix printk warning
pata_hpt37x: checkpatch fixes
[libata] pata_winbond: update for new ->data_xfer hook [libata] pata_legacy: typo fix

James Bottomley (1):
[libata] Prefer SCSI_SENSE_BUFFERSIZE to sizeof()

Jeff Garzik (3):
libata: checkpatch fixes
[libata] Build fix WRT ata_is_xxx() new API introduction
libata: make ata_port_queue_task() an internal function

Peter Schwenke (1):
ata_piix: Add Toshiba Satellite R20 and Tecra M6 to broken suspend list.

Shaohua Li (1):
libata-acpi: add ACPI _PSx method

Tejun Heo (40):
ahci: update PCS programming
libata: rearrange ATA_DFLAG_*
libata: implement protocol tests
libata: factor out ata_eh_schedule_probe()
libata: move ata_set_mode() to libata-eh.c
libata: clean up EH speed down implementation
libata: adjust speed down rules
libata: implement ATA_DFLAG_DUBIOUS_XFER
libata: implement fast speed down for unverified data transfer mode
ata_generic: unindent loop in generic_set_mode()
libata: export xfermode / PATA timing related functions
libata: clean up xfermode / PATA timing related stuff
libata: kill ata_id_to_dma_mode()
libata: xfer_mask is unsigned long not unsigned int
libata: add ATA_CBL_PATA_IGN
sata_promise: make pdc_atapi_pkt() use values from qc->tf
ata_piix: separate controller IDs into separate enum
libata: separate out ata_acpi_gtm_xfermask() from pacpi_discover_modes()
libata: fix ata_acpi_gtm_xfermask()
libata: implement ata_timing_cycle2mode() and use it in libata-acpi and pata_acpi
libata: reimplement ata_acpi_cbl_80wire() using ata_acpi_gtm_xfermask()
pata_amd: update mode selection for NV PATAs
libata: convert NCQ test in ata_qc_issue() to ata_is_ncq()
libata: make atapi_request_sense() use sg
cdrom: add more GPCMD_* constants
libata: rename ATA_PROT_ATAPI_* to ATAPI_PROT_*
libata: add ATAPI_* cmd types and implement atapi_cmd_type()
libata: update ->data_xfer hook for ATAPI
libata: kill non-sg DMA interface
libata: change ATA_QCFLAG_DMAMAP semantics
libata: convert to chained sg
libata: make qc->nbytes include extra buffers
ata_piix: kill unused constants and flags
libata: use dev_driver_string() instead of "libata" in libata-sff.c
pata_pcmcia: convert to new data_xfer prototype
libata: factor out ata_pci_activate_sff_host() from ata_pci_one()
ata_piix: convert to prepare - activate initialization
ata_piix: implement SIDPR SCR access
ahci: factor out AHCI enabling and enable AHCI before reading CAP
libata: fix off-by-one in error categorization

[email protected] (2):
[libata] Prefer SCSI_SENSE_BUFFERSIZE to sizeof() fix drivers/ata/sata_fsl.c double-decl

drivers/ata/Kconfig +9 -0
index ba63619..2478cca 100644
@@ -459,6 +459,15 @@ config PATA_NETCELL
 
 	  If unsure, say N.
 
+config PATA_NINJA32
+	tristate "Ninja32/Delkin Cardbus ATA support (Experimental)"
+	depends on PCI && EXPERIMENTAL
+	help
+	  This option enables support for the Ninja32, Delkin and
+	  possibly other brands of Cardbus ATA adapter
+
+	  If unsure, say N.
+
 config PATA_NS87410
 	tristate "Nat Semi NS87410 PATA support (Experimental)"
 	depends on PCI && EXPERIMENTAL
drivers/ata/Makefile +1 -0
index b13feb2..82550c1 100644
@@ -41,6 +41,7 @@ obj-$(CONFIG_PATA_IT821X)	+= pata_it821x.o
 obj-$(CONFIG_PATA_IT8213)	+= pata_it8213.o
 obj-$(CONFIG_PATA_JMICRON)	+= pata_jmicron.o
 obj-$(CONFIG_PATA_NETCELL)	+= pata_netcell.o
+obj-$(CONFIG_PATA_NINJA32)	+= pata_ninja32.o
 obj-$(CONFIG_PATA_NS87410)	+= pata_ns87410.o
 obj-$(CONFIG_PATA_NS87415)	+= pata_ns87415.o
 obj-$(CONFIG_PATA_OPTI)		+= pata_opti.o
drivers/ata/ahci.c +42 -30

142 lines not on this page · raw message

drivers/ata/ata_generic.c +36 -15

76 lines not on this page · raw message

drivers/ata/ata_piix.c +317 -76

607 lines not on this page · raw message

drivers/ata/libata-acpi.c +92 -25

138 lines not on this page · raw message

drivers/ata/libata-core.c +381 -424

1,359 lines not on this page · raw message

drivers/ata/libata-eh.c +229 -70

512 lines not on this page · raw message

drivers/ata/libata-scsi.c +30 -10
index 14daf48..3fd0820 100644
@@ -517,7 +517,7 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev,
 		qc->scsicmd = cmd;
 		qc->scsidone = done;
 
-		qc->__sg = scsi_sglist(cmd);
+		qc->sg = scsi_sglist(cmd);
 		qc->n_elem = scsi_sg_count(cmd);
 	} else {
 		cmd->result = (DID_OK << 16) | (QUEUE_FULL << 1);
@@ -2210,7 +2210,7 @@ unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf,
 
 		/* sector size */
 		ATA_SCSI_RBUF_SET(6, ATA_SECT_SIZE >> 8);
-		ATA_SCSI_RBUF_SET(7, ATA_SECT_SIZE);
+		ATA_SCSI_RBUF_SET(7, ATA_SECT_SIZE & 0xff);
 	} else {
 		/* sector count, 64-bit */
 		ATA_SCSI_RBUF_SET(0, last_lba >> (8 * 7));
@@ -2224,7 +2224,7 @@ unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf,
 
 		/* sector size */
 		ATA_SCSI_RBUF_SET(10, ATA_SECT_SIZE >> 8);
-		ATA_SCSI_RBUF_SET(11, ATA_SECT_SIZE);
+		ATA_SCSI_RBUF_SET(11, ATA_SECT_SIZE & 0xff);
 	}
 
 	return 0;
@@ -2331,7 +2331,7 @@ static void atapi_request_sense(struct ata_queued_cmd *qc)
 	DPRINTK("ATAPI request sense\n");
 
 	/* FIXME: is this needed? */
-	memset(cmd->sense_buffer, 0, sizeof(cmd->sense_buffer));
+	memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
 
 	ap->ops->tf_read(ap, &qc->tf);
 
@@ -2341,7 +2341,9 @@ static void atapi_request_sense(struct ata_queued_cmd *qc)
 
 	ata_qc_reinit(qc);
 
-	ata_sg_init_one(qc, cmd->sense_buffer, sizeof(cmd->sense_buffer));
+	/* setup sg table and init transfer direction */
+	sg_init_one(&qc->sgent, cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE);
+	ata_sg_init(qc, &qc->sgent, 1);
 	qc->dma_dir = DMA_FROM_DEVICE;
 
 	memset(&qc->cdb, 0, qc->dev->cdb_len);
@@ -2352,10 +2354,10 @@ static void atapi_request_sense(struct ata_queued_cmd *qc)
 	qc->tf.command = ATA_CMD_PACKET;
 
 	if (ata_pio_use_silly(ap)) {
-		qc->tf.protocol = ATA_PROT_ATAPI_DMA;
+		qc->tf.protocol = ATAPI_PROT_DMA;
 		qc->tf.feature |= ATAPI_PKT_DMA;
 	} else {
-		qc->tf.protocol = ATA_PROT_ATAPI;
+		qc->tf.protocol = ATAPI_PROT_PIO;
 		qc->tf.lbam = SCSI_SENSE_BUFFERSIZE;
 		qc->tf.lbah = 0;
 	}
@@ -2526,12 +2528,12 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
 	if (using_pio || nodata) {
 		/* no data, or PIO data xfer */
 		if (nodata)
-			qc->tf.protocol = ATA_PROT_ATAPI_NODATA;
+			qc->tf.protocol = ATAPI_PROT_NODATA;
 		else
-			qc->tf.protocol = ATA_PROT_ATAPI;
+			qc->tf.protocol = ATAPI_PROT_PIO;
 	} else {
 		/* DMA data xfer */
-		qc->tf.protocol = ATA_PROT_ATAPI_DMA;
+		qc->tf.protocol = ATAPI_PROT_DMA;
 		qc->tf.feature |= ATAPI_PKT_DMA;
 
 		if (atapi_dmadir && (scmd->sc_data_direction != DMA_TO_DEVICE))
@@ -2690,6 +2692,24 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
 	if ((tf->protocol = ata_scsi_map_proto(cdb[1])) == ATA_PROT_UNKNOWN)
 		goto invalid_fld;
 
+	/*
+	 * Filter TPM commands by default. These provide an
+	 * essentially uncontrolled encrypted "back door" between
+	 * applications and the disk. Set libata.allow_tpm=1 if you
+	 * have a real reason for wanting to use them. This ensures
+	 * that installed software cannot easily mess stuff up without
+	 * user intent. DVR type users will probably ship with this enabled
+	 * for movie content management.
+	 *
+	 * Note that for ATA8 we can issue a DCS change and DCS freeze lock
+	 * for this and should do in future but that it is not sufficient as
+	 * DCS is an optional feature set. Thus we also do the software filter
+	 * so that we comply with the TC consortium stated goal that the user
+	 * can turn off TC features of their system.
+	 */
+	if (tf->command >= 0x5C && tf->command <= 0x5F && !libata_allow_tpm)
+		goto invalid_fld;
+
 	/* We may not issue DMA commands if no DMA mode is set */
 	if (tf->protocol == ATA_PROT_DMA && dev->dma_mode == 0)
 		goto invalid_fld;
drivers/ata/libata-sff.c +111 -88

51 lines not on this page · raw message

drivers/ata/libata.h +5 -1
index bbe59c2..409ffb9 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_acpi.c +12 -55

67 lines not on this page · raw message

drivers/ata/pata_ali.c +1 -1
index 8caf9af..7e68edf 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_amd.c +93 -35

128 lines not on this page · raw message

drivers/ata/pata_bf54x.c +23 -18

41 lines not on this page · raw message

drivers/ata/pata_cs5520.c +1 -1
index 33f7f08..d4590f5 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_hpt37x.c +4 -3
index c79f066..68eb349 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_icside.c +2 -1
index 842fe08..5b8586d 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_it821x.c +33 -2
index ca9aae0..109ddd4 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_ixp4xx_cf.c +14 -12
index 120b5bf..030878f 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_legacy.c +742 -170

912 lines not on this page · raw message

drivers/ata/pata_mpc52xx.c +1 -1
index 50c56e2..dc40162 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_ninja32.c new file +214 -0

214 lines not on this page · raw message

drivers/ata/pata_pcmcia.c +88 -13

101 lines not on this page · raw message

drivers/ata/pata_pdc2027x.c +1 -1
index 2622577..028af5d 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_pdc202xx_old.c +2 -3
index 6c9689b..3ed8667 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_qdi.c +17 -13
index a4c0e50..9f308ed 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_scc.c +16 -14
index ea2ef9f..55055b2 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_serverworks.c +4 -5
index 8bed888..9c523fb 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_via.c +2 -1
index 453d72b..39627ab 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pata_winbond.c +17 -13
index 7116a9e..99c92ed 100644

Lines of this file are not shown. View the raw message.

drivers/ata/pdc_adma.c +3 -2
index bd4c2a3..8e1b7e9 100644

Lines of this file are not shown. View the raw message.

drivers/ata/sata_fsl.c +3 -2
index d015b4a..922d7b2 100644

Lines of this file are not shown. View the raw message.

drivers/ata/sata_inic162x.c +1 -1
index 323c087..96e614a 100644

Lines of this file are not shown. View the raw message.

drivers/ata/sata_mv.c +2 -1
index 37b850a..7e72463 100644

Lines of this file are not shown. View the raw message.

drivers/ata/sata_nv.c +9 -16
index ed5dc7c..a0f98fd 100644

Lines of this file are not shown. View the raw message.

drivers/ata/sata_promise.c +42 -56

98 lines not on this page · raw message

drivers/ata/sata_promise.h +1 -1
index 6ee5e19..00d6000 100644

Lines of this file are not shown. View the raw message.

drivers/ata/sata_qstor.c +5 -10
index c68b241..91cc12c 100644

Lines of this file are not shown. View the raw message.

drivers/ata/sata_sil.c +4 -6
index f5119bf..0b8191b 100644

Lines of this file are not shown. View the raw message.

drivers/ata/sata_sil24.c +7 -23
index 864c1c1..b4b1f91 100644

Lines of this file are not shown. View the raw message.

drivers/ata/sata_sx4.c +8 -7
index 4d85718..e3d56bc 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/ipr.c +5 -4
index 0841df0..aa0df0a 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/libsas/sas_ata.c +6 -8
index 0829b55..827cfb1 100644

Lines of this file are not shown. View the raw message.

include/linux/ata.h +94 -16

110 lines not on this page · raw message

include/linux/cdrom.h +3 -0
index c6d3e22..fcdc11b 100644

Lines of this file are not shown. View the raw message.

include/linux/libata.h +115 -69

184 lines not on this page · raw message

include/linux/pci_ids.h +3 -0
index 7f22151..1fbd025 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.