Re: [git patches] libata fixes

2008-02-24 Thread Bartlomiej Zolnierkiewicz
On Sunday 24 February 2008, Jeff Garzik wrote:

[...]

 Alan Cox (1):
   pata_atiixp: Use 255 sector limit

AHCI needs sorting too but this deals with the old interface

Signed-off-by: Alan Cox [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

[...]

 diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
 index 9623f52..408bdc1 100644
 --- a/drivers/ata/pata_atiixp.c
 +++ b/drivers/ata/pata_atiixp.c
 @@ -227,7 +227,7 @@ static struct scsi_host_template atiixp_sht = {
   .queuecommand   = ata_scsi_queuecmd,
   .can_queue  = ATA_DEF_QUEUE,
   .this_id= ATA_SHT_THIS_ID,
 - .sg_tablesize   = LIBATA_MAX_PRD,
 + .sg_tablesize   = LIBATA_DUMB_MAX_PRD,
   .cmd_per_lun= ATA_SHT_CMD_PER_LUN,
   .emulated   = ATA_SHT_EMULATED,
   .use_clustering = ATA_SHT_USE_CLUSTERING,
 @@ -259,7 +259,7 @@ static struct ata_port_operations atiixp_port_ops = {
   .bmdma_stop = atiixp_bmdma_stop,
   .bmdma_status   = ata_bmdma_status,
  
 - .qc_prep= ata_qc_prep,
 + .qc_prep= ata_dumb_qc_prep,
   .qc_issue   = ata_qc_issue_prot,
  
   .data_xfer  = ata_data_xfer,

This patch doesn't enforce 255 sector limit but instead:

- limits max PRD table size from 128 entries to 64

- enables quirk needed for some chipsets to split 64K PRD table entry
  on two 32K ones (these chipsets choke on size == 0x)

From the patch description it can't be told whether the patch itself is
correct and only the patch description is bogus...

Alan/Jeff: please elaborate on what the patch is trying to achieve.

Thanks,
Bart
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2008-02-24 Thread Alan Cox
 From the patch description it can't be told whether the patch itself is
 correct and only the patch description is bogus...

zero length PRD misparsing. If I remember rightly old IDE never generates
64K PRD slots because other hardware can't handle it either (CS5520/30
etc)
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2008-02-24 Thread Bartlomiej Zolnierkiewicz
On Sunday 24 February 2008, Alan Cox wrote:
  From the patch description it can't be told whether the patch itself is
  correct and only the patch description is bogus...
 
 zero length PRD misparsing. If I remember rightly old IDE never generates
 64K PRD slots because other hardware can't handle it either (CS5520/30
 etc)

OK, that would explain it.

Thanks,
Bart
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2008-02-23 Thread Jeff Garzik

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/ahci.c|   23 +--
 drivers/ata/libata-core.c |   16 ++--
 drivers/ata/libata-pmp.c  |4 ++--
 drivers/ata/libata-scsi.c |3 ++-
 drivers/ata/pata_atiixp.c |4 ++--
 drivers/ata/sata_fsl.c|8 +---
 include/linux/ata.h   |5 +
 include/linux/libata.h|1 +
 8 files changed, 44 insertions(+), 20 deletions(-)

Alan Cox (1):
  pata_atiixp: Use 255 sector limit

Anton Vorontsov (1):
  sata_fsl: fix build with ATA_VERBOSE_DEBUG

Mark Lord (1):
  libata-pmp: clear hob for pmp register accesses

Pavel Machek (1):
  power_state: get rid of write-only variable in SATA

Randy Dunlap (1):
  libata-core: fix kernel-doc warning

Shane Huang (1):
  [libata] ahci: AMD SB700/SB800 SATA support 64bit DMA

Tejun Heo (1):
  libata: automatically use DMADIR if drive/bridge requires it

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 6dd12f7..1db93b6 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -85,6 +85,7 @@ enum {
board_ahci_ign_iferr= 2,
board_ahci_sb600= 3,
board_ahci_mv   = 4,
+   board_ahci_sb700= 5,
 
/* global controller registers */
HOST_CAP= 0x00, /* host capabilities */
@@ -442,6 +443,16 @@ static const struct ata_port_info ahci_port_info[] = {
.udma_mask  = ATA_UDMA6,
.port_ops   = ahci_ops,
},
+   /* board_ahci_sb700 */
+   {
+   AHCI_HFLAGS (AHCI_HFLAG_IGN_SERR_INTERNAL |
+AHCI_HFLAG_NO_PMP),
+   .flags  = AHCI_FLAG_COMMON,
+   .link_flags = AHCI_LFLAG_COMMON,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .udma_mask  = ATA_UDMA6,
+   .port_ops   = ahci_ops,
+   },
 };
 
 static const struct pci_device_id ahci_pci_tbl[] = {
@@ -484,12 +495,12 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 
/* ATI */
{ PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */
-   { PCI_VDEVICE(ATI, 0x4390), board_ahci_sb600 }, /* ATI SB700/800 */
-   { PCI_VDEVICE(ATI, 0x4391), board_ahci_sb600 }, /* ATI SB700/800 */
-   { PCI_VDEVICE(ATI, 0x4392), board_ahci_sb600 }, /* ATI SB700/800 */
-   { PCI_VDEVICE(ATI, 0x4393), board_ahci_sb600 }, /* ATI SB700/800 */
-   { PCI_VDEVICE(ATI, 0x4394), board_ahci_sb600 }, /* ATI SB700/800 */
-   { PCI_VDEVICE(ATI, 0x4395), board_ahci_sb600 }, /* ATI SB700/800 */
+   { PCI_VDEVICE(ATI, 0x4390), board_ahci_sb700 }, /* ATI SB700/800 */
+   { PCI_VDEVICE(ATI, 0x4391), board_ahci_sb700 }, /* ATI SB700/800 */
+   { PCI_VDEVICE(ATI, 0x4392), board_ahci_sb700 }, /* ATI SB700/800 */
+   { PCI_VDEVICE(ATI, 0x4393), board_ahci_sb700 }, /* ATI SB700/800 */
+   { PCI_VDEVICE(ATI, 0x4394), board_ahci_sb700 }, /* ATI SB700/800 */
+   { PCI_VDEVICE(ATI, 0x4395), board_ahci_sb700 }, /* ATI SB700/800 */
 
/* VIA */
{ PCI_VDEVICE(VIA, 0x3349), board_ahci_vt8251 }, /* VIA VT8251 */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4cf8662..fbc2435 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -153,7 +153,7 @@ MODULE_VERSION(DRV_VERSION);
 
 /**
  * ata_force_cbl - force cable type according to libata.force
- * @link: ATA link of interest
+ * @ap: ATA port of interest
  *
  * Force cable type according to libata.force and whine about it.
  * The last entry which has matching port number is used, so it
@@ -2396,6 +2396,7 @@ int ata_dev_configure(struct ata_device *dev)
else if (dev-class == ATA_DEV_ATAPI) {
const char *cdb_intr_string = ;
const char *atapi_an_string = ;
+   const char *dma_dir_string = ;
u32 sntf;
 
rc = atapi_cdb_len(id);
@@ -2436,13 +2437,19 @@ int ata_dev_configure(struct ata_device *dev)
cdb_intr_string = , CDB intr;
}
 
+   if (atapi_dmadir || atapi_id_dmadir(dev-id)) {
+   dev-flags |= ATA_DFLAG_DMADIR;
+   dma_dir_string = , DMADIR;
+   }
+
/* print device info to dmesg */
if (ata_msg_drv(ap)  print_info)
ata_dev_printk(dev, KERN_INFO,
-  ATAPI: %s, %s, max %s%s%s\n,
+  ATAPI: %s, %s, max %s%s%s%s\n,
   modelbuf, fwrevbuf,
   ata_mode_string(xfer_mask),
-  cdb_intr_string, atapi_an_string);
+  cdb_intr_string, 

[git patches] libata fixes

2008-02-20 Thread Jeff Garzik

Note: Tejun's change is a feature addition, but one that is IMO
important for debugging and serious-bug workarounds.  It's
self-contained and should not affect anyone not using the new parm.


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:

 Documentation/kernel-parameters.txt |   35 
 drivers/ata/libata-core.c   |  380 ++-
 drivers/ata/libata-eh.c |8 +-
 drivers/ata/libata-scsi.c   |2 +-
 drivers/ata/libata.h|1 +
 drivers/ata/pata_legacy.c   |   44 ++--
 drivers/ata/sata_mv.c   |9 +-
 include/linux/libata.h  |2 +-
 8 files changed, 448 insertions(+), 33 deletions(-)

Harvey Harrison (2):
  ata: fix sparse warnings in pata_legacy.c
  ata: fix sparse warning in libata.h

Martin Michlmayr (1):
  sata_mv: Define module alias for platform device

Randy Dunlap (1):
  libata: fix kernel-doc parameter warning

Saeed Bishara (2):
  sata_mv: use hpriv-base instead of the host-iomap
  sata_mv: remove iounmap in mv_platform_remove and use devm_iomap

Tejun Heo (1):
  libata: implement libata.force module parameter

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index 7278295..9a5b665 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -950,6 +950,41 @@ and is between 256 and 4096 characters. It is defined in 
the file
when set.
Format: int
 
+   libata.force=   [LIBATA] Force configurations.  The format is comma
+   separated list of [ID:]VAL where ID is
+   PORT[:DEVICE].  PORT and DEVICE are decimal numbers
+   matching port, link or device.  Basically, it matches
+   the ATA ID string printed on console by libata.  If
+   the whole ID part is omitted, the last PORT and DEVICE
+   values are used.  If ID hasn't been specified yet, the
+   configuration applies to all ports, links and devices.
+
+   If only DEVICE is omitted, the parameter applies to
+   the port and all links and devices behind it.  DEVICE
+   number of 0 either selects the first device or the
+   first fan-out link behind PMP device.  It does not
+   select the host link.  DEVICE number of 15 selects the
+   host link and device attached to it.
+
+   The VAL specifies the configuration to force.  As long
+   as there's no ambiguity shortcut notation is allowed.
+   For example, both 1.5 and 1.5G would work for 1.5Gbps.
+   The following configurations can be forced.
+
+   * Cable type: 40c, 80c, short40c, unk, ign or sata.
+ Any ID with matching PORT is used.
+
+   * SATA link speed limit: 1.5Gbps or 3.0Gbps.
+
+   * Transfer mode: pio[0-7], mwdma[0-4] and udma[0-7].
+ udma[/][16,25,33,44,66,100,133] notation is also
+ allowed.
+
+   * [no]ncq: Turn on or off NCQ.
+
+   If there are multiple matching configurations changing
+   the same attribute, the last one is used.
+
load_ramdisk=   [RAM] List of ramdisks to load from floppy
See Documentation/ramdisk.txt.
 
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index def3682..60d1bb5 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -87,6 +87,28 @@ static struct workqueue_struct *ata_wq;
 
 struct workqueue_struct *ata_aux_wq;
 
+struct ata_force_param {
+   const char  *name;
+   unsigned intcbl;
+   int spd_limit;
+   unsigned long   xfer_mask;
+   unsigned inthorkage_on;
+   unsigned inthorkage_off;
+};
+
+struct ata_force_ent {
+   int port;
+   int device;
+   struct ata_force_param  param;
+};
+
+static struct ata_force_ent *ata_force_tbl;
+static int ata_force_tbl_size;
+
+static char ata_force_param_buf[PAGE_SIZE] __initdata;
+module_param_string(force, ata_force_param_buf, sizeof(ata_force_param_buf), 
0444);
+MODULE_PARM_DESC(force, Force ATA configurations including cable type, link 
speed and transfer mode (see Documentation/kernel-parameters.txt for details));
+
 int atapi_enabled = 1;
 module_param(atapi_enabled, int, 0444);
 MODULE_PARM_DESC(atapi_enabled, Enable discovery of ATAPI devices (0=off, 
1=on));
@@ -130,6 +152,179 @@ MODULE_VERSION(DRV_VERSION);
 
 
 /**
+ * 

[git patches] libata fixes

2008-02-15 Thread Jeff Garzik

Got another couple sata_mv fixes pending too...  coming soon.

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/ata_piix.c |2 +-
 drivers/ata/libata-core.c  |1 -
 drivers/ata/libata-scsi.c  |2 +-
 drivers/ata/pata_acpi.c|4 ++--
 drivers/ata/pata_amd.c |7 ++-
 drivers/ata/pata_cs5536.c  |   10 +-
 drivers/ata/pata_jmicron.c |3 ++-
 drivers/ata/pata_legacy.c  |2 --
 drivers/ata/pata_marvell.c |4 ++--
 drivers/ata/pata_scc.c |2 ++
 drivers/ata/sata_mv.c  |4 ++--
 drivers/ata/sata_promise.c |2 +-
 drivers/ata/sata_via.c |4 ++--
 13 files changed, 22 insertions(+), 25 deletions(-)

Akira Iguchi (1):
  pata_scc.c: add thaw ops

Harvey Harrison (11):
  ata: make ata_scsiop_inq_89 static in libata-scsi.c
  ata: fix sparse warning in libata-core.c
  ata: fix sparse warning in ata_piix.c
  ata: fix sparse warning in sata_promise.c
  ata: fix sparse warning in sata_via.c
  ata: fix sparse warnings in sata_mv.c
  ata: sparse fixes for pata_amd.c
  ata: fix sparse warning in pata_cs5536.c
  ata: fix sparse warning in pata_jmicron.c
  ata: fix sparse warning in pata_marvell.c
  ata: fix sparse warning in pata_acpi.c

Martin K. Petersen (1):
  pata_cs5536.c bugfix

Tejun Heo (1):
  pata_legacy: don't call ata_host_detach() after initialization failure

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 9c2515f..752e7d2 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -1652,7 +1652,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
u8 tmp;
pci_read_config_byte(pdev, PIIX_SCC, tmp);
if (tmp == PIIX_AHCI_DEVICE) {
-   int rc = piix_disable_ahci(pdev);
+   rc = piix_disable_ahci(pdev);
if (rc)
return rc;
}
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 004dae4..beaa3a9 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -7086,7 +7086,6 @@ int ata_host_register(struct ata_host *host, struct 
scsi_host_template *sht)
DPRINTK(probe begin\n);
for (i = 0; i  host-n_ports; i++) {
struct ata_port *ap = host-ports[i];
-   int rc;
 
/* probe */
if (ap-ops-error_handler) {
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index c02c490..1cea18f 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1862,7 +1862,7 @@ unsigned int ata_scsiop_inq_83(struct ata_scsi_args 
*args, u8 *rbuf,
  * spin_lock_irqsave(host lock)
  */
 
-unsigned int ata_scsiop_inq_89(struct ata_scsi_args *args, u8 *rbuf,
+static unsigned int ata_scsiop_inq_89(struct ata_scsi_args *args, u8 *rbuf,
  unsigned int buflen)
 {
u8 pbuf[60];
diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c
index 244098a..bdc3b9d 100644
--- a/drivers/ata/pata_acpi.c
+++ b/drivers/ata/pata_acpi.c
@@ -77,8 +77,8 @@ static int pacpi_cable_detect(struct ata_port *ap)
 
 static void pacpi_error_handler(struct ata_port *ap)
 {
-   return ata_bmdma_drive_eh(ap, pacpi_pre_reset, ata_std_softreset,
- NULL, ata_std_postreset);
+   ata_bmdma_drive_eh(ap, pacpi_pre_reset, ata_std_softreset, NULL,
+  ata_std_postreset);
 }
 
 /**
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index ea567e2..4b8d9b5 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -146,9 +146,8 @@ static int amd_pre_reset(struct ata_link *link, unsigned 
long deadline)
 
 static void amd_error_handler(struct ata_port *ap)
 {
-   return ata_bmdma_drive_eh(ap, amd_pre_reset,
- ata_std_softreset, NULL,
- ata_std_postreset);
+   ata_bmdma_drive_eh(ap, amd_pre_reset, ata_std_softreset, NULL,
+  ata_std_postreset);
 }
 
 static int amd_cable_detect(struct ata_port *ap)
@@ -506,7 +505,6 @@ static struct ata_port_operations amd133_port_ops = {
 static struct ata_port_operations nv100_port_ops = {
.set_piomode= nv100_set_piomode,
.set_dmamode= nv100_set_dmamode,
-   .mode_filter= ata_pci_default_filter,
.tf_load= ata_tf_load,
.tf_read= ata_tf_read,
.check_status   = ata_check_status,
@@ -541,7 +539,6 @@ static struct ata_port_operations nv100_port_ops = {
 static struct ata_port_operations nv133_port_ops = {
.set_piomode= nv133_set_piomode,
.set_dmamode= nv133_set_dmamode,
-   .mode_filter= ata_pci_default_filter,
.tf_load= ata_tf_load,

[git patches] libata fixes

2008-02-11 Thread Jeff Garzik

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

to receive the following updates:

 drivers/ata/libata-core.c  |   48 +-
 drivers/ata/pata_amd.c |2 +-
 drivers/ata/pata_legacy.c  |2 +-
 drivers/ata/pata_ninja32.c |9 ++-
 drivers/ata/pata_via.c |6 -
 drivers/ata/sata_mv.c  |   50 ---
 6 files changed, 75 insertions(+), 42 deletions(-)

Alan Cox (3):
  pata_amd: Note in the module description it handles Nvidia
  pata_legacy: typo fix
  pata_ninja32: setup changes

Byron Bradley (1):
  sata_mv: platform driver allocs dma without create

Tejun Heo (2):
  pata_via: fix SATA cable detection on cx700
  libata: ignore deverr on SETXFER if mode is configured

Yinghai Lu (1):
  sata_mv: fix loop with last port

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3011919..004dae4 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3048,6 +3048,8 @@ int ata_down_xfermask_limit(struct ata_device *dev, 
unsigned int sel)
 static int ata_dev_set_mode(struct ata_device *dev)
 {
struct ata_eh_context *ehc = dev-link-eh_context;
+   const char *dev_err_whine = ;
+   int ign_dev_err = 0;
unsigned int err_mask;
int rc;
 
@@ -3057,41 +3059,57 @@ static int ata_dev_set_mode(struct ata_device *dev)
 
err_mask = ata_dev_set_xfermode(dev);
 
+   if (err_mask  ~AC_ERR_DEV)
+   goto fail;
+
+   /* revalidate */
+   ehc-i.flags |= ATA_EHI_POST_SETMODE;
+   rc = ata_dev_revalidate(dev, ATA_DEV_UNKNOWN, 0);
+   ehc-i.flags = ~ATA_EHI_POST_SETMODE;
+   if (rc)
+   return rc;
+
/* Old CFA may refuse this command, which is just fine */
if (dev-xfer_shift == ATA_SHIFT_PIO  ata_id_is_cfa(dev-id))
-   err_mask = ~AC_ERR_DEV;
+   ign_dev_err = 1;
 
/* Some very old devices and some bad newer ones fail any kind of
   SET_XFERMODE request but support PIO0-2 timings and no IORDY */
if (dev-xfer_shift == ATA_SHIFT_PIO  !ata_id_has_iordy(dev-id) 
dev-pio_mode = XFER_PIO_2)
-   err_mask = ~AC_ERR_DEV;
+   ign_dev_err = 1;
 
/* Early MWDMA devices do DMA but don't allow DMA mode setting.
   Don't fail an MWDMA0 set IFF the device indicates it is in MWDMA0 */
if (dev-xfer_shift == ATA_SHIFT_MWDMA 
dev-dma_mode == XFER_MW_DMA_0 
(dev-id[63]  8)  1)
-   err_mask = ~AC_ERR_DEV;
+   ign_dev_err = 1;
 
-   if (err_mask) {
-   ata_dev_printk(dev, KERN_ERR, failed to set xfermode 
-  (err_mask=0x%x)\n, err_mask);
-   return -EIO;
-   }
+   /* if the device is actually configured correctly, ignore dev err */
+   if (dev-xfer_mode == ata_xfer_mask2mode(ata_id_xfermask(dev-id)))
+   ign_dev_err = 1;
 
-   ehc-i.flags |= ATA_EHI_POST_SETMODE;
-   rc = ata_dev_revalidate(dev, ATA_DEV_UNKNOWN, 0);
-   ehc-i.flags = ~ATA_EHI_POST_SETMODE;
-   if (rc)
-   return rc;
+   if (err_mask  AC_ERR_DEV) {
+   if (!ign_dev_err)
+   goto fail;
+   else
+   dev_err_whine =  (device error ignored);
+   }
 
DPRINTK(xfer_shift=%u, xfer_mode=0x%x\n,
dev-xfer_shift, (int)dev-xfer_mode);
 
-   ata_dev_printk(dev, KERN_INFO, configured for %s\n,
-  ata_mode_string(ata_xfer_mode2mask(dev-xfer_mode)));
+   ata_dev_printk(dev, KERN_INFO, configured for %s%s\n,
+  ata_mode_string(ata_xfer_mode2mask(dev-xfer_mode)),
+  dev_err_whine);
+
return 0;
+
+ fail:
+   ata_dev_printk(dev, KERN_ERR, failed to set xfermode 
+  (err_mask=0x%x)\n, err_mask);
+   return -EIO;
 }
 
 /**
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index 761a666..ea567e2 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -772,7 +772,7 @@ static void __exit amd_exit(void)
 }
 
 MODULE_AUTHOR(Alan Cox);
-MODULE_DESCRIPTION(low-level driver for AMD PATA IDE);
+MODULE_DESCRIPTION(low-level driver for AMD and Nvidia PATA IDE);
 MODULE_LICENSE(GPL);
 MODULE_DEVICE_TABLE(pci, amd);
 MODULE_VERSION(DRV_VERSION);
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 333dc15..6c59969 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -127,7 +127,7 @@ static int opti82c611a; /* Opti82c611A on 
primary 1, sec 2, both 3 */
 static int opti82c46x; /* Opti 82c465MV present(pri/sec autodetect) */
 static int qdi;/* Set to probe QDI controllers */
 static int winbond;/* Set 

[git patches] libata fixes

2008-01-15 Thread Jeff Garzik

Open issues for 2.6.24:  sata_nv ADMA, sata_nv 32/64bit DMA

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/libata-core.c  |4 +++-
 drivers/ata/pata_bf54x.c   |3 ++-
 drivers/ata/pata_legacy.c  |8 +++-
 drivers/ata/pata_qdi.c |8 +++-
 drivers/ata/pata_winbond.c |8 +++-
 include/linux/ata.h|2 --
 6 files changed, 14 insertions(+), 19 deletions(-)

Al Viro (1):
  libata fixes for sparse-found problems

Alan Cox (1):
  libata: correct handling of TSS DVD

Andrew Morton (2):
  [libata] pata_bf54x: checkpatch fixes
  [libata] core checkpatch fix

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4753a18..6380726 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6998,7 +6998,9 @@ int ata_host_start(struct ata_host *host)
rc = ap-ops-port_start(ap);
if (rc) {
if (rc != -ENODEV)
-   dev_printk(KERN_ERR, host-dev, failed 
to start port %d (errno=%d)\n, i, rc);
+   dev_printk(KERN_ERR, host-dev,
+   failed to start port %d 
+   (errno=%d)\n, i, rc);
goto err_out;
}
}
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index 088a41f..7842cc4 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -1509,7 +1509,8 @@ static int __devinit bfin_atapi_probe(struct 
platform_device *pdev)
if (res == NULL)
return -EINVAL;
 
-   while (bfin_port_info[board_idx].udma_mask0  udma_fsclk[udma_mode]  
fsclk) {
+   while (bfin_port_info[board_idx].udma_mask  0 
+   udma_fsclk[udma_mode]  fsclk) {
udma_mode--;
bfin_port_info[board_idx].udma_mask = 1;
}
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 7bed8d8..17159b5 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -271,14 +271,12 @@ static void pdc_data_xfer_vlb(struct ata_device *adev, 
unsigned char *buf, unsig
ioread32_rep(ap-ioaddr.data_addr, buf, buflen  2);
 
if (unlikely(slop)) {
-   u32 pad;
+   __le32 pad = 0;
if (write_data) {
memcpy(pad, buf + buflen - slop, slop);
-   pad = le32_to_cpu(pad);
-   iowrite32(pad, ap-ioaddr.data_addr);
+   iowrite32(le32_to_cpu(pad), 
ap-ioaddr.data_addr);
} else {
-   pad = ioread32(ap-ioaddr.data_addr);
-   pad = cpu_to_le16(pad);
+   pad = 
cpu_to_le32(ioread32(ap-ioaddr.data_addr));
memcpy(buf + buflen - slop, pad, slop);
}
}
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c
index 7d4c696..a4c0e50 100644
--- a/drivers/ata/pata_qdi.c
+++ b/drivers/ata/pata_qdi.c
@@ -136,14 +136,12 @@ static void qdi_data_xfer(struct ata_device *adev, 
unsigned char *buf, unsigned
ioread32_rep(ap-ioaddr.data_addr, buf, buflen  2);
 
if (unlikely(slop)) {
-   u32 pad;
+   __le32 pad = 0;
if (write_data) {
memcpy(pad, buf + buflen - slop, slop);
-   pad = le32_to_cpu(pad);
-   iowrite32(pad, ap-ioaddr.data_addr);
+   iowrite32(le32_to_cpu(pad), 
ap-ioaddr.data_addr);
} else {
-   pad = ioread32(ap-ioaddr.data_addr);
-   pad = cpu_to_le32(pad);
+   pad = 
cpu_to_le32(ioread32(ap-ioaddr.data_addr));
memcpy(buf + buflen - slop, pad, slop);
}
}
diff --git a/drivers/ata/pata_winbond.c b/drivers/ata/pata_winbond.c
index 311cdb3..7116a9e 100644
--- a/drivers/ata/pata_winbond.c
+++ b/drivers/ata/pata_winbond.c
@@ -104,14 +104,12 @@ static void winbond_data_xfer(struct ata_device *adev, 
unsigned char *buf, unsig
ioread32_rep(ap-ioaddr.data_addr, buf, buflen  2);
 
if (unlikely(slop)) {
-   u32 pad;
+   __le32 pad = 0;
if (write_data) {
memcpy(pad, buf + buflen - slop, slop);
-   pad = 

[git patches] libata fixes

2008-01-14 Thread Jeff Garzik

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/ata_piix.c|   51 +
 drivers/ata/libata-scsi.c |6 ++--
 drivers/ata/sata_sil24.c  |5 +++-
 3 files changed, 58 insertions(+), 4 deletions(-)

Tejun Heo (4):
  ata_piix: ignore ATA_DMA_ERR on vmware ich4
  sata_sil24: fix stupid typo
  sata_sil24: freeze on non-dev errors reported via CERR
  libata: relocate sdev-manage_start_stop configuration

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index bb62a58..b406b39 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -132,6 +132,7 @@ enum {
ich8_2port_sata,
ich8m_apple_sata_ahci,  /* locks up on second port enable */
tolapai_sata_ahci,
+   piix_pata_vmw,  /* PIIX4 for VMware, spurious DMA_ERR */
 
/* constants for mapping table */
P0  = 0,  /* port 0 */
@@ -165,6 +166,7 @@ static void piix_set_piomode(struct ata_port *ap, struct 
ata_device *adev);
 static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev);
 static void ich_set_dmamode(struct ata_port *ap, struct ata_device *adev);
 static int ich_pata_cable_detect(struct ata_port *ap);
+static u8 piix_vmw_bmdma_status(struct ata_port *ap);
 #ifdef CONFIG_PM
 static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
 static int piix_pci_device_resume(struct pci_dev *pdev);
@@ -175,6 +177,8 @@ static unsigned int in_module_init = 1;
 static const struct pci_device_id piix_pci_tbl[] = {
/* Intel PIIX3 for the 430HX etc */
{ 0x8086, 0x7010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_mwdma },
+   /* VMware ICH4 */
+   { 0x8086, 0x7111, 0x15ad, 0x1976, 0, 0, piix_pata_vmw },
/* Intel PIIX4 for the 430TX/440BX/MX chipset: UDMA 33 */
/* Also PIIX4E (fn3 rev 2) and PIIX4M (fn3 rev 3) */
{ 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 },
@@ -383,6 +387,38 @@ static const struct ata_port_operations piix_sata_ops = {
.port_start = ata_port_start,
 };
 
+static const struct ata_port_operations piix_vmw_ops = {
+   .set_piomode= piix_set_piomode,
+   .set_dmamode= piix_set_dmamode,
+   .mode_filter= ata_pci_default_filter,
+
+   .tf_load= ata_tf_load,
+   .tf_read= ata_tf_read,
+   .check_status   = ata_check_status,
+   .exec_command   = ata_exec_command,
+   .dev_select = ata_std_dev_select,
+
+   .bmdma_setup= ata_bmdma_setup,
+   .bmdma_start= ata_bmdma_start,
+   .bmdma_stop = ata_bmdma_stop,
+   .bmdma_status   = piix_vmw_bmdma_status,
+   .qc_prep= ata_qc_prep,
+   .qc_issue   = ata_qc_issue_prot,
+   .data_xfer  = ata_data_xfer,
+
+   .freeze = ata_bmdma_freeze,
+   .thaw   = ata_bmdma_thaw,
+   .error_handler  = piix_pata_error_handler,
+   .post_internal_cmd  = ata_bmdma_post_internal_cmd,
+   .cable_detect   = ata_cable_40wire,
+
+   .irq_handler= ata_interrupt,
+   .irq_clear  = ata_bmdma_irq_clear,
+   .irq_on = ata_irq_on,
+
+   .port_start = ata_port_start,
+};
+
 static const struct piix_map_db ich5_map_db = {
.mask = 0x7,
.port_enable = 0x3,
@@ -623,6 +659,16 @@ static struct ata_port_info piix_port_info[] = {
.port_ops   = piix_sata_ops,
},
 
+   [piix_pata_vmw] =
+   {
+   .sht= piix_sht,
+   .flags  = PIIX_PATA_FLAGS,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but 
slow */
+   .udma_mask  = ATA_UDMA_MASK_40C,
+   .port_ops   = piix_vmw_ops,
+   },
+
 };
 
 static struct pci_bits piix_enable_bits[] = {
@@ -1135,6 +1181,11 @@ static int piix_pci_device_resume(struct pci_dev *pdev)
 }
 #endif
 
+static u8 piix_vmw_bmdma_status(struct ata_port *ap)
+{
+   return ata_bmdma_status(ap)  ~ATA_DMA_ERR;
+}
+
 #define AHCI_PCI_BAR 5
 #define AHCI_GLOBAL_CTL 0x04
 #define AHCI_ENABLE (1  31)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 264ae60..14daf48 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -841,6 +841,9 @@ static void ata_scsi_dev_config(struct scsi_device *sdev,
blk_queue_max_hw_segments(q, q-max_hw_segments - 1);
}
 
+   if (dev-class == ATA_DEV_ATA)
+   sdev-manage_start_stop = 1;
+
if (dev-flags  ATA_DFLAG_AN)

[git patches] libata fixes

2008-01-10 Thread Jeff Garzik

Still working through the backlog, but this is most of the immediate
libata stuff.  I asked DaveM to help out with netdev fixes, so there
shouldn't be much of a 2.6.24-rc backlog at all there (thanks again David).

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:

 Documentation/kernel-parameters.txt |8 +++
 drivers/ata/libata-eh.c |   24 +++---
 drivers/ata/libata-pmp.c|   12 --
 drivers/ata/libata-scsi.c   |3 +-
 drivers/ata/libata-sff.c|7 -
 drivers/ata/pata_ixp4xx_cf.c|3 +-
 drivers/ata/pata_pdc202xx_old.c |   15 -
 drivers/ata/sata_qstor.c|2 +-
 drivers/ata/sata_sil24.c|   37 --
 9 files changed, 78 insertions(+), 33 deletions(-)

Alan Cox (2):
  libata-sff: PCI IRQ handling fix
  pata_pdc202xx_old: Further fixups

FD Cami (1):
  Update kernel parameter document for libata DMA mode setting knobs.

Gwendal Grignou (1):
  sata_sil24: prevent hba lockup when pass-through ATA commands are used

Ondrej Zary (1):
  libata and starting/stopping ATAPI floppy devices

Rod Whitby (1):
  pata_ixp4xx_cf: fix compilation introduced by ata_port_desc() conversion

Tejun Heo (4):
  sata_qstor: use hardreset instead of softreset
  libata-pmp: 4726 hates SRST
  libata-pmp: propagate timeout to host link
  libata: don't normalize UNKNOWN to NONE after reset

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index e5b447a..c417877 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -883,6 +883,14 @@ and is between 256 and 4096 characters. It is defined in 
the file
lapic_timer_c2_ok   [X86-32,x86-64,APIC] trust the local apic timer 
in
C2 power state.
 
+   libata.dma= [LIBATA] DMA control
+   libata.dma=0  Disable all PATA and SATA DMA
+   libata.dma=1  PATA and SATA Disk DMA only
+   libata.dma=2  ATAPI (CDROM) DMA only
+   libata.dma=4  Compact Flash DMA only 
+   Combinations also work, so libata.dma=3 enables DMA
+   for disks and CDROMs, but not CFs.
+
libata.noacpi   [LIBATA] Disables use of ACPI in libata suspend/resume
when set.
Format: int
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index f0124a8..21a81cd 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1733,11 +1733,15 @@ static void ata_eh_link_autopsy(struct ata_link *link)
ehc-i.action = ~ATA_EH_PERDEV_MASK;
}
 
-   /* consider speeding down */
+   /* propagate timeout to host link */
+   if ((all_err_mask  AC_ERR_TIMEOUT)  !ata_is_host_link(link))
+   ap-link.eh_context.i.err_mask |= AC_ERR_TIMEOUT;
+
+   /* record error and consider speeding down */
dev = ehc-i.dev;
-   if (!dev  ata_link_max_devices(link) == 1 
-   ata_dev_enabled(link-device))
-   dev = link-device;
+   if (!dev  ((ata_link_max_devices(link) == 1 
+ ata_dev_enabled(link-device
+   dev = link-device;
 
if (dev)
ehc-i.action |= ata_eh_speed_down(dev, is_io, all_err_mask);
@@ -1759,8 +1763,14 @@ void ata_eh_autopsy(struct ata_port *ap)
 {
struct ata_link *link;
 
-   __ata_port_for_each_link(link, ap)
+   ata_port_for_each_link(link, ap)
ata_eh_link_autopsy(link);
+
+   /* Autopsy of fanout ports can affect host link autopsy.
+* Perform host link autopsy last.
+*/
+   if (ap-nr_pmp_links)
+   ata_eh_link_autopsy(ap-link);
 }
 
 /**
@@ -2157,13 +2167,11 @@ int ata_eh_reset(struct ata_link *link, int classify,
if (ata_link_offline(link))
continue;
 
-   /* apply class override and convert UNKNOWN to NONE */
+   /* apply class override */
if (lflags  ATA_LFLAG_ASSUME_ATA)
classes[dev-devno] = ATA_DEV_ATA;
else if (lflags  ATA_LFLAG_ASSUME_SEMB)
classes[dev-devno] = ATA_DEV_SEMB_UNSUP; /* not yet */
-   else if (classes[dev-devno] == ATA_DEV_UNKNOWN)
-   classes[dev-devno] = ATA_DEV_NONE;
}
 
/* record current link speed */
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index c0c4dbc..caef2bb 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -495,14 +495,12 @@ static void sata_pmp_quirks(struct ata_port *ap)
/* SError.N need a kick in the ass to get working */

[git patches] libata fixes

2007-12-17 Thread Jeff Garzik

In 2.6.24, we turned on ACPI support in libata.  This is needed in order
to support suspend/resume and BIOS passworded drives, but it inevitably
brought with it a host of new regressions -- which is what happens
anytime you blindly accept ATA commands the BIOS has decided to toss
your way.  :)

It is bigger than I would like for -rc5, but the bulk of these
changes are Tejun addressing regressions from 2.6.23, most of which
are ACPI-related.


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/libata-acpi.c |  387 +++--
 drivers/ata/libata-core.c |  101 +
 drivers/ata/libata-eh.c   |4 +-
 drivers/ata/libata.h  |8 +-
 drivers/ata/sata_mv.c |   30 +++-
 drivers/ata/sata_sil.c|   18 +--
 include/linux/ata.h   |   15 ++
 include/linux/libata.h|   29 +++-
 8 files changed, 419 insertions(+), 173 deletions(-)

Mark Lord (1):
  sata_mv: improve warnings about Highpoint RocketRAID 23xx cards

Tejun Heo (15):
  sata_sil: fix spurious IRQ handling
  libata: clear link-eh_info.serror from ata_std_postreset()
  libata: add ST3160023AS / 3.42 to NCQ blacklist
  libata-acpi: adjust constness in ata_acpi_gtm/stm() parameters
  libata: update ata_*_printk() macros such that level can be a variable
  libata: add more opcodes to ata.h
  libata: ata_dev_disable() should be called from EH context
  libata-acpi: add new hooks ata_acpi_dissociate() and ata_acpi_on_disable()
  libata-acpi: implement and use ata_acpi_init_gtm()
  libata-acpi: implement dev-gtf_cache and evaluate _GTF right after _STM 
during resume
  libata-acpi: improve ACPI disabling
  libata-acpi: improve _GTF execution error handling and reporting
  libata-acpi: implement _GTF command filtering
  libata: update atapi_eh_request_sense() such that lbam/lbah contains 
buffer size
  libata: fix ATAPI draining

diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 545ea86..7bf4bef 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -6,6 +6,7 @@
  * Copyright (C) 2006 Randy Dunlap
  */
 
+#include linux/module.h
 #include linux/ata.h
 #include linux/delay.h
 #include linux/device.h
@@ -25,6 +26,18 @@
 #include acpi/acmacros.h
 #include acpi/actypes.h
 
+enum {
+   ATA_ACPI_FILTER_SETXFER = 1  0,
+   ATA_ACPI_FILTER_LOCK= 1  1,
+
+   ATA_ACPI_FILTER_DEFAULT = ATA_ACPI_FILTER_SETXFER |
+ ATA_ACPI_FILTER_LOCK,
+};
+
+static unsigned int ata_acpi_gtf_filter = ATA_ACPI_FILTER_DEFAULT;
+module_param_named(acpi_gtf_filter, ata_acpi_gtf_filter, int, 0644);
+MODULE_PARM_DESC(acpi_gtf_filter, filter mask for ACPI _GTF commands, set to 
filter out (0x1=set xfermode, 0x2=lock/freeze lock));
+
 #define NO_PORT_MULT   0x
 #define SATA_ADR(root, pmp)(((root)  16) | (pmp))
 
@@ -41,6 +54,12 @@ static int is_pci_dev(struct device *dev)
return (dev-bus == pci_bus_type);
 }
 
+static void ata_acpi_clear_gtf(struct ata_device *dev)
+{
+   kfree(dev-gtf_cache);
+   dev-gtf_cache = NULL;
+}
+
 /**
  * ata_acpi_associate_sata_port - associate SATA port with ACPI objects
  * @ap: target SATA port
@@ -94,6 +113,9 @@ static void ata_acpi_associate_ide_port(struct ata_port *ap)
 
dev-acpi_handle = acpi_get_child(ap-acpi_handle, i);
}
+
+   if (ata_acpi_gtm(ap, ap-__acpi_init_gtm) == 0)
+   ap-pflags |= ATA_PFLAG_INIT_GTM_VALID;
 }
 
 static void ata_acpi_handle_hotplug(struct ata_port *ap, struct kobject *kobj,
@@ -188,6 +210,32 @@ void ata_acpi_associate(struct ata_host *host)
 }
 
 /**
+ * ata_acpi_dissociate - dissociate ATA host from ACPI objects
+ * @host: target ATA host
+ *
+ * This function is called during driver detach after the whole host
+ * is shut down.
+ *
+ * LOCKING:
+ * EH context.
+ */
+void ata_acpi_dissociate(struct ata_host *host)
+{
+   int i;
+
+   /* Restore initial _GTM values so that driver which attaches
+* afterward can use them too.
+*/
+   for (i = 0; i  host-n_ports; i++) {
+   struct ata_port *ap = host-ports[i];
+   const struct ata_acpi_gtm *gtm = ata_acpi_init_gtm(ap);
+
+   if (ap-acpi_handle  gtm)
+   ata_acpi_stm(ap, gtm);
+   }
+}
+
+/**
  * ata_acpi_gtm - execute _GTM
  * @ap: target ATA port
  * @gtm: out parameter for _GTM result
@@ -200,7 +248,7 @@ void ata_acpi_associate(struct ata_host *host)
  * RETURNS:
  * 0 on success, -ENOENT if _GTM doesn't exist, -errno on failure.
  */
-int ata_acpi_gtm(const struct ata_port *ap, struct ata_acpi_gtm *gtm)
+int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *gtm)
 {
struct acpi_buffer output = { .length = ACPI_ALLOCATE_BUFFER };
union acpi_object *out_obj;
@@ -259,15 +307,16 

[git patches] libata fixes

2007-12-07 Thread Jeff Garzik

Notable:  kill spurious NCQ completion detection

libata disabling command queueing (aka NCQ) based on some hueristics for
detection device brokenness that ultimately turned out to be broken.

Remove the broken hueristic and turn NCQ back on for all the wrongfully
maligned hard drives.


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/ahci.c|   96 +++--
 drivers/ata/ata_piix.c|7 +++
 drivers/ata/libata-core.c |   18 +
 3 files changed, 31 insertions(+), 90 deletions(-)

Peter Schwenke (1):
  ata_piix: add Toshiba Tecra M4 to broken suspend list

Tejun Heo (3):
  ahci: fix engine reset failed message
  ahci: don't attach if ICH6 is in combined mode
  libata: kill spurious NCQ completion detection

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 4688dbf..54f38c2 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -193,6 +193,8 @@ enum {
  ATA_FLAG_ACPI_SATA | ATA_FLAG_AN |
  ATA_FLAG_IPM,
AHCI_LFLAG_COMMON   = ATA_LFLAG_SKIP_D2H_BSY,
+
+   ICH_MAP = 0x90, /* ICH MAP register */
 };
 
 struct ahci_cmd_hdr {
@@ -1271,9 +1273,9 @@ static int ahci_do_softreset(struct ata_link *link, 
unsigned int *class,
 
/* prepare for SRST (AHCI-1.1 10.4.1) */
rc = ahci_kick_engine(ap, 1);
-   if (rc)
+   if (rc  rc != -EOPNOTSUPP)
ata_link_printk(link, KERN_WARNING,
-   failed to reset engine (errno=%d), rc);
+   failed to reset engine (errno=%d)\n, rc);
 
ata_tf_init(link-device, tf);
 
@@ -1638,7 +1640,7 @@ static void ahci_port_intr(struct ata_port *ap)
struct ahci_host_priv *hpriv = ap-host-private_data;
int resetting = !!(ap-pflags  ATA_PFLAG_RESETTING);
u32 status, qc_active;
-   int rc, known_irq = 0;
+   int rc;
 
status = readl(port_mmio + PORT_IRQ_STAT);
writel(status, port_mmio + PORT_IRQ_STAT);
@@ -1696,80 +1698,12 @@ static void ahci_port_intr(struct ata_port *ap)
 
rc = ata_qc_complete_multiple(ap, qc_active, NULL);
 
-   /* If resetting, spurious or invalid completions are expected,
-* return unconditionally.
-*/
-   if (resetting)
-   return;
-
-   if (rc  0)
-   return;
-   if (rc  0) {
+   /* while resetting, invalid completions are expected */
+   if (unlikely(rc  0  !resetting)) {
ehi-err_mask |= AC_ERR_HSM;
ehi-action |= ATA_EH_SOFTRESET;
ata_port_freeze(ap);
-   return;
}
-
-   /* hmmm... a spurious interrupt */
-
-   /* if !NCQ, ignore.  No modern ATA device has broken HSM
-* implementation for non-NCQ commands.
-*/
-   if (!ap-link.sactive)
-   return;
-
-   if (status  PORT_IRQ_D2H_REG_FIS) {
-   if (!pp-ncq_saw_d2h)
-   ata_port_printk(ap, KERN_INFO,
-   D2H reg with I during NCQ, 
-   this message won't be printed again\n);
-   pp-ncq_saw_d2h = 1;
-   known_irq = 1;
-   }
-
-   if (status  PORT_IRQ_DMAS_FIS) {
-   if (!pp-ncq_saw_dmas)
-   ata_port_printk(ap, KERN_INFO,
-   DMAS FIS during NCQ, 
-   this message won't be printed again\n);
-   pp-ncq_saw_dmas = 1;
-   known_irq = 1;
-   }
-
-   if (status  PORT_IRQ_SDB_FIS) {
-   const __le32 *f = pp-rx_fis + RX_FIS_SDB;
-
-   if (le32_to_cpu(f[1])) {
-   /* SDB FIS containing spurious completions
-* might be dangerous, whine and fail commands
-* with HSM violation.  EH will turn off NCQ
-* after several such failures.
-*/
-   ata_ehi_push_desc(ehi,
-   spurious completions during NCQ 
-   issue=0x%x SAct=0x%x FIS=%08x:%08x,
-   readl(port_mmio + PORT_CMD_ISSUE),
-   readl(port_mmio + PORT_SCR_ACT),
-   le32_to_cpu(f[0]), le32_to_cpu(f[1]));
-   ehi-err_mask |= AC_ERR_HSM;
-   ehi-action |= ATA_EH_SOFTRESET;
-   ata_port_freeze(ap);
-   } else {
-   if (!pp-ncq_saw_sdb)
-   ata_port_printk(ap, KERN_INFO,
-   spurious SDB FIS %08x:%08x during NCQ, 

-   

Re: [git patches] libata fixes

2007-12-07 Thread Frans Pop
Jeff Garzik wrote:
 libata disabling command queueing (aka NCQ) based on some hueristics for
 detection device brokenness that ultimately turned out to be broken.
 
 Remove the broken hueristic and turn NCQ back on for all the wrongfully
 maligned hard drives.

Yay!
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-12-01 Thread Jeff Garzik

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/ata_piix.c|   28 +++
 drivers/ata/libata-core.c |8 +++--
 drivers/ata/libata-eh.c   |   42 +++--
 drivers/ata/pata_at32.c   |   61 +++---
 drivers/ata/pata_bf54x.c  |7 +
 drivers/ata/sata_mv.c |   64 ++--
 6 files changed, 149 insertions(+), 61 deletions(-)

Alan Cox (1):
  libata: Fix early use of port printk. (Was Re: ata4294967295: failed to 
start port (errno=-19))

Kristoffer Nyborg Gregertsen (1):
  Several fixes for the AVR32 PATA driver

Mark Lord (1):
  sata_mv: Fix broken Marvell 7042 support.

Peter Missel (1):
  libata: More IVB horkage from TSST

Peter Schwenke (1):
  ata_piix: add more toshiba laptops to broken suspend list

Saeed Bishara (1):
  sata_mv: fix compilation error when enabling DEBUG

Tejun Heo (1):
  libata: report protocol and full CDB on error

sonic zhang (1):
  Set proper ATA UDMA mode for bf548 according to system clock.

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 483269d..b538e1d 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -967,6 +967,13 @@ static int piix_broken_suspend(void)
},
},
{
+   .ident = TECRA M3,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
+   DMI_MATCH(DMI_PRODUCT_NAME, Tecra M3),
+   },
+   },
+   {
.ident = TECRA M5,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
@@ -981,6 +988,20 @@ static int piix_broken_suspend(void)
},
},
{
+   .ident = TECRA A8,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
+   DMI_MATCH(DMI_PRODUCT_NAME, TECRA A8),
+   },
+   },
+   {
+   .ident = Satellite R25,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
+   DMI_MATCH(DMI_PRODUCT_NAME, Satellite R25),
+   },
+   },
+   {
.ident = Satellite U200,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
@@ -988,6 +1009,13 @@ static int piix_broken_suspend(void)
},
},
{
+   .ident = Satellite U200,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
+   DMI_MATCH(DMI_PRODUCT_NAME, SATELLITE U200),
+   },
+   },
+   {
.ident = Satellite Pro U200,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 33f0627..b514a80 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4185,6 +4185,9 @@ static const struct ata_blacklist_entry 
ata_device_blacklist [] = {
/* Devices which get the IVB wrong */
{ QUANTUM FIREBALLlct10 05, A03.0900, ATA_HORKAGE_IVB, },
{ TSSTcorp CDDVDW SH-S202J, SB00, ATA_HORKAGE_IVB, },
+   { TSSTcorp CDDVDW SH-S202J, SB01, ATA_HORKAGE_IVB, },
+   { TSSTcorp CDDVDW SH-S202N, SB00, ATA_HORKAGE_IVB, },
+   { TSSTcorp CDDVDW SH-S202N, SB01, ATA_HORKAGE_IVB, },
 
/* End Marker */
{ }
@@ -6964,12 +6967,11 @@ int ata_host_start(struct ata_host *host)
if (ap-ops-port_start) {
rc = ap-ops-port_start(ap);
if (rc) {
-   ata_port_printk(ap, KERN_ERR, failed to 
-   start port (errno=%d)\n, rc);
+   if (rc != -ENODEV)
+   dev_printk(KERN_ERR, host-dev, failed 
to start port %d (errno=%d)\n, i, rc);
goto err_out;
}
}
-
ata_eh_freeze_port(ap);
}
 
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 0dac69d..e6605f0 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1850,30 +1850,54 @@ static void ata_eh_link_report(struct ata_link *link)
  ehc-i.serror  SERR_DEV_XCHG ? DevExch  : );
 
for (tag = 0; tag  

[git patches] libata fixes

2007-11-26 Thread Jeff Garzik

NOTE:  This includes 100% of the fixes collected during the week I
was on vacation, by Tejun... rebased.  So all the commit ids are
different from his push.

If you have not pulled from Tejun, then pull this.

If you have pulled from Tejun, then do not pull this (I will rebase once
Tejun's pull is pushed out).

Other notes:  I have a sata_nv ATAPI fix that needs to go in too, should
push that in the next push (day or two).


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/ata_piix.c |   93 ++
 drivers/ata/libata-core.c  |  108 ++--
 drivers/ata/libata-eh.c|   95 --
 drivers/ata/libata-scsi.c  |   38 ++--
 drivers/ata/pata_ali.c |   20 
 drivers/ata/pata_bf54x.c   |6 +-
 drivers/ata/pata_hpt37x.c  |2 +-
 drivers/ata/pata_isapnp.c  |   11 +++--
 drivers/ata/pata_jmicron.c |9 ++--
 drivers/ata/pata_sil680.c  |   32 +
 drivers/ata/pata_sis.c |1 +
 drivers/ata/sata_sil24.c   |   26 +-
 include/linux/libata.h |5 +--
 13 files changed, 184 insertions(+), 262 deletions(-)

Adrian Bunk (1):
  libata: remove unused functions

Alan Cox (6):
  ata_piix: Invalid use of writel/readl with iomap
  libata-core: List more documentation sources for reference
  pata_ali: Add Mitac 8317 and derivatives
  pata_ali: Lots of problems still showing up with small ATAPI DMA
  pata_hpt37x: Fix cable detect bug spotted by Sergei
  pata_isapnp: Polled devices

Albert Lee (2):
  libata: workaround DRQ=1 ERR=1 for ATAPI tape drives
  libata: use ATA_HORKAGE_STUCK_ERR for ATAPI tape drives

Gabriel C (1):
  pata_sis.c: Add Packard Bell EasyNote K5305 to laptops

Jeff Garzik (1):
  pata_ali: trim trailing whitespace (fix checkpatch complaints)

Mark Lord (1):
  libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs

Sergei Shtylyov (1):
  pata_sil680: kill bogus reset code (take 2)

Tejun Heo (6):
  ata_piix: add SATELLITE U205 to broken suspend list
  ata_piix: reorganize controller IDs
  ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3
  pata_jmicron: fix disabled port handling in jmicron_pre_reset()
  sata_sil24: fix sg table sizing
  libata: bump transfer chunk size if it's odd

Thomas Rohwer (1):
  ata_piix: only enable the first port on apple macbook pro

sonic zhang (1):
  libata: Return proper ATA INT status in pata_bf54x driver

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 328ce8a..483269d 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -119,18 +119,19 @@ enum {
PIIX_80C_SEC= (1  7) | (1  6),
 
/* controller IDs */
-   piix_pata_33= 0,/* PIIX4 at 33Mhz */
-   ich_pata_33 = 1,/* ICH up to UDMA 33 only */
-   ich_pata_66 = 2,/* ICH up to 66 Mhz */
-   ich_pata_100= 3,/* ICH up to UDMA 100 */
-   ich5_sata   = 5,
-   ich6_sata   = 6,
-   ich6_sata_ahci  = 7,
-   ich6m_sata_ahci = 8,
-   ich8_sata_ahci  = 9,
-   piix_pata_mwdma = 10,   /* PIIX3 MWDMA only */
-   tolapai_sata_ahci   = 11,
-   ich9_2port_sata = 12,
+   piix_pata_mwdma = 0,/* PIIX3 MWDMA only */
+   piix_pata_33,   /* PIIX4 at 33Mhz */
+   ich_pata_33,/* ICH up to UDMA 33 only */
+   ich_pata_66,/* ICH up to 66 Mhz */
+   ich_pata_100,   /* ICH up to UDMA 100 */
+   ich5_sata,
+   ich6_sata,
+   ich6_sata_ahci,
+   ich6m_sata_ahci,
+   ich8_sata_ahci,
+   ich8_2port_sata,
+   ich8m_apple_sata_ahci,  /* locks up on second port enable */
+   tolapai_sata_ahci,
 
/* constants for mapping table */
P0  = 0,  /* port 0 */
@@ -239,19 +240,21 @@ static const struct pci_device_id piix_pci_tbl[] = {
/* SATA Controller 1 IDE (ICH8) */
{ 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
/* SATA Controller 2 IDE (ICH8) */
-   { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+   { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* Mobile SATA Controller IDE (ICH8M) */
{ 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
+   /* Mobile SATA Controller IDE (ICH8M), Apple */
+   { 0x8086, 0x2828, 0x106b, 0x00a0, 0, 0, ich8m_apple_sata_ahci },
/* SATA Controller IDE (ICH9) */
{ 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
/* SATA Controller IDE (ICH9) */
-   { 0x8086, 

Re: [git patches] libata fixes

2007-11-20 Thread Jeff Garzik

Tejun Heo wrote:

These are upstream patches I collected while Jeff is away.  Thanks.

* workaround for ATAPI tape drives
* detection/suspend workarounds for several laptops
* ICH8/9 port_enable fix

ata_piix controller ID reorganization is included to ease the fixes.

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

to receive the following updates:

 drivers/ata/ata_piix.c|   87 
 drivers/ata/libata-core.c |  100 +++---
 drivers/ata/libata-eh.c   |   95 ---
 drivers/ata/libata-scsi.c |3 -
 drivers/ata/pata_sis.c|1 
 include/linux/libata.h|5 --

 6 files changed, 81 insertions(+), 210 deletions(-)

Adrian Bunk (1):
  libata: remove unused functions

Albert Lee (2):
  libata: workaround DRQ=1 ERR=1 for ATAPI tape drives
  libata: use ATA_HORKAGE_STUCK_ERR for ATAPI tape drives

Gabriel C (1):
  pata_sis.c: Add Packard Bell EasyNote K5305 to laptops

Mark Lord (1):
  libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs

Tejun Heo (3):
  ata_piix: add SATELLITE U205 to broken suspend list
  ata_piix: reorganize controller IDs
  ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3

Thomas Rohwer (1):
  ata_piix: only enable the first port on apple macbook pro


Just to make sure, I pulled this into #upstream-fixes.  If Linus already 
picked it up, great.  Otherwise I'll make sure it goes upstream.


Jeff



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


[git patches] libata fixes

2007-11-18 Thread Tejun Heo
These are upstream patches I collected while Jeff is away.  Thanks.

* workaround for ATAPI tape drives
* detection/suspend workarounds for several laptops
* ICH8/9 port_enable fix

ata_piix controller ID reorganization is included to ease the fixes.

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

to receive the following updates:

 drivers/ata/ata_piix.c|   87 
 drivers/ata/libata-core.c |  100 +++---
 drivers/ata/libata-eh.c   |   95 ---
 drivers/ata/libata-scsi.c |3 -
 drivers/ata/pata_sis.c|1 
 include/linux/libata.h|5 --
 6 files changed, 81 insertions(+), 210 deletions(-)

Adrian Bunk (1):
  libata: remove unused functions

Albert Lee (2):
  libata: workaround DRQ=1 ERR=1 for ATAPI tape drives
  libata: use ATA_HORKAGE_STUCK_ERR for ATAPI tape drives

Gabriel C (1):
  pata_sis.c: Add Packard Bell EasyNote K5305 to laptops

Mark Lord (1):
  libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs

Tejun Heo (3):
  ata_piix: add SATELLITE U205 to broken suspend list
  ata_piix: reorganize controller IDs
  ata_piix: port enable for the first SATA controller of ICH8 is 0xf not 0x3

Thomas Rohwer (1):
  ata_piix: only enable the first port on apple macbook pro

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 328ce8a..671e796 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -119,18 +119,19 @@ enum {
PIIX_80C_SEC= (1  7) | (1  6),
 
/* controller IDs */
-   piix_pata_33= 0,/* PIIX4 at 33Mhz */
-   ich_pata_33 = 1,/* ICH up to UDMA 33 only */
-   ich_pata_66 = 2,/* ICH up to 66 Mhz */
-   ich_pata_100= 3,/* ICH up to UDMA 100 */
-   ich5_sata   = 5,
-   ich6_sata   = 6,
-   ich6_sata_ahci  = 7,
-   ich6m_sata_ahci = 8,
-   ich8_sata_ahci  = 9,
-   piix_pata_mwdma = 10,   /* PIIX3 MWDMA only */
-   tolapai_sata_ahci   = 11,
-   ich9_2port_sata = 12,
+   piix_pata_mwdma = 0,/* PIIX3 MWDMA only */
+   piix_pata_33,   /* PIIX4 at 33Mhz */
+   ich_pata_33,/* ICH up to UDMA 33 only */
+   ich_pata_66,/* ICH up to 66 Mhz */
+   ich_pata_100,   /* ICH up to UDMA 100 */
+   ich5_sata,
+   ich6_sata,
+   ich6_sata_ahci,
+   ich6m_sata_ahci,
+   ich8_sata_ahci,
+   ich8_2port_sata,
+   ich8m_apple_sata_ahci,  /* locks up on second port enable */
+   tolapai_sata_ahci,
 
/* constants for mapping table */
P0  = 0,  /* port 0 */
@@ -239,19 +240,21 @@ static const struct pci_device_id piix_pci_tbl[] = {
/* SATA Controller 1 IDE (ICH8) */
{ 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
/* SATA Controller 2 IDE (ICH8) */
-   { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+   { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* Mobile SATA Controller IDE (ICH8M) */
{ 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
+   /* Mobile SATA Controller IDE (ICH8M), Apple */
+   { 0x8086, 0x2828, 0x106b, 0x00a0, 0, 0, ich8m_apple_sata_ahci },
/* SATA Controller IDE (ICH9) */
{ 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
/* SATA Controller IDE (ICH9) */
-   { 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+   { 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (ICH9) */
-   { 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+   { 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (ICH9M) */
-   { 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+   { 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (ICH9M) */
-   { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_2port_sata },
+   { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (ICH9M) */
{ 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
/* SATA Controller IDE (Tolapai) */
@@ -427,7 +430,7 @@ static const struct piix_map_db ich6m_map_db = {
 
 static const struct piix_map_db ich8_map_db = {
.mask = 0x3,
-   .port_enable = 0x3,
+   .port_enable = 0xf,
.map = {
/* PM   PS   SM   SS   MAP */
{  P0,  P2,  P1,  P3 }, /* 00b (hardwired when in AHCI) */
@@ -437,7 +440,7 @@ static const 

[git patches] libata fixes

2007-11-05 Thread Jeff Garzik

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/ata_piix.c |1 +
 drivers/ata/libata-core.c  |   39 ---
 drivers/ata/pata_hpt37x.c  |   49 +--
 drivers/ata/pata_serverworks.c |   11 -
 include/linux/ata.h|   11 +
 include/linux/libata.h |1 +
 6 files changed, 84 insertions(+), 28 deletions(-)

Alan Cox (4):
  pata_serverworks: Fix problem with some drive combinations
  ata_piix: Add additional PCI identifier for 40 wire short cable
  pata_hpt37x: Fix outstanding bug reports on the HPT374 and 37x cable 
detect
  libata: handle broken cable reporting

Geert Uytterhoeven (1):
  libata and bogus LBA48 drives

Kristen Carlson Accardi (1):
  libata: Don't disable dipm with SET FEATURES

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index a4b2cb2..f08cca2 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -621,6 +621,7 @@ struct ich_laptop {
 static const struct ich_laptop ich_laptop[] = {
/* devid, subvendor, subdev */
{ 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */
+   { 0x27DF, 0x1025, 0x0102 }, /* ICH7 on Acer 5602aWLMi */
{ 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */
{ 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */
{ 0x27DF, 0x103C, 0x30A1 }, /* ICH7 on HP Compaq nc2400 */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 164c7d9..ec3ce12 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -676,10 +676,11 @@ static int ata_dev_set_dipm(struct ata_device *dev, enum 
link_pm policy)
if (rc)
return rc;
 
-   /* disable DIPM */
-   if (ata_dev_enabled(dev)  (dev-flags  ATA_DFLAG_DIPM))
-   err_mask = ata_dev_set_feature(dev,
-   SETFEATURES_SATA_DISABLE, SATA_DIPM);
+   /*
+* we don't have to disable DIPM since IPM flags
+* disallow transitions to SLUMBER, which effectively
+* disable DIPM if it does not support PARTIAL
+*/
break;
case NOT_AVAILABLE:
case MAX_PERFORMANCE:
@@ -689,10 +690,11 @@ static int ata_dev_set_dipm(struct ata_device *dev, enum 
link_pm policy)
if (rc)
return rc;
 
-   /* disable DIPM */
-   if (ata_dev_enabled(dev)  (dev-flags  ATA_DFLAG_DIPM))
-   err_mask = ata_dev_set_feature(dev,
-   SETFEATURES_SATA_DISABLE, SATA_DIPM);
+   /*
+* we don't have to disable DIPM since IPM flags
+* disallow all transitions which effectively
+* disable DIPM anyway.
+*/
break;
}
 
@@ -4239,6 +4241,10 @@ static const struct ata_blacklist_entry 
ata_device_blacklist [] = {
{ ST340823A,  NULL,   ATA_HORKAGE_HPA_SIZE, },
{ ST320413A,  NULL,   ATA_HORKAGE_HPA_SIZE, },
 
+   /* Devices which get the IVB wrong */
+   { QUANTUM FIREBALLlct10 05, A03.0900, ATA_HORKAGE_IVB, },
+   { TSSTcorp CDDVDW SH-S202J, SB00, ATA_HORKAGE_IVB, },
+
/* End Marker */
{ }
 };
@@ -4300,6 +4306,21 @@ static int ata_dma_blacklisted(const struct ata_device 
*dev)
 }
 
 /**
+ * ata_is_40wire   -   check drive side detection
+ * @dev: device
+ *
+ * Perform drive side detection decoding, allowing for device vendors
+ * who can't follow the documentation.
+ */
+
+static int ata_is_40wire(struct ata_device *dev)
+{
+   if (dev-horkage  ATA_HORKAGE_IVB)
+   return ata_drive_40wire_relaxed(dev-id);
+   return ata_drive_40wire(dev-id);
+}
+
+/**
  * ata_dev_xfermask - Compute supported xfermask of the given device
  * @dev: Device to compute xfermask for
  *
@@ -4368,7 +4389,7 @@ static void ata_dev_xfermask(struct ata_device *dev)
if (xfer_mask  (0xF8  ATA_SHIFT_UDMA))
/* UDMA/44 or higher would be available */
if ((ap-cbl == ATA_CBL_PATA40) ||
-   (ata_drive_40wire(dev-id) 
+   (ata_is_40wire(dev) 
(ap-cbl == ATA_CBL_PATA_UNK ||
 ap-cbl == ATA_CBL_PATA80))) {
ata_dev_printk(dev, KERN_WARNING,
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index e61cb1f..3816b86 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -295,7 +295,7 @@ static unsigned long hpt370_filter(struct ata_device *adev, 
unsigned long mask)
 
 static unsigned long hpt370a_filter(struct ata_device 

[git patches] libata fixes

2007-11-03 Thread Jeff Garzik
Fixes, fixes and more fixes.

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/libata-core.c  |   38 ---
 drivers/ata/libata-eh.c|  148 ++--
 drivers/ata/libata-scsi.c  |2 +-
 drivers/ata/sata_fsl.c |  159 +---
 drivers/ata/sata_promise.c |2 +-
 include/linux/ata.h|6 ++
 6 files changed, 149 insertions(+), 206 deletions(-)

Adrian Bunk (1):
  make ata_scsi_lpm_get() static

Jeff Garzik (4):
  ata/sata_fsl: Remove unnecessary SCR cases
  ata/sata_fsl: cleanup needless casts to/from void __iomem *
  ata/sata_fsl: remove unneeded on-stack copy of FIS
  ata/sata_fsl: remove unneeded sata_fsl_hardreset()

Li Yang (5):
  ata/sata_fsl: Update for ata_link introduction
  ata/sata_fsl: Remove deprecated hooks
  ata/sata_fsl: save irq in private data for irq unmapping
  ata/sata_fsl: Kill ata_sg_is_last()
  ata/sata_fsl: cleanup style problem

Mikael Pettersson (1):
  sata_promise: fix endianess bug in ASIC PRD bug workaround

Stephen Hemminger (1):
  libata: fix docbook

Stephen Rothwell (1):
  libata: suppress two warnings

Tejun Heo (6):
  libata: fix timing computation in ata_eh_reset()
  libata: cosmetic clean up / reorganization of ata_eh_reset()
  libata: more robust reset failure handling
  libata: consider errors not associated with commands for speed down
  libata: request PHY speed configuration on SControl access failure
  libata: don't configure downstream links faster than the upstream link

Tony Battersby (1):
  libata: increase 128 KB / cmd limit for ATAPI tape drives

ashish kalra (3):
  ata/sata_fsl: Move MPC8315DS link speed limit workaround to specific ifdef
  ata/sata_fsl: Remove sending LOG EXT command in sata_fsl_softreset()
  ata/sata_fsl: Remove ata_scsi_suspend/resume callbacks

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 63035d7..164c7d9 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -704,8 +704,8 @@ static int ata_dev_set_dipm(struct ata_device *dev, enum 
link_pm policy)
 
 /**
  * ata_dev_enable_pm - enable SATA interface power management
- * @device - device to enable ipm for
- * @policy - the link power management policy
+ * @dev:  device to enable power management
+ * @policy: the link power management policy
  *
  * Enable SATA Interface power management.  This will enable
  * Device Interface Power Management (DIPM) for min_power
@@ -735,9 +735,10 @@ enable_pm_out:
return /* rc */;/* hopefully we can use 'rc' eventually */
 }
 
+#ifdef CONFIG_PM
 /**
  * ata_dev_disable_pm - disable SATA interface power management
- * @device - device to enable ipm for
+ * @dev: device to disable power management
  *
  * Disable SATA Interface power management.  This will disable
  * Device Interface Power Management (DIPM) without changing
@@ -755,6 +756,7 @@ static void ata_dev_disable_pm(struct ata_device *dev)
if (ap-ops-disable_pm)
ap-ops-disable_pm(ap);
 }
+#endif /* CONFIG_PM */
 
 void ata_lpm_schedule(struct ata_port *ap, enum link_pm policy)
 {
@@ -764,6 +766,7 @@ void ata_lpm_schedule(struct ata_port *ap, enum link_pm 
policy)
ata_port_schedule_eh(ap);
 }
 
+#ifdef CONFIG_PM
 static void ata_lpm_enable(struct ata_host *host)
 {
struct ata_link *link;
@@ -789,6 +792,7 @@ static void ata_lpm_disable(struct ata_host *host)
ata_lpm_schedule(ap, ap-pm_policy);
}
 }
+#endif /* CONFIG_PM */
 
 
 /**
@@ -2300,6 +2304,10 @@ int ata_dev_configure(struct ata_device *dev)
dev-max_sectors = ATA_MAX_SECTORS;
}
 
+   if ((dev-class == ATA_DEV_ATAPI) 
+   (atapi_command_packet_set(id) == TYPE_TAPE))
+   dev-max_sectors = ATA_MAX_SECTORS_TAPE;
+
if (dev-horkage  ATA_HORKAGE_MAX_SEC_128)
dev-max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128,
 dev-max_sectors);
@@ -2743,17 +2751,27 @@ int sata_down_spd_limit(struct ata_link *link)
 
 static int __sata_set_spd_needed(struct ata_link *link, u32 *scontrol)
 {
-   u32 spd, limit;
+   struct ata_link *host_link = link-ap-link;
+   u32 limit, target, spd;
+
+   limit = link-sata_spd_limit;
 
-   if (link-sata_spd_limit == UINT_MAX)
-   limit = 0;
+   /* Don't configure downstream link faster than upstream link.
+* It doesn't speed up anything and some PMPs choke on such
+* configuration.
+*/
+   if (!ata_is_host_link(link)  host_link-sata_spd)
+   limit = (1  host_link-sata_spd) - 1;
+
+   if (limit == UINT_MAX)
+   target = 0;
else
-   

Re: [git patches] libata fixes

2007-10-31 Thread Jeff Garzik

Mikael Pettersson wrote:

That's my fault for misremembering the rule about the
number of dashes before the other comments part :-(
I'll remember better in the future.



Well, I should have caught it and hand-edited it on my side too...

Jeff


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


Re: [git patches] libata fixes

2007-10-31 Thread Mikael Pettersson
On Tue, 30 Oct 2007 11:54:01 -0700 (PDT), Linus Torvalds wrote:
 On Tue, 30 Oct 2007, Jeff Garzik wrote:
  
  Mikael Pettersson (2):
sata_promise: ASIC PRD table bug workaround, take 2
sata_promise: cleanups
 
 You and Mikael need to sort out the way you send/accept patches. 
 
 Both of these commits had stuff like this:
 
 Signed-off-by: Mikael Pettersson [EMAIL PROTECTED]
 --
 Changes since previous version:
 * use new PDC_MAX_PRD constant to initialise sg_tablesize
 
  drivers/ata/sata_promise.c |   87 
 ++---
  1 files changed, 83 insertions(+), 4 deletions(-)
 Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
 
 which seems to be because Mikael uses two dashes instead of three to 
 separate his real message from the stuff you have.
 
 So either you need to teach Mikael to use the proper separators

That's my fault for misremembering the rule about the
number of dashes before the other comments part :-(
I'll remember better in the future.

/Mikael
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-10-30 Thread Jeff Garzik

Of particular note is the sata_promise fix, which works around a
nasty hw errata.  I need to push that to stable@

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/libata-eh.c|   20 ++---
 drivers/ata/libata-scsi.c  |7 ++-
 drivers/ata/sata_promise.c |  104 ++-
 drivers/ata/sata_sil24.c   |6 +-
 include/linux/libata.h |1 +
 5 files changed, 115 insertions(+), 23 deletions(-)

Mikael Pettersson (2):
  sata_promise: ASIC PRD table bug workaround, take 2
  sata_promise: cleanups

Tejun Heo (3):
  libata: flush is an IO command
  libata: stop being overjealous about non-IO commands
  libata: implement and use ATA_QCFLAG_QUIET

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index fefea74..8d64f8f 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1800,10 +1800,8 @@ static void ata_eh_link_autopsy(struct ata_link *link)
qc-err_mask = ~AC_ERR_OTHER;
 
/* SENSE_VALID trumps dev/unknown error and revalidation */
-   if (qc-flags  ATA_QCFLAG_SENSE_VALID) {
+   if (qc-flags  ATA_QCFLAG_SENSE_VALID)
qc-err_mask = ~(AC_ERR_DEV | AC_ERR_OTHER);
-   ehc-i.action = ~ATA_EH_REVALIDATE;
-   }
 
/* accumulate error info */
ehc-i.dev = qc-dev;
@@ -1816,7 +1814,8 @@ static void ata_eh_link_autopsy(struct ata_link *link)
if (ap-pflags  ATA_PFLAG_FROZEN ||
all_err_mask  (AC_ERR_HSM | AC_ERR_TIMEOUT))
ehc-i.action |= ATA_EH_SOFTRESET;
-   else if (all_err_mask)
+   else if ((is_io  all_err_mask) ||
+(!is_io  (all_err_mask  ~AC_ERR_DEV)))
ehc-i.action |= ATA_EH_REVALIDATE;
 
/* if we have offending qcs and the associated failed device */
@@ -1879,7 +1878,9 @@ static void ata_eh_link_report(struct ata_link *link)
for (tag = 0; tag  ATA_MAX_QUEUE; tag++) {
struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
 
-   if (!(qc-flags  ATA_QCFLAG_FAILED) || qc-dev-link != link)
+   if (!(qc-flags  ATA_QCFLAG_FAILED) || qc-dev-link != link ||
+   ((qc-flags  ATA_QCFLAG_QUIET) 
+qc-err_mask == AC_ERR_DEV))
continue;
if (qc-flags  ATA_QCFLAG_SENSE_VALID  !qc-err_mask)
continue;
@@ -2697,8 +2698,15 @@ void ata_eh_finish(struct ata_port *ap)
/* FIXME: Once EH migration is complete,
 * generate sense data in this function,
 * considering both err_mask and tf.
+*
+* There's no point in retrying invalid
+* (detected by libata) and non-IO device
+* errors (rejected by device).  Finish them
+* immediately.
 */
-   if (qc-err_mask  AC_ERR_INVALID)
+   if ((qc-err_mask  AC_ERR_INVALID) ||
+   (!(qc-flags  ATA_QCFLAG_IO) 
+qc-err_mask == AC_ERR_DEV))
ata_eh_qc_complete(qc);
else
ata_eh_qc_retry(qc);
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 93bd36c..fc89590 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1108,6 +1108,9 @@ static unsigned int ata_scsi_flush_xlat(struct 
ata_queued_cmd *qc)
else
tf-command = ATA_CMD_FLUSH;
 
+   /* flush is critical for IO integrity, consider it an IO command */
+   qc-flags |= ATA_QCFLAG_IO;
+
return 0;
 }
 
@@ -2764,8 +2767,8 @@ static unsigned int ata_scsi_pass_thru(struct 
ata_queued_cmd *qc)
 */
qc-nbytes = scsi_bufflen(scmd);
 
-   /* request result TF */
-   qc-flags |= ATA_QCFLAG_RESULT_TF;
+   /* request result TF and be quiet about device error */
+   qc-flags |= ATA_QCFLAG_RESULT_TF | ATA_QCFLAG_QUIET;
 
return 0;
 
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index deb26f0..825e717 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -2,6 +2,7 @@
  *  sata_promise.c - Promise SATA
  *
  *  Maintained by:  Jeff Garzik [EMAIL PROTECTED]
+ * Mikael Pettersson [EMAIL PROTECTED]
  * Please ALWAYS copy linux-ide@vger.kernel.org
  * on emails.
  *
@@ -45,11 +46,12 @@
 #include sata_promise.h
 
 #define DRV_NAME   sata_promise
-#define DRV_VERSION2.10
+#define DRV_VERSION2.11
 
 enum {
PDC_MAX_PORTS   = 4,
PDC_MMIO_BAR= 3,
+ 

Re: [git patches] libata fixes

2007-10-30 Thread Linus Torvalds


On Tue, 30 Oct 2007, Jeff Garzik wrote:
 
 Mikael Pettersson (2):
   sata_promise: ASIC PRD table bug workaround, take 2
   sata_promise: cleanups

You and Mikael need to sort out the way you send/accept patches. 

Both of these commits had stuff like this:

Signed-off-by: Mikael Pettersson [EMAIL PROTECTED]
--
Changes since previous version:
* use new PDC_MAX_PRD constant to initialise sg_tablesize

 drivers/ata/sata_promise.c |   87 
++---
 1 files changed, 83 insertions(+), 4 deletions(-)
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

which seems to be because Mikael uses two dashes instead of three to 
separate his real message from the stuff you have.

So either you need to teach Mikael to use the proper separators, or you 
need to edit these things down to be something readable instead of keeping 
the extraneous commentary around...

Pulled, but I'm hoping for cleaner commit messages in the future..

Linus
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-10-30 Thread Jeff Garzik

Linus Torvalds wrote:


On Tue, 30 Oct 2007, Jeff Garzik wrote:

Mikael Pettersson (2):
  sata_promise: ASIC PRD table bug workaround, take 2
  sata_promise: cleanups


You and Mikael need to sort out the way you send/accept patches. 


Both of these commits had stuff like this:

Signed-off-by: Mikael Pettersson [EMAIL PROTECTED]
--
Changes since previous version:
* use new PDC_MAX_PRD constant to initialise sg_tablesize

 drivers/ata/sata_promise.c |   87 ++---

 1 files changed, 83 insertions(+), 4 deletions(-)
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

which seems to be because Mikael uses two dashes instead of three to 
separate his real message from the stuff you have.


So either you need to teach Mikael to use the proper separators, or you 
need to edit these things down to be something readable instead of keeping 
the extraneous commentary around...


Pulled, but I'm hoping for cleaner commit messages in the future..


Can we change git-am to accept two dashes as well as three?  :)

It seems pretty common, not just with Mikael but several others who send 
patches to me.


Jeff



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


Re: [git patches] libata fixes

2007-10-30 Thread Linus Torvalds


On Tue, 30 Oct 2007, Jeff Garzik wrote:
 
 Can we change git-am to accept two dashes as well as three?  :)
 
 It seems pretty common, not just with Mikael but several others who send
 patches to me.

Well, git-am actually used to be a lot less strict about the dashes, and 
we've made it *more* strict rather than less, because the more of these 
breaks we accept, the more likely it is that something that was intended 
to be part of the message gets thrown out.. So I'll say that I'm a bit 
nervous about extending it again.

The reason for the three dashes is actually that that is what a *diff* 
starts with. So if you look at what closes a description as far as 
git-am is concerned, they are currently all things that are likely to 
start a patch: Index:  or diff - or --- filename, and that last 
case was then extended to be manual break even without the filename 
information.

See git/builtin-mailinfo.c: patchbreak().

But you could try to sell it to Junio. He's the maintainer, and while I 
care about some other things and will argue violently against them, when 
it comes to something like this, Junio is the guy to go to.

That said, I really think you could just try to educate the people you 
work with. Maybe they just never even realized that three dashes is what 
you're supposed to use!

Linus
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-10-30 Thread Jan Engelhardt

On Oct 30 2007 12:31, Linus Torvalds wrote:
On Tue, 30 Oct 2007, Jeff Garzik wrote:
 
 Can we change git-am to accept two dashes as well as three?  :)
 
 It seems pretty common, not just with Mikael but several others who send
 patches to me.

Well, git-am actually used to be a lot less strict about the dashes, and 
we've made it *more* strict rather than less, because the more of these 
breaks we accept, the more likely it is that something that was intended 
to be part of the message gets thrown out.. So I'll say that I'm a bit 
nervous about extending it again.

I would not add --. It is already used (--  is) in the mail world as a
signature separator. Let's stay with ---, which is also what quilt generates.

The reason for the three dashes is actually that that is what a *diff* 
starts with. So if you look at what closes a description as far as 
git-am is concerned, they are currently all things that are likely to 
start a patch: Index:  or diff - or --- filename, and that last 
case was then extended to be manual break even without the filename 
information.

See git/builtin-mailinfo.c: patchbreak().

But you could try to sell it to Junio. He's the maintainer, and while I 
care about some other things and will argue violently against them, when 
it comes to something like this, Junio is the guy to go to.

That said, I really think you could just try to educate the people you 
work with. Maybe they just never even realized that three dashes is what 
you're supposed to use!

   Linus
-
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/


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


Re: [git patches] libata fixes

2007-10-30 Thread Junio C Hamano
Jan Engelhardt [EMAIL PROTECTED] writes:

 On Oct 30 2007 12:31, Linus Torvalds wrote:
On Tue, 30 Oct 2007, Jeff Garzik wrote:
 
 Can we change git-am to accept two dashes as well as three?  :)

Well, git-am actually used to be a lot less strict about the dashes, and 
we've made it *more* strict rather than less, because the more of these 
breaks we accept, the more likely it is that something that was intended 
to be part of the message gets thrown out.. So I'll say that I'm a bit 
nervous about extending it again.

 I would not add --. It is already used (--  is) in the mail world as a
 signature separator. Let's stay with ---, which is also what quilt generates.

Thanks for the input about what quilt does.

So the way to proceed is to have no change to mailinfo, and have
a bit of user education.
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-10-19 Thread Jeff Garzik

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/libata-core.c |2 +-
 drivers/ata/pata_cs5536.c |4 ++--
 drivers/ata/sata_sis.c|   15 +--
 3 files changed, 12 insertions(+), 9 deletions(-)

Bartlomiej Zolnierkiewicz (1):
  pata_cs5536: MWDMA fix

Jeff Garzik (1):
  [libata] sata_sis: use correct S/G table size

Randy Dunlap (1):
  libata: fix kernel-doc param name

Tejun Heo (1):
  sata_sis: fix SCR read breakage

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index bbaa545..629eadb 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1392,7 +1392,7 @@ static void ata_qc_complete_internal(struct 
ata_queued_cmd *qc)
  * @tf: Taskfile registers for the command and the result
  * @cdb: CDB for packet command
  * @dma_dir: Data tranfer direction of the command
- * @sg: sg list for the data buffer of the command
+ * @sgl: sg list for the data buffer of the command
  * @n_elem: Number of sg entries
  * @timeout: Timeout in msecs (0 for default)
  *
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
index 53070f6..d753e56 100644
--- a/drivers/ata/pata_cs5536.c
+++ b/drivers/ata/pata_cs5536.c
@@ -40,7 +40,7 @@
 #include asm/msr.h
 
 #define DRV_NAME   pata_cs5536
-#define DRV_VERSION0.0.5
+#define DRV_VERSION0.0.6
 
 enum {
CFG = 0,
@@ -214,7 +214,7 @@ static void cs5536_set_dmamode(struct ata_port *ap, struct 
ata_device *adev)
cs5536_read(pdev, DTC, dtc);
 
dtc = ~(IDE_DRV_MASK  dshift);
-   dtc |= mwdma_timings[mode]  dshift;
+   dtc |= mwdma_timings[mode - XFER_MW_DMA_0]  dshift;
 
cs5536_write(pdev, DTC, dtc);
}
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index 8d98a9f..f147dc7 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -92,7 +92,7 @@ static struct scsi_host_template sis_sht = {
.queuecommand   = ata_scsi_queuecmd,
.can_queue  = ATA_DEF_QUEUE,
.this_id= ATA_SHT_THIS_ID,
-   .sg_tablesize   = ATA_MAX_PRD,
+   .sg_tablesize   = LIBATA_MAX_PRD,
.cmd_per_lun= ATA_SHT_CMD_PER_LUN,
.emulated   = ATA_SHT_EMULATED,
.use_clustering = ATA_SHT_USE_CLUSTERING,
@@ -166,11 +166,11 @@ static unsigned int get_scr_cfg_addr(struct ata_port *ap, 
unsigned int sc_reg)
return addr;
 }
 
-static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg)
+static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg, u32 
*val)
 {
struct pci_dev *pdev = to_pci_dev(ap-host-dev);
unsigned int cfg_addr = get_scr_cfg_addr(ap, sc_reg);
-   u32 val, val2 = 0;
+   u32 val2 = 0;
u8 pmr;
 
if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */
@@ -178,13 +178,16 @@ static u32 sis_scr_cfg_read (struct ata_port *ap, 
unsigned int sc_reg)
 
pci_read_config_byte(pdev, SIS_PMR, pmr);
 
-   pci_read_config_dword(pdev, cfg_addr, val);
+   pci_read_config_dword(pdev, cfg_addr, val);
 
if ((pdev-device == 0x0182) || (pdev-device == 0x0183) ||
(pdev-device == 0x1182) || (pmr  SIS_PMR_COMBINED))
pci_read_config_dword(pdev, cfg_addr+0x10, val2);
 
-   return (val|val2)   0xfffb; /* avoid problems with powerdowned 
ports */
+   *val |= val2;
+   *val = 0xfffb; /* avoid problems with powerdowned ports */
+
+   return 0;
 }
 
 static void sis_scr_cfg_write (struct ata_port *ap, unsigned int sc_reg, u32 
val)
@@ -214,7 +217,7 @@ static int sis_scr_read(struct ata_port *ap, unsigned int 
sc_reg, u32 *val)
return -EINVAL;
 
if (ap-flags  SIS_FLAG_CFGSCR)
-   return sis_scr_cfg_read(ap, sc_reg);
+   return sis_scr_cfg_read(ap, sc_reg, val);
 
pci_read_config_byte(pdev, SIS_PMR, pmr);
 
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-10-17 Thread Jeff Garzik

Well, the new driver is not a fix.

Anyway -- still plugging away at debugging libata.  It seems some
outside changes are causing a bunch of my test boxes to crap themselves.
These need to go up in the meantime, however.

Maybe its the sg-chaining stuff, we'll see.  I'm watching that thread
closely (after recovering from an email outage).



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  |   16 +-
 drivers/ata/Makefile |1 +
 drivers/ata/libata-sff.c |2 +-
 drivers/ata/pata_acpi.c  |2 +
 drivers/ata/pata_bf54x.c |   77 ++--
 drivers/ata/sata_fsl.c   | 1490 ++
 6 files changed, 1540 insertions(+), 48 deletions(-)
 create mode 100644 drivers/ata/sata_fsl.c

Alan Cox (1):
  libata-sff: Correct use of check_status()

Li Yang (1):
  drivers/ata: add support to Freescale 3.0Gbps SATA Controller

Sonic Zhang (1):
  Update libata driver for bf548 atapi controller against the 2.6.24 tree.

Tejun Heo (1):
  pata_acpi: fix build breakage if !CONFIG_PM

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 33f5eb0..ba63619 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -182,6 +182,15 @@ config PATA_ACPI
  firmware in the BIOS. This driver can sometimes handle
  otherwise unsupported hardware.
 
+config SATA_FSL
+   tristate Freescale 3.0Gbps SATA support
+   depends on PPC_MPC837x
+   help
+ This option enables support for Freescale 3.0Gbps SATA controller.
+ It can be found on MPC837x and MPC8315.
+
+ If unsure, say N.
+
 config PATA_ALI
tristate ALi PATA support (Experimental)
depends on PCI  EXPERIMENTAL
@@ -641,11 +650,4 @@ config PATA_BF54X
 
  If unsure, say N.
 
-config PATA_BF54X_DMA
-   bool DMA mode
-   depends on PATA_BF54X
-   default y
-   help
- Enable DMA mode for Blackfin ATAPI controller.
-
 endif # ATA
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index 6bdc307..b13feb2 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_SATA_ULI)+= sata_uli.o
 obj-$(CONFIG_SATA_MV)  += sata_mv.o
 obj-$(CONFIG_SATA_INIC162X)+= sata_inic162x.o
 obj-$(CONFIG_PDC_ADMA) += pdc_adma.o
+obj-$(CONFIG_SATA_FSL) += sata_fsl.o
 
 obj-$(CONFIG_PATA_ALI) += pata_ali.o
 obj-$(CONFIG_PATA_AMD) += pata_amd.o
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 026439e..1232dcb 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -156,7 +156,7 @@ void ata_tf_read(struct ata_port *ap, struct ata_taskfile 
*tf)
 {
struct ata_ioports *ioaddr = ap-ioaddr;
 
-   tf-command = ata_check_status(ap);
+   tf-command = ata_chk_status(ap);
tf-feature = ioread8(ioaddr-error_addr);
tf-nsect = ioread8(ioaddr-nsect_addr);
tf-lbal = ioread8(ioaddr-lbal_addr);
diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c
index 5d3920f..0f6f7bc 100644
--- a/drivers/ata/pata_acpi.c
+++ b/drivers/ata/pata_acpi.c
@@ -370,8 +370,10 @@ static struct pci_driver pacpi_pci_driver = {
.id_table   = pacpi_pci_tbl,
.probe  = pacpi_init_one,
.remove = ata_pci_remove_one,
+#ifdef CONFIG_PM
.suspend= ata_pci_device_suspend,
.resume = ata_pci_device_resume,
+#endif
 };
 
 static int __init pacpi_init(void)
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index 747549e..b5e3842 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -1092,14 +1092,15 @@ static unsigned int bfin_bus_softreset(struct ata_port 
*ap,
  * Note: Original code is ata_std_softreset().
  */
 
-static int bfin_std_softreset(struct ata_port *ap, unsigned int *classes,
+static int bfin_std_softreset(struct ata_link *link, unsigned int *classes,
unsigned long deadline)
 {
+   struct ata_port *ap = link-ap;
unsigned int slave_possible = ap-flags  ATA_FLAG_SLAVE_POSS;
unsigned int devmask = 0, err_mask;
u8 err;
 
-   if (ata_port_offline(ap)) {
+   if (ata_link_offline(link)) {
classes[0] = ATA_DEV_NONE;
goto out;
}
@@ -1122,9 +1123,11 @@ static int bfin_std_softreset(struct ata_port *ap, 
unsigned int *classes,
}
 
/* determine by signature whether we have ATA or ATAPI devices */
-   classes[0] = ata_dev_try_classify(ap, 0, err);
+   classes[0] = ata_dev_try_classify(ap-link.device[0],
+   devmask  (1  0), err);
if (slave_possible  err != 0x81)
-   classes[1] = ata_dev_try_classify(ap, 1, err);
+   classes[1] = ata_dev_try_classify(ap-link.device[1],
+ 

[git patches] libata fixes

2007-10-03 Thread Jeff Garzik

Fix ugly sata_mv bug, that exists due to lack of IOMMU knowledge about
device constraints (FUJITA Tomonori's current work should fix this issue
long term, hopefully).


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/pata_ixp4xx_cf.c |3 +++
 drivers/ata/pata_marvell.c   |4 ++--
 drivers/ata/sata_mv.c|   26 +++---
 3 files changed, 24 insertions(+), 9 deletions(-)

Jiri Slaby (1):
  Ata: pata_marvell, use ioread* for iomap-ped memory

Olof Johansson (1):
  libata: fix for sata_mv 64KB DMA segments

Scott Thompson (1):
  drivers/ata/pata_ixp4xx_cf.c: ioremap return code check

diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 4ca7fd6..5dea358 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -189,6 +189,9 @@ static __devinit int ixp4xx_pata_probe(struct 
platform_device *pdev)
data-cs0 = devm_ioremap(pdev-dev, cs0-start, 0x1000);
data-cs1 = devm_ioremap(pdev-dev, cs1-start, 0x1000);
 
+   if (!data-cs0 || !data-cs1)
+   return -ENOMEM;
+
irq = platform_get_irq(pdev, 0);
if (irq)
set_irq_type(irq, IRQT_RISING);
diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c
index ae206f3..b45506f 100644
--- a/drivers/ata/pata_marvell.c
+++ b/drivers/ata/pata_marvell.c
@@ -44,10 +44,10 @@ static int marvell_pre_reset(struct ata_port *ap, unsigned 
long deadline)
return -ENOMEM;
printk(BAR5:);
for(i = 0; i = 0x0F; i++)
-   printk(%02X:%02X , i, readb(barp + i));
+   printk(%02X:%02X , i, ioread8(barp + i));
printk(\n);
 
-   devices = readl(barp + 0x0C);
+   devices = ioread32(barp + 0x0C);
pci_iounmap(pdev, barp);
 
if ((pdev-device == 0x6145)  (ap-port_no == 0) 
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 11bf6c7..1a82e22 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1139,15 +1139,27 @@ static unsigned int mv_fill_sg(struct ata_queued_cmd 
*qc)
dma_addr_t addr = sg_dma_address(sg);
u32 sg_len = sg_dma_len(sg);
 
-   mv_sg-addr = cpu_to_le32(addr  0x);
-   mv_sg-addr_hi = cpu_to_le32((addr  16)  16);
-   mv_sg-flags_size = cpu_to_le32(sg_len  0x);
+   while (sg_len) {
+   u32 offset = addr  0x;
+   u32 len = sg_len;
 
-   if (ata_sg_is_last(sg, qc))
-   mv_sg-flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
+   if ((offset + sg_len  0x1))
+   len = 0x1 - offset;
+
+   mv_sg-addr = cpu_to_le32(addr  0x);
+   mv_sg-addr_hi = cpu_to_le32((addr  16)  16);
+   mv_sg-flags_size = cpu_to_le32(len);
+
+   sg_len -= len;
+   addr += len;
+
+   if (!sg_len  ata_sg_is_last(sg, qc))
+   mv_sg-flags_size |= 
cpu_to_le32(EPRD_FLAG_END_OF_TBL);
+
+   mv_sg++;
+   n_sg++;
+   }
 
-   mv_sg++;
-   n_sg++;
}
 
return n_sg;
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-09-25 Thread Jeff Garzik

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/pata_sis.c   |3 ++-
 drivers/ata/sata_sil24.c |   16 
 2 files changed, 14 insertions(+), 5 deletions(-)

Tejun Heo (2):
  sata_sil24: fix IRQ clearing race when PCIX_IRQ_WOC is used
  pata_sis: add missing UDMA5 timing value in sis_66_set_dmamode()

diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index 2bd7645..cce2834 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -375,8 +375,9 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct 
ata_device *adev)
int drive_pci = sis_old_port_base(adev);
u16 timing;
 
+   /* MWDMA 0-2 and UDMA 0-5 */
const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 };
-   const u16 udma_bits[]  = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000};
+   const u16 udma_bits[]  = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000, 
0x8000 };
 
pci_read_config_word(pdev, drive_pci, timing);
 
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index ef83e6b..233e886 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -888,6 +888,16 @@ static inline void sil24_host_intr(struct ata_port *ap)
u32 slot_stat, qc_active;
int rc;
 
+   /* If PCIX_IRQ_WOC, there's an inherent race window between
+* clearing IRQ pending status and reading PORT_SLOT_STAT
+* which may cause spurious interrupts afterwards.  This is
+* unavoidable and much better than losing interrupts which
+* happens if IRQ pending is cleared after reading
+* PORT_SLOT_STAT.
+*/
+   if (ap-flags  SIL24_FLAG_PCIX_IRQ_WOC)
+   writel(PORT_IRQ_COMPLETE, port + PORT_IRQ_STAT);
+
slot_stat = readl(port + PORT_SLOT_STAT);
 
if (unlikely(slot_stat  HOST_SSTAT_ATTN)) {
@@ -895,9 +905,6 @@ static inline void sil24_host_intr(struct ata_port *ap)
return;
}
 
-   if (ap-flags  SIL24_FLAG_PCIX_IRQ_WOC)
-   writel(PORT_IRQ_COMPLETE, port + PORT_IRQ_STAT);
-
qc_active = slot_stat  ~HOST_SSTAT_ATTN;
rc = ata_qc_complete_multiple(ap, qc_active, sil24_finish_qc);
if (rc  0)
@@ -910,7 +917,8 @@ static inline void sil24_host_intr(struct ata_port *ap)
return;
}
 
-   if (ata_ratelimit())
+   /* spurious interrupts are expected if PCIX_IRQ_WOC */
+   if (!(ap-flags  SIL24_FLAG_PCIX_IRQ_WOC)  ata_ratelimit())
ata_port_printk(ap, KERN_INFO, spurious interrupt 
(slot_stat 0x%x active_tag %d sactive 0x%x)\n,
slot_stat, ap-active_tag, ap-sactive);
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-09-20 Thread Jeff Garzik

Fixes from Alan, PCI IDs from ATI/AMD.

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/ahci.c|   10 ++
 drivers/ata/libata-core.c |4 
 drivers/ata/libata-sff.c  |5 -
 3 files changed, 14 insertions(+), 5 deletions(-)

Alan Cox (2):
  libata: Update the blacklist with a few more devices
  libata-sff: Fix documentation

henry su (1):
  [libata] ahci: add ATI SB800 PCI IDs

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 06f212f..c168203 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -418,10 +418,12 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 
/* ATI */
{ PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */
-   { PCI_VDEVICE(ATI, 0x4390), board_ahci_sb600 }, /* ATI SB700 IDE */
-   { PCI_VDEVICE(ATI, 0x4391), board_ahci_sb600 }, /* ATI SB700 AHCI */
-   { PCI_VDEVICE(ATI, 0x4392), board_ahci_sb600 }, /* ATI SB700 nraid5 */
-   { PCI_VDEVICE(ATI, 0x4393), board_ahci_sb600 }, /* ATI SB700 raid5 */
+   { PCI_VDEVICE(ATI, 0x4390), board_ahci_sb600 }, /* ATI SB700/800 */
+   { PCI_VDEVICE(ATI, 0x4391), board_ahci_sb600 }, /* ATI SB700/800 */
+   { PCI_VDEVICE(ATI, 0x4392), board_ahci_sb600 }, /* ATI SB700/800 */
+   { PCI_VDEVICE(ATI, 0x4393), board_ahci_sb600 }, /* ATI SB700/800 */
+   { PCI_VDEVICE(ATI, 0x4394), board_ahci_sb600 }, /* ATI SB700/800 */
+   { PCI_VDEVICE(ATI, 0x4395), board_ahci_sb600 }, /* ATI SB700/800 */
 
/* VIA */
{ PCI_VDEVICE(VIA, 0x3349), board_ahci_vt8251 }, /* VIA VT8251 */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index c43de9a..772be09 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3778,6 +3778,9 @@ static const struct ata_blacklist_entry 
ata_device_blacklist [] = {
{ Maxtor 6L250S0, BANC1G10, ATA_HORKAGE_NONCQ },
{ Maxtor 6B200M0, BANC1BM0, ATA_HORKAGE_NONCQ },
{ Maxtor 6B200M0, BANC1B10, ATA_HORKAGE_NONCQ },
+   { Maxtor 7B250S0, BANC1B70, ATA_HORKAGE_NONCQ, },
+   { Maxtor 7B300S0, BANC1B70, ATA_HORKAGE_NONCQ },
+   { Maxtor 7V300F0, VA111630, ATA_HORKAGE_NONCQ },
{ HITACHI HDS7250SASUN500G 0621KTAWSD, K2AOAJ0AHITACHI,
 ATA_HORKAGE_NONCQ },
/* NCQ hard hangs device under heavier load, needs hard power cycle */
@@ -3794,6 +3797,7 @@ static const struct ata_blacklist_entry 
ata_device_blacklist [] = {
{ WDC WD740ADFD-00NLR1, NULL, ATA_HORKAGE_NONCQ, },
{ FUJITSU MHV2080BH,  00840028, ATA_HORKAGE_NONCQ, },
{ ST9160821AS,3.CLF,ATA_HORKAGE_NONCQ, },
+   { ST3160812AS,3.AD, ATA_HORKAGE_NONCQ, },
{ SAMSUNG HD401LJ,ZZ100-15, ATA_HORKAGE_NONCQ, },
 
/* devices which puke on READ_NATIVE_MAX */
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 1cce219..8023167 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -297,7 +297,7 @@ void ata_bmdma_start (struct ata_queued_cmd *qc)
dmactl = ioread8(ap-ioaddr.bmdma_addr + ATA_DMA_CMD);
iowrite8(dmactl | ATA_DMA_START, ap-ioaddr.bmdma_addr + ATA_DMA_CMD);
 
-   /* Strictly, one may wish to issue a readb() here, to
+   /* Strictly, one may wish to issue an ioread8() here, to
 * flush the mmio write.  However, control also passes
 * to the hardware at this point, and it will interrupt
 * us when we are to resume control.  So, in effect,
@@ -307,6 +307,9 @@ void ata_bmdma_start (struct ata_queued_cmd *qc)
 * is expected, so I think it is best to not add a readb()
 * without first all the MMIO ATA cards/mobos.
 * Or maybe I'm just being paranoid.
+*
+* FIXME: The posting of this write means I/O starts are
+* unneccessarily delayed for MMIO
 */
 }
 
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-09-10 Thread Jeff Garzik

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/libata-core.c   |1 +
 drivers/ata/pata_it821x.c   |4 
 drivers/ata/pata_via.c  |   14 +++---
 drivers/ide/pci/via82cxxx.c |1 +
 include/linux/pci_ids.h |1 +
 5 files changed, 18 insertions(+), 3 deletions(-)

Jeff Norden (1):
  pata_it821x: fix lost interrupt with atapi devices

Joseph Chan (1):
  [libata, IDE] add new VIA bridge to VIA PATA drivers

Laurent Riffard (1):
  Fix broken pata_via cable detection

Tejun Heo (1):
  libata clear horkage on ata_dev_init()

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a3ee087..c43de9a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6035,6 +6035,7 @@ void ata_dev_init(struct ata_device *dev)
 */
spin_lock_irqsave(ap-lock, flags);
dev-flags = ~ATA_DFLAG_INIT_MASK;
+   dev-horkage = 0;
spin_unlock_irqrestore(ap-lock, flags);
 
memset((void *)dev + ATA_DEVICE_CLEAR_OFFSET, 0,
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index ed637ae..5d8b91e 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -533,6 +533,10 @@ static int it821x_check_atapi_dma(struct ata_queued_cmd 
*qc)
struct ata_port *ap = qc-ap;
struct it821x_dev *itdev = ap-private_data;
 
+   /* Only use dma for transfers to/from the media. */
+   if (qc-nbytes  2048)
+   return -EOPNOTSUPP;
+
/* No ATAPI DMA in smart mode */
if (itdev-smart)
return -EOPNOTSUPP;
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index ea18e33..636c4f1 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -97,6 +97,7 @@ static const struct via_isa_bridge {
u8 rev_max;
u16 flags;
 } via_isa_bridges[] = {
+   { vx800,  PCI_DEVICE_ID_VIA_VX800,0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST },
{ vt8237s,PCI_DEVICE_ID_VIA_8237S,0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST },
{ vt8251, PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST },
{ cx700,  PCI_DEVICE_ID_VIA_CX700,0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST },
@@ -243,7 +244,6 @@ static void via_do_set_mode(struct ata_port *ap, struct 
ata_device *adev, int mo
int ut;
int offset = 3 - (2*ap-port_no) - adev-devno;
 
-
/* Calculate the timing values we require */
ata_timing_compute(adev, mode, t, T, UT);
 
@@ -290,9 +290,17 @@ static void via_do_set_mode(struct ata_port *ap, struct 
ata_device *adev, int mo
ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07;
break;
}
+
/* Set UDMA unless device is not UDMA capable */
-   if (udma_type)
-   pci_write_config_byte(pdev, 0x50 + offset, ut);
+   if (udma_type) {
+   u8 cable80_status;
+
+   /* Get 80-wire cable detection bit */
+   pci_read_config_byte(pdev, 0x50 + offset, cable80_status);
+   cable80_status = 0x10;
+
+   pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status);
+   }
 }
 
 static void via_set_piomode(struct ata_port *ap, struct ata_device *adev)
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index 581316f..8c53938 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -74,6 +74,7 @@ static struct via_isa_bridge {
u8 udma_mask;
u8 flags;
 } via_isa_bridges[] = {
+   { vx800,  PCI_DEVICE_ID_VIA_VX800,0x00, 0x2f, ATA_UDMA6, 
VIA_BAD_AST },
{ cx700,  PCI_DEVICE_ID_VIA_CX700,0x00, 0x2f, ATA_UDMA6, 
VIA_BAD_AST },
{ vt8237s,PCI_DEVICE_ID_VIA_8237S,0x00, 0x2f, ATA_UDMA6, 
VIA_BAD_AST },
{ vt6410, PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, ATA_UDMA6, 
VIA_BAD_AST },
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 17168f3..d41747b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1343,6 +1343,7 @@
 #define PCI_DEVICE_ID_VIA_8231_4   0x8235
 #define PCI_DEVICE_ID_VIA_8365_1   0x8305
 #define PCI_DEVICE_ID_VIA_CX7000x8324
+#define PCI_DEVICE_ID_VIA_VX8000x8353
 #define PCI_DEVICE_ID_VIA_8371_1   0x8391
 #define PCI_DEVICE_ID_VIA_82C598_1 0x8598
 #define PCI_DEVICE_ID_VIA_838X_1   0xB188
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-08-31 Thread Jeff Garzik

Fixes, some new ids, and a version bump that we discovered was missing
from several drivers.

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/ata_generic.c  |2 +-
 drivers/ata/ata_piix.c |   72 +++-
 drivers/ata/libata-core.c  |   16 +++--
 drivers/ata/pata_ali.c |2 +-
 drivers/ata/pata_amd.c |2 +-
 drivers/ata/pata_atiixp.c  |2 +-
 drivers/ata/pata_cs5520.c  |2 +-
 drivers/ata/pata_cs5530.c  |2 +-
 drivers/ata/pata_isapnp.c  |2 +-
 drivers/ata/pata_it821x.c  |2 +-
 drivers/ata/pata_marvell.c |2 +
 drivers/ata/pata_mpc52xx.c |2 +-
 drivers/ata/pata_pcmcia.c  |2 +-
 drivers/ata/pata_pdc2027x.c|2 +-
 drivers/ata/pata_platform.c|2 +-
 drivers/ata/pata_sc1200.c  |2 +-
 drivers/ata/pata_scc.c |2 +-
 drivers/ata/pata_serverworks.c |2 +-
 drivers/ata/pata_sil680.c  |2 +-
 drivers/ata/pata_sl82c105.c|2 +-
 drivers/ata/pdc_adma.c |2 +-
 drivers/ata/sata_inic162x.c|2 +-
 drivers/ata/sata_mv.c  |2 +-
 drivers/ata/sata_nv.c  |2 +-
 drivers/ata/sata_promise.c |6 ++--
 drivers/ata/sata_qstor.c   |2 +-
 drivers/ata/sata_sil.c |2 +-
 drivers/ata/sata_sil24.c   |2 +-
 drivers/ata/sata_sis.c |2 +-
 drivers/ata/sata_svw.c |2 +-
 drivers/ata/sata_sx4.c |2 +-
 drivers/ata/sata_uli.c |2 +-
 drivers/ata/sata_via.c |2 +-
 drivers/ata/sata_vsc.c |2 +-
 include/linux/ata.h|   13 +++
 include/linux/libata.h |1 +
 36 files changed, 133 insertions(+), 37 deletions(-)

Alan Cox (2):
  libata-core: Allow translation setting to fail
  pata_marvell: Add more identifiers

Bartlomiej Zolnierkiewicz (1):
  ata: add ATA_MWDMA* and ATA_SWDMA* defines

Jason Gaston (1):
  ata_piix: IDE mode SATA patch for Intel Tolapai

Jeff Garzik (1):
  [libata] Bump driver versions

Mikael Pettersson (1):
  sata_promise: FastTrack TX4200 is a second-generation chip

Tejun Heo (3):
  ata_piix: add Satellite U200 to broken suspend list
  libata: implement BROKEN_HPA horkage and apply it to affected drives
  ata_piix: implement IOCFG bit18 quirk

diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c
index 430fcf4..9454669 100644
--- a/drivers/ata/ata_generic.c
+++ b/drivers/ata/ata_generic.c
@@ -26,7 +26,7 @@
 #include linux/libata.h
 
 #define DRV_NAME ata_generic
-#define DRV_VERSION 0.2.12
+#define DRV_VERSION 0.2.13
 
 /*
  * A generic parallel ATA driver using libata
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 071d274..e40c94f 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -94,7 +94,7 @@
 #include linux/dmi.h
 
 #define DRV_NAME   ata_piix
-#define DRV_VERSION2.11
+#define DRV_VERSION2.12
 
 enum {
PIIX_IOCFG  = 0x54, /* IDE I/O configuration register */
@@ -130,6 +130,7 @@ enum {
ich6m_sata_ahci = 8,
ich8_sata_ahci  = 9,
piix_pata_mwdma = 10,   /* PIIX3 MWDMA only */
+   tolapai_sata_ahci   = 11,
 
/* constants for mapping table */
P0  = 0,  /* port 0 */
@@ -253,6 +254,8 @@ static const struct pci_device_id piix_pci_tbl[] = {
{ 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
/* SATA Controller IDE (ICH9M) */
{ 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
+   /* SATA Controller IDE (Tolapai) */
+   { 0x8086, 0x5028, PCI_ANY_ID, PCI_ANY_ID, 0, 0, tolapai_sata_ahci },
 
{ } /* terminate list */
 };
@@ -441,12 +444,25 @@ static const struct piix_map_db ich8_map_db = {
},
 };
 
+static const struct piix_map_db tolapai_map_db = {
+.mask = 0x3,
+.port_enable = 0x3,
+.map = {
+/* PM   PS   SM   SS   MAP */
+{  P0,  NA,  P1,  NA }, /* 00b */
+{  RV,  RV,  RV,  RV }, /* 01b */
+{  RV,  RV,  RV,  RV }, /* 10b */
+{  RV,  RV,  RV,  RV },
+},
+};
+
 static const struct piix_map_db *piix_map_db_table[] = {
[ich5_sata] = ich5_map_db,
[ich6_sata] = ich6_map_db,
[ich6_sata_ahci]= ich6_map_db,
[ich6m_sata_ahci]   = ich6m_map_db,
[ich8_sata_ahci]= ich8_map_db,
+   [tolapai_sata_ahci] = tolapai_map_db,
 };
 
 static struct ata_port_info piix_port_info[] = {
@@ -560,6 +576,17 @@ static struct ata_port_info piix_port_info[] = {
.mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but 
slow */
.port_ops   = piix_pata_ops,

[git patches] libata fixes

2007-08-23 Thread Jeff Garzik

Fixes + more laptop IDs

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/libata-core.c   |7 ++-
 drivers/ata/pata_pdc2027x.c |   18 +-
 drivers/ata/pata_sis.c  |1 +
 drivers/ata/pata_via.c  |5 -
 4 files changed, 20 insertions(+), 11 deletions(-)

Alan Cox (2):
  pata_sis: Add the FSC Amilo and friends
  pata_via: Add Arima W730-K8 and other rebadgings

Mikael Pettersson (1):
  pata_pdc2027x: PLL detection fixes

Tejun Heo (2):
  libata: fix n_sectors failure handling during revalidation
  libata: don't check n_sectors during revalidation if zero

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 99d4fbf..2ad4dda 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3700,11 +3700,16 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned 
int readid_flags)
goto fail;
 
/* verify n_sectors hasn't changed */
-   if (dev-class == ATA_DEV_ATA  dev-n_sectors != n_sectors) {
+   if (dev-class == ATA_DEV_ATA  n_sectors 
+   dev-n_sectors != n_sectors) {
ata_dev_printk(dev, KERN_INFO, n_sectors mismatch 
   %llu != %llu\n,
   (unsigned long long)n_sectors,
   (unsigned long long)dev-n_sectors);
+
+   /* restore original n_sectors */
+   dev-n_sectors = n_sectors;
+
rc = -ENODEV;
goto fail;
}
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index 69a5aa4..e3245b3 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -563,13 +563,13 @@ static long pdc_read_counter(struct ata_host *host)
u32 bccrl, bccrh, bccrlv, bccrhv;
 
 retry:
-   bccrl = readl(mmio_base + PDC_BYTE_COUNT)  0x;
-   bccrh = readl(mmio_base + PDC_BYTE_COUNT + 0x100)  0x;
+   bccrl = readl(mmio_base + PDC_BYTE_COUNT)  0x7fff;
+   bccrh = readl(mmio_base + PDC_BYTE_COUNT + 0x100)  0x7fff;
rmb();
 
/* Read the counter values again for verification */
-   bccrlv = readl(mmio_base + PDC_BYTE_COUNT)  0x;
-   bccrhv = readl(mmio_base + PDC_BYTE_COUNT + 0x100)  0x;
+   bccrlv = readl(mmio_base + PDC_BYTE_COUNT)  0x7fff;
+   bccrhv = readl(mmio_base + PDC_BYTE_COUNT + 0x100)  0x7fff;
rmb();
 
counter = (bccrh  15) | bccrl;
@@ -692,16 +692,16 @@ static long pdc_detect_pll_input_clock(struct ata_host 
*host)
struct timeval start_time, end_time;
long pll_clock, usec_elapsed;
 
-   /* Read current counter value */
-   start_count = pdc_read_counter(host);
-   do_gettimeofday(start_time);
-
/* Start the test mode */
scr = readl(mmio_base + PDC_SYS_CTL);
PDPRINTK(scr[%X]\n, scr);
writel(scr | (0x01  14), mmio_base + PDC_SYS_CTL);
readl(mmio_base + PDC_SYS_CTL); /* flush */
 
+   /* Read current counter value */
+   start_count = pdc_read_counter(host);
+   do_gettimeofday(start_time);
+
/* Let the counter run for 100 ms. */
mdelay(100);
 
@@ -719,7 +719,7 @@ static long pdc_detect_pll_input_clock(struct ata_host 
*host)
usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 100 +
(end_time.tv_usec - start_time.tv_usec);
 
-   pll_clock = (start_count - end_count) / 100 *
+   pll_clock = ((start_count - end_count)  0x3fff) / 100 *
(1 / usec_elapsed);
 
PDPRINTK(start[%ld] end[%ld] \n, start_count, end_count);
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index 66bd0e8..2bd7645 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -54,6 +54,7 @@ struct sis_laptop {
 static const struct sis_laptop sis_laptop[] = {
/* devid, subvendor, subdev */
{ 0x5513, 0x1043, 0x1107 }, /* ASUS A6K */
+   { 0x5513, 0x1734, 0x105F }, /* FSC Amilo A1630 */
/* end marker */
{ 0, }
 };
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index f645fe2..ea18e33 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -63,7 +63,7 @@
 #include linux/dmi.h
 
 #define DRV_NAME pata_via
-#define DRV_VERSION 0.3.1
+#define DRV_VERSION 0.3.2
 
 /*
  * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx
@@ -144,6 +144,9 @@ static int via_cable_override(struct pci_dev *pdev)
/* Systems by DMI */
if (dmi_check_system(cable_dmi_table))
return 1;
+   /* Arima W730-K8/Targa Visionary 811/... */
+   if (pdev-subsystem_vendor == 0x161F  pdev-subsystem_device == 
0x2032)
+   return 1;
return 0;
 }
 
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to 

[git patches] libata fixes

2007-08-15 Thread Jeff Garzik

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/ata_piix.c |9 -
 drivers/ata/libata-core.c  |2 +-
 drivers/ata/pata_artop.c   |   19 ++-
 drivers/ata/pata_hpt37x.c  |   20 +---
 drivers/ata/pata_hpt3x2n.c |8 +---
 drivers/ata/pata_isapnp.c  |2 ++
 drivers/ata/sata_mv.c  |3 +++
 7 files changed, 42 insertions(+), 21 deletions(-)

Alan Cox (1):
  sata_mv: PCI IDs for Hightpoint RocketRaid 1740/1742

Bartlomiej Zolnierkiewicz (1):
  pata_artop: fix UDMA5 for AEC6280[R] and UDMA6 for AEC6880[R]

Jeff Garzik (1):
  [libata] pata_isapnp: replace missing module device table

Ryan Power (1):
  libata: adjust libata to ignore errors after spinup

Sergei Shtylyov (2):
  pata_hpt37x: actually clock HPT374 with 50 MHz DPLL (take 2)
  pata_hpt{37x|3x2n}: fix clock reporting (take 2)

Tejun Heo (2):
  ata_piix: update map 10b for ich8m
  ata_piix: add TECRA M7 to broken suspend list

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index a78832e..071d274 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -436,7 +436,7 @@ static const struct piix_map_db ich8_map_db = {
/* PM   PS   SM   SS   MAP */
{  P0,  P2,  P1,  P3 }, /* 00b (hardwired when in AHCI) */
{  RV,  RV,  RV,  RV },
-   {  IDE,  IDE,  NA,  NA }, /* 10b (IDE mode) */
+   {  P0,  P2, IDE, IDE }, /* 10b (IDE mode) */
{  RV,  RV,  RV,  RV },
},
 };
@@ -901,6 +901,13 @@ static int piix_broken_suspend(void)
},
},
{
+   .ident = TECRA M7,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
+   DMI_MATCH(DMI_PRODUCT_NAME, TECRA M7),
+   },
+   },
+   {
.ident = Satellite U205,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 60e78be..99d4fbf 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1723,7 +1723,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int 
*p_class,
tf.protocol = ATA_PROT_NODATA;
tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
err_mask = ata_exec_internal(dev, tf, NULL, DMA_NONE, NULL, 0);
-   if (err_mask) {
+   if (err_mask  id[2] != 0x738c) {
rc = -EIO;
reason = SPINUP failed;
goto err_out;
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index ce589d9..b5352eb 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -2,6 +2,7 @@
  *pata_artop.c - ARTOP ATA controller driver
  *
  * (C) 2006 Red Hat [EMAIL PROTECTED]
+ * (C) 2007 Bartlomiej Zolnierkiewicz
  *
  *Based in part on drivers/ide/pci/aec62xx.c
  * Copyright (C) 1999-2002 Andre Hedrick [EMAIL PROTECTED]
@@ -28,7 +29,7 @@
 #include linux/ata.h
 
 #define DRV_NAME   pata_artop
-#define DRV_VERSION0.4.3
+#define DRV_VERSION0.4.4
 
 /*
  * The ARTOP has 33 Mhz and over clocked timing tables. Until we
@@ -430,7 +431,7 @@ static int artop_init_one (struct pci_dev *pdev, const 
struct pci_device_id *id)
.udma_mask  = ATA_UDMA4,
.port_ops   = artop6260_ops,
};
-   static const struct ata_port_info info_626x_fast = {
+   static const struct ata_port_info info_628x = {
.sht= artop_sht,
.flags  = ATA_FLAG_SLAVE_POSS,
.pio_mask   = 0x1f, /* pio0-4 */
@@ -438,6 +439,14 @@ static int artop_init_one (struct pci_dev *pdev, const 
struct pci_device_id *id)
.udma_mask  = ATA_UDMA5,
.port_ops   = artop6260_ops,
};
+   static const struct ata_port_info info_628x_fast = {
+   .sht= artop_sht,
+   .flags  = ATA_FLAG_SLAVE_POSS,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .mwdma_mask = 0x07, /* mwdma0-2 */
+   .udma_mask  = ATA_UDMA6,
+   .port_ops   = artop6260_ops,
+   };
const struct ata_port_info *ppi[] = { NULL, NULL };
 
if (!printed_version++)
@@ -455,13 +464,13 @@ static int artop_init_one (struct pci_dev *pdev, const 
struct pci_device_id *id)
}
else if (id-driver_data == 1)  /* 6260 */
ppi[0] = info_626x;
-   else if (id-driver_data == 2)  { /* 6260 or 6260 + fast */
+   else if (id-driver_data == 2)  { /* 6280 or 

[git patches] libata fixes

2007-08-07 Thread Jeff Garzik

The only non-fix are two sata_mv PCI ID additions.

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/ata_piix.c|2 +-
 drivers/ata/pata_isapnp.c |2 ++
 drivers/ata/sata_mv.c |3 +++
 3 files changed, 6 insertions(+), 1 deletions(-)

Alan Cox (1):
  sata_mv: PCI IDs for Hightpoint RocketRaid 1740/1742

Jeff Garzik (1):
  [libata] pata_isapnp: replace missing module device table

Tejun Heo (1):
  ata_piix: update map 10b for ich8m

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index a78832e..c5b4509 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -436,7 +436,7 @@ static const struct piix_map_db ich8_map_db = {
/* PM   PS   SM   SS   MAP */
{  P0,  P2,  P1,  P3 }, /* 00b (hardwired when in AHCI) */
{  RV,  RV,  RV,  RV },
-   {  IDE,  IDE,  NA,  NA }, /* 10b (IDE mode) */
+   {  P0,  P2, IDE, IDE }, /* 10b (IDE mode) */
{  RV,  RV,  RV,  RV },
},
 };
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c
index 5525518..91a396f 100644
--- a/drivers/ata/pata_isapnp.c
+++ b/drivers/ata/pata_isapnp.c
@@ -139,6 +139,8 @@ static struct pnp_device_id isapnp_devices[] = {
{.id = }
 };
 
+MODULE_DEVICE_TABLE(pnp, isapnp_devices);
+
 static struct pnp_driver isapnp_driver = {
.name   = DRV_NAME,
.id_table   = isapnp_devices,
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 8ec5208..3acf65e 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -621,6 +621,9 @@ static const struct pci_device_id mv_pci_tbl[] = {
{ PCI_VDEVICE(MARVELL, 0x5041), chip_504x },
{ PCI_VDEVICE(MARVELL, 0x5080), chip_5080 },
{ PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
+   /* RocketRAID 1740/174x have different identifiers */
+   { PCI_VDEVICE(TTI, 0x1740), chip_508x },
+   { PCI_VDEVICE(TTI, 0x1742), chip_508x },
 
{ PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
{ PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-08-01 Thread Jeff Garzik

The only notable: GregKH wanted the pci_reenable_device() change
associated with ata_piix to go in before the release, to avoiding
release with an imperfect API.

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/ata_piix.c|   74 +
 drivers/ata/libata-core.c |1 +
 drivers/ata/libata-sff.c  |4 ++
 drivers/ata/pata_cmd64x.c |8 ++--
 drivers/ata/pata_sis.c|   20 +---
 drivers/pci/pci-driver.c  |2 +-
 drivers/pci/pci.c |7 ++--
 include/linux/pci.h   |2 +-
 8 files changed, 64 insertions(+), 54 deletions(-)

Alan Cox (2):
  pata_cmd64x: Correct the speed ranges
  libata-sff; Unbreak non DMA capable controllers again

Bartlomiej Zolnierkiewicz (1):
  pata_sis: fix MWDMA for = UDMA66 chipsets and UDMA for UDMA33 chipsets

Tejun Heo (4):
  pci: rename __pci_reenable_device() to pci_reenable_device()
  ata_piix: implement piix_borken_suspend()
  ata_piix: add Tecra M3 to broken suspend blacklist
  libata: blacklist SAMSUNG HD401LJ / ZZ100-15 for NCQ

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index ad07086..a78832e 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -890,37 +890,46 @@ static void ich_set_dmamode (struct ata_port *ap, struct 
ata_device *adev)
 }
 
 #ifdef CONFIG_PM
-static struct dmi_system_id piix_broken_suspend_dmi_table[] = {
-   {
-   .ident = TECRA M5,
-   .matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
-   DMI_MATCH(DMI_PRODUCT_NAME, TECRA M5),
-   },
-   },
-   {
-   .ident = Satellite U200,
-   .matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
-   DMI_MATCH(DMI_PRODUCT_NAME, Satellite U200),
+static int piix_broken_suspend(void)
+{
+   static struct dmi_system_id sysids[] = {
+   {
+   .ident = TECRA M5,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
+   DMI_MATCH(DMI_PRODUCT_NAME, TECRA M5),
+   },
},
-   },
-   {
-   .ident = Satellite U205,
-   .matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
-   DMI_MATCH(DMI_PRODUCT_NAME, Satellite U205),
+   {
+   .ident = Satellite U205,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
+   DMI_MATCH(DMI_PRODUCT_NAME, Satellite U205),
+   },
},
-   },
-   {
-   .ident = Portege M500,
-   .matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
-   DMI_MATCH(DMI_PRODUCT_NAME, PORTEGE M500),
+   {
+   .ident = Portege M500,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
+   DMI_MATCH(DMI_PRODUCT_NAME, PORTEGE M500),
+   },
},
-   },
-   { }
-};
+   { }
+   };
+   static const char *oemstrs[] = {
+   Tecra M3,,
+   };
+   int i;
+
+   if (dmi_check_system(sysids))
+   return 1;
+
+   for (i = 0; i  ARRAY_SIZE(oemstrs); i++)
+   if (dmi_find_device(DMI_DEV_TYPE_OEM_STRING, oemstrs[i], NULL))
+   return 1;
+
+   return 0;
+}
 
 static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
 {
@@ -937,8 +946,7 @@ static int piix_pci_device_suspend(struct pci_dev *pdev, 
pm_message_t mesg)
 * cycles and power trying to do something to the sleeping
 * beauty.
 */
-   if (dmi_check_system(piix_broken_suspend_dmi_table) 
-   mesg.event == PM_EVENT_SUSPEND) {
+   if (piix_broken_suspend()  mesg.event == PM_EVENT_SUSPEND) {
pci_save_state(pdev);
 
/* mark its power state as unknown, since we don't
@@ -973,10 +981,10 @@ static int piix_pci_device_resume(struct pci_dev *pdev)
pci_restore_state(pdev);
 
/* PCI device wasn't disabled during suspend.  Use
-* __pci_reenable_device() to avoid affecting the
-* enable count.
+* pci_reenable_device() to avoid affecting the enable
+* count.
 */
-   rc = __pci_reenable_device(pdev);
+   rc = pci_reenable_device(pdev);
if (rc)
dev_printk(KERN_ERR, pdev-dev, failed to enable 
   device after resume 

Re: [git patches] libata fixes

2007-07-03 Thread Linus Torvalds


On Tue, 3 Jul 2007, Alan Cox wrote:

  Chuck Ebbert (1):
pata_ali: fix UDMA settings
 
 Could you please fix your git tree to have the proper credits for patches
 you pull from bugzilla. 
 
 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=242472

I don't think it is Jeff who needs to fix anything: it seems that it is 
Chuck Ebbert you should talk to. He's the one that dropped the 
attribution. Probably because of some insane system he uses (he has a 
comment in that bugzilla about patch from comment #14 is in CVS now..

CVS? What kind if insane setup do you have there at Red Hat?

Linus
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-07-03 Thread Alan Cox
 attribution. Probably because of some insane system he uses (he has a 
 comment in that bugzilla about patch from comment #14 is in CVS now..
 
 CVS? What kind if insane setup do you have there at Red Hat?

CVS is used for tracking patch sets for RPMS rather than source trees.
Its quite good at that job and its reliable and proven and has been done
that way for years. When you are keeping a stable distribution for large
business end users the stable and proven wins over new technology...

Alan
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-07-02 Thread Jeff Garzik

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 |5 
 drivers/ata/libata-core.c   |3 +-
 drivers/ata/pata_pdc2027x.c |   11 -
 drivers/ata/pata_sis.c  |   46 +-
 drivers/ata/sata_inic162x.c |7 ++
 drivers/ata/sata_nv.c   |2 +
 drivers/ata/sata_sis.c  |   39 +--
 drivers/ata/sis.h   |2 +-
 drivers/scsi/Kconfig|1 +
 9 files changed, 89 insertions(+), 27 deletions(-)

Albert Lee (2):
  libata: pata_pdc2027x PLL input clock fix
  libata: remove reading alt_status from ata_hsm_qc_complete()

Randy Dunlap (1):
  scsi disk help file is not complete

Robert Hancock (1):
  sata_nv: allow changing queue depth

Tejun Heo (2):
  sata_inic162x: disable LBA48 devices
  libata: add HTS541616J9SA00 to NCQ blacklist

Uwe Koziolek (1):
  libata: PATA-mode fixes for sis_sata

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index b4a8d60..4ad8675 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -16,6 +16,11 @@ menuconfig ATA
  that speaks the ATA protocol, also called ATA controller),
  because you will be asked for it.
 
+ NOTE: ATA enables basic SCSI support; *however*,
+ 'SCSI disk support', 'SCSI tape support', or
+ 'SCSI CDROM support' may also be needed,
+ depending on your hardware configuration.
+
 if ATA
 
 config ATA_NONSTANDARD
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index bfc59a1..2407f84 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3798,6 +3798,7 @@ static const struct ata_blacklist_entry 
ata_device_blacklist [] = {
/* Drives which do spurious command completion */
{ HTS541680J9SA00,SB2IC7EP, ATA_HORKAGE_NONCQ, },
{ HTS541612J9SA00,SBDIC7JP, ATA_HORKAGE_NONCQ, },
+   { Hitachi HTS541616J9SA00, SB4OC70P, ATA_HORKAGE_NONCQ, },
{ WDC WD740ADFD-00NLR1, NULL, ATA_HORKAGE_NONCQ, },
 
/* Devices with NCQ limits */
@@ -4781,8 +4782,6 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd 
*qc, int in_wq)
} else
ata_qc_complete(qc);
}
-
-   ata_altstatus(ap); /* flush */
 }
 
 /**
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index 0d2cc49..69a5aa4 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -689,10 +689,12 @@ static long pdc_detect_pll_input_clock(struct ata_host 
*host)
void __iomem *mmio_base = host-iomap[PDC_MMIO_BAR];
u32 scr;
long start_count, end_count;
-   long pll_clock;
+   struct timeval start_time, end_time;
+   long pll_clock, usec_elapsed;
 
/* Read current counter value */
start_count = pdc_read_counter(host);
+   do_gettimeofday(start_time);
 
/* Start the test mode */
scr = readl(mmio_base + PDC_SYS_CTL);
@@ -705,6 +707,7 @@ static long pdc_detect_pll_input_clock(struct ata_host 
*host)
 
/* Read the counter values again */
end_count = pdc_read_counter(host);
+   do_gettimeofday(end_time);
 
/* Stop the test mode */
scr = readl(mmio_base + PDC_SYS_CTL);
@@ -713,7 +716,11 @@ static long pdc_detect_pll_input_clock(struct ata_host 
*host)
readl(mmio_base + PDC_SYS_CTL); /* flush */
 
/* calculate the input clock in Hz */
-   pll_clock = (start_count - end_count) * 10;
+   usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 100 +
+   (end_time.tv_usec - start_time.tv_usec);
+
+   pll_clock = (start_count - end_count) / 100 *
+   (1 / usec_elapsed);
 
PDPRINTK(start[%ld] end[%ld] \n, start_count, end_count);
PDPRINTK(PLL input clock[%ld]Hz\n, pll_clock);
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index ec3ae93..cfe4ec6 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -560,6 +560,40 @@ static const struct ata_port_operations sis_133_ops = {
.port_start = ata_port_start,
 };
 
+static const struct ata_port_operations sis_133_for_sata_ops = {
+   .port_disable   = ata_port_disable,
+   .set_piomode= sis_133_set_piomode,
+   .set_dmamode= sis_133_set_dmamode,
+   .mode_filter= ata_pci_default_filter,
+
+   .tf_load= ata_tf_load,
+   .tf_read= ata_tf_read,
+   .check_status   = ata_check_status,
+   .exec_command   = ata_exec_command,
+   .dev_select = ata_std_dev_select,
+
+   .freeze = ata_bmdma_freeze,
+   .thaw   = ata_bmdma_thaw,
+   .error_handler  = 

Re: [git patches] libata fixes

2007-06-28 Thread Mikael Pettersson
On Wed, 27 Jun 2007 03:35:26 -0400, Jeff Garzik wrote:
Tejun Heo (9):
  libata: kill the infamous abnormal status message
  libata: kill non-sense warning message
  libata: be less verbose about hpa
  libata: remove unused variable from ata_eh_reset()
  libata: fix ata_dev_disable()
  libata: fix infinite EH waiting bug
  libata: call ata_check_atapi_dma() with qc better prepared
  libata: use PIO for non-16 byte aligned ATAPI commands
  libata: kill ATA_HORKAGE_DMA_RW_ONLY

These changes fixed the CDROM IDENTIFY failures one of
my older test machines used to get with libata. I now
get much nicer results on that machine:

ata_piix :00:1f.1: version 2.11
PCI: Setting latency timer of device :00:1f.1 to 64
scsi0 : ata_piix
scsi1 : ata_piix
ata1: PATA max UDMA/100 cmd 0x000101f0 ctl 0x000103f6 bmdma 0x0001f000 irq 14
ata2: PATA max UDMA/100 cmd 0x00010170 ctl 0x00010376 bmdma 0x0001f008 irq 15
ata1.00: ATA-5: IC35L080AVVA07-0, VA4OA52A, max UDMA/100
ata1.00: 160836480 sectors, multi 16: LBA 
ata1.00: configured for UDMA/100
ata2.00: ATAPI: CRD-8320B, 1.12, max MWDMA2
ata2.01: ATAPI: Hewlett-Packard CD-Writer Plus 9100, 1.0c, max UDMA/33
ata2.00: configured for MWDMA2
ata2.01: configured for UDMA/33
scsi 0:0:0:0: Direct-Access ATA  IC35L080AVVA07-0 VA4O PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 160836480 512-byte hardware sectors (82348 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support 
DPO or FUA
sd 0:0:0:0: [sda] 160836480 512-byte hardware sectors (82348 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support 
DPO or FUA
 sda: sda1 sda2 sda3 sda4  sda5 sda6 
sd 0:0:0:0: [sda] Attached SCSI disk
scsi 1:0:0:0: CD-ROMGoldStar CD-ROM CRD-8320B 1.12 PQ: 0 ANSI: 5
scsi 1:0:1:0: CD-ROMHP   CD-Writer+ 9100  1.0c PQ: 0 ANSI: 5

It's the CRD-8320B that used to time out and fail IDENTIFY.

Tested-by: Mikael Pettersson [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-06-27 Thread Jeff Garzik

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/libata-core.c |   56 +++-
 drivers/ata/libata-eh.c   |7 +
 drivers/ata/libata-scsi.c |   20 ++-
 drivers/ata/pata_hpt37x.c |4 +-
 drivers/ata/pata_it821x.c |2 +-
 include/linux/libata.h|9 ++-
 6 files changed, 35 insertions(+), 63 deletions(-)

Alan Cox (1):
  HPT374 is UDMA100 not UDMA133

Randy Dunlap (1):
  pata_it821x: fix section mismatch warning

Tejun Heo (9):
  libata: kill the infamous abnormal status message
  libata: kill non-sense warning message
  libata: be less verbose about hpa
  libata: remove unused variable from ata_eh_reset()
  libata: fix ata_dev_disable()
  libata: fix infinite EH waiting bug
  libata: call ata_check_atapi_dma() with qc better prepared
  libata: use PIO for non-16 byte aligned ATAPI commands
  libata: kill ATA_HORKAGE_DMA_RW_ONLY

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index adfae9d..bfc59a1 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -600,8 +600,9 @@ static const char *sata_spd_string(unsigned int spd)
 
 void ata_dev_disable(struct ata_device *dev)
 {
-   if (ata_dev_enabled(dev)  ata_msg_drv(dev-ap)) {
-   ata_dev_printk(dev, KERN_WARNING, disabled\n);
+   if (ata_dev_enabled(dev)) {
+   if (ata_msg_drv(dev-ap))
+   ata_dev_printk(dev, KERN_WARNING, disabled\n);
ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 |
 ATA_DNXFER_QUIET);
dev-class++;
@@ -983,11 +984,6 @@ static u64 ata_hpa_resize(struct ata_device *dev)
else
hpa_sectors = ata_read_native_max_address(dev);
 
-   /* if no hpa, both should be equal */
-   ata_dev_printk(dev, KERN_INFO, %s 1: sectors = %lld, 
-   hpa_sectors = %lld\n,
-   __FUNCTION__, (long long)sectors, (long long)hpa_sectors);
-
if (hpa_sectors  sectors) {
ata_dev_printk(dev, KERN_INFO,
Host Protected Area detected:\n
@@ -1009,7 +1005,11 @@ static u64 ata_hpa_resize(struct ata_device *dev)
return hpa_sectors;
}
}
-   }
+   } else if (hpa_sectors  sectors)
+   ata_dev_printk(dev, KERN_WARNING, %s 1: hpa sectors (%lld) 
+  is smaller than sectors (%lld)\n, __FUNCTION__,
+  (long long)hpa_sectors, (long long)sectors);
+
return sectors;
 }
 
@@ -2046,10 +2046,6 @@ int ata_dev_configure(struct ata_device *dev)
dev-max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128,
 dev-max_sectors);
 
-   /* limit ATAPI DMA to R/W commands only */
-   if (ata_device_blacklisted(dev)  ATA_HORKAGE_DMA_RW_ONLY)
-   dev-horkage |= ATA_HORKAGE_DMA_RW_ONLY;
-
if (ap-ops-dev_config)
ap-ops-dev_config(dev);
 
@@ -3780,8 +3776,7 @@ static const struct ata_blacklist_entry 
ata_device_blacklist [] = {
{ IOMEGA  ZIP 250   ATAPI, NULL,  ATA_HORKAGE_NODMA }, /* 
temporary fix */
 
/* Weird ATAPI devices */
-   { TORiSAN DVD-ROM DRD-N216, NULL, ATA_HORKAGE_MAX_SEC_128 |
-   ATA_HORKAGE_DMA_RW_ONLY },
+   { TORiSAN DVD-ROM DRD-N216, NULL, ATA_HORKAGE_MAX_SEC_128 },
 
/* Devices we expect to fail diagnostics */
 
@@ -4109,6 +4104,7 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
if (idx)
ap-prd[idx - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT);
 }
+
 /**
  * ata_check_atapi_dma - Check whether ATAPI DMA can be supported
  * @qc: Metadata associated with taskfile to check
@@ -4126,33 +4122,19 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
 int ata_check_atapi_dma(struct ata_queued_cmd *qc)
 {
struct ata_port *ap = qc-ap;
-   int rc = 0; /* Assume ATAPI DMA is OK by default */
-
-   /* some drives can only do ATAPI DMA on read/write */
-   if (unlikely(qc-dev-horkage  ATA_HORKAGE_DMA_RW_ONLY)) {
-   struct scsi_cmnd *cmd = qc-scsicmd;
-   u8 *scsicmd = cmd-cmnd;
-
-   switch (scsicmd[0]) {
-   case READ_10:
-   case WRITE_10:
-   case READ_12:
-   case WRITE_12:
-   case READ_6:
-   case WRITE_6:
-   /* atapi dma maybe ok */
-   break;
-   default:
-   /* turn off atapi dma */
-   return 1;
-   }
-   }
+
+   /* Don't allow DMA if it isn't multiple of 16 bytes.  

Re: [git patches] libata fixes

2007-06-27 Thread Andrew Morton
On Wed, 27 Jun 2007 03:35:26 -0400 Jeff Garzik [EMAIL PROTECTED] wrote:

 + /* Don't allow DMA if it isn't multiple of 16 bytes.  Quite a
 +  * few ATAPI devices choke on such DMA requests.
 +  */
 + if (unlikely(qc-nbytes  15))
 + return 1;

It might be worth emitting a diagnostic when this happens.
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-06-27 Thread Jeff Garzik

Andrew Morton wrote:

On Wed, 27 Jun 2007 03:35:26 -0400 Jeff Garzik [EMAIL PROTECTED] wrote:


+   /* Don't allow DMA if it isn't multiple of 16 bytes.  Quite a
+* few ATAPI devices choke on such DMA requests.
+*/
+   if (unlikely(qc-nbytes  15))
+   return 1;


It might be worth emitting a diagnostic when this happens.


I tend to disagree, but if any screaming users show up, we can certainly 
think about adding some.


Such would be a diagnostic that would trigger on valid SCSI commands, 
when the user is doing nothing wrong and the system can indeed complete 
the command just fine.  Additionally, this is moving us in the direction 
of what the IDE driver has apparently been doing.


Jeff


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


Re: [git patches] libata fixes

2007-06-27 Thread Linus Torvalds


On Wed, 27 Jun 2007, Jeff Garzik wrote:
 
 Such would be a diagnostic that would trigger on valid SCSI commands, when the
 user is doing nothing wrong and the system can indeed complete the command
 just fine.  Additionally, this is moving us in the direction of what the IDE
 driver has apparently been doing.

Indeed. At least the IDE CD-ROM driver does

if ((rq-data_len  15) || (addr  mask))
info-dma = 0;

where the mask is the dma_alignment mask. So it requires the length to 
be a multiple of 16, and also requires a certain alignment of the data 
(which defaults to 32 bytes for some reason I cannot for the life of me 
remember).

The generic BIO layer does that DMA alignment check too when mapping user 
pages.

Linus
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-06-20 Thread Jeff Garzik

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/ahci.c|2 +-
 drivers/ata/libata-core.c |4 +++-
 drivers/ata/pata_amd.c|2 ++
 drivers/ata/pata_it821x.c |   13 -
 4 files changed, 10 insertions(+), 11 deletions(-)

Bartlomiej Zolnierkiewicz (1):
  pata_it821x: (partially) fix DMA in RAID mode

Henrik Kretzschmar (1):
  kerneldoc fix in libata

Peer Chen (1):
  PATA: Add the MCP73/77 support to PATA driver

Stas Sergeev (1):
  fix module_param mistake in it821x

Tejun Heo (2):
  libata: more NONCQ devices
  ahci: fix PORTS_IMPL override

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 545f330..ca5229d 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -527,7 +527,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
 
/* fixup zero port_map */
if (!port_map) {
-   port_map = (1  ahci_nr_ports(hpriv-cap)) - 1;
+   port_map = (1  ahci_nr_ports(cap)) - 1;
dev_printk(KERN_WARNING, pdev-dev,
   PORTS_IMPL is zero, forcing 0x%x\n, port_map);
 
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 047eabd..adfae9d 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3659,7 +3659,7 @@ static int ata_dev_same_device(struct ata_device *dev, 
unsigned int new_class,
 
 /**
  * ata_dev_reread_id - Re-read IDENTIFY data
- * @adev: target ATA device
+ * @dev: target ATA device
  * @readid_flags: read ID flags
  *
  * Re-read IDENTIFY page and make sure @dev is still attached to
@@ -3802,6 +3802,8 @@ static const struct ata_blacklist_entry 
ata_device_blacklist [] = {
{ HTS541010G9SA00,MBZOC60D, ATA_HORKAGE_NONCQ, },
/* Drives which do spurious command completion */
{ HTS541680J9SA00,SB2IC7EP, ATA_HORKAGE_NONCQ, },
+   { HTS541612J9SA00,SBDIC7JP, ATA_HORKAGE_NONCQ, },
+   { WDC WD740ADFD-00NLR1, NULL, ATA_HORKAGE_NONCQ, },
 
/* Devices with NCQ limits */
 
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index b439351..a16f629 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -693,6 +693,8 @@ static const struct pci_device_id amd[] = {
{ PCI_VDEVICE(NVIDIA,   PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE), 8 },
{ PCI_VDEVICE(NVIDIA,   PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE), 8 },
{ PCI_VDEVICE(NVIDIA,   PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE), 8 },
+   { PCI_VDEVICE(NVIDIA,   PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE), 8 },
+   { PCI_VDEVICE(NVIDIA,   PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE), 8 },
{ PCI_VDEVICE(AMD,  PCI_DEVICE_ID_AMD_CS5536_IDE),  9 },
 
{ },
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index b3456d7..dab4e7c 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -2,6 +2,7 @@
  * pata_it821x.c   - IT821x PATA for new ATA layer
  *   (C) 2005 Red Hat Inc
  *   Alan Cox [EMAIL PROTECTED]
+ *   (C) 2007 Bartlomiej Zolnierkiewicz
  *
  * based upon
  *
@@ -79,7 +80,7 @@
 
 
 #define DRV_NAME pata_it821x
-#define DRV_VERSION 0.3.6
+#define DRV_VERSION 0.3.7
 
 struct it821x_dev
 {
@@ -460,14 +461,8 @@ static unsigned int it821x_passthru_qc_issue_prot(struct 
ata_queued_cmd *qc)
 
 static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device 
**unused)
 {
-   int dma_enabled = 0;
int i;
 
-   /* Bits 5 and 6 indicate if DMA is active on master/slave */
-   /* It is possible that BMDMA isn't allocated */
-   if (ap-ioaddr.bmdma_addr)
-   dma_enabled = ioread8(ap-ioaddr.bmdma_addr + ATA_DMA_CMD);
-
for (i = 0; i  ATA_MAX_DEVICES; i++) {
struct ata_device *dev = ap-device[i];
if (ata_dev_enabled(dev)) {
@@ -476,7 +471,7 @@ static int it821x_smart_set_mode(struct ata_port *ap, 
struct ata_device **unused
dev-dma_mode = XFER_MW_DMA_0;
/* We do need the right mode information for DMA or PIO
   and this comes from the current configuration flags 
*/
-   if (dma_enabled  (1  (5 + i))) {
+   if (ata_id_has_dma(dev-id)) {
ata_dev_printk(dev, KERN_INFO, configured for 
DMA\n);
dev-xfer_mode = XFER_MW_DMA_0;
dev-xfer_shift = ATA_SHIFT_MWDMA;
@@ -799,7 +794,7 @@ MODULE_VERSION(DRV_VERSION);
 
 
 module_param_named(noraid, it8212_noraid, int, S_IRUGO);
-MODULE_PARM_DESC(it8212_noraid, Force card into bypass mode);
+MODULE_PARM_DESC(noraid, Force card into bypass mode);
 
 module_init(it821x_init);
 module_exit(it821x_exit);
-
To 

[git patches] libata fixes

2007-06-09 Thread Jeff Garzik

As mentioned, will push Tejun's updated probe patch when received.

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/ahci.c|   24 
 drivers/ata/libata-core.c |   29 +---
 drivers/ata/libata-scsi.c |   67 +
 drivers/ata/libata-sff.c  |   37 +++-
 drivers/ata/pata_isapnp.c |1 -
 include/linux/ata.h   |3 +-
 include/linux/libata.h|1 +
 7 files changed, 118 insertions(+), 44 deletions(-)

Alan Cox (2):
  libata-core/sff: Fix multiple assumptions about DMA
  libata: Correct abuse of language

Albert Lee (6):
  libata: print device model and firmware revision for ATAPI devices
  libata passthru: update protocol numbers
  libata passthru: support PIO multi commands
  libata passthru: map UDMA protocols
  libata passthru: always enforce correct DEV bit
  libata passthru: update cached device paramters

Olof Johansson (1):
  libata: fix probe time irq printouts

Peer Chen (1):
  ahci: Add MCP73/MCP77 support to AHCI driver

Tejun Heo (2):
  libata: disable NCQ for HITACHI HTS541680J9SA00/SB21C7EP
  libata: fix hw_sata_spd_limit initialization

Yoichi Yuasa (1):
  remove unused variable in pata_isapnp

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 7baeaff..545f330 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -426,6 +426,30 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(NVIDIA, 0x0559), board_ahci },/* MCP67 */
{ PCI_VDEVICE(NVIDIA, 0x055a), board_ahci },/* MCP67 */
{ PCI_VDEVICE(NVIDIA, 0x055b), board_ahci },/* MCP67 */
+   { PCI_VDEVICE(NVIDIA, 0x07f0), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x07f1), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x07f2), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x07f3), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x07f4), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x07f5), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x07f6), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x07f7), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x07f8), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x07f9), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x07fa), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x07fb), board_ahci },/* MCP73 */
+   { PCI_VDEVICE(NVIDIA, 0x0ad0), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ad1), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ad2), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ad3), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ad4), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ad5), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ad6), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ad7), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ad8), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ad9), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ada), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0adb), board_ahci },/* MCP77 */
 
/* SiS */
{ PCI_VDEVICE(SI, 0x1184), board_ahci }, /* SiS 966 */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4733f00..4b3c45e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1727,7 +1727,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int 
*p_class,
 
/* sanity check */
rc = -EINVAL;
-   reason = device reports illegal type;
+   reason = device reports invalid type;
 
if (class == ATA_DEV_ATA) {
if (!ata_id_is_ata(id)  !ata_id_is_cfa(id))
@@ -1900,6 +1900,13 @@ int ata_dev_configure(struct ata_device *dev)
if (ata_msg_probe(ap))
ata_dump_id(id);
 
+   /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */
+   ata_id_c_string(dev-id, fwrevbuf, ATA_ID_FW_REV,
+   sizeof(fwrevbuf));
+
+   ata_id_c_string(dev-id, modelbuf, ATA_ID_PROD,
+   sizeof(modelbuf));
+
/* ATA-specific feature tests */
if (dev-class == ATA_DEV_ATA) {
if (ata_id_is_cfa(id)) {
@@ -1914,13 +1921,6 @@ int ata_dev_configure(struct ata_device *dev)
 
dev-n_sectors = ata_id_n_sectors(id);
 
-   /* SCSI only uses 4-char revisions, dump full 8 chars from ATA 
*/
-   

[git patches] libata fixes

2007-05-25 Thread Jeff Garzik

And a few trivial documentation patches.

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/libata-scsi.c  |5 ++-
 drivers/ata/pata_artop.c   |2 +-
 drivers/ata/pata_hpt37x.c  |   27 ++---
 drivers/ata/pata_it821x.c  |3 +-
 drivers/ata/pata_scc.c |   46 ++-
 drivers/ata/pata_via.c |9 ---
 drivers/ata/sata_mv.c  |   44 ++
 drivers/ata/sata_promise.c |2 +-
 drivers/ata/sata_sis.c |2 +-
 drivers/ata/sata_via.c |3 ++
 10 files changed, 98 insertions(+), 45 deletions(-)

Alan Cox (2):
  pata: Trivia
  pata_hpt37x: Further improvements based on the IDE updates and vendor 
drivers

Jeff Garzik (4):
  [libata] sata_promise: fix flags typo
  [libata] sata_mv: add TODO list
  [libata] Fix decoding of 6-byte commands
  [libata] sata_via, pata_via: Add PCI IDs.

Tony Breeds (1):
  Fix build failure for drivers/ata/pata_scc.c

Uwe Koziolek (1):
  libata: sata_sis fixes

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 242c43e..b3900cf 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1050,14 +1050,15 @@ static unsigned int ata_scsi_flush_xlat(struct 
ata_queued_cmd *qc)
 static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen)
 {
u64 lba = 0;
-   u32 len = 0;
+   u32 len;
 
VPRINTK(six-byte command\n);
 
+   lba |= ((u64)(cdb[1]  0x1f))  16;
lba |= ((u64)cdb[2])  8;
lba |= ((u64)cdb[3]);
 
-   len |= ((u32)cdb[4]);
+   len = cdb[4];
 
*plba = lba;
*plen = len;
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 7b4810c..03b6ddd 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -97,7 +97,7 @@ static int artop6260_pre_reset(struct ata_port *ap, unsigned 
long deadline)
  * artop6260_cable_detect  -   identify cable type
  * @ap: Port
  *
- * Identify the cable type for the ARTOp interface in question
+ * Identify the cable type for the ARTOP interface in question
  */
 
 static int artop6260_cable_detect(struct ata_port *ap)
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index a54c174..6446735 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -26,7 +26,7 @@
 #include linux/libata.h
 
 #define DRV_NAME   pata_hpt37x
-#define DRV_VERSION0.6.5
+#define DRV_VERSION0.6.6
 
 struct hpt_clock {
u8  xfer_speed;
@@ -931,15 +931,6 @@ static int hpt37x_init_one(struct pci_dev *dev, const 
struct pci_device_id *id)
.udma_mask = 0x7f,
.port_ops = hpt372_port_ops
};
-   /* HPT371, 372 and friends - UDMA100 at 50MHz clock */
-   static const struct ata_port_info info_hpt372_50 = {
-   .sht = hpt37x_sht,
-   .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
-   .pio_mask = 0x1f,
-   .mwdma_mask = 0x07,
-   .udma_mask = 0x3f,
-   .port_ops = hpt372_port_ops
-   };
/* HPT374 - UDMA133 */
static const struct ata_port_info info_hpt374 = {
.sht = hpt37x_sht,
@@ -1098,17 +1089,21 @@ static int hpt37x_init_one(struct pci_dev *dev, const 
struct pci_device_id *id)
 *  use a 50MHz DPLL by choice
 */
unsigned int f_low, f_high;
-   int adjust;
+   int dpll, adjust;
 
-   clock_slot = 2;
+   /* Compute DPLL */
+   dpll = 2;
if (port-udma_mask  0xE0)
-   clock_slot = 3;
+   dpll = 3;
 
-   f_low = (MHz[clock_slot] * chip_table-base) / 192;
+   f_low = (MHz[clock_slot] * 48) / MHz[dpll];
f_high = f_low + 2;
+   if (clock_slot  1)
+   f_high += 2;
 
/* Select the DPLL clock. */
pci_write_config_byte(dev, 0x5b, 0x21);
+   pci_write_config_dword(dev, 0x5C, (f_high  16) | f_low);
 
for(adjust = 0; adjust  8; adjust++) {
if (hpt37x_calibrate_dpll(dev))
@@ -1124,12 +1119,12 @@ static int hpt37x_init_one(struct pci_dev *dev, const 
struct pci_device_id *id)
printk(KERN_WARNING hpt37x: DPLL did not 
stabilize.\n);
return -ENODEV;
}
-   if (clock_slot == 3)
+   if (dpll == 3)
private_data = (void *)hpt37x_timings_66;
else
private_data = (void *)hpt37x_timings_50;
 
-   printk(KERN_INFO hpt37x: Bus clock %dMHz, using DPLL.\n, 
MHz[clock_slot]);
+   printk(KERN_INFO 

Re: [git patches] libata fixes

2007-05-25 Thread Mikael Pettersson
On Fri, 25 May 2007 18:03:07 -0400, Jeff Garzik wrote:
Jeff Garzik (4):
  [libata] sata_promise: fix flags typo
...
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -297,7 +297,7 @@ static const struct ata_port_info pdc_port_info[] = {
 
   /* board_2057x_pata */
   {
-  .flags  = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS,
+  .flags  = PDC_COMMON_FLAGS | ATA_FLAG_SLAVE_POSS |
 PDC_FLAG_GEN_II,
   .pio_mask   = 0x1f, /* pio0-4 */
   .mwdma_mask = 0x07, /* mwdma0-2 */

Acked-by: Mikael Pettersson [EMAIL PROTECTED]

Good catch. This typo would have prevented pdc_host_intr()
from detecting GEN_II-specific errors on the PATA port.
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-05-24 Thread Jeff Garzik

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/ata_piix.c |1 +
 drivers/ata/libata-core.c  |4 +-
 drivers/ata/pata_hpt3x2n.c |4 +-
 drivers/ata/pata_sis.c |   46 ++--
 drivers/ata/pata_via.c |   29 +++
 5 files changed, 57 insertions(+), 27 deletions(-)

Alan Cox (3):
  hpt3x2n: Correct revision boundary
  pata_sis: Fix and clean up some timing setups
  pata_via: Handle laptops via DMI

Tejun Heo (3):
  ata_piix: add short 40c quirk for Acer Aspire 2030, take #2
  libata: don't consider 0xff as port empty if SStatus is available
  libata: -ENODEV during prereset isn't an error

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 0458811..9c07b88 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -578,6 +578,7 @@ static const struct ich_laptop ich_laptop[] = {
{ 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */
{ 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */
{ 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */
+   { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */
/* end marker */
{ 0, }
 };
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a6de57e..3ca9c61 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3022,7 +3022,7 @@ int ata_wait_ready(struct ata_port *ap, unsigned long 
deadline)
 
if (!(status  ATA_BUSY))
return 0;
-   if (status == 0xff)
+   if (!ata_port_online(ap)  status == 0xff)
return -ENODEV;
if (time_after(now, deadline))
return -EBUSY;
@@ -3368,7 +3368,7 @@ int ata_std_prereset(struct ata_port *ap, unsigned long 
deadline)
 */
if (!(ap-flags  ATA_FLAG_SKIP_D2H_BSY)  !ata_port_offline(ap)) {
rc = ata_wait_ready(ap, deadline);
-   if (rc) {
+   if (rc  rc != -ENODEV) {
ata_port_printk(ap, KERN_WARNING, device not ready 
(errno=%d), forcing hardreset\n, rc);
ehc-i.action |= ATA_EH_HARDRESET;
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
index f25154a..e947433 100644
--- a/drivers/ata/pata_hpt3x2n.c
+++ b/drivers/ata/pata_hpt3x2n.c
@@ -521,8 +521,8 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const 
struct pci_device_id *id)
/* 371N if rev  1 */
break;
case PCI_DEVICE_ID_TTI_HPT372:
-   /* 372N if rev = 1*/
-   if (class_rev == 0)
+   /* 372N if rev = 2*/
+   if (class_rev  2)
return -ENODEV;
break;
case PCI_DEVICE_ID_TTI_HPT302:
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index f223126..ec3ae93 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -73,14 +73,14 @@ static int sis_short_ata40(struct pci_dev *dev)
 }
 
 /**
- * sis_port_base   -   return PCI configuration base for dev
+ * sis_old_port_base   -   return PCI configuration base 
for dev
  * @adev: device
  *
  * Returns the base of the PCI configuration registers for this port
  * number.
  */
 
-static int sis_port_base(struct ata_device *adev)
+static int sis_old_port_base(struct ata_device *adev)
 {
return  0x40 + (4 * adev-ap-port_no) +  (2 * adev-devno);
 }
@@ -211,7 +211,7 @@ static void sis_set_fifo(struct ata_port *ap, struct 
ata_device *adev)
 static void sis_old_set_piomode (struct ata_port *ap, struct ata_device *adev)
 {
struct pci_dev *pdev= to_pci_dev(ap-host-dev);
-   int port = sis_port_base(adev);
+   int port = sis_old_port_base(adev);
u8 t1, t2;
int speed = adev-pio_mode - XFER_PIO_0;
 
@@ -248,7 +248,7 @@ static void sis_old_set_piomode (struct ata_port *ap, 
struct ata_device *adev)
 static void sis_100_set_piomode (struct ata_port *ap, struct ata_device *adev)
 {
struct pci_dev *pdev= to_pci_dev(ap-host-dev);
-   int port = sis_port_base(adev);
+   int port = sis_old_port_base(adev);
int speed = adev-pio_mode - XFER_PIO_0;
 
const u8 actrec[] = { 0x00, 0x67, 0x44, 0x33, 0x31 };
@@ -328,7 +328,7 @@ static void sis_old_set_dmamode (struct ata_port *ap, 
struct ata_device *adev)
 {
struct pci_dev *pdev= to_pci_dev(ap-host-dev);
int speed = adev-dma_mode - XFER_MW_DMA_0;
-   int drive_pci = sis_port_base(adev);
+   int drive_pci = sis_old_port_base(adev);
u16 timing;
 
const u16 mwdma_bits[] = { 0x707, 0x202, 

[git patches] libata fixes and administrivia

2007-05-21 Thread Jeff Garzik

Two fixes; the rest is trivial pre-release administrivia (ie. only bump
versions and chomp whitespace after everything else gets merged up)

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|2 +-
 drivers/ata/ahci.c |   13 +++--
 drivers/ata/ata_generic.c  |2 +-
 drivers/ata/ata_piix.c |9 +
 drivers/ata/libata-core.c  |   14 ++
 drivers/ata/libata-eh.c|2 +-
 drivers/ata/pata_artop.c   |4 ++--
 drivers/ata/pata_cmd640.c  |4 ++--
 drivers/ata/pata_cmd64x.c  |2 +-
 drivers/ata/pata_cs5520.c  |2 +-
 drivers/ata/pata_cs5530.c  |2 +-
 drivers/ata/pata_cs5535.c  |2 +-
 drivers/ata/pata_cypress.c |2 +-
 drivers/ata/pata_hpt366.c  |   28 +---
 drivers/ata/pata_hpt37x.c  |   10 +-
 drivers/ata/pata_hpt3x3.c  |2 +-
 drivers/ata/pata_isapnp.c  |2 +-
 drivers/ata/pata_it8213.c  |2 +-
 drivers/ata/pata_ixp4xx_cf.c   |2 +-
 drivers/ata/pata_jmicron.c |2 +-
 drivers/ata/pata_legacy.c  |2 +-
 drivers/ata/pata_platform.c|2 +-
 drivers/ata/pata_qdi.c |2 +-
 drivers/ata/pata_rz1000.c  |2 +-
 drivers/ata/pata_sc1200.c  |2 +-
 drivers/ata/pata_scc.c |2 +-
 drivers/ata/pata_serverworks.c |2 +-
 drivers/ata/pata_sl82c105.c|2 +-
 drivers/ata/pata_winbond.c |2 +-
 drivers/ata/pdc_adma.c |2 +-
 drivers/ata/sata_inic162x.c|2 +-
 drivers/ata/sata_mv.c  |2 +-
 drivers/ata/sata_nv.c  |6 +++---
 drivers/ata/sata_qstor.c   |2 +-
 drivers/ata/sata_sil.c |2 +-
 drivers/ata/sata_sil24.c   |2 +-
 drivers/ata/sata_sis.c |2 +-
 drivers/ata/sata_svw.c |2 +-
 drivers/ata/sata_sx4.c |2 +-
 drivers/ata/sata_uli.c |2 +-
 drivers/ata/sata_via.c |2 +-
 drivers/ata/sata_vsc.c |2 +-
 include/linux/libata.h |2 --
 43 files changed, 65 insertions(+), 93 deletions(-)

Alan Cox (3):
  pata_hpt366: Enable bits are unreliable so don't use them
  ata_piix: clean up
  libata: Kiss post_set_mode goodbye

Dave Jones (1):
  libata: Add Seagate STT2A to DMA blacklist.

Jeff Garzik (2):
  libata: Trim trailing whitespace
  libata: bump versions

Tejun Heo (1):
  ahci: disable 64bit dma on sb600

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index ad1f59c..b4a8d60 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -132,7 +132,7 @@ config SATA_SIS
depends on PCI
select PATA_SIS
help
- This option enables support for SiS Serial ATA on 
+ This option enables support for SiS Serial ATA on
  SiS 964/965/966/180 and Parallel ATA on SiS 180.
  The PATA support for SiS 180 requires additionally to
  enable the PATA_SIS driver in the config.
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index e00e1b9..7baeaff 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -46,7 +46,7 @@
 #include linux/libata.h
 
 #define DRV_NAME   ahci
-#define DRV_VERSION2.1
+#define DRV_VERSION2.2
 
 
 enum {
@@ -170,6 +170,7 @@ enum {
AHCI_FLAG_IGN_IRQ_IF_ERR= (1  25), /* ignore IRQ_IF_ERR */
AHCI_FLAG_HONOR_PI  = (1  26), /* honor PORTS_IMPL */
AHCI_FLAG_IGN_SERR_INTERNAL = (1  27), /* ignore SERR_INTERNAL */
+   AHCI_FLAG_32BIT_ONLY= (1  28), /* force 32bit */
 
AHCI_FLAG_COMMON= ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
  ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
@@ -354,7 +355,8 @@ static const struct ata_port_info ahci_port_info[] = {
/* board_ahci_sb600 */
{
.flags  = AHCI_FLAG_COMMON |
- AHCI_FLAG_IGN_SERR_INTERNAL,
+ AHCI_FLAG_IGN_SERR_INTERNAL |
+ AHCI_FLAG_32BIT_ONLY,
.pio_mask   = 0x1f, /* pio0-4 */
.udma_mask  = 0x7f, /* udma0-6 ; FIXME */
.port_ops   = ahci_ops,
@@ -492,6 +494,13 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
hpriv-saved_cap = cap = readl(mmio + HOST_CAP);
hpriv-saved_port_map = port_map = readl(mmio + HOST_PORTS_IMPL);
 
+   /* some chips lie about 64bit support */
+   if ((cap  HOST_CAP_64)  (pi-flags  AHCI_FLAG_32BIT_ONLY)) {
+   dev_printk(KERN_INFO, pdev-dev,
+  controller can't do 64bit DMA, forcing 32bit\n);
+   cap = ~HOST_CAP_64;
+   }
+
/* fixup zero port_map */
if (!port_map) {
port_map = (1  

[git patches] libata fixes

2007-05-17 Thread Jeff Garzik

Main thing of note: still sorting out the shutdown mess.  See the
extended commit texts for more info.

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:

 Documentation/feature-removal-schedule.txt |   25 -
 drivers/ata/libata-core.c  |6 --
 drivers/ata/libata-scsi.c  |9 -
 drivers/ata/libata.h   |1 -
 drivers/ata/sata_nv.c  |   18 +-
 drivers/ata/sata_via.c |2 +-
 6 files changed, 18 insertions(+), 43 deletions(-)

Peer Chen (1):
  drivers/ata: remove the wildcard from sata_nv driver

Tejun Heo (3):
  sata_nv: fix fallout of devres conversion
  libata: remove libata.spindown_compat
  sata_via: pcim_iomap_regions() conversion missed BAR5

diff --git a/Documentation/feature-removal-schedule.txt 
b/Documentation/feature-removal-schedule.txt
index 498ff31..5c8695a 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -328,21 +328,20 @@ Who:   Adrian Bunk [EMAIL PROTECTED]
 
 ---
 
-What: libata.spindown_compat module parameter
+What: libata spindown skipping and warning
 When: Dec 2008
-Why:  halt(8) synchronizes caches for and spins down libata disks
-  because libata didn't use to spin down disk on system halt
-  (only synchronized caches).
-  Spin down on system halt is now implemented and can be tested
-  using sysfs node /sys/class/scsi_disk/h:c:i:l/manage_start_stop.
+Why:  Some halt(8) implementations synchronize caches for and spin
+  down libata disks because libata didn't use to spin down disk on
+  system halt (only synchronized caches).
+  Spin down on system halt is now implemented.  sysfs node
+  /sys/class/scsi_disk/h:c:i:l/manage_start_stop is present if
+  spin down support is available.
   Because issuing spin down command to an already spun down disk
-  makes some disks spin up just to spin down again, the old
-  behavior needs to be maintained till userspace tool is updated
-  to check the sysfs node and not to spin down disks with the
-  node set to one.
-  This module parameter is to give userspace tool the time to
-  get updated and should be removed after userspace is
-  reasonably updated.
+  makes some disks spin up just to spin down again, libata tracks
+  device spindown status to skip the extra spindown command and
+  warn about it.
+  This is to give userspace tools the time to get updated and will
+  be removed after userspace is reasonably updated.
 Who:  Tejun Heo [EMAIL PROTECTED]
 
 ---
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index d5939e6..d3ea7f5 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -101,12 +101,6 @@ int libata_noacpi = 1;
 module_param_named(noacpi, libata_noacpi, int, 0444);
 MODULE_PARM_DESC(noacpi, Disables the use of ACPI in suspend/resume when 
set);
 
-int ata_spindown_compat = 1;
-module_param_named(spindown_compat, ata_spindown_compat, int, 0644);
-MODULE_PARM_DESC(spindown_compat, Enable backward compatible spindown 
-behavior.  Will be removed.  More info can be found in 
-Documentation/feature-removal-schedule.txt\n);
-
 MODULE_AUTHOR(Jeff Garzik);
 MODULE_DESCRIPTION(Library module for ATA devices);
 MODULE_LICENSE(GPL);
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index b6a1de8..242c43e 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -893,7 +893,7 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, 
int queue_depth)
return queue_depth;
 }
 
-/* XXX: for ata_spindown_compat */
+/* XXX: for spindown warning */
 static void ata_delayed_done_timerfn(unsigned long arg)
 {
struct scsi_cmnd *scmd = (void *)arg;
@@ -901,7 +901,7 @@ static void ata_delayed_done_timerfn(unsigned long arg)
scmd-scsi_done(scmd);
 }
 
-/* XXX: for ata_spindown_compat */
+/* XXX: for spindown warning */
 static void ata_delayed_done(struct scsi_cmnd *scmd)
 {
static struct timer_list timer;
@@ -966,8 +966,7 @@ static unsigned int ata_scsi_start_stop_xlat(struct 
ata_queued_cmd *qc)
 * removed.  Read Documentation/feature-removal-schedule.txt
 * for more info.
 */
-   if (ata_spindown_compat 
-   (qc-dev-flags  ATA_DFLAG_SPUNDOWN) 
+   if ((qc-dev-flags  ATA_DFLAG_SPUNDOWN) 
(system_state == SYSTEM_HALT ||
 system_state == SYSTEM_POWER_OFF)) {
static unsigned long warned = 0;
@@ -1395,7 +1394,7 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd 
*qc)
}
}
 
- 

[git patches] libata fixes

2007-05-15 Thread Jeff Garzik

All bug fixes.  The two things that do not seem like bugfixes (separate
out... and add ATA_FLAG_ACPI_SATA) are not as they seem.  The former
is a prep patch for a fix, and the latter fixes what ACPI considers a
legacy IDE interface.

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/ahci.c|3 +-
 drivers/ata/libata-acpi.c |   10 +++---
 drivers/ata/libata-core.c |   80 +++-
 drivers/ata/libata-scsi.c |   44 
 drivers/ata/libata.h  |3 +-
 drivers/ata/pata_scc.c|4 +-
 drivers/ata/sata_sil24.c  |3 +-
 include/linux/libata.h|3 +-
 8 files changed, 100 insertions(+), 50 deletions(-)

Al Viro (1):
  pata_scc had been missed by ata_std_prereset() switch

Tejun Heo (5):
  libata: separate out ata_dev_reread_id()
  libata: during revalidation, check n_sectors after device is configured
  libata-acpi: add ATA_FLAG_ACPI_SATA port flag
  libata: fix shutdown warning message printing
  libata: track spindown status and skip spindown_compat if possible

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 1ae443d..e00e1b9 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -173,7 +173,8 @@ enum {
 
AHCI_FLAG_COMMON= ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
  ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
- ATA_FLAG_SKIP_D2H_BSY,
+ ATA_FLAG_SKIP_D2H_BSY |
+ ATA_FLAG_ACPI_SATA,
 };
 
 struct ahci_cmd_hdr {
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index ed4138e..0223673 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -321,7 +321,7 @@ static int do_drive_get_GTF(struct ata_device *dev, 
unsigned int *gtf_length,
 
/* Don't continue if device has no _ADR method.
 * _GTF is intended for known motherboard devices. */
-   if (!(ap-cbl == ATA_CBL_SATA)) {
+   if (!(ap-flags  ATA_FLAG_ACPI_SATA)) {
err = pata_get_dev_handle(gdev, dev_handle, pcidevfn);
if (err  0) {
if (ata_msg_probe(ap))
@@ -343,7 +343,7 @@ static int do_drive_get_GTF(struct ata_device *dev, 
unsigned int *gtf_length,
 
/* Get this drive's _ADR info. if not already known. */
if (!dev-obj_handle) {
-   if (!(ap-cbl == ATA_CBL_SATA)) {
+   if (!(ap-flags  ATA_FLAG_ACPI_SATA)) {
/* get child objects of dev_handle == channel objects,
 * + _their_ children == drive objects */
/* channel is ap-port_no */
@@ -528,7 +528,7 @@ static int do_drive_set_taskfiles(struct ata_device *dev,
ata_dev_printk(dev, KERN_DEBUG, %s: ENTER: port#: %d\n,
   __FUNCTION__, ap-port_no);
 
-   if (libata_noacpi || !(ap-cbl == ATA_CBL_SATA))
+   if (libata_noacpi || !(ap-flags  ATA_FLAG_ACPI_SATA))
return 0;
 
if (!ata_dev_enabled(dev) || (ap-flags  ATA_FLAG_DISABLED))
@@ -578,7 +578,7 @@ int ata_acpi_exec_tfs(struct ata_port *ap)
 * we should not run GTF on PATA devices since some
 * PATA require execution of GTM/STM before GTF.
 */
-   if (!(ap-cbl == ATA_CBL_SATA))
+   if (!(ap-flags  ATA_FLAG_ACPI_SATA))
return 0;
 
for (ix = 0; ix  ATA_MAX_DEVICES; ix++) {
@@ -641,7 +641,7 @@ int ata_acpi_push_id(struct ata_device *dev)
   __FUNCTION__, dev-devno, ap-port_no);
 
/* Don't continue if not a SATA device. */
-   if (!(ap-cbl == ATA_CBL_SATA)) {
+   if (!(ap-flags  ATA_FLAG_ACPI_SATA)) {
if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG,
%s: Not a SATA device\n, __FUNCTION__);
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4166407..d5939e6 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1919,7 +1919,6 @@ int ata_dev_configure(struct ata_device *dev)
snprintf(revbuf, 7, ATA-%d,  
ata_id_major_version(id));
 
dev-n_sectors = ata_id_n_sectors(id);
-   dev-n_sectors_boot = dev-n_sectors;
 
/* SCSI only uses 4-char revisions, dump full 8 chars from ATA 
*/
ata_id_c_string(dev-id, fwrevbuf, ATA_ID_FW_REV,
@@ -3632,7 +3631,6 @@ static int ata_dev_same_device(struct ata_device *dev, 
unsigned int new_class,
const u16 *old_id = dev-id;
unsigned char model[2][ATA_ID_PROD_LEN + 1];
unsigned char serial[2][ATA_ID_SERNO_LEN + 1];
-   u64 new_n_sectors;
 
if (dev-class != new_class) {
ata_dev_printk(dev, 

[git patches] libata fixes, minor updates

2007-05-09 Thread Jeff Garzik

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:

 Documentation/kernel-parameters.txt |8 ---
 drivers/ata/libata-acpi.c   |3 +-
 drivers/ata/libata-core.c   |2 +
 drivers/ata/pata_pcmcia.c   |1 +
 drivers/ata/pata_qdi.c  |2 +-
 drivers/ata/pata_scc.c  |4 +-
 drivers/ata/sata_nv.c   |   92 +-
 drivers/ata/sata_promise.c  |   24 --
 drivers/ata/sata_via.c  |8 +++
 9 files changed, 113 insertions(+), 31 deletions(-)

Alexey Dobriyan (1):
  pata_scc: fix compilation

Jesse Barnes (1):
  Doc Fix: remove mention of combined mode-related kernel parameters

Mikael Pettersson (2):
  sata_promise: fix another error decode regression
  sata_promise: SATAII-150/300 TX4 port numbering fix

Randy Dunlap (1):
  libata: fix kernel-doc parameters

Richard Kennedy (1):
  pata_pcmcia.c: add card ident for jvc cdrom

Robert Hancock (1):
  sata_nv: fix ADMA freeze/thaw/irq_clear issues

Samuel Thibault (1):
  Fix pata_qdi.c probe code

Tejun Heo (2):
  libata-acpi: fix _GTF command protocol for ATAPI devices
  sata_via: add missing PM hooks

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index 6b8ad06..09220a1 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -754,14 +754,6 @@ and is between 256 and 4096 characters. It is defined in 
the file
inport.irq= [HW] Inport (ATI XL and Microsoft) busmouse driver
Format: irq
 
-   combined_mode=  [HW] control which driver uses IDE ports in combined
-   mode: legacy IDE driver, libata, or both
-   (in the libata case, libata.atapi_enabled=1 may be
-   useful as well).  Note that using the ide or libata
-   options may affect your device naming (e.g. by
-   changing hdc to sdb).
-   Format: combined (default), ide, or libata
-
inttest=[IA64]
 
io7=[HW] IO7 for Marvel based alpha systems
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 03a0acf..cb3eab6 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -489,8 +489,7 @@ static void taskfile_load_raw(struct ata_port *ap,
 
/* convert gtf to tf */
tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; /* TBD */
-   tf.protocol = atadev-class == ATA_DEV_ATAPI ?
-   ATA_PROT_ATAPI_NODATA : ATA_PROT_NODATA;
+   tf.protocol = ATA_PROT_NODATA;
tf.feature = gtf-tfa[0];   /* 0x1f1 */
tf.nsect   = gtf-tfa[1];   /* 0x1f2 */
tf.lbal= gtf-tfa[2];   /* 0x1f3 */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index fef87dd..4595d1f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -895,6 +895,7 @@ static u64 ata_read_native_max_address(struct ata_device 
*dev)
 /**
  * ata_set_native_max_address_ext  -   LBA48 native max set
  * @dev: Device to query
+ * @new_sectors: new max sectors value to set for the device
  *
  * Perform an LBA48 size set max upon the device in question. Return the
  * actual LBA48 size or zero if the command fails.
@@ -932,6 +933,7 @@ static u64 ata_set_native_max_address_ext(struct ata_device 
*dev, u64 new_sector
 /**
  * ata_set_native_max_address  -   LBA28 native max set
  * @dev: Device to query
+ * @new_sectors: new max sectors value to set for the device
  *
  * Perform an LBA28 size set max upon the device in question. Return the
  * actual LBA28 size or zero if the command fails.
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 75dc847..11245e3 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -357,6 +357,7 @@ static struct pcmcia_device_id pcmcia_devices[] = {
PCMCIA_DEVICE_MANF_CARD(0x000a, 0x),/* I-O Data CFA */
PCMCIA_DEVICE_MANF_CARD(0x001c, 0x0001),/* Mitsubishi CFA */
PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704),
+   PCMCIA_DEVICE_MANF_CARD(0x0032, 0x2904),
PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401),/* SanDisk CFA */
PCMCIA_DEVICE_MANF_CARD(0x0098, 0x),/* Toshiba */
PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d),
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c
index 27685ce..fb8c9e1 100644
--- a/drivers/ata/pata_qdi.c
+++ b/drivers/ata/pata_qdi.c
@@ -375,7 +375,7 @@ static __init int qdi_init(void)
res = inb(port + 3);
if (res  1) {
/* Single channel mode */
- 

[git patches] libata fixes

2007-03-28 Thread Jeff Garzik

This disables libata ACPI, among other things.

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/ahci.c  |   21 +++-
 drivers/ata/libata-acpi.c   |8 ++--
 drivers/ata/libata-core.c   |6 ++-
 drivers/ata/libata-eh.c |   66 --
 drivers/ata/libata.h|2 +-
 drivers/ata/pata_pdc202xx_old.c |2 +-
 6 files changed, 71 insertions(+), 34 deletions(-)

Alan Cox (1):
  pata_pdc202xx_old: LBA48 bug

Conke Hu (1):
  ahci.c: walkaround for SB600 SATA internal error issue

Jeff Garzik (1):
  [libata] Disable ACPI by default; fix namespace problems

Paul Rolland (1):
  ata: NCQ is broken on Maxtor 6L250S0

Tejun Heo (1):
  libata: IDENTIFY backwards for drive side cable detection

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index dc7b562..fd27227 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -80,6 +80,7 @@ enum {
board_ahci_pi   = 1,
board_ahci_vt8251   = 2,
board_ahci_ign_iferr= 3,
+   board_ahci_sb600= 4,
 
/* global controller registers */
HOST_CAP= 0x00, /* host capabilities */
@@ -168,6 +169,7 @@ enum {
AHCI_FLAG_NO_NCQ= (1  24),
AHCI_FLAG_IGN_IRQ_IF_ERR= (1  25), /* ignore IRQ_IF_ERR */
AHCI_FLAG_HONOR_PI  = (1  26), /* honor PORTS_IMPL */
+   AHCI_FLAG_IGN_SERR_INTERNAL = (1  27), /* ignore SERR_INTERNAL */
 };
 
 struct ahci_cmd_hdr {
@@ -362,6 +364,18 @@ static const struct ata_port_info ahci_port_info[] = {
.udma_mask  = 0x7f, /* udma0-6 ; FIXME */
.port_ops   = ahci_ops,
},
+   /* board_ahci_sb600 */
+   {
+   .sht= ahci_sht,
+   .flags  = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+ ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
+ ATA_FLAG_SKIP_D2H_BSY |
+ AHCI_FLAG_IGN_SERR_INTERNAL,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .udma_mask  = 0x7f, /* udma0-6 ; FIXME */
+   .port_ops   = ahci_ops,
+   },
+
 };
 
 static const struct pci_device_id ahci_pci_tbl[] = {
@@ -399,7 +413,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
  PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci_ign_iferr },
 
/* ATI */
-   { PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */
+   { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 non-raid */
{ PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */
 
/* VIA */
@@ -1067,8 +1081,11 @@ static void ahci_error_intr(struct ata_port *ap, u32 
irq_stat)
if (ap-flags  AHCI_FLAG_IGN_IRQ_IF_ERR)
irq_stat = ~PORT_IRQ_IF_ERR;
 
-   if (irq_stat  PORT_IRQ_TF_ERR)
+   if (irq_stat  PORT_IRQ_TF_ERR) {
err_mask |= AC_ERR_DEV;
+   if (ap-flags  AHCI_FLAG_IGN_SERR_INTERNAL)
+   serror = ~SERR_INTERNAL;
+   }
 
if (irq_stat  (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR)) {
err_mask |= AC_ERR_HOST_BUS;
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index c428a56..03a0acf 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -305,7 +305,7 @@ static int do_drive_get_GTF(struct ata_port *ap, int ix,
*gtf_address = 0UL;
*obj_loc = 0UL;
 
-   if (noacpi)
+   if (libata_noacpi)
return 0;
 
if (ata_msg_probe(ap))
@@ -531,7 +531,7 @@ static int do_drive_set_taskfiles(struct ata_port *ap,
ata_dev_printk(atadev, KERN_DEBUG, %s: ENTER: port#: %d\n,
   __FUNCTION__, ap-port_no);
 
-   if (noacpi || !(ap-cbl == ATA_CBL_SATA))
+   if (libata_noacpi || !(ap-cbl == ATA_CBL_SATA))
return 0;
 
if (!ata_dev_enabled(atadev) || (ap-flags  ATA_FLAG_DISABLED))
@@ -574,7 +574,7 @@ int ata_acpi_exec_tfs(struct ata_port *ap)
unsigned long   gtf_address;
unsigned long   obj_loc;
 
-   if (noacpi)
+   if (libata_noacpi)
return 0;
/*
 * TBD - implement PATA support.  For now,
@@ -636,7 +636,7 @@ int ata_acpi_push_id(struct ata_port *ap, unsigned int ix)
struct acpi_object_list input;
union acpi_object   in_params[1];
 
-   if (noacpi)
+   if (libata_noacpi)
return 0;
 
if (ata_msg_probe(ap))
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index bf327d4..f1f595f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -93,8 +93,8 @@ static int ata_probe_timeout = ATA_TMOUT_INTERNAL / HZ;
 

Re: [git patches] libata fixes

2007-03-28 Thread Jeff Garzik

Jeff Garzik wrote:

This disables libata ACPI, among other things.


If a -rc6 is possible, that would be quite nice...

Jeff


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


Re: [git patches] libata fixes

2007-03-28 Thread Linus Torvalds


On Wed, 28 Mar 2007, Jeff Garzik wrote:

 Jeff Garzik wrote:
  This disables libata ACPI, among other things.
 
 If a -rc6 is possible, that would be quite nice...

Heh. I don't think -rc6 is possible - it's inevitable. We have too 
much fallout from the timer changes still outstanding. It looks people 
finally figured out a big issue with the HPET timer, and that hopefully 
resolves most of the remaining timer-related regressions, but yes, we most 
definitely _will_ have an -rc6.

Andrew, what's your feeling apart from the timer fallout?

Linus
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-03-28 Thread Andrew Morton
On Wed, 28 Mar 2007 13:53:10 -0700 (PDT)
Linus Torvalds [EMAIL PROTECTED] wrote:

 
 
 On Wed, 28 Mar 2007, Jeff Garzik wrote:
 
  Jeff Garzik wrote:
   This disables libata ACPI, among other things.
  
  If a -rc6 is possible, that would be quite nice...
 
 Heh. I don't think -rc6 is possible - it's inevitable. We have too 
 much fallout from the timer changes still outstanding. It looks people 
 finally figured out a big issue with the HPET timer, and that hopefully 
 resolves most of the remaining timer-related regressions, but yes, we most 
 definitely _will_ have an -rc6.

yup.

 Andrew, what's your feeling apart from the timer fallout?

There are two main metrics:

a) the number of bugs which Adrian is tracking.  I think this still
   exceeds 25, which is a lot.

b) the rate at which fixes are arriving.  I have accumulated 15-20
   since the last batch (40 hours ago), which is still a pretty high rate.

Based on that, we're still quite a long way from -final.

(But you know me - I'd be happy releasing 2.6.21 in July)
(Don't ask me what year I'm referring to, either)


There is another metric to look at, too: the number of fixes which are
going into 2.6.x.y.  If that fix count is high, and if those fixes fix bugs
which were not present in 2.6.x-1 then this is an indication that something
is wrong - many regressions are sneaking through the -rc process.

And I haven't run the numbers, but I get the impression that 2.6.20.x has
an unusually large number of fixes in it.

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


Re: [git patches] libata fixes

2007-03-19 Thread Tejun Heo

Paul Rolland wrote:
Oh... that's just weird.  It seems you'll have to continue 
boot with the

timeouts for the time being.  Sorry about that.


Would you agree to a patch to add a kernel boot parameter to skip some
ata ports ?
I found some archives refering to some ataX=noprobe, but it seems
to have no effect, and I'd like to resurrect it for libata, at least to
help me support my configuration ?
If no, I'll just cook it for me, without posting it...


Why not cook it and share it?  :-)

--
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-03-19 Thread Alan Cox
On Mon, Mar 19, 2007 at 08:48:00AM +0100, Paul Rolland wrote:
 Would you agree to a patch to add a kernel boot parameter to skip some
 ata ports ?

It should in theory not be neccessary

 I found some archives refering to some ataX=noprobe, but it seems
 to have no effect, and I'd like to resurrect it for libata, at least to
 help me support my configuration ?
 If no, I'll just cook it for me, without posting it...

If you get it working please post patches - theory and practice rarely agree 8)
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-03-19 Thread Jeff Garzik

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  |2 +-
 drivers/ata/libata-core.c|2 +-
 drivers/ata/libata-eh.c  |8 +++-
 drivers/ata/pata_ixp4xx_cf.c |3 +--
 drivers/ata/sata_inic162x.c  |4 
 drivers/ata/sata_sil24.c |1 +
 6 files changed, 11 insertions(+), 9 deletions(-)

Akira Iguchi (1):
  drivers/ata/Kconfig: PATA_SCC depends on wrong platform

Alessandro Zummo (1):
  pata_ixp4xx_cf: fix interrupt

Jamie Clark (1):
  sata_sil24: Add Adaptec 1220SA PCI ID

Randy Dunlap (1):
  libata: kernel-doc fix

Tejun Heo (3):
  libata: don't whine if -prereset() returns -ENOENT
  sata_inic162x: kill double region requests
  pata_ixp4xx_cf: fix oops on detach

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index d16b5b0..7bdbe5a 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -564,7 +564,7 @@ config PATA_IXP4XX_CF
 
 config PATA_SCC
tristate Toshiba's Cell Reference Set IDE support
-   depends on PCI  PPC_IBM_CELL_BLADE
+   depends on PCI  PPC_CELLEB
help
  This option enables support for the built-in IDE controller on
  Toshiba Cell Reference Board.
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3c1f883..bf327d4 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -826,7 +826,7 @@ static u64 ata_id_n_sectors(const u16 *id)
 /**
  * ata_id_to_dma_mode  -   Identify DMA mode from id block
  * @dev: device to identify
- * @mode: mode to assume if we cannot tell
+ * @unknown: mode to assume if we cannot tell
  *
  * Set up the timing values for the device based upon the identify
  * reported values for the DMA mode. This function is used by drivers
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 7349c3d..361953a 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1625,8 +1625,14 @@ static int ata_eh_reset(struct ata_port *ap, int 
classify,
rc = prereset(ap);
if (rc) {
if (rc == -ENOENT) {
-   ata_port_printk(ap, KERN_DEBUG, port disabled. 
ignoring.\n);
+   ata_port_printk(ap, KERN_DEBUG,
+   port disabled. ignoring.\n);
ap-eh_context.i.action = ~ATA_EH_RESET_MASK;
+
+   for (i = 0; i  ATA_MAX_DEVICES; i++)
+   classes[i] = ATA_DEV_NONE;
+
+   rc = 0;
} else
ata_port_printk(ap, KERN_ERR,
prereset failed (errno=%d)\n, rc);
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 9a0523b..c6f0e19 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -193,7 +193,7 @@ static __devinit int ixp4xx_pata_probe(struct 
platform_device *pdev)
 
irq = platform_get_irq(pdev, 0);
if (irq)
-   set_irq_type(irq, IRQT_HIGH);
+   set_irq_type(irq, IRQT_RISING);
 
/* Setup expansion bus chip selects */
*data-cs0_cfg = data-cs0_bits;
@@ -232,7 +232,6 @@ static __devexit int ixp4xx_pata_remove(struct 
platform_device *dev)
struct ata_host *host = platform_get_drvdata(dev);
 
ata_host_detach(host);
-   platform_set_drvdata(dev, NULL);
 
return 0;
 }
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index 3193a60..1e21688 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -672,10 +672,6 @@ static int inic_init_one(struct pci_dev *pdev, const 
struct pci_device_id *ent)
if (rc)
return rc;
 
-   rc = pci_request_regions(pdev, DRV_NAME);
-   if (rc)
-   return rc;
-
rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME);
if (rc)
return rc;
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 75d9615..5614df8 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -346,6 +346,7 @@ static const struct pci_device_id sil24_pci_tbl[] = {
{ PCI_VDEVICE(CMD, 0x3124), BID_SIL3124 },
{ PCI_VDEVICE(INTEL, 0x3124), BID_SIL3124 },
{ PCI_VDEVICE(CMD, 0x3132), BID_SIL3132 },
+   { PCI_VDEVICE(CMD, 0x0242), BID_SIL3132 },
{ PCI_VDEVICE(CMD, 0x3131), BID_SIL3131 },
{ PCI_VDEVICE(CMD, 0x3531), BID_SIL3131 },
 
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [git patches] libata fixes

2007-03-18 Thread Paul Rolland
Hello,

 Can you put the harddisk under high load and see what happens?  How
 often do those errors occur?  Care to post full dmesg?

I started again a stock 2.6.21-rc4, and ran that :
while (/bin/true); do tar jxf linux-2.6.19.1.tar.bz2; rm -rf linux-2.6.19.1;
echo -n .; done  

After several minutes (I waited more than 300 loops to be completed), and
a lot of errors, I finally managed to see :
Mar 18 10:32:47 riri kernel: ata1.00: NCQ disabled due to excessive errors

/var/log/messages contains :
Mar 18 10:15:04 riri syslogd 1.4.1#17ubuntu7: restart.
Mar 18 10:15:04 riri kernel: Inspecting /boot/System.map-2.6.21-rc4
Mar 18 10:15:04 riri kernel: Loaded 39327 symbols from
/boot/System.map-2.6.21-rc4.
Mar 18 10:15:04 riri kernel: Symbols match kernel version 2.6.21.
Mar 18 10:15:04 riri kernel: No module symbols loaded - kernel modules not
enabled. 
Mar 18 10:15:04 riri kernel: Linux version 2.6.21-rc4 ([EMAIL PROTECTED])
(gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) #1 SMP PREEMPT Sat Mar 17 18:50:10
CET 2007
Mar 18 10:15:04 riri kernel: Command line: root=/dev/sde1 ro ata2=noprobe
console=ttyS0,9600 console=tty0 vga=extended irqpoll
Mar 18 10:15:04 riri kernel: BIOS-provided physical RAM map:
Mar 18 10:15:04 riri kernel:  BIOS-e820:  - 0009fc00
(usable)
Mar 18 10:15:04 riri kernel:  BIOS-e820: 0009fc00 - 000a
(reserved)
Mar 18 10:15:04 riri kernel:  BIOS-e820: 000e4000 - 0010
(reserved)
Mar 18 10:15:04 riri kernel:  BIOS-e820: 0010 - c7f8
(usable)
Mar 18 10:15:04 riri kernel:  BIOS-e820: c7f8 - c7f8e000
(ACPI data)
Mar 18 10:15:04 riri kernel:  BIOS-e820: c7f8e000 - c7fe
(ACPI NVS)
Mar 18 10:15:04 riri kernel:  BIOS-e820: c7fe - c800
(reserved)
Mar 18 10:15:04 riri kernel:  BIOS-e820: ffb0 - 0001
(reserved)
Mar 18 10:15:04 riri kernel: end_pfn_map = 1048576
Mar 18 10:15:04 riri kernel: DMI 2.4 present.
Mar 18 10:15:04 riri kernel: ACPI: RSDP 000FAF20, 0024 (r2 ACPIAM)
Mar 18 10:15:04 riri kernel: ACPI: XSDT C7F80100, 005C (r1 A_M_I_ OEMXSDT
12000608 MSFT   97)
Mar 18 10:15:04 riri kernel: ACPI: FACP C7F80290, 00F4 (r3 A_M_I_ OEMFACP
12000608 MSFT   97)
Mar 18 10:15:04 riri kernel: ACPI: DSDT C7F80410, 8FC4 (r1  A0543 A0543000
0 INTL 20060113)
Mar 18 10:15:04 riri kernel: ACPI: FACS C7F8E000, 0040
Mar 18 10:15:04 riri kernel: ACPI: APIC C7F80390, 0080 (r1 A_M_I_ OEMAPIC
12000608 MSFT   97)
Mar 18 10:15:04 riri kernel: ACPI: OEMB C7F8E040, 0066 (r1 A_M_I_ AMI_OEM
12000608 MSFT   97)
Mar 18 10:15:04 riri kernel: ACPI: HPET C7F893E0, 0038 (r1 A_M_I_ OEMHPET
12000608 MSFT   97)
Mar 18 10:15:04 riri kernel: ACPI: MCFG C7F89420, 003C (r1 A_M_I_ OEMMCFG
12000608 MSFT   97)
Mar 18 10:15:04 riri kernel: ACPI: SSDT C7F8E0B0, 01C6 (r1AMI   CPU1PM
1 INTL 20060113)
Mar 18 10:15:04 riri kernel: ACPI: SSDT C7F8E280, 013A (r1AMI   CPU2PM
1 INTL 20060113)
Mar 18 10:15:04 riri kernel: Zone PFN ranges:
Mar 18 10:15:04 riri kernel:   DMA 0 - 4096
Mar 18 10:15:04 riri kernel:   DMA324096 -  1048576
Mar 18 10:15:04 riri kernel:   Normal1048576 -  1048576
Mar 18 10:15:04 riri kernel: early_node_map[2] active PFN ranges
Mar 18 10:15:04 riri kernel: 0:0 -  159
Mar 18 10:15:04 riri kernel: 0:  256 -   819072
Mar 18 10:15:04 riri kernel: ACPI: PM-Timer IO Port: 0x808
Mar 18 10:15:04 riri kernel: ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00]
enabled)
Mar 18 10:15:04 riri kernel: Processor #0 (Bootup-CPU)
Mar 18 10:15:04 riri kernel: ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01]
enabled)
Mar 18 10:15:04 riri kernel: Processor #1
Mar 18 10:15:04 riri kernel: ACPI: LAPIC (acpi_id[0x03] lapic_id[0x82]
disabled)
Mar 18 10:15:04 riri kernel: ACPI: LAPIC (acpi_id[0x04] lapic_id[0x83]
disabled)
Mar 18 10:15:04 riri kernel: ACPI: IOAPIC (id[0x02] address[0xfec0]
gsi_base[0])
Mar 18 10:15:04 riri kernel: IOAPIC[0]: apic_id 2, address 0xfec0, GSI
0-23
Mar 18 10:15:04 riri kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2
dfl dfl)
Mar 18 10:15:04 riri kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9
high level)
Mar 18 10:15:04 riri kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2
dfl dfl)
Mar 18 10:15:04 riri kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9
high level)
Mar 18 10:15:04 riri kernel: Setting APIC routing to flat
Mar 18 10:15:04 riri kernel: ACPI: HPET id: 0x8086a201 base: 0xfed0
Mar 18 10:15:04 riri kernel: Using ACPI (MADT) for SMP configuration
information
Mar 18 10:15:04 riri kernel: Nosave address range: 0009f000 -
000a
Mar 18 10:15:04 riri kernel: Nosave address range: 000a -
000e4000
Mar 18 10:15:04 riri kernel: Nosave address range: 000e4000 -
0010
Mar 18 10:15:04 riri kernel: Allocating PCI resources starting at cc00
(gap: c800:37b0)
Mar 18 10:15:04 riri kernel: 

Re: [git patches] libata fixes

2007-03-18 Thread Tejun Heo
Paul Rolland wrote:
 Hello,
 
 Can you put the harddisk under high load and see what happens?  How
 often do those errors occur?  Care to post full dmesg?
 
 I started again a stock 2.6.21-rc4, and ran that :
 while (/bin/true); do tar jxf linux-2.6.19.1.tar.bz2; rm -rf linux-2.6.19.1;
 echo -n .; done  
 
 After several minutes (I waited more than 300 loops to be completed), and
 a lot of errors, I finally managed to see :
 Mar 18 10:32:47 riri kernel: ata1.00: NCQ disabled due to excessive errors
 
 Mar 18 10:23:26 riri kernel:  res 40/00:58:53:6e:31/00:00:0d:00:00/40
 Emask 0x2 (HSM violation)
 Mar 18 10:25:07 riri kernel:  res 40/00:d8:db:b0:2e/00:00:0d:00:00/40
 Emask 0x2 (HSM violation)
 Mar 18 10:32:42 riri kernel:  res 40/00:c0:7b:6a:2a/00:00:0d:00:00/40
 Em
 ask 0x2 (HSM violation)
 Mar 18 10:32:47 riri kernel: ata1.00: NCQ disabled due to excessive errors
 Mar 18 10:32:47 riri kernel:  res 40/00:b8:63:0d:2d/00:00:0d:00:00/40
 Em
 ask 0x2 (HSM violation)
 
 Is this what you were expecting ?

Yeap, more than three HSM violations in ten minutes.  That's the
criteria for turning off NCQ.  Good to see it working.  It look like a
lot because libata reports all active commands (can't help as on HSM
failure, there's no way to determine which caused it) and the SCSI
prints revalidation messages, but it's still only three errors.

Thanks for verifying that.  I wanted to verify it works in the field as
expected.

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [git patches] libata fixes

2007-03-18 Thread Paul Rolland
Hello,

 Yeap, more than three HSM violations in ten minutes.  That's the
 criteria for turning off NCQ.  Good to see it working.  It look like a
 lot because libata reports all active commands (can't help as on HSM
 failure, there's no way to determine which caused it) and the SCSI
 prints revalidation messages, but it's still only three errors.
 
 Thanks for verifying that.  I wanted to verify it works in 
 the field as expected.

Glad to help !

Anyhow, how should I consider these errors ? Are they real failure that
can affect data integrity on the disk, or some kind of protocol errors
with the disk, that are covered by soft (retry or so), and don't affect
data ?

Regards,
Paul

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


RE: [git patches] libata fixes

2007-03-18 Thread Paul Rolland
Hi,

 This is NCQ protocol violation on the drive's side shown on some early
 drives.  No need to worry too much about it.  The drive will just get
 blacklisted for NCQ and should work fine.
 

Thx.

Also, remember one of the problem I have, with ata2 going to timeout
because this port of the ICH7 is connected to a PMT ?
You suggested me to connect a disk to one of the SATA port of the PMT,
and reboot the machine to see if the timeout would vanish... I've just
done it, and here is the relevant part of the boot log :


ACPI: PCI Interrupt :00:1f.2[B] - GSI 23 (level, low) - IRQ 23
ahci :00:1f.2: AHCI 0001.0100 32 slots 4 ports 3 Gbps 0xf impl SATA mode
ahci :00:1f.2: flags: 64bit ncq led clo pio slum part 
ata1: SATA max UDMA/133 cmd 0xc208e900 ctl 0x bmdma
0x irq 504
ata2: SATA max UDMA/133 cmd 0xc208e980 ctl 0x bmdma
0x irq 504
ata3: SATA max UDMA/133 cmd 0xc208ea00 ctl 0x bmdma
0x irq 504
ata4: SATA max UDMA/133 cmd 0xc208ea80 ctl 0x bmdma
0x irq 504
scsi0 : ahci
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata1.00: ATA-7: Maxtor 6L250S0, BANC1G10, max UDMA/133
ata1.00: 490234752 sectors, multi 0: LBA48 NCQ (not used)
ata1.00: configured for UDMA/133
scsi1 : ahci
ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata2.00: ATA-6: External Disk 0, RGL10364, max UDMA/133
ata2.00: 1 sectors, multi 1: LBA48 
ata2.00: configured for UDMA/133
scsi2 : ahci
ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata3.00: ATA-7: Maxtor 6L250S0, BANC1G10, max UDMA/133
ata3.00: 490234752 sectors, multi 0: LBA48 NCQ (not used)
ata3.00: configured for UDMA/133
scsi3 : ahci
ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata4.00: ATA-7: ST3500641AS, 3.AAB, max UDMA/133
ata4.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 31/32)
ata4.00: configured for UDMA/133
scsi 0:0:0:0: Direct-Access ATA  Maxtor 6L250S0   BANC PQ: 0 ANSI: 5
SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB)
sda: Write Protect is off
SCSI device sda: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB)
sda: Write Protect is off
SCSI device sda: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
 sda: sda1 sda2 sda3
sd 0:0:0:0: Attached scsi disk sda
sd 0:0:0:0: Attached scsi generic sg0 type 0
scsi 1:0:0:0: Direct-Access ATA  External Disk 0  RGL1 PQ: 0 ANSI: 5
SCSI device sdb: 1 512-byte hdwr sectors (0 MB)
sdb: Write Protect is off
SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
SCSI device sdb: 1 512-byte hdwr sectors (0 MB)
sdb: Write Protect is off
SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
 sdb: unknown partition table
sd 1:0:0:0: Attached scsi disk sdb
sd 1:0:0:0: Attached scsi generic sg1 type 0
scsi 2:0:0:0: Direct-Access ATA  Maxtor 6L250S0   BANC PQ: 0 ANSI: 5
SCSI device sdc: 490234752 512-byte hdwr sectors (251000 MB)
sdc: Write Protect is off
SCSI device sdc: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
SCSI device sdc: 490234752 512-byte hdwr sectors (251000 MB)
sdc: Write Protect is off
SCSI device sdc: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
 sdc: sdc1 sdc2
sd 2:0:0:0: Attached scsi disk sdc
sd 2:0:0:0: Attached scsi generic sg2 type 0
scsi 3:0:0:0: Direct-Access ATA  ST3500641AS  3.AA PQ: 0 ANSI: 5
SCSI device sdd: 976773168 512-byte hdwr sectors (500108 MB)
sdd: Write Protect is off
SCSI device sdd: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
SCSI device sdd: 976773168 512-byte hdwr sectors (500108 MB)
sdd: Write Protect is off
SCSI device sdd: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
 sdd: sdd1 sdd2 sdd3
sd 3:0:0:0: Attached scsi disk sdd
sd 3:0:0:0: Attached scsi generic sg3 type 0
ACPI: PCI Interrupt :02:00.0[A] - GSI 17 (level, low) - IRQ 17
ahci :02:00.0: AHCI 0001. 32 slots 2 ports 3 Gbps 0x3 impl SATA mode
ahci :02:00.0: flags: 64bit ncq pm led clo pmp pio slum part 
...

The good news is that there is no more timeout, which is excellent !
The bad news is that the disk is not detected... but maybe I should do
something in the BIOS configuration. I'll try to have a look at this,
because connecting a disk to avoid TO without being able to use it is not
that good ;)

Regards,
Paul

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


RE: [git patches] libata fixes

2007-03-18 Thread Paul Rolland
Doh ! Got that :


ACPI: PCI Interrupt :00:1f.2[B] - GSI 23 (level, low) - IRQ 23
ahci :00:1f.2: AHCI 0001.0100 32 slots 4 ports 3 Gbps 0xf impl SATA mode
ahci :00:1f.2: flags: 64bit ncq led clo pio slum part 
ata1: SATA max UDMA/133 cmd 0xc208e900 ctl 0x bmdma
0x irq 504
ata2: SATA max UDMA/133 cmd 0xc208e980 ctl 0x bmdma
0x irq 504
ata3: SATA max UDMA/133 cmd 0xc208ea00 ctl 0x bmdma
0x irq 504
ata4: SATA max UDMA/133 cmd 0xc208ea80 ctl 0x bmdma
0x irq 504
scsi0 : ahci
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata1.00: ATA-7: Maxtor 6L250S0, BANC1G10, max UDMA/133
ata1.00: 490234752 sectors, multi 0: LBA48 NCQ (not used)
ata1.00: configured for UDMA/133
scsi1 : ahci
ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata2.00: ATA-6: External Disk 0, RGL10364, max UDMA/133
ata2.00: 1 sectors, multi 1: LBA48 
ata2.00: configured for UDMA/133
scsi2 : ahci
ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata3.00: ATA-7: Maxtor 6L250S0, BANC1G10, max UDMA/133
ata3.00: 490234752 sectors, multi 0: LBA48 NCQ (not used)
ata3.00: configured for UDMA/133
scsi3 : ahci
ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata4.00: ATA-7: ST3500641AS, 3.AAB, max UDMA/133
ata4.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 31/32)
ata4.00: configured for UDMA/133
scsi 0:0:0:0: Direct-Access ATA  Maxtor 6L250S0   BANC PQ: 0 ANSI: 5
SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB)
sda: Write Protect is off
SCSI device sda: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB)
sda: Write Protect is off
SCSI device sda: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
 sda: sda1 sda2 sda3
sd 0:0:0:0: Attached scsi disk sda
sd 0:0:0:0: Attached scsi generic sg0 type 0
scsi 1:0:0:0: Direct-Access ATA  External Disk 0  RGL1 PQ: 0 ANSI: 5
SCSI device sdb: 1 512-byte hdwr sectors (0 MB)
sdb: Write Protect is off
SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
SCSI device sdb: 1 512-byte hdwr sectors (0 MB)
sdb: Write Protect is off
SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA
 sdb:3irq 504: nobody cared (try booting with the irqpoll option)

Call Trace:
 IRQ  [802b0245] __report_bad_irq+0x35/0x90
 [802b04ba] note_interrupt+0x21a/0x270
 [802b128f] handle_edge_irq+0x10f/0x150
 [8026f3eb] do_IRQ+0x7b/0xf0
 [80259e70] mwait_idle+0x0/0x50
 [802612d1] ret_from_intr+0x0/0xa
 EOI  [8042bff0] vgacon_cursor+0x0/0x1d0
 [80259eb6] mwait_idle+0x46/0x50
 [8024aebc] cpu_idle+0x5c/0xa0
 [808b984a] start_kernel+0x2aa/0x2c0
 [808b9176] _sinittext+0x176/0x180

handlers:
[804e1c90] (ahci_interrupt+0x0/0x590)
Disabling IRQ #504
 unknown partition table
sd 1:0:0:0: Attached scsi disk sdb
sd 1:0:0:0: Attached scsi generic sg1 type 0
scsi 2:0:0:0: Direct-Access ATA  Maxtor 6L250S0   BANC PQ: 0 ANSI: 5
SCSI device sdc: 490234752 512-byte hdwr sectors (251000 MB)
sdc: Write Protect is off


and though it said :
 sdb:3irq 504: nobody cared (try booting with the irqpoll option)
I _am_ booting with the irqpoll option !

Paul

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


RE: [git patches] libata fixes

2007-03-17 Thread Paul Rolland

  PS : I'd like to try 2.6.21-rc3, but it seems that this is 
 breaking my
  config : disk naming is no more the same, and I end up with a panic
  Warning: unable to open an initial console
  though i've been compiling with the same .config I was 
 using for 2.6.21-rc2
 
 Gaah. Can you get a log through serial console or netconsole 
 to see what changed?
 

Sorry, I've had no time this week for that.
I've just switch to 2.6.21-rc4, and carefully restored config from 2.6.21-rc2,
and boot is Ok...

So, I must have done something bad when building 2.6.21-rc3, sorry for the
noise.

Regards,
Paul

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


RE: [git patches] libata fixes

2007-03-17 Thread Paul Rolland
 and Peering Coordinator

--

Please no HTML, I'm not a browser - Pas d'HTML, je ne suis pas un navigateur 
Some people dream of success... while others wake up and work hard at it 

I worry about my child and the Internet all the time, even though she's too 
young to have logged on yet. Here's what I worry about. I worry that 10 or 15 
years from now, she will come to me and say 'Daddy, where were you when they 
took freedom of the press away from the Internet?'
--Mike Godwin, Electronic Frontier Foundation 
  

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Tejun Heo
 Sent: Monday, March 12, 2007 9:05 AM
 To: [EMAIL PROTECTED]
 Cc: 'Linus Torvalds'; 'Jeff Garzik'; 'Alan Cox'; 'Andrew 
 Morton'; linux-ide@vger.kernel.org; 'LKML'; 'Eric D. Mudama'
 Subject: Re: [git patches] libata fixes
 
 Paul Rolland wrote:
  I keep forgetting about this.  I'll ask SIMG how to deal with 
  this.  For
  the time being, connecting a device to the PMP port should 
 remove the
  timeouts.
  
  That sounds a quite expensive solution ;)
 
 You should be able to just move the drive attached at ata1 to ata2.
 Please report whether that works.
 
 -- 
 tejun
 -
 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/
 

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


Re: [git patches] libata fixes

2007-03-17 Thread Alan Cox
On Sat, Mar 17, 2007 at 07:47:01PM +0100, Paul Rolland wrote:
 Hello,
 
 Here is a patch to avoid these pesky messages for the Maxtor disk :
 

Please match the firmware version as well for the Maxtor drives

 --- linux-2.6.21-rc4/drivers/ata/libata-core.c  2007-03-17 19:29:45.0
 +0100
 +++ linux-2.6.21-rc4-Maxtor/drivers/ata/libata-core.c   2007-03-17
 19:37:28.0 +0100
 @@ -3359,6 +3359,8 @@
  { WDC WD740ADFD-00,   NULL,  ATA_HORKAGE_NONCQ },
 /* http://thread.gmane.org/gmane.linux.ide/14907 */
 { FUJITSU MHT2060BH,  NULL,   ATA_HORKAGE_NONCQ },
 +   /* NCQ is broken */
 +   { Maxtor 6L250S0, NULL,   ATA_HORKAGE_NONCQ }, 
  
 /* Devices with NCQ limits */
  
 
 Signed-off-by: Paul Rolland [EMAIL PROTECTED]

NAK - but add the firmware to the match and you can have an Ack 8)
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [git patches] libata fixes

2007-03-17 Thread Paul Rolland
Hello,

 Please match the firmware version as well for the Maxtor drives
Ok.
 
  --- linux-2.6.21-rc4/drivers/ata/libata-core.c  2007-03-17 
 19:29:45.0
  +0100
  +++ linux-2.6.21-rc4-Maxtor/drivers/ata/libata-core.c   2007-03-17
  19:37:28.0 +0100
  @@ -3359,6 +3359,8 @@
   { WDC WD740ADFD-00,   NULL,  ATA_HORKAGE_NONCQ },
  /* http://thread.gmane.org/gmane.linux.ide/14907 */
  { FUJITSU MHT2060BH,  NULL,   ATA_HORKAGE_NONCQ },
  +   /* NCQ is broken */
  +   { Maxtor 6L250S0, NULL,   
 ATA_HORKAGE_NONCQ }, 
   
  /* Devices with NCQ limits */
   
  
  Signed-off-by: Paul Rolland [EMAIL PROTECTED]
 
 NAK - but add the firmware to the match and you can have an Ack 8)

Second try, compiled _and_ boot tested, of course.

dmesg says :
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata1.00: ATA-7: Maxtor 6L250S0, BANC1G10, max UDMA/133
ata1.00: 490234752 sectors, multi 0: LBA48 NCQ (not used)
ata1.00: configured for UDMA/133

--- linux-2.6.21-rc4/drivers/ata/libata-core.c  2007-03-17 19:47:49.0
+0100
+++ linux-2.6.21-rc4-Maxtor/drivers/ata/libata-core.c   2007-03-17
20:24:01.0 +0100
@@ -3359,6 +3359,8 @@
 { WDC WD740ADFD-00,   NULL,  ATA_HORKAGE_NONCQ },
/* http://thread.gmane.org/gmane.linux.ide/14907 */
{ FUJITSU MHT2060BH,  NULL,   ATA_HORKAGE_NONCQ },
+   /* NCQ is broken */
+   { Maxtor 6L250S0, BANC1G10, ATA_HORKAGE_NONCQ }, 
 
/* Devices with NCQ limits */

Signed-off-by: Paul Rolland [EMAIL PROTECTED]

Regards,
Paul

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


Re: [git patches] libata fixes

2007-03-17 Thread Tejun Heo
Paul Rolland wrote:
 Hello,
 
 I'm preparing to attach a disk. 
 In the meantime, I've rebuild a 2.6.21-rc4, and got that while booting :
 ...
 ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
 ata1.00: ATA-7: Maxtor 6L250S0, BANC1G10, max UDMA/133
 ata1.00: 490234752 sectors, multi 0: LBA48 NCQ (depth 31/32)
 ata1.00: configured for UDMA/133
 ...
 Adding 2096436k swap on /dev/sde5.  Priority:-1 extents:1 across:2096436k
 Adding 4192956k swap on /dev/sda3.  Priority:-2 extents:1 across:4192956k
 ata1.00: exception Emask 0x2 SAct 0x7fc3 SErr 0x0 action 0x2 frozen
 ata1.00: (spurious completions during NCQ issue=0x0 SAct=0x7fc3
 FIS=004040a1:0020)
 ata1.00: cmd 60/01:00:52:eb:ff/00:00:09:00:00/40 tag 0 cdb 0x0 data 512 in
  res 40/00:08:53:eb:ff/00:00:09:00:00/40 Emask 0x2 (HSM violation)

If you leave it alone, does libata turn off NCQ and boot continues?

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-03-17 Thread Alan Cox

   
   Signed-off-by: Paul Rolland [EMAIL PROTECTED]
  
  NAK - but add the firmware to the match and you can have an Ack 8)
 
 Second try, compiled _and_ boot tested, of course.
 
 dmesg says :
 ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
 ata1.00: ATA-7: Maxtor 6L250S0, BANC1G10, max UDMA/133
 ata1.00: 490234752 sectors, multi 0: LBA48 NCQ (not used)
 ata1.00: configured for UDMA/133
 
 --- linux-2.6.21-rc4/drivers/ata/libata-core.c  2007-03-17 19:47:49.0
 +0100
 +++ linux-2.6.21-rc4-Maxtor/drivers/ata/libata-core.c   2007-03-17
 20:24:01.0 +0100
 @@ -3359,6 +3359,8 @@
  { WDC WD740ADFD-00,   NULL,  ATA_HORKAGE_NONCQ },
 /* http://thread.gmane.org/gmane.linux.ide/14907 */
 { FUJITSU MHT2060BH,  NULL,   ATA_HORKAGE_NONCQ },
 +   /* NCQ is broken */
 +   { Maxtor 6L250S0, BANC1G10, ATA_HORKAGE_NONCQ }, 
  
 /* Devices with NCQ limits */
 
 Signed-off-by: Paul Rolland [EMAIL PROTECTED]

Acked-by: Alan Cox [EMAIL PROTECTED]

--
  'YKYHBRTFDriverSTLW: you catch yourself saying enough horrors for today
and picking Lovecraft to relax...' -- Al Viro
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-03-17 Thread Tejun Heo
Paul Rolland wrote:
 If you leave it alone, does libata turn off NCQ and boot continues?
 
 boot continues, but I can't tell anything about libata turning of NCQ...
 I've had a bunch of them at some while while compiling some kernel, so it
 was quite some time after booting.
 
 Is there a message I can check for that would indicate NCQ being turned
 off ?

The kernel says that NCQ is turned off due to excessive errors.  If your
HSM violation is intermittent, it might not trigger tho.

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [git patches] libata fixes

2007-03-17 Thread Paul Rolland
Hello,

 The kernel says that NCQ is turned off due to excessive 
 errors.  If your
 HSM violation is intermittent, it might not trigger tho.

I've just grep'ed thru all my messages, and I can't find anything 
stating that NCQ is being turned off...

Paul 

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


Re: [git patches] libata fixes

2007-03-17 Thread Tejun Heo
Paul Rolland wrote:
 Hello,
 
 The kernel says that NCQ is turned off due to excessive 
 errors.  If your
 HSM violation is intermittent, it might not trigger tho.
 
 I've just grep'ed thru all my messages, and I can't find anything 
 stating that NCQ is being turned off...

Can you put the harddisk under high load and see what happens?  How
often do those errors occur?  Care to post full dmesg?

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [git patches] libata fixes

2007-03-12 Thread Paul Rolland
Hello,

 Ok, so that's just a message irritation, not actually bothersome 
 otherwise?

It is somewhat painful, because delays involved are quite long, and
it is not possible to explain the machine to ignore the port, and
skip to the next one... 
 
  The second problem is a Jmicron363 controler that is 
 failing to detect
  the DVD-RW that is connected, unless I use the irqpoll 
 option as Tejun has
  suggested.
 
 .. and this one has never worked without irqpoll?

Exactly.
 
 So it's the irq16 one that is the Jmicron controller and just isn't 
 getting any interrupts?

It's IRQ 16 that is reported as affected to the Jmicron from the dmesg
output, yes.
 
 Since all the other interrupts work (and MSI worked for other 
 controllers), I don't think it's interrupt-routing related. 
 Especially as MSI shouldn't even care about things like that.

 And since it all works when irqpoll is used, that implies that the 
 *only* thing that is broken is literally irq delivery.

Surely, also if you add the using pci=nomsi doesn't change anything.
 
 Gaah. Can you get a log through serial console or netconsole 
 to see what changed?

I'll try to do that 

Regards,
Paul

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


RE: [git patches] libata fixes

2007-03-12 Thread Paul Rolland
Hello,

 It involves a long timeout, so it's bothersome.  This is caused by
 Silicon Image 4726/3726 storage processor (SATA Port Multiplier with
 extra features) attached to one of the ICH ports.

Yes, I think this is the part Asus is using for it's EZ-Raid feature
on this motherboard, and they seem to like their EZ-Raid, so it's likely
to become more and more common.
 
 If the first  downstream port in the PMP is empty and it gets reset in
I confirm it is empty in my config.

 work very well with the current ATA reset sequence and gets identified
 only after a few failures thus causing long timeout.
30s to 1min ;(
 
 I keep forgetting about this.  I'll ask SIMG how to deal with 
 this.  For
 the time being, connecting a device to the PMP port should remove the
 timeouts.

That sounds a quite expensive solution ;)

Paul

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


Re: [git patches] libata fixes

2007-03-12 Thread Tejun Heo
Paul Rolland wrote:
 I keep forgetting about this.  I'll ask SIMG how to deal with 
 this.  For
 the time being, connecting a device to the PMP port should remove the
 timeouts.
 
 That sounds a quite expensive solution ;)

You should be able to just move the drive attached at ata1 to ata2.
Please report whether that works.

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [git patches] libata fixes

2007-03-12 Thread Paul Rolland
Hello,

  That sounds a quite expensive solution ;)
 
 You should be able to just move the drive attached at ata1 to ata2.
 Please report whether that works.

I'll try to find an unused disk... As I said, these ports are part of
Asus EZRaid solution, and i'd prefer this piece of code not to try to
write anything on the disk ;)

... but I should find a disk without too much problem.

Paul

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


RE: [git patches] libata fixes

2007-03-11 Thread Paul Rolland
Hello,

 It seems like IRQ is not getting through.  The first IRQ 
 driven command is failing for you.

H 
 Extract is :
 ata7: PATA max UDMA/100 cmd 0x00019c00 ctl 0x00019882 bmdma
 0x00019400 irq 16
 ata8: PATA max UDMA/100 cmd 0x00019800 ctl 0x00019482 bmdma
 0x00019408 irq 16

IRQ 16 is IO-APIC-fasteoi for libata, and is not shared... but all the
others libata IRQ are IO-APIC-edge.

 * Does giving 'acpi=off' or 'irqpoll' make any difference?
 
 * Can you connect a harddisk to the channel and see whether 
 that works?
Tried that.. Disk is identified as ATA-7: Mastor 6Y080L0, YAR41BW0, max
UDMA/13
and then timeout again...

Tried then with acpi=off, same result (identify is OK, but then timeout),
and irqpoll and then it was OK 

Let's then go back to my DVD-RW and test irqpoll...
and ... Yes Got it !
It is identified, it can be mounted, and read as /dev/sr1 !

/proc/interrupts show a count of 0 for IRQ 16, so yes, it goes somewhere
else...

Doing some diffs on copy of /proc/interrupts while accessing the DVD
gives two possibilities : IRQ14 or IRQ18, but both are also counting
when not accessing the DVD...

Question : does running with irqpoll affects performance ?

Paul
 

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


RE: [git patches] libata fixes

2007-03-11 Thread Paul Rolland
Just one point that may be interesting, as it seems that this is IRQ
related : at the beginning of the dmesg, it seems that IRQ16 is used
for sky2/Yukon , but when reading /proc/interrupts, it has been remapped
to IRQ 505... Could this also affect libata ?

Regards,
Paul

Paul Rolland, rol(at)as2917.net
ex-AS2917 Network administrator and Peering Coordinator

--

Please no HTML, I'm not a browser - Pas d'HTML, je ne suis pas un navigateur 
Some people dream of success... while others wake up and work hard at it 

I worry about my child and the Internet all the time, even though she's too 
young to have logged on yet. Here's what I worry about. I worry that 10 or 15 
years from now, she will come to me and say 'Daddy, where were you when they 
took freedom of the press away from the Internet?'
--Mike Godwin, Electronic Frontier Foundation 
  

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Paul Rolland
 Sent: Sunday, March 11, 2007 7:35 PM
 To: 'Linus Torvalds'
 Cc: 'Tejun Heo'; 'Jeff Garzik'; 'Andrew Morton'; 
 linux-ide@vger.kernel.org; 'LKML'; 'Eric D. Mudama'
 Subject: RE: [git patches] libata fixes
 
 Hello,
 
   do I understand correctly that the *only* difference between 
  the working 
  setup is that you applied (by hand) the libata patch that 
  Jeff sent out?
  
  So plain 2.6.21-rc2 works fine, but with the patch applied, 
  you get no 
  interrupts on the DVD drive?
 
 Nope... I tried several patches from Tejun, and also some 
 that Jeff posted
 to linux-ide, but no luck. The only way to have this DVD-RW 
 working is to
 use irqpoll on the command line...
 
 Sorry to have been unclear
 
 To complete, here are some more output from the machine : 
  - a dmesg without irqpoll,
  - a dmesg with irqpoll,
  - a copy of /proc/interrupts
 6 [19:33] [EMAIL PROTECTED]:~ cat /proc/interrupts 
CPU0   CPU1   
   0: 357022  0   IO-APIC-edge  timer
   1:  8  0   IO-APIC-edge  i8042
   4: 14  0   IO-APIC-edge  serial
   6:  5  0   IO-APIC-edge  floppy
   8:  1  0   IO-APIC-edge  rtc
   9:  0  0   IO-APIC-fasteoi   acpi
  12:129  0   IO-APIC-edge  i8042
  14:   7639  0   IO-APIC-edge  libata
  15:  0  0   IO-APIC-edge  libata
  16:  0  0   IO-APIC-fasteoi   libata
  17:  0  0   IO-APIC-fasteoi   uhci_hcd:usb3
  18:  0  0   IO-APIC-fasteoi   uhci_hcd:usb4
  19:204  0   IO-APIC-fasteoi   uhci_hcd:usb5, 
 HDA Intel
  20:107  0   IO-APIC-fasteoi   ehci_hcd:usb1, 
 uhci_hcd:usb2
  21:  3  0   IO-APIC-fasteoi   ohci1394
 504:   8243  0   PCI-MSI-edge  libata
 505:  1  0   PCI-MSI-edge  eth1
 506:386  0   PCI-MSI-edge  eth0
 NMI:771531 
 LOC: 569318 578684 
 ERR:  0
 
 Regards,
 Paul
 

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


RE: [git patches] libata fixes

2007-03-11 Thread Linus Torvalds


On Sun, 11 Mar 2007, Paul Rolland wrote:
 
 Nope... I tried several patches from Tejun, and also some that Jeff posted
 to linux-ide, but no luck. The only way to have this DVD-RW working is to
 use irqpoll on the command line...

So it has *never* worked? That's what I'm trying to see - you had a 
before and after dmesg in one of your posts, and the before one 
looked fine (as if it was working) because it didn't have the error 
messages.

So I'm just trying to figure out where the regression started...

 To complete, here are some more output from the machine : 

What happens if you disable MSI entirely? Use pci=nomsi on the command 
line.

The

ata2.00: qc timeout (cmd 0xec)
ata2.00: failed to IDENTIFY (I/O error, err_mask=0x104)

messages happen for you on the controller that claims MSI:

ata2: SATA max UDMA/133 cmd 0xc208a980 ctl 0x 
bmdma 0x irq 504

and quite frankly, we've had lots of bugs with MSI, both in hardware and 
in software.

Linus
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [git patches] libata fixes

2007-03-11 Thread Paul Rolland
Hello,

  Nope... I tried several patches from Tejun, and also some 
 that Jeff posted
  to linux-ide, but no luck. The only way to have this DVD-RW 
 working is to
  use irqpoll on the command line...
 
 So it has *never* worked? That's what I'm trying to see - you had a 
 before and after dmesg in one of your posts, and the before one 
 looked fine (as if it was working) because it didn't have the error 
 messages.
 
 So I'm just trying to figure out where the regression started...
 
  To complete, here are some more output from the machine : 
 
 What happens if you disable MSI entirely? Use pci=nomsi on 
 the command 
 line.
 
 The
 
   ata2.00: qc timeout (cmd 0xec)
   ata2.00: failed to IDENTIFY (I/O error, err_mask=0x104)
 
 messages happen for you on the controller that claims MSI:
 
   ata2: SATA max UDMA/133 cmd 0xc208a980 ctl 
 0x bmdma 0x irq 504
 
 and quite frankly, we've had lots of bugs with MSI, both in 
 hardware and 
 in software.

OK, I see, we are talking about two different problems...

My machine is having two problems : the one you are describing above,
which is due to a SIL controler being connected to one port of the ICH7
(at least, it seems to), and probing it goes  timeout, but nothing is
connected on it.

The second problem is a Jmicron363 controler that is failing to detect
the DVD-RW that is connected, unless I use the irqpoll option as Tejun has
suggested.

From what I remember, except my initial description of the problem,
no attempt has been made yet to workaround/understand the first problem,
and all the mails I've exchanged were focused on the second one.

But, as you suggest it, I'm adding pci=nomsi to the command line
rebooting... no change for this part of the problem.

OK, the /proc/interrupt for this config, and the dmesg attached.

3 [23:22] [EMAIL PROTECTED]:~ cat /proc/interrupts 
   CPU0   CPU1   
  0: 297549  0   IO-APIC-edge  timer
  1:  7  0   IO-APIC-edge  i8042
  4: 13  0   IO-APIC-edge  serial
  6:  5  0   IO-APIC-edge  floppy
  8:  1  0   IO-APIC-edge  rtc
  9:  0  0   IO-APIC-fasteoi   acpi
 12:126  0   IO-APIC-edge  i8042
 14:   8313  0   IO-APIC-edge  libata
 15:  0  0   IO-APIC-edge  libata
 16:  0  0   IO-APIC-fasteoi   eth1, libata
 17:  0  0   IO-APIC-fasteoi   uhci_hcd:usb3
 18:   6894  0   IO-APIC-fasteoi   uhci_hcd:usb4
 19:579  0   IO-APIC-fasteoi   eth0, uhci_hcd:usb5, HDA Intel
 20:104  0   IO-APIC-fasteoi   ehci_hcd:usb1, uhci_hcd:usb2
 21:  3  0   IO-APIC-fasteoi   ohci1394
 23:   7205  0   IO-APIC-fasteoi   libata
NMI:783540 
LOC: 291823 290536 

PS : I'd like to try 2.6.21-rc3, but it seems that this is breaking my
config : disk naming is no more the same, and I end up with a panic
Warning: unable to open an initial console
though i've been compiling with the same .config I was using for 2.6.21-rc2

Regards,
Paul



dmesg-2.6.21-rc2-irqpoll-nomsi
Description: Binary data


RE: [git patches] libata fixes

2007-03-11 Thread Linus Torvalds


On Sun, 11 Mar 2007, Paul Rolland wrote:

 My machine is having two problems : the one you are describing above,
 which is due to a SIL controler being connected to one port of the ICH7
 (at least, it seems to), and probing it goes  timeout, but nothing is
 connected on it.

Ok, so that's just a message irritation, not actually bothersome 
otherwise?

 The second problem is a Jmicron363 controler that is failing to detect
 the DVD-RW that is connected, unless I use the irqpoll option as Tejun has
 suggested.

.. and this one has never worked without irqpoll?

 But, as you suggest it, I'm adding pci=nomsi to the command line
 rebooting... no change for this part of the problem.
 
 OK, the /proc/interrupt for this config, and the dmesg attached.
 
 3 [23:22] [EMAIL PROTECTED]:~ cat /proc/interrupts 
CPU0   CPU1   
   0: 297549  0   IO-APIC-edge  timer
   1:  7  0   IO-APIC-edge  i8042
   4: 13  0   IO-APIC-edge  serial
   6:  5  0   IO-APIC-edge  floppy
   8:  1  0   IO-APIC-edge  rtc
   9:  0  0   IO-APIC-fasteoi   acpi
  12:126  0   IO-APIC-edge  i8042
  14:   8313  0   IO-APIC-edge  libata
  15:  0  0   IO-APIC-edge  libata
  16:  0  0   IO-APIC-fasteoi   eth1, libata

So it's the irq16 one that is the Jmicron controller and just isn't 
getting any interrupts?

Since all the other interrupts work (and MSI worked for other 
controllers), I don't think it's interrupt-routing related. Especially as 
MSI shouldn't even care about things like that.

And since it all works when irqpoll is used, that implies that the 
*only* thing that is broken is literally irq delivery.

Is there possibly some jmicron-specific enable interrupts bit? 

 PS : I'd like to try 2.6.21-rc3, but it seems that this is breaking my
 config : disk naming is no more the same, and I end up with a panic
 Warning: unable to open an initial console
 though i've been compiling with the same .config I was using for 2.6.21-rc2

Gaah. Can you get a log through serial console or netconsole to see what 
changed?

Linus
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-03-11 Thread Tejun Heo
Hello, Linus.

Linus Torvalds wrote:
 On Sun, 11 Mar 2007, Paul Rolland wrote:
 My machine is having two problems : the one you are describing above,
 which is due to a SIL controler being connected to one port of the ICH7
 (at least, it seems to), and probing it goes  timeout, but nothing is
 connected on it.
 
 Ok, so that's just a message irritation, not actually bothersome 
 otherwise?

It involves a long timeout, so it's bothersome.  This is caused by
Silicon Image 4726/3726 storage processor (SATA Port Multiplier with
extra features) attached to one of the ICH ports.

If the first  downstream port in the PMP is empty and it gets reset in
non-PMP way, it identifies itself as Config Disk of quite small size.
 It's probably used to configure the extra features using standard ATA
RW commands.  Anyways, this Config Disk is a bit peculiar and doesn't
work very well with the current ATA reset sequence and gets identified
only after a few failures thus causing long timeout.

I keep forgetting about this.  I'll ask SIMG how to deal with this.  For
the time being, connecting a device to the PMP port should remove the
timeouts.

 The second problem is a Jmicron363 controler that is failing to detect
 the DVD-RW that is connected, unless I use the irqpoll option as Tejun has
 suggested.
 
 .. and this one has never worked without irqpoll?
 
 But, as you suggest it, I'm adding pci=nomsi to the command line
 rebooting... no change for this part of the problem.

 OK, the /proc/interrupt for this config, and the dmesg attached.

 3 [23:22] [EMAIL PROTECTED]:~ cat /proc/interrupts 
CPU0   CPU1   
   0: 297549  0   IO-APIC-edge  timer
   1:  7  0   IO-APIC-edge  i8042
   4: 13  0   IO-APIC-edge  serial
   6:  5  0   IO-APIC-edge  floppy
   8:  1  0   IO-APIC-edge  rtc
   9:  0  0   IO-APIC-fasteoi   acpi
  12:126  0   IO-APIC-edge  i8042
  14:   8313  0   IO-APIC-edge  libata
  15:  0  0   IO-APIC-edge  libata
  16:  0  0   IO-APIC-fasteoi   eth1, libata
 
 So it's the irq16 one that is the Jmicron controller and just isn't 
 getting any interrupts?
 
 Since all the other interrupts work (and MSI worked for other 
 controllers), I don't think it's interrupt-routing related. Especially as 
 MSI shouldn't even care about things like that.
 
 And since it all works when irqpoll is used, that implies that the 
 *only* thing that is broken is literally irq delivery.
 
 Is there possibly some jmicron-specific enable interrupts bit? 

(cc'ing Justin of JMicron.  Hello, please correct me if I'm wrong.)

Not that I know of.  The PATA portion of JMB controllers is bog standard
PCI BMDMA ATA device where ATA_NIEN is the way to turn IRQ on and off.

Thanks.

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-03-11 Thread Tejun Heo
Of course I forgot to CC.  :-)  Quoting whole message for Justin.

Tejun Heo wrote:
 Hello, Linus.
 
 Linus Torvalds wrote:
 On Sun, 11 Mar 2007, Paul Rolland wrote:
 My machine is having two problems : the one you are describing above,
 which is due to a SIL controler being connected to one port of the ICH7
 (at least, it seems to), and probing it goes  timeout, but nothing is
 connected on it.
 Ok, so that's just a message irritation, not actually bothersome 
 otherwise?
 
 It involves a long timeout, so it's bothersome.  This is caused by
 Silicon Image 4726/3726 storage processor (SATA Port Multiplier with
 extra features) attached to one of the ICH ports.
 
 If the first  downstream port in the PMP is empty and it gets reset in
 non-PMP way, it identifies itself as Config Disk of quite small size.
  It's probably used to configure the extra features using standard ATA
 RW commands.  Anyways, this Config Disk is a bit peculiar and doesn't
 work very well with the current ATA reset sequence and gets identified
 only after a few failures thus causing long timeout.
 
 I keep forgetting about this.  I'll ask SIMG how to deal with this.  For
 the time being, connecting a device to the PMP port should remove the
 timeouts.
 
 The second problem is a Jmicron363 controler that is failing to detect
 the DVD-RW that is connected, unless I use the irqpoll option as Tejun has
 suggested.
 .. and this one has never worked without irqpoll?

 But, as you suggest it, I'm adding pci=nomsi to the command line
 rebooting... no change for this part of the problem.

 OK, the /proc/interrupt for this config, and the dmesg attached.

 3 [23:22] [EMAIL PROTECTED]:~ cat /proc/interrupts 
CPU0   CPU1   
   0: 297549  0   IO-APIC-edge  timer
   1:  7  0   IO-APIC-edge  i8042
   4: 13  0   IO-APIC-edge  serial
   6:  5  0   IO-APIC-edge  floppy
   8:  1  0   IO-APIC-edge  rtc
   9:  0  0   IO-APIC-fasteoi   acpi
  12:126  0   IO-APIC-edge  i8042
  14:   8313  0   IO-APIC-edge  libata
  15:  0  0   IO-APIC-edge  libata
  16:  0  0   IO-APIC-fasteoi   eth1, libata
 So it's the irq16 one that is the Jmicron controller and just isn't 
 getting any interrupts?

 Since all the other interrupts work (and MSI worked for other 
 controllers), I don't think it's interrupt-routing related. Especially as 
 MSI shouldn't even care about things like that.

 And since it all works when irqpoll is used, that implies that the 
 *only* thing that is broken is literally irq delivery.

 Is there possibly some jmicron-specific enable interrupts bit? 
 
 (cc'ing Justin of JMicron.  Hello, please correct me if I'm wrong.)
 
 Not that I know of.  The PATA portion of JMB controllers is bog standard
 PCI BMDMA ATA device where ATA_NIEN is the way to turn IRQ on and off.
 
 Thanks.
 


-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-03-09 Thread Tejun Heo
Paul Rolland wrote:
 Hell Tejun,
 
 I've boot-tested this yesterday, with no real luck... 
 
 1 - Tested on top of 2.6.21-rc2 (hope it's fine for you),
 2 - Collected a full dmesg before and after
 
 Extract is :
 ata7: PATA max UDMA/100 cmd 0x00019c00 ctl 0x00019882 bmdma
 0x00
 019400 irq 16
 ata8: PATA max UDMA/100 cmd 0x00019800 ctl 0x00019482 bmdma
 0x00
 019408 irq 16
 scsi6 : pata_jmicron
 ata7.00: ATAPI, max UDMA/66
 ata7.00: configured for UDMA/66
 scsi7 : pata_jmicron
 ATA: abnormal status 0x7F on port 0x00019807
 ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
 ata7.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
  res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)

It seems like IRQ is not getting through.  The first IRQ driven command
is failing for you.

* Does giving 'acpi=off' or 'irqpoll' make any difference?

* Can you connect a harddisk to the channel and see whether that works?

Thanks.

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[git patches] libata fixes

2007-03-06 Thread Jeff Garzik

There were some bumps, but I'm surprised at the lack of ACPI problem
reports.  It did live in -mm for many months, but nonetheless...  we'll
see how 2.6.21 release goes.

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/ahci.c  |1 +
 drivers/ata/pata_legacy.c   |2 +-
 drivers/ata/pata_pdc202xx_old.c |   22 ++
 3 files changed, 16 insertions(+), 9 deletions(-)

Bartlomiej Zolnierkiewicz (1):
  pata_pdc202xx_old: fix data corruption and other problems

Jason Gaston (1):
  ahci: RAID mode SATA patch for Intel ICH9M

Mikael Pettersson (1):
  pata_legacy: fix io/irq mismatch

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 43cc43d..dc7b562 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -389,6 +389,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x2929), board_ahci_pi }, /* ICH9M */
{ PCI_VDEVICE(INTEL, 0x292a), board_ahci_pi }, /* ICH9M */
{ PCI_VDEVICE(INTEL, 0x292b), board_ahci_pi }, /* ICH9M */
+   { PCI_VDEVICE(INTEL, 0x292c), board_ahci_pi }, /* ICH9M */
{ PCI_VDEVICE(INTEL, 0x292f), board_ahci_pi }, /* ICH9M */
{ PCI_VDEVICE(INTEL, 0x294d), board_ahci_pi }, /* ICH9 */
{ PCI_VDEVICE(INTEL, 0x294e), board_ahci_pi }, /* ICH9M */
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index fc5b73d..86fbcd6 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -69,7 +69,7 @@
 #define NR_HOST 6
 
 static int legacy_port[NR_HOST] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 };
-static int legacy_irq[NR_HOST] = { 15, 14, 11, 10, 8, 12 };
+static int legacy_irq[NR_HOST] = { 14, 15, 11, 10, 8, 12 };
 
 struct legacy_data {
unsigned long timing;
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index 3fb4177..acdc52c 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -2,13 +2,14 @@
  * pata_pdc202xx_old.c - Promise PDC202xx PATA for new ATA layer
  *   (C) 2005 Red Hat Inc
  *   Alan Cox [EMAIL PROTECTED]
+ *   (C) 2007 Bartlomiej Zolnierkiewicz
  *
  * Based in part on linux/drivers/ide/pci/pdc202xx_old.c
  *
  * First cut with LBA48/ATAPI
  *
  * TODO:
- * Channel interlock/reset on both required ?
+ * Channel interlock/reset on both required
  */
 
 #include linux/kernel.h
@@ -21,7 +22,7 @@
 #include linux/libata.h
 
 #define DRV_NAME pata_pdc202xx_old
-#define DRV_VERSION 0.3.0
+#define DRV_VERSION 0.4.0
 
 /**
  * pdc2024x_pre_reset  -   probe begin
@@ -76,7 +77,7 @@ static void pdc2026x_error_handler(struct ata_port *ap)
 static void pdc202xx_configure_piomode(struct ata_port *ap, struct ata_device 
*adev, int pio)
 {
struct pci_dev *pdev = to_pci_dev(ap-host-dev);
-   int port = 0x60 + 4 * ap-port_no + 2 * adev-devno;
+   int port = 0x60 + 8 * ap-port_no + 4 * adev-devno;
static u16 pio_timing[5] = {
0x0913, 0x050C , 0x0308, 0x0206, 0x0104
};
@@ -85,7 +86,7 @@ static void pdc202xx_configure_piomode(struct ata_port *ap, 
struct ata_device *a
pci_read_config_byte(pdev, port, r_ap);
pci_read_config_byte(pdev, port + 1, r_bp);
r_ap = ~0x3F;  /* Preserve ERRDY_EN, SYNC_IN */
-   r_bp = ~0x07;
+   r_bp = ~0x1F;
r_ap |= (pio_timing[pio]  8);
r_bp |= (pio_timing[pio]  0xFF);
 
@@ -123,7 +124,7 @@ static void pdc202xx_set_piomode(struct ata_port *ap, 
struct ata_device *adev)
 static void pdc202xx_set_dmamode(struct ata_port *ap, struct ata_device *adev)
 {
struct pci_dev *pdev = to_pci_dev(ap-host-dev);
-   int port = 0x60 + 4 * ap-port_no + 2 * adev-devno;
+   int port = 0x60 + 8 * ap-port_no + 4 * adev-devno;
static u8 udma_timing[6][2] = {
{ 0x60, 0x03 }, /* 33 Mhz Clock */
{ 0x40, 0x02 },
@@ -132,12 +133,17 @@ static void pdc202xx_set_dmamode(struct ata_port *ap, 
struct ata_device *adev)
{ 0x20, 0x01 },
{ 0x20, 0x01 }
};
+   static u8 mdma_timing[3][2] = {
+   { 0x60, 0x03 },
+   { 0x60, 0x04 },
+   { 0xe0, 0x0f },
+   };
u8 r_bp, r_cp;
 
pci_read_config_byte(pdev, port + 1, r_bp);
pci_read_config_byte(pdev, port + 2, r_cp);
 
-   r_bp = ~0xF0;
+   r_bp = ~0xE0;
r_cp = ~0x0F;
 
if (adev-dma_mode = XFER_UDMA_0) {
@@ -147,8 +153,8 @@ static void pdc202xx_set_dmamode(struct ata_port *ap, 
struct ata_device *adev)
 
} else {
int speed = adev-dma_mode - XFER_MW_DMA_0;
-   r_bp |= 0x60;
-   r_cp |= (5 - speed);
+   r_bp |= mdma_timing[speed][0];
+   r_cp |= mdma_timing[speed][1];
   

RE: [git patches] libata fixes

2007-03-05 Thread Paul Rolland
Hello,

 1. Has it ever worked with the previous kernels?

I can't tell, this machine is new, and it never booted something that
was not a 2.6.20 or 2.6.21.
 
 2. If you connect a harddisk to pata_jmicron, does it work?

 3. Does applying the attached patch fix your problem?

Will do these two tonite when back home. 

Thanks,
Paul

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


RE: [git patches] libata fixes

2007-03-05 Thread Paul Rolland
Hello,

 Your drive has some issues with NCQ and is scheduled to be blacklisted
 such that it isn't enabled.  libata used to ignore the 
 condition but now
 considers it NCQ protocol violation and fails all pending commands.

OK, do you need an hdparm report to fully identify the disk ?
 
 libata EH should turn NCQ off automatically after a few of the above
 errors.  I'd love to see how that actually works in the field (full
 dmesg please).  If it doesn't, it needs fixing.

I'll get you one tonite, I don't have access to the machine right now.

Regards,
Paul

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


Re: [git patches] libata fixes

2007-03-05 Thread Tejun Heo
Paul Rolland wrote:
 Hello,
 
 Your drive has some issues with NCQ and is scheduled to be blacklisted
 such that it isn't enabled.  libata used to ignore the 
 condition but now
 considers it NCQ protocol violation and fails all pending commands.
 
 OK, do you need an hdparm report to fully identify the disk ?

Nope, we already know.

 libata EH should turn NCQ off automatically after a few of the above
 errors.  I'd love to see how that actually works in the field (full
 dmesg please).  If it doesn't, it needs fixing.
 
 I'll get you one tonite, I don't have access to the machine right now.

Great. Thanks.

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [git patches] libata fixes

2007-03-05 Thread Paul Rolland
Hell Tejun,

I've boot-tested this yesterday, with no real luck... 

1 - Tested on top of 2.6.21-rc2 (hope it's fine for you),
2 - Collected a full dmesg before and after

Extract is :
ata7: PATA max UDMA/100 cmd 0x00019c00 ctl 0x00019882 bmdma
0x00
019400 irq 16
ata8: PATA max UDMA/100 cmd 0x00019800 ctl 0x00019482 bmdma
0x00
019408 irq 16
scsi6 : pata_jmicron
ata7.00: ATAPI, max UDMA/66
ata7.00: configured for UDMA/66
scsi7 : pata_jmicron
ATA: abnormal status 0x7F on port 0x00019807
ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata7.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
 res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata7: soft resetting port
ata7.00: configured for UDMA/66
ata7: EH complete
ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata7.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
 res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata7: soft resetting port
ata7.00: configured for UDMA/66
ata7: EH complete
ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata7.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
 res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata7: soft resetting port
ata7.00: configured for UDMA/66
ata7: EH complete
ata7.00: limiting speed to UDMA/44:PIO4
ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata7.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
 res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata7: soft resetting port
ata7.00: configured for UDMA/44
ata7: EH complete

Hope this helps...

Regards,
Paul

Paul Rolland, rol(at)as2917.net
ex-AS2917 Network administrator and Peering Coordinator

--

Please no HTML, I'm not a browser - Pas d'HTML, je ne suis pas un navigateur 
Some people dream of success... while others wake up and work hard at it 

I worry about my child and the Internet all the time, even though she's too 
young to have logged on yet. Here's what I worry about. I worry that 10 or 15 
years from now, she will come to me and say 'Daddy, where were you when they 
took freedom of the press away from the Internet?'
--Mike Godwin, Electronic Frontier Foundation 
  

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Tejun Heo
 Sent: Monday, March 05, 2007 4:45 PM
 To: [EMAIL PROTECTED]
 Cc: 'Jeff Garzik'; 'Andrew Morton'; 'Linus Torvalds'; 
 linux-ide@vger.kernel.org; 'LKML'; 'Eric D. Mudama'
 Subject: Re: [git patches] libata fixes
 
 Paul Rolland wrote:
  Hello,
  
  Your drive has some issues with NCQ and is scheduled to be 
 blacklisted
  such that it isn't enabled.  libata used to ignore the 
  condition but now
  considers it NCQ protocol violation and fails all pending commands.
  
  OK, do you need an hdparm report to fully identify the disk ?
 
 Nope, we already know.
 
  libata EH should turn NCQ off automatically after a few of 
 the above
  errors.  I'd love to see how that actually works in the field (full
  dmesg please).  If it doesn't, it needs fixing.
  
  I'll get you one tonite, I don't have access to the machine 
 right now.
 
 Great. Thanks.
 
 -- 
 tejun
 -
 To unsubscribe from this list: send the line unsubscribe 
 linux-ide in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 


dmesg-2.6.21-rc2.before.bz2
Description: Binary data


dmesg-2.6.21-rc2.after.bz2
Description: Binary data


Re: [git patches] libata fixes

2007-03-04 Thread Tejun Heo
[cc'ing Eric D. Mudama. Hi!]

Paul Rolland wrote:
 ata1.00: exception Emask 0x2 SAct 0xffe0 SErr 0x0 action 0x2 frozen
 ata1.00: (spurious completions during NCQ issue=0x0 SAct=0xffe0
 FIS=004040a1:0010)
 ata1.00: cmd 60/02:28:52:ec:c4/00:00:0e:00:00/40 tag 5 cdb 0x0 data 1024 in
  res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
 ata1.00: cmd 60/02:30:54:ec:c4/00:00:0e:00:00/40 tag 6 cdb 0x0 data 1024 in
  res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
 ata1.00: cmd 60/02:38:56:ec:c4/00:00:0e:00:00/40 tag 7 cdb 0x0 data 1024 in
  res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
 ata1.00: cmd 60/02:40:58:ec:c4/00:00:0e:00:00/40 tag 8 cdb 0x0 data 1024 in
  res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
 ata1.00: cmd 60/02:48:5a:ec:c4/00:00:0e:00:00/40 tag 9 cdb 0x0 data 1024 in
  res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
 ata1.00: cmd 60/02:50:5c:ec:c4/00:00:0e:00:00/40 tag 10 cdb 0x0 data 1024 in
  res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
 ata1.00: cmd 60/02:58:5e:ec:c4/00:00:0e:00:00/40 tag 11 cdb 0x0 data 1024 in
  res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
 ata1.00: cmd 60/02:60:60:ec:c4/00:00:0e:00:00/40 tag 12 cdb 0x0 data 1024 in
  res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
 ata1.00: cmd 60/02:68:62:ec:c4/00:00:0e:00:00/40 tag 13 cdb 0x0 data 1024 in
  res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
 ata1.00: cmd 60/02:70:64:ec:c4/00:00:0e:00:00/40 tag 14 cdb 0x0 data 1024 in
  res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
 ata1.00: cmd 60/02:78:66:ec:c4/00:00:0e:00:00/40 tag 15 cdb 0x0 data 1024 in
  res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
 ata1: soft resetting port
 ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
 ata1.00: configured for UDMA/133
 ata1: EH complete
 SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB)
 sda: Write Protect is off
 sda: Mode Sense: 00 3a 00 00
 SCSI device sda: write cache: enabled, read cache: enabled, doesn't support
 DPO or FUA

 This last part was not present when booting stock 2.6.21-rc1

Your drive has some issues with NCQ and is scheduled to be blacklisted
such that it isn't enabled.  libata used to ignore the condition but now
considers it NCQ protocol violation and fails all pending commands.

libata EH should turn NCQ off automatically after a few of the above
errors.  I'd love to see how that actually works in the field (full
dmesg please).  If it doesn't, it needs fixing.

Thanks.

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [git patches] libata fixes

2007-03-04 Thread Tejun Heo
Hello,

Paul Rolland wrote:
 Hello,
 
 Applied this on top of 2.6.21-rc1 and your previous patch (see my previous
 mail). 
 Still booting, no more the weird error I've reported minutes ago.
 
 pata_jmicron still unable to detect my DVD-RW :
 scsi8 : pata_jmicron
 ata9.00: ATAPI, max UDMA/66
 ata9.00: qc timeout (cmd 0xef)
 ata9.00: failed to set xfermode (err_mask=0x4)
 ata9.00: limiting speed to UDMA/44
 ata9: failed to recover some devices, retrying in 5 secs
 ata9.00: qc timeout (cmd 0xef)
 ata9.00: failed to set xfermode (err_mask=0x4)
 ata9.00: limiting speed to PIO0
 ata9: failed to recover some devices, retrying in 5 secs
 ata9.00: qc timeout (cmd 0xef)
 ata9.00: failed to set xfermode (err_mask=0x4)
 ata9.00: disabled
 scsi9 : pata_jmicron
 ATA: abnormal status 0x7F on port 0x00019807

1. Has it ever worked with the previous kernels?

2. If you connect a harddisk to pata_jmicron, does it work?

3. Does applying the attached patch fix your problem?

-- 
tejun
diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c
index 43763c9..8a95a56 100644
--- a/drivers/ata/pata_jmicron.c
+++ b/drivers/ata/pata_jmicron.c
@@ -196,7 +196,8 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i
 {
 	static struct ata_port_info info = {
 		.sht		= jmicron_sht,
-		.flags	= ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
+		.flags	= ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST |
+			  ATA_FLAG_SETXFER_POLLING,
 
 		.pio_mask	= 0x1f,
 		.mwdma_mask	= 0x07,


RE: [git patches] libata fixes

2007-03-03 Thread Paul Rolland
:0e:00:00/40 Emask 0x2 (HSM violation)
ata1.00: cmd 60/02:68:62:ec:c4/00:00:0e:00:00/40 tag 13 cdb 0x0 data 1024 in
 res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
ata1.00: cmd 60/02:70:64:ec:c4/00:00:0e:00:00/40 tag 14 cdb 0x0 data 1024 in
 res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
ata1.00: cmd 60/02:78:66:ec:c4/00:00:0e:00:00/40 tag 15 cdb 0x0 data 1024 in
 res 40/00:78:66:ec:c4/00:00:0e:00:00/40 Emask 0x2 (HSM violation)
ata1: soft resetting port
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata1.00: configured for UDMA/133
ata1: EH complete
SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: write cache: enabled, read cache: enabled, doesn't support
DPO or FUA

This last part was not present when booting stock 2.6.21-rc1

Any other info you may need, please ask.

Regards,
Paul


Paul Rolland, rol(at)as2917.net
ex-AS2917 Network administrator and Peering Coordinator

--

Please no HTML, I'm not a browser - Pas d'HTML, je ne suis pas un navigateur 
Some people dream of success... while others wake up and work hard at it 

I worry about my child and the Internet all the time, even though she's too 
young to have logged on yet. Here's what I worry about. I worry that 10 or 15 
years from now, she will come to me and say 'Daddy, where were you when they 
took freedom of the press away from the Internet?'
--Mike Godwin, Electronic Frontier Foundation 
  

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Garzik
 Sent: Friday, March 02, 2007 3:09 AM
 To: Andrew Morton; Linus Torvalds
 Cc: linux-ide@vger.kernel.org; LKML
 Subject: [git patches] libata fixes
 
 
 Does not include Alan's stuff, per recent email thread.
 
 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/ahci.c  |   55 ++--
  drivers/ata/libata-core.c   |5 ++-
  drivers/ata/pata_cs5520.c   |1 -
  drivers/ata/pata_isapnp.c   |1 -
  drivers/ata/pata_jmicron.c  |   51 ++
  drivers/ata/pata_platform.c |1 -
  drivers/ata/sata_sil24.c|3 --
  drivers/pci/quirks.c|   83 
 +++---
  8 files changed, 95 insertions(+), 105 deletions(-)
 
 Tejun Heo (7):
   libata: clear drvdata in ata_host_release(), take#2
   sata_sil24: kill unused local variable idx in sil24_fill_sg()
   libata: blacklist FUJITSU MHT2060BH for NCQ
   pata_jmicron: drop unnecessary device programming in [re]init
   jmicron ATA: reimplement jmicron ATA quirk
   ahci/pata_jmicron: match class not function number
   ahci: improve spurious SDB FIS handling
 
 diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
 index 6d93240..1539734 100644
 --- a/drivers/ata/ahci.c
 +++ b/drivers/ata/ahci.c
 @@ -200,6 +200,7 @@ struct ahci_port_priv {
   /* for NCQ spurious interrupt analysis */
   unsigned intncq_saw_d2h:1;
   unsigned intncq_saw_dmas:1;
 + unsigned intncq_saw_sdb:1;
  };
  
  static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg);
 @@ -384,12 +385,9 @@ static const struct pci_device_id 
 ahci_pci_tbl[] = {
   { PCI_VDEVICE(INTEL, 0x294d), board_ahci_pi }, /* ICH9 */
   { PCI_VDEVICE(INTEL, 0x294e), board_ahci_pi }, /* ICH9M */
  
 - /* JMicron */
 - { PCI_VDEVICE(JMICRON, 0x2360), board_ahci_ign_iferr }, 
 /* JMB360 */
 - { PCI_VDEVICE(JMICRON, 0x2361), board_ahci_ign_iferr }, 
 /* JMB361 */
 - { PCI_VDEVICE(JMICRON, 0x2363), board_ahci_ign_iferr }, 
 /* JMB363 */
 - { PCI_VDEVICE(JMICRON, 0x2365), board_ahci_ign_iferr }, 
 /* JMB365 */
 - { PCI_VDEVICE(JMICRON, 0x2366), board_ahci_ign_iferr }, 
 /* JMB366 */
 + /* JMicron 360/1/3/5/6, match class to avoid IDE function */
 + { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
 +   PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci_ign_iferr },
  
   /* ATI */
   { PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 
 non-raid */
 @@ -1160,23 +1158,31 @@ static void ahci_host_intr(struct 
 ata_port *ap)
   }
  
   if (status  PORT_IRQ_SDB_FIS) {
 - /* SDB FIS containing spurious completions might be
 -  * dangerous, whine and fail commands with HSM
 -  * violation.  EH will turn off NCQ after several such
 -  * failures.
 -  */
   const __le32 *f = pp-rx_fis + RX_FIS_SDB;
  
 - ata_ehi_push_desc(ehi, spurious completion during NCQ 
 -   issue=0x%x SAct=0x%x FIS=%08x:%08x,
 -   readl(port_mmio + PORT_CMD_ISSUE),
 -   readl(port_mmio + PORT_SCR_ACT

[git patches] libata fixes

2007-03-02 Thread Jeff Garzik

Notes:
1) The patches credited to me are really extractions of Alan's patches.

2) In particular, the 'change master/slave IDENTIFY order' has a wide
(but hopefully not negative) impact, as mentioned in the thread.  Since
pata_* drivers are Officially(tm) considered more experimental than
drivers/ide, and since most SATA devices are one-per-port (no slave),
the biggest consideration is really master/slave on ata_piix.

3) Tejun's CONFIG_PM stuff might look like a cleanup, but IMO it is
indeed a bug fix.  As Nigel C noted in the related thread, this can
probably be cleaned up further with some hopeful macros, but let's go
ahead and get things compiling correctly.

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/ahci.c  |   14 ++
 drivers/ata/ata_generic.c   |4 
 drivers/ata/ata_piix.c  |4 
 drivers/ata/libata-core.c   |   32 +++-
 drivers/ata/libata-eh.c |   29 +
 drivers/ata/libata-scsi.c   |2 ++
 drivers/ata/pata_ali.c  |6 ++
 drivers/ata/pata_amd.c  |6 ++
 drivers/ata/pata_atiixp.c   |4 
 drivers/ata/pata_cmd64x.c   |8 +++-
 drivers/ata/pata_cs5520.c   |6 ++
 drivers/ata/pata_cs5530.c   |6 ++
 drivers/ata/pata_cs5535.c   |4 
 drivers/ata/pata_cypress.c  |4 
 drivers/ata/pata_efar.c |4 
 drivers/ata/pata_hpt366.c   |7 ++-
 drivers/ata/pata_hpt3x3.c   |6 ++
 drivers/ata/pata_it8213.c   |4 
 drivers/ata/pata_it821x.c   |6 ++
 drivers/ata/pata_jmicron.c  |7 +++
 drivers/ata/pata_legacy.c   |   18 ++
 drivers/ata/pata_marvell.c  |4 
 drivers/ata/pata_mpc52xx.c  |4 
 drivers/ata/pata_mpiix.c|4 
 drivers/ata/pata_netcell.c  |4 
 drivers/ata/pata_ns87410.c  |4 
 drivers/ata/pata_oldpiix.c  |4 
 drivers/ata/pata_opti.c |4 
 drivers/ata/pata_optidma.c  |4 
 drivers/ata/pata_pdc202xx_old.c |4 
 drivers/ata/pata_qdi.c  |   12 
 drivers/ata/pata_radisys.c  |4 
 drivers/ata/pata_rz1000.c   |6 ++
 drivers/ata/pata_sc1200.c   |7 +++
 drivers/ata/pata_scc.c  |2 ++
 drivers/ata/pata_serverworks.c  |6 ++
 drivers/ata/pata_sil680.c   |8 
 drivers/ata/pata_sis.c  |4 
 drivers/ata/pata_sl82c105.c |3 +++
 drivers/ata/pata_triflex.c  |4 
 drivers/ata/pata_via.c  |6 ++
 drivers/ata/sata_inic162x.c |7 ++-
 drivers/ata/sata_nv.c   |   16 
 drivers/ata/sata_sil.c  |2 ++
 drivers/ata/sata_sil24.c|2 ++
 include/linux/libata.h  |7 +--
 46 files changed, 299 insertions(+), 14 deletions(-)

Alan Cox (2):
  libata-core: Fix simplex handling
  pata_qdi: Fix initialisation

Jeff Garzik (3):
  [libata] change master/slave IDENTIFY order
  [libata] pata_{legacy,sc1200,sl82c105}: add missing hooks
  [libata] pata_cmd64x: fix driver description in comments

Tejun Heo (3):
  libata: add missing PM callbacks
  libata: add missing CONFIG_PM in LLDs
  libata: add CONFIG_PM to libata core layer

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 1539734..43cc43d 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -219,10 +219,12 @@ static void ahci_thaw(struct ata_port *ap);
 static void ahci_error_handler(struct ata_port *ap);
 static void ahci_vt8251_error_handler(struct ata_port *ap);
 static void ahci_post_internal_cmd(struct ata_queued_cmd *qc);
+#ifdef CONFIG_PM
 static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg);
 static int ahci_port_resume(struct ata_port *ap);
 static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
 static int ahci_pci_device_resume(struct pci_dev *pdev);
+#endif
 
 static struct scsi_host_template ahci_sht = {
.module = THIS_MODULE,
@@ -241,8 +243,10 @@ static struct scsi_host_template ahci_sht = {
.slave_configure= ata_scsi_slave_config,
.slave_destroy  = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
+#ifdef CONFIG_PM
.suspend= ata_scsi_device_suspend,
.resume = ata_scsi_device_resume,
+#endif
 };
 
 static const struct ata_port_operations ahci_ops = {
@@ -271,8 +275,10 @@ static const struct ata_port_operations ahci_ops = {
.error_handler  = ahci_error_handler,
.post_internal_cmd  = ahci_post_internal_cmd,
 
+#ifdef CONFIG_PM
.port_suspend   = ahci_port_suspend,

Re: [git patches] libata fixes

2007-02-06 Thread Conke Hu
On Fri, 2007-02-02 at 11:58 -0500, Jeff Garzik wrote:
 Brian and Tejun's patches fix really ugly bugs, Alan's are of less
 importance
 
 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/libata-core.c  |1 +
  drivers/ata/pata_atiixp.c  |   11 +--
  drivers/ata/pata_jmicron.c |   18 +-
  drivers/ata/pata_via.c |3 ++-
  drivers/pci/quirks.c   |4 ++--
  include/linux/libata.h |2 ++
  6 files changed, 21 insertions(+), 18 deletions(-)
 
 Alan (3):
   pata_atiixp: propogate cable detection hack from drivers/ide to the new 
 driver
   pata_via: Correct missing comments
   libata: Fix ata_busy_wait() kernel docs
 
 Brian King (1):
   libata: Initialize nbytes for internal sg commands
 
 Tejun Heo (1):
   ahci/pata_jmicron: fix JMicron quirk
 
 diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
 index cf70702..667acd2 100644
 --- a/drivers/ata/libata-core.c
 +++ b/drivers/ata/libata-core.c
 @@ -1250,6 +1250,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
  
   ata_sg_init(qc, sg, n_elem);
   qc-nsect = buflen / ATA_SECT_SIZE;
 + qc-nbytes = buflen;
   }
  
   qc-private_data = wait;
 diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
 index 6f6672c..504e1db 100644
 --- a/drivers/ata/pata_atiixp.c
 +++ b/drivers/ata/pata_atiixp.c
 @@ -36,15 +36,22 @@ enum {
  static int atiixp_pre_reset(struct ata_port *ap)
  {
   struct pci_dev *pdev = to_pci_dev(ap-host-dev);
 - static struct pci_bits atiixp_enable_bits[] = {
 + static const struct pci_bits atiixp_enable_bits[] = {
   { 0x48, 1, 0x01, 0x00 },
   { 0x48, 1, 0x08, 0x00 }
   };
 + u8 udma;
  
   if (!pci_test_config_bits(pdev, atiixp_enable_bits[ap-port_no]))
   return -ENOENT;
  
 - ap-cbl = ATA_CBL_PATA80;
 + /* Hack from drivers/ide/pci. Really we want to know how to do the
 +raw detection not play follow the bios mode guess */
 + pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap-port_no, udma);
 + if ((udma  0x07) = 0x04 || (udma  0x70) = 0x40)
 + ap-cbl = ATA_CBL_PATA80;
 + else
 + ap-cbl = ATA_CBL_PATA40;
   return ata_std_prereset(ap);
  }
 (snip)
  

Alan's patch is also important. Thank you :)

Without the patch, OS on 40-pin cable maybe get IDE DMA error (CRC
error, system hang, or even data crash).

Conke


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


[git patches] libata fixes

2007-02-02 Thread Jeff Garzik

Brian and Tejun's patches fix really ugly bugs, Alan's are of less
importance

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/libata-core.c  |1 +
 drivers/ata/pata_atiixp.c  |   11 +--
 drivers/ata/pata_jmicron.c |   18 +-
 drivers/ata/pata_via.c |3 ++-
 drivers/pci/quirks.c   |4 ++--
 include/linux/libata.h |2 ++
 6 files changed, 21 insertions(+), 18 deletions(-)

Alan (3):
  pata_atiixp: propogate cable detection hack from drivers/ide to the new 
driver
  pata_via: Correct missing comments
  libata: Fix ata_busy_wait() kernel docs

Brian King (1):
  libata: Initialize nbytes for internal sg commands

Tejun Heo (1):
  ahci/pata_jmicron: fix JMicron quirk

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index cf70702..667acd2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1250,6 +1250,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
 
ata_sg_init(qc, sg, n_elem);
qc-nsect = buflen / ATA_SECT_SIZE;
+   qc-nbytes = buflen;
}
 
qc-private_data = wait;
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index 6f6672c..504e1db 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -36,15 +36,22 @@ enum {
 static int atiixp_pre_reset(struct ata_port *ap)
 {
struct pci_dev *pdev = to_pci_dev(ap-host-dev);
-   static struct pci_bits atiixp_enable_bits[] = {
+   static const struct pci_bits atiixp_enable_bits[] = {
{ 0x48, 1, 0x01, 0x00 },
{ 0x48, 1, 0x08, 0x00 }
};
+   u8 udma;
 
if (!pci_test_config_bits(pdev, atiixp_enable_bits[ap-port_no]))
return -ENOENT;
 
-   ap-cbl = ATA_CBL_PATA80;
+   /* Hack from drivers/ide/pci. Really we want to know how to do the
+  raw detection not play follow the bios mode guess */
+   pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap-port_no, udma);
+   if ((udma  0x07) = 0x04 || (udma  0x70) = 0x40)
+   ap-cbl = ATA_CBL_PATA80;
+   else
+   ap-cbl = ATA_CBL_PATA40;
return ata_std_prereset(ap);
 }
 
diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c
index 2d661cb..d50264a 100644
--- a/drivers/ata/pata_jmicron.c
+++ b/drivers/ata/pata_jmicron.c
@@ -204,20 +204,12 @@ static int jmicron_init_one (struct pci_dev *pdev, const 
struct pci_device_id *i
 
u32 reg;
 
-   if (id-driver_data != 368) {
-   /* Put the controller into AHCI mode in case the AHCI driver
-  has not yet been loaded. This can be done with either
-  function present */
+   /* PATA controller is fn 1, AHCI is fn 0 */
+   if (id-driver_data != 368  PCI_FUNC(pdev-devfn) != 1)
+   return -ENODEV;
 
-   /* FIXME: We may want a way to override this in future */
-   pci_write_config_byte(pdev, 0x41, 0xa1);
-
-   /* PATA controller is fn 1, AHCI is fn 0 */
-   if (PCI_FUNC(pdev-devfn) != 1)
-   return -ENODEV;
-   }
-   if ( id-driver_data == 365 || id-driver_data == 366) {
-   /* The 365/66 have two PATA channels, redirect the second */
+   /* The 365/66 have two PATA channels, redirect the second */
+   if (id-driver_data == 365 || id-driver_data == 366) {
pci_read_config_dword(pdev, 0x80, reg);
reg |= (1  24);   /* IDE1 to PATA IDE secondary */
pci_write_config_dword(pdev, 0x80, reg);
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index 0219419..f0b6c3b 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -23,6 +23,7 @@
  * VIA VT8233c -   UDMA100
  * VIA VT8235  -   UDMA133
  * VIA VT8237  -   UDMA133
+ * VIA VT8237S -   UDMA133
  * VIA VT8251  -   UDMA133
  *
  * Most registers remain compatible across chips. Others start reserved
@@ -61,7 +62,7 @@
 #include linux/libata.h
 
 #define DRV_NAME pata_via
-#define DRV_VERSION 0.2.0
+#define DRV_VERSION 0.2.1
 
 /*
  * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index dcc0c1a..c913ea4 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1262,8 +1262,8 @@ static void quirk_jmicron_dualfn(struct pci_dev *pdev)
pci_read_config_dword(pdev, 0x40, conf);
/* Enable dual function mode, AHCI on fn 0, IDE fn1 */
/* Set the class codes correctly and then direct IDE 0 
*/
-   conf = ~0x000F0200;/* Clear bit 9 and 16-19 */
-   conf |=  0x00C20002;/* Set 

Re: [git patches] libata fixes

2007-02-02 Thread Jeff Garzik

Linus Torvalds wrote:


On Fri, 2 Feb 2007, Jeff Garzik wrote:

  pata_atiixp: propogate cable detection hack from drivers/ide to the new 
driver


It's prop*a*gate. 

Damn. 


Linus some speling mistaeks drive me wild Torvalds



Those UK types don't know how to spell tons of words, that's just one 
more for the list.


/me runs...

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


  1   2   >