[git patches] libata fixes

2013-04-08 Thread Jeff Garzik

The HDIO_DRIVE_* fix is really the biggie.

Please pull 6d3bfc7be6f80d0c6ee6800d58d573343bf6e260 from
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
tags/upstream-linus


to receive the following updates:

 drivers/ata/ata_piix.c| 14 +-
 drivers/ata/libata-core.c |  6 +-
 drivers/ata/libata-scsi.c |  8 
 include/linux/ata.h   |  2 +-
 include/linux/libata.h|  1 +
 5 files changed, 24 insertions(+), 7 deletions(-)

David Woodhouse (1):
  libata: fix DMA to stack in reading devslp_timing parameters

Krzysztof Mazur (1):
  [libata] Fix HDIO_DRIVE_* ioctl() Linux 3.9 regression

Shan Hai (2):
  libata: Use integer return value for atapi_command_packet_set
  libata: Set max sector to 65535 for Slimtype DVD A DS8A8SH drive

Youquan Song (1):
  ata_piix: Fix DVD not dectected at some Haswell platforms

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index ffdd32d..2f48123 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -150,6 +150,7 @@ enum piix_controller_ids {
tolapai_sata,
piix_pata_vmw,  /* PIIX4 for VMware, spurious DMA_ERR */
ich8_sata_snb,
+   ich8_2port_sata_snb,
 };
 
 struct piix_map_db {
@@ -304,7 +305,7 @@ static const struct pci_device_id piix_pci_tbl[] = {
/* SATA Controller IDE (Lynx Point) */
{ 0x8086, 0x8c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
/* SATA Controller IDE (Lynx Point) */
-   { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
+   { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_snb },
/* SATA Controller IDE (Lynx Point) */
{ 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (Lynx Point-LP) */
@@ -439,6 +440,7 @@ static const struct piix_map_db *piix_map_db_table[] = {
[ich8m_apple_sata]  = _apple_map_db,
[tolapai_sata]  = _map_db,
[ich8_sata_snb] = _map_db,
+   [ich8_2port_sata_snb]   = _2port_map_db,
 };
 
 static struct pci_bits piix_enable_bits[] = {
@@ -1242,6 +1244,16 @@ static struct ata_port_info piix_port_info[] = {
.udma_mask  = ATA_UDMA6,
.port_ops   = _sata_ops,
},
+
+   [ich8_2port_sata_snb] =
+   {
+   .flags  = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR
+   | PIIX_FLAG_PIO16,
+   .pio_mask   = ATA_PIO4,
+   .mwdma_mask = ATA_MWDMA2,
+   .udma_mask  = ATA_UDMA6,
+   .port_ops   = _sata_ops,
+   },
 };
 
 #define AHCI_PCI_BAR 5
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 497adea..63c743b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2329,7 +2329,7 @@ int ata_dev_configure(struct ata_device *dev)
 * from SATA Settings page of Identify Device Data Log.
 */
if (ata_id_has_devslp(dev->id)) {
-   u8 sata_setting[ATA_SECT_SIZE];
+   u8 *sata_setting = ap->sector_buf;
int i, j;
 
dev->flags |= ATA_DFLAG_DEVSLP;
@@ -2439,6 +2439,9 @@ int ata_dev_configure(struct ata_device *dev)
dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128,
 dev->max_sectors);
 
+   if (dev->horkage & ATA_HORKAGE_MAX_SEC_LBA48)
+   dev->max_sectors = ATA_MAX_SECTORS_LBA48;
+
if (ap->ops->dev_config)
ap->ops->dev_config(dev);
 
@@ -4100,6 +4103,7 @@ static const struct ata_blacklist_entry 
ata_device_blacklist [] = {
/* Weird ATAPI devices */
{ "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 },
{ "QUANTUM DATDAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA },
+   { "Slimtype DVD A  DS8A8SH", NULL,  ATA_HORKAGE_MAX_SEC_LBA48 },
 
/* Devices we expect to fail diagnostics */
 
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 318b413..ff44787 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user 
*arg)
struct scsi_sense_hdr sshdr;
scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
 );
-   if (sshdr.sense_key == 0 &&
-   sshdr.asc == 0 && sshdr.ascq == 0)
+   if (sshdr.sense_key == RECOVERED_ERROR &&
+   sshdr.asc == 0 && sshdr.ascq == 0x1d)
cmd_result &= ~SAM_STAT_CHECK_CONDITION;
}
 
@@ -618,8 +618,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user 
*arg)
struct scsi_sense_hdr 

[git patches] libata fixes

2013-04-08 Thread Jeff Garzik

The HDIO_DRIVE_* fix is really the biggie.

Please pull 6d3bfc7be6f80d0c6ee6800d58d573343bf6e260 from
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
tags/upstream-linus


to receive the following updates:

 drivers/ata/ata_piix.c| 14 +-
 drivers/ata/libata-core.c |  6 +-
 drivers/ata/libata-scsi.c |  8 
 include/linux/ata.h   |  2 +-
 include/linux/libata.h|  1 +
 5 files changed, 24 insertions(+), 7 deletions(-)

David Woodhouse (1):
  libata: fix DMA to stack in reading devslp_timing parameters

Krzysztof Mazur (1):
  [libata] Fix HDIO_DRIVE_* ioctl() Linux 3.9 regression

Shan Hai (2):
  libata: Use integer return value for atapi_command_packet_set
  libata: Set max sector to 65535 for Slimtype DVD A DS8A8SH drive

Youquan Song (1):
  ata_piix: Fix DVD not dectected at some Haswell platforms

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index ffdd32d..2f48123 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -150,6 +150,7 @@ enum piix_controller_ids {
tolapai_sata,
piix_pata_vmw,  /* PIIX4 for VMware, spurious DMA_ERR */
ich8_sata_snb,
+   ich8_2port_sata_snb,
 };
 
 struct piix_map_db {
@@ -304,7 +305,7 @@ static const struct pci_device_id piix_pci_tbl[] = {
/* SATA Controller IDE (Lynx Point) */
{ 0x8086, 0x8c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
/* SATA Controller IDE (Lynx Point) */
-   { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
+   { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_snb },
/* SATA Controller IDE (Lynx Point) */
{ 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (Lynx Point-LP) */
@@ -439,6 +440,7 @@ static const struct piix_map_db *piix_map_db_table[] = {
[ich8m_apple_sata]  = ich8m_apple_map_db,
[tolapai_sata]  = tolapai_map_db,
[ich8_sata_snb] = ich8_map_db,
+   [ich8_2port_sata_snb]   = ich8_2port_map_db,
 };
 
 static struct pci_bits piix_enable_bits[] = {
@@ -1242,6 +1244,16 @@ static struct ata_port_info piix_port_info[] = {
.udma_mask  = ATA_UDMA6,
.port_ops   = piix_sata_ops,
},
+
+   [ich8_2port_sata_snb] =
+   {
+   .flags  = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR
+   | PIIX_FLAG_PIO16,
+   .pio_mask   = ATA_PIO4,
+   .mwdma_mask = ATA_MWDMA2,
+   .udma_mask  = ATA_UDMA6,
+   .port_ops   = piix_sata_ops,
+   },
 };
 
 #define AHCI_PCI_BAR 5
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 497adea..63c743b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2329,7 +2329,7 @@ int ata_dev_configure(struct ata_device *dev)
 * from SATA Settings page of Identify Device Data Log.
 */
if (ata_id_has_devslp(dev-id)) {
-   u8 sata_setting[ATA_SECT_SIZE];
+   u8 *sata_setting = ap-sector_buf;
int i, j;
 
dev-flags |= ATA_DFLAG_DEVSLP;
@@ -2439,6 +2439,9 @@ int ata_dev_configure(struct ata_device *dev)
dev-max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128,
 dev-max_sectors);
 
+   if (dev-horkage  ATA_HORKAGE_MAX_SEC_LBA48)
+   dev-max_sectors = ATA_MAX_SECTORS_LBA48;
+
if (ap-ops-dev_config)
ap-ops-dev_config(dev);
 
@@ -4100,6 +4103,7 @@ static const struct ata_blacklist_entry 
ata_device_blacklist [] = {
/* Weird ATAPI devices */
{ TORiSAN DVD-ROM DRD-N216, NULL, ATA_HORKAGE_MAX_SEC_128 },
{ QUANTUM DATDAT72-000, NULL, ATA_HORKAGE_ATAPI_MOD16_DMA },
+   { Slimtype DVD A  DS8A8SH, NULL,  ATA_HORKAGE_MAX_SEC_LBA48 },
 
/* Devices we expect to fail diagnostics */
 
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 318b413..ff44787 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user 
*arg)
struct scsi_sense_hdr sshdr;
scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
 sshdr);
-   if (sshdr.sense_key == 0 
-   sshdr.asc == 0  sshdr.ascq == 0)
+   if (sshdr.sense_key == RECOVERED_ERROR 
+   sshdr.asc == 0  sshdr.ascq == 0x1d)
cmd_result = ~SAM_STAT_CHECK_CONDITION;
}
 
@@ -618,8 +618,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user 
*arg)
struct 

Re: [git patches] libata fixes

2013-01-22 Thread Linus Torvalds
On Mon, Jan 21, 2013 at 11:48 AM, Jeff Garzik  wrote:
> Please pull 803739d25c2343da6d2f95eebdcbc08bf67097d4 from
> git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
> tags/upstream-linus

>From the tag message:

   " Thought: I wonder if sparse could have caught this, somehow."

You *can* make sparse catch things like that, but you need to
carefully annotate the bits for that to happen.

In particular, you need to make the variable that contains the
bitfield (in this case 'err_mask') and all the values you use for
testing be its own "__bitwise__" type, which is sparse-speak for "this
is not a plain integer, and you cannot do arithmetic on this, you can
only do bitwise things".

So you need to create the specific type with a typedef, something like this:

typedef unsigned int __bitwise__ err_mask_t;

and then that particular type will now no longer mix with any other
integer types. But that also means that in order to create the bit
definitions that you use to test that type, you have to do something
like this:

  #define AC_ERR_MEDIA ((__force err_mask_t) __AC_ERR_MEDIA)

where the "__force" part allows the cast of a normal integer to the
private type without any errors.

So it's fairly invasive (but usually only in the place where you
define the different bits), and we don't do it very much in the
kernel. The main case we do this for is "gfp_t", because we've had
*soo* many cases of people mixing up the order of arguments to the
memory allocation functions (so size or 'allocation order' has been
switched with the gfp_t argument), and by making it a __bitwise__
type, sparse will warn about it (and will warn about it if you test
the field using the wrong constants).

So see what we do about gfp_t in  and in .
It's not *hard*, but the explicit typing does tend to mean that it's
not worth it for most random small things. Whether it is worth it for
the libata mask fields or not, I'll leave up to you.

You can do a "git grep __bitwise__" to see other examples. The SCSI
target code use of sense_reason_t probably comes closest to the libata
case.

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


Re: [git patches] libata fixes

2013-01-22 Thread Linus Torvalds
On Mon, Jan 21, 2013 at 11:48 AM, Jeff Garzik j...@garzik.org wrote:
 Please pull 803739d25c2343da6d2f95eebdcbc08bf67097d4 from
 git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
 tags/upstream-linus

From the tag message:

Thought: I wonder if sparse could have caught this, somehow.

You *can* make sparse catch things like that, but you need to
carefully annotate the bits for that to happen.

In particular, you need to make the variable that contains the
bitfield (in this case 'err_mask') and all the values you use for
testing be its own __bitwise__ type, which is sparse-speak for this
is not a plain integer, and you cannot do arithmetic on this, you can
only do bitwise things.

So you need to create the specific type with a typedef, something like this:

typedef unsigned int __bitwise__ err_mask_t;

and then that particular type will now no longer mix with any other
integer types. But that also means that in order to create the bit
definitions that you use to test that type, you have to do something
like this:

  #define AC_ERR_MEDIA ((__force err_mask_t) __AC_ERR_MEDIA)

where the __force part allows the cast of a normal integer to the
private type without any errors.

So it's fairly invasive (but usually only in the place where you
define the different bits), and we don't do it very much in the
kernel. The main case we do this for is gfp_t, because we've had
*soo* many cases of people mixing up the order of arguments to the
memory allocation functions (so size or 'allocation order' has been
switched with the gfp_t argument), and by making it a __bitwise__
type, sparse will warn about it (and will warn about it if you test
the field using the wrong constants).

So see what we do about gfp_t in linux/types.h and in linux/gfp.h.
It's not *hard*, but the explicit typing does tend to mean that it's
not worth it for most random small things. Whether it is worth it for
the libata mask fields or not, I'll leave up to you.

You can do a git grep __bitwise__ to see other examples. The SCSI
target code use of sense_reason_t probably comes closest to the libata
case.

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


[git patches] libata fixes

2013-01-21 Thread Jeff Garzik

Please pull 803739d25c2343da6d2f95eebdcbc08bf67097d4 from
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
tags/upstream-linus

to receive the following updates:

 drivers/ata/ahci.c|  8 +++-
 drivers/ata/libahci.c |  6 +++---
 drivers/ata/libata-core.c | 22 +-
 drivers/ata/libata-eh.c   |  2 +-
 include/linux/ata.h   |  8 +---
 include/linux/libata.h|  4 ++--
 6 files changed, 31 insertions(+), 19 deletions(-)

Bian Yu (1):
  [libata] ahci: Fix lack of command retry after a success error handler.

Hugh Daschbach (1):
  [libata] ahci: Add support for Enmotus Bobcat device.

Shane Huang (1):
  [libata] replace sata_settings with devslp_timing

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 7862d17..4979127 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -53,6 +53,7 @@
 
 enum {
AHCI_PCI_BAR_STA2X11= 0,
+   AHCI_PCI_BAR_ENMOTUS= 2,
AHCI_PCI_BAR_STANDARD   = 5,
 };
 
@@ -410,6 +411,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci },   /* ASM1061 */
{ PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci },   /* ASM1062 */
 
+   /* Enmotus */
+   { PCI_DEVICE(0x1c44, 0x8000), board_ahci },
+
/* Generic, PCI class code for AHCI */
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
  PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci },
@@ -1098,9 +1102,11 @@ static int ahci_init_one(struct pci_dev *pdev, const 
struct pci_device_id *ent)
dev_info(>dev,
 "PDC42819 can only drive SATA devices with this 
driver\n");
 
-   /* The Connext uses non-standard BAR */
+   /* Both Connext and Enmotus devices use non-standard BARs */
if (pdev->vendor == PCI_VENDOR_ID_STMICRO && pdev->device == 0xCC06)
ahci_pci_bar = AHCI_PCI_BAR_STA2X11;
+   else if (pdev->vendor == 0x1c44 && pdev->device == 0x8000)
+   ahci_pci_bar = AHCI_PCI_BAR_ENMOTUS;
 
/* acquire resources */
rc = pcim_enable_device(pdev);
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 320712a..6cd7805 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1951,13 +1951,13 @@ static void ahci_set_aggressive_devslp(struct ata_port 
*ap, bool sleep)
/* Use the nominal value 10 ms if the read MDAT is zero,
 * the nominal value of DETO is 20 ms.
 */
-   if (dev->sata_settings[ATA_LOG_DEVSLP_VALID] &
+   if (dev->devslp_timing[ATA_LOG_DEVSLP_VALID] &
ATA_LOG_DEVSLP_VALID_MASK) {
-   mdat = dev->sata_settings[ATA_LOG_DEVSLP_MDAT] &
+   mdat = dev->devslp_timing[ATA_LOG_DEVSLP_MDAT] &
   ATA_LOG_DEVSLP_MDAT_MASK;
if (!mdat)
mdat = 10;
-   deto = dev->sata_settings[ATA_LOG_DEVSLP_DETO];
+   deto = dev->devslp_timing[ATA_LOG_DEVSLP_DETO];
if (!deto)
deto = 20;
} else {
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 9e8b99a..46cd3f4 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2325,24 +2325,28 @@ int ata_dev_configure(struct ata_device *dev)
}
}
 
-   /* check and mark DevSlp capability */
-   if (ata_id_has_devslp(dev->id))
-   dev->flags |= ATA_DFLAG_DEVSLP;
-
-   /* Obtain SATA Settings page from Identify Device Data Log,
-* which contains DevSlp timing variables etc.
-* Exclude old devices with ata_id_has_ncq()
+   /* Check and mark DevSlp capability. Get DevSlp timing variables
+* from SATA Settings page of Identify Device Data Log.
 */
-   if (ata_id_has_ncq(dev->id)) {
+   if (ata_id_has_devslp(dev->id)) {
+   u8 sata_setting[ATA_SECT_SIZE];
+   int i, j;
+
+   dev->flags |= ATA_DFLAG_DEVSLP;
err_mask = ata_read_log_page(dev,
 ATA_LOG_SATA_ID_DEV_DATA,
 ATA_LOG_SATA_SETTINGS,
-dev->sata_settings,
+sata_setting,
 1);
if (err_mask)
ata_dev_dbg(dev,
"failed to get Identify Device 
Data, Emask 0x%x\n",
err_mask);
+   else
+   for (i = 0; i < ATA_LOG_DEVSLP_SIZE; i++) {
+   j = ATA_LOG_DEVSLP_OFFSET + i;
+   

[git patches] libata fixes

2013-01-21 Thread Jeff Garzik

Please pull 803739d25c2343da6d2f95eebdcbc08bf67097d4 from
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
tags/upstream-linus

to receive the following updates:

 drivers/ata/ahci.c|  8 +++-
 drivers/ata/libahci.c |  6 +++---
 drivers/ata/libata-core.c | 22 +-
 drivers/ata/libata-eh.c   |  2 +-
 include/linux/ata.h   |  8 +---
 include/linux/libata.h|  4 ++--
 6 files changed, 31 insertions(+), 19 deletions(-)

Bian Yu (1):
  [libata] ahci: Fix lack of command retry after a success error handler.

Hugh Daschbach (1):
  [libata] ahci: Add support for Enmotus Bobcat device.

Shane Huang (1):
  [libata] replace sata_settings with devslp_timing

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 7862d17..4979127 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -53,6 +53,7 @@
 
 enum {
AHCI_PCI_BAR_STA2X11= 0,
+   AHCI_PCI_BAR_ENMOTUS= 2,
AHCI_PCI_BAR_STANDARD   = 5,
 };
 
@@ -410,6 +411,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci },   /* ASM1061 */
{ PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci },   /* ASM1062 */
 
+   /* Enmotus */
+   { PCI_DEVICE(0x1c44, 0x8000), board_ahci },
+
/* Generic, PCI class code for AHCI */
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
  PCI_CLASS_STORAGE_SATA_AHCI, 0xff, board_ahci },
@@ -1098,9 +1102,11 @@ static int ahci_init_one(struct pci_dev *pdev, const 
struct pci_device_id *ent)
dev_info(pdev-dev,
 PDC42819 can only drive SATA devices with this 
driver\n);
 
-   /* The Connext uses non-standard BAR */
+   /* Both Connext and Enmotus devices use non-standard BARs */
if (pdev-vendor == PCI_VENDOR_ID_STMICRO  pdev-device == 0xCC06)
ahci_pci_bar = AHCI_PCI_BAR_STA2X11;
+   else if (pdev-vendor == 0x1c44  pdev-device == 0x8000)
+   ahci_pci_bar = AHCI_PCI_BAR_ENMOTUS;
 
/* acquire resources */
rc = pcim_enable_device(pdev);
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 320712a..6cd7805 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1951,13 +1951,13 @@ static void ahci_set_aggressive_devslp(struct ata_port 
*ap, bool sleep)
/* Use the nominal value 10 ms if the read MDAT is zero,
 * the nominal value of DETO is 20 ms.
 */
-   if (dev-sata_settings[ATA_LOG_DEVSLP_VALID] 
+   if (dev-devslp_timing[ATA_LOG_DEVSLP_VALID] 
ATA_LOG_DEVSLP_VALID_MASK) {
-   mdat = dev-sata_settings[ATA_LOG_DEVSLP_MDAT] 
+   mdat = dev-devslp_timing[ATA_LOG_DEVSLP_MDAT] 
   ATA_LOG_DEVSLP_MDAT_MASK;
if (!mdat)
mdat = 10;
-   deto = dev-sata_settings[ATA_LOG_DEVSLP_DETO];
+   deto = dev-devslp_timing[ATA_LOG_DEVSLP_DETO];
if (!deto)
deto = 20;
} else {
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 9e8b99a..46cd3f4 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2325,24 +2325,28 @@ int ata_dev_configure(struct ata_device *dev)
}
}
 
-   /* check and mark DevSlp capability */
-   if (ata_id_has_devslp(dev-id))
-   dev-flags |= ATA_DFLAG_DEVSLP;
-
-   /* Obtain SATA Settings page from Identify Device Data Log,
-* which contains DevSlp timing variables etc.
-* Exclude old devices with ata_id_has_ncq()
+   /* Check and mark DevSlp capability. Get DevSlp timing variables
+* from SATA Settings page of Identify Device Data Log.
 */
-   if (ata_id_has_ncq(dev-id)) {
+   if (ata_id_has_devslp(dev-id)) {
+   u8 sata_setting[ATA_SECT_SIZE];
+   int i, j;
+
+   dev-flags |= ATA_DFLAG_DEVSLP;
err_mask = ata_read_log_page(dev,
 ATA_LOG_SATA_ID_DEV_DATA,
 ATA_LOG_SATA_SETTINGS,
-dev-sata_settings,
+sata_setting,
 1);
if (err_mask)
ata_dev_dbg(dev,
failed to get Identify Device 
Data, Emask 0x%x\n,
err_mask);
+   else
+   for (i = 0; i  ATA_LOG_DEVSLP_SIZE; i++) {
+   j = ATA_LOG_DEVSLP_OFFSET + i;
+   

[git patches] libata fixes

2012-11-16 Thread Jeff Garzik

If you were going to shoot me for not sending these earlier, you would be
right.  -rc6 beat me by ~2 hours it seems, and they really should have
gone out to libata-dev.git and you long before that.

These have been in libata-dev.git for a day or so (unfortunately
linux-next is on vacation).  The main one is #1, with the others being
minor bits.  #1 has multiple tested-by, and can be considered a
regression fix IMO.

1) Fix ACPI oops, https://bugzilla.kernel.org/show_bug.cgi?id=48211

2) Temporary WARN_ONCE() debugging patch for further ACPI debugging.
   The code already oopses here, and so this merely gives slightly
   better info.  Related to https://bugzilla.kernel.org/show_bug.cgi?id=49151
   which has been bisected down to a patch that _exposes_ a latent bug,
   but said bisection target does not actually appear to be the root cause
   itself.

3) sata_svw: fix longstanding error recovery bug, which was
   preventing kdump, by adding missing DMA-start bit check.  Core
   code was already checking DMA-start, but ancillary, less-used
   routines were not.  Fixed.

4) sata_highbank: fix minor __init/__devinit warning

5) Fix minor warning, if CONFIG_PM is set, but CONFIG_PM_SLEEP is not set

6) pata_arasan: proper functioning requires clock setting

Please pull 29448ec129c5c9c7ece2ef28c72a0dafd70c8af2 from
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
tags/upstream-linus


to receive the following updates:

 drivers/ata/ahci_platform.c  |  2 +-
 drivers/ata/libata-acpi.c| 11 ---
 drivers/ata/libata-core.c|  4 
 drivers/ata/pata_arasan_cf.c |  8 +++-
 drivers/ata/sata_highbank.c  |  4 ++--
 drivers/ata/sata_svw.c   | 35 +++
 6 files changed, 57 insertions(+), 7 deletions(-)

Aaron Lu (1):
  libata-acpi: Fix NULL ptr derference in ata_acpi_dev_handle

Arnd Bergmann (1):
  sata_highbank: mark ahci_highbank_probe as __devinit

Borislav Petkov (1):
  libata debugging: Warn when unable to find timing descriptor based on 
xfer_mode

David Milburn (1):
  sata_svw: check DMA start bit before reset

Vipul Kumar Samar (1):
  pata_arasan: Initialize cf clock to 166MHz

Yuanhan Liu (1):
  [libata] PM callbacks should be conditionally compiled on CONFIG_PM_SLEEP

diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index b1ae480..b7078af 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -238,7 +238,7 @@ static int __devexit ahci_remove(struct platform_device 
*pdev)
return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int ahci_suspend(struct device *dev)
 {
struct ahci_platform_data *pdata = dev_get_platdata(dev);
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index fd9ecf7..5b0ba3f 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -1105,10 +1105,15 @@ static int ata_acpi_bind_device(struct ata_port *ap, 
struct scsi_device *sdev,
struct acpi_device *acpi_dev;
struct acpi_device_power_state *states;
 
-   if (ap->flags & ATA_FLAG_ACPI_SATA)
-   ata_dev = >link.device[sdev->channel];
-   else
+   if (ap->flags & ATA_FLAG_ACPI_SATA) {
+   if (!sata_pmp_attached(ap))
+   ata_dev = >link.device[sdev->id];
+   else
+   ata_dev = >pmp_link[sdev->channel].device[sdev->id];
+   }
+   else {
ata_dev = >link.device[sdev->id];
+   }
 
*handle = ata_dev_acpi_handle(ata_dev);
 
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3cc7096..f46fbd3 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2942,6 +2942,10 @@ const struct ata_timing *ata_timing_find_mode(u8 
xfer_mode)
 
if (xfer_mode == t->mode)
return t;
+
+   WARN_ONCE(true, "%s: unable to find timing for xfer_mode 0x%x\n",
+   __func__, xfer_mode);
+
return NULL;
 }
 
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index 26201eb..371fd2c 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -317,6 +317,12 @@ static int cf_init(struct arasan_cf_dev *acdev)
return ret;
}
 
+   ret = clk_set_rate(acdev->clk, 16600);
+   if (ret) {
+   dev_warn(acdev->host->dev, "clock set rate failed");
+   return ret;
+   }
+
spin_lock_irqsave(>host->lock, flags);
/* configure CF interface clock */
writel((pdata->cf_if_clk <= CF_IF_CLK_200M) ? pdata->cf_if_clk :
@@ -908,7 +914,7 @@ static int __devexit arasan_cf_remove(struct 
platform_device *pdev)
return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int arasan_cf_suspend(struct device *dev)
 {
struct ata_host *host = dev_get_drvdata(dev);
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index 

[git patches] libata fixes

2012-11-16 Thread Jeff Garzik

If you were going to shoot me for not sending these earlier, you would be
right.  -rc6 beat me by ~2 hours it seems, and they really should have
gone out to libata-dev.git and you long before that.

These have been in libata-dev.git for a day or so (unfortunately
linux-next is on vacation).  The main one is #1, with the others being
minor bits.  #1 has multiple tested-by, and can be considered a
regression fix IMO.

1) Fix ACPI oops, https://bugzilla.kernel.org/show_bug.cgi?id=48211

2) Temporary WARN_ONCE() debugging patch for further ACPI debugging.
   The code already oopses here, and so this merely gives slightly
   better info.  Related to https://bugzilla.kernel.org/show_bug.cgi?id=49151
   which has been bisected down to a patch that _exposes_ a latent bug,
   but said bisection target does not actually appear to be the root cause
   itself.

3) sata_svw: fix longstanding error recovery bug, which was
   preventing kdump, by adding missing DMA-start bit check.  Core
   code was already checking DMA-start, but ancillary, less-used
   routines were not.  Fixed.

4) sata_highbank: fix minor __init/__devinit warning

5) Fix minor warning, if CONFIG_PM is set, but CONFIG_PM_SLEEP is not set

6) pata_arasan: proper functioning requires clock setting

Please pull 29448ec129c5c9c7ece2ef28c72a0dafd70c8af2 from
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
tags/upstream-linus


to receive the following updates:

 drivers/ata/ahci_platform.c  |  2 +-
 drivers/ata/libata-acpi.c| 11 ---
 drivers/ata/libata-core.c|  4 
 drivers/ata/pata_arasan_cf.c |  8 +++-
 drivers/ata/sata_highbank.c  |  4 ++--
 drivers/ata/sata_svw.c   | 35 +++
 6 files changed, 57 insertions(+), 7 deletions(-)

Aaron Lu (1):
  libata-acpi: Fix NULL ptr derference in ata_acpi_dev_handle

Arnd Bergmann (1):
  sata_highbank: mark ahci_highbank_probe as __devinit

Borislav Petkov (1):
  libata debugging: Warn when unable to find timing descriptor based on 
xfer_mode

David Milburn (1):
  sata_svw: check DMA start bit before reset

Vipul Kumar Samar (1):
  pata_arasan: Initialize cf clock to 166MHz

Yuanhan Liu (1):
  [libata] PM callbacks should be conditionally compiled on CONFIG_PM_SLEEP

diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index b1ae480..b7078af 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -238,7 +238,7 @@ static int __devexit ahci_remove(struct platform_device 
*pdev)
return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int ahci_suspend(struct device *dev)
 {
struct ahci_platform_data *pdata = dev_get_platdata(dev);
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index fd9ecf7..5b0ba3f 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -1105,10 +1105,15 @@ static int ata_acpi_bind_device(struct ata_port *ap, 
struct scsi_device *sdev,
struct acpi_device *acpi_dev;
struct acpi_device_power_state *states;
 
-   if (ap-flags  ATA_FLAG_ACPI_SATA)
-   ata_dev = ap-link.device[sdev-channel];
-   else
+   if (ap-flags  ATA_FLAG_ACPI_SATA) {
+   if (!sata_pmp_attached(ap))
+   ata_dev = ap-link.device[sdev-id];
+   else
+   ata_dev = ap-pmp_link[sdev-channel].device[sdev-id];
+   }
+   else {
ata_dev = ap-link.device[sdev-id];
+   }
 
*handle = ata_dev_acpi_handle(ata_dev);
 
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3cc7096..f46fbd3 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2942,6 +2942,10 @@ const struct ata_timing *ata_timing_find_mode(u8 
xfer_mode)
 
if (xfer_mode == t-mode)
return t;
+
+   WARN_ONCE(true, %s: unable to find timing for xfer_mode 0x%x\n,
+   __func__, xfer_mode);
+
return NULL;
 }
 
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index 26201eb..371fd2c 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -317,6 +317,12 @@ static int cf_init(struct arasan_cf_dev *acdev)
return ret;
}
 
+   ret = clk_set_rate(acdev-clk, 16600);
+   if (ret) {
+   dev_warn(acdev-host-dev, clock set rate failed);
+   return ret;
+   }
+
spin_lock_irqsave(acdev-host-lock, flags);
/* configure CF interface clock */
writel((pdata-cf_if_clk = CF_IF_CLK_200M) ? pdata-cf_if_clk :
@@ -908,7 +914,7 @@ static int __devexit arasan_cf_remove(struct 
platform_device *pdev)
return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int arasan_cf_suspend(struct device *dev)
 {
struct ata_host *host = dev_get_drvdata(dev);
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index 

Re: [git patches] libata fixes for 3.7

2012-10-02 Thread Michael Tokarev
On 02.10.2012 23:59, Jeff Garzik wrote:
> On 10/02/2012 03:44 PM, Michael Tokarev wrote:
>> On 02.10.2012 23:40, Jeff Garzik wrote:
>>
>>> Minor libata updates, nothing notable.
>>>
>>> 1) Apply -- and then revert -- the FUA feature.  Caused
>>> disk corruption in linux-next, proving it cannot be turned on by
>>> default.
>>
>> Any details on that?  Disk corruprion is rather a nasty
>> side-effect indeed.
> 
> One thread with reports is
> 
> Storage related regression in linux-next 20120824

Eg, https://lkml.org/lkml/2012/8/27/66 (two reports).
Thank you!

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


Re: [git patches] libata fixes for 3.7

2012-10-02 Thread Jeff Garzik

On 10/02/2012 03:44 PM, Michael Tokarev wrote:

On 02.10.2012 23:40, Jeff Garzik wrote:


Minor libata updates, nothing notable.

1) Apply -- and then revert -- the FUA feature.  Caused
disk corruption in linux-next, proving it cannot be turned on by
default.


Any details on that?  Disk corruprion is rather a nasty
side-effect indeed.


One thread with reports is

Storage related regression in linux-next 20120824

Regards,

Jeff



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


Re: [git patches] libata fixes for 3.7

2012-10-02 Thread Michael Tokarev
On 02.10.2012 23:40, Jeff Garzik wrote:

> Minor libata updates, nothing notable.
> 
> 1) Apply -- and then revert -- the FUA feature.  Caused
>disk corruption in linux-next, proving it cannot be turned on by
>default.

Any details on that?  Disk corruprion is rather a nasty
side-effect indeed.

Thank you!

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


[git patches] libata fixes for 3.7

2012-10-02 Thread Jeff Garzik

Please pull 13b74085d92feda78bad1045516d332a1e9a3407 from
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
tags/upstream-linus


to receive the following updates:


Minor libata updates, nothing notable.

1) Apply -- and then revert -- the FUA feature.  Caused
   disk corruption in linux-next, proving it cannot be turned on by
   default.

   Net effect to upstream tree:  zero

2) New AHCI platform driver sata_highbank

3) Improve SCSI MODE SENSE handling; support MODE SELECT

4) AHCI: support aggressive device sleep (power mgmt)

5) sata_fsl: minor fix

6) pata_arasan: clk support


 Documentation/devicetree/bindings/arm/calxeda/combophy.txt |   17 
 Documentation/devicetree/bindings/ata/ahci-platform.txt|8 
 Documentation/devicetree/bindings/ata/pata-arasan.txt  |   17 
 arch/arm/boot/dts/highbank.dts |   17 
 drivers/ata/Kconfig|8 
 drivers/ata/Makefile   |1 
 drivers/ata/ahci.h |   16 
 drivers/ata/ahci_platform.c|   58 +
 drivers/ata/libahci.c  |   97 ++
 drivers/ata/libata-core.c  |   32 
 drivers/ata/libata-eh.c|   12 
 drivers/ata/libata-scsi.c  |  255 ++-
 drivers/ata/libata.h   |2 
 drivers/ata/pata_arasan_cf.c   |   14 
 drivers/ata/sata_fsl.c |   39 +
 drivers/ata/sata_highbank.c|  450 +
 drivers/ata/sata_mv.c  |8 
 include/linux/ata.h|   30 
 include/linux/libata.h |4 
 19 files changed, 1025 insertions(+), 60 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/calxeda/combophy.txt 
b/Documentation/devicetree/bindings/arm/calxeda/combophy.txt
new file mode 100644
index 000..6622bdb
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/calxeda/combophy.txt
@@ -0,0 +1,17 @@
+Calxeda Highbank Combination Phys for SATA
+
+Properties:
+- compatible : Should be "calxeda,hb-combophy"
+- #phy-cells: Should be 1.
+- reg : Address and size for Combination Phy registers.
+- phydev: device ID for programming the combophy.
+
+Example:
+
+   combophy5: combo-phy@fff5d000 {
+   compatible = "calxeda,hb-combophy";
+   #phy-cells = <1>;
+   reg = <0xfff5d000 0x1000>;
+   phydev = <31>;
+   };
+
diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt 
b/Documentation/devicetree/bindings/ata/ahci-platform.txt
index 8bb8a76..147c1f6 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
@@ -8,9 +8,17 @@ Required properties:
 - interrupts: 
 - reg   : 
 
+Optional properties:
+- calxeda,port-phys: phandle-combophy and lane assignment, which maps each
+   SATA port to a combophy and a lane within that
+   combophy
+
 Example:
 sata@ffe08000 {
compatible = "calxeda,hb-ahci";
 reg = <0xffe08000 0x1000>;
 interrupts = <115>;
+   calxeda,port-phys = < 0  0  1
+2  3>;
+
 };
diff --git a/Documentation/devicetree/bindings/ata/pata-arasan.txt 
b/Documentation/devicetree/bindings/ata/pata-arasan.txt
new file mode 100644
index 000..95ec7f8
--- /dev/null
+++ b/Documentation/devicetree/bindings/ata/pata-arasan.txt
@@ -0,0 +1,17 @@
+* ARASAN PATA COMPACT FLASH CONTROLLER
+
+Required properties:
+- compatible: "arasan,cf-spear1340"
+- reg: Address range of the CF registers
+- interrupt-parent: Should be the phandle for the interrupt controller
+  that services interrupts for this device
+- interrupt: Should contain the CF interrupt number
+
+Example:
+
+   cf@fc00 {
+   compatible = "arasan,cf-spear1340";
+   reg = <0xfc00 0x1000>;
+   interrupt-parent = <>;
+   interrupts = <12>;
+   };
diff --git a/arch/arm/boot/dts/highbank.dts b/arch/arm/boot/dts/highbank.dts
index 9fecf1a..5204cf7 100644
--- a/arch/arm/boot/dts/highbank.dts
+++ b/arch/arm/boot/dts/highbank.dts
@@ -121,6 +121,9 @@
compatible = "calxeda,hb-ahci";
reg = <0xffe08000 0x1>;
interrupts = <0 83 4>;
+   calxeda,port-phys = < 0  0
+ 1  2
+ 3>;
};
 
sdhci@ffe0e000 {
@@ -306,5 +309,19 @@
reg = <0xfff51000 0x1000>;
   

[git patches] libata fixes for 3.7

2012-10-02 Thread Jeff Garzik

Please pull 13b74085d92feda78bad1045516d332a1e9a3407 from
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
tags/upstream-linus


to receive the following updates:


Minor libata updates, nothing notable.

1) Apply -- and then revert -- the FUA feature.  Caused
   disk corruption in linux-next, proving it cannot be turned on by
   default.

   Net effect to upstream tree:  zero

2) New AHCI platform driver sata_highbank

3) Improve SCSI MODE SENSE handling; support MODE SELECT

4) AHCI: support aggressive device sleep (power mgmt)

5) sata_fsl: minor fix

6) pata_arasan: clk support


 Documentation/devicetree/bindings/arm/calxeda/combophy.txt |   17 
 Documentation/devicetree/bindings/ata/ahci-platform.txt|8 
 Documentation/devicetree/bindings/ata/pata-arasan.txt  |   17 
 arch/arm/boot/dts/highbank.dts |   17 
 drivers/ata/Kconfig|8 
 drivers/ata/Makefile   |1 
 drivers/ata/ahci.h |   16 
 drivers/ata/ahci_platform.c|   58 +
 drivers/ata/libahci.c  |   97 ++
 drivers/ata/libata-core.c  |   32 
 drivers/ata/libata-eh.c|   12 
 drivers/ata/libata-scsi.c  |  255 ++-
 drivers/ata/libata.h   |2 
 drivers/ata/pata_arasan_cf.c   |   14 
 drivers/ata/sata_fsl.c |   39 +
 drivers/ata/sata_highbank.c|  450 +
 drivers/ata/sata_mv.c  |8 
 include/linux/ata.h|   30 
 include/linux/libata.h |4 
 19 files changed, 1025 insertions(+), 60 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/calxeda/combophy.txt 
b/Documentation/devicetree/bindings/arm/calxeda/combophy.txt
new file mode 100644
index 000..6622bdb
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/calxeda/combophy.txt
@@ -0,0 +1,17 @@
+Calxeda Highbank Combination Phys for SATA
+
+Properties:
+- compatible : Should be calxeda,hb-combophy
+- #phy-cells: Should be 1.
+- reg : Address and size for Combination Phy registers.
+- phydev: device ID for programming the combophy.
+
+Example:
+
+   combophy5: combo-phy@fff5d000 {
+   compatible = calxeda,hb-combophy;
+   #phy-cells = 1;
+   reg = 0xfff5d000 0x1000;
+   phydev = 31;
+   };
+
diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt 
b/Documentation/devicetree/bindings/ata/ahci-platform.txt
index 8bb8a76..147c1f6 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
@@ -8,9 +8,17 @@ Required properties:
 - interrupts: interrupt mapping for SATA IRQ
 - reg   : registers mapping
 
+Optional properties:
+- calxeda,port-phys: phandle-combophy and lane assignment, which maps each
+   SATA port to a combophy and a lane within that
+   combophy
+
 Example:
 sata@ffe08000 {
compatible = calxeda,hb-ahci;
 reg = 0xffe08000 0x1000;
 interrupts = 115;
+   calxeda,port-phys = combophy5 0 combophy0 0 combophy0 1
+   combophy0 2 combophy0 3;
+
 };
diff --git a/Documentation/devicetree/bindings/ata/pata-arasan.txt 
b/Documentation/devicetree/bindings/ata/pata-arasan.txt
new file mode 100644
index 000..95ec7f8
--- /dev/null
+++ b/Documentation/devicetree/bindings/ata/pata-arasan.txt
@@ -0,0 +1,17 @@
+* ARASAN PATA COMPACT FLASH CONTROLLER
+
+Required properties:
+- compatible: arasan,cf-spear1340
+- reg: Address range of the CF registers
+- interrupt-parent: Should be the phandle for the interrupt controller
+  that services interrupts for this device
+- interrupt: Should contain the CF interrupt number
+
+Example:
+
+   cf@fc00 {
+   compatible = arasan,cf-spear1340;
+   reg = 0xfc00 0x1000;
+   interrupt-parent = vic1;
+   interrupts = 12;
+   };
diff --git a/arch/arm/boot/dts/highbank.dts b/arch/arm/boot/dts/highbank.dts
index 9fecf1a..5204cf7 100644
--- a/arch/arm/boot/dts/highbank.dts
+++ b/arch/arm/boot/dts/highbank.dts
@@ -121,6 +121,9 @@
compatible = calxeda,hb-ahci;
reg = 0xffe08000 0x1;
interrupts = 0 83 4;
+   calxeda,port-phys = combophy5 0 combophy0 0
+combophy0 1 combophy0 2
+combophy0 3;
};
 
   

Re: [git patches] libata fixes for 3.7

2012-10-02 Thread Michael Tokarev
On 02.10.2012 23:40, Jeff Garzik wrote:

 Minor libata updates, nothing notable.
 
 1) Apply -- and then revert -- the FUA feature.  Caused
disk corruption in linux-next, proving it cannot be turned on by
default.

Any details on that?  Disk corruprion is rather a nasty
side-effect indeed.

Thank you!

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


Re: [git patches] libata fixes for 3.7

2012-10-02 Thread Jeff Garzik

On 10/02/2012 03:44 PM, Michael Tokarev wrote:

On 02.10.2012 23:40, Jeff Garzik wrote:


Minor libata updates, nothing notable.

1) Apply -- and then revert -- the FUA feature.  Caused
disk corruption in linux-next, proving it cannot be turned on by
default.


Any details on that?  Disk corruprion is rather a nasty
side-effect indeed.


One thread with reports is

Storage related regression in linux-next 20120824

Regards,

Jeff



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


Re: [git patches] libata fixes for 3.7

2012-10-02 Thread Michael Tokarev
On 02.10.2012 23:59, Jeff Garzik wrote:
 On 10/02/2012 03:44 PM, Michael Tokarev wrote:
 On 02.10.2012 23:40, Jeff Garzik wrote:

 Minor libata updates, nothing notable.

 1) Apply -- and then revert -- the FUA feature.  Caused
 disk corruption in linux-next, proving it cannot be turned on by
 default.

 Any details on that?  Disk corruprion is rather a nasty
 side-effect indeed.
 
 One thread with reports is
 
 Storage related regression in linux-next 20120824

Eg, https://lkml.org/lkml/2012/8/27/66 (two reports).
Thank you!

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


[git patches] libata fixes

2012-08-25 Thread Jeff Garzik


Changes:
1) libata-acpi regression fix

2) additional or corrected drive quirks for ata_blacklist

3) Kconfig text tweaking

4) new PCI IDs

5) pata_atiixp: quirk for MSI motherboard

6) export ahci_dev_classify for an ahci_platform driver


Please pull d17d794c63e2dc0a5b1ffc8367c9475880427fc7 from
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
tags/upstream-linus


to receive the following updates:

 drivers/ata/Kconfig   |2 +-
 drivers/ata/ahci.c|8 
 drivers/ata/ahci.h|1 +
 drivers/ata/ata_piix.c|8 
 drivers/ata/libahci.c |3 ++-
 drivers/ata/libata-acpi.c |   15 ---
 drivers/ata/libata-core.c |3 ++-
 drivers/ata/pata_atiixp.c |   16 
 8 files changed, 42 insertions(+), 14 deletions(-)

Aaron Lu (1):
  [libata] acpi: call ata_acpi_gtm during ata port init time

Arnd Hannemann (1):
  pata_atiixp: override cable detection on MSI E350DM-E33

James Ralston (2):
  ahci: Add Device IDs for Intel Lynx Point-LP PCH
  ata_piix: Add Device IDs for Intel Lynx Point-LP PCH

Jeff Garzik (1):
  [libata] new quirk, lift bridge limits for Buffalo DriveStation Quattro

Paul Menzel (1):
  [libata] Kconfig: Elaborate that SFF is meant for legacy and PATA stuff

Prarit Bhargava (1):
  libata: Add a space to " 2GB ATA Flash Disk" DMA blacklist entry

Rob Herring (1):
  ahci: un-staticize ahci_dev_classify

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 2be8ef1..27cecd3 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -115,7 +115,7 @@ config SATA_SIL24
  If unsure, say N.
 
 config ATA_SFF
-   bool "ATA SFF support"
+   bool "ATA SFF support (for legacy IDE and PATA)"
default y
help
  This option adds support for ATA controllers with SFF
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 062e6a1..50d5dea 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -256,6 +256,14 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x8c07), board_ahci }, /* Lynx Point RAID */
{ PCI_VDEVICE(INTEL, 0x8c0e), board_ahci }, /* Lynx Point RAID */
{ PCI_VDEVICE(INTEL, 0x8c0f), board_ahci }, /* Lynx Point RAID */
+   { PCI_VDEVICE(INTEL, 0x9c02), board_ahci }, /* Lynx Point-LP AHCI */
+   { PCI_VDEVICE(INTEL, 0x9c03), board_ahci }, /* Lynx Point-LP AHCI */
+   { PCI_VDEVICE(INTEL, 0x9c04), board_ahci }, /* Lynx Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x9c05), board_ahci }, /* Lynx Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x9c06), board_ahci }, /* Lynx Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x9c07), board_ahci }, /* Lynx Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x9c0e), board_ahci }, /* Lynx Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x9c0f), board_ahci }, /* Lynx Point-LP RAID */
 
/* 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,
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index c2594dd..57eb1c2 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -320,6 +320,7 @@ extern struct device_attribute *ahci_sdev_attrs[];
 extern struct ata_port_operations ahci_ops;
 extern struct ata_port_operations ahci_pmp_retry_srst_ops;
 
+unsigned int ahci_dev_classify(struct ata_port *ap);
 void ahci_fill_cmd_slot(struct ahci_port_priv *pp, unsigned int tag,
u32 opts);
 void ahci_save_initial_config(struct device *dev,
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 3c809bf..ef773e1 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -329,6 +329,14 @@ static const struct pci_device_id piix_pci_tbl[] = {
{ 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (Lynx Point) */
{ 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
+   /* SATA Controller IDE (Lynx Point-LP) */
+   { 0x8086, 0x9c00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
+   /* SATA Controller IDE (Lynx Point-LP) */
+   { 0x8086, 0x9c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
+   /* SATA Controller IDE (Lynx Point-LP) */
+   { 0x8086, 0x9c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
+   /* SATA Controller IDE (Lynx Point-LP) */
+   { 0x8086, 0x9c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (DH89xxCC) */
{ 0x8086, 0x2326, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
{ } /* terminate list */
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index f9eaa82..555c07a 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1139,7 +1139,7 @@ static void ahci_dev_config(struct ata_device *dev)
}
 }
 
-static unsigned int ahci_dev_classify(struct ata_port *ap)
+unsigned int ahci_dev_classify(struct ata_port *ap)
 {
 

[git patches] libata fixes

2012-08-25 Thread Jeff Garzik


Changes:
1) libata-acpi regression fix

2) additional or corrected drive quirks for ata_blacklist

3) Kconfig text tweaking

4) new PCI IDs

5) pata_atiixp: quirk for MSI motherboard

6) export ahci_dev_classify for an ahci_platform driver


Please pull d17d794c63e2dc0a5b1ffc8367c9475880427fc7 from
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
tags/upstream-linus


to receive the following updates:

 drivers/ata/Kconfig   |2 +-
 drivers/ata/ahci.c|8 
 drivers/ata/ahci.h|1 +
 drivers/ata/ata_piix.c|8 
 drivers/ata/libahci.c |3 ++-
 drivers/ata/libata-acpi.c |   15 ---
 drivers/ata/libata-core.c |3 ++-
 drivers/ata/pata_atiixp.c |   16 
 8 files changed, 42 insertions(+), 14 deletions(-)

Aaron Lu (1):
  [libata] acpi: call ata_acpi_gtm during ata port init time

Arnd Hannemann (1):
  pata_atiixp: override cable detection on MSI E350DM-E33

James Ralston (2):
  ahci: Add Device IDs for Intel Lynx Point-LP PCH
  ata_piix: Add Device IDs for Intel Lynx Point-LP PCH

Jeff Garzik (1):
  [libata] new quirk, lift bridge limits for Buffalo DriveStation Quattro

Paul Menzel (1):
  [libata] Kconfig: Elaborate that SFF is meant for legacy and PATA stuff

Prarit Bhargava (1):
  libata: Add a space to  2GB ATA Flash Disk DMA blacklist entry

Rob Herring (1):
  ahci: un-staticize ahci_dev_classify

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 2be8ef1..27cecd3 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -115,7 +115,7 @@ config SATA_SIL24
  If unsure, say N.
 
 config ATA_SFF
-   bool ATA SFF support
+   bool ATA SFF support (for legacy IDE and PATA)
default y
help
  This option adds support for ATA controllers with SFF
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 062e6a1..50d5dea 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -256,6 +256,14 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x8c07), board_ahci }, /* Lynx Point RAID */
{ PCI_VDEVICE(INTEL, 0x8c0e), board_ahci }, /* Lynx Point RAID */
{ PCI_VDEVICE(INTEL, 0x8c0f), board_ahci }, /* Lynx Point RAID */
+   { PCI_VDEVICE(INTEL, 0x9c02), board_ahci }, /* Lynx Point-LP AHCI */
+   { PCI_VDEVICE(INTEL, 0x9c03), board_ahci }, /* Lynx Point-LP AHCI */
+   { PCI_VDEVICE(INTEL, 0x9c04), board_ahci }, /* Lynx Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x9c05), board_ahci }, /* Lynx Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x9c06), board_ahci }, /* Lynx Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x9c07), board_ahci }, /* Lynx Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x9c0e), board_ahci }, /* Lynx Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x9c0f), board_ahci }, /* Lynx Point-LP RAID */
 
/* 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,
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index c2594dd..57eb1c2 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -320,6 +320,7 @@ extern struct device_attribute *ahci_sdev_attrs[];
 extern struct ata_port_operations ahci_ops;
 extern struct ata_port_operations ahci_pmp_retry_srst_ops;
 
+unsigned int ahci_dev_classify(struct ata_port *ap);
 void ahci_fill_cmd_slot(struct ahci_port_priv *pp, unsigned int tag,
u32 opts);
 void ahci_save_initial_config(struct device *dev,
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 3c809bf..ef773e1 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -329,6 +329,14 @@ static const struct pci_device_id piix_pci_tbl[] = {
{ 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (Lynx Point) */
{ 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
+   /* SATA Controller IDE (Lynx Point-LP) */
+   { 0x8086, 0x9c00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
+   /* SATA Controller IDE (Lynx Point-LP) */
+   { 0x8086, 0x9c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
+   /* SATA Controller IDE (Lynx Point-LP) */
+   { 0x8086, 0x9c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
+   /* SATA Controller IDE (Lynx Point-LP) */
+   { 0x8086, 0x9c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
/* SATA Controller IDE (DH89xxCC) */
{ 0x8086, 0x2326, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
{ } /* terminate list */
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index f9eaa82..555c07a 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1139,7 +1139,7 @@ static void ahci_dev_config(struct ata_device *dev)
}
 }
 
-static unsigned int ahci_dev_classify(struct ata_port *ap)
+unsigned int ahci_dev_classify(struct ata_port *ap)
 {

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-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-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/


[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   = _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   = _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);
+  

[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: 
 
+   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-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, );
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-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 = >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 

[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_mask>0 && 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(, 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, , 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(, 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, , 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(, buf + buflen - slop, slop);
-

[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   = _sata_ops,
},
 
+   [piix_pata_vmw] =
+   {
+   .sht= _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   = _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-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: 
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(>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 

[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 
 #include 
 #include 
 #include 
@@ -25,6 +26,18 @@
 #include 
 #include 
 
+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 == _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, >__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 @@ EXPORT_SYMBOL_GPL(ata_acpi_gtm);
  * RETURNS:
  * 0 on 

[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 

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


[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, );
 
@@ -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 

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


[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, 

-   

[git patches] libata fixes

2007-12-04 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 |4 
 drivers/ata/pata_amd.c |5 +++--
 drivers/ata/pata_via.c |4 ++--
 drivers/ata/sata_mv.c  |9 +
 drivers/ata/sata_nv.c  |   32 +++-
 5 files changed, 41 insertions(+), 13 deletions(-)

Bartlomiej Zolnierkiewicz (1):
  pata_amd/pata_via: de-couple programming of PIO/MWDMA and UDMA timings

Mark Lord (1):
  sata_mv:  Warn about HPT RocketRAID BIOS treatment of "Legacy" drives

Robert Hancock (1):
  sata_nv: don't use legacy DMA in ADMA mode (v3)

peerchen (1):
  ahci: add the Device IDs of MCP79 AHCI controller to ahci.c

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index ed9b407..4688dbf 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -536,6 +536,10 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(NVIDIA, 0x0ad9), board_ahci },/* MCP77 */
{ PCI_VDEVICE(NVIDIA, 0x0ada), board_ahci },/* MCP77 */
{ PCI_VDEVICE(NVIDIA, 0x0adb), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ab4), board_ahci },/* MCP79 */
+   { PCI_VDEVICE(NVIDIA, 0x0ab5), board_ahci },/* MCP79 */
+   { PCI_VDEVICE(NVIDIA, 0x0ab6), board_ahci },/* MCP79 */
+   { PCI_VDEVICE(NVIDIA, 0x0ab7), board_ahci },/* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0ab8), board_ahci },/* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0ab9), board_ahci },/* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0aba), board_ahci },/* MCP79 */
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index c5779ad..3cc27b5 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -25,7 +25,7 @@
 #include 
 
 #define DRV_NAME "pata_amd"
-#define DRV_VERSION "0.3.9"
+#define DRV_VERSION "0.3.10"
 
 /**
  * timing_setup-   shared timing computation and load
@@ -115,7 +115,8 @@ static void timing_setup(struct ata_port *ap, struct 
ata_device *adev, int offse
}
 
/* UDMA timing */
-   pci_write_config_byte(pdev, offset + 0x10 + (3 - dn), t);
+   if (at.udma)
+   pci_write_config_byte(pdev, offset + 0x10 + (3 - dn), t);
 }
 
 /**
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index a4175fb..453d72b 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -63,7 +63,7 @@
 #include 
 
 #define DRV_NAME "pata_via"
-#define DRV_VERSION "0.3.2"
+#define DRV_VERSION "0.3.3"
 
 /*
  * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx
@@ -296,7 +296,7 @@ static void via_do_set_mode(struct ata_port *ap, struct 
ata_device *adev, int mo
}
 
/* Set UDMA unless device is not UDMA capable */
-   if (udma_type) {
+   if (udma_type && t.udma) {
u8 cable80_status;
 
/* Get 80-wire cable detection bit */
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 8d864e5..fe0105d 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -2503,6 +2503,15 @@ static int mv_chip_id(struct ata_host *host, unsigned 
int board_idx)
 
case chip_7042:
hp_flags |= MV_HP_PCIE;
+   if (pdev->vendor == PCI_VENDOR_ID_TTI &&
+   (pdev->device == 0x2300 || pdev->device == 0x2310))
+   {
+   printk(KERN_WARNING "sata_mv: Highpoint RocketRAID BIOS"
+   " will CORRUPT DATA on attached drives when"
+   " configured as \"Legacy\".  BEWARE!\n");
+   printk(KERN_WARNING "sata_mv: Use BIOS \"JBOD\" volumes"
+   " instead for safety.\n");
+   }
case chip_6042:
hpriv->ops = _ops;
hp_flags |= MV_HP_GEN_IIE;
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 44f9e5d..ed5dc7c 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -791,11 +791,13 @@ static int nv_adma_check_atapi_dma(struct ata_queued_cmd 
*qc)
 
 static void nv_adma_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
 {
-   /* Since commands where a result TF is requested are not
-  executed in ADMA mode, the only time this function will be called
-  in ADMA mode will be if a command fails. In this case we
-  don't care about going into register mode with ADMA commands
-  pending, as the commands will all shortly be aborted anyway. */
+   /* Other than when internal or pass-through commands are executed,
+  the only time this function will be called in ADMA mode will be
+  if a command fails. In the failure case we don't care about going
+  into register mode with ADMA commands pending, as the commands 

[git patches] libata fixes

2007-12-04 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 |4 
 drivers/ata/pata_amd.c |5 +++--
 drivers/ata/pata_via.c |4 ++--
 drivers/ata/sata_mv.c  |9 +
 drivers/ata/sata_nv.c  |   32 +++-
 5 files changed, 41 insertions(+), 13 deletions(-)

Bartlomiej Zolnierkiewicz (1):
  pata_amd/pata_via: de-couple programming of PIO/MWDMA and UDMA timings

Mark Lord (1):
  sata_mv:  Warn about HPT RocketRAID BIOS treatment of Legacy drives

Robert Hancock (1):
  sata_nv: don't use legacy DMA in ADMA mode (v3)

peerchen (1):
  ahci: add the Device IDs of MCP79 AHCI controller to ahci.c

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index ed9b407..4688dbf 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -536,6 +536,10 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(NVIDIA, 0x0ad9), board_ahci },/* MCP77 */
{ PCI_VDEVICE(NVIDIA, 0x0ada), board_ahci },/* MCP77 */
{ PCI_VDEVICE(NVIDIA, 0x0adb), board_ahci },/* MCP77 */
+   { PCI_VDEVICE(NVIDIA, 0x0ab4), board_ahci },/* MCP79 */
+   { PCI_VDEVICE(NVIDIA, 0x0ab5), board_ahci },/* MCP79 */
+   { PCI_VDEVICE(NVIDIA, 0x0ab6), board_ahci },/* MCP79 */
+   { PCI_VDEVICE(NVIDIA, 0x0ab7), board_ahci },/* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0ab8), board_ahci },/* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0ab9), board_ahci },/* MCP79 */
{ PCI_VDEVICE(NVIDIA, 0x0aba), board_ahci },/* MCP79 */
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index c5779ad..3cc27b5 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -25,7 +25,7 @@
 #include linux/libata.h
 
 #define DRV_NAME pata_amd
-#define DRV_VERSION 0.3.9
+#define DRV_VERSION 0.3.10
 
 /**
  * timing_setup-   shared timing computation and load
@@ -115,7 +115,8 @@ static void timing_setup(struct ata_port *ap, struct 
ata_device *adev, int offse
}
 
/* UDMA timing */
-   pci_write_config_byte(pdev, offset + 0x10 + (3 - dn), t);
+   if (at.udma)
+   pci_write_config_byte(pdev, offset + 0x10 + (3 - dn), t);
 }
 
 /**
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index a4175fb..453d72b 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.2
+#define DRV_VERSION 0.3.3
 
 /*
  * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx
@@ -296,7 +296,7 @@ static void via_do_set_mode(struct ata_port *ap, struct 
ata_device *adev, int mo
}
 
/* Set UDMA unless device is not UDMA capable */
-   if (udma_type) {
+   if (udma_type  t.udma) {
u8 cable80_status;
 
/* Get 80-wire cable detection bit */
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 8d864e5..fe0105d 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -2503,6 +2503,15 @@ static int mv_chip_id(struct ata_host *host, unsigned 
int board_idx)
 
case chip_7042:
hp_flags |= MV_HP_PCIE;
+   if (pdev-vendor == PCI_VENDOR_ID_TTI 
+   (pdev-device == 0x2300 || pdev-device == 0x2310))
+   {
+   printk(KERN_WARNING sata_mv: Highpoint RocketRAID BIOS
+will CORRUPT DATA on attached drives when
+configured as \Legacy\.  BEWARE!\n);
+   printk(KERN_WARNING sata_mv: Use BIOS \JBOD\ volumes
+instead for safety.\n);
+   }
case chip_6042:
hpriv-ops = mv6xxx_ops;
hp_flags |= MV_HP_GEN_IIE;
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 44f9e5d..ed5dc7c 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -791,11 +791,13 @@ static int nv_adma_check_atapi_dma(struct ata_queued_cmd 
*qc)
 
 static void nv_adma_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
 {
-   /* Since commands where a result TF is requested are not
-  executed in ADMA mode, the only time this function will be called
-  in ADMA mode will be if a command fails. In this case we
-  don't care about going into register mode with ADMA commands
-  pending, as the commands will all shortly be aborted anyway. */
+   /* Other than when internal or pass-through commands are executed,
+  the only time this function will be called in ADMA mode will be
+  if a command fails. In the failure case we don't care about going
+  into register mode with ADMA commands pending, as the commands will

[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 & 

[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) */
-   { 

[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-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-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/


[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-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-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/ata_piix.c  |7 +++
 drivers/ata/libata-acpi.c   |   10 +---
 drivers/ata/libata-core.c   |   78 ++---
 drivers/ata/pata_platform.c |   35 +++---
 drivers/ata/sata_nv.c   |2 +-
 drivers/ata/sata_qstor.c|  114 ---
 6 files changed, 172 insertions(+), 74 deletions(-)

Fernando Luis Vázquez Cao (1):
  nv_hardreset: update dangling reference to bugzilla entry

Mark Lord (3):
  libata sata_qstor nuke idle state
  libata sata_qstor workaround for spurious interrupts
  libata sata_qstor conversion to new error handling (EH).

Matthew Garrett (1):
  libata: Don't fail device revalidation for bad _GTF methods

Paul Mundt (2):
  libata: Support PIO polling-only hosts.
  libata: pata_platform: Support polling-mode configuration.

Tejun Heo (2):
  libata: skip 0xff polling for PATA controllers
  libata: port and host should be stopped before hardware resources are 
released

Yann Chachkoff (1):
  ata_piix: add SATELLITE PRO U200 to broken suspend list

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index f08cca2..328ce8a 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -960,6 +960,13 @@ static int piix_broken_suspend(void)
},
},
{
+   .ident = "Satellite Pro U200",
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+   DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE PRO 
U200"),
+   },
+   },
+   {
.ident = "Satellite U205",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 08a52dd..545ea86 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(ata_acpi_stm);
  *
  * RETURNS:
  * Number of taskfiles on success, 0 if _GTF doesn't exist or doesn't
- * contain valid data.  -errno on other errors.
+ * contain valid data.
  */
 static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
   void **ptr_to_free)
@@ -339,7 +339,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct 
ata_acpi_gtf **gtf,
ata_dev_printk(dev, KERN_WARNING,
   "_GTF evaluation failed (AE 0x%x)\n",
   status);
-   rc = -EIO;
}
goto out_free;
}
@@ -359,7 +358,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct 
ata_acpi_gtf **gtf,
ata_dev_printk(dev, KERN_WARNING,
   "_GTF unexpected object type 0x%x\n",
   out_obj->type);
-   rc = -EINVAL;
goto out_free;
}
 
@@ -367,7 +365,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct 
ata_acpi_gtf **gtf,
ata_dev_printk(dev, KERN_WARNING,
   "unexpected _GTF length (%d)\n",
   out_obj->buffer.length);
-   rc = -EINVAL;
goto out_free;
}
 
@@ -511,10 +508,7 @@ static int ata_acpi_exec_tfs(struct ata_device *dev)
int gtf_count, i, rc;
 
/* get taskfiles */
-   rc = ata_dev_get_GTF(dev, , _to_free);
-   if (rc < 0)
-   return rc;
-   gtf_count = rc;
+   gtf_count = ata_dev_get_GTF(dev, , _to_free);
 
/* execute them */
for (i = 0, rc = 0; i < gtf_count; i++) {
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index ec3ce12..8189803 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3373,14 +3373,20 @@ void ata_wait_after_reset(struct ata_port *ap, unsigned 
long deadline)
 * to clear 0xff after reset.  For example, HHD424020F7SV00
 * iVDR needs >= 800ms while.  Quantum GoVault needs even more
 * than that.
+*
+* Note that some PATA controllers (pata_ali) explode if
+* status register is read more than once when there's no
+* device attached.
 */
-   while (1) {
-   u8 status = ata_chk_status(ap);
+   if (ap->flags & ATA_FLAG_SATA) {
+   while (1) {
+   u8 status = ata_chk_status(ap);
 
-   if (status != 0xff || time_after(jiffies, deadline))
-   return;
+   if (status != 0xff || time_after(jiffies, deadline))
+   return;
 
-   msleep(50);
+  

[git patches] libata fixes

2007-11-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/ata_piix.c  |7 +++
 drivers/ata/libata-acpi.c   |   10 +---
 drivers/ata/libata-core.c   |   78 ++---
 drivers/ata/pata_platform.c |   35 +++---
 drivers/ata/sata_nv.c   |2 +-
 drivers/ata/sata_qstor.c|  114 ---
 6 files changed, 172 insertions(+), 74 deletions(-)

Fernando Luis Vázquez Cao (1):
  nv_hardreset: update dangling reference to bugzilla entry

Mark Lord (3):
  libata sata_qstor nuke idle state
  libata sata_qstor workaround for spurious interrupts
  libata sata_qstor conversion to new error handling (EH).

Matthew Garrett (1):
  libata: Don't fail device revalidation for bad _GTF methods

Paul Mundt (2):
  libata: Support PIO polling-only hosts.
  libata: pata_platform: Support polling-mode configuration.

Tejun Heo (2):
  libata: skip 0xff polling for PATA controllers
  libata: port and host should be stopped before hardware resources are 
released

Yann Chachkoff (1):
  ata_piix: add SATELLITE PRO U200 to broken suspend list

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index f08cca2..328ce8a 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -960,6 +960,13 @@ static int piix_broken_suspend(void)
},
},
{
+   .ident = Satellite Pro U200,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
+   DMI_MATCH(DMI_PRODUCT_NAME, SATELLITE PRO 
U200),
+   },
+   },
+   {
.ident = Satellite U205,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 08a52dd..545ea86 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(ata_acpi_stm);
  *
  * RETURNS:
  * Number of taskfiles on success, 0 if _GTF doesn't exist or doesn't
- * contain valid data.  -errno on other errors.
+ * contain valid data.
  */
 static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
   void **ptr_to_free)
@@ -339,7 +339,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct 
ata_acpi_gtf **gtf,
ata_dev_printk(dev, KERN_WARNING,
   _GTF evaluation failed (AE 0x%x)\n,
   status);
-   rc = -EIO;
}
goto out_free;
}
@@ -359,7 +358,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct 
ata_acpi_gtf **gtf,
ata_dev_printk(dev, KERN_WARNING,
   _GTF unexpected object type 0x%x\n,
   out_obj-type);
-   rc = -EINVAL;
goto out_free;
}
 
@@ -367,7 +365,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct 
ata_acpi_gtf **gtf,
ata_dev_printk(dev, KERN_WARNING,
   unexpected _GTF length (%d)\n,
   out_obj-buffer.length);
-   rc = -EINVAL;
goto out_free;
}
 
@@ -511,10 +508,7 @@ static int ata_acpi_exec_tfs(struct ata_device *dev)
int gtf_count, i, rc;
 
/* get taskfiles */
-   rc = ata_dev_get_GTF(dev, gtf, ptr_to_free);
-   if (rc  0)
-   return rc;
-   gtf_count = rc;
+   gtf_count = ata_dev_get_GTF(dev, gtf, ptr_to_free);
 
/* execute them */
for (i = 0, rc = 0; i  gtf_count; i++) {
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index ec3ce12..8189803 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3373,14 +3373,20 @@ void ata_wait_after_reset(struct ata_port *ap, unsigned 
long deadline)
 * to clear 0xff after reset.  For example, HHD424020F7SV00
 * iVDR needs = 800ms while.  Quantum GoVault needs even more
 * than that.
+*
+* Note that some PATA controllers (pata_ali) explode if
+* status register is read more than once when there's no
+* device attached.
 */
-   while (1) {
-   u8 status = ata_chk_status(ap);
+   if (ap-flags  ATA_FLAG_SATA) {
+   while (1) {
+   u8 status = ata_chk_status(ap);
 
-   if (status != 0xff || time_after(jiffies, deadline))
-   return;
+   if (status != 0xff || time_after(jiffies, deadline))
+   return;
 
-   msleep(50);
+ 

[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 

[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 = >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;
 

[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-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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 "--- ", 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-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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 "--- ", 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/


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-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-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/


[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 [EMAIL PROTECTED]
  * on emails.
  *
@@ -45,11 +46,12 @@
 #include "sata_promise.h"
 
 #define DRV_NAME   "sata_promise"
-#define DRV_VERSION"2.10"
+#define DRV_VERSION"2.11"
 
 enum {

[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 [EMAIL PROTECTED]
  * 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-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [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-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/


[git patches] libata fixes and checkpatch cleanups

2007-10-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 |   26 +++---
 drivers/ata/ata_piix.c |   29 +++---
 drivers/ata/libata-acpi.c  |   16 ++--
 drivers/ata/libata-core.c  |   69 +++--
 drivers/ata/libata-eh.c|   14 ++--
 drivers/ata/libata-scsi.c  |  240 ++--
 drivers/ata/libata-sff.c   |2 +-
 drivers/ata/pata_ns87415.c |   10 +-
 drivers/ata/sata_mv.c  |   23 ++--
 drivers/ata/sata_nv.c  |   68 ++---
 drivers/ata/sata_sx4.c |4 +-
 drivers/pci/quirks.c   |2 +-
 include/linux/ata.h|6 +-
 include/linux/libata.h |   22 ++--
 14 files changed, 265 insertions(+), 266 deletions(-)

Alan Cox (1):
  libata-core: auditting chk_status v check_status

Jeff Garzik (1):
  [libata] checkpatch-inspired cleanups

Tejun Heo (2):
  libata: add HTS542525K9SA00 to NCQ blacklist
  jmicron: update quirk for JMB361/3/5/6

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 47c8060..95229e7 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -227,7 +227,7 @@ struct ahci_port_priv {
 
 static int ahci_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val);
 static int ahci_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val);
-static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id 
*ent);
+static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id 
*ent);
 static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc);
 static void ahci_irq_clear(struct ata_port *ap);
 static int ahci_port_start(struct ata_port *ap);
@@ -729,7 +729,7 @@ static int ahci_stop_engine(struct ata_port *ap)
 
/* wait for engine to stop. This could be as long as 500 msec */
tmp = ata_wait_register(port_mmio + PORT_CMD,
-   PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500);
+   PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500);
if (tmp & PORT_CMD_LIST_ON)
return -EIO;
 
@@ -1564,9 +1564,9 @@ static irqreturn_t ahci_interrupt(int irq, void 
*dev_instance)
if (!irq_stat)
return IRQ_NONE;
 
-spin_lock(>lock);
+   spin_lock(>lock);
 
-for (i = 0; i < host->n_ports; i++) {
+   for (i = 0; i < host->n_ports; i++) {
struct ata_port *ap;
 
if (!(irq_stat & (1 << i)))
@@ -1829,9 +1829,9 @@ static int ahci_port_start(struct ata_port *ap)
pp->cmd_tbl_dma = mem_dma;
 
/*
-* Save off initial list of interrupts to be enabled.
-* This could be changed later
-*/
+* Save off initial list of interrupts to be enabled.
+* This could be changed later
+*/
pp->intr_mask = DEF_PORT_IRQ;
 
ap->private_data = pp;
@@ -1918,12 +1918,12 @@ static void ahci_print_info(struct ata_host *host)
dev_printk(KERN_INFO, >dev,
"AHCI %02x%02x.%02x%02x "
"%u slots %u ports %s Gbps 0x%x impl %s mode\n"
-   ,
+   ,
 
-   (vers >> 24) & 0xff,
-   (vers >> 16) & 0xff,
-   (vers >> 8) & 0xff,
-   vers & 0xff,
+   (vers >> 24) & 0xff,
+   (vers >> 16) & 0xff,
+   (vers >> 8) & 0xff,
+   vers & 0xff,
 
((cap >> 8) & 0x1f) + 1,
(cap & 0x1f) + 1,
@@ -1935,7 +1935,7 @@ static void ahci_print_info(struct ata_host *host)
"flags: "
"%s%s%s%s%s%s%s"
"%s%s%s%s%s%s%s\n"
-   ,
+   ,
 
cap & (1 << 31) ? "64bit " : "",
cap & (1 << 30) ? "ncq " : "",
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 3c6f43e..a4b2cb2 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -157,12 +157,12 @@ struct piix_host_priv {
const int *map;
 };
 
-static int piix_init_one (struct pci_dev *pdev,
-   const struct pci_device_id *ent);
+static int piix_init_one(struct pci_dev *pdev,
+const struct pci_device_id *ent);
 static void piix_pata_error_handler(struct ata_port *ap);
-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 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);
 #ifdef CONFIG_PM
 static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
@@ -650,9 

[git patches] libata fixes and checkpatch cleanups

2007-10-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 |   26 +++---
 drivers/ata/ata_piix.c |   29 +++---
 drivers/ata/libata-acpi.c  |   16 ++--
 drivers/ata/libata-core.c  |   69 +++--
 drivers/ata/libata-eh.c|   14 ++--
 drivers/ata/libata-scsi.c  |  240 ++--
 drivers/ata/libata-sff.c   |2 +-
 drivers/ata/pata_ns87415.c |   10 +-
 drivers/ata/sata_mv.c  |   23 ++--
 drivers/ata/sata_nv.c  |   68 ++---
 drivers/ata/sata_sx4.c |4 +-
 drivers/pci/quirks.c   |2 +-
 include/linux/ata.h|6 +-
 include/linux/libata.h |   22 ++--
 14 files changed, 265 insertions(+), 266 deletions(-)

Alan Cox (1):
  libata-core: auditting chk_status v check_status

Jeff Garzik (1):
  [libata] checkpatch-inspired cleanups

Tejun Heo (2):
  libata: add HTS542525K9SA00 to NCQ blacklist
  jmicron: update quirk for JMB361/3/5/6

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 47c8060..95229e7 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -227,7 +227,7 @@ struct ahci_port_priv {
 
 static int ahci_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val);
 static int ahci_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val);
-static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id 
*ent);
+static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id 
*ent);
 static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc);
 static void ahci_irq_clear(struct ata_port *ap);
 static int ahci_port_start(struct ata_port *ap);
@@ -729,7 +729,7 @@ static int ahci_stop_engine(struct ata_port *ap)
 
/* wait for engine to stop. This could be as long as 500 msec */
tmp = ata_wait_register(port_mmio + PORT_CMD,
-   PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500);
+   PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500);
if (tmp  PORT_CMD_LIST_ON)
return -EIO;
 
@@ -1564,9 +1564,9 @@ static irqreturn_t ahci_interrupt(int irq, void 
*dev_instance)
if (!irq_stat)
return IRQ_NONE;
 
-spin_lock(host-lock);
+   spin_lock(host-lock);
 
-for (i = 0; i  host-n_ports; i++) {
+   for (i = 0; i  host-n_ports; i++) {
struct ata_port *ap;
 
if (!(irq_stat  (1  i)))
@@ -1829,9 +1829,9 @@ static int ahci_port_start(struct ata_port *ap)
pp-cmd_tbl_dma = mem_dma;
 
/*
-* Save off initial list of interrupts to be enabled.
-* This could be changed later
-*/
+* Save off initial list of interrupts to be enabled.
+* This could be changed later
+*/
pp-intr_mask = DEF_PORT_IRQ;
 
ap-private_data = pp;
@@ -1918,12 +1918,12 @@ static void ahci_print_info(struct ata_host *host)
dev_printk(KERN_INFO, pdev-dev,
AHCI %02x%02x.%02x%02x 
%u slots %u ports %s Gbps 0x%x impl %s mode\n
-   ,
+   ,
 
-   (vers  24)  0xff,
-   (vers  16)  0xff,
-   (vers  8)  0xff,
-   vers  0xff,
+   (vers  24)  0xff,
+   (vers  16)  0xff,
+   (vers  8)  0xff,
+   vers  0xff,
 
((cap  8)  0x1f) + 1,
(cap  0x1f) + 1,
@@ -1935,7 +1935,7 @@ static void ahci_print_info(struct ata_host *host)
flags: 
%s%s%s%s%s%s%s
%s%s%s%s%s%s%s\n
-   ,
+   ,
 
cap  (1  31) ? 64bit  : ,
cap  (1  30) ? ncq  : ,
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 3c6f43e..a4b2cb2 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -157,12 +157,12 @@ struct piix_host_priv {
const int *map;
 };
 
-static int piix_init_one (struct pci_dev *pdev,
-   const struct pci_device_id *ent);
+static int piix_init_one(struct pci_dev *pdev,
+const struct pci_device_id *ent);
 static void piix_pata_error_handler(struct ata_port *ap);
-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 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);
 #ifdef CONFIG_PM
 static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
@@ -650,9 +650,9 @@ static int 

[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 
 
 #define DRV_NAME   "pata_cs5536"
-#define DRV_VERSION"0.0.5"
+#define DRV_VERSION"0.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 &= ~(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, );
 
-   pci_read_config_dword(pdev, cfg_addr, );
+   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, );
 
-   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, );
 
-
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/


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


[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 = >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, );
+   classes[0] = ata_dev_try_classify(>link.device[0],
+   devmask & (1 << 0), );
if (slave_possible && err != 0x81)
-   classes[1] = ata_dev_try_classify(ap, 1, );
+   classes[1] = 

[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(>dev, cs0->start, 0x1000);
data->cs1 = devm_ioremap(>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-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/


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


[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, );
 
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-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/


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


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


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


[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, 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, _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-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/


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


[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 
 
 #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 
 
 #define DRV_NAME   "ata_piix"
-#define DRV_VERSION"2.11"
+#define DRV_VERSION"2.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] = _map_db,
[ich6_sata] = _map_db,
[ich6_sata_ahci]= _map_db,
[ich6m_sata_ahci]   = _map_db,
[ich8_sata_ahci]= _map_db,
+   [tolapai_sata_ahci] = _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   = _pata_ops,
},
+
+   /* tolapai_sata_ahci: 11: 

[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(_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(_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 
 
 #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-kernel" in
the 

[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-kernel 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, , 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 
 
 #define DRV_NAME   "pata_artop"
-#define DRV_VERSION"0.4.3"
+#define DRV_VERSION"0.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   = _ops,
};
-   static const struct ata_port_info info_626x_fast = {
+   static const struct ata_port_info info_628x = {
.sht= _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   = _ops,
};
+   static const struct ata_port_info info_628x_fast = {
+   .sht= _sht,
+   .flags  = ATA_FLAG_SLAVE_POSS,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .mwdma_mask = 0x07, /* mwdma0-2 */
+   .udma_mask  = ATA_UDMA6,
+   .port_ops   = _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] = _626x;
-   else if (id->driver_data == 2)  { /* 6260 or 6260 + fast */
+   else if (id->driver_data == 2)  { /* 6280 or 6280 + fast */

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


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


[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, >dev, "failed to enable "
   

[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 

  1   2   3   >