Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/jgarzik/libata-dev
  • Loading branch information
Linus Torvalds committed Oct 30, 2005
2 parents d3f8cf4 + a9524a7 commit 6e9d6b8
Show file tree
Hide file tree
Showing 19 changed files with 232 additions and 233 deletions.
55 changes: 23 additions & 32 deletions 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 @@ -192,7 +193,6 @@ static void ahci_port_stop(struct ata_port *ap);
static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
static void ahci_qc_prep(struct ata_queued_cmd *qc);
static u8 ahci_check_status(struct ata_port *ap);
static u8 ahci_check_err(struct ata_port *ap);
static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
static void ahci_remove_one (struct pci_dev *pdev);

Expand Down Expand Up @@ -221,7 +221,6 @@ static const struct ata_port_operations ahci_ops = {

.check_status = ahci_check_status,
.check_altstatus = ahci_check_status,
.check_err = ahci_check_err,
.dev_select = ata_noop_dev_select,

.tf_read = ahci_tf_read,
Expand Down Expand Up @@ -458,13 +457,6 @@ static u8 ahci_check_status(struct ata_port *ap)
return readl(mmio + PORT_TFDATA) & 0xFF;
}

static u8 ahci_check_err(struct ata_port *ap)
{
void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr;

return (readl(mmio + PORT_TFDATA) >> 8) & 0xFF;
}

static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
{
struct ahci_port_priv *pp = ap->private_data;
Expand Down Expand Up @@ -609,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 @@ -638,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 @@ -683,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 @@ -769,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 @@ -798,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 @@ -916,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 @@ -932,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 @@ -969,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 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
Loading

0 comments on commit 6e9d6b8

Please sign in to comment.