Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  ata: PATA_ARASAN_CF depends on DMADEVICES
  ata: remove unnecessary code
  [libata] Prevent warning during PMP error recovery
  ahci: RAID-mode SATA patch for Intel Panther Point DeviceIDs
  pata_it821x: Fix RAID type display, by adding missing comma
  sata_dwc_460ex: fix error path
  ahci: Enable SB600 64bit DMA on Asus M3A
  libata: report link resume failure as KERN_WARNING instead of ERR
  ahci: move ahci_sb600_softreset to libahci.c and rename it
  libata: leave port thawed after reset failure
  ata: sata_via: Use dev_dbg
  ata: Add and use ata_print_version_once
  ata: Convert ata_<foo>_printk(KERN_<LEVEL> to ata_<foo>_<level>
  ata: Convert dev_printk(KERN_<LEVEL> to dev_<level>(
This commit is contained in:
Linus Torvalds 2011-07-24 14:34:01 -07:00
commit f1f3b8eab7
67 changed files with 918 additions and 971 deletions

View file

@ -313,6 +313,7 @@ config PATA_AMD
config PATA_ARASAN_CF config PATA_ARASAN_CF
tristate "ARASAN CompactFlash PATA Controller Support" tristate "ARASAN CompactFlash PATA Controller Support"
depends on DMADEVICES
select DMA_ENGINE select DMA_ENGINE
help help
Say Y here to support the ARASAN CompactFlash PATA controller Say Y here to support the ARASAN CompactFlash PATA controller

View file

@ -135,8 +135,8 @@ static int acard_ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg
if (mesg.event & PM_EVENT_SUSPEND && if (mesg.event & PM_EVENT_SUSPEND &&
hpriv->flags & AHCI_HFLAG_NO_SUSPEND) { hpriv->flags & AHCI_HFLAG_NO_SUSPEND) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"BIOS update required for suspend/resume\n"); "BIOS update required for suspend/resume\n");
return -EIO; return -EIO;
} }
@ -187,7 +187,7 @@ static int acard_ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
if (rc) { if (rc) {
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"64-bit DMA enable failed\n"); "64-bit DMA enable failed\n");
return rc; return rc;
} }
@ -195,14 +195,13 @@ static int acard_ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
} else { } else {
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "32-bit DMA enable failed\n");
"32-bit DMA enable failed\n");
return rc; return rc;
} }
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"32-bit consistent DMA enable failed\n"); "32-bit consistent DMA enable failed\n");
return rc; return rc;
} }
} }
@ -343,14 +342,12 @@ static int acard_ahci_port_start(struct ata_port *ap)
if (cmd & PORT_CMD_FBSCP) if (cmd & PORT_CMD_FBSCP)
pp->fbs_supported = true; pp->fbs_supported = true;
else if (hpriv->flags & AHCI_HFLAG_YES_FBS) { else if (hpriv->flags & AHCI_HFLAG_YES_FBS) {
dev_printk(KERN_INFO, dev, dev_info(dev, "port %d can do FBS, forcing FBSCP\n",
"port %d can do FBS, forcing FBSCP\n", ap->port_no);
ap->port_no);
pp->fbs_supported = true; pp->fbs_supported = true;
} else } else
dev_printk(KERN_WARNING, dev, dev_warn(dev, "port %d is not capable of FBS\n",
"port %d is not capable of FBS\n", ap->port_no);
ap->port_no);
} }
if (pp->fbs_supported) { if (pp->fbs_supported) {
@ -406,7 +403,6 @@ static int acard_ahci_port_start(struct ata_port *ap)
static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
unsigned int board_id = ent->driver_data; unsigned int board_id = ent->driver_data;
struct ata_port_info pi = acard_ahci_port_info[board_id]; struct ata_port_info pi = acard_ahci_port_info[board_id];
const struct ata_port_info *ppi[] = { &pi, NULL }; const struct ata_port_info *ppi[] = { &pi, NULL };
@ -419,8 +415,7 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
WARN_ON((int)ATA_MAX_QUEUE > AHCI_MAX_CMDS); WARN_ON((int)ATA_MAX_QUEUE > AHCI_MAX_CMDS);
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* acquire resources */ /* acquire resources */
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);

View file

@ -79,8 +79,6 @@ enum board_ids {
}; };
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 int ahci_sb600_softreset(struct ata_link *link, unsigned int *class,
unsigned long deadline);
static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class, static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline); unsigned long deadline);
static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class, static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class,
@ -104,12 +102,6 @@ static struct ata_port_operations ahci_p5wdh_ops = {
.hardreset = ahci_p5wdh_hardreset, .hardreset = ahci_p5wdh_hardreset,
}; };
static struct ata_port_operations ahci_sb600_ops = {
.inherits = &ahci_ops,
.softreset = ahci_sb600_softreset,
.pmp_softreset = ahci_sb600_softreset,
};
#define AHCI_HFLAGS(flags) .private_data = (void *)(flags) #define AHCI_HFLAGS(flags) .private_data = (void *)(flags)
static const struct ata_port_info ahci_port_info[] = { static const struct ata_port_info ahci_port_info[] = {
@ -188,7 +180,7 @@ static const struct ata_port_info ahci_port_info[] = {
.flags = AHCI_FLAG_COMMON, .flags = AHCI_FLAG_COMMON,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
.udma_mask = ATA_UDMA6, .udma_mask = ATA_UDMA6,
.port_ops = &ahci_sb600_ops, .port_ops = &ahci_pmp_retry_srst_ops,
}, },
[board_ahci_sb700] = /* for SB700 and SB800 */ [board_ahci_sb700] = /* for SB700 and SB800 */
{ {
@ -196,7 +188,7 @@ static const struct ata_port_info ahci_port_info[] = {
.flags = AHCI_FLAG_COMMON, .flags = AHCI_FLAG_COMMON,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
.udma_mask = ATA_UDMA6, .udma_mask = ATA_UDMA6,
.port_ops = &ahci_sb600_ops, .port_ops = &ahci_pmp_retry_srst_ops,
}, },
[board_ahci_vt8251] = [board_ahci_vt8251] =
{ {
@ -267,6 +259,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x1e05), board_ahci }, /* Panther Point RAID */ { PCI_VDEVICE(INTEL, 0x1e05), board_ahci }, /* Panther Point RAID */
{ PCI_VDEVICE(INTEL, 0x1e06), board_ahci }, /* Panther Point RAID */ { PCI_VDEVICE(INTEL, 0x1e06), board_ahci }, /* Panther Point RAID */
{ PCI_VDEVICE(INTEL, 0x1e07), board_ahci }, /* Panther Point RAID */ { PCI_VDEVICE(INTEL, 0x1e07), board_ahci }, /* Panther Point RAID */
{ PCI_VDEVICE(INTEL, 0x1e0e), board_ahci }, /* Panther Point RAID */
/* JMicron 360/1/3/5/6, match class to avoid IDE function */ /* JMicron 360/1/3/5/6, match class to avoid IDE function */
{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
@ -502,55 +495,6 @@ static void ahci_pci_init_controller(struct ata_host *host)
ahci_init_controller(host); ahci_init_controller(host);
} }
static int ahci_sb600_check_ready(struct ata_link *link)
{
void __iomem *port_mmio = ahci_port_base(link->ap);
u8 status = readl(port_mmio + PORT_TFDATA) & 0xFF;
u32 irq_status = readl(port_mmio + PORT_IRQ_STAT);
/*
* There is no need to check TFDATA if BAD PMP is found due to HW bug,
* which can save timeout delay.
*/
if (irq_status & PORT_IRQ_BAD_PMP)
return -EIO;
return ata_check_ready(status);
}
static int ahci_sb600_softreset(struct ata_link *link, unsigned int *class,
unsigned long deadline)
{
struct ata_port *ap = link->ap;
void __iomem *port_mmio = ahci_port_base(ap);
int pmp = sata_srst_pmp(link);
int rc;
u32 irq_sts;
DPRINTK("ENTER\n");
rc = ahci_do_softreset(link, class, pmp, deadline,
ahci_sb600_check_ready);
/*
* Soft reset fails on some ATI chips with IPMS set when PMP
* is enabled but SATA HDD/ODD is connected to SATA port,
* do soft reset again to port 0.
*/
if (rc == -EIO) {
irq_sts = readl(port_mmio + PORT_IRQ_STAT);
if (irq_sts & PORT_IRQ_BAD_PMP) {
ata_link_printk(link, KERN_WARNING,
"applying SB600 PMP SRST workaround "
"and retrying\n");
rc = ahci_do_softreset(link, class, 0, deadline,
ahci_check_ready);
}
}
return rc;
}
static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class, static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline) unsigned long deadline)
{ {
@ -629,8 +573,8 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
if (mesg.event & PM_EVENT_SUSPEND && if (mesg.event & PM_EVENT_SUSPEND &&
hpriv->flags & AHCI_HFLAG_NO_SUSPEND) { hpriv->flags & AHCI_HFLAG_NO_SUSPEND) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"BIOS update required for suspend/resume\n"); "BIOS update required for suspend/resume\n");
return -EIO; return -EIO;
} }
@ -681,22 +625,21 @@ static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
if (rc) { if (rc) {
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"64-bit DMA enable failed\n"); "64-bit DMA enable failed\n");
return rc; return rc;
} }
} }
} else { } else {
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "32-bit DMA enable failed\n");
"32-bit DMA enable failed\n");
return rc; return rc;
} }
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"32-bit consistent DMA enable failed\n"); "32-bit consistent DMA enable failed\n");
return rc; return rc;
} }
} }
@ -759,8 +702,8 @@ static void ahci_p5wdh_workaround(struct ata_host *host)
dmi_check_system(sysids)) { dmi_check_system(sysids)) {
struct ata_port *ap = host->ports[1]; struct ata_port *ap = host->ports[1];
dev_printk(KERN_INFO, &pdev->dev, "enabling ASUS P5W DH " dev_info(&pdev->dev,
"Deluxe on-board SIMG4726 workaround\n"); "enabling ASUS P5W DH Deluxe on-board SIMG4726 workaround\n");
ap->ops = &ahci_p5wdh_ops; ap->ops = &ahci_p5wdh_ops;
ap->link.flags |= ATA_LFLAG_NO_SRST | ATA_LFLAG_ASSUME_ATA; ap->link.flags |= ATA_LFLAG_NO_SRST | ATA_LFLAG_ASSUME_ATA;
@ -811,6 +754,18 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev)
DMI_MATCH(DMI_BOARD_NAME, "MS-7376"), DMI_MATCH(DMI_BOARD_NAME, "MS-7376"),
}, },
}, },
/*
* All BIOS versions for the Asus M3A support 64bit DMA.
* (all release versions from 0301 to 1206 were tested)
*/
{
.ident = "ASUS M3A",
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR,
"ASUSTeK Computer INC."),
DMI_MATCH(DMI_BOARD_NAME, "M3A"),
},
},
{ } { }
}; };
const struct dmi_system_id *match; const struct dmi_system_id *match;
@ -831,14 +786,14 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev)
if (strcmp(buf, match->driver_data) >= 0) if (strcmp(buf, match->driver_data) >= 0)
goto enable_64bit; goto enable_64bit;
else { else {
dev_printk(KERN_WARNING, &pdev->dev, "%s: BIOS too old, " dev_warn(&pdev->dev,
"forcing 32bit DMA, update BIOS\n", match->ident); "%s: BIOS too old, forcing 32bit DMA, update BIOS\n",
match->ident);
return false; return false;
} }
enable_64bit: enable_64bit:
dev_printk(KERN_WARNING, &pdev->dev, "%s: enabling 64bit DMA\n", dev_warn(&pdev->dev, "%s: enabling 64bit DMA\n", match->ident);
match->ident);
return true; return true;
} }
@ -1041,9 +996,8 @@ static void ahci_gtf_filter_workaround(struct ata_host *host)
return; return;
filter = (unsigned long)dmi->driver_data; filter = (unsigned long)dmi->driver_data;
dev_printk(KERN_INFO, host->dev, dev_info(host->dev, "applying extra ACPI _GTF filter 0x%x for %s\n",
"applying extra ACPI _GTF filter 0x%x for %s\n", filter, dmi->ident);
filter, dmi->ident);
for (i = 0; i < host->n_ports; i++) { for (i = 0; i < host->n_ports; i++) {
struct ata_port *ap = host->ports[i]; struct ata_port *ap = host->ports[i];
@ -1062,7 +1016,6 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host)
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 int printed_version;
unsigned int board_id = ent->driver_data; unsigned int board_id = ent->driver_data;
struct ata_port_info pi = ahci_port_info[board_id]; struct ata_port_info pi = ahci_port_info[board_id];
const struct ata_port_info *ppi[] = { &pi, NULL }; const struct ata_port_info *ppi[] = { &pi, NULL };
@ -1075,8 +1028,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
WARN_ON((int)ATA_MAX_QUEUE > AHCI_MAX_CMDS); WARN_ON((int)ATA_MAX_QUEUE > AHCI_MAX_CMDS);
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* The AHCI driver can only drive the SATA ports, the PATA driver /* The AHCI driver can only drive the SATA ports, the PATA driver
can drive them all so if both drivers are selected make sure can drive them all so if both drivers are selected make sure
@ -1099,8 +1051,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
* that for SAS drives they're out of luck. * that for SAS drives they're out of luck.
*/ */
if (pdev->vendor == PCI_VENDOR_ID_PROMISE) if (pdev->vendor == PCI_VENDOR_ID_PROMISE)
dev_printk(KERN_INFO, &pdev->dev, "PDC42819 " dev_info(&pdev->dev,
"can only drive SATA devices with this driver\n"); "PDC42819 can only drive SATA devices with this driver\n");
/* acquire resources */ /* acquire resources */
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
@ -1126,8 +1078,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
*/ */
pci_read_config_byte(pdev, ICH_MAP, &map); pci_read_config_byte(pdev, ICH_MAP, &map);
if (map & 0x3) { if (map & 0x3) {
dev_printk(KERN_INFO, &pdev->dev, "controller is in " dev_info(&pdev->dev,
"combined mode, can't enable AHCI mode\n"); "controller is in combined mode, can't enable AHCI mode\n");
return -ENODEV; return -ENODEV;
} }
} }
@ -1184,8 +1136,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (ahci_broken_suspend(pdev)) { if (ahci_broken_suspend(pdev)) {
hpriv->flags |= AHCI_HFLAG_NO_SUSPEND; hpriv->flags |= AHCI_HFLAG_NO_SUSPEND;
dev_printk(KERN_WARNING, &pdev->dev, dev_warn(&pdev->dev,
"BIOS update required for suspend/resume\n"); "BIOS update required for suspend/resume\n");
} }
if (ahci_broken_online(pdev)) { if (ahci_broken_online(pdev)) {

View file

@ -312,6 +312,7 @@ extern struct device_attribute *ahci_sdev_attrs[];
.sdev_attrs = ahci_sdev_attrs .sdev_attrs = ahci_sdev_attrs
extern struct ata_port_operations ahci_ops; extern struct ata_port_operations ahci_ops;
extern struct ata_port_operations ahci_pmp_retry_srst_ops;
void ahci_fill_cmd_slot(struct ahci_port_priv *pp, unsigned int tag, void ahci_fill_cmd_slot(struct ahci_port_priv *pp, unsigned int tag,
u32 opts); u32 opts);

View file

@ -81,14 +81,13 @@ static int generic_set_mode(struct ata_link *link, struct ata_device **unused)
xfer_mask |= ata_xfer_mode2mask(XFER_MW_DMA_0); xfer_mask |= ata_xfer_mode2mask(XFER_MW_DMA_0);
} }
ata_dev_printk(dev, KERN_INFO, "configured for %s\n", ata_dev_info(dev, "configured for %s\n", name);
name);
dev->xfer_mode = ata_xfer_mask2mode(xfer_mask); dev->xfer_mode = ata_xfer_mask2mode(xfer_mask);
dev->xfer_shift = ata_xfer_mode2shift(dev->xfer_mode); dev->xfer_shift = ata_xfer_mode2shift(dev->xfer_mode);
dev->flags &= ~ATA_DFLAG_PIO; dev->flags &= ~ATA_DFLAG_PIO;
} else { } else {
ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); ata_dev_info(dev, "configured for PIO\n");
dev->xfer_mode = XFER_PIO_0; dev->xfer_mode = XFER_PIO_0;
dev->xfer_shift = ATA_SHIFT_PIO; dev->xfer_shift = ATA_SHIFT_PIO;
dev->flags |= ATA_DFLAG_PIO; dev->flags |= ATA_DFLAG_PIO;

View file

@ -1225,8 +1225,9 @@ static int piix_pci_device_resume(struct pci_dev *pdev)
*/ */
rc = pci_reenable_device(pdev); rc = pci_reenable_device(pdev);
if (rc) if (rc)
dev_printk(KERN_ERR, &pdev->dev, "failed to enable " dev_err(&pdev->dev,
"device after resume (%d)\n", rc); "failed to enable device after resume (%d)\n",
rc);
} else } else
rc = ata_pci_device_do_resume(pdev); rc = ata_pci_device_do_resume(pdev);
@ -1303,9 +1304,11 @@ static int __devinit piix_check_450nx_errata(struct pci_dev *ata_dev)
no_piix_dma = 2; no_piix_dma = 2;
} }
if (no_piix_dma) if (no_piix_dma)
dev_printk(KERN_WARNING, &ata_dev->dev, "450NX errata present, disabling IDE DMA.\n"); dev_warn(&ata_dev->dev,
if (no_piix_dma == 2) "450NX errata present, disabling IDE DMA%s\n",
dev_printk(KERN_WARNING, &ata_dev->dev, "A BIOS update may resolve this.\n"); no_piix_dma == 2 ? " - a BIOS update may resolve this"
: "");
return no_piix_dma; return no_piix_dma;
} }
@ -1338,37 +1341,36 @@ static const int *__devinit piix_init_sata_map(struct pci_dev *pdev,
map = map_db->map[map_value & map_db->mask]; map = map_db->map[map_value & map_db->mask];
dev_printk(KERN_INFO, &pdev->dev, "MAP ["); dev_info(&pdev->dev, "MAP [");
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
switch (map[i]) { switch (map[i]) {
case RV: case RV:
invalid_map = 1; invalid_map = 1;
printk(" XX"); pr_cont(" XX");
break; break;
case NA: case NA:
printk(" --"); pr_cont(" --");
break; break;
case IDE: case IDE:
WARN_ON((i & 1) || map[i + 1] != IDE); WARN_ON((i & 1) || map[i + 1] != IDE);
pinfo[i / 2] = piix_port_info[ich_pata_100]; pinfo[i / 2] = piix_port_info[ich_pata_100];
i++; i++;
printk(" IDE IDE"); pr_cont(" IDE IDE");
break; break;
default: default:
printk(" P%d", map[i]); pr_cont(" P%d", map[i]);
if (i & 1) if (i & 1)
pinfo[i / 2].flags |= ATA_FLAG_SLAVE_POSS; pinfo[i / 2].flags |= ATA_FLAG_SLAVE_POSS;
break; break;
} }
} }
printk(" ]\n"); pr_cont(" ]\n");
if (invalid_map) if (invalid_map)
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "invalid MAP value %u\n", map_value);
"invalid MAP value %u\n", map_value);
return map; return map;
} }
@ -1398,8 +1400,8 @@ static bool piix_no_sidpr(struct ata_host *host)
if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x2920 && if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x2920 &&
pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG && pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG &&
pdev->subsystem_device == 0xb049) { pdev->subsystem_device == 0xb049) {
dev_printk(KERN_WARNING, host->dev, dev_warn(host->dev,
"Samsung DB-P70 detected, disabling SIDPR\n"); "Samsung DB-P70 detected, disabling SIDPR\n");
return true; return true;
} }
@ -1451,8 +1453,8 @@ static int __devinit piix_init_sidpr(struct ata_host *host)
piix_sidpr_scr_read(link0, SCR_CONTROL, &scontrol); piix_sidpr_scr_read(link0, SCR_CONTROL, &scontrol);
if ((scontrol & 0xf00) != 0x300) { if ((scontrol & 0xf00) != 0x300) {
dev_printk(KERN_INFO, host->dev, "SCR access via " dev_info(host->dev,
"SIDPR is available but doesn't work\n"); "SCR access via SIDPR is available but doesn't work\n");
return 0; return 0;
} }
} }
@ -1501,8 +1503,7 @@ static void piix_iocfg_bit18_quirk(struct ata_host *host)
* affected systems. * affected systems.
*/ */
if (hpriv->saved_iocfg & (1 << 18)) { if (hpriv->saved_iocfg & (1 << 18)) {
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev, "applying IOCFG bit18 quirk\n");
"applying IOCFG bit18 quirk\n");
pci_write_config_dword(pdev, PIIX_IOCFG, pci_write_config_dword(pdev, PIIX_IOCFG,
hpriv->saved_iocfg & ~(1 << 18)); hpriv->saved_iocfg & ~(1 << 18));
} }
@ -1561,7 +1562,6 @@ static bool piix_broken_system_poweroff(struct pci_dev *pdev)
static int __devinit piix_init_one(struct pci_dev *pdev, static int __devinit piix_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
static int printed_version;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct ata_port_info port_info[2]; struct ata_port_info port_info[2];
const struct ata_port_info *ppi[] = { &port_info[0], &port_info[1] }; const struct ata_port_info *ppi[] = { &port_info[0], &port_info[1] };
@ -1571,9 +1571,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
struct piix_host_priv *hpriv; struct piix_host_priv *hpriv;
int rc; int rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
/* no hotplugging support for later devices (FIXME) */ /* no hotplugging support for later devices (FIXME) */
if (!in_module_init && ent->driver_data >= ich5_sata) if (!in_module_init && ent->driver_data >= ich5_sata)

View file

@ -82,6 +82,8 @@ static void ahci_pmp_attach(struct ata_port *ap);
static void ahci_pmp_detach(struct ata_port *ap); static void ahci_pmp_detach(struct ata_port *ap);
static int ahci_softreset(struct ata_link *link, unsigned int *class, static int ahci_softreset(struct ata_link *link, unsigned int *class,
unsigned long deadline); unsigned long deadline);
static int ahci_pmp_retry_softreset(struct ata_link *link, unsigned int *class,
unsigned long deadline);
static int ahci_hardreset(struct ata_link *link, unsigned int *class, static int ahci_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline); unsigned long deadline);
static void ahci_postreset(struct ata_link *link, unsigned int *class); static void ahci_postreset(struct ata_link *link, unsigned int *class);
@ -178,6 +180,12 @@ struct ata_port_operations ahci_ops = {
}; };
EXPORT_SYMBOL_GPL(ahci_ops); EXPORT_SYMBOL_GPL(ahci_ops);
struct ata_port_operations ahci_pmp_retry_srst_ops = {
.inherits = &ahci_ops,
.softreset = ahci_pmp_retry_softreset,
};
EXPORT_SYMBOL_GPL(ahci_pmp_retry_srst_ops);
int ahci_em_messages = 1; int ahci_em_messages = 1;
EXPORT_SYMBOL_GPL(ahci_em_messages); EXPORT_SYMBOL_GPL(ahci_em_messages);
module_param(ahci_em_messages, int, 0444); module_param(ahci_em_messages, int, 0444);
@ -286,10 +294,10 @@ static ssize_t ahci_read_em_buffer(struct device *dev,
/* the count should not be larger than PAGE_SIZE */ /* the count should not be larger than PAGE_SIZE */
if (count > PAGE_SIZE) { if (count > PAGE_SIZE) {
if (printk_ratelimit()) if (printk_ratelimit())
ata_port_printk(ap, KERN_WARNING, ata_port_warn(ap,
"EM read buffer size too large: " "EM read buffer size too large: "
"buffer size %u, page size %lu\n", "buffer size %u, page size %lu\n",
hpriv->em_buf_sz, PAGE_SIZE); hpriv->em_buf_sz, PAGE_SIZE);
count = PAGE_SIZE; count = PAGE_SIZE;
} }
@ -410,51 +418,46 @@ void ahci_save_initial_config(struct device *dev,
/* some chips have errata preventing 64bit use */ /* some chips have errata preventing 64bit use */
if ((cap & HOST_CAP_64) && (hpriv->flags & AHCI_HFLAG_32BIT_ONLY)) { if ((cap & HOST_CAP_64) && (hpriv->flags & AHCI_HFLAG_32BIT_ONLY)) {
dev_printk(KERN_INFO, dev, dev_info(dev, "controller can't do 64bit DMA, forcing 32bit\n");
"controller can't do 64bit DMA, forcing 32bit\n");
cap &= ~HOST_CAP_64; cap &= ~HOST_CAP_64;
} }
if ((cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_NO_NCQ)) { if ((cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_NO_NCQ)) {
dev_printk(KERN_INFO, dev, dev_info(dev, "controller can't do NCQ, turning off CAP_NCQ\n");
"controller can't do NCQ, turning off CAP_NCQ\n");
cap &= ~HOST_CAP_NCQ; cap &= ~HOST_CAP_NCQ;
} }
if (!(cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_YES_NCQ)) { if (!(cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_YES_NCQ)) {
dev_printk(KERN_INFO, dev, dev_info(dev, "controller can do NCQ, turning on CAP_NCQ\n");
"controller can do NCQ, turning on CAP_NCQ\n");
cap |= HOST_CAP_NCQ; cap |= HOST_CAP_NCQ;
} }
if ((cap & HOST_CAP_PMP) && (hpriv->flags & AHCI_HFLAG_NO_PMP)) { if ((cap & HOST_CAP_PMP) && (hpriv->flags & AHCI_HFLAG_NO_PMP)) {
dev_printk(KERN_INFO, dev, dev_info(dev, "controller can't do PMP, turning off CAP_PMP\n");
"controller can't do PMP, turning off CAP_PMP\n");
cap &= ~HOST_CAP_PMP; cap &= ~HOST_CAP_PMP;
} }
if ((cap & HOST_CAP_SNTF) && (hpriv->flags & AHCI_HFLAG_NO_SNTF)) { if ((cap & HOST_CAP_SNTF) && (hpriv->flags & AHCI_HFLAG_NO_SNTF)) {
dev_printk(KERN_INFO, dev, dev_info(dev,
"controller can't do SNTF, turning off CAP_SNTF\n"); "controller can't do SNTF, turning off CAP_SNTF\n");
cap &= ~HOST_CAP_SNTF; cap &= ~HOST_CAP_SNTF;
} }
if (!(cap & HOST_CAP_FBS) && (hpriv->flags & AHCI_HFLAG_YES_FBS)) { if (!(cap & HOST_CAP_FBS) && (hpriv->flags & AHCI_HFLAG_YES_FBS)) {
dev_printk(KERN_INFO, dev, dev_info(dev, "controller can do FBS, turning on CAP_FBS\n");
"controller can do FBS, turning on CAP_FBS\n");
cap |= HOST_CAP_FBS; cap |= HOST_CAP_FBS;
} }
if (force_port_map && port_map != force_port_map) { if (force_port_map && port_map != force_port_map) {
dev_printk(KERN_INFO, dev, "forcing port_map 0x%x -> 0x%x\n", dev_info(dev, "forcing port_map 0x%x -> 0x%x\n",
port_map, force_port_map); port_map, force_port_map);
port_map = force_port_map; port_map = force_port_map;
} }
if (mask_port_map) { if (mask_port_map) {
dev_printk(KERN_WARNING, dev, "masking port_map 0x%x -> 0x%x\n", dev_warn(dev, "masking port_map 0x%x -> 0x%x\n",
port_map, port_map,
port_map & mask_port_map); port_map & mask_port_map);
port_map &= mask_port_map; port_map &= mask_port_map;
} }
@ -470,10 +473,9 @@ void ahci_save_initial_config(struct device *dev,
* port_map and let it be generated from n_ports. * port_map and let it be generated from n_ports.
*/ */
if (map_ports > ahci_nr_ports(cap)) { if (map_ports > ahci_nr_ports(cap)) {
dev_printk(KERN_WARNING, dev, dev_warn(dev,
"implemented port map (0x%x) contains more " "implemented port map (0x%x) contains more ports than nr_ports (%u), using nr_ports\n",
"ports than nr_ports (%u), using nr_ports\n", port_map, ahci_nr_ports(cap));
port_map, ahci_nr_ports(cap));
port_map = 0; port_map = 0;
} }
} }
@ -481,8 +483,7 @@ void ahci_save_initial_config(struct device *dev,
/* fabricate port_map from cap.nr_ports */ /* fabricate port_map from cap.nr_ports */
if (!port_map) { if (!port_map) {
port_map = (1 << ahci_nr_ports(cap)) - 1; port_map = (1 << ahci_nr_ports(cap)) - 1;
dev_printk(KERN_WARNING, dev, dev_warn(dev, "forcing PORTS_IMPL to 0x%x\n", port_map);
"forcing PORTS_IMPL to 0x%x\n", port_map);
/* write the fixed up value to the PI register */ /* write the fixed up value to the PI register */
hpriv->saved_port_map = port_map; hpriv->saved_port_map = port_map;
@ -822,8 +823,8 @@ int ahci_reset_controller(struct ata_host *host)
HOST_RESET, 10, 1000); HOST_RESET, 10, 1000);
if (tmp & HOST_RESET) { if (tmp & HOST_RESET) {
dev_printk(KERN_ERR, host->dev, dev_err(host->dev, "controller reset failed (0x%x)\n",
"controller reset failed (0x%x)\n", tmp); tmp);
return -EIO; return -EIO;
} }
@ -835,8 +836,7 @@ int ahci_reset_controller(struct ata_host *host)
*/ */
ahci_restore_initial_config(host); ahci_restore_initial_config(host);
} else } else
dev_printk(KERN_INFO, host->dev, dev_info(host->dev, "skipping global host reset\n");
"skipping global host reset\n");
return 0; return 0;
} }
@ -1132,8 +1132,8 @@ static void ahci_dev_config(struct ata_device *dev)
if (hpriv->flags & AHCI_HFLAG_SECT255) { if (hpriv->flags & AHCI_HFLAG_SECT255) {
dev->max_sectors = 255; dev->max_sectors = 255;
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev,
"SB600 AHCI: limiting to 255 sectors per cmd\n"); "SB600 AHCI: limiting to 255 sectors per cmd\n");
} }
} }
@ -1257,8 +1257,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
/* prepare for SRST (AHCI-1.1 10.4.1) */ /* prepare for SRST (AHCI-1.1 10.4.1) */
rc = ahci_kick_engine(ap); rc = ahci_kick_engine(ap);
if (rc && rc != -EOPNOTSUPP) if (rc && rc != -EOPNOTSUPP)
ata_link_printk(link, KERN_WARNING, ata_link_warn(link, "failed to reset engine (errno=%d)\n", rc);
"failed to reset engine (errno=%d)\n", rc);
ata_tf_init(link->device, &tf); ata_tf_init(link->device, &tf);
@ -1291,8 +1290,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
* be trusted. Treat device readiness timeout as link * be trusted. Treat device readiness timeout as link
* offline. * offline.
*/ */
ata_link_printk(link, KERN_INFO, ata_link_info(link, "device not ready, treating as offline\n");
"device not ready, treating as offline\n");
*class = ATA_DEV_NONE; *class = ATA_DEV_NONE;
} else if (rc) { } else if (rc) {
/* link occupied, -ENODEV too is an error */ /* link occupied, -ENODEV too is an error */
@ -1305,7 +1303,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
return 0; return 0;
fail: fail:
ata_link_printk(link, KERN_ERR, "softreset failed (%s)\n", reason); ata_link_err(link, "softreset failed (%s)\n", reason);
return rc; return rc;
} }
@ -1329,6 +1327,55 @@ static int ahci_softreset(struct ata_link *link, unsigned int *class,
} }
EXPORT_SYMBOL_GPL(ahci_do_softreset); EXPORT_SYMBOL_GPL(ahci_do_softreset);
static int ahci_bad_pmp_check_ready(struct ata_link *link)
{
void __iomem *port_mmio = ahci_port_base(link->ap);
u8 status = readl(port_mmio + PORT_TFDATA) & 0xFF;
u32 irq_status = readl(port_mmio + PORT_IRQ_STAT);
/*
* There is no need to check TFDATA if BAD PMP is found due to HW bug,
* which can save timeout delay.
*/
if (irq_status & PORT_IRQ_BAD_PMP)
return -EIO;
return ata_check_ready(status);
}
int ahci_pmp_retry_softreset(struct ata_link *link, unsigned int *class,
unsigned long deadline)
{
struct ata_port *ap = link->ap;
void __iomem *port_mmio = ahci_port_base(ap);
int pmp = sata_srst_pmp(link);
int rc;
u32 irq_sts;
DPRINTK("ENTER\n");
rc = ahci_do_softreset(link, class, pmp, deadline,
ahci_bad_pmp_check_ready);
/*
* Soft reset fails with IPMS set when PMP is enabled but
* SATA HDD/ODD is connected to SATA port, do soft reset
* again to port 0.
*/
if (rc == -EIO) {
irq_sts = readl(port_mmio + PORT_IRQ_STAT);
if (irq_sts & PORT_IRQ_BAD_PMP) {
ata_link_printk(link, KERN_WARNING,
"applying PMP SRST workaround "
"and retrying\n");
rc = ahci_do_softreset(link, class, 0, deadline,
ahci_check_ready);
}
}
return rc;
}
static int ahci_hardreset(struct ata_link *link, unsigned int *class, static int ahci_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline) unsigned long deadline)
{ {
@ -1474,8 +1521,7 @@ static void ahci_fbs_dec_intr(struct ata_port *ap)
} }
if (fbs & PORT_FBS_DEC) if (fbs & PORT_FBS_DEC)
dev_printk(KERN_ERR, ap->host->dev, dev_err(ap->host->dev, "failed to clear device error\n");
"failed to clear device error\n");
} }
static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
@ -1713,8 +1759,8 @@ irqreturn_t ahci_interrupt(int irq, void *dev_instance)
} else { } else {
VPRINTK("port %u (no irq)\n", i); VPRINTK("port %u (no irq)\n", i);
if (ata_ratelimit()) if (ata_ratelimit())
dev_printk(KERN_WARNING, host->dev, dev_warn(host->dev,
"interrupt on disabled port %u\n", i); "interrupt on disabled port %u\n", i);
} }
handled = 1; handled = 1;
@ -1865,11 +1911,11 @@ static void ahci_enable_fbs(struct ata_port *ap)
writel(fbs | PORT_FBS_EN, port_mmio + PORT_FBS); writel(fbs | PORT_FBS_EN, port_mmio + PORT_FBS);
fbs = readl(port_mmio + PORT_FBS); fbs = readl(port_mmio + PORT_FBS);
if (fbs & PORT_FBS_EN) { if (fbs & PORT_FBS_EN) {
dev_printk(KERN_INFO, ap->host->dev, "FBS is enabled.\n"); dev_info(ap->host->dev, "FBS is enabled\n");
pp->fbs_enabled = true; pp->fbs_enabled = true;
pp->fbs_last_dev = -1; /* initialization */ pp->fbs_last_dev = -1; /* initialization */
} else } else
dev_printk(KERN_ERR, ap->host->dev, "Failed to enable FBS\n"); dev_err(ap->host->dev, "Failed to enable FBS\n");
ahci_start_engine(ap); ahci_start_engine(ap);
} }
@ -1897,9 +1943,9 @@ static void ahci_disable_fbs(struct ata_port *ap)
writel(fbs & ~PORT_FBS_EN, port_mmio + PORT_FBS); writel(fbs & ~PORT_FBS_EN, port_mmio + PORT_FBS);
fbs = readl(port_mmio + PORT_FBS); fbs = readl(port_mmio + PORT_FBS);
if (fbs & PORT_FBS_EN) if (fbs & PORT_FBS_EN)
dev_printk(KERN_ERR, ap->host->dev, "Failed to disable FBS\n"); dev_err(ap->host->dev, "Failed to disable FBS\n");
else { else {
dev_printk(KERN_INFO, ap->host->dev, "FBS is disabled.\n"); dev_info(ap->host->dev, "FBS is disabled\n");
pp->fbs_enabled = false; pp->fbs_enabled = false;
} }
@ -1975,7 +2021,7 @@ static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg)
if (rc == 0) if (rc == 0)
ahci_power_down(ap); ahci_power_down(ap);
else { else {
ata_port_printk(ap, KERN_ERR, "%s (%d)\n", emsg, rc); ata_port_err(ap, "%s (%d)\n", emsg, rc);
ahci_start_port(ap); ahci_start_port(ap);
} }
@ -2003,14 +2049,12 @@ static int ahci_port_start(struct ata_port *ap)
if (cmd & PORT_CMD_FBSCP) if (cmd & PORT_CMD_FBSCP)
pp->fbs_supported = true; pp->fbs_supported = true;
else if (hpriv->flags & AHCI_HFLAG_YES_FBS) { else if (hpriv->flags & AHCI_HFLAG_YES_FBS) {
dev_printk(KERN_INFO, dev, dev_info(dev, "port %d can do FBS, forcing FBSCP\n",
"port %d can do FBS, forcing FBSCP\n", ap->port_no);
ap->port_no);
pp->fbs_supported = true; pp->fbs_supported = true;
} else } else
dev_printk(KERN_WARNING, dev, dev_warn(dev, "port %d is not capable of FBS\n",
"port %d is not capable of FBS\n", ap->port_no);
ap->port_no);
} }
if (pp->fbs_supported) { if (pp->fbs_supported) {
@ -2072,7 +2116,7 @@ static void ahci_port_stop(struct ata_port *ap)
/* de-initialize port */ /* de-initialize port */
rc = ahci_deinit_port(ap, &emsg); rc = ahci_deinit_port(ap, &emsg);
if (rc) if (rc)
ata_port_printk(ap, KERN_WARNING, "%s (%d)\n", emsg, rc); ata_port_warn(ap, "%s (%d)\n", emsg, rc);
} }
void ahci_print_info(struct ata_host *host, const char *scc_s) void ahci_print_info(struct ata_host *host, const char *scc_s)

View file

@ -332,25 +332,22 @@ int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *gtm)
rc = -EINVAL; rc = -EINVAL;
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ata_port_printk(ap, KERN_ERR, ata_port_err(ap, "ACPI get timing mode failed (AE 0x%x)\n",
"ACPI get timing mode failed (AE 0x%x)\n", status);
status);
goto out_free; goto out_free;
} }
out_obj = output.pointer; out_obj = output.pointer;
if (out_obj->type != ACPI_TYPE_BUFFER) { if (out_obj->type != ACPI_TYPE_BUFFER) {
ata_port_printk(ap, KERN_WARNING, ata_port_warn(ap, "_GTM returned unexpected object type 0x%x\n",
"_GTM returned unexpected object type 0x%x\n", out_obj->type);
out_obj->type);
goto out_free; goto out_free;
} }
if (out_obj->buffer.length != sizeof(struct ata_acpi_gtm)) { if (out_obj->buffer.length != sizeof(struct ata_acpi_gtm)) {
ata_port_printk(ap, KERN_ERR, ata_port_err(ap, "_GTM returned invalid length %d\n",
"_GTM returned invalid length %d\n", out_obj->buffer.length);
out_obj->buffer.length);
goto out_free; goto out_free;
} }
@ -402,8 +399,8 @@ int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm)
if (status == AE_NOT_FOUND) if (status == AE_NOT_FOUND)
return -ENOENT; return -ENOENT;
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ata_port_printk(ap, KERN_ERR, ata_port_err(ap, "ACPI set timing mode failed (status=0x%x)\n",
"ACPI set timing mode failed (status=0x%x)\n", status); status);
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
@ -450,8 +447,8 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
output.pointer = NULL; /* ACPI-CA sets this; save/free it later */ output.pointer = NULL; /* ACPI-CA sets this; save/free it later */
if (ata_msg_probe(ap)) if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n", ata_dev_dbg(dev, "%s: ENTER: port#: %d\n",
__func__, ap->port_no); __func__, ap->port_no);
/* _GTF has no input parameters */ /* _GTF has no input parameters */
status = acpi_evaluate_object(dev->acpi_handle, "_GTF", NULL, &output); status = acpi_evaluate_object(dev->acpi_handle, "_GTF", NULL, &output);
@ -459,9 +456,8 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) { if (status != AE_NOT_FOUND) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "_GTF evaluation failed (AE 0x%x)\n",
"_GTF evaluation failed (AE 0x%x)\n", status);
status);
rc = -EINVAL; rc = -EINVAL;
} }
goto out_free; goto out_free;
@ -469,27 +465,24 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
if (!output.length || !output.pointer) { if (!output.length || !output.pointer) {
if (ata_msg_probe(ap)) if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: Run _GTF: " ata_dev_dbg(dev, "%s: Run _GTF: length or ptr is NULL (0x%llx, 0x%p)\n",
"length or ptr is NULL (0x%llx, 0x%p)\n", __func__,
__func__, (unsigned long long)output.length,
(unsigned long long)output.length, output.pointer);
output.pointer);
rc = -EINVAL; rc = -EINVAL;
goto out_free; goto out_free;
} }
if (out_obj->type != ACPI_TYPE_BUFFER) { if (out_obj->type != ACPI_TYPE_BUFFER) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "_GTF unexpected object type 0x%x\n",
"_GTF unexpected object type 0x%x\n", out_obj->type);
out_obj->type);
rc = -EINVAL; rc = -EINVAL;
goto out_free; goto out_free;
} }
if (out_obj->buffer.length % REGS_PER_GTF) { if (out_obj->buffer.length % REGS_PER_GTF) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "unexpected _GTF length (%d)\n",
"unexpected _GTF length (%d)\n", out_obj->buffer.length);
out_obj->buffer.length);
rc = -EINVAL; rc = -EINVAL;
goto out_free; goto out_free;
} }
@ -499,9 +492,8 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
if (gtf) { if (gtf) {
*gtf = (void *)out_obj->buffer.pointer; *gtf = (void *)out_obj->buffer.pointer;
if (ata_msg_probe(ap)) if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, ata_dev_dbg(dev, "%s: returning gtf=%p, gtf_count=%d\n",
"%s: returning gtf=%p, gtf_count=%d\n", __func__, *gtf, rc);
__func__, *gtf, rc);
} }
return rc; return rc;
@ -811,8 +803,8 @@ static int ata_acpi_push_id(struct ata_device *dev)
union acpi_object in_params[1]; union acpi_object in_params[1];
if (ata_msg_probe(ap)) if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: ix = %d, port#: %d\n", ata_dev_dbg(dev, "%s: ix = %d, port#: %d\n",
__func__, dev->devno, ap->port_no); __func__, dev->devno, ap->port_no);
/* Give the drive Identify data to the drive via the _SDD method */ /* Give the drive Identify data to the drive via the _SDD method */
/* _SDD: set up input parameters */ /* _SDD: set up input parameters */
@ -832,8 +824,7 @@ static int ata_acpi_push_id(struct ata_device *dev)
return -ENOENT; return -ENOENT;
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "ACPI _SDD failed (AE 0x%x)\n", status);
"ACPI _SDD failed (AE 0x%x)\n", status);
return -EIO; return -EIO;
} }
@ -983,8 +974,8 @@ int ata_acpi_on_devcfg(struct ata_device *dev)
if (nr_executed) { if (nr_executed) {
rc = ata_dev_reread_id(dev, 0); rc = ata_dev_reread_id(dev, 0);
if (rc < 0) { if (rc < 0) {
ata_dev_printk(dev, KERN_ERR, "failed to IDENTIFY " ata_dev_err(dev,
"after ACPI commands\n"); "failed to IDENTIFY after ACPI commands\n");
return rc; return rc;
} }
} }
@ -1002,8 +993,7 @@ int ata_acpi_on_devcfg(struct ata_device *dev)
return rc; return rc;
} }
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "ACPI: failed the second time, disabled\n");
"ACPI: failed the second time, disabled\n");
dev->acpi_handle = NULL; dev->acpi_handle = NULL;
/* We can safely continue if no _GTF command has been executed /* We can safely continue if no _GTF command has been executed

View file

@ -335,8 +335,7 @@ void ata_force_cbl(struct ata_port *ap)
continue; continue;
ap->cbl = fe->param.cbl; ap->cbl = fe->param.cbl;
ata_port_printk(ap, KERN_NOTICE, ata_port_notice(ap, "FORCE: cable set to %s\n", fe->param.name);
"FORCE: cable set to %s\n", fe->param.name);
return; return;
} }
} }
@ -378,8 +377,7 @@ static void ata_force_link_limits(struct ata_link *link)
/* only honor the first spd limit */ /* only honor the first spd limit */
if (!did_spd && fe->param.spd_limit) { if (!did_spd && fe->param.spd_limit) {
link->hw_sata_spd_limit = (1 << fe->param.spd_limit) - 1; link->hw_sata_spd_limit = (1 << fe->param.spd_limit) - 1;
ata_link_printk(link, KERN_NOTICE, ata_link_notice(link, "FORCE: PHY spd limit set to %s\n",
"FORCE: PHY spd limit set to %s\n",
fe->param.name); fe->param.name);
did_spd = true; did_spd = true;
} }
@ -387,7 +385,7 @@ static void ata_force_link_limits(struct ata_link *link)
/* let lflags stack */ /* let lflags stack */
if (fe->param.lflags) { if (fe->param.lflags) {
link->flags |= fe->param.lflags; link->flags |= fe->param.lflags;
ata_link_printk(link, KERN_NOTICE, ata_link_notice(link,
"FORCE: link flag 0x%x forced -> 0x%x\n", "FORCE: link flag 0x%x forced -> 0x%x\n",
fe->param.lflags, link->flags); fe->param.lflags, link->flags);
} }
@ -442,8 +440,8 @@ static void ata_force_xfermask(struct ata_device *dev)
dev->pio_mask = pio_mask; dev->pio_mask = pio_mask;
} }
ata_dev_printk(dev, KERN_NOTICE, ata_dev_notice(dev, "FORCE: xfer_mask set to %s\n",
"FORCE: xfer_mask set to %s\n", fe->param.name); fe->param.name);
return; return;
} }
} }
@ -486,8 +484,8 @@ static void ata_force_horkage(struct ata_device *dev)
dev->horkage |= fe->param.horkage_on; dev->horkage |= fe->param.horkage_on;
dev->horkage &= ~fe->param.horkage_off; dev->horkage &= ~fe->param.horkage_off;
ata_dev_printk(dev, KERN_NOTICE, ata_dev_notice(dev, "FORCE: horkage modified (%s)\n",
"FORCE: horkage modified (%s)\n", fe->param.name); fe->param.name);
} }
} }
@ -711,8 +709,8 @@ u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev)
sect = tf->lbal; sect = tf->lbal;
if (!sect) { if (!sect) {
ata_dev_printk(dev, KERN_WARNING, "device reported " ata_dev_warn(dev,
"invalid CHS sector 0\n"); "device reported invalid CHS sector 0\n");
sect = 1; /* oh well */ sect = 1; /* oh well */
} }
@ -1230,8 +1228,9 @@ static int ata_read_native_max_address(struct ata_device *dev, u64 *max_sectors)
err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
if (err_mask) { if (err_mask) {
ata_dev_printk(dev, KERN_WARNING, "failed to read native " ata_dev_warn(dev,
"max address (err_mask=0x%x)\n", err_mask); "failed to read native max address (err_mask=0x%x)\n",
err_mask);
if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED)) if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED))
return -EACCES; return -EACCES;
return -EIO; return -EIO;
@ -1292,8 +1291,9 @@ static int ata_set_max_sectors(struct ata_device *dev, u64 new_sectors)
err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
if (err_mask) { if (err_mask) {
ata_dev_printk(dev, KERN_WARNING, "failed to set " ata_dev_warn(dev,
"max address (err_mask=0x%x)\n", err_mask); "failed to set max address (err_mask=0x%x)\n",
err_mask);
if (err_mask == AC_ERR_DEV && if (err_mask == AC_ERR_DEV &&
(tf.feature & (ATA_ABORTED | ATA_IDNF))) (tf.feature & (ATA_ABORTED | ATA_IDNF)))
return -EACCES; return -EACCES;
@ -1336,8 +1336,8 @@ static int ata_hpa_resize(struct ata_device *dev)
* be unlocked, skip HPA resizing. * be unlocked, skip HPA resizing.
*/ */
if (rc == -EACCES || !unlock_hpa) { if (rc == -EACCES || !unlock_hpa) {
ata_dev_printk(dev, KERN_WARNING, "HPA support seems " ata_dev_warn(dev,
"broken, skipping HPA handling\n"); "HPA support seems broken, skipping HPA handling\n");
dev->horkage |= ATA_HORKAGE_BROKEN_HPA; dev->horkage |= ATA_HORKAGE_BROKEN_HPA;
/* we can continue if device aborted the command */ /* we can continue if device aborted the command */
@ -1355,14 +1355,13 @@ static int ata_hpa_resize(struct ata_device *dev)
return 0; return 0;
if (native_sectors > sectors) if (native_sectors > sectors)
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev,
"HPA detected: current %llu, native %llu\n", "HPA detected: current %llu, native %llu\n",
(unsigned long long)sectors, (unsigned long long)sectors,
(unsigned long long)native_sectors); (unsigned long long)native_sectors);
else if (native_sectors < sectors) else if (native_sectors < sectors)
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"native sectors (%llu) is smaller than " "native sectors (%llu) is smaller than sectors (%llu)\n",
"sectors (%llu)\n",
(unsigned long long)native_sectors, (unsigned long long)native_sectors,
(unsigned long long)sectors); (unsigned long long)sectors);
return 0; return 0;
@ -1372,10 +1371,10 @@ static int ata_hpa_resize(struct ata_device *dev)
rc = ata_set_max_sectors(dev, native_sectors); rc = ata_set_max_sectors(dev, native_sectors);
if (rc == -EACCES) { if (rc == -EACCES) {
/* if device aborted the command, skip HPA resizing */ /* if device aborted the command, skip HPA resizing */
ata_dev_printk(dev, KERN_WARNING, "device aborted resize " ata_dev_warn(dev,
"(%llu -> %llu), skipping HPA handling\n", "device aborted resize (%llu -> %llu), skipping HPA handling\n",
(unsigned long long)sectors, (unsigned long long)sectors,
(unsigned long long)native_sectors); (unsigned long long)native_sectors);
dev->horkage |= ATA_HORKAGE_BROKEN_HPA; dev->horkage |= ATA_HORKAGE_BROKEN_HPA;
return 0; return 0;
} else if (rc) } else if (rc)
@ -1384,14 +1383,14 @@ static int ata_hpa_resize(struct ata_device *dev)
/* re-read IDENTIFY data */ /* re-read IDENTIFY data */
rc = ata_dev_reread_id(dev, 0); rc = ata_dev_reread_id(dev, 0);
if (rc) { if (rc) {
ata_dev_printk(dev, KERN_ERR, "failed to re-read IDENTIFY " ata_dev_err(dev,
"data after HPA resizing\n"); "failed to re-read IDENTIFY data after HPA resizing\n");
return rc; return rc;
} }
if (print_info) { if (print_info) {
u64 new_sectors = ata_id_n_sectors(dev->id); u64 new_sectors = ata_id_n_sectors(dev->id);
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev,
"HPA unlocked: %llu -> %llu, native %llu\n", "HPA unlocked: %llu -> %llu, native %llu\n",
(unsigned long long)sectors, (unsigned long long)sectors,
(unsigned long long)new_sectors, (unsigned long long)new_sectors,
@ -1655,8 +1654,8 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
ata_qc_complete(qc); ata_qc_complete(qc);
if (ata_msg_warn(ap)) if (ata_msg_warn(ap))
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "qc timeout (cmd 0x%x)\n",
"qc timeout (cmd 0x%x)\n", command); command);
} }
spin_unlock_irqrestore(ap->lock, flags); spin_unlock_irqrestore(ap->lock, flags);
@ -1870,7 +1869,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
int rc; int rc;
if (ata_msg_ctl(ap)) if (ata_msg_ctl(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __func__); ata_dev_dbg(dev, "%s: ENTER\n", __func__);
retry: retry:
ata_tf_init(dev, &tf); ata_tf_init(dev, &tf);
@ -1909,14 +1908,13 @@ retry:
if (err_mask) { if (err_mask) {
if (err_mask & AC_ERR_NODEV_HINT) { if (err_mask & AC_ERR_NODEV_HINT) {
ata_dev_printk(dev, KERN_DEBUG, ata_dev_dbg(dev, "NODEV after polling detection\n");
"NODEV after polling detection\n");
return -ENOENT; return -ENOENT;
} }
if (is_semb) { if (is_semb) {
ata_dev_printk(dev, KERN_INFO, "IDENTIFY failed on " ata_dev_info(dev,
"device w/ SEMB sig, disabled\n"); "IDENTIFY failed on device w/ SEMB sig, disabled\n");
/* SEMB is not supported yet */ /* SEMB is not supported yet */
*p_class = ATA_DEV_SEMB_UNSUP; *p_class = ATA_DEV_SEMB_UNSUP;
return 0; return 0;
@ -1942,8 +1940,8 @@ retry:
* both flavors of IDENTIFYs which happens * both flavors of IDENTIFYs which happens
* sometimes with phantom devices. * sometimes with phantom devices.
*/ */
ata_dev_printk(dev, KERN_DEBUG, ata_dev_dbg(dev,
"both IDENTIFYs aborted, assuming NODEV\n"); "both IDENTIFYs aborted, assuming NODEV\n");
return -ENOENT; return -ENOENT;
} }
@ -1953,9 +1951,9 @@ retry:
} }
if (dev->horkage & ATA_HORKAGE_DUMP_ID) { if (dev->horkage & ATA_HORKAGE_DUMP_ID) {
ata_dev_printk(dev, KERN_DEBUG, "dumping IDENTIFY data, " ata_dev_dbg(dev, "dumping IDENTIFY data, "
"class=%d may_fallback=%d tried_spinup=%d\n", "class=%d may_fallback=%d tried_spinup=%d\n",
class, may_fallback, tried_spinup); class, may_fallback, tried_spinup);
print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET,
16, 2, id, ATA_ID_WORDS * sizeof(*id), true); 16, 2, id, ATA_ID_WORDS * sizeof(*id), true);
} }
@ -2034,8 +2032,8 @@ retry:
err_out: err_out:
if (ata_msg_warn(ap)) if (ata_msg_warn(ap))
ata_dev_printk(dev, KERN_WARNING, "failed to IDENTIFY " ata_dev_warn(dev, "failed to IDENTIFY (%s, err_mask=0x%x)\n",
"(%s, err_mask=0x%x)\n", reason, err_mask); reason, err_mask);
return rc; return rc;
} }
@ -2065,9 +2063,8 @@ static int ata_do_link_spd_horkage(struct ata_device *dev)
* guaranteed by setting sata_spd_limit to target_limit above. * guaranteed by setting sata_spd_limit to target_limit above.
*/ */
if (plink->sata_spd > target) { if (plink->sata_spd > target) {
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev, "applying link speed limit horkage to %s\n",
"applying link speed limit horkage to %s\n", sata_spd_string(target));
sata_spd_string(target));
return -EAGAIN; return -EAGAIN;
} }
return 0; return 0;
@ -2110,8 +2107,9 @@ static int ata_dev_config_ncq(struct ata_device *dev,
err_mask = ata_dev_set_feature(dev, SETFEATURES_SATA_ENABLE, err_mask = ata_dev_set_feature(dev, SETFEATURES_SATA_ENABLE,
SATA_FPDMA_AA); SATA_FPDMA_AA);
if (err_mask) { if (err_mask) {
ata_dev_printk(dev, KERN_ERR, "failed to enable AA" ata_dev_err(dev,
"(error_mask=0x%x)\n", err_mask); "failed to enable AA (error_mask=0x%x)\n",
err_mask);
if (err_mask != AC_ERR_DEV) { if (err_mask != AC_ERR_DEV) {
dev->horkage |= ATA_HORKAGE_BROKEN_FPDMA_AA; dev->horkage |= ATA_HORKAGE_BROKEN_FPDMA_AA;
return -EIO; return -EIO;
@ -2154,31 +2152,28 @@ int ata_dev_configure(struct ata_device *dev)
int rc; int rc;
if (!ata_dev_enabled(dev) && ata_msg_info(ap)) { if (!ata_dev_enabled(dev) && ata_msg_info(ap)) {
ata_dev_printk(dev, KERN_INFO, "%s: ENTER/EXIT -- nodev\n", ata_dev_info(dev, "%s: ENTER/EXIT -- nodev\n", __func__);
__func__);
return 0; return 0;
} }
if (ata_msg_probe(ap)) if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __func__); ata_dev_dbg(dev, "%s: ENTER\n", __func__);
/* set horkage */ /* set horkage */
dev->horkage |= ata_dev_blacklisted(dev); dev->horkage |= ata_dev_blacklisted(dev);
ata_force_horkage(dev); ata_force_horkage(dev);
if (dev->horkage & ATA_HORKAGE_DISABLE) { if (dev->horkage & ATA_HORKAGE_DISABLE) {
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev, "unsupported device, disabling\n");
"unsupported device, disabling\n");
ata_dev_disable(dev); ata_dev_disable(dev);
return 0; return 0;
} }
if ((!atapi_enabled || (ap->flags & ATA_FLAG_NO_ATAPI)) && if ((!atapi_enabled || (ap->flags & ATA_FLAG_NO_ATAPI)) &&
dev->class == ATA_DEV_ATAPI) { dev->class == ATA_DEV_ATAPI) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "WARNING: ATAPI is %s, device ignored\n",
"WARNING: ATAPI is %s, device ignored.\n", atapi_enabled ? "not supported with this driver"
atapi_enabled ? "not supported with this driver" : "disabled");
: "disabled");
ata_dev_disable(dev); ata_dev_disable(dev);
return 0; return 0;
} }
@ -2199,12 +2194,12 @@ int ata_dev_configure(struct ata_device *dev)
/* print device capabilities */ /* print device capabilities */
if (ata_msg_probe(ap)) if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, ata_dev_dbg(dev,
"%s: cfg 49:%04x 82:%04x 83:%04x 84:%04x " "%s: cfg 49:%04x 82:%04x 83:%04x 84:%04x "
"85:%04x 86:%04x 87:%04x 88:%04x\n", "85:%04x 86:%04x 87:%04x 88:%04x\n",
__func__, __func__,
id[49], id[82], id[83], id[84], id[49], id[82], id[83], id[84],
id[85], id[86], id[87], id[88]); id[85], id[86], id[87], id[88]);
/* initialize to-be-configured parameters */ /* initialize to-be-configured parameters */
dev->flags &= ~ATA_DFLAG_CFG_MASK; dev->flags &= ~ATA_DFLAG_CFG_MASK;
@ -2238,17 +2233,15 @@ int ata_dev_configure(struct ata_device *dev)
if (ata_id_is_cfa(id)) { if (ata_id_is_cfa(id)) {
/* CPRM may make this media unusable */ /* CPRM may make this media unusable */
if (id[ATA_ID_CFA_KEY_MGMT] & 1) if (id[ATA_ID_CFA_KEY_MGMT] & 1)
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"supports DRM functions and may " "supports DRM functions and may not be fully accessible\n");
"not be fully accessible.\n");
snprintf(revbuf, 7, "CFA"); snprintf(revbuf, 7, "CFA");
} else { } else {
snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id)); snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id));
/* Warn the user if the device has TPM extensions */ /* Warn the user if the device has TPM extensions */
if (ata_id_has_tpm(id)) if (ata_id_has_tpm(id))
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"supports DRM functions and may " "supports DRM functions and may not be fully accessible\n");
"not be fully accessible.\n");
} }
dev->n_sectors = ata_id_n_sectors(id); dev->n_sectors = ata_id_n_sectors(id);
@ -2285,12 +2278,11 @@ int ata_dev_configure(struct ata_device *dev)
/* print device info to dmesg */ /* print device info to dmesg */
if (ata_msg_drv(ap) && print_info) { if (ata_msg_drv(ap) && print_info) {
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev, "%s: %s, %s, max %s\n",
"%s: %s, %s, max %s\n", revbuf, modelbuf, fwrevbuf,
revbuf, modelbuf, fwrevbuf, ata_mode_string(xfer_mask));
ata_mode_string(xfer_mask)); ata_dev_info(dev,
ata_dev_printk(dev, KERN_INFO, "%llu sectors, multi %u: %s %s\n",
"%Lu sectors, multi %u: %s %s\n",
(unsigned long long)dev->n_sectors, (unsigned long long)dev->n_sectors,
dev->multi_count, lba_desc, ncq_desc); dev->multi_count, lba_desc, ncq_desc);
} }
@ -2311,15 +2303,14 @@ int ata_dev_configure(struct ata_device *dev)
/* print device info to dmesg */ /* print device info to dmesg */
if (ata_msg_drv(ap) && print_info) { if (ata_msg_drv(ap) && print_info) {
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev, "%s: %s, %s, max %s\n",
"%s: %s, %s, max %s\n", revbuf, modelbuf, fwrevbuf,
revbuf, modelbuf, fwrevbuf, ata_mode_string(xfer_mask));
ata_mode_string(xfer_mask)); ata_dev_info(dev,
ata_dev_printk(dev, KERN_INFO, "%llu sectors, multi %u, CHS %u/%u/%u\n",
"%Lu sectors, multi %u, CHS %u/%u/%u\n", (unsigned long long)dev->n_sectors,
(unsigned long long)dev->n_sectors, dev->multi_count, dev->cylinders,
dev->multi_count, dev->cylinders, dev->heads, dev->sectors);
dev->heads, dev->sectors);
} }
} }
@ -2336,8 +2327,7 @@ int ata_dev_configure(struct ata_device *dev)
rc = atapi_cdb_len(id); rc = atapi_cdb_len(id);
if ((rc < 12) || (rc > ATAPI_CDB_LEN)) { if ((rc < 12) || (rc > ATAPI_CDB_LEN)) {
if (ata_msg_warn(ap)) if (ata_msg_warn(ap))
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "unsupported CDB len\n");
"unsupported CDB len\n");
rc = -EINVAL; rc = -EINVAL;
goto err_out_nosup; goto err_out_nosup;
} }
@ -2358,9 +2348,9 @@ int ata_dev_configure(struct ata_device *dev)
err_mask = ata_dev_set_feature(dev, err_mask = ata_dev_set_feature(dev,
SETFEATURES_SATA_ENABLE, SATA_AN); SETFEATURES_SATA_ENABLE, SATA_AN);
if (err_mask) if (err_mask)
ata_dev_printk(dev, KERN_ERR, ata_dev_err(dev,
"failed to enable ATAPI AN " "failed to enable ATAPI AN (err_mask=0x%x)\n",
"(err_mask=0x%x)\n", err_mask); err_mask);
else { else {
dev->flags |= ATA_DFLAG_AN; dev->flags |= ATA_DFLAG_AN;
atapi_an_string = ", ATAPI AN"; atapi_an_string = ", ATAPI AN";
@ -2379,12 +2369,12 @@ int ata_dev_configure(struct ata_device *dev)
/* print device info to dmesg */ /* print device info to dmesg */
if (ata_msg_drv(ap) && print_info) if (ata_msg_drv(ap) && print_info)
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev,
"ATAPI: %s, %s, max %s%s%s%s\n", "ATAPI: %s, %s, max %s%s%s%s\n",
modelbuf, fwrevbuf, modelbuf, fwrevbuf,
ata_mode_string(xfer_mask), ata_mode_string(xfer_mask),
cdb_intr_string, atapi_an_string, cdb_intr_string, atapi_an_string,
dma_dir_string); dma_dir_string);
} }
/* determine max_sectors */ /* determine max_sectors */
@ -2396,8 +2386,7 @@ int ata_dev_configure(struct ata_device *dev)
200 sectors */ 200 sectors */
if (ata_dev_knobble(dev)) { if (ata_dev_knobble(dev)) {
if (ata_msg_drv(ap) && print_info) if (ata_msg_drv(ap) && print_info)
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev, "applying bridge limits\n");
"applying bridge limits\n");
dev->udma_mask &= ATA_UDMA5; dev->udma_mask &= ATA_UDMA5;
dev->max_sectors = ATA_MAX_SECTORS; dev->max_sectors = ATA_MAX_SECTORS;
} }
@ -2423,26 +2412,23 @@ int ata_dev_configure(struct ata_device *dev)
bugs */ bugs */
if (print_info) { if (print_info) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"Drive reports diagnostics failure. This may indicate a drive\n"); "Drive reports diagnostics failure. This may indicate a drive\n");
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"fault or invalid emulation. Contact drive vendor for information.\n"); "fault or invalid emulation. Contact drive vendor for information.\n");
} }
} }
if ((dev->horkage & ATA_HORKAGE_FIRMWARE_WARN) && print_info) { if ((dev->horkage & ATA_HORKAGE_FIRMWARE_WARN) && print_info) {
ata_dev_printk(dev, KERN_WARNING, "WARNING: device requires " ata_dev_warn(dev, "WARNING: device requires firmware update to be fully functional\n");
"firmware update to be fully functional.\n"); ata_dev_warn(dev, " contact the vendor or visit http://ata.wiki.kernel.org\n");
ata_dev_printk(dev, KERN_WARNING, " contact the vendor "
"or visit http://ata.wiki.kernel.org.\n");
} }
return 0; return 0;
err_out_nosup: err_out_nosup:
if (ata_msg_probe(ap)) if (ata_msg_probe(ap))
ata_dev_printk(dev, KERN_DEBUG, ata_dev_dbg(dev, "%s: EXIT, err\n", __func__);
"%s: EXIT, err\n", __func__);
return rc; return rc;
} }
@ -2663,13 +2649,11 @@ static void sata_print_link_status(struct ata_link *link)
if (ata_phys_link_online(link)) { if (ata_phys_link_online(link)) {
tmp = (sstatus >> 4) & 0xf; tmp = (sstatus >> 4) & 0xf;
ata_link_printk(link, KERN_INFO, ata_link_info(link, "SATA link up %s (SStatus %X SControl %X)\n",
"SATA link up %s (SStatus %X SControl %X)\n", sata_spd_string(tmp), sstatus, scontrol);
sata_spd_string(tmp), sstatus, scontrol);
} else { } else {
ata_link_printk(link, KERN_INFO, ata_link_info(link, "SATA link down (SStatus %X SControl %X)\n",
"SATA link down (SStatus %X SControl %X)\n", sstatus, scontrol);
sstatus, scontrol);
} }
} }
@ -2758,8 +2742,8 @@ int sata_down_spd_limit(struct ata_link *link, u32 spd_limit)
link->sata_spd_limit = mask; link->sata_spd_limit = mask;
ata_link_printk(link, KERN_WARNING, "limiting SATA link speed to %s\n", ata_link_warn(link, "limiting SATA link speed to %s\n",
sata_spd_string(fls(mask))); sata_spd_string(fls(mask)));
return 0; return 0;
} }
@ -3136,8 +3120,7 @@ int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel)
snprintf(buf, sizeof(buf), "%s", snprintf(buf, sizeof(buf), "%s",
ata_mode_string(xfer_mask)); ata_mode_string(xfer_mask));
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "limiting speed to %s\n", buf);
"limiting speed to %s\n", buf);
} }
ata_unpack_xfermask(xfer_mask, &dev->pio_mask, &dev->mwdma_mask, ata_unpack_xfermask(xfer_mask, &dev->pio_mask, &dev->mwdma_mask,
@ -3164,9 +3147,9 @@ static int ata_dev_set_mode(struct ata_device *dev)
dev_err_whine = " (SET_XFERMODE skipped)"; dev_err_whine = " (SET_XFERMODE skipped)";
else { else {
if (nosetxfer) if (nosetxfer)
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"NOSETXFER but PATA detected - can't " "NOSETXFER but PATA detected - can't "
"skip SETXFER, might malfunction\n"); "skip SETXFER, might malfunction\n");
err_mask = ata_dev_set_xfermode(dev); err_mask = ata_dev_set_xfermode(dev);
} }
@ -3216,15 +3199,14 @@ static int ata_dev_set_mode(struct ata_device *dev)
DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n", DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
dev->xfer_shift, (int)dev->xfer_mode); dev->xfer_shift, (int)dev->xfer_mode);
ata_dev_printk(dev, KERN_INFO, "configured for %s%s\n", ata_dev_info(dev, "configured for %s%s\n",
ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)), ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)),
dev_err_whine); dev_err_whine);
return 0; return 0;
fail: fail:
ata_dev_printk(dev, KERN_ERR, "failed to set xfermode " ata_dev_err(dev, "failed to set xfermode (err_mask=0x%x)\n", err_mask);
"(err_mask=0x%x)\n", err_mask);
return -EIO; return -EIO;
} }
@ -3286,7 +3268,7 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
/* step 2: always set host PIO timings */ /* step 2: always set host PIO timings */
ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev(dev, link, ENABLED) {
if (dev->pio_mode == 0xff) { if (dev->pio_mode == 0xff) {
ata_dev_printk(dev, KERN_WARNING, "no PIO support\n"); ata_dev_warn(dev, "no PIO support\n");
rc = -EINVAL; rc = -EINVAL;
goto out; goto out;
} }
@ -3404,7 +3386,7 @@ int ata_wait_ready(struct ata_link *link, unsigned long deadline,
if (!warned && time_after(now, start + 5 * HZ) && if (!warned && time_after(now, start + 5 * HZ) &&
(deadline - now > 3 * HZ)) { (deadline - now > 3 * HZ)) {
ata_link_printk(link, KERN_WARNING, ata_link_warn(link,
"link is slow to respond, please be patient " "link is slow to respond, please be patient "
"(ready=%d)\n", tmp); "(ready=%d)\n", tmp);
warned = 1; warned = 1;
@ -3552,16 +3534,14 @@ int sata_link_resume(struct ata_link *link, const unsigned long *params,
} while ((scontrol & 0xf0f) != 0x300 && --tries); } while ((scontrol & 0xf0f) != 0x300 && --tries);
if ((scontrol & 0xf0f) != 0x300) { if ((scontrol & 0xf0f) != 0x300) {
ata_link_printk(link, KERN_ERR, ata_link_warn(link, "failed to resume link (SControl %X)\n",
"failed to resume link (SControl %X)\n", scontrol);
scontrol);
return 0; return 0;
} }
if (tries < ATA_LINK_RESUME_TRIES) if (tries < ATA_LINK_RESUME_TRIES)
ata_link_printk(link, KERN_WARNING, ata_link_warn(link, "link resume succeeded after %d retries\n",
"link resume succeeded after %d retries\n", ATA_LINK_RESUME_TRIES - tries);
ATA_LINK_RESUME_TRIES - tries);
if ((rc = sata_link_debounce(link, params, deadline))) if ((rc = sata_link_debounce(link, params, deadline)))
return rc; return rc;
@ -3678,8 +3658,9 @@ int ata_std_prereset(struct ata_link *link, unsigned long deadline)
rc = sata_link_resume(link, timing, deadline); rc = sata_link_resume(link, timing, deadline);
/* whine about phy resume failure but proceed */ /* whine about phy resume failure but proceed */
if (rc && rc != -EOPNOTSUPP) if (rc && rc != -EOPNOTSUPP)
ata_link_printk(link, KERN_WARNING, "failed to resume " ata_link_warn(link,
"link for reset (errno=%d)\n", rc); "failed to resume link for reset (errno=%d)\n",
rc);
} }
/* no point in trying softreset on offline link */ /* no point in trying softreset on offline link */
@ -3795,8 +3776,7 @@ int sata_link_hardreset(struct ata_link *link, const unsigned long *timing,
/* online is set iff link is online && reset succeeded */ /* online is set iff link is online && reset succeeded */
if (online) if (online)
*online = false; *online = false;
ata_link_printk(link, KERN_ERR, ata_link_err(link, "COMRESET failed (errno=%d)\n", rc);
"COMRESET failed (errno=%d)\n", rc);
} }
DPRINTK("EXIT, rc=%d\n", rc); DPRINTK("EXIT, rc=%d\n", rc);
return rc; return rc;
@ -3880,8 +3860,8 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
unsigned char serial[2][ATA_ID_SERNO_LEN + 1]; unsigned char serial[2][ATA_ID_SERNO_LEN + 1];
if (dev->class != new_class) { if (dev->class != new_class) {
ata_dev_printk(dev, KERN_INFO, "class mismatch %d != %d\n", ata_dev_info(dev, "class mismatch %d != %d\n",
dev->class, new_class); dev->class, new_class);
return 0; return 0;
} }
@ -3891,14 +3871,14 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1])); ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1]));
if (strcmp(model[0], model[1])) { if (strcmp(model[0], model[1])) {
ata_dev_printk(dev, KERN_INFO, "model number mismatch " ata_dev_info(dev, "model number mismatch '%s' != '%s'\n",
"'%s' != '%s'\n", model[0], model[1]); model[0], model[1]);
return 0; return 0;
} }
if (strcmp(serial[0], serial[1])) { if (strcmp(serial[0], serial[1])) {
ata_dev_printk(dev, KERN_INFO, "serial number mismatch " ata_dev_info(dev, "serial number mismatch '%s' != '%s'\n",
"'%s' != '%s'\n", serial[0], serial[1]); serial[0], serial[1]);
return 0; return 0;
} }
@ -3968,8 +3948,8 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
new_class != ATA_DEV_ATA && new_class != ATA_DEV_ATA &&
new_class != ATA_DEV_ATAPI && new_class != ATA_DEV_ATAPI &&
new_class != ATA_DEV_SEMB) { new_class != ATA_DEV_SEMB) {
ata_dev_printk(dev, KERN_INFO, "class mismatch %u != %u\n", ata_dev_info(dev, "class mismatch %u != %u\n",
dev->class, new_class); dev->class, new_class);
rc = -ENODEV; rc = -ENODEV;
goto fail; goto fail;
} }
@ -3990,9 +3970,9 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
return 0; return 0;
/* n_sectors has changed */ /* n_sectors has changed */
ata_dev_printk(dev, KERN_WARNING, "n_sectors mismatch %llu != %llu\n", ata_dev_warn(dev, "n_sectors mismatch %llu != %llu\n",
(unsigned long long)n_sectors, (unsigned long long)n_sectors,
(unsigned long long)dev->n_sectors); (unsigned long long)dev->n_sectors);
/* /*
* Something could have caused HPA to be unlocked * Something could have caused HPA to be unlocked
@ -4001,9 +3981,9 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
*/ */
if (dev->n_native_sectors == n_native_sectors && if (dev->n_native_sectors == n_native_sectors &&
dev->n_sectors > n_sectors && dev->n_sectors == n_native_sectors) { dev->n_sectors > n_sectors && dev->n_sectors == n_native_sectors) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"new n_sectors matches native, probably " "new n_sectors matches native, probably "
"late HPA unlock, n_sectors updated\n"); "late HPA unlock, n_sectors updated\n");
/* use the larger n_sectors */ /* use the larger n_sectors */
return 0; return 0;
} }
@ -4017,9 +3997,9 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
if (dev->n_native_sectors == n_native_sectors && if (dev->n_native_sectors == n_native_sectors &&
dev->n_sectors < n_sectors && n_sectors == n_native_sectors && dev->n_sectors < n_sectors && n_sectors == n_native_sectors &&
!(dev->horkage & ATA_HORKAGE_BROKEN_HPA)) { !(dev->horkage & ATA_HORKAGE_BROKEN_HPA)) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"old n_sectors matches native, probably " "old n_sectors matches native, probably "
"late HPA lock, will try to unlock HPA\n"); "late HPA lock, will try to unlock HPA\n");
/* try unlocking HPA */ /* try unlocking HPA */
dev->flags |= ATA_DFLAG_UNLOCK_HPA; dev->flags |= ATA_DFLAG_UNLOCK_HPA;
rc = -EIO; rc = -EIO;
@ -4030,7 +4010,7 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
dev->n_native_sectors = n_native_sectors; dev->n_native_sectors = n_native_sectors;
dev->n_sectors = n_sectors; dev->n_sectors = n_sectors;
fail: fail:
ata_dev_printk(dev, KERN_ERR, "revalidation failed (errno=%d)\n", rc); ata_dev_err(dev, "revalidation failed (errno=%d)\n", rc);
return rc; return rc;
} }
@ -4358,15 +4338,15 @@ static void ata_dev_xfermask(struct ata_device *dev)
if (ata_dma_blacklisted(dev)) { if (ata_dma_blacklisted(dev)) {
xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"device is on DMA blacklist, disabling DMA\n"); "device is on DMA blacklist, disabling DMA\n");
} }
if ((host->flags & ATA_HOST_SIMPLEX) && if ((host->flags & ATA_HOST_SIMPLEX) &&
host->simplex_claimed && host->simplex_claimed != ap) { host->simplex_claimed && host->simplex_claimed != ap) {
xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
ata_dev_printk(dev, KERN_WARNING, "simplex DMA is claimed by " ata_dev_warn(dev,
"other device, disabling DMA\n"); "simplex DMA is claimed by other device, disabling DMA\n");
} }
if (ap->flags & ATA_FLAG_NO_IORDY) if (ap->flags & ATA_FLAG_NO_IORDY)
@ -4386,8 +4366,8 @@ static void ata_dev_xfermask(struct ata_device *dev)
if (xfer_mask & (0xF8 << ATA_SHIFT_UDMA)) if (xfer_mask & (0xF8 << ATA_SHIFT_UDMA))
/* UDMA/44 or higher would be available */ /* UDMA/44 or higher would be available */
if (cable_is_40wire(ap)) { if (cable_is_40wire(ap)) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"limited to UDMA/33 due to 40-wire cable\n"); "limited to UDMA/33 due to 40-wire cable\n");
xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA); xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA);
} }
@ -4954,8 +4934,8 @@ int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active)
done_mask = ap->qc_active ^ qc_active; done_mask = ap->qc_active ^ qc_active;
if (unlikely(done_mask & qc_active)) { if (unlikely(done_mask & qc_active)) {
ata_port_printk(ap, KERN_ERR, "illegal qc_active transition " ata_port_err(ap, "illegal qc_active transition (%08x->%08x)\n",
"(%08x->%08x)\n", ap->qc_active, qc_active); ap->qc_active, qc_active);
return -EINVAL; return -EINVAL;
} }
@ -5847,9 +5827,9 @@ int ata_host_start(struct ata_host *host)
rc = ap->ops->port_start(ap); rc = ap->ops->port_start(ap);
if (rc) { if (rc) {
if (rc != -ENODEV) if (rc != -ENODEV)
dev_printk(KERN_ERR, host->dev, dev_err(host->dev,
"failed to start port %d " "failed to start port %d (errno=%d)\n",
"(errno=%d)\n", i, rc); i, rc);
goto err_out; goto err_out;
} }
} }
@ -5971,8 +5951,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
/* host must have been started */ /* host must have been started */
if (!(host->flags & ATA_HOST_STARTED)) { if (!(host->flags & ATA_HOST_STARTED)) {
dev_printk(KERN_ERR, host->dev, dev_err(host->dev, "BUG: trying to register unstarted host\n");
"BUG: trying to register unstarted host\n");
WARN_ON(1); WARN_ON(1);
return -EINVAL; return -EINVAL;
} }
@ -6023,14 +6002,13 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
ap->udma_mask); ap->udma_mask);
if (!ata_port_is_dummy(ap)) { if (!ata_port_is_dummy(ap)) {
ata_port_printk(ap, KERN_INFO, ata_port_info(ap, "%cATA max %s %s\n",
"%cATA max %s %s\n", (ap->flags & ATA_FLAG_SATA) ? 'S' : 'P',
(ap->flags & ATA_FLAG_SATA) ? 'S' : 'P', ata_mode_string(xfer_mask),
ata_mode_string(xfer_mask), ap->link.eh_info.desc);
ap->link.eh_info.desc);
ata_ehi_clear_desc(&ap->link.eh_info); ata_ehi_clear_desc(&ap->link.eh_info);
} else } else
ata_port_printk(ap, KERN_INFO, "DUMMY\n"); ata_port_info(ap, "DUMMY\n");
} }
/* perform each probe asynchronously */ /* perform each probe asynchronously */
@ -6242,8 +6220,8 @@ int ata_pci_device_do_resume(struct pci_dev *pdev)
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"failed to enable device after resume (%d)\n", rc); "failed to enable device after resume (%d)\n", rc);
return rc; return rc;
} }
@ -6599,6 +6577,82 @@ const struct ata_port_info ata_dummy_port_info = {
.port_ops = &ata_dummy_port_ops, .port_ops = &ata_dummy_port_ops,
}; };
/*
* Utility print functions
*/
int ata_port_printk(const struct ata_port *ap, const char *level,
const char *fmt, ...)
{
struct va_format vaf;
va_list args;
int r;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
r = printk("%sata%u: %pV", level, ap->print_id, &vaf);
va_end(args);
return r;
}
EXPORT_SYMBOL(ata_port_printk);
int ata_link_printk(const struct ata_link *link, const char *level,
const char *fmt, ...)
{
struct va_format vaf;
va_list args;
int r;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
if (sata_pmp_attached(link->ap) || link->ap->slave_link)
r = printk("%sata%u.%02u: %pV",
level, link->ap->print_id, link->pmp, &vaf);
else
r = printk("%sata%u: %pV",
level, link->ap->print_id, &vaf);
va_end(args);
return r;
}
EXPORT_SYMBOL(ata_link_printk);
int ata_dev_printk(const struct ata_device *dev, const char *level,
const char *fmt, ...)
{
struct va_format vaf;
va_list args;
int r;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
r = printk("%sata%u.%02u: %pV",
level, dev->link->ap->print_id, dev->link->pmp + dev->devno,
&vaf);
va_end(args);
return r;
}
EXPORT_SYMBOL(ata_dev_printk);
void ata_print_version(const struct device *dev, const char *version)
{
dev_printk(KERN_DEBUG, dev, "version %s\n", version);
}
EXPORT_SYMBOL(ata_print_version);
/* /*
* libata is essentially a library of internal helper functions for * libata is essentially a library of internal helper functions for
* low-level ATA host controller drivers. As such, the API/ABI is * low-level ATA host controller drivers. As such, the API/ABI is

View file

@ -782,8 +782,9 @@ void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap)
spin_unlock_irqrestore(ap->lock, flags); spin_unlock_irqrestore(ap->lock, flags);
goto repeat; goto repeat;
} }
ata_port_printk(ap, KERN_ERR, "EH pending after %d " ata_port_err(ap,
"tries, giving up\n", ATA_EH_MAX_TRIES); "EH pending after %d tries, giving up\n",
ATA_EH_MAX_TRIES);
ap->pflags &= ~ATA_PFLAG_EH_PENDING; ap->pflags &= ~ATA_PFLAG_EH_PENDING;
} }
@ -816,7 +817,7 @@ void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap)
schedule_delayed_work(&ap->hotplug_task, 0); schedule_delayed_work(&ap->hotplug_task, 0);
if (ap->pflags & ATA_PFLAG_RECOVERED) if (ap->pflags & ATA_PFLAG_RECOVERED)
ata_port_printk(ap, KERN_INFO, "EH complete\n"); ata_port_info(ap, "EH complete\n");
ap->pflags &= ~(ATA_PFLAG_SCSI_HOTPLUG | ATA_PFLAG_RECOVERED); ap->pflags &= ~(ATA_PFLAG_SCSI_HOTPLUG | ATA_PFLAG_RECOVERED);
@ -1310,7 +1311,7 @@ void ata_dev_disable(struct ata_device *dev)
return; return;
if (ata_msg_drv(dev->link->ap)) if (ata_msg_drv(dev->link->ap))
ata_dev_printk(dev, KERN_WARNING, "disabled\n"); ata_dev_warn(dev, "disabled\n");
ata_acpi_on_disable(dev); ata_acpi_on_disable(dev);
ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | ATA_DNXFER_QUIET); ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | ATA_DNXFER_QUIET);
dev->class++; dev->class++;
@ -1515,8 +1516,8 @@ static int ata_eh_read_log_10h(struct ata_device *dev,
for (i = 0; i < ATA_SECT_SIZE; i++) for (i = 0; i < ATA_SECT_SIZE; i++)
csum += buf[i]; csum += buf[i];
if (csum) if (csum)
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "invalid checksum 0x%x on log page 10h\n",
"invalid checksum 0x%x on log page 10h\n", csum); csum);
if (buf[0] & 0x80) if (buf[0] & 0x80)
return -ENOENT; return -ENOENT;
@ -1716,14 +1717,14 @@ void ata_eh_analyze_ncq_error(struct ata_link *link)
memset(&tf, 0, sizeof(tf)); memset(&tf, 0, sizeof(tf));
rc = ata_eh_read_log_10h(dev, &tag, &tf); rc = ata_eh_read_log_10h(dev, &tag, &tf);
if (rc) { if (rc) {
ata_link_printk(link, KERN_ERR, "failed to read log page 10h " ata_link_err(link, "failed to read log page 10h (errno=%d)\n",
"(errno=%d)\n", rc); rc);
return; return;
} }
if (!(link->sactive & (1 << tag))) { if (!(link->sactive & (1 << tag))) {
ata_link_printk(link, KERN_ERR, "log page 10h reported " ata_link_err(link, "log page 10h reported inactive tag %d\n",
"inactive tag %d\n", tag); tag);
return; return;
} }
@ -1988,8 +1989,7 @@ static unsigned int ata_eh_speed_down(struct ata_device *dev,
(dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ | (dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ |
ATA_DFLAG_NCQ_OFF)) == ATA_DFLAG_NCQ) { ATA_DFLAG_NCQ_OFF)) == ATA_DFLAG_NCQ) {
dev->flags |= ATA_DFLAG_NCQ_OFF; dev->flags |= ATA_DFLAG_NCQ_OFF;
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "NCQ disabled due to excessive errors\n");
"NCQ disabled due to excessive errors\n");
goto done; goto done;
} }
@ -2374,24 +2374,24 @@ static void ata_eh_link_report(struct ata_link *link)
ap->eh_tries); ap->eh_tries);
if (ehc->i.dev) { if (ehc->i.dev) {
ata_dev_printk(ehc->i.dev, KERN_ERR, "exception Emask 0x%x " ata_dev_err(ehc->i.dev, "exception Emask 0x%x "
"SAct 0x%x SErr 0x%x action 0x%x%s%s\n", "SAct 0x%x SErr 0x%x action 0x%x%s%s\n",
ehc->i.err_mask, link->sactive, ehc->i.serror, ehc->i.err_mask, link->sactive, ehc->i.serror,
ehc->i.action, frozen, tries_buf); ehc->i.action, frozen, tries_buf);
if (desc) if (desc)
ata_dev_printk(ehc->i.dev, KERN_ERR, "%s\n", desc); ata_dev_err(ehc->i.dev, "%s\n", desc);
} else { } else {
ata_link_printk(link, KERN_ERR, "exception Emask 0x%x " ata_link_err(link, "exception Emask 0x%x "
"SAct 0x%x SErr 0x%x action 0x%x%s%s\n", "SAct 0x%x SErr 0x%x action 0x%x%s%s\n",
ehc->i.err_mask, link->sactive, ehc->i.serror, ehc->i.err_mask, link->sactive, ehc->i.serror,
ehc->i.action, frozen, tries_buf); ehc->i.action, frozen, tries_buf);
if (desc) if (desc)
ata_link_printk(link, KERN_ERR, "%s\n", desc); ata_link_err(link, "%s\n", desc);
} }
#ifdef CONFIG_ATA_VERBOSE_ERROR #ifdef CONFIG_ATA_VERBOSE_ERROR
if (ehc->i.serror) if (ehc->i.serror)
ata_link_printk(link, KERN_ERR, ata_link_err(link,
"SError: { %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s}\n", "SError: { %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s}\n",
ehc->i.serror & SERR_DATA_RECOVERED ? "RecovData " : "", ehc->i.serror & SERR_DATA_RECOVERED ? "RecovData " : "",
ehc->i.serror & SERR_COMM_RECOVERED ? "RecovComm " : "", ehc->i.serror & SERR_COMM_RECOVERED ? "RecovComm " : "",
@ -2456,11 +2456,11 @@ static void ata_eh_link_report(struct ata_link *link)
} else { } else {
const char *descr = ata_get_cmd_descript(cmd->command); const char *descr = ata_get_cmd_descript(cmd->command);
if (descr) if (descr)
ata_dev_printk(qc->dev, KERN_ERR, ata_dev_err(qc->dev, "failed command: %s\n",
"failed command: %s\n", descr); descr);
} }
ata_dev_printk(qc->dev, KERN_ERR, ata_dev_err(qc->dev,
"cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x " "cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
"tag %d%s\n %s" "tag %d%s\n %s"
"res %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x " "res %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
@ -2481,11 +2481,9 @@ static void ata_eh_link_report(struct ata_link *link)
if (res->command & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | if (res->command & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ |
ATA_ERR)) { ATA_ERR)) {
if (res->command & ATA_BUSY) if (res->command & ATA_BUSY)
ata_dev_printk(qc->dev, KERN_ERR, ata_dev_err(qc->dev, "status: { Busy }\n");
"status: { Busy }\n");
else else
ata_dev_printk(qc->dev, KERN_ERR, ata_dev_err(qc->dev, "status: { %s%s%s%s}\n",
"status: { %s%s%s%s}\n",
res->command & ATA_DRDY ? "DRDY " : "", res->command & ATA_DRDY ? "DRDY " : "",
res->command & ATA_DF ? "DF " : "", res->command & ATA_DF ? "DF " : "",
res->command & ATA_DRQ ? "DRQ " : "", res->command & ATA_DRQ ? "DRQ " : "",
@ -2495,8 +2493,7 @@ static void ata_eh_link_report(struct ata_link *link)
if (cmd->command != ATA_CMD_PACKET && if (cmd->command != ATA_CMD_PACKET &&
(res->feature & (ATA_ICRC | ATA_UNC | ATA_IDNF | (res->feature & (ATA_ICRC | ATA_UNC | ATA_IDNF |
ATA_ABORTED))) ATA_ABORTED)))
ata_dev_printk(qc->dev, KERN_ERR, ata_dev_err(qc->dev, "error: { %s%s%s%s}\n",
"error: { %s%s%s%s}\n",
res->feature & ATA_ICRC ? "ICRC " : "", res->feature & ATA_ICRC ? "ICRC " : "",
res->feature & ATA_UNC ? "UNC " : "", res->feature & ATA_UNC ? "UNC " : "",
res->feature & ATA_IDNF ? "IDNF " : "", res->feature & ATA_IDNF ? "IDNF " : "",
@ -2650,8 +2647,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
if (rc) { if (rc) {
if (rc == -ENOENT) { if (rc == -ENOENT) {
ata_link_printk(link, KERN_DEBUG, ata_link_dbg(link, "port disabled--ignoring\n");
"port disabled. ignoring.\n");
ehc->i.action &= ~ATA_EH_RESET; ehc->i.action &= ~ATA_EH_RESET;
ata_for_each_dev(dev, link, ALL) ata_for_each_dev(dev, link, ALL)
@ -2659,8 +2655,9 @@ int ata_eh_reset(struct ata_link *link, int classify,
rc = 0; rc = 0;
} else } else
ata_link_printk(link, KERN_ERR, ata_link_err(link,
"prereset failed (errno=%d)\n", rc); "prereset failed (errno=%d)\n",
rc);
goto out; goto out;
} }
@ -2689,8 +2686,8 @@ int ata_eh_reset(struct ata_link *link, int classify,
if (reset) { if (reset) {
if (verbose) if (verbose)
ata_link_printk(link, KERN_INFO, "%s resetting link\n", ata_link_info(link, "%s resetting link\n",
reset == softreset ? "soft" : "hard"); reset == softreset ? "soft" : "hard");
/* mark that this EH session started with reset */ /* mark that this EH session started with reset */
ehc->last_reset = jiffies; ehc->last_reset = jiffies;
@ -2710,8 +2707,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
int tmp; int tmp;
if (verbose) if (verbose)
ata_link_printk(slave, KERN_INFO, ata_link_info(slave, "hard resetting link\n");
"hard resetting link\n");
ata_eh_about_to_do(slave, NULL, ATA_EH_RESET); ata_eh_about_to_do(slave, NULL, ATA_EH_RESET);
tmp = ata_do_reset(slave, reset, classes, deadline, tmp = ata_do_reset(slave, reset, classes, deadline,
@ -2734,9 +2730,8 @@ int ata_eh_reset(struct ata_link *link, int classify,
reset = softreset; reset = softreset;
if (!reset) { if (!reset) {
ata_link_printk(link, KERN_ERR, ata_link_err(link,
"follow-up softreset required " "follow-up softreset required but no softreset available\n");
"but no softreset available\n");
failed_link = link; failed_link = link;
rc = -EINVAL; rc = -EINVAL;
goto fail; goto fail;
@ -2751,8 +2746,8 @@ int ata_eh_reset(struct ata_link *link, int classify,
} }
} else { } else {
if (verbose) if (verbose)
ata_link_printk(link, KERN_INFO, "no reset method " ata_link_info(link,
"available, skipping reset\n"); "no reset method available, skipping reset\n");
if (!(lflags & ATA_LFLAG_ASSUME_CLASS)) if (!(lflags & ATA_LFLAG_ASSUME_CLASS))
lflags |= ATA_LFLAG_ASSUME_ATA; lflags |= ATA_LFLAG_ASSUME_ATA;
} }
@ -2830,36 +2825,35 @@ int ata_eh_reset(struct ata_link *link, int classify,
ata_for_each_dev(dev, link, ALL) { ata_for_each_dev(dev, link, ALL) {
if (ata_phys_link_online(ata_dev_phys_link(dev))) { if (ata_phys_link_online(ata_dev_phys_link(dev))) {
if (classes[dev->devno] == ATA_DEV_UNKNOWN) { if (classes[dev->devno] == ATA_DEV_UNKNOWN) {
ata_dev_printk(dev, KERN_DEBUG, "link online " ata_dev_dbg(dev, "link online but device misclassified\n");
"but device misclassifed\n");
classes[dev->devno] = ATA_DEV_NONE; classes[dev->devno] = ATA_DEV_NONE;
nr_unknown++; nr_unknown++;
} }
} else if (ata_phys_link_offline(ata_dev_phys_link(dev))) { } else if (ata_phys_link_offline(ata_dev_phys_link(dev))) {
if (ata_class_enabled(classes[dev->devno])) if (ata_class_enabled(classes[dev->devno]))
ata_dev_printk(dev, KERN_DEBUG, "link offline, " ata_dev_dbg(dev,
"clearing class %d to NONE\n", "link offline, clearing class %d to NONE\n",
classes[dev->devno]); classes[dev->devno]);
classes[dev->devno] = ATA_DEV_NONE; classes[dev->devno] = ATA_DEV_NONE;
} else if (classes[dev->devno] == ATA_DEV_UNKNOWN) { } else if (classes[dev->devno] == ATA_DEV_UNKNOWN) {
ata_dev_printk(dev, KERN_DEBUG, "link status unknown, " ata_dev_dbg(dev,
"clearing UNKNOWN to NONE\n"); "link status unknown, clearing UNKNOWN to NONE\n");
classes[dev->devno] = ATA_DEV_NONE; classes[dev->devno] = ATA_DEV_NONE;
} }
} }
if (classify && nr_unknown) { if (classify && nr_unknown) {
if (try < max_tries) { if (try < max_tries) {
ata_link_printk(link, KERN_WARNING, "link online but " ata_link_warn(link,
"%d devices misclassified, retrying\n", "link online but %d devices misclassified, retrying\n",
nr_unknown); nr_unknown);
failed_link = link; failed_link = link;
rc = -EAGAIN; rc = -EAGAIN;
goto fail; goto fail;
} }
ata_link_printk(link, KERN_WARNING, ata_link_warn(link,
"link online but %d devices misclassified, " "link online but %d devices misclassified, "
"device detection might fail\n", nr_unknown); "device detection might fail\n", nr_unknown);
} }
/* reset successful, schedule revalidation */ /* reset successful, schedule revalidation */
@ -2889,14 +2883,23 @@ int ata_eh_reset(struct ata_link *link, int classify,
sata_scr_read(link, SCR_STATUS, &sstatus)) sata_scr_read(link, SCR_STATUS, &sstatus))
rc = -ERESTART; rc = -ERESTART;
if (rc == -ERESTART || try >= max_tries) if (rc == -ERESTART || try >= max_tries) {
/*
* Thaw host port even if reset failed, so that the port
* can be retried on the next phy event. This risks
* repeated EH runs but seems to be a better tradeoff than
* shutting down a port after a botched hotplug attempt.
*/
if (ata_is_host_link(link))
ata_eh_thaw_port(ap);
goto out; goto out;
}
now = jiffies; now = jiffies;
if (time_before(now, deadline)) { if (time_before(now, deadline)) {
unsigned long delta = deadline - now; unsigned long delta = deadline - now;
ata_link_printk(failed_link, KERN_WARNING, ata_link_warn(failed_link,
"reset failed (errno=%d), retrying in %u secs\n", "reset failed (errno=%d), retrying in %u secs\n",
rc, DIV_ROUND_UP(jiffies_to_msecs(delta), 1000)); rc, DIV_ROUND_UP(jiffies_to_msecs(delta), 1000));
@ -2987,7 +2990,7 @@ static void ata_eh_park_issue_cmd(struct ata_device *dev, int park)
tf.protocol |= ATA_PROT_NODATA; tf.protocol |= ATA_PROT_NODATA;
err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
if (park && (err_mask || tf.lbal != 0xc4)) { if (park && (err_mask || tf.lbal != 0xc4)) {
ata_dev_printk(dev, KERN_ERR, "head unload failed!\n"); ata_dev_err(dev, "head unload failed!\n");
ehc->unloaded_mask &= ~(1 << dev->devno); ehc->unloaded_mask &= ~(1 << dev->devno);
} }
} }
@ -3198,8 +3201,9 @@ static int atapi_eh_clear_ua(struct ata_device *dev)
err_mask = atapi_eh_tur(dev, &sense_key); err_mask = atapi_eh_tur(dev, &sense_key);
if (err_mask != 0 && err_mask != AC_ERR_DEV) { if (err_mask != 0 && err_mask != AC_ERR_DEV) {
ata_dev_printk(dev, KERN_WARNING, "TEST_UNIT_READY " ata_dev_warn(dev,
"failed (err_mask=0x%x)\n", err_mask); "TEST_UNIT_READY failed (err_mask=0x%x)\n",
err_mask);
return -EIO; return -EIO;
} }
@ -3208,14 +3212,14 @@ static int atapi_eh_clear_ua(struct ata_device *dev)
err_mask = atapi_eh_request_sense(dev, sense_buffer, sense_key); err_mask = atapi_eh_request_sense(dev, sense_buffer, sense_key);
if (err_mask) { if (err_mask) {
ata_dev_printk(dev, KERN_WARNING, "failed to clear " ata_dev_warn(dev, "failed to clear "
"UNIT ATTENTION (err_mask=0x%x)\n", err_mask); "UNIT ATTENTION (err_mask=0x%x)\n", err_mask);
return -EIO; return -EIO;
} }
} }
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "UNIT ATTENTION persists after %d tries\n",
"UNIT ATTENTION persists after %d tries\n", ATA_EH_UA_TRIES); ATA_EH_UA_TRIES);
return 0; return 0;
} }
@ -3266,7 +3270,7 @@ static int ata_eh_maybe_retry_flush(struct ata_device *dev)
tf.flags |= ATA_TFLAG_DEVICE; tf.flags |= ATA_TFLAG_DEVICE;
tf.protocol = ATA_PROT_NODATA; tf.protocol = ATA_PROT_NODATA;
ata_dev_printk(dev, KERN_WARNING, "retrying FLUSH 0x%x Emask 0x%x\n", ata_dev_warn(dev, "retrying FLUSH 0x%x Emask 0x%x\n",
tf.command, qc->err_mask); tf.command, qc->err_mask);
err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
@ -3281,7 +3285,7 @@ static int ata_eh_maybe_retry_flush(struct ata_device *dev)
*/ */
qc->scsicmd->allowed = max(qc->scsicmd->allowed, 1); qc->scsicmd->allowed = max(qc->scsicmd->allowed, 1);
} else { } else {
ata_dev_printk(dev, KERN_WARNING, "FLUSH failed Emask 0x%x\n", ata_dev_warn(dev, "FLUSH failed Emask 0x%x\n",
err_mask); err_mask);
rc = -EIO; rc = -EIO;
@ -3355,9 +3359,9 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
err_mask = ata_dev_set_feature(dev, err_mask = ata_dev_set_feature(dev,
SETFEATURES_SATA_DISABLE, SATA_DIPM); SETFEATURES_SATA_DISABLE, SATA_DIPM);
if (err_mask && err_mask != AC_ERR_DEV) { if (err_mask && err_mask != AC_ERR_DEV) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"failed to disable DIPM, Emask 0x%x\n", "failed to disable DIPM, Emask 0x%x\n",
err_mask); err_mask);
rc = -EIO; rc = -EIO;
goto fail; goto fail;
} }
@ -3399,7 +3403,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
err_mask = ata_dev_set_feature(dev, err_mask = ata_dev_set_feature(dev,
SETFEATURES_SATA_ENABLE, SATA_DIPM); SETFEATURES_SATA_ENABLE, SATA_DIPM);
if (err_mask && err_mask != AC_ERR_DEV) { if (err_mask && err_mask != AC_ERR_DEV) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"failed to enable DIPM, Emask 0x%x\n", "failed to enable DIPM, Emask 0x%x\n",
err_mask); err_mask);
rc = -EIO; rc = -EIO;
@ -3418,8 +3422,7 @@ fail:
/* if no device or only one more chance is left, disable LPM */ /* if no device or only one more chance is left, disable LPM */
if (!dev || ehc->tries[dev->devno] <= 2) { if (!dev || ehc->tries[dev->devno] <= 2) {
ata_link_printk(link, KERN_WARNING, ata_link_warn(link, "disabling LPM on the link\n");
"disabling LPM on the link\n");
link->flags |= ATA_LFLAG_NO_LPM; link->flags |= ATA_LFLAG_NO_LPM;
} }
if (r_failed_dev) if (r_failed_dev)
@ -3690,8 +3693,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
rc = ata_eh_reset(link, ata_link_nr_vacant(link), rc = ata_eh_reset(link, ata_link_nr_vacant(link),
prereset, softreset, hardreset, postreset); prereset, softreset, hardreset, postreset);
if (rc) { if (rc) {
ata_link_printk(link, KERN_ERR, ata_link_err(link, "reset failed, giving up\n");
"reset failed, giving up\n");
goto out; goto out;
} }
} }

View file

@ -147,8 +147,8 @@ int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *r_val)
err_mask = sata_pmp_read(link, reg, r_val); err_mask = sata_pmp_read(link, reg, r_val);
if (err_mask) { if (err_mask) {
ata_link_printk(link, KERN_WARNING, "failed to read SCR %d " ata_link_warn(link, "failed to read SCR %d (Emask=0x%x)\n",
"(Emask=0x%x)\n", reg, err_mask); reg, err_mask);
return -EIO; return -EIO;
} }
return 0; return 0;
@ -178,8 +178,8 @@ int sata_pmp_scr_write(struct ata_link *link, int reg, u32 val)
err_mask = sata_pmp_write(link, reg, val); err_mask = sata_pmp_write(link, reg, val);
if (err_mask) { if (err_mask) {
ata_link_printk(link, KERN_WARNING, "failed to write SCR %d " ata_link_warn(link, "failed to write SCR %d (Emask=0x%x)\n",
"(Emask=0x%x)\n", reg, err_mask); reg, err_mask);
return -EIO; return -EIO;
} }
return 0; return 0;
@ -231,8 +231,8 @@ static int sata_pmp_read_gscr(struct ata_device *dev, u32 *gscr)
err_mask = sata_pmp_read(dev->link, reg, &gscr[reg]); err_mask = sata_pmp_read(dev->link, reg, &gscr[reg]);
if (err_mask) { if (err_mask) {
ata_dev_printk(dev, KERN_ERR, "failed to read PMP " ata_dev_err(dev, "failed to read PMP GSCR[%d] (Emask=0x%x)\n",
"GSCR[%d] (Emask=0x%x)\n", reg, err_mask); reg, err_mask);
return -EIO; return -EIO;
} }
} }
@ -311,26 +311,25 @@ static int sata_pmp_configure(struct ata_device *dev, int print_info)
} }
if (print_info) { if (print_info) {
ata_dev_printk(dev, KERN_INFO, "Port Multiplier %s, " ata_dev_info(dev, "Port Multiplier %s, "
"0x%04x:0x%04x r%d, %d ports, feat 0x%x/0x%x\n", "0x%04x:0x%04x r%d, %d ports, feat 0x%x/0x%x\n",
sata_pmp_spec_rev_str(gscr), vendor, devid, sata_pmp_spec_rev_str(gscr), vendor, devid,
sata_pmp_gscr_rev(gscr), sata_pmp_gscr_rev(gscr),
nr_ports, gscr[SATA_PMP_GSCR_FEAT_EN], nr_ports, gscr[SATA_PMP_GSCR_FEAT_EN],
gscr[SATA_PMP_GSCR_FEAT]); gscr[SATA_PMP_GSCR_FEAT]);
if (!(dev->flags & ATA_DFLAG_AN)) if (!(dev->flags & ATA_DFLAG_AN))
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev,
"Asynchronous notification not supported, " "Asynchronous notification not supported, "
"hotplug won't\n work on fan-out " "hotplug won't work on fan-out ports. Use warm-plug instead.\n");
"ports. Use warm-plug instead.\n");
} }
return 0; return 0;
fail: fail:
ata_dev_printk(dev, KERN_ERR, ata_dev_err(dev,
"failed to configure Port Multiplier (%s, Emask=0x%x)\n", "failed to configure Port Multiplier (%s, Emask=0x%x)\n",
reason, err_mask); reason, err_mask);
return rc; return rc;
} }
@ -485,20 +484,17 @@ int sata_pmp_attach(struct ata_device *dev)
/* is it hanging off the right place? */ /* is it hanging off the right place? */
if (!sata_pmp_supported(ap)) { if (!sata_pmp_supported(ap)) {
ata_dev_printk(dev, KERN_ERR, ata_dev_err(dev, "host does not support Port Multiplier\n");
"host does not support Port Multiplier\n");
return -EINVAL; return -EINVAL;
} }
if (!ata_is_host_link(link)) { if (!ata_is_host_link(link)) {
ata_dev_printk(dev, KERN_ERR, ata_dev_err(dev, "Port Multipliers cannot be nested\n");
"Port Multipliers cannot be nested\n");
return -EINVAL; return -EINVAL;
} }
if (dev->devno) { if (dev->devno) {
ata_dev_printk(dev, KERN_ERR, ata_dev_err(dev, "Port Multiplier must be the first device\n");
"Port Multiplier must be the first device\n");
return -EINVAL; return -EINVAL;
} }
@ -517,8 +513,7 @@ int sata_pmp_attach(struct ata_device *dev)
rc = sata_pmp_init_links(ap, sata_pmp_gscr_ports(dev->gscr)); rc = sata_pmp_init_links(ap, sata_pmp_gscr_ports(dev->gscr));
if (rc) { if (rc) {
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev, "failed to initialize PMP links\n");
"failed to initialize PMP links\n");
goto fail; goto fail;
} }
@ -562,7 +557,7 @@ static void sata_pmp_detach(struct ata_device *dev)
struct ata_link *tlink; struct ata_link *tlink;
unsigned long flags; unsigned long flags;
ata_dev_printk(dev, KERN_INFO, "Port Multiplier detaching\n"); ata_dev_info(dev, "Port Multiplier detaching\n");
WARN_ON(!ata_is_host_link(link) || dev->devno || WARN_ON(!ata_is_host_link(link) || dev->devno ||
link->pmp != SATA_PMP_CTRL_PORT); link->pmp != SATA_PMP_CTRL_PORT);
@ -609,23 +604,23 @@ static int sata_pmp_same_pmp(struct ata_device *dev, const u32 *new_gscr)
new_nr_ports = sata_pmp_gscr_ports(new_gscr); new_nr_ports = sata_pmp_gscr_ports(new_gscr);
if (old_vendor != new_vendor) { if (old_vendor != new_vendor) {
ata_dev_printk(dev, KERN_INFO, "Port Multiplier " ata_dev_info(dev,
"vendor mismatch '0x%x' != '0x%x'\n", "Port Multiplier vendor mismatch '0x%x' != '0x%x'\n",
old_vendor, new_vendor); old_vendor, new_vendor);
return 0; return 0;
} }
if (old_devid != new_devid) { if (old_devid != new_devid) {
ata_dev_printk(dev, KERN_INFO, "Port Multiplier " ata_dev_info(dev,
"device ID mismatch '0x%x' != '0x%x'\n", "Port Multiplier device ID mismatch '0x%x' != '0x%x'\n",
old_devid, new_devid); old_devid, new_devid);
return 0; return 0;
} }
if (old_nr_ports != new_nr_ports) { if (old_nr_ports != new_nr_ports) {
ata_dev_printk(dev, KERN_INFO, "Port Multiplier " ata_dev_info(dev,
"nr_ports mismatch '0x%x' != '0x%x'\n", "Port Multiplier nr_ports mismatch '0x%x' != '0x%x'\n",
old_nr_ports, new_nr_ports); old_nr_ports, new_nr_ports);
return 0; return 0;
} }
@ -691,8 +686,7 @@ static int sata_pmp_revalidate(struct ata_device *dev, unsigned int new_class)
return 0; return 0;
fail: fail:
ata_dev_printk(dev, KERN_ERR, ata_dev_err(dev, "PMP revalidation failed (errno=%d)\n", rc);
"PMP revalidation failed (errno=%d)\n", rc);
DPRINTK("EXIT, rc=%d\n", rc); DPRINTK("EXIT, rc=%d\n", rc);
return rc; return rc;
} }
@ -716,13 +710,14 @@ static int sata_pmp_revalidate_quick(struct ata_device *dev)
err_mask = sata_pmp_read(dev->link, SATA_PMP_GSCR_PROD_ID, &prod_id); err_mask = sata_pmp_read(dev->link, SATA_PMP_GSCR_PROD_ID, &prod_id);
if (err_mask) { if (err_mask) {
ata_dev_printk(dev, KERN_ERR, "failed to read PMP product ID " ata_dev_err(dev,
"(Emask=0x%x)\n", err_mask); "failed to read PMP product ID (Emask=0x%x)\n",
err_mask);
return -EIO; return -EIO;
} }
if (prod_id != dev->gscr[SATA_PMP_GSCR_PROD_ID]) { if (prod_id != dev->gscr[SATA_PMP_GSCR_PROD_ID]) {
ata_dev_printk(dev, KERN_ERR, "PMP product ID mismatch\n"); ata_dev_err(dev, "PMP product ID mismatch\n");
/* something weird is going on, request full PMP recovery */ /* something weird is going on, request full PMP recovery */
return -EIO; return -EIO;
} }
@ -777,8 +772,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
rc = ata_eh_reset(link, 0, prereset, softreset, hardreset, rc = ata_eh_reset(link, 0, prereset, softreset, hardreset,
postreset); postreset);
if (rc) { if (rc) {
ata_link_printk(link, KERN_ERR, ata_link_err(link, "failed to reset PMP, giving up\n");
"failed to reset PMP, giving up\n");
goto fail; goto fail;
} }
@ -819,9 +813,9 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
ehc->i.action |= ATA_EH_RESET; ehc->i.action |= ATA_EH_RESET;
goto retry; goto retry;
} else { } else {
ata_dev_printk(dev, KERN_ERR, "failed to recover PMP " ata_dev_err(dev,
"after %d tries, giving up\n", "failed to recover PMP after %d tries, giving up\n",
ATA_EH_PMP_TRIES); ATA_EH_PMP_TRIES);
goto fail; goto fail;
} }
} }
@ -867,8 +861,9 @@ static int sata_pmp_eh_handle_disabled_links(struct ata_port *ap)
/* unconditionally clear SError.N */ /* unconditionally clear SError.N */
rc = sata_scr_write(link, SCR_ERROR, SERR_PHYRDY_CHG); rc = sata_scr_write(link, SCR_ERROR, SERR_PHYRDY_CHG);
if (rc) { if (rc) {
ata_link_printk(link, KERN_ERR, "failed to clear " ata_link_err(link,
"SError.N (errno=%d)\n", rc); "failed to clear SError.N (errno=%d)\n",
rc);
return rc; return rc;
} }
@ -890,7 +885,7 @@ static int sata_pmp_handle_link_fail(struct ata_link *link, int *link_tries)
/* disable this link */ /* disable this link */
if (!(link->flags & ATA_LFLAG_DISABLED)) { if (!(link->flags & ATA_LFLAG_DISABLED)) {
ata_link_printk(link, KERN_WARNING, ata_link_warn(link,
"failed to recover link after %d tries, disabling\n", "failed to recover link after %d tries, disabling\n",
ATA_EH_PMP_LINK_TRIES); ATA_EH_PMP_LINK_TRIES);
@ -974,7 +969,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
err_mask = sata_pmp_write(pmp_link, SATA_PMP_GSCR_FEAT_EN, err_mask = sata_pmp_write(pmp_link, SATA_PMP_GSCR_FEAT_EN,
gscr[SATA_PMP_GSCR_FEAT_EN]); gscr[SATA_PMP_GSCR_FEAT_EN]);
if (err_mask) { if (err_mask) {
ata_link_printk(pmp_link, KERN_WARNING, ata_link_warn(pmp_link,
"failed to disable NOTIFY (err_mask=0x%x)\n", "failed to disable NOTIFY (err_mask=0x%x)\n",
err_mask); err_mask);
goto pmp_fail; goto pmp_fail;
@ -1018,8 +1013,9 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
err_mask = sata_pmp_write(pmp_link, SATA_PMP_GSCR_FEAT_EN, err_mask = sata_pmp_write(pmp_link, SATA_PMP_GSCR_FEAT_EN,
gscr[SATA_PMP_GSCR_FEAT_EN]); gscr[SATA_PMP_GSCR_FEAT_EN]);
if (err_mask) { if (err_mask) {
ata_dev_printk(pmp_dev, KERN_ERR, "failed to write " ata_dev_err(pmp_dev,
"PMP_FEAT_EN (Emask=0x%x)\n", err_mask); "failed to write PMP_FEAT_EN (Emask=0x%x)\n",
err_mask);
rc = -EIO; rc = -EIO;
goto pmp_fail; goto pmp_fail;
} }
@ -1028,8 +1024,9 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
/* check GSCR_ERROR */ /* check GSCR_ERROR */
err_mask = sata_pmp_read(pmp_link, SATA_PMP_GSCR_ERROR, &gscr_error); err_mask = sata_pmp_read(pmp_link, SATA_PMP_GSCR_ERROR, &gscr_error);
if (err_mask) { if (err_mask) {
ata_dev_printk(pmp_dev, KERN_ERR, "failed to read " ata_dev_err(pmp_dev,
"PMP_GSCR_ERROR (Emask=0x%x)\n", err_mask); "failed to read PMP_GSCR_ERROR (Emask=0x%x)\n",
err_mask);
rc = -EIO; rc = -EIO;
goto pmp_fail; goto pmp_fail;
} }
@ -1043,17 +1040,16 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
ata_ehi_hotplugged(&link->eh_context.i); ata_ehi_hotplugged(&link->eh_context.i);
cnt++; cnt++;
} else { } else {
ata_link_printk(link, KERN_WARNING, ata_link_warn(link,
"PHY status changed but maxed out on retries, " "PHY status changed but maxed out on retries, giving up\n");
"giving up\n"); ata_link_warn(link,
ata_link_printk(link, KERN_WARNING, "Manually issue scan to resume this link\n");
"Manully issue scan to resume this link\n");
} }
} }
if (cnt) { if (cnt) {
ata_port_printk(ap, KERN_INFO, "PMP SError.N set for some " ata_port_info(ap,
"ports, repeating recovery\n"); "PMP SError.N set for some ports, repeating recovery\n");
goto retry; goto retry;
} }
@ -1081,9 +1077,8 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
goto retry; goto retry;
} }
ata_port_printk(ap, KERN_ERR, ata_port_err(ap, "failed to recover PMP after %d tries, giving up\n",
"failed to recover PMP after %d tries, giving up\n", ATA_EH_PMP_TRIES);
ATA_EH_PMP_TRIES);
sata_pmp_detach(pmp_dev); sata_pmp_detach(pmp_dev);
ata_dev_disable(pmp_dev); ata_dev_disable(pmp_dev);

View file

@ -1108,8 +1108,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
/* configure draining */ /* configure draining */
buf = kmalloc(ATAPI_MAX_DRAIN, q->bounce_gfp | GFP_KERNEL); buf = kmalloc(ATAPI_MAX_DRAIN, q->bounce_gfp | GFP_KERNEL);
if (!buf) { if (!buf) {
ata_dev_printk(dev, KERN_ERR, ata_dev_err(dev, "drain buffer allocation failed\n");
"drain buffer allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
@ -1127,7 +1126,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
* IDENTIFY_PACKET is executed as ATA_PROT_PIO. * IDENTIFY_PACKET is executed as ATA_PROT_PIO.
*/ */
if (sdev->sector_size > PAGE_SIZE) if (sdev->sector_size > PAGE_SIZE)
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"sector_size=%u > PAGE_SIZE, PIO may malfunction\n", "sector_size=%u > PAGE_SIZE, PIO may malfunction\n",
sdev->sector_size); sdev->sector_size);
@ -1784,8 +1783,7 @@ static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd,
if (cmd->sc_data_direction == DMA_FROM_DEVICE || if (cmd->sc_data_direction == DMA_FROM_DEVICE ||
cmd->sc_data_direction == DMA_TO_DEVICE) { cmd->sc_data_direction == DMA_TO_DEVICE) {
if (unlikely(scsi_bufflen(cmd) < 1)) { if (unlikely(scsi_bufflen(cmd) < 1)) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "WARNING: zero len r/w req\n");
"WARNING: zero len r/w req\n");
goto err_did; goto err_did;
} }
@ -2969,9 +2967,8 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
* with the cached multi_count of libata * with the cached multi_count of libata
*/ */
if (multi_count != dev->multi_count) if (multi_count != dev->multi_count)
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev, "invalid multi_count %u ignored\n",
"invalid multi_count %u ignored\n", multi_count);
multi_count);
} }
/* /*
@ -3466,9 +3463,8 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
goto repeat; goto repeat;
} }
ata_port_printk(ap, KERN_ERR, "WARNING: synchronous SCSI scan " ata_port_err(ap,
"failed without making any progress,\n" "WARNING: synchronous SCSI scan failed without making any progress, switching to async\n");
" switching to async\n");
} }
queue_delayed_work(system_long_wq, &ap->hotplug_task, queue_delayed_work(system_long_wq, &ap->hotplug_task,
@ -3550,8 +3546,8 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
mutex_unlock(&ap->scsi_host->scan_mutex); mutex_unlock(&ap->scsi_host->scan_mutex);
if (sdev) { if (sdev) {
ata_dev_printk(dev, KERN_INFO, "detaching (SCSI %s)\n", ata_dev_info(dev, "detaching (SCSI %s)\n",
dev_name(&sdev->sdev_gendev)); dev_name(&sdev->sdev_gendev));
scsi_remove_device(sdev); scsi_remove_device(sdev);
scsi_device_put(sdev); scsi_device_put(sdev);

View file

@ -227,9 +227,9 @@ int ata_sff_busy_sleep(struct ata_port *ap,
} }
if (status != 0xff && (status & ATA_BUSY)) if (status != 0xff && (status & ATA_BUSY))
ata_port_printk(ap, KERN_WARNING, ata_port_warn(ap,
"port is slow to respond, please be patient " "port is slow to respond, please be patient (Status 0x%x)\n",
"(Status 0x%x)\n", status); status);
timeout = ata_deadline(timer_start, tmout); timeout = ata_deadline(timer_start, tmout);
while (status != 0xff && (status & ATA_BUSY) && while (status != 0xff && (status & ATA_BUSY) &&
@ -242,9 +242,9 @@ int ata_sff_busy_sleep(struct ata_port *ap,
return -ENODEV; return -ENODEV;
if (status & ATA_BUSY) { if (status & ATA_BUSY) {
ata_port_printk(ap, KERN_ERR, "port failed to respond " ata_port_err(ap,
"(%lu secs, Status 0x%x)\n", "port failed to respond (%lu secs, Status 0x%x)\n",
DIV_ROUND_UP(tmout, 1000), status); DIV_ROUND_UP(tmout, 1000), status);
return -EBUSY; return -EBUSY;
} }
@ -350,8 +350,8 @@ static void ata_dev_select(struct ata_port *ap, unsigned int device,
unsigned int wait, unsigned int can_sleep) unsigned int wait, unsigned int can_sleep)
{ {
if (ata_msg_probe(ap)) if (ata_msg_probe(ap))
ata_port_printk(ap, KERN_INFO, "ata_dev_select: ENTER, " ata_port_info(ap, "ata_dev_select: ENTER, device %u, wait %u\n",
"device %u, wait %u\n", device, wait); device, wait);
if (wait) if (wait)
ata_wait_idle(ap); ata_wait_idle(ap);
@ -1333,9 +1333,10 @@ void ata_sff_flush_pio_task(struct ata_port *ap)
cancel_delayed_work_sync(&ap->sff_pio_task); cancel_delayed_work_sync(&ap->sff_pio_task);
ap->hsm_task_state = HSM_ST_IDLE; ap->hsm_task_state = HSM_ST_IDLE;
ap->sff_pio_task_link = NULL;
if (ata_msg_ctl(ap)) if (ata_msg_ctl(ap))
ata_port_printk(ap, KERN_DEBUG, "%s: EXIT\n", __func__); ata_port_dbg(ap, "%s: EXIT\n", __func__);
} }
static void ata_sff_pio_task(struct work_struct *work) static void ata_sff_pio_task(struct work_struct *work)
@ -1513,7 +1514,7 @@ static unsigned int ata_sff_idle_irq(struct ata_port *ap)
ap->ops->sff_check_status(ap); ap->ops->sff_check_status(ap);
if (ap->ops->sff_irq_clear) if (ap->ops->sff_irq_clear)
ap->ops->sff_irq_clear(ap); ap->ops->sff_irq_clear(ap);
ata_port_printk(ap, KERN_WARNING, "irq trap\n"); ata_port_warn(ap, "irq trap\n");
return 1; return 1;
} }
#endif #endif
@ -1711,7 +1712,7 @@ void ata_sff_lost_interrupt(struct ata_port *ap)
/* There was a command running, we are no longer busy and we have /* There was a command running, we are no longer busy and we have
no interrupt. */ no interrupt. */
ata_port_printk(ap, KERN_WARNING, "lost interrupt (Status 0x%x)\n", ata_port_warn(ap, "lost interrupt (Status 0x%x)\n",
status); status);
/* Run the host interrupt logic as if the interrupt had not been /* Run the host interrupt logic as if the interrupt had not been
lost */ lost */
@ -1798,8 +1799,9 @@ int ata_sff_prereset(struct ata_link *link, unsigned long deadline)
if (!ata_link_offline(link)) { if (!ata_link_offline(link)) {
rc = ata_sff_wait_ready(link, deadline); rc = ata_sff_wait_ready(link, deadline);
if (rc && rc != -ENODEV) { if (rc && rc != -ENODEV) {
ata_link_printk(link, KERN_WARNING, "device not ready " ata_link_warn(link,
"(errno=%d), forcing hardreset\n", rc); "device not ready (errno=%d), forcing hardreset\n",
rc);
ehc->i.action |= ATA_EH_HARDRESET; ehc->i.action |= ATA_EH_HARDRESET;
} }
} }
@ -2056,7 +2058,7 @@ int ata_sff_softreset(struct ata_link *link, unsigned int *classes,
rc = ata_bus_softreset(ap, devmask, deadline); rc = ata_bus_softreset(ap, devmask, deadline);
/* if link is occupied, -ENODEV too is an error */ /* if link is occupied, -ENODEV too is an error */
if (rc && (rc != -ENODEV || sata_scr_valid(link))) { if (rc && (rc != -ENODEV || sata_scr_valid(link))) {
ata_link_printk(link, KERN_ERR, "SRST failed (errno=%d)\n", rc); ata_link_err(link, "SRST failed (errno=%d)\n", rc);
return rc; return rc;
} }
@ -2170,8 +2172,7 @@ void ata_sff_drain_fifo(struct ata_queued_cmd *qc)
/* Can become DEBUG later */ /* Can become DEBUG later */
if (count) if (count)
ata_port_printk(ap, KERN_DEBUG, ata_port_dbg(ap, "drained %d bytes to clear DRQ\n", count);
"drained %d bytes to clear DRQ.\n", count);
} }
EXPORT_SYMBOL_GPL(ata_sff_drain_fifo); EXPORT_SYMBOL_GPL(ata_sff_drain_fifo);
@ -2316,9 +2317,9 @@ int ata_pci_sff_init_host(struct ata_host *host)
rc = pcim_iomap_regions(pdev, 0x3 << base, rc = pcim_iomap_regions(pdev, 0x3 << base,
dev_driver_string(gdev)); dev_driver_string(gdev));
if (rc) { if (rc) {
dev_printk(KERN_WARNING, gdev, dev_warn(gdev,
"failed to request/iomap BARs for port %d " "failed to request/iomap BARs for port %d (errno=%d)\n",
"(errno=%d)\n", i, rc); i, rc);
if (rc == -EBUSY) if (rc == -EBUSY)
pcim_pin_device(pdev); pcim_pin_device(pdev);
ap->ops = &ata_dummy_port_ops; ap->ops = &ata_dummy_port_ops;
@ -2340,7 +2341,7 @@ int ata_pci_sff_init_host(struct ata_host *host)
} }
if (!mask) { if (!mask) {
dev_printk(KERN_ERR, gdev, "no available native port\n"); dev_err(gdev, "no available native port\n");
return -ENODEV; return -ENODEV;
} }
@ -2375,8 +2376,7 @@ int ata_pci_sff_prepare_host(struct pci_dev *pdev,
host = ata_host_alloc_pinfo(&pdev->dev, ppi, 2); host = ata_host_alloc_pinfo(&pdev->dev, ppi, 2);
if (!host) { if (!host) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "failed to allocate ATA host\n");
"failed to allocate ATA host\n");
rc = -ENOMEM; rc = -ENOMEM;
goto err_out; goto err_out;
} }
@ -2542,8 +2542,7 @@ int ata_pci_sff_init_one(struct pci_dev *pdev,
pi = ata_sff_find_valid_pi(ppi); pi = ata_sff_find_valid_pi(ppi);
if (!pi) { if (!pi) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "no valid port_info specified\n");
"no valid port_info specified\n");
return -EINVAL; return -EINVAL;
} }
@ -3164,8 +3163,7 @@ static void ata_bmdma_nodma(struct ata_host *host, const char *reason)
{ {
int i; int i;
dev_printk(KERN_ERR, host->dev, "BMDMA: %s, falling back to PIO\n", dev_err(host->dev, "BMDMA: %s, falling back to PIO\n", reason);
reason);
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
host->ports[i]->mwdma_mask = 0; host->ports[i]->mwdma_mask = 0;
@ -3297,8 +3295,7 @@ int ata_pci_bmdma_init_one(struct pci_dev *pdev,
pi = ata_sff_find_valid_pi(ppi); pi = ata_sff_find_valid_pi(ppi);
if (!pi) { if (!pi) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "no valid port_info specified\n");
"no valid port_info specified\n");
return -EINVAL; return -EINVAL;
} }

View file

@ -195,8 +195,6 @@ static int pacpi_port_start(struct ata_port *ap)
struct pci_dev *pdev = to_pci_dev(ap->host->dev); struct pci_dev *pdev = to_pci_dev(ap->host->dev);
struct pata_acpi *acpi; struct pata_acpi *acpi;
int ret;
if (ap->acpi_handle == NULL) if (ap->acpi_handle == NULL)
return -ENODEV; return -ENODEV;
@ -205,11 +203,7 @@ static int pacpi_port_start(struct ata_port *ap)
return -ENOMEM; return -ENOMEM;
acpi->mask[0] = pacpi_discover_modes(ap, &ap->link.device[0]); acpi->mask[0] = pacpi_discover_modes(ap, &ap->link.device[0]);
acpi->mask[1] = pacpi_discover_modes(ap, &ap->link.device[1]); acpi->mask[1] = pacpi_discover_modes(ap, &ap->link.device[1]);
ret = ata_bmdma_port_start(ap); return ata_bmdma_port_start(ap);
if (ret < 0)
return ret;
return ret;
} }
static struct scsi_host_template pacpi_sht = { static struct scsi_host_template pacpi_sht = {

View file

@ -287,10 +287,10 @@ static void ali_warn_atapi_dma(struct ata_device *adev)
int print_info = ehc->i.flags & ATA_EHI_PRINTINFO; int print_info = ehc->i.flags & ATA_EHI_PRINTINFO;
if (print_info && adev->class == ATA_DEV_ATAPI && !ali_atapi_dma) { if (print_info && adev->class == ATA_DEV_ATAPI && !ali_atapi_dma) {
ata_dev_printk(adev, KERN_WARNING, ata_dev_warn(adev,
"WARNING: ATAPI DMA disabled for reliability issues. It can be enabled\n"); "WARNING: ATAPI DMA disabled for reliability issues. It can be enabled\n");
ata_dev_printk(adev, KERN_WARNING, ata_dev_warn(adev,
"WARNING: via pata_ali.atapi_dma modparam or corresponding sysfs node.\n"); "WARNING: via pata_ali.atapi_dma modparam or corresponding sysfs node.\n");
} }
} }

View file

@ -60,7 +60,7 @@ static void timing_setup(struct ata_port *ap, struct ata_device *adev, int offse
UT = T / 2; UT = T / 2;
if (ata_timing_compute(adev, speed, &at, T, UT) < 0) { if (ata_timing_compute(adev, speed, &at, T, UT) < 0) {
dev_printk(KERN_ERR, &pdev->dev, "unknown mode %d.\n", speed); dev_err(&pdev->dev, "unknown mode %d\n", speed);
return; return;
} }
@ -311,7 +311,7 @@ static unsigned long nv_mode_filter(struct ata_device *dev,
cable detection result */ cable detection result */
limit |= ata_pack_xfermask(ATA_PIO4, ATA_MWDMA2, ATA_UDMA2); limit |= ata_pack_xfermask(ATA_PIO4, ATA_MWDMA2, ATA_UDMA2);
ata_port_printk(ap, KERN_DEBUG, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, " ata_port_dbg(ap, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, "
"BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n", "BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n",
xfer_mask, limit, xfer_mask & limit, bios_limit, xfer_mask, limit, xfer_mask & limit, bios_limit,
saved_udma, acpi_limit, acpi_str); saved_udma, acpi_limit, acpi_str);
@ -530,14 +530,12 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
} }
}; };
const struct ata_port_info *ppi[] = { NULL, NULL }; const struct ata_port_info *ppi[] = { NULL, NULL };
static int printed_version;
int type = id->driver_data; int type = id->driver_data;
void *hpriv = NULL; void *hpriv = NULL;
u8 fifo; u8 fifo;
int rc; int rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)

View file

@ -346,7 +346,6 @@ static struct ata_port_operations artop6260_ops = {
static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
{ {
static int printed_version;
static const struct ata_port_info info_6210 = { static const struct ata_port_info info_6210 = {
.flags = ATA_FLAG_SLAVE_POSS, .flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
@ -378,9 +377,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
const struct ata_port_info *ppi[] = { NULL, NULL }; const struct ata_port_info *ppi[] = { NULL, NULL };
int rc; int rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)

View file

@ -470,7 +470,7 @@ static int atp867x_ata_pci_sff_init_host(struct ata_host *host)
} }
if (!mask) { if (!mask) {
dev_printk(KERN_ERR, gdev, "no available native port\n"); dev_err(gdev, "no available native port\n");
return -ENODEV; return -ENODEV;
} }
@ -487,7 +487,6 @@ static int atp867x_ata_pci_sff_init_host(struct ata_host *host)
static int atp867x_init_one(struct pci_dev *pdev, static int atp867x_init_one(struct pci_dev *pdev,
const struct pci_device_id *id) const struct pci_device_id *id)
{ {
static int printed_version;
static const struct ata_port_info info_867x = { static const struct ata_port_info info_867x = {
.flags = ATA_FLAG_SLAVE_POSS, .flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
@ -499,8 +498,7 @@ static int atp867x_init_one(struct pci_dev *pdev,
const struct ata_port_info *ppi[] = { &info_867x, NULL }; const struct ata_port_info *ppi[] = { &info_867x, NULL };
int rc; int rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)
@ -511,15 +509,14 @@ static int atp867x_init_one(struct pci_dev *pdev,
host = ata_host_alloc_pinfo(&pdev->dev, ppi, ATP867X_NUM_PORTS); host = ata_host_alloc_pinfo(&pdev->dev, ppi, ATP867X_NUM_PORTS);
if (!host) { if (!host) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "failed to allocate ATA host\n");
"failed to allocate ATA host\n");
rc = -ENOMEM; rc = -ENOMEM;
goto err_out; goto err_out;
} }
rc = atp867x_ata_pci_sff_init_host(host); rc = atp867x_ata_pci_sff_init_host(host);
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, "failed to init host\n"); dev_err(&pdev->dev, "failed to init host\n");
goto err_out; goto err_out;
} }
@ -528,7 +525,7 @@ static int atp867x_init_one(struct pci_dev *pdev,
rc = ata_host_activate(host, pdev->irq, ata_bmdma_interrupt, rc = ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
IRQF_SHARED, &atp867x_sht); IRQF_SHARED, &atp867x_sht);
if (rc) if (rc)
dev_printk(KERN_ERR, &pdev->dev, "failed to activate host\n"); dev_err(&pdev->dev, "failed to activate host\n");
err_out: err_out:
return rc; return rc;

View file

@ -1129,7 +1129,7 @@ static int bfin_softreset(struct ata_link *link, unsigned int *classes,
/* issue bus reset */ /* issue bus reset */
err_mask = bfin_bus_softreset(ap, devmask); err_mask = bfin_bus_softreset(ap, devmask);
if (err_mask) { if (err_mask) {
ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n", ata_port_err(ap, "SRST failed (err_mask=0x%x)\n",
err_mask); err_mask);
return -EIO; return -EIO;
} }
@ -1382,7 +1382,7 @@ idle_irq:
#ifdef ATA_IRQ_TRAP #ifdef ATA_IRQ_TRAP
if ((ap->stats.idle_irq % 1000) == 0) { if ((ap->stats.idle_irq % 1000) == 0) {
ap->ops->irq_ack(ap, 0); /* debug trap */ ap->ops->irq_ack(ap, 0); /* debug trap */
ata_port_printk(ap, KERN_WARNING, "irq trap\n"); ata_port_warn(ap, "irq trap\n");
return 1; return 1;
} }
#endif #endif

View file

@ -149,8 +149,7 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi
ppi[1] = &pi; ppi[1] = &pi;
if ((pcicfg & 0x40) == 0) { if ((pcicfg & 0x40) == 0) {
dev_printk(KERN_WARNING, &pdev->dev, dev_warn(&pdev->dev, "DMA mode disabled. Enabling.\n");
"DMA mode disabled. Enabling.\n");
pci_write_config_byte(pdev, 0x60, pcicfg | 0x40); pci_write_config_byte(pdev, 0x60, pcicfg | 0x40);
} }

View file

@ -263,7 +263,6 @@ static struct ata_port_operations efar_ops = {
static int efar_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) static int efar_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
static const struct ata_port_info info = { static const struct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS, .flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
@ -273,9 +272,7 @@ static int efar_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
}; };
const struct ata_port_info *ppi[] = { &info, &info }; const struct ata_port_info *ppi[] = { &info, &info };
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
return ata_pci_bmdma_init_one(pdev, ppi, &efar_sht, NULL, return ata_pci_bmdma_init_one(pdev, ppi, &efar_sht, NULL,
ATA_HOST_PARALLEL_SCAN); ATA_HOST_PARALLEL_SCAN);

View file

@ -185,7 +185,6 @@ static void hpt3x3_init_chipset(struct pci_dev *dev)
static int hpt3x3_init_one(struct pci_dev *pdev, const struct pci_device_id *id) static int hpt3x3_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
{ {
static int printed_version;
static const struct ata_port_info info = { static const struct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS, .flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
@ -206,8 +205,7 @@ static int hpt3x3_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
hpt3x3_init_chipset(pdev); hpt3x3_init_chipset(pdev);
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
host = ata_host_alloc_pinfo(&pdev->dev, ppi, 2); host = ata_host_alloc_pinfo(&pdev->dev, ppi, 2);
if (!host) if (!host)

View file

@ -210,8 +210,8 @@ static void pata_icside_set_dmamode(struct ata_port *ap, struct ata_device *adev
else else
iomd_type = 'A', cycle = 562; iomd_type = 'A', cycle = 562;
ata_dev_printk(adev, KERN_INFO, "timings: act %dns rec %dns cyc %dns (%c)\n", ata_dev_info(adev, "timings: act %dns rec %dns cyc %dns (%c)\n",
t.active, t.recover, t.cycle, iomd_type); t.active, t.recover, t.cycle, iomd_type);
state->port[ap->port_no].speed[adev->devno] = cycle; state->port[ap->port_no].speed[adev->devno] = cycle;
} }

View file

@ -258,7 +258,6 @@ static struct ata_port_operations it8213_ops = {
static int it8213_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) static int it8213_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
static const struct ata_port_info info = { static const struct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS, .flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
@ -269,9 +268,7 @@ static int it8213_init_one (struct pci_dev *pdev, const struct pci_device_id *en
/* Current IT8213 stuff is single port */ /* Current IT8213 stuff is single port */
const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info }; const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info };
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
return ata_pci_bmdma_init_one(pdev, ppi, &it8213_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &it8213_sht, NULL, 0);
} }

View file

@ -473,12 +473,12 @@ static int it821x_smart_set_mode(struct ata_link *link, struct ata_device **unus
/* We do need the right mode information for DMA or PIO /* We do need the right mode information for DMA or PIO
and this comes from the current configuration flags */ and this comes from the current configuration flags */
if (ata_id_has_dma(dev->id)) { if (ata_id_has_dma(dev->id)) {
ata_dev_printk(dev, KERN_INFO, "configured for DMA\n"); ata_dev_info(dev, "configured for DMA\n");
dev->xfer_mode = XFER_MW_DMA_0; dev->xfer_mode = XFER_MW_DMA_0;
dev->xfer_shift = ATA_SHIFT_MWDMA; dev->xfer_shift = ATA_SHIFT_MWDMA;
dev->flags &= ~ATA_DFLAG_PIO; dev->flags &= ~ATA_DFLAG_PIO;
} else { } else {
ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); ata_dev_info(dev, "configured for PIO\n");
dev->xfer_mode = XFER_PIO_0; dev->xfer_mode = XFER_PIO_0;
dev->xfer_shift = ATA_SHIFT_PIO; dev->xfer_shift = ATA_SHIFT_PIO;
dev->flags |= ATA_DFLAG_PIO; dev->flags |= ATA_DFLAG_PIO;
@ -508,12 +508,12 @@ static void it821x_dev_config(struct ata_device *adev)
if (strstr(model_num, "Integrated Technology Express")) { if (strstr(model_num, "Integrated Technology Express")) {
/* RAID mode */ /* RAID mode */
ata_dev_printk(adev, KERN_INFO, "%sRAID%d volume", ata_dev_info(adev, "%sRAID%d volume",
adev->id[147]?"Bootable ":"", adev->id[147] ? "Bootable " : "",
adev->id[129]); adev->id[129]);
if (adev->id[129] != 1) if (adev->id[129] != 1)
printk("(%dK stripe)", adev->id[146]); pr_cont("(%dK stripe)", adev->id[146]);
printk(".\n"); pr_cont("\n");
} }
/* This is a controller firmware triggered funny, don't /* This is a controller firmware triggered funny, don't
report the drive faulty! */ report the drive faulty! */
@ -610,7 +610,7 @@ static void it821x_display_disk(int n, u8 *buf)
char *cbl = "(40 wire cable)"; char *cbl = "(40 wire cable)";
static const char *types[5] = { static const char *types[5] = {
"RAID0", "RAID1" "RAID 0+1", "JBOD", "DISK" "RAID0", "RAID1", "RAID 0+1", "JBOD", "DISK"
}; };
if (buf[52] > 4) /* No Disk */ if (buf[52] > 4) /* No Disk */

View file

@ -31,7 +31,7 @@ static int ixp4xx_set_mode(struct ata_link *link, struct ata_device **error)
struct ata_device *dev; struct ata_device *dev;
ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev(dev, link, ENABLED) {
ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); ata_dev_info(dev, "configured for PIO0\n");
dev->pio_mode = XFER_PIO_0; dev->pio_mode = XFER_PIO_0;
dev->xfer_mode = XFER_PIO_0; dev->xfer_mode = XFER_PIO_0;
dev->xfer_shift = ATA_SHIFT_PIO; dev->xfer_shift = ATA_SHIFT_PIO;
@ -181,7 +181,7 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev)
ixp4xx_setup_port(ap, data, cs0->start, cs1->start); ixp4xx_setup_port(ap, data, cs0->start, cs1->start);
dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); ata_print_version_once(&pdev->dev, DRV_VERSION);
/* activate host */ /* activate host */
return ata_host_activate(host, irq, ata_sff_interrupt, 0, &ixp4xx_sht); return ata_host_activate(host, irq, ata_sff_interrupt, 0, &ixp4xx_sht);

View file

@ -213,7 +213,7 @@ static int legacy_set_mode(struct ata_link *link, struct ata_device **unused)
struct ata_device *dev; struct ata_device *dev;
ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev(dev, link, ENABLED) {
ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); ata_dev_info(dev, "configured for PIO\n");
dev->pio_mode = XFER_PIO_0; dev->pio_mode = XFER_PIO_0;
dev->xfer_mode = XFER_PIO_0; dev->xfer_mode = XFER_PIO_0;
dev->xfer_shift = ATA_SHIFT_PIO; dev->xfer_shift = ATA_SHIFT_PIO;

View file

@ -772,8 +772,9 @@ static void pata_macio_reset_hw(struct pata_macio_priv *priv, int resume)
pci_restore_state(priv->pdev); pci_restore_state(priv->pdev);
rc = pcim_enable_device(priv->pdev); rc = pcim_enable_device(priv->pdev);
if (rc) if (rc)
dev_printk(KERN_ERR, &priv->pdev->dev, dev_err(&priv->pdev->dev,
"Failed to enable device after resume (%d)\n", rc); "Failed to enable device after resume (%d)\n",
rc);
else else
pci_set_master(priv->pdev); pci_set_master(priv->pdev);
} }
@ -812,7 +813,7 @@ static int pata_macio_slave_config(struct scsi_device *sdev)
blk_queue_update_dma_pad(sdev->request_queue, 31); blk_queue_update_dma_pad(sdev->request_queue, 31);
/* Tell the world about it */ /* Tell the world about it */
ata_dev_printk(dev, KERN_INFO, "OHare alignment limits applied\n"); ata_dev_info(dev, "OHare alignment limits applied\n");
return 0; return 0;
} }
@ -838,8 +839,7 @@ static int pata_macio_slave_config(struct scsi_device *sdev)
cmd | PCI_COMMAND_INVALIDATE); cmd | PCI_COMMAND_INVALIDATE);
/* Tell the world about it */ /* Tell the world about it */
ata_dev_printk(dev, KERN_INFO, ata_dev_info(dev, "K2/Shasta alignment limits applied\n");
"K2/Shasta alignment limits applied\n");
} }
return 0; return 0;

View file

@ -152,15 +152,13 @@ static struct ata_port_operations mpiix_port_ops = {
static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id) static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
/* Single threaded by the PCI probe logic */ /* Single threaded by the PCI probe logic */
static int printed_version;
struct ata_host *host; struct ata_host *host;
struct ata_port *ap; struct ata_port *ap;
void __iomem *cmd_addr, *ctl_addr; void __iomem *cmd_addr, *ctl_addr;
u16 idetim; u16 idetim;
int cmd, ctl, irq; int cmd, ctl, irq;
if (!printed_version++) ata_print_version_once(&dev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n");
host = ata_host_alloc(&dev->dev, 1); host = ata_host_alloc(&dev->dev, 1);
if (!host) if (!host)

View file

@ -57,7 +57,6 @@ static struct ata_port_operations netcell_ops = {
static int netcell_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) static int netcell_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
static const struct ata_port_info info = { static const struct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS, .flags = ATA_FLAG_SLAVE_POSS,
/* Actually we don't really care about these as the /* Actually we don't really care about these as the
@ -70,9 +69,7 @@ static int netcell_init_one (struct pci_dev *pdev, const struct pci_device_id *e
const struct ata_port_info *port_info[] = { &info, NULL }; const struct ata_port_info *port_info[] = { &info, NULL };
int rc; int rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)

View file

@ -86,7 +86,7 @@ static void ns87410_set_piomode(struct ata_port *ap, struct ata_device *adev)
idefr &= ~0x04; idefr &= ~0x04;
if (ata_timing_compute(adev, adev->pio_mode, &at, 30303, 1) < 0) { if (ata_timing_compute(adev, adev->pio_mode, &at, 30303, 1) < 0) {
dev_printk(KERN_ERR, &pdev->dev, "unknown mode %d.\n", adev->pio_mode); dev_err(&pdev->dev, "unknown mode %d\n", adev->pio_mode);
return; return;
} }

View file

@ -350,7 +350,6 @@ static void ns87415_fixup(struct pci_dev *pdev)
static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
static const struct ata_port_info info = { static const struct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS, .flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
@ -370,9 +369,7 @@ static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *e
if (PCI_SLOT(pdev->devfn) == 0x0E) if (PCI_SLOT(pdev->devfn) == 0x0E)
ppi[0] = &info87560; ppi[0] = &info87560;
#endif #endif
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)

View file

@ -405,7 +405,7 @@ static int octeon_cf_softreset16(struct ata_link *link, unsigned int *classes,
rc = ata_sff_wait_after_reset(link, 1, deadline); rc = ata_sff_wait_after_reset(link, 1, deadline);
if (rc) { if (rc) {
ata_link_printk(link, KERN_ERR, "SRST failed (errno=%d)\n", rc); ata_link_err(link, "SRST failed (errno=%d)\n", rc);
return rc; return rc;
} }
@ -807,6 +807,7 @@ static int __devinit octeon_cf_probe(struct platform_device *pdev)
irq_handler_t irq_handler = NULL; irq_handler_t irq_handler = NULL;
void __iomem *base; void __iomem *base;
struct octeon_cf_port *cf_port; struct octeon_cf_port *cf_port;
char version[32];
res_cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0); res_cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@ -905,10 +906,11 @@ static int __devinit octeon_cf_probe(struct platform_device *pdev)
ata_port_desc(ap, "cmd %p ctl %p", base, ap->ioaddr.ctl_addr); ata_port_desc(ap, "cmd %p ctl %p", base, ap->ioaddr.ctl_addr);
dev_info(&pdev->dev, "version " DRV_VERSION" %d bit%s.\n", snprintf(version, sizeof(version), "%s %d bit%s",
DRV_VERSION,
(ocd->is16bit) ? 16 : 8, (ocd->is16bit) ? 16 : 8,
(cs1) ? ", True IDE" : ""); (cs1) ? ", True IDE" : "");
ata_print_version_once(&pdev->dev, version);
return ata_host_activate(host, irq, irq_handler, 0, &octeon_cf_sht); return ata_host_activate(host, irq, irq_handler, 0, &octeon_cf_sht);

View file

@ -235,7 +235,6 @@ static struct ata_port_operations oldpiix_pata_ops = {
static int oldpiix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) static int oldpiix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
static const struct ata_port_info info = { static const struct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS, .flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
@ -244,9 +243,7 @@ static int oldpiix_init_one (struct pci_dev *pdev, const struct pci_device_id *e
}; };
const struct ata_port_info *ppi[] = { &info, NULL }; const struct ata_port_info *ppi[] = { &info, NULL };
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
return ata_pci_bmdma_init_one(pdev, ppi, &oldpiix_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &oldpiix_sht, NULL, 0);
} }

View file

@ -167,10 +167,8 @@ static int opti_init_one(struct pci_dev *dev, const struct pci_device_id *id)
.port_ops = &opti_port_ops .port_ops = &opti_port_ops
}; };
const struct ata_port_info *ppi[] = { &info, NULL }; const struct ata_port_info *ppi[] = { &info, NULL };
static int printed_version;
if (!printed_version++) ata_print_version_once(&dev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n");
return ata_pci_sff_init_one(dev, ppi, &opti_sht, NULL, 0); return ata_pci_sff_init_one(dev, ppi, &opti_sht, NULL, 0);
} }

View file

@ -411,11 +411,9 @@ static int optidma_init_one(struct pci_dev *dev, const struct pci_device_id *id)
.port_ops = &optiplus_port_ops .port_ops = &optiplus_port_ops
}; };
const struct ata_port_info *ppi[] = { &info_82c700, NULL }; const struct ata_port_info *ppi[] = { &info_82c700, NULL };
static int printed_version;
int rc; int rc;
if (!printed_version++) ata_print_version_once(&dev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n");
rc = pcim_enable_device(dev); rc = pcim_enable_device(dev);
if (rc) if (rc)

View file

@ -68,7 +68,7 @@ static int pcmcia_set_mode(struct ata_link *link, struct ata_device **r_failed_d
the same vendor - check serial */ the same vendor - check serial */
if (memcmp(master->id + ATA_ID_SERNO, slave->id + ATA_ID_SERNO, if (memcmp(master->id + ATA_ID_SERNO, slave->id + ATA_ID_SERNO,
ATA_ID_SERNO_LEN) == 0 && master->id[ATA_ID_SERNO] >> 8) { ATA_ID_SERNO_LEN) == 0 && master->id[ATA_ID_SERNO] >> 8) {
ata_dev_printk(slave, KERN_WARNING, "is a ghost device, ignoring.\n"); ata_dev_warn(slave, "is a ghost device, ignoring\n");
ata_dev_disable(slave); ata_dev_disable(slave);
} }
} }
@ -142,8 +142,7 @@ static void pcmcia_8bit_drain_fifo(struct ata_queued_cmd *qc)
ioread8(ap->ioaddr.data_addr); ioread8(ap->ioaddr.data_addr);
if (count) if (count)
ata_port_printk(ap, KERN_WARNING, "drained %d bytes to clear DRQ.\n", ata_port_warn(ap, "drained %d bytes to clear DRQ\n", count);
count);
} }

View file

@ -655,7 +655,7 @@ static int pdc_hardware_init(struct ata_host *host, unsigned int board_idx)
*/ */
pll_clock = pdc_detect_pll_input_clock(host); pll_clock = pdc_detect_pll_input_clock(host);
dev_printk(KERN_INFO, host->dev, "PLL input clock %ld kHz\n", pll_clock/1000); dev_info(host->dev, "PLL input clock %ld kHz\n", pll_clock/1000);
/* Adjust PLL control register */ /* Adjust PLL control register */
pdc_adjust_pll(host, pll_clock, board_idx); pdc_adjust_pll(host, pll_clock, board_idx);
@ -697,7 +697,6 @@ static void pdc_ata_setup_port(struct ata_ioports *port, void __iomem *base)
*/ */
static int __devinit pdc2027x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) static int __devinit pdc2027x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
static const unsigned long cmd_offset[] = { 0x17c0, 0x15c0 }; static const unsigned long cmd_offset[] = { 0x17c0, 0x15c0 };
static const unsigned long bmdma_offset[] = { 0x1000, 0x1008 }; static const unsigned long bmdma_offset[] = { 0x1000, 0x1008 };
unsigned int board_idx = (unsigned int) ent->driver_data; unsigned int board_idx = (unsigned int) ent->driver_data;
@ -707,8 +706,7 @@ static int __devinit pdc2027x_init_one(struct pci_dev *pdev, const struct pci_de
void __iomem *mmio_base; void __iomem *mmio_base;
int i, rc; int i, rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* alloc host */ /* alloc host */
host = ata_host_alloc_pinfo(&pdev->dev, ppi, 2); host = ata_host_alloc_pinfo(&pdev->dev, ppi, 2);

View file

@ -39,7 +39,7 @@ static int pata_platform_set_mode(struct ata_link *link, struct ata_device **unu
dev->pio_mode = dev->xfer_mode = XFER_PIO_0; dev->pio_mode = dev->xfer_mode = XFER_PIO_0;
dev->xfer_shift = ATA_SHIFT_PIO; dev->xfer_shift = ATA_SHIFT_PIO;
dev->flags |= ATA_DFLAG_PIO; dev->flags |= ATA_DFLAG_PIO;
ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); ata_dev_info(dev, "configured for PIO\n");
} }
return 0; return 0;
} }

View file

@ -213,7 +213,6 @@ static struct ata_port_operations radisys_pata_ops = {
static int radisys_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) static int radisys_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
static const struct ata_port_info info = { static const struct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS, .flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4, .pio_mask = ATA_PIO4,
@ -223,9 +222,7 @@ static int radisys_init_one (struct pci_dev *pdev, const struct pci_device_id *e
}; };
const struct ata_port_info *ppi[] = { &info, NULL }; const struct ata_port_info *ppi[] = { &info, NULL };
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
return ata_pci_bmdma_init_one(pdev, ppi, &radisys_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &radisys_sht, NULL, 0);
} }

View file

@ -312,7 +312,6 @@ static struct scsi_host_template rdc_sht = {
static int __devinit rdc_init_one(struct pci_dev *pdev, static int __devinit rdc_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
static int printed_version;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct ata_port_info port_info[2]; struct ata_port_info port_info[2];
const struct ata_port_info *ppi[] = { &port_info[0], &port_info[1] }; const struct ata_port_info *ppi[] = { &port_info[0], &port_info[1] };
@ -321,9 +320,7 @@ static int __devinit rdc_init_one(struct pci_dev *pdev,
struct rdc_host_priv *hpriv; struct rdc_host_priv *hpriv;
int rc; int rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
port_info[0] = rdc_port_info; port_info[0] = rdc_port_info;
port_info[1] = rdc_port_info; port_info[1] = rdc_port_info;

View file

@ -44,7 +44,7 @@ static int rz1000_set_mode(struct ata_link *link, struct ata_device **unused)
dev->xfer_mode = XFER_PIO_0; dev->xfer_mode = XFER_PIO_0;
dev->xfer_shift = ATA_SHIFT_PIO; dev->xfer_shift = ATA_SHIFT_PIO;
dev->flags |= ATA_DFLAG_PIO; dev->flags |= ATA_DFLAG_PIO;
ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); ata_dev_info(dev, "configured for PIO\n");
} }
return 0; return 0;
} }
@ -92,7 +92,7 @@ static int rz1000_init_one (struct pci_dev *pdev, const struct pci_device_id *en
}; };
const struct ata_port_info *ppi[] = { &info, NULL }; const struct ata_port_info *ppi[] = { &info, NULL };
printk_once(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); ata_print_version_once(&pdev->dev, DRV_VERSION);
if (rz1000_fifo_disable(pdev) == 0) if (rz1000_fifo_disable(pdev) == 0)
return ata_pci_sff_init_one(pdev, ppi, &rz1000_sht, NULL, 0); return ata_pci_sff_init_one(pdev, ppi, &rz1000_sht, NULL, 0);

View file

@ -376,7 +376,7 @@ static int pata_s3c_softreset(struct ata_link *link, unsigned int *classes,
rc = pata_s3c_bus_softreset(ap, deadline); rc = pata_s3c_bus_softreset(ap, deadline);
/* if link is occupied, -ENODEV too is an error */ /* if link is occupied, -ENODEV too is an error */
if (rc && rc != -ENODEV) { if (rc && rc != -ENODEV) {
ata_link_printk(link, KERN_ERR, "SRST failed (errno=%d)\n", rc); ata_link_err(link, "SRST failed (errno=%d)\n", rc);
return rc; return rc;
} }

View file

@ -637,8 +637,7 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes,
DPRINTK("about to softreset, devmask=%x\n", devmask); DPRINTK("about to softreset, devmask=%x\n", devmask);
err_mask = scc_bus_softreset(ap, devmask, deadline); err_mask = scc_bus_softreset(ap, devmask, deadline);
if (err_mask) { if (err_mask) {
ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n", ata_port_err(ap, "SRST failed (err_mask=0x%x)\n", err_mask);
err_mask);
return -EIO; return -EIO;
} }
@ -1072,15 +1071,12 @@ static int scc_host_init(struct ata_host *host)
static int scc_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) static int scc_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
unsigned int board_idx = (unsigned int) ent->driver_data; unsigned int board_idx = (unsigned int) ent->driver_data;
const struct ata_port_info *ppi[] = { &scc_port_info[board_idx], NULL }; const struct ata_port_info *ppi[] = { &scc_port_info[board_idx], NULL };
struct ata_host *host; struct ata_host *host;
int rc; int rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
host = ata_host_alloc_pinfo(&pdev->dev, ppi, 1); host = ata_host_alloc_pinfo(&pdev->dev, ppi, 1);
if (!host) if (!host)

View file

@ -172,12 +172,9 @@ static void sch_set_dmamode(struct ata_port *ap, struct ata_device *adev)
static int __devinit sch_init_one(struct pci_dev *pdev, static int __devinit sch_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
static int printed_version;
const struct ata_port_info *ppi[] = { &sch_port_info, NULL }; const struct ata_port_info *ppi[] = { &sch_port_info, NULL };
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
return ata_pci_bmdma_init_one(pdev, ppi, &sch_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &sch_sht, NULL, 0);
} }

View file

@ -327,13 +327,11 @@ static int __devinit sil680_init_one(struct pci_dev *pdev,
.port_ops = &sil680_port_ops .port_ops = &sil680_port_ops
}; };
const struct ata_port_info *ppi[] = { &info, NULL }; const struct ata_port_info *ppi[] = { &info, NULL };
static int printed_version;
struct ata_host *host; struct ata_host *host;
void __iomem *mmio_base; void __iomem *mmio_base;
int rc, try_mmio; int rc, try_mmio;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)

View file

@ -681,7 +681,6 @@ static void sis_fixup(struct pci_dev *pdev, struct sis_chipset *sis)
static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
const struct ata_port_info *ppi[] = { NULL, NULL }; const struct ata_port_info *ppi[] = { NULL, NULL };
struct pci_dev *host = NULL; struct pci_dev *host = NULL;
struct sis_chipset *chipset = NULL; struct sis_chipset *chipset = NULL;
@ -735,9 +734,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
0x0, &sis_info100 0x0, &sis_info100
}; };
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)

View file

@ -317,9 +317,11 @@ static int sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id
rev = sl82c105_bridge_revision(dev); rev = sl82c105_bridge_revision(dev);
if (rev == -1) if (rev == -1)
dev_printk(KERN_WARNING, &dev->dev, "pata_sl82c105: Unable to find bridge, disabling DMA.\n"); dev_warn(&dev->dev,
"pata_sl82c105: Unable to find bridge, disabling DMA\n");
else if (rev <= 5) else if (rev <= 5)
dev_printk(KERN_WARNING, &dev->dev, "pata_sl82c105: Early bridge revision, no DMA available.\n"); dev_warn(&dev->dev,
"pata_sl82c105: Early bridge revision, no DMA available\n");
else else
ppi[0] = &info_dma; ppi[0] = &info_dma;

View file

@ -196,10 +196,8 @@ static int triflex_init_one(struct pci_dev *dev, const struct pci_device_id *id)
.port_ops = &triflex_port_ops .port_ops = &triflex_port_ops
}; };
const struct ata_port_info *ppi[] = { &info, NULL }; const struct ata_port_info *ppi[] = { &info, NULL };
static int printed_version;
if (!printed_version++) ata_print_version_once(&dev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n");
return ata_pci_bmdma_init_one(dev, ppi, &triflex_sht, NULL, 0); return ata_pci_bmdma_init_one(dev, ppi, &triflex_sht, NULL, 0);
} }

View file

@ -350,8 +350,8 @@ static unsigned long via_mode_filter(struct ata_device *dev, unsigned long mask)
if (config->id == PCI_DEVICE_ID_VIA_82C586_0) { if (config->id == PCI_DEVICE_ID_VIA_82C586_0) {
ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
if (strcmp(model_num, "TS64GSSD25-M") == 0) { if (strcmp(model_num, "TS64GSSD25-M") == 0) {
ata_dev_printk(dev, KERN_WARNING, ata_dev_warn(dev,
"disabling UDMA mode due to reported lockups with this device.\n"); "disabling UDMA mode due to reported lockups with this device\n");
mask &= ~ ATA_MASK_UDMA; mask &= ~ ATA_MASK_UDMA;
} }
} }
@ -551,14 +551,12 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
const struct ata_port_info *ppi[] = { NULL, NULL }; const struct ata_port_info *ppi[] = { NULL, NULL };
struct pci_dev *isa; struct pci_dev *isa;
const struct via_isa_bridge *config; const struct via_isa_bridge *config;
static int printed_version;
u8 enable; u8 enable;
u32 timing; u32 timing;
unsigned long flags = id->driver_data; unsigned long flags = id->driver_data;
int rc; int rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)

View file

@ -596,14 +596,12 @@ static int adma_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base)
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "32-bit DMA enable failed\n");
"32-bit DMA enable failed\n");
return rc; return rc;
} }
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "32-bit consistent DMA enable failed\n");
"32-bit consistent DMA enable failed\n");
return rc; return rc;
} }
return 0; return 0;
@ -612,15 +610,13 @@ static int adma_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base)
static int adma_ata_init_one(struct pci_dev *pdev, static int adma_ata_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
static int printed_version;
unsigned int board_idx = (unsigned int) ent->driver_data; unsigned int board_idx = (unsigned int) ent->driver_data;
const struct ata_port_info *ppi[] = { &adma_port_info[board_idx], NULL }; const struct ata_port_info *ppi[] = { &adma_port_info[board_idx], NULL };
struct ata_host *host; struct ata_host *host;
void __iomem *mmio_base; void __iomem *mmio_base;
int rc, port_no; int rc, port_no;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* alloc host */ /* alloc host */
host = ata_host_alloc_pinfo(&pdev->dev, ppi, ADMA_PORTS); host = ata_host_alloc_pinfo(&pdev->dev, ppi, ADMA_PORTS);

View file

@ -766,11 +766,15 @@ static int dma_dwc_xfer_setup(struct scatterlist *sg, int num_elems,
static void dma_dwc_exit(struct sata_dwc_device *hsdev) static void dma_dwc_exit(struct sata_dwc_device *hsdev)
{ {
dev_dbg(host_pvt.dwc_dev, "%s:\n", __func__); dev_dbg(host_pvt.dwc_dev, "%s:\n", __func__);
if (host_pvt.sata_dma_regs) if (host_pvt.sata_dma_regs) {
iounmap(host_pvt.sata_dma_regs); iounmap(host_pvt.sata_dma_regs);
host_pvt.sata_dma_regs = NULL;
}
if (hsdev->irq_dma) if (hsdev->irq_dma) {
free_irq(hsdev->irq_dma, hsdev); free_irq(hsdev->irq_dma, hsdev);
hsdev->irq_dma = 0;
}
} }
/* /*
@ -1642,7 +1646,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
if (hsdev == NULL) { if (hsdev == NULL) {
dev_err(&ofdev->dev, "kmalloc failed for hsdev\n"); dev_err(&ofdev->dev, "kmalloc failed for hsdev\n");
err = -ENOMEM; err = -ENOMEM;
goto error_out; goto error;
} }
memset(hsdev, 0, sizeof(*hsdev)); memset(hsdev, 0, sizeof(*hsdev));
@ -1652,7 +1656,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
dev_err(&ofdev->dev, "ioremap failed for SATA register" dev_err(&ofdev->dev, "ioremap failed for SATA register"
" address\n"); " address\n");
err = -ENODEV; err = -ENODEV;
goto error_out; goto error_kmalloc;
} }
hsdev->reg_base = base; hsdev->reg_base = base;
dev_dbg(&ofdev->dev, "ioremap done for SATA register address\n"); dev_dbg(&ofdev->dev, "ioremap done for SATA register address\n");
@ -1665,7 +1669,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
if (!host) { if (!host) {
dev_err(&ofdev->dev, "ata_host_alloc_pinfo failed\n"); dev_err(&ofdev->dev, "ata_host_alloc_pinfo failed\n");
err = -ENOMEM; err = -ENOMEM;
goto error_out; goto error_iomap;
} }
host->private_data = hsdev; host->private_data = hsdev;
@ -1733,8 +1737,11 @@ error_out:
/* Free SATA DMA resources */ /* Free SATA DMA resources */
dma_dwc_exit(hsdev); dma_dwc_exit(hsdev);
if (base) error_iomap:
iounmap(base); iounmap(base);
error_kmalloc:
kfree(hsdev);
error:
return err; return err;
} }

View file

@ -346,12 +346,11 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
/* warn if each s/g element is not dword aligned */ /* warn if each s/g element is not dword aligned */
if (sg_addr & 0x03) if (sg_addr & 0x03)
ata_port_printk(qc->ap, KERN_ERR, ata_port_err(qc->ap, "s/g addr unaligned : 0x%llx\n",
"s/g addr unaligned : 0x%llx\n", (unsigned long long)sg_addr);
(unsigned long long)sg_addr);
if (sg_len & 0x03) if (sg_len & 0x03)
ata_port_printk(qc->ap, KERN_ERR, ata_port_err(qc->ap, "s/g len unaligned : 0x%x\n",
"s/g len unaligned : 0x%x\n", sg_len); sg_len);
if (num_prde == (SATA_FSL_MAX_PRD_DIRECT - 1) && if (num_prde == (SATA_FSL_MAX_PRD_DIRECT - 1) &&
sg_next(sg) != NULL) { sg_next(sg) != NULL) {
@ -661,8 +660,7 @@ static int sata_fsl_port_start(struct ata_port *ap)
sata_fsl_scr_write(&ap->link, SCR_CONTROL, temp); sata_fsl_scr_write(&ap->link, SCR_CONTROL, temp);
sata_fsl_scr_read(&ap->link, SCR_CONTROL, &temp); sata_fsl_scr_read(&ap->link, SCR_CONTROL, &temp);
dev_printk(KERN_WARNING, dev, "scr_control, speed limited to %x\n", dev_warn(dev, "scr_control, speed limited to %x\n", temp);
temp);
#endif #endif
return 0; return 0;
@ -740,8 +738,7 @@ try_offline_again:
1, 500); 1, 500);
if (temp & ONLINE) { if (temp & ONLINE) {
ata_port_printk(ap, KERN_ERR, ata_port_err(ap, "Hardreset failed, not off-lined %d\n", i);
"Hardreset failed, not off-lined %d\n", i);
/* /*
* Try to offline controller atleast twice * Try to offline controller atleast twice
@ -777,8 +774,7 @@ try_offline_again:
temp = ata_wait_register(ap, hcr_base + HSTATUS, ONLINE, 0, 1, 500); temp = ata_wait_register(ap, hcr_base + HSTATUS, ONLINE, 0, 1, 500);
if (!(temp & ONLINE)) { if (!(temp & ONLINE)) {
ata_port_printk(ap, KERN_ERR, ata_port_err(ap, "Hardreset failed, not on-lined\n");
"Hardreset failed, not on-lined\n");
goto err; goto err;
} }
@ -794,9 +790,8 @@ try_offline_again:
temp = ata_wait_register(ap, hcr_base + HSTATUS, 0xFF, 0, 1, 500); temp = ata_wait_register(ap, hcr_base + HSTATUS, 0xFF, 0, 1, 500);
if ((!(temp & 0x10)) || ata_link_offline(link)) { if ((!(temp & 0x10)) || ata_link_offline(link)) {
ata_port_printk(ap, KERN_WARNING, ata_port_warn(ap, "No Device OR PHYRDY change,Hstatus = 0x%x\n",
"No Device OR PHYRDY change,Hstatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
ioread32(hcr_base + HSTATUS));
*class = ATA_DEV_NONE; *class = ATA_DEV_NONE;
return 0; return 0;
} }
@ -809,13 +804,12 @@ try_offline_again:
500, jiffies_to_msecs(deadline - start_jiffies)); 500, jiffies_to_msecs(deadline - start_jiffies));
if ((temp & 0xFF) != 0x18) { if ((temp & 0xFF) != 0x18) {
ata_port_printk(ap, KERN_WARNING, "No Signature Update\n"); ata_port_warn(ap, "No Signature Update\n");
*class = ATA_DEV_NONE; *class = ATA_DEV_NONE;
goto do_followup_srst; goto do_followup_srst;
} else { } else {
ata_port_printk(ap, KERN_INFO, ata_port_info(ap, "Signature Update detected @ %d msecs\n",
"Signature Update detected @ %d msecs\n", jiffies_to_msecs(jiffies - start_jiffies));
jiffies_to_msecs(jiffies - start_jiffies));
*class = sata_fsl_dev_classify(ap); *class = sata_fsl_dev_classify(ap);
return 0; return 0;
} }
@ -890,7 +884,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,
temp = ata_wait_register(ap, CQ + hcr_base, 0x1, 0x1, 1, 5000); temp = ata_wait_register(ap, CQ + hcr_base, 0x1, 0x1, 1, 5000);
if (temp & 0x1) { if (temp & 0x1) {
ata_port_printk(ap, KERN_WARNING, "ATA_SRST issue failed\n"); ata_port_warn(ap, "ATA_SRST issue failed\n");
DPRINTK("Softreset@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n", DPRINTK("Softreset@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n",
ioread32(CQ + hcr_base), ioread32(CQ + hcr_base),
@ -1202,8 +1196,7 @@ static irqreturn_t sata_fsl_interrupt(int irq, void *dev_instance)
if (ap) { if (ap) {
sata_fsl_host_intr(ap); sata_fsl_host_intr(ap);
} else { } else {
dev_printk(KERN_WARNING, host->dev, dev_warn(host->dev, "interrupt on disabled port 0\n");
"interrupt on disabled port 0\n");
} }
iowrite32(interrupt_enables, hcr_base + HSTATUS); iowrite32(interrupt_enables, hcr_base + HSTATUS);
@ -1317,8 +1310,7 @@ static int sata_fsl_probe(struct platform_device *ofdev)
struct ata_port_info pi = sata_fsl_port_info[0]; struct ata_port_info pi = sata_fsl_port_info[0];
const struct ata_port_info *ppi[] = { &pi, NULL }; const struct ata_port_info *ppi[] = { &pi, NULL };
dev_printk(KERN_INFO, &ofdev->dev, dev_info(&ofdev->dev, "Sata FSL Platform/CSB Driver init\n");
"Sata FSL Platform/CSB Driver init\n");
hcr_base = of_iomap(ofdev->dev.of_node, 0); hcr_base = of_iomap(ofdev->dev.of_node, 0);
if (!hcr_base) if (!hcr_base)
@ -1347,7 +1339,7 @@ static int sata_fsl_probe(struct platform_device *ofdev)
irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
if (irq < 0) { if (irq < 0) {
dev_printk(KERN_ERR, &ofdev->dev, "invalid irq from platform\n"); dev_err(&ofdev->dev, "invalid irq from platform\n");
goto error_exit_with_cleanup; goto error_exit_with_cleanup;
} }
host_priv->irq = irq; host_priv->irq = irq;
@ -1422,8 +1414,7 @@ static int sata_fsl_resume(struct platform_device *op)
ret = sata_fsl_init_controller(host); ret = sata_fsl_init_controller(host);
if (ret) { if (ret) {
dev_printk(KERN_ERR, &op->dev, dev_err(&op->dev, "Error initializing hardware\n");
"Error initialize hardware\n");
return ret; return ret;
} }

View file

@ -396,9 +396,8 @@ static void inic_host_intr(struct ata_port *ap)
} }
spurious: spurious:
ata_port_printk(ap, KERN_WARNING, "unhandled interrupt: " ata_port_warn(ap, "unhandled interrupt: cmd=0x%x irq_stat=0x%x idma_stat=0x%x\n",
"cmd=0x%x irq_stat=0x%x idma_stat=0x%x\n", qc ? qc->tf.command : 0xff, irq_stat, idma_stat);
qc ? qc->tf.command : 0xff, irq_stat, idma_stat);
} }
static irqreturn_t inic_interrupt(int irq, void *dev_instance) static irqreturn_t inic_interrupt(int irq, void *dev_instance)
@ -619,8 +618,9 @@ static int inic_hardreset(struct ata_link *link, unsigned int *class,
rc = sata_link_resume(link, timing, deadline); rc = sata_link_resume(link, timing, deadline);
if (rc) { if (rc) {
ata_link_printk(link, KERN_WARNING, "failed to resume " ata_link_warn(link,
"link after reset (errno=%d)\n", rc); "failed to resume link after reset (errno=%d)\n",
rc);
return rc; return rc;
} }
@ -632,8 +632,9 @@ static int inic_hardreset(struct ata_link *link, unsigned int *class,
rc = ata_wait_after_reset(link, deadline, inic_check_ready); rc = ata_wait_after_reset(link, deadline, inic_check_ready);
/* link occupied, -ENODEV too is an error */ /* link occupied, -ENODEV too is an error */
if (rc) { if (rc) {
ata_link_printk(link, KERN_WARNING, "device not ready " ata_link_warn(link,
"after hardreset (errno=%d)\n", rc); "device not ready after hardreset (errno=%d)\n",
rc);
return rc; return rc;
} }
@ -799,7 +800,6 @@ static int inic_pci_device_resume(struct pci_dev *pdev)
static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
const struct ata_port_info *ppi[] = { &inic_port_info, NULL }; const struct ata_port_info *ppi[] = { &inic_port_info, NULL };
struct ata_host *host; struct ata_host *host;
struct inic_host_priv *hpriv; struct inic_host_priv *hpriv;
@ -807,8 +807,7 @@ static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
int mmio_bar; int mmio_bar;
int i, rc; int i, rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* alloc host */ /* alloc host */
host = ata_host_alloc_pinfo(&pdev->dev, ppi, NR_PORTS); host = ata_host_alloc_pinfo(&pdev->dev, ppi, NR_PORTS);
@ -847,15 +846,13 @@ static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Set dma_mask. This devices doesn't support 64bit addressing. */ /* Set dma_mask. This devices doesn't support 64bit addressing. */
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "32-bit DMA enable failed\n");
"32-bit DMA enable failed\n");
return rc; return rc;
} }
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "32-bit consistent DMA enable failed\n");
"32-bit consistent DMA enable failed\n");
return rc; return rc;
} }
@ -866,15 +863,13 @@ static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
*/ */
rc = pci_set_dma_max_seg_size(pdev, 65536 - 512); rc = pci_set_dma_max_seg_size(pdev, 65536 - 512);
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "failed to set the maximum segment size\n");
"failed to set the maximum segment size.\n");
return rc; return rc;
} }
rc = init_controller(hpriv->mmio_base, hpriv->cached_hctl); rc = init_controller(hpriv->mmio_base, hpriv->cached_hctl);
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "failed to initialize controller\n");
"failed to initialize controller\n");
return rc; return rc;
} }

View file

@ -1190,7 +1190,7 @@ static void mv_wait_for_edma_empty_idle(struct ata_port *ap)
break; break;
udelay(per_loop); udelay(per_loop);
} }
/* ata_port_printk(ap, KERN_INFO, "%s: %u+ usecs\n", __func__, i); */ /* ata_port_info(ap, "%s: %u+ usecs\n", __func__, i); */
} }
/** /**
@ -1228,7 +1228,7 @@ static int mv_stop_edma(struct ata_port *ap)
pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN; pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN;
mv_wait_for_edma_empty_idle(ap); mv_wait_for_edma_empty_idle(ap);
if (mv_stop_edma_engine(port_mmio)) { if (mv_stop_edma_engine(port_mmio)) {
ata_port_printk(ap, KERN_ERR, "Unable to stop eDMA\n"); ata_port_err(ap, "Unable to stop eDMA\n");
err = -EIO; err = -EIO;
} }
mv_edma_cfg(ap, 0, 0); mv_edma_cfg(ap, 0, 0);
@ -1382,7 +1382,7 @@ static void mv6_dev_config(struct ata_device *adev)
if (adev->flags & ATA_DFLAG_NCQ) { if (adev->flags & ATA_DFLAG_NCQ) {
if (sata_pmp_attached(adev->link->ap)) { if (sata_pmp_attached(adev->link->ap)) {
adev->flags &= ~ATA_DFLAG_NCQ; adev->flags &= ~ATA_DFLAG_NCQ;
ata_dev_printk(adev, KERN_INFO, ata_dev_info(adev,
"NCQ disabled for command-based switching\n"); "NCQ disabled for command-based switching\n");
} }
} }
@ -2225,9 +2225,8 @@ static unsigned int mv_send_fis(struct ata_port *ap, u32 *fis, int nwords)
/* See if it worked */ /* See if it worked */
if ((ifstat & 0x3000) != 0x1000) { if ((ifstat & 0x3000) != 0x1000) {
ata_port_printk(ap, KERN_WARNING, ata_port_warn(ap, "%s transmission error, ifstat=%08x\n",
"%s transmission error, ifstat=%08x\n", __func__, ifstat);
__func__, ifstat);
return AC_ERR_OTHER; return AC_ERR_OTHER;
} }
return 0; return 0;
@ -2342,9 +2341,9 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
*/ */
if (limit_warnings > 0 && (qc->nbytes / qc->sect_size) > 1) { if (limit_warnings > 0 && (qc->nbytes / qc->sect_size) > 1) {
--limit_warnings; --limit_warnings;
ata_link_printk(qc->dev->link, KERN_WARNING, DRV_NAME ata_link_warn(qc->dev->link, DRV_NAME
": attempting PIO w/multiple DRQ: " ": attempting PIO w/multiple DRQ: "
"this may fail due to h/w errata\n"); "this may fail due to h/w errata\n");
} }
/* drop through */ /* drop through */
case ATA_PROT_NODATA: case ATA_PROT_NODATA:
@ -2499,20 +2498,20 @@ static int mv_handle_fbs_ncq_dev_err(struct ata_port *ap)
} }
failed_links = hweight16(new_map); failed_links = hweight16(new_map);
ata_port_printk(ap, KERN_INFO, "%s: pmp_map=%04x qc_map=%04x " ata_port_info(ap,
"failed_links=%d nr_active_links=%d\n", "%s: pmp_map=%04x qc_map=%04x failed_links=%d nr_active_links=%d\n",
__func__, pp->delayed_eh_pmp_map, __func__, pp->delayed_eh_pmp_map,
ap->qc_active, failed_links, ap->qc_active, failed_links,
ap->nr_active_links); ap->nr_active_links);
if (ap->nr_active_links <= failed_links && mv_req_q_empty(ap)) { if (ap->nr_active_links <= failed_links && mv_req_q_empty(ap)) {
mv_process_crpb_entries(ap, pp); mv_process_crpb_entries(ap, pp);
mv_stop_edma(ap); mv_stop_edma(ap);
mv_eh_freeze(ap); mv_eh_freeze(ap);
ata_port_printk(ap, KERN_INFO, "%s: done\n", __func__); ata_port_info(ap, "%s: done\n", __func__);
return 1; /* handled */ return 1; /* handled */
} }
ata_port_printk(ap, KERN_INFO, "%s: waiting\n", __func__); ata_port_info(ap, "%s: waiting\n", __func__);
return 1; /* handled */ return 1; /* handled */
} }
@ -2554,9 +2553,8 @@ static int mv_handle_dev_err(struct ata_port *ap, u32 edma_err_cause)
* and we cannot handle it here. * and we cannot handle it here.
*/ */
if (edma_err_cause & EDMA_ERR_SELF_DIS) { if (edma_err_cause & EDMA_ERR_SELF_DIS) {
ata_port_printk(ap, KERN_WARNING, ata_port_warn(ap, "%s: err_cause=0x%x pp_flags=0x%x\n",
"%s: err_cause=0x%x pp_flags=0x%x\n", __func__, edma_err_cause, pp->pp_flags);
__func__, edma_err_cause, pp->pp_flags);
return 0; /* not handled */ return 0; /* not handled */
} }
return mv_handle_fbs_ncq_dev_err(ap); return mv_handle_fbs_ncq_dev_err(ap);
@ -2567,9 +2565,8 @@ static int mv_handle_dev_err(struct ata_port *ap, u32 edma_err_cause)
* and we cannot handle it here. * and we cannot handle it here.
*/ */
if (!(edma_err_cause & EDMA_ERR_SELF_DIS)) { if (!(edma_err_cause & EDMA_ERR_SELF_DIS)) {
ata_port_printk(ap, KERN_WARNING, ata_port_warn(ap, "%s: err_cause=0x%x pp_flags=0x%x\n",
"%s: err_cause=0x%x pp_flags=0x%x\n", __func__, edma_err_cause, pp->pp_flags);
__func__, edma_err_cause, pp->pp_flags);
return 0; /* not handled */ return 0; /* not handled */
} }
return mv_handle_fbs_non_ncq_dev_err(ap); return mv_handle_fbs_non_ncq_dev_err(ap);
@ -2930,8 +2927,7 @@ static int mv_pci_error(struct ata_host *host, void __iomem *mmio)
err_cause = readl(mmio + hpriv->irq_cause_offset); err_cause = readl(mmio + hpriv->irq_cause_offset);
dev_printk(KERN_ERR, host->dev, "PCI ERROR; PCI IRQ cause=0x%08x\n", dev_err(host->dev, "PCI ERROR; PCI IRQ cause=0x%08x\n", err_cause);
err_cause);
DPRINTK("All regs @ PCI error\n"); DPRINTK("All regs @ PCI error\n");
mv_dump_all_regs(mmio, -1, to_pci_dev(host->dev)); mv_dump_all_regs(mmio, -1, to_pci_dev(host->dev));
@ -3760,8 +3756,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
hp_flags |= MV_HP_ERRATA_50XXB2; hp_flags |= MV_HP_ERRATA_50XXB2;
break; break;
default: default:
dev_printk(KERN_WARNING, &pdev->dev, dev_warn(&pdev->dev,
"Applying 50XXB2 workarounds to unknown rev\n"); "Applying 50XXB2 workarounds to unknown rev\n");
hp_flags |= MV_HP_ERRATA_50XXB2; hp_flags |= MV_HP_ERRATA_50XXB2;
break; break;
} }
@ -3780,8 +3776,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
hp_flags |= MV_HP_ERRATA_50XXB2; hp_flags |= MV_HP_ERRATA_50XXB2;
break; break;
default: default:
dev_printk(KERN_WARNING, &pdev->dev, dev_warn(&pdev->dev,
"Applying B2 workarounds to unknown rev\n"); "Applying B2 workarounds to unknown rev\n");
hp_flags |= MV_HP_ERRATA_50XXB2; hp_flags |= MV_HP_ERRATA_50XXB2;
break; break;
} }
@ -3801,8 +3797,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
hp_flags |= MV_HP_ERRATA_60X1C0; hp_flags |= MV_HP_ERRATA_60X1C0;
break; break;
default: default:
dev_printk(KERN_WARNING, &pdev->dev, dev_warn(&pdev->dev,
"Applying B2 workarounds to unknown rev\n"); "Applying B2 workarounds to unknown rev\n");
hp_flags |= MV_HP_ERRATA_60X1B2; hp_flags |= MV_HP_ERRATA_60X1B2;
break; break;
} }
@ -3851,8 +3847,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
hp_flags |= MV_HP_ERRATA_60X1C0; hp_flags |= MV_HP_ERRATA_60X1C0;
break; break;
default: default:
dev_printk(KERN_WARNING, &pdev->dev, dev_warn(&pdev->dev,
"Applying 60X1C0 workarounds to unknown rev\n"); "Applying 60X1C0 workarounds to unknown rev\n");
hp_flags |= MV_HP_ERRATA_60X1C0; hp_flags |= MV_HP_ERRATA_60X1C0;
break; break;
} }
@ -3867,8 +3863,7 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
break; break;
default: default:
dev_printk(KERN_ERR, host->dev, dev_err(host->dev, "BUG: invalid board index %u\n", board_idx);
"BUG: invalid board index %u\n", board_idx);
return 1; return 1;
} }
@ -4023,7 +4018,6 @@ static void mv_conf_mbus_windows(struct mv_host_priv *hpriv,
*/ */
static int mv_platform_probe(struct platform_device *pdev) static int mv_platform_probe(struct platform_device *pdev)
{ {
static int printed_version;
const struct mv_sata_platform_data *mv_platform_data; const struct mv_sata_platform_data *mv_platform_data;
const struct ata_port_info *ppi[] = const struct ata_port_info *ppi[] =
{ &mv_port_info[chip_soc], NULL }; { &mv_port_info[chip_soc], NULL };
@ -4032,8 +4026,7 @@ static int mv_platform_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
int n_ports, rc; int n_ports, rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n");
/* /*
* Simple resource validation .. * Simple resource validation ..
@ -4091,9 +4084,8 @@ static int mv_platform_probe(struct platform_device *pdev)
if (rc) if (rc)
goto err; goto err;
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev, "slots %u ports %d\n",
"slots %u ports %d\n", (unsigned)MV_MAX_Q_DEPTH, (unsigned)MV_MAX_Q_DEPTH, host->n_ports);
host->n_ports);
return ata_host_activate(host, platform_get_irq(pdev, 0), mv_interrupt, return ata_host_activate(host, platform_get_irq(pdev, 0), mv_interrupt,
IRQF_SHARED, &mv6_sht); IRQF_SHARED, &mv6_sht);
@ -4217,22 +4209,21 @@ static int pci_go_64(struct pci_dev *pdev)
if (rc) { if (rc) {
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"64-bit DMA enable failed\n"); "64-bit DMA enable failed\n");
return rc; return rc;
} }
} }
} else { } else {
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "32-bit DMA enable failed\n");
"32-bit DMA enable failed\n");
return rc; return rc;
} }
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"32-bit consistent DMA enable failed\n"); "32-bit consistent DMA enable failed\n");
return rc; return rc;
} }
} }
@ -4276,10 +4267,9 @@ static void mv_print_info(struct ata_host *host)
else else
gen = "?"; gen = "?";
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev, "Gen-%s %u slots %u ports %s mode IRQ via %s\n",
"Gen-%s %u slots %u ports %s mode IRQ via %s\n", gen, (unsigned)MV_MAX_Q_DEPTH, host->n_ports,
gen, (unsigned)MV_MAX_Q_DEPTH, host->n_ports, scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx");
scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx");
} }
/** /**
@ -4293,15 +4283,13 @@ static void mv_print_info(struct ata_host *host)
static int mv_pci_init_one(struct pci_dev *pdev, static int mv_pci_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
static int printed_version;
unsigned int board_idx = (unsigned int)ent->driver_data; unsigned int board_idx = (unsigned int)ent->driver_data;
const struct ata_port_info *ppi[] = { &mv_port_info[board_idx], NULL }; const struct ata_port_info *ppi[] = { &mv_port_info[board_idx], NULL };
struct ata_host *host; struct ata_host *host;
struct mv_host_priv *hpriv; struct mv_host_priv *hpriv;
int n_ports, port, rc; int n_ports, port, rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n");
/* allocate host */ /* allocate host */
n_ports = mv_get_hc_count(ppi[0]->flags) * MV_PORTS_PER_HC; n_ports = mv_get_hc_count(ppi[0]->flags) * MV_PORTS_PER_HC;

View file

@ -620,9 +620,8 @@ static void nv_adma_register_mode(struct ata_port *ap)
count++; count++;
} }
if (count == 20) if (count == 20)
ata_port_printk(ap, KERN_WARNING, ata_port_warn(ap, "timeout waiting for ADMA IDLE, stat=0x%hx\n",
"timeout waiting for ADMA IDLE, stat=0x%hx\n", status);
status);
tmp = readw(mmio + NV_ADMA_CTL); tmp = readw(mmio + NV_ADMA_CTL);
writew(tmp & ~NV_ADMA_CTL_GO, mmio + NV_ADMA_CTL); writew(tmp & ~NV_ADMA_CTL_GO, mmio + NV_ADMA_CTL);
@ -635,9 +634,9 @@ static void nv_adma_register_mode(struct ata_port *ap)
count++; count++;
} }
if (count == 20) if (count == 20)
ata_port_printk(ap, KERN_WARNING, ata_port_warn(ap,
"timeout waiting for ADMA LEGACY, stat=0x%hx\n", "timeout waiting for ADMA LEGACY, stat=0x%hx\n",
status); status);
pp->flags |= NV_ADMA_PORT_REGISTER_MODE; pp->flags |= NV_ADMA_PORT_REGISTER_MODE;
} }
@ -665,7 +664,7 @@ static void nv_adma_mode(struct ata_port *ap)
count++; count++;
} }
if (count == 20) if (count == 20)
ata_port_printk(ap, KERN_WARNING, ata_port_warn(ap,
"timeout waiting for ADMA LEGACY clear and IDLE, stat=0x%hx\n", "timeout waiting for ADMA LEGACY clear and IDLE, stat=0x%hx\n",
status); status);
@ -772,10 +771,10 @@ static int nv_adma_slave_config(struct scsi_device *sdev)
blk_queue_segment_boundary(sdev->request_queue, segment_boundary); blk_queue_segment_boundary(sdev->request_queue, segment_boundary);
blk_queue_max_segments(sdev->request_queue, sg_tablesize); blk_queue_max_segments(sdev->request_queue, sg_tablesize);
ata_port_printk(ap, KERN_INFO, ata_port_info(ap,
"DMA mask 0x%llX, segment boundary 0x%lX, hw segs %hu\n", "DMA mask 0x%llX, segment boundary 0x%lX, hw segs %hu\n",
(unsigned long long)*ap->host->dev->dma_mask, (unsigned long long)*ap->host->dev->dma_mask,
segment_boundary, sg_tablesize); segment_boundary, sg_tablesize);
spin_unlock_irqrestore(ap->lock, flags); spin_unlock_irqrestore(ap->lock, flags);
@ -1443,8 +1442,7 @@ static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc)
existing commands. */ existing commands. */
if (unlikely(qc->tf.protocol == ATA_PROT_NCQ && if (unlikely(qc->tf.protocol == ATA_PROT_NCQ &&
(qc->flags & ATA_QCFLAG_RESULT_TF))) { (qc->flags & ATA_QCFLAG_RESULT_TF))) {
ata_dev_printk(qc->dev, KERN_ERR, ata_dev_err(qc->dev, "NCQ w/ RESULT_TF not allowed\n");
"NCQ w/ RESULT_TF not allowed\n");
return AC_ERR_SYSTEM; return AC_ERR_SYSTEM;
} }
@ -1581,15 +1579,15 @@ static int nv_hardreset(struct ata_link *link, unsigned int *class,
int rc; int rc;
if (!(ehc->i.flags & ATA_EHI_QUIET)) if (!(ehc->i.flags & ATA_EHI_QUIET))
ata_link_printk(link, KERN_INFO, "nv: skipping " ata_link_info(link,
"hardreset on occupied port\n"); "nv: skipping hardreset on occupied port\n");
/* make sure the link is online */ /* make sure the link is online */
rc = sata_link_resume(link, timing, deadline); rc = sata_link_resume(link, timing, deadline);
/* whine about phy resume failure but proceed */ /* whine about phy resume failure but proceed */
if (rc && rc != -EOPNOTSUPP) if (rc && rc != -EOPNOTSUPP)
ata_link_printk(link, KERN_WARNING, "failed to resume " ata_link_warn(link, "failed to resume link (errno=%d)\n",
"link (errno=%d)\n", rc); rc);
} }
/* device signature acquisition is unreliable */ /* device signature acquisition is unreliable */
@ -1686,7 +1684,7 @@ static void nv_adma_error_handler(struct ata_port *ap)
u8 cpb_count = readb(mmio + NV_ADMA_CPB_COUNT); u8 cpb_count = readb(mmio + NV_ADMA_CPB_COUNT);
u8 next_cpb_idx = readb(mmio + NV_ADMA_NEXT_CPB_IDX); u8 next_cpb_idx = readb(mmio + NV_ADMA_NEXT_CPB_IDX);
ata_port_printk(ap, KERN_ERR, ata_port_err(ap,
"EH in ADMA mode, notifier 0x%X " "EH in ADMA mode, notifier 0x%X "
"notifier_error 0x%X gen_ctl 0x%X status 0x%X " "notifier_error 0x%X gen_ctl 0x%X status 0x%X "
"next cpb count 0x%X next cpb idx 0x%x\n", "next cpb count 0x%X next cpb idx 0x%x\n",
@ -1697,7 +1695,7 @@ static void nv_adma_error_handler(struct ata_port *ap)
struct nv_adma_cpb *cpb = &pp->cpb[i]; struct nv_adma_cpb *cpb = &pp->cpb[i];
if ((ata_tag_valid(ap->link.active_tag) && i == ap->link.active_tag) || if ((ata_tag_valid(ap->link.active_tag) && i == ap->link.active_tag) ||
ap->link.sactive & (1 << i)) ap->link.sactive & (1 << i))
ata_port_printk(ap, KERN_ERR, ata_port_err(ap,
"CPB %d: ctl_flags 0x%x, resp_flags 0x%x\n", "CPB %d: ctl_flags 0x%x, resp_flags 0x%x\n",
i, cpb->ctl_flags, cpb->resp_flags); i, cpb->ctl_flags, cpb->resp_flags);
} }
@ -1799,23 +1797,22 @@ static void nv_swncq_ncq_stop(struct ata_port *ap)
u32 sactive; u32 sactive;
u32 done_mask; u32 done_mask;
ata_port_printk(ap, KERN_ERR, ata_port_err(ap, "EH in SWNCQ mode,QC:qc_active 0x%X sactive 0x%X\n",
"EH in SWNCQ mode,QC:qc_active 0x%X sactive 0x%X\n", ap->qc_active, ap->link.sactive);
ap->qc_active, ap->link.sactive); ata_port_err(ap,
ata_port_printk(ap, KERN_ERR,
"SWNCQ:qc_active 0x%X defer_bits 0x%X last_issue_tag 0x%x\n " "SWNCQ:qc_active 0x%X defer_bits 0x%X last_issue_tag 0x%x\n "
"dhfis 0x%X dmafis 0x%X sdbfis 0x%X\n", "dhfis 0x%X dmafis 0x%X sdbfis 0x%X\n",
pp->qc_active, pp->defer_queue.defer_bits, pp->last_issue_tag, pp->qc_active, pp->defer_queue.defer_bits, pp->last_issue_tag,
pp->dhfis_bits, pp->dmafis_bits, pp->sdbfis_bits); pp->dhfis_bits, pp->dmafis_bits, pp->sdbfis_bits);
ata_port_printk(ap, KERN_ERR, "ATA_REG 0x%X ERR_REG 0x%X\n", ata_port_err(ap, "ATA_REG 0x%X ERR_REG 0x%X\n",
ap->ops->sff_check_status(ap), ap->ops->sff_check_status(ap),
ioread8(ap->ioaddr.error_addr)); ioread8(ap->ioaddr.error_addr));
sactive = readl(pp->sactive_block); sactive = readl(pp->sactive_block);
done_mask = pp->qc_active ^ sactive; done_mask = pp->qc_active ^ sactive;
ata_port_printk(ap, KERN_ERR, "tag : dhfis dmafis sdbfis sacitve\n"); ata_port_err(ap, "tag : dhfis dmafis sdbfis sactive\n");
for (i = 0; i < ATA_MAX_QUEUE; i++) { for (i = 0; i < ATA_MAX_QUEUE; i++) {
u8 err = 0; u8 err = 0;
if (pp->qc_active & (1 << i)) if (pp->qc_active & (1 << i))
@ -1825,13 +1822,13 @@ static void nv_swncq_ncq_stop(struct ata_port *ap)
else else
continue; continue;
ata_port_printk(ap, KERN_ERR, ata_port_err(ap,
"tag 0x%x: %01x %01x %01x %01x %s\n", i, "tag 0x%x: %01x %01x %01x %01x %s\n", i,
(pp->dhfis_bits >> i) & 0x1, (pp->dhfis_bits >> i) & 0x1,
(pp->dmafis_bits >> i) & 0x1, (pp->dmafis_bits >> i) & 0x1,
(pp->sdbfis_bits >> i) & 0x1, (pp->sdbfis_bits >> i) & 0x1,
(sactive >> i) & 0x1, (sactive >> i) & 0x1,
(err ? "error! tag doesn't exit" : " ")); (err ? "error! tag doesn't exit" : " "));
} }
nv_swncq_pp_reinit(ap); nv_swncq_pp_reinit(ap);
@ -1956,8 +1953,8 @@ static int nv_swncq_slave_config(struct scsi_device *sdev)
if (strncmp(model_num, "Maxtor", 6) == 0) { if (strncmp(model_num, "Maxtor", 6) == 0) {
ata_scsi_change_queue_depth(sdev, 1, SCSI_QDEPTH_DEFAULT); ata_scsi_change_queue_depth(sdev, 1, SCSI_QDEPTH_DEFAULT);
ata_dev_printk(dev, KERN_NOTICE, ata_dev_notice(dev, "Disabling SWNCQ mode (depth %x)\n",
"Disabling SWNCQ mode (depth %x)\n", sdev->queue_depth); sdev->queue_depth);
} }
return rc; return rc;
@ -2356,7 +2353,6 @@ static irqreturn_t nv_swncq_interrupt(int irq, void *dev_instance)
static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
const struct ata_port_info *ppi[] = { NULL, NULL }; const struct ata_port_info *ppi[] = { NULL, NULL };
struct nv_pi_priv *ipriv; struct nv_pi_priv *ipriv;
struct ata_host *host; struct ata_host *host;
@ -2373,8 +2369,7 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (pci_resource_start(pdev, bar) == 0) if (pci_resource_start(pdev, bar) == 0)
return -ENODEV; return -ENODEV;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)
@ -2382,10 +2377,10 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* determine type and allocate host */ /* determine type and allocate host */
if (type == CK804 && adma_enabled) { if (type == CK804 && adma_enabled) {
dev_printk(KERN_NOTICE, &pdev->dev, "Using ADMA mode\n"); dev_notice(&pdev->dev, "Using ADMA mode\n");
type = ADMA; type = ADMA;
} else if (type == MCP5x && swncq_enabled) { } else if (type == MCP5x && swncq_enabled) {
dev_printk(KERN_NOTICE, &pdev->dev, "Using SWNCQ mode\n"); dev_notice(&pdev->dev, "Using SWNCQ mode\n");
type = SWNCQ; type = SWNCQ;
} }
@ -2429,7 +2424,7 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
nv_swncq_host_init(host); nv_swncq_host_init(host);
if (msi_enabled) { if (msi_enabled) {
dev_printk(KERN_NOTICE, &pdev->dev, "Using MSI\n"); dev_notice(&pdev->dev, "Using MSI\n");
pci_enable_msi(pdev); pci_enable_msi(pdev);
} }

View file

@ -1179,7 +1179,6 @@ static void pdc_host_init(struct ata_host *host)
static int pdc_ata_init_one(struct pci_dev *pdev, static int pdc_ata_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
static int printed_version;
const struct ata_port_info *pi = &pdc_port_info[ent->driver_data]; const struct ata_port_info *pi = &pdc_port_info[ent->driver_data];
const struct ata_port_info *ppi[PDC_MAX_PORTS]; const struct ata_port_info *ppi[PDC_MAX_PORTS];
struct ata_host *host; struct ata_host *host;
@ -1187,8 +1186,7 @@ static int pdc_ata_init_one(struct pci_dev *pdev,
int n_ports, i, rc; int n_ports, i, rc;
int is_sataii_tx4; int is_sataii_tx4;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* enable and acquire resources */ /* enable and acquire resources */
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
@ -1217,7 +1215,7 @@ static int pdc_ata_init_one(struct pci_dev *pdev,
host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports); host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
if (!host) { if (!host) {
dev_printk(KERN_ERR, &pdev->dev, "failed to allocate host\n"); dev_err(&pdev->dev, "failed to allocate host\n");
return -ENOMEM; return -ENOMEM;
} }
host->iomap = pcim_iomap_table(pdev); host->iomap = pcim_iomap_table(pdev);

View file

@ -563,21 +563,20 @@ static int qs_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base)
if (rc) { if (rc) {
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"64-bit DMA enable failed\n"); "64-bit DMA enable failed\n");
return rc; return rc;
} }
} }
} else { } else {
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "32-bit DMA enable failed\n");
"32-bit DMA enable failed\n");
return rc; return rc;
} }
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"32-bit consistent DMA enable failed\n"); "32-bit consistent DMA enable failed\n");
return rc; return rc;
} }
@ -588,14 +587,12 @@ static int qs_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base)
static int qs_ata_init_one(struct pci_dev *pdev, static int qs_ata_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
static int printed_version;
unsigned int board_idx = (unsigned int) ent->driver_data; unsigned int board_idx = (unsigned int) ent->driver_data;
const struct ata_port_info *ppi[] = { &qs_port_info[board_idx], NULL }; const struct ata_port_info *ppi[] = { &qs_port_info[board_idx], NULL };
struct ata_host *host; struct ata_host *host;
int rc, port_no; int rc, port_no;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* alloc host */ /* alloc host */
host = ata_host_alloc_pinfo(&pdev->dev, ppi, QS_PORTS); host = ata_host_alloc_pinfo(&pdev->dev, ppi, QS_PORTS);

View file

@ -643,8 +643,8 @@ static void sil_dev_config(struct ata_device *dev)
((ap->flags & SIL_FLAG_MOD15WRITE) && ((ap->flags & SIL_FLAG_MOD15WRITE) &&
(quirks & SIL_QUIRK_MOD15WRITE))) { (quirks & SIL_QUIRK_MOD15WRITE))) {
if (print_info) if (print_info)
ata_dev_printk(dev, KERN_INFO, "applying Seagate " ata_dev_info(dev,
"errata fix (mod15write workaround)\n"); "applying Seagate errata fix (mod15write workaround)\n");
dev->max_sectors = 15; dev->max_sectors = 15;
return; return;
} }
@ -652,8 +652,8 @@ static void sil_dev_config(struct ata_device *dev)
/* limit to udma5 */ /* limit to udma5 */
if (quirks & SIL_QUIRK_UDMA5MAX) { if (quirks & SIL_QUIRK_UDMA5MAX) {
if (print_info) if (print_info)
ata_dev_printk(dev, KERN_INFO, "applying Maxtor " ata_dev_info(dev, "applying Maxtor errata fix %s\n",
"errata fix %s\n", model_num); model_num);
dev->udma_mask &= ATA_UDMA5; dev->udma_mask &= ATA_UDMA5;
return; return;
} }
@ -676,8 +676,8 @@ static void sil_init_controller(struct ata_host *host)
writew(cls << 8 | cls, writew(cls << 8 | cls,
mmio_base + sil_port[i].fifo_cfg); mmio_base + sil_port[i].fifo_cfg);
} else } else
dev_printk(KERN_WARNING, &pdev->dev, dev_warn(&pdev->dev,
"cache line size not set. Driver may not function\n"); "cache line size not set. Driver may not function\n");
/* Apply R_ERR on DMA activate FIS errata workaround */ /* Apply R_ERR on DMA activate FIS errata workaround */
if (host->ports[0]->flags & SIL_FLAG_RERR_ON_DMA_ACT) { if (host->ports[0]->flags & SIL_FLAG_RERR_ON_DMA_ACT) {
@ -688,9 +688,8 @@ static void sil_init_controller(struct ata_host *host)
if ((tmp & 0x3) != 0x01) if ((tmp & 0x3) != 0x01)
continue; continue;
if (!cnt) if (!cnt)
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev,
"Applying R_ERR on DMA activate " "Applying R_ERR on DMA activate FIS errata fix\n");
"FIS errata fix\n");
writel(tmp & ~0x3, mmio_base + sil_port[i].sfis_cfg); writel(tmp & ~0x3, mmio_base + sil_port[i].sfis_cfg);
cnt++; cnt++;
} }
@ -733,7 +732,6 @@ static bool sil_broken_system_poweroff(struct pci_dev *pdev)
static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
int board_id = ent->driver_data; int board_id = ent->driver_data;
struct ata_port_info pi = sil_port_info[board_id]; struct ata_port_info pi = sil_port_info[board_id];
const struct ata_port_info *ppi[] = { &pi, NULL }; const struct ata_port_info *ppi[] = { &pi, NULL };
@ -742,8 +740,7 @@ static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
int n_ports, rc; int n_ports, rc;
unsigned int i; unsigned int i;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* allocate host */ /* allocate host */
n_ports = 2; n_ports = 2;

View file

@ -694,7 +694,7 @@ static int sil24_softreset(struct ata_link *link, unsigned int *class,
return 0; return 0;
err: err:
ata_link_printk(link, KERN_ERR, "softreset failed (%s)\n", reason); ata_link_err(link, "softreset failed (%s)\n", reason);
return -EIO; return -EIO;
} }
@ -714,8 +714,8 @@ static int sil24_hardreset(struct ata_link *link, unsigned int *class,
* This happens often after PM DMA CS errata. * This happens often after PM DMA CS errata.
*/ */
if (pp->do_port_rst) { if (pp->do_port_rst) {
ata_port_printk(ap, KERN_WARNING, "controller in dubious " ata_port_warn(ap,
"state, performing PORT_RST\n"); "controller in dubious state, performing PORT_RST\n");
writel(PORT_CS_PORT_RST, port + PORT_CTRL_STAT); writel(PORT_CS_PORT_RST, port + PORT_CTRL_STAT);
ata_msleep(ap, 10); ata_msleep(ap, 10);
@ -773,7 +773,7 @@ static int sil24_hardreset(struct ata_link *link, unsigned int *class,
goto retry; goto retry;
} }
ata_link_printk(link, KERN_ERR, "hardreset failed (%s)\n", reason); ata_link_err(link, "hardreset failed (%s)\n", reason);
return -EIO; return -EIO;
} }
@ -925,7 +925,7 @@ static void sil24_pmp_attach(struct ata_port *ap)
if (sata_pmp_gscr_vendor(gscr) == 0x11ab && if (sata_pmp_gscr_vendor(gscr) == 0x11ab &&
sata_pmp_gscr_devid(gscr) == 0x4140) { sata_pmp_gscr_devid(gscr) == 0x4140) {
ata_port_printk(ap, KERN_INFO, ata_port_info(ap,
"disabling NCQ support due to sil24-mv4140 quirk\n"); "disabling NCQ support due to sil24-mv4140 quirk\n");
ap->flags &= ~ATA_FLAG_NCQ; ap->flags &= ~ATA_FLAG_NCQ;
} }
@ -946,8 +946,7 @@ static int sil24_pmp_hardreset(struct ata_link *link, unsigned int *class,
rc = sil24_init_port(link->ap); rc = sil24_init_port(link->ap);
if (rc) { if (rc) {
ata_link_printk(link, KERN_ERR, ata_link_err(link, "hardreset failed (port not ready)\n");
"hardreset failed (port not ready)\n");
return rc; return rc;
} }
@ -1141,8 +1140,8 @@ static inline void sil24_host_intr(struct ata_port *ap)
/* spurious interrupts are expected if PCIX_IRQ_WOC */ /* spurious interrupts are expected if PCIX_IRQ_WOC */
if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit()) if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit())
ata_port_printk(ap, KERN_INFO, "spurious interrupt " ata_port_info(ap,
"(slot_stat 0x%x active_tag %d sactive 0x%x)\n", "spurious interrupt (slot_stat 0x%x active_tag %d sactive 0x%x)\n",
slot_stat, ap->link.active_tag, ap->link.sactive); slot_stat, ap->link.active_tag, ap->link.sactive);
} }
@ -1256,8 +1255,8 @@ static void sil24_init_controller(struct ata_host *host)
PORT_CS_PORT_RST, PORT_CS_PORT_RST,
PORT_CS_PORT_RST, 10, 100); PORT_CS_PORT_RST, 10, 100);
if (tmp & PORT_CS_PORT_RST) if (tmp & PORT_CS_PORT_RST)
dev_printk(KERN_ERR, host->dev, dev_err(host->dev,
"failed to clear port RST\n"); "failed to clear port RST\n");
} }
/* configure port */ /* configure port */
@ -1271,7 +1270,6 @@ static void sil24_init_controller(struct ata_host *host)
static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
extern int __MARKER__sil24_cmd_block_is_sized_wrongly; extern int __MARKER__sil24_cmd_block_is_sized_wrongly;
static int printed_version;
struct ata_port_info pi = sil24_port_info[ent->driver_data]; struct ata_port_info pi = sil24_port_info[ent->driver_data];
const struct ata_port_info *ppi[] = { &pi, NULL }; const struct ata_port_info *ppi[] = { &pi, NULL };
void __iomem * const *iomap; void __iomem * const *iomap;
@ -1283,8 +1281,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (sizeof(union sil24_cmd_block) != PAGE_SIZE) if (sizeof(union sil24_cmd_block) != PAGE_SIZE)
__MARKER__sil24_cmd_block_is_sized_wrongly = 1; __MARKER__sil24_cmd_block_is_sized_wrongly = 1;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* acquire resources */ /* acquire resources */
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
@ -1302,9 +1299,8 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (pi.flags & SIL24_FLAG_PCIX_IRQ_WOC) { if (pi.flags & SIL24_FLAG_PCIX_IRQ_WOC) {
tmp = readl(iomap[SIL24_HOST_BAR] + HOST_CTRL); tmp = readl(iomap[SIL24_HOST_BAR] + HOST_CTRL);
if (tmp & (HOST_CTRL_TRDY | HOST_CTRL_STOP | HOST_CTRL_DEVSEL)) if (tmp & (HOST_CTRL_TRDY | HOST_CTRL_STOP | HOST_CTRL_DEVSEL))
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev,
"Applying completion IRQ loss on PCI-X " "Applying completion IRQ loss on PCI-X errata fix\n");
"errata fix\n");
else else
pi.flags &= ~SIL24_FLAG_PCIX_IRQ_WOC; pi.flags &= ~SIL24_FLAG_PCIX_IRQ_WOC;
} }
@ -1322,22 +1318,21 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc) { if (rc) {
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"64-bit DMA enable failed\n"); "64-bit DMA enable failed\n");
return rc; return rc;
} }
} }
} else { } else {
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev, "32-bit DMA enable failed\n");
"32-bit DMA enable failed\n");
return rc; return rc;
} }
rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"32-bit consistent DMA enable failed\n"); "32-bit consistent DMA enable failed\n");
return rc; return rc;
} }
} }
@ -1350,7 +1345,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
sil24_init_controller(host); sil24_init_controller(host);
if (sata_sil24_msi && !pci_enable_msi(pdev)) { if (sata_sil24_msi && !pci_enable_msi(pdev)) {
dev_printk(KERN_INFO, &pdev->dev, "Using MSI\n"); dev_info(&pdev->dev, "Using MSI\n");
pci_intx(pdev, 0); pci_intx(pdev, 0);
} }

View file

@ -193,7 +193,6 @@ static int sis_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val)
static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
struct ata_port_info pi = sis_port_info; struct ata_port_info pi = sis_port_info;
const struct ata_port_info *ppi[] = { &pi, &pi }; const struct ata_port_info *ppi[] = { &pi, &pi };
struct ata_host *host; struct ata_host *host;
@ -202,8 +201,7 @@ static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
u8 port2_start = 0x20; u8 port2_start = 0x20;
int i, rc; int i, rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)
@ -241,12 +239,12 @@ static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
break; break;
} }
if ((pmr & SIS_PMR_COMBINED) == 0) { if ((pmr & SIS_PMR_COMBINED) == 0) {
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev,
"Detected SiS 180/181/964 chipset in SATA mode\n"); "Detected SiS 180/181/964 chipset in SATA mode\n");
port2_start = 64; port2_start = 64;
} else { } else {
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev,
"Detected SiS 180/181 chipset in combined mode\n"); "Detected SiS 180/181 chipset in combined mode\n");
port2_start = 0; port2_start = 0;
pi.flags |= ATA_FLAG_SLAVE_POSS; pi.flags |= ATA_FLAG_SLAVE_POSS;
} }
@ -256,24 +254,22 @@ static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
case 0x0183: case 0x0183:
pci_read_config_dword(pdev, 0x6C, &val); pci_read_config_dword(pdev, 0x6C, &val);
if (val & (1L << 31)) { if (val & (1L << 31)) {
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev, "Detected SiS 182/965 chipset\n");
"Detected SiS 182/965 chipset\n");
pi.flags |= ATA_FLAG_SLAVE_POSS; pi.flags |= ATA_FLAG_SLAVE_POSS;
} else { } else {
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev, "Detected SiS 182/965L chipset\n");
"Detected SiS 182/965L chipset\n");
} }
break; break;
case 0x1182: case 0x1182:
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev,
"Detected SiS 1182/966/680 SATA controller\n"); "Detected SiS 1182/966/680 SATA controller\n");
pi.flags |= ATA_FLAG_SLAVE_POSS; pi.flags |= ATA_FLAG_SLAVE_POSS;
break; break;
case 0x1183: case 0x1183:
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev,
"Detected SiS 1183/966/966L/968/680 controller in PATA mode\n"); "Detected SiS 1183/966/966L/968/680 controller in PATA mode\n");
ppi[0] = &sis_info133_for_sata; ppi[0] = &sis_info133_for_sata;
ppi[1] = &sis_info133_for_sata; ppi[1] = &sis_info133_for_sata;
break; break;

View file

@ -414,15 +414,13 @@ static void k2_sata_setup_port(struct ata_ioports *port, void __iomem *base)
static int k2_sata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) static int k2_sata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
const struct ata_port_info *ppi[] = const struct ata_port_info *ppi[] =
{ &k2_port_info[ent->driver_data], NULL }; { &k2_port_info[ent->driver_data], NULL };
struct ata_host *host; struct ata_host *host;
void __iomem *mmio_base; void __iomem *mmio_base;
int n_ports, i, rc, bar_pos; int n_ports, i, rc, bar_pos;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* allocate host */ /* allocate host */
n_ports = 4; n_ports = 4;

View file

@ -1440,15 +1440,13 @@ static void pdc_20621_init(struct ata_host *host)
static int pdc_sata_init_one(struct pci_dev *pdev, static int pdc_sata_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
static int printed_version;
const struct ata_port_info *ppi[] = const struct ata_port_info *ppi[] =
{ &pdc_port_info[ent->driver_data], NULL }; { &pdc_port_info[ent->driver_data], NULL };
struct ata_host *host; struct ata_host *host;
struct pdc_host_priv *hpriv; struct pdc_host_priv *hpriv;
int i, rc; int i, rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* allocate host */ /* allocate host */
host = ata_host_alloc_pinfo(&pdev->dev, ppi, 4); host = ata_host_alloc_pinfo(&pdev->dev, ppi, 4);

View file

@ -145,7 +145,6 @@ static int uli_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val)
static int uli_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) static int uli_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
const struct ata_port_info *ppi[] = { &uli_port_info, NULL }; const struct ata_port_info *ppi[] = { &uli_port_info, NULL };
unsigned int board_idx = (unsigned int) ent->driver_data; unsigned int board_idx = (unsigned int) ent->driver_data;
struct ata_host *host; struct ata_host *host;
@ -154,8 +153,7 @@ static int uli_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
struct ata_ioports *ioaddr; struct ata_ioports *ioaddr;
int n_ports, rc; int n_ports, rc;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)

View file

@ -360,9 +360,9 @@ static int vt6420_prereset(struct ata_link *link, unsigned long deadline)
online = (sstatus & 0xf) == 0x3; online = (sstatus & 0xf) == 0x3;
ata_port_printk(ap, KERN_INFO, ata_port_info(ap,
"SATA link %s 1.5 Gbps (SStatus %X SControl %X)\n", "SATA link %s 1.5 Gbps (SStatus %X SControl %X)\n",
online ? "up" : "down", sstatus, scontrol); online ? "up" : "down", sstatus, scontrol);
/* SStatus is read one more time */ /* SStatus is read one more time */
svia_scr_read(link, SCR_STATUS, &sstatus); svia_scr_read(link, SCR_STATUS, &sstatus);
@ -469,7 +469,7 @@ static int vt6420_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
rc = pcim_iomap_regions(pdev, 1 << 5, DRV_NAME); rc = pcim_iomap_regions(pdev, 1 << 5, DRV_NAME);
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, "failed to iomap PCI BAR 5\n"); dev_err(&pdev->dev, "failed to iomap PCI BAR 5\n");
return rc; return rc;
} }
@ -488,14 +488,14 @@ static int vt6421_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
*r_host = host = ata_host_alloc_pinfo(&pdev->dev, ppi, ARRAY_SIZE(ppi)); *r_host = host = ata_host_alloc_pinfo(&pdev->dev, ppi, ARRAY_SIZE(ppi));
if (!host) { if (!host) {
dev_printk(KERN_ERR, &pdev->dev, "failed to allocate host\n"); dev_err(&pdev->dev, "failed to allocate host\n");
return -ENOMEM; return -ENOMEM;
} }
rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME); rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME);
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, "failed to request/iomap " dev_err(&pdev->dev, "failed to request/iomap PCI BARs (errno=%d)\n",
"PCI BARs (errno=%d)\n", rc); rc);
return rc; return rc;
} }
host->iomap = pcim_iomap_table(pdev); host->iomap = pcim_iomap_table(pdev);
@ -526,7 +526,7 @@ static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
rc = pcim_iomap_regions(pdev, 1 << 5, DRV_NAME); rc = pcim_iomap_regions(pdev, 1 << 5, DRV_NAME);
if (rc) { if (rc) {
dev_printk(KERN_ERR, &pdev->dev, "failed to iomap PCI BAR 5\n"); dev_err(&pdev->dev, "failed to iomap PCI BAR 5\n");
return rc; return rc;
} }
@ -542,15 +542,14 @@ static void svia_configure(struct pci_dev *pdev, int board_id)
u8 tmp8; u8 tmp8;
pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &tmp8); pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &tmp8);
dev_printk(KERN_INFO, &pdev->dev, "routed to hard irq line %d\n", dev_info(&pdev->dev, "routed to hard irq line %d\n",
(int) (tmp8 & 0xf0) == 0xf0 ? 0 : tmp8 & 0x0f); (int) (tmp8 & 0xf0) == 0xf0 ? 0 : tmp8 & 0x0f);
/* make sure SATA channels are enabled */ /* make sure SATA channels are enabled */
pci_read_config_byte(pdev, SATA_CHAN_ENAB, &tmp8); pci_read_config_byte(pdev, SATA_CHAN_ENAB, &tmp8);
if ((tmp8 & ALL_PORTS) != ALL_PORTS) { if ((tmp8 & ALL_PORTS) != ALL_PORTS) {
dev_printk(KERN_DEBUG, &pdev->dev, dev_dbg(&pdev->dev, "enabling SATA channels (0x%x)\n",
"enabling SATA channels (0x%x)\n", (int)tmp8);
(int) tmp8);
tmp8 |= ALL_PORTS; tmp8 |= ALL_PORTS;
pci_write_config_byte(pdev, SATA_CHAN_ENAB, tmp8); pci_write_config_byte(pdev, SATA_CHAN_ENAB, tmp8);
} }
@ -558,9 +557,8 @@ static void svia_configure(struct pci_dev *pdev, int board_id)
/* make sure interrupts for each channel sent to us */ /* make sure interrupts for each channel sent to us */
pci_read_config_byte(pdev, SATA_INT_GATE, &tmp8); pci_read_config_byte(pdev, SATA_INT_GATE, &tmp8);
if ((tmp8 & ALL_PORTS) != ALL_PORTS) { if ((tmp8 & ALL_PORTS) != ALL_PORTS) {
dev_printk(KERN_DEBUG, &pdev->dev, dev_dbg(&pdev->dev, "enabling SATA channel interrupts (0x%x)\n",
"enabling SATA channel interrupts (0x%x)\n", (int) tmp8);
(int) tmp8);
tmp8 |= ALL_PORTS; tmp8 |= ALL_PORTS;
pci_write_config_byte(pdev, SATA_INT_GATE, tmp8); pci_write_config_byte(pdev, SATA_INT_GATE, tmp8);
} }
@ -568,9 +566,9 @@ static void svia_configure(struct pci_dev *pdev, int board_id)
/* make sure native mode is enabled */ /* make sure native mode is enabled */
pci_read_config_byte(pdev, SATA_NATIVE_MODE, &tmp8); pci_read_config_byte(pdev, SATA_NATIVE_MODE, &tmp8);
if ((tmp8 & NATIVE_MODE_ALL) != NATIVE_MODE_ALL) { if ((tmp8 & NATIVE_MODE_ALL) != NATIVE_MODE_ALL) {
dev_printk(KERN_DEBUG, &pdev->dev, dev_dbg(&pdev->dev,
"enabling SATA channel native mode (0x%x)\n", "enabling SATA channel native mode (0x%x)\n",
(int) tmp8); (int) tmp8);
tmp8 |= NATIVE_MODE_ALL; tmp8 |= NATIVE_MODE_ALL;
pci_write_config_byte(pdev, SATA_NATIVE_MODE, tmp8); pci_write_config_byte(pdev, SATA_NATIVE_MODE, tmp8);
} }
@ -606,15 +604,13 @@ static void svia_configure(struct pci_dev *pdev, int board_id)
static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
unsigned int i; unsigned int i;
int rc; int rc;
struct ata_host *host = NULL; struct ata_host *host = NULL;
int board_id = (int) ent->driver_data; int board_id = (int) ent->driver_data;
const unsigned *bar_sizes; const unsigned *bar_sizes;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pcim_enable_device(pdev); rc = pcim_enable_device(pdev);
if (rc) if (rc)
@ -628,7 +624,7 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
for (i = 0; i < ARRAY_SIZE(svia_bar_sizes); i++) for (i = 0; i < ARRAY_SIZE(svia_bar_sizes); i++)
if ((pci_resource_start(pdev, i) == 0) || if ((pci_resource_start(pdev, i) == 0) ||
(pci_resource_len(pdev, i) < bar_sizes[i])) { (pci_resource_len(pdev, i) < bar_sizes[i])) {
dev_printk(KERN_ERR, &pdev->dev, dev_err(&pdev->dev,
"invalid PCI BAR %u (sz 0x%llx, val 0x%llx)\n", "invalid PCI BAR %u (sz 0x%llx, val 0x%llx)\n",
i, i,
(unsigned long long)pci_resource_start(pdev, i), (unsigned long long)pci_resource_start(pdev, i),

View file

@ -273,9 +273,8 @@ static irqreturn_t vsc_sata_interrupt(int irq, void *dev_instance)
if (unlikely(status == 0xffffffff || status == 0)) { if (unlikely(status == 0xffffffff || status == 0)) {
if (status) if (status)
dev_printk(KERN_ERR, host->dev, dev_err(host->dev,
": IRQ status == 0xffffffff, " ": IRQ status == 0xffffffff, PCI fault or device removal?\n");
"PCI fault or device removal?\n");
goto out; goto out;
} }
@ -347,14 +346,12 @@ static int __devinit vsc_sata_init_one(struct pci_dev *pdev,
.port_ops = &vsc_sata_ops, .port_ops = &vsc_sata_ops,
}; };
const struct ata_port_info *ppi[] = { &pi, NULL }; const struct ata_port_info *ppi[] = { &pi, NULL };
static int printed_version;
struct ata_host *host; struct ata_host *host;
void __iomem *mmio_base; void __iomem *mmio_base;
int i, rc; int i, rc;
u8 cls; u8 cls;
if (!printed_version++) ata_print_version_once(&pdev->dev, DRV_VERSION);
dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* allocate host */ /* allocate host */
host = ata_host_alloc_pinfo(&pdev->dev, ppi, 4); host = ata_host_alloc_pinfo(&pdev->dev, ppi, 4);

View file

@ -74,6 +74,16 @@
#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args) #define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args)
#define ata_print_version_once(dev, version) \
({ \
static bool __print_once; \
\
if (!__print_once) { \
__print_once = true; \
ata_print_version(dev, version); \
} \
})
/* NEW: debug levels */ /* NEW: debug levels */
#define HAVE_LIBATA_MSG 1 #define HAVE_LIBATA_MSG 1
@ -1244,20 +1254,50 @@ static inline int sata_srst_pmp(struct ata_link *link)
/* /*
* printk helpers * printk helpers
*/ */
#define ata_port_printk(ap, lv, fmt, args...) \ __attribute__((format (printf, 3, 4)))
printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) int ata_port_printk(const struct ata_port *ap, const char *level,
const char *fmt, ...);
__attribute__((format (printf, 3, 4)))
int ata_link_printk(const struct ata_link *link, const char *level,
const char *fmt, ...);
__attribute__((format (printf, 3, 4)))
int ata_dev_printk(const struct ata_device *dev, const char *level,
const char *fmt, ...);
#define ata_link_printk(link, lv, fmt, args...) do { \ #define ata_port_err(ap, fmt, ...) \
if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \ ata_port_printk(ap, KERN_ERR, fmt, ##__VA_ARGS__)
printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ #define ata_port_warn(ap, fmt, ...) \
(link)->pmp , ##args); \ ata_port_printk(ap, KERN_WARNING, fmt, ##__VA_ARGS__)
else \ #define ata_port_notice(ap, fmt, ...) \
printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \ ata_port_printk(ap, KERN_NOTICE, fmt, ##__VA_ARGS__)
} while(0) #define ata_port_info(ap, fmt, ...) \
ata_port_printk(ap, KERN_INFO, fmt, ##__VA_ARGS__)
#define ata_port_dbg(ap, fmt, ...) \
ata_port_printk(ap, KERN_DEBUG, fmt, ##__VA_ARGS__)
#define ata_dev_printk(dev, lv, fmt, args...) \ #define ata_link_err(link, fmt, ...) \
printk("%sata%u.%02u: "fmt, lv, (dev)->link->ap->print_id, \ ata_link_printk(link, KERN_ERR, fmt, ##__VA_ARGS__)
(dev)->link->pmp + (dev)->devno , ##args) #define ata_link_warn(link, fmt, ...) \
ata_link_printk(link, KERN_WARNING, fmt, ##__VA_ARGS__)
#define ata_link_notice(link, fmt, ...) \
ata_link_printk(link, KERN_NOTICE, fmt, ##__VA_ARGS__)
#define ata_link_info(link, fmt, ...) \
ata_link_printk(link, KERN_INFO, fmt, ##__VA_ARGS__)
#define ata_link_dbg(link, fmt, ...) \
ata_link_printk(link, KERN_DEBUG, fmt, ##__VA_ARGS__)
#define ata_dev_err(dev, fmt, ...) \
ata_dev_printk(dev, KERN_ERR, fmt, ##__VA_ARGS__)
#define ata_dev_warn(dev, fmt, ...) \
ata_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__)
#define ata_dev_notice(dev, fmt, ...) \
ata_dev_printk(dev, KERN_NOTICE, fmt, ##__VA_ARGS__)
#define ata_dev_info(dev, fmt, ...) \
ata_dev_printk(dev, KERN_INFO, fmt, ##__VA_ARGS__)
#define ata_dev_dbg(dev, fmt, ...) \
ata_dev_printk(dev, KERN_DEBUG, fmt, ##__VA_ARGS__)
void ata_print_version(const struct device *dev, const char *version);
/* /*
* ata_eh_info helpers * ata_eh_info helpers