Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29338
b: refs/heads/master
c: 122401c
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Garzik committed Oct 31, 2005
1 parent e0affbd commit 77f75fc
Show file tree
Hide file tree
Showing 22 changed files with 222 additions and 167 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 94ec1ef1cf29e137e5c79372e432b040c6604be6
refs/heads/master: 122401ce39faab22b29eb11b20e4342f7f566b1b
4 changes: 2 additions & 2 deletions trunk/drivers/pci/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static void piix4_mem_quirk(struct pci_dev *dev, const char *name, unsigned int
/*
* PIIX4 ACPI: Two IO regions pointed to by longwords at
* 0x40 (64 bytes of ACPI registers)
* 0x90 (32 bytes of SMB registers)
* 0x90 (16 bytes of SMB registers)
* and a few strange programmable PIIX4 device resources.
*/
static void __devinit quirk_piix4_acpi(struct pci_dev *dev)
Expand All @@ -366,7 +366,7 @@ static void __devinit quirk_piix4_acpi(struct pci_dev *dev)
pci_read_config_dword(dev, 0x40, &region);
quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES, "PIIX4 ACPI");
pci_read_config_dword(dev, 0x90, &region);
quirk_io_region(dev, region, 32, PCI_BRIDGE_RESOURCES+1, "PIIX4 SMB");
quirk_io_region(dev, region, 16, PCI_BRIDGE_RESOURCES+1, "PIIX4 SMB");

/* Device resource A has enables for some of the other ones */
pci_read_config_dword(dev, 0x5c, &res_a);
Expand Down
46 changes: 23 additions & 23 deletions trunk/drivers/scsi/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/dma-mapping.h>
#include <linux/device.h>
#include "scsi.h"
#include <scsi/scsi_host.h>
#include <linux/libata.h>
Expand Down Expand Up @@ -600,7 +601,7 @@ static void ahci_eng_timeout(struct ata_port *ap)
* not being called from the SCSI EH.
*/
qc->scsidone = scsi_finish_command;
ata_qc_complete(qc, ATA_ERR);
ata_qc_complete(qc, AC_ERR_OTHER);
}

spin_unlock_irqrestore(&host_set->lock, flags);
Expand Down Expand Up @@ -629,7 +630,7 @@ static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc)
if (status & PORT_IRQ_FATAL) {
ahci_intr_error(ap, status);
if (qc)
ata_qc_complete(qc, ATA_ERR);
ata_qc_complete(qc, AC_ERR_OTHER);
}

return 1;
Expand Down Expand Up @@ -674,21 +675,20 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
if (!ahci_host_intr(ap, qc))
if (ata_ratelimit()) {
struct pci_dev *pdev =
to_pci_dev(ap->host_set->dev);
printk(KERN_WARNING
"ahci(%s): unhandled interrupt on port %u\n",
pci_name(pdev), i);
to_pci_dev(ap->host_set->dev);
dev_printk(KERN_WARNING, &pdev->dev,
"unhandled interrupt on port %u\n",
i);
}

VPRINTK("port %u\n", i);
} else {
VPRINTK("port %u (no irq)\n", i);
if (ata_ratelimit()) {
struct pci_dev *pdev =
to_pci_dev(ap->host_set->dev);
printk(KERN_WARNING
"ahci(%s): interrupt on disabled port %u\n",
pci_name(pdev), i);
to_pci_dev(ap->host_set->dev);
dev_printk(KERN_WARNING, &pdev->dev,
"interrupt on disabled port %u\n", i);
}
}

Expand Down Expand Up @@ -760,8 +760,8 @@ static int ahci_host_init(struct ata_probe_ent *probe_ent)

tmp = readl(mmio + HOST_CTL);
if (tmp & HOST_RESET) {
printk(KERN_ERR DRV_NAME "(%s): controller reset failed (0x%x)\n",
pci_name(pdev), tmp);
dev_printk(KERN_ERR, &pdev->dev,
"controller reset failed (0x%x)\n", tmp);
return -EIO;
}

Expand Down Expand Up @@ -789,22 +789,22 @@ static int ahci_host_init(struct ata_probe_ent *probe_ent)
if (rc) {
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
printk(KERN_ERR DRV_NAME "(%s): 64-bit DMA enable failed\n",
pci_name(pdev));
dev_printk(KERN_ERR, &pdev->dev,
"64-bit DMA enable failed\n");
return rc;
}
}
} else {
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
printk(KERN_ERR DRV_NAME "(%s): 32-bit DMA enable failed\n",
pci_name(pdev));
dev_printk(KERN_ERR, &pdev->dev,
"32-bit DMA enable failed\n");
return rc;
}
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
printk(KERN_ERR DRV_NAME "(%s): 32-bit consistent DMA enable failed\n",
pci_name(pdev));
dev_printk(KERN_ERR, &pdev->dev,
"32-bit consistent DMA enable failed\n");
return rc;
}
}
Expand Down Expand Up @@ -907,10 +907,10 @@ static void ahci_print_info(struct ata_probe_ent *probe_ent)
else
scc_s = "unknown";

printk(KERN_INFO DRV_NAME "(%s) AHCI %02x%02x.%02x%02x "
dev_printk(KERN_INFO, &pdev->dev,
"AHCI %02x%02x.%02x%02x "
"%u slots %u ports %s Gbps 0x%x impl %s mode\n"
,
pci_name(pdev),

(vers >> 24) & 0xff,
(vers >> 16) & 0xff,
Expand All @@ -923,11 +923,11 @@ static void ahci_print_info(struct ata_probe_ent *probe_ent)
impl,
scc_s);

printk(KERN_INFO DRV_NAME "(%s) flags: "
dev_printk(KERN_INFO, &pdev->dev,
"flags: "
"%s%s%s%s%s%s"
"%s%s%s%s%s%s%s\n"
,
pci_name(pdev),

cap & (1 << 31) ? "64bit " : "",
cap & (1 << 30) ? "ncq " : "",
Expand Down Expand Up @@ -960,7 +960,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
VPRINTK("ENTER\n");

if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");

rc = pci_enable_device(pdev);
if (rc)
Expand Down
15 changes: 9 additions & 6 deletions trunk/drivers/scsi/ata_piix.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/device.h>
#include "scsi.h"
#include <scsi/scsi_host.h>
#include <linux/libata.h>
Expand Down Expand Up @@ -621,18 +622,19 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{
static int printed_version;
struct ata_port_info *port_info[2];
unsigned int combined = 0, n_ports = 1;
unsigned int combined = 0;
unsigned int pata_chan = 0, sata_chan = 0;

if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");

/* no hotplugging support (FIXME) */
if (!in_module_init)
return -ENODEV;

port_info[0] = &piix_port_info[ent->driver_data];
port_info[1] = NULL;
port_info[1] = &piix_port_info[ent->driver_data];

if (port_info[0]->host_flags & PIIX_FLAG_AHCI) {
u8 tmp;
Expand Down Expand Up @@ -670,12 +672,13 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
port_info[sata_chan] = &piix_port_info[ent->driver_data];
port_info[sata_chan]->host_flags |= ATA_FLAG_SLAVE_POSS;
port_info[pata_chan] = &piix_port_info[ich5_pata];
n_ports++;

printk(KERN_WARNING DRV_NAME ": combined mode detected\n");
dev_printk(KERN_WARNING, &pdev->dev,
"combined mode detected (p=%u, s=%u)\n",
pata_chan, sata_chan);
}

return ata_pci_init_one(pdev, port_info, n_ports);
return ata_pci_init_one(pdev, port_info, 2);
}

static int __init piix_init(void)
Expand Down
33 changes: 15 additions & 18 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2667,14 +2667,14 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
* None. (grabs host lock)
*/

void ata_poll_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
void ata_poll_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask)
{
struct ata_port *ap = qc->ap;
unsigned long flags;

spin_lock_irqsave(&ap->host_set->lock, flags);
ata_irq_on(ap);
ata_qc_complete(qc, drv_stat);
ata_qc_complete(qc, err_mask);
spin_unlock_irqrestore(&ap->host_set->lock, flags);
}

Expand Down Expand Up @@ -2771,7 +2771,7 @@ static int ata_pio_complete (struct ata_port *ap)

ap->hsm_task_state = HSM_ST_IDLE;

ata_poll_qc_complete(qc, drv_stat);
ata_poll_qc_complete(qc, 0);

/* another command may start at this point */

Expand Down Expand Up @@ -3266,18 +3266,15 @@ static void ata_pio_block(struct ata_port *ap)
static void ata_pio_error(struct ata_port *ap)
{
struct ata_queued_cmd *qc;
u8 drv_stat;

printk(KERN_WARNING "ata%u: PIO error\n", ap->id);

qc = ata_qc_from_tag(ap, ap->active_tag);
assert(qc != NULL);

drv_stat = ata_chk_status(ap);
printk(KERN_WARNING "ata%u: PIO error, drv_stat 0x%x\n",
ap->id, drv_stat);

ap->hsm_task_state = HSM_ST_IDLE;

ata_poll_qc_complete(qc, drv_stat | ATA_ERR);
ata_poll_qc_complete(qc, AC_ERR_ATA_BUS);
}

static void ata_pio_task(void *_data)
Expand Down Expand Up @@ -3402,7 +3399,7 @@ static void ata_qc_timeout(struct ata_queued_cmd *qc)
ap->hsm_task_state = HSM_ST_IDLE;

/* complete taskfile transaction */
ata_qc_complete(qc, drv_stat);
ata_qc_complete(qc, ac_err_mask(drv_stat));
break;
}

Expand Down Expand Up @@ -3507,7 +3504,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
return qc;
}

int ata_qc_complete_noop(struct ata_queued_cmd *qc, u8 drv_stat)
int ata_qc_complete_noop(struct ata_queued_cmd *qc, unsigned int err_mask)
{
return 0;
}
Expand Down Expand Up @@ -3566,7 +3563,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
* spin_lock_irqsave(host_set lock)
*/

void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
void ata_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask)
{
int rc;

Expand All @@ -3583,7 +3580,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
qc->flags &= ~ATA_QCFLAG_ACTIVE;

/* call completion callback */
rc = qc->complete_fn(qc, drv_stat);
rc = qc->complete_fn(qc, err_mask);

/* if callback indicates not to complete command (non-zero),
* return immediately
Expand Down Expand Up @@ -4169,7 +4166,7 @@ inline unsigned int ata_host_intr (struct ata_port *ap,
ap->hsm_task_state = HSM_ST_IDLE;

/* complete taskfile transaction */
ata_qc_complete(qc, status);
ata_qc_complete(qc, ac_err_mask(status));
break;

case HSM_ST_ERR:
Expand Down Expand Up @@ -4746,11 +4743,11 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int
return probe_ent;
}

static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, struct ata_port_info **port, int port_num)
static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, struct ata_port_info *port, int port_num)
{
struct ata_probe_ent *probe_ent;

probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[0]);
probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port);
if (!probe_ent)
return NULL;

Expand Down Expand Up @@ -4897,9 +4894,9 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,

if (legacy_mode) {
if (legacy_mode & (1 << 0))
probe_ent = ata_pci_init_legacy_port(pdev, port, 0);
probe_ent = ata_pci_init_legacy_port(pdev, port[0], 0);
if (legacy_mode & (1 << 1))
probe_ent2 = ata_pci_init_legacy_port(pdev, port, 1);
probe_ent2 = ata_pci_init_legacy_port(pdev, port[1], 1);
} else {
if (n_ports == 2)
probe_ent = ata_pci_init_native_mode(pdev, port, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
Expand Down
Loading

0 comments on commit 77f75fc

Please sign in to comment.