ide: include PCI device name in messages from IDE PCI host drivers

While at it:

* Apply small fixes to messages (s/dma/DMA/, remove trailing '.', etc).

* Fix printk() call in ide_setup_pci_baseregs() to use KERN_INFO.

* Move printk() call from ide_pci_clear_simplex() to the caller.

* Cleanup do_ide_setup_pci_device() a bit.

* amd74xx.c: remove superfluous PCI device revision information.

* hpt366.c: fix two printk() calls in ->init_chipset to use KERN_INFO.

* pdc202xx_new.c: fix printk() call in ->init_chipset to use KERN_INFO.

* pdc202xx_old.c: fix driver message in pdc202xx_init_one().

* via82cxxx.c: fix driver warning message in via_init_one().
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 2a8f7450
...@@ -129,9 +129,9 @@ static void __devinit amd7411_cable_detect(struct pci_dev *dev, ...@@ -129,9 +129,9 @@ static void __devinit amd7411_cable_detect(struct pci_dev *dev,
amd_80w = ((t & 0x3) ? 1 : 0) | ((t & 0xc) ? 2 : 0); amd_80w = ((t & 0x3) ? 1 : 0) | ((t & 0xc) ? 2 : 0);
for (i = 24; i >= 0; i -= 8) for (i = 24; i >= 0; i -= 8)
if (((u >> i) & 4) && !(amd_80w & (1 << (1 - (i >> 4))))) { if (((u >> i) & 4) && !(amd_80w & (1 << (1 - (i >> 4))))) {
printk(KERN_WARNING "%s: BIOS didn't set cable bits " printk(KERN_WARNING "%s %s: BIOS didn't set cable bits "
"correctly. Enabling workaround.\n", "correctly. Enabling workaround.\n",
name); name, pci_name(dev));
amd_80w |= (1 << (1 - (i >> 4))); amd_80w |= (1 << (1 - (i >> 4)));
} }
} }
...@@ -280,9 +280,8 @@ static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_ ...@@ -280,9 +280,8 @@ static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_
d.udma_mask = ATA_UDMA5; d.udma_mask = ATA_UDMA5;
} }
printk(KERN_INFO "%s: %s (rev %02x) UDMA%s controller\n", printk(KERN_INFO "%s %s: UDMA%s controller\n",
d.name, pci_name(dev), dev->revision, d.name, pci_name(dev), amd_dma[fls(d.udma_mask) - 1]);
amd_dma[fls(d.udma_mask) - 1]);
/* /*
* Determine the system bus clock. * Determine the system bus clock.
......
...@@ -134,8 +134,8 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi ...@@ -134,8 +134,8 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi
u16 command; u16 command;
pci_read_config_word(dev, PCI_COMMAND, &command); pci_read_config_word(dev, PCI_COMMAND, &command);
if (!(command & PCI_COMMAND_IO)) { if (!(command & PCI_COMMAND_IO)) {
printk(KERN_INFO "Skipping disabled %s IDE " printk(KERN_INFO "%s %s: skipping disabled "
"controller.\n", d->name); "controller\n", d->name, pci_name(dev));
goto out; goto out;
} }
} }
......
...@@ -1044,8 +1044,8 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha ...@@ -1044,8 +1044,8 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
if ((temp & 0xFFFFF000) != 0xABCDE000) { if ((temp & 0xFFFFF000) != 0xABCDE000) {
int i; int i;
printk(KERN_WARNING "%s: no clock data saved by BIOS\n", printk(KERN_WARNING "%s %s: no clock data saved by "
name); "BIOS\n", name, pci_name(dev));
/* Calculate the average value of f_CNT. */ /* Calculate the average value of f_CNT. */
for (temp = i = 0; i < 128; i++) { for (temp = i = 0; i < 128; i++) {
...@@ -1070,8 +1070,9 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha ...@@ -1070,8 +1070,9 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
else else
pci_clk = 66; pci_clk = 66;
printk(KERN_INFO "%s: DPLL base: %d MHz, f_CNT: %d, " printk(KERN_INFO "%s %s: DPLL base: %d MHz, f_CNT: %d, "
"assuming %d MHz PCI\n", name, dpll_clk, f_cnt, pci_clk); "assuming %d MHz PCI\n", name, pci_name(dev),
dpll_clk, f_cnt, pci_clk);
} else { } else {
u32 itr1 = 0; u32 itr1 = 0;
...@@ -1137,7 +1138,8 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha ...@@ -1137,7 +1138,8 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
} }
if (info->timings->clock_table[clock] == NULL) { if (info->timings->clock_table[clock] == NULL) {
printk(KERN_ERR "%s: unknown bus timing!\n", name); printk(KERN_ERR "%s %s: unknown bus timing!\n",
name, pci_name(dev));
return -EIO; return -EIO;
} }
...@@ -1163,16 +1165,19 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha ...@@ -1163,16 +1165,19 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
f_low += adjust >> 1; f_low += adjust >> 1;
} }
if (adjust == 8) { if (adjust == 8) {
printk(KERN_ERR "%s: DPLL did not stabilize!\n", name); printk(KERN_ERR "%s %s: DPLL did not stabilize!\n",
name, pci_name(dev));
return -EIO; return -EIO;
} }
printk("%s: using %d MHz DPLL clock\n", name, dpll_clk); printk(KERN_INFO "%s %s: using %d MHz DPLL clock\n",
name, pci_name(dev), dpll_clk);
} else { } else {
/* Mark the fact that we're not using the DPLL. */ /* Mark the fact that we're not using the DPLL. */
dpll_clk = 0; dpll_clk = 0;
printk("%s: using %d MHz PCI clock\n", name, pci_clk); printk(KERN_INFO "%s %s: using %d MHz PCI clock\n",
name, pci_name(dev), pci_clk);
} }
/* Store the clock frequencies. */ /* Store the clock frequencies. */
...@@ -1357,7 +1362,8 @@ static void __devinit hpt374_init(struct pci_dev *dev, struct pci_dev *dev2) ...@@ -1357,7 +1362,8 @@ static void __devinit hpt374_init(struct pci_dev *dev, struct pci_dev *dev2)
if (dev2->irq != dev->irq) { if (dev2->irq != dev->irq) {
/* FIXME: we need a core pci_set_interrupt() */ /* FIXME: we need a core pci_set_interrupt() */
dev2->irq = dev->irq; dev2->irq = dev->irq;
printk(KERN_INFO "HPT374: PCI config space interrupt fixed\n"); printk(KERN_INFO "HPT374 %s: PCI config space interrupt "
"fixed\n", pci_name(dev2));
} }
} }
...@@ -1392,8 +1398,8 @@ static int __devinit hpt36x_init(struct pci_dev *dev, struct pci_dev *dev2) ...@@ -1392,8 +1398,8 @@ static int __devinit hpt36x_init(struct pci_dev *dev, struct pci_dev *dev2)
pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin2); pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin2);
if (pin1 != pin2 && dev->irq == dev2->irq) { if (pin1 != pin2 && dev->irq == dev2->irq) {
printk(KERN_INFO "HPT36x: onboard version of chipset, " printk(KERN_INFO "HPT36x %s: onboard version of chipset, "
"pin1=%d pin2=%d\n", pin1, pin2); "pin1=%d pin2=%d\n", pci_name(dev), pin1, pin2);
return 1; return 1;
} }
...@@ -1591,7 +1597,8 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic ...@@ -1591,7 +1597,8 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
dyn_info = kzalloc(sizeof(*dyn_info) * (dev2 ? 2 : 1), GFP_KERNEL); dyn_info = kzalloc(sizeof(*dyn_info) * (dev2 ? 2 : 1), GFP_KERNEL);
if (dyn_info == NULL) { if (dyn_info == NULL) {
printk(KERN_ERR "%s: out of memory!\n", d.name); printk(KERN_ERR "%s %s: out of memory!\n",
d.name, pci_name(dev));
pci_dev_put(dev2); pci_dev_put(dev2);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -569,7 +569,8 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif) ...@@ -569,7 +569,8 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
idev->timing10 = 1; idev->timing10 = 1;
hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
if (idev->smart == 0) if (idev->smart == 0)
printk(KERN_WARNING "it821x: Revision 0x10, workarounds activated.\n"); printk(KERN_WARNING "it821x %s: revision 0x10, "
"workarounds activated\n", pci_name(dev));
} }
if (idev->smart == 0) { if (idev->smart == 0) {
...@@ -609,11 +610,13 @@ static unsigned int __devinit init_chipset_it821x(struct pci_dev *dev, const cha ...@@ -609,11 +610,13 @@ static unsigned int __devinit init_chipset_it821x(struct pci_dev *dev, const cha
/* Force the card into bypass mode if so requested */ /* Force the card into bypass mode if so requested */
if (it8212_noraid) { if (it8212_noraid) {
printk(KERN_INFO "it8212: forcing bypass mode.\n"); printk(KERN_INFO "it821x %s: forcing bypass mode\n",
pci_name(dev));
it8212_disable_raid(dev); it8212_disable_raid(dev);
} }
pci_read_config_byte(dev, 0x50, &conf); pci_read_config_byte(dev, 0x50, &conf);
printk(KERN_INFO "it821x: controller in %s mode.\n", mode[conf & 1]); printk(KERN_INFO "it821x %s: controller in %s mode\n",
pci_name(dev), mode[conf & 1]);
return 0; return 0;
} }
...@@ -654,7 +657,7 @@ static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_devic ...@@ -654,7 +657,7 @@ static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_devic
itdevs = kzalloc(2 * sizeof(*itdevs), GFP_KERNEL); itdevs = kzalloc(2 * sizeof(*itdevs), GFP_KERNEL);
if (itdevs == NULL) { if (itdevs == NULL) {
printk(KERN_ERR "it821x: out of memory\n"); printk(KERN_ERR "it821x %s: out of memory\n", pci_name(dev));
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -358,12 +358,13 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha ...@@ -358,12 +358,13 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha
* registers setting. * registers setting.
*/ */
pll_input = detect_pll_input_clock(dma_base); pll_input = detect_pll_input_clock(dma_base);
printk("%s: PLL input clock is %ld kHz\n", name, pll_input / 1000); printk(KERN_INFO "%s %s: PLL input clock is %ld kHz\n",
name, pci_name(dev), pll_input / 1000);
/* Sanity check */ /* Sanity check */
if (unlikely(pll_input < 5000000L || pll_input > 70000000L)) { if (unlikely(pll_input < 5000000L || pll_input > 70000000L)) {
printk(KERN_ERR "%s: Bad PLL input clock %ld Hz, giving up!\n", printk(KERN_ERR "%s %s: Bad PLL input clock %ld Hz, giving up!"
name, pll_input); "\n", name, pci_name(dev), pll_input);
goto out; goto out;
} }
...@@ -399,7 +400,8 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha ...@@ -399,7 +400,8 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha
r = 0x00; r = 0x00;
} else { } else {
/* Invalid ratio */ /* Invalid ratio */
printk(KERN_ERR "%s: Bad ratio %ld, giving up!\n", name, ratio); printk(KERN_ERR "%s %s: Bad ratio %ld, giving up!\n",
name, pci_name(dev), ratio);
goto out; goto out;
} }
...@@ -409,7 +411,8 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha ...@@ -409,7 +411,8 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha
if (unlikely(f < 0 || f > 127)) { if (unlikely(f < 0 || f > 127)) {
/* Invalid F */ /* Invalid F */
printk(KERN_ERR "%s: F[%d] invalid!\n", name, f); printk(KERN_ERR "%s %s: F[%d] invalid!\n",
name, pci_name(dev), f);
goto out; goto out;
} }
...@@ -455,8 +458,8 @@ static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev) ...@@ -455,8 +458,8 @@ static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev)
if (dev2->irq != dev->irq) { if (dev2->irq != dev->irq) {
dev2->irq = dev->irq; dev2->irq = dev->irq;
printk(KERN_INFO "PDC20270: PCI config space " printk(KERN_INFO "PDC20270 %s: PCI config space "
"interrupt fixed\n"); "interrupt fixed\n", pci_name(dev));
} }
return dev2; return dev2;
...@@ -535,8 +538,8 @@ static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_de ...@@ -535,8 +538,8 @@ static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_de
bridge->vendor == PCI_VENDOR_ID_INTEL && bridge->vendor == PCI_VENDOR_ID_INTEL &&
(bridge->device == PCI_DEVICE_ID_INTEL_I960 || (bridge->device == PCI_DEVICE_ID_INTEL_I960 ||
bridge->device == PCI_DEVICE_ID_INTEL_I960RM)) { bridge->device == PCI_DEVICE_ID_INTEL_I960RM)) {
printk(KERN_INFO "PDC20276: attached to I2O RAID controller, " printk(KERN_INFO "PDC20276 %s: attached to I2O RAID controller,"
"skipping\n"); " skipping\n", pci_name(dev));
return -ENODEV; return -ENODEV;
} }
......
...@@ -304,8 +304,8 @@ static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev, ...@@ -304,8 +304,8 @@ static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev,
if (irq != irq2) { if (irq != irq2) {
pci_write_config_byte(dev, pci_write_config_byte(dev,
(PCI_INTERRUPT_LINE)|0x80, irq); /* 0xbc */ (PCI_INTERRUPT_LINE)|0x80, irq); /* 0xbc */
printk(KERN_INFO "%s: PCI config space interrupt " printk(KERN_INFO "%s %s: PCI config space interrupt "
"mirror fixed\n", name); "mirror fixed\n", name, pci_name(dev));
} }
} }
} }
...@@ -406,8 +406,9 @@ static int __devinit pdc202xx_init_one(struct pci_dev *dev, const struct pci_dev ...@@ -406,8 +406,9 @@ static int __devinit pdc202xx_init_one(struct pci_dev *dev, const struct pci_dev
bridge->vendor == PCI_VENDOR_ID_INTEL && bridge->vendor == PCI_VENDOR_ID_INTEL &&
(bridge->device == PCI_DEVICE_ID_INTEL_I960 || (bridge->device == PCI_DEVICE_ID_INTEL_I960 ||
bridge->device == PCI_DEVICE_ID_INTEL_I960RM)) { bridge->device == PCI_DEVICE_ID_INTEL_I960RM)) {
printk(KERN_INFO "ide: Skipping Promise PDC20265 " printk(KERN_INFO "pdc202xx_old %s: skipping Promise "
"attached to I2O RAID controller\n"); "PDC20265 attached to I2O RAID controller\n",
pci_name(dev));
return -ENODEV; return -ENODEV;
} }
} }
......
...@@ -188,7 +188,8 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha ...@@ -188,7 +188,8 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha
pci_read_config_dword(isa_dev, 0x64, &reg); pci_read_config_dword(isa_dev, 0x64, &reg);
reg &= ~0x00002000; /* disable 600ns interrupt mask */ reg &= ~0x00002000; /* disable 600ns interrupt mask */
if(!(reg & 0x00004000)) if(!(reg & 0x00004000))
printk(KERN_DEBUG "%s: UDMA not BIOS enabled.\n", name); printk(KERN_DEBUG "%s %s: UDMA not BIOS "
"enabled.\n", name, pci_name(dev));
reg |= 0x00004000; /* enable UDMA/33 support */ reg |= 0x00004000; /* enable UDMA/33 support */
pci_write_config_dword(isa_dev, 0x64, reg); pci_write_config_dword(isa_dev, 0x64, reg);
} }
......
...@@ -539,7 +539,8 @@ static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev, ...@@ -539,7 +539,8 @@ static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev,
{ "== 100", "== 133", "== 2X PCI", "DISABLED!" }; { "== 100", "== 133", "== 2X PCI", "DISABLED!" };
tmp >>= 4; tmp >>= 4;
printk(KERN_INFO "%s: BASE CLOCK %s\n", name, clk_str[tmp & 3]); printk(KERN_INFO "%s %s: BASE CLOCK %s\n",
name, pci_name(dev), clk_str[tmp & 3]);
} }
return 0; return 0;
...@@ -779,8 +780,8 @@ static int __devinit siimage_init_one(struct pci_dev *dev, ...@@ -779,8 +780,8 @@ static int __devinit siimage_init_one(struct pci_dev *dev,
* seem to get terminally confused in the PCI spaces. * seem to get terminally confused in the PCI spaces.
*/ */
if (!request_mem_region(bar5, barsize, d.name)) { if (!request_mem_region(bar5, barsize, d.name)) {
printk(KERN_WARNING "siimage: IDE controller MMIO " printk(KERN_WARNING "siimage %s: MMIO ports not "
"ports not available.\n"); "available\n", pci_name(dev));
} else { } else {
ioaddr = ioremap(bar5, barsize); ioaddr = ioremap(bar5, barsize);
if (ioaddr == NULL) if (ioaddr == NULL)
......
...@@ -380,8 +380,9 @@ static int __devinit sis_find_family(struct pci_dev *dev) ...@@ -380,8 +380,9 @@ static int __devinit sis_find_family(struct pci_dev *dev)
} }
pci_dev_put(host); pci_dev_put(host);
printk(KERN_INFO "SIS5513: %s %s controller\n", printk(KERN_INFO "SIS5513 %s: %s %s controller\n",
SiSHostChipInfo[i].name, chipset_capability[chipset_family]); pci_name(dev), SiSHostChipInfo[i].name,
chipset_capability[chipset_family]);
} }
if (!chipset_family) { /* Belongs to pci-quirks */ if (!chipset_family) { /* Belongs to pci-quirks */
...@@ -396,7 +397,8 @@ static int __devinit sis_find_family(struct pci_dev *dev) ...@@ -396,7 +397,8 @@ static int __devinit sis_find_family(struct pci_dev *dev)
pci_write_config_dword(dev, 0x54, idemisc); pci_write_config_dword(dev, 0x54, idemisc);
if (trueid == 0x5518) { if (trueid == 0x5518) {
printk(KERN_INFO "SIS5513: SiS 962/963 MuTIOL IDE UDMA133 controller\n"); printk(KERN_INFO "SIS5513 %s: SiS 962/963 MuTIOL IDE UDMA133 controller\n",
pci_name(dev));
chipset_family = ATA_133; chipset_family = ATA_133;
/* Check for 5513 compability mapping /* Check for 5513 compability mapping
...@@ -405,7 +407,8 @@ static int __devinit sis_find_family(struct pci_dev *dev) ...@@ -405,7 +407,8 @@ static int __devinit sis_find_family(struct pci_dev *dev)
*/ */
if ((idemisc & 0x40000000) == 0) { if ((idemisc & 0x40000000) == 0) {
pci_write_config_dword(dev, 0x54, idemisc | 0x40000000); pci_write_config_dword(dev, 0x54, idemisc | 0x40000000);
printk(KERN_INFO "SIS5513: Switching to 5513 register mapping\n"); printk(KERN_INFO "SIS5513 %s: Switching to 5513 register mapping\n",
pci_name(dev));
} }
} }
} }
...@@ -429,10 +432,12 @@ static int __devinit sis_find_family(struct pci_dev *dev) ...@@ -429,10 +432,12 @@ static int __devinit sis_find_family(struct pci_dev *dev)
pci_dev_put(lpc_bridge); pci_dev_put(lpc_bridge);
if (lpc_bridge->revision == 0x10 && (prefctl & 0x80)) { if (lpc_bridge->revision == 0x10 && (prefctl & 0x80)) {
printk(KERN_INFO "SIS5513: SiS 961B MuTIOL IDE UDMA133 controller\n"); printk(KERN_INFO "SIS5513 %s: SiS 961B MuTIOL IDE UDMA133 controller\n",
pci_name(dev));
chipset_family = ATA_133a; chipset_family = ATA_133a;
} else { } else {
printk(KERN_INFO "SIS5513: SiS 961 MuTIOL IDE UDMA100 controller\n"); printk(KERN_INFO "SIS5513 %s: SiS 961 MuTIOL IDE UDMA100 controller\n",
pci_name(dev));
chipset_family = ATA_100; chipset_family = ATA_100;
} }
} }
......
...@@ -245,10 +245,10 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif) ...@@ -245,10 +245,10 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
u8 reg = 0; u8 reg = 0;
if ((dev->class & 5) && cfg_base) if ((dev->class & 5) && cfg_base)
printk(KERN_INFO "TRM290: chip"); printk(KERN_INFO "TRM290 %s: chip", pci_name(dev));
else { else {
cfg_base = 0x3df0; cfg_base = 0x3df0;
printk(KERN_INFO "TRM290: using default"); printk(KERN_INFO "TRM290 %s: using default", pci_name(dev));
} }
printk(KERN_CONT " config base at 0x%04x\n", cfg_base); printk(KERN_CONT " config base at 0x%04x\n", cfg_base);
hwif->config_data = cfg_base; hwif->config_data = cfg_base;
......
...@@ -401,20 +401,19 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i ...@@ -401,20 +401,19 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i
*/ */
via_config = via_config_find(&isa); via_config = via_config_find(&isa);
if (!via_config->id) { if (!via_config->id) {
printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, disabling DMA.\n"); printk(KERN_WARNING "VP_IDE %s: unknown chipset, skipping\n",
pci_name(dev));
return -ENODEV; return -ENODEV;
} }
/* /*
* Print the boot message. * Print the boot message.
*/ */
printk(KERN_INFO "VP_IDE: VIA %s (rev %02x) IDE %sDMA%s " printk(KERN_INFO "VP_IDE %s: VIA %s (rev %02x) IDE %sDMA%s\n",
"controller on pci%s\n", pci_name(dev), via_config->name, isa->revision,
via_config->name, isa->revision,
via_config->udma_mask ? "U" : "MW", via_config->udma_mask ? "U" : "MW",
via_dma[via_config->udma_mask ? via_dma[via_config->udma_mask ?
(fls(via_config->udma_mask) - 1) : 0], (fls(via_config->udma_mask) - 1) : 0]);
pci_name(dev));
pci_dev_put(isa); pci_dev_put(isa);
...@@ -454,7 +453,7 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i ...@@ -454,7 +453,7 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i
vdev = kzalloc(sizeof(*vdev), GFP_KERNEL); vdev = kzalloc(sizeof(*vdev), GFP_KERNEL);
if (!vdev) { if (!vdev) {
printk(KERN_ERR "VP_IDE: out of memory :(\n"); printk(KERN_ERR "VP_IDE %s: out of memory :(\n", pci_name(dev));
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -39,17 +39,18 @@ static int ide_setup_pci_baseregs(struct pci_dev *dev, const char *name) ...@@ -39,17 +39,18 @@ static int ide_setup_pci_baseregs(struct pci_dev *dev, const char *name)
if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) || if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) ||
(progif & 5) != 5) { (progif & 5) != 5) {
if ((progif & 0xa) != 0xa) { if ((progif & 0xa) != 0xa) {
printk(KERN_INFO "%s: device not capable of full " printk(KERN_INFO "%s %s: device not capable of full "
"native PCI mode\n", name); "native PCI mode\n", name, pci_name(dev));
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
printk("%s: placing both ports into native PCI mode\n", name); printk(KERN_INFO "%s %s: placing both ports into native PCI "
"mode\n", name, pci_name(dev));
(void) pci_write_config_byte(dev, PCI_CLASS_PROG, progif|5); (void) pci_write_config_byte(dev, PCI_CLASS_PROG, progif|5);
if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) || if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) ||
(progif & 5) != 5) { (progif & 5) != 5) {
printk(KERN_ERR "%s: rewrite of PROGIF failed, wanted " printk(KERN_ERR "%s %s: rewrite of PROGIF failed, "
"0x%04x, got 0x%04x\n", "wanted 0x%04x, got 0x%04x\n",
name, progif|5, progif); name, pci_name(dev), progif | 5, progif);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
} }
...@@ -57,14 +58,14 @@ static int ide_setup_pci_baseregs(struct pci_dev *dev, const char *name) ...@@ -57,14 +58,14 @@ static int ide_setup_pci_baseregs(struct pci_dev *dev, const char *name)
} }
#ifdef CONFIG_BLK_DEV_IDEDMA_PCI #ifdef CONFIG_BLK_DEV_IDEDMA_PCI
static void ide_pci_clear_simplex(unsigned long dma_base, const char *name) static int ide_pci_clear_simplex(unsigned long dma_base, const char *name)
{ {
u8 dma_stat = inb(dma_base + 2); u8 dma_stat = inb(dma_base + 2);
outb(dma_stat & 0x60, dma_base + 2); outb(dma_stat & 0x60, dma_base + 2);
dma_stat = inb(dma_base + 2); dma_stat = inb(dma_base + 2);
if (dma_stat & 0x80)
printk(KERN_INFO "%s: simplex device: DMA forced\n", name); return (dma_stat & 0x80) ? 1 : 0;
} }
/** /**
...@@ -91,7 +92,8 @@ unsigned long ide_pci_dma_base(ide_hwif_t *hwif, const struct ide_port_info *d) ...@@ -91,7 +92,8 @@ unsigned long ide_pci_dma_base(ide_hwif_t *hwif, const struct ide_port_info *d)
dma_base = pci_resource_start(dev, baridx); dma_base = pci_resource_start(dev, baridx);
if (dma_base == 0) { if (dma_base == 0) {
printk(KERN_ERR "%s: DMA base is invalid\n", d->name); printk(KERN_ERR "%s %s: DMA base is invalid\n",
d->name, pci_name(dev));
return 0; return 0;
} }
} }
...@@ -105,13 +107,16 @@ EXPORT_SYMBOL_GPL(ide_pci_dma_base); ...@@ -105,13 +107,16 @@ EXPORT_SYMBOL_GPL(ide_pci_dma_base);
int ide_pci_check_simplex(ide_hwif_t *hwif, const struct ide_port_info *d) int ide_pci_check_simplex(ide_hwif_t *hwif, const struct ide_port_info *d)
{ {
struct pci_dev *dev = to_pci_dev(hwif->dev);
u8 dma_stat; u8 dma_stat;
if (d->host_flags & (IDE_HFLAG_MMIO | IDE_HFLAG_CS5520)) if (d->host_flags & (IDE_HFLAG_MMIO | IDE_HFLAG_CS5520))
goto out; goto out;
if (d->host_flags & IDE_HFLAG_CLEAR_SIMPLEX) { if (d->host_flags & IDE_HFLAG_CLEAR_SIMPLEX) {
ide_pci_clear_simplex(hwif->dma_base, d->name); if (ide_pci_clear_simplex(hwif->dma_base, d->name))
printk(KERN_INFO "%s %s: simplex device: DMA forced\n",
d->name, pci_name(dev));
goto out; goto out;
} }
...@@ -127,7 +132,8 @@ int ide_pci_check_simplex(ide_hwif_t *hwif, const struct ide_port_info *d) ...@@ -127,7 +132,8 @@ int ide_pci_check_simplex(ide_hwif_t *hwif, const struct ide_port_info *d)
*/ */
dma_stat = hwif->tp_ops->read_sff_dma_status(hwif); dma_stat = hwif->tp_ops->read_sff_dma_status(hwif);
if ((dma_stat & 0x80) && hwif->mate && hwif->mate->dma_base) { if ((dma_stat & 0x80) && hwif->mate && hwif->mate->dma_base) {
printk(KERN_INFO "%s: simplex device: DMA disabled\n", d->name); printk(KERN_INFO "%s %s: simplex device: DMA disabled\n",
d->name, pci_name(dev));
return -1; return -1;
} }
out: out:
...@@ -149,7 +155,7 @@ int ide_pci_set_master(struct pci_dev *dev, const char *name) ...@@ -149,7 +155,7 @@ int ide_pci_set_master(struct pci_dev *dev, const char *name)
if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd) || if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd) ||
(pcicmd & PCI_COMMAND_MASTER) == 0) { (pcicmd & PCI_COMMAND_MASTER) == 0) {
printk(KERN_ERR "%s: error updating PCICMD on %s\n", printk(KERN_ERR "%s %s: error updating PCICMD\n",
name, pci_name(dev)); name, pci_name(dev));
return -EIO; return -EIO;
} }
...@@ -162,9 +168,9 @@ EXPORT_SYMBOL_GPL(ide_pci_set_master); ...@@ -162,9 +168,9 @@ EXPORT_SYMBOL_GPL(ide_pci_set_master);
void ide_setup_pci_noise(struct pci_dev *dev, const struct ide_port_info *d) void ide_setup_pci_noise(struct pci_dev *dev, const struct ide_port_info *d)
{ {
printk(KERN_INFO "%s: IDE controller (0x%04x:0x%04x rev 0x%02x) at " printk(KERN_INFO "%s %s: IDE controller (0x%04x:0x%04x rev 0x%02x)\n",
" PCI slot %s\n", d->name, dev->vendor, dev->device, d->name, pci_name(dev),
dev->revision, pci_name(dev)); dev->vendor, dev->device, dev->revision);
} }
EXPORT_SYMBOL_GPL(ide_setup_pci_noise); EXPORT_SYMBOL_GPL(ide_setup_pci_noise);
...@@ -189,11 +195,12 @@ static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d) ...@@ -189,11 +195,12 @@ static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
if (pci_enable_device(dev)) { if (pci_enable_device(dev)) {
ret = pci_enable_device_io(dev); ret = pci_enable_device_io(dev);
if (ret < 0) { if (ret < 0) {
printk(KERN_WARNING "%s: (ide_setup_pci_device:) " printk(KERN_WARNING "%s %s: couldn't enable device\n",
"Could not enable device.\n", d->name); d->name, pci_name(dev));
goto out; goto out;
} }
printk(KERN_WARNING "%s: BIOS configuration fixed.\n", d->name); printk(KERN_WARNING "%s %s: BIOS configuration fixed\n",
d->name, pci_name(dev));
} }
/* /*
...@@ -203,7 +210,8 @@ static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d) ...@@ -203,7 +210,8 @@ static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
*/ */
ret = pci_set_dma_mask(dev, DMA_32BIT_MASK); ret = pci_set_dma_mask(dev, DMA_32BIT_MASK);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "%s: can't set dma mask\n", d->name); printk(KERN_ERR "%s %s: can't set DMA mask\n",
d->name, pci_name(dev));
goto out; goto out;
} }
...@@ -221,7 +229,8 @@ static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d) ...@@ -221,7 +229,8 @@ static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
ret = pci_request_selected_regions(dev, bars, d->name); ret = pci_request_selected_regions(dev, bars, d->name);
if (ret < 0) if (ret < 0)
printk(KERN_ERR "%s: can't reserve resources\n", d->name); printk(KERN_ERR "%s %s: can't reserve resources\n",
d->name, pci_name(dev));
out: out:
return ret; return ret;
} }
...@@ -247,15 +256,18 @@ static int ide_pci_configure(struct pci_dev *dev, const struct ide_port_info *d) ...@@ -247,15 +256,18 @@ static int ide_pci_configure(struct pci_dev *dev, const struct ide_port_info *d)
*/ */
if (ide_setup_pci_baseregs(dev, d->name) || if (ide_setup_pci_baseregs(dev, d->name) ||
pci_write_config_word(dev, PCI_COMMAND, pcicmd | PCI_COMMAND_IO)) { pci_write_config_word(dev, PCI_COMMAND, pcicmd | PCI_COMMAND_IO)) {
printk(KERN_INFO "%s: device disabled (BIOS)\n", d->name); printk(KERN_INFO "%s %s: device disabled (BIOS)\n",
d->name, pci_name(dev));
return -ENODEV; return -ENODEV;
} }
if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd)) { if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd)) {
printk(KERN_ERR "%s: error accessing PCI regs\n", d->name); printk(KERN_ERR "%s %s: error accessing PCI regs\n",
d->name, pci_name(dev));
return -EIO; return -EIO;
} }
if (!(pcicmd & PCI_COMMAND_IO)) { if (!(pcicmd & PCI_COMMAND_IO)) {
printk(KERN_ERR "%s: unable to enable IDE controller\n", d->name); printk(KERN_ERR "%s %s: unable to enable IDE controller\n",
d->name, pci_name(dev));
return -ENXIO; return -ENXIO;
} }
return 0; return 0;
...@@ -311,8 +323,9 @@ static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d, ...@@ -311,8 +323,9 @@ static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d,
if ((d->host_flags & IDE_HFLAG_ISA_PORTS) == 0) { if ((d->host_flags & IDE_HFLAG_ISA_PORTS) == 0) {
if (ide_pci_check_iomem(dev, d, 2 * port) || if (ide_pci_check_iomem(dev, d, 2 * port) ||
ide_pci_check_iomem(dev, d, 2 * port + 1)) { ide_pci_check_iomem(dev, d, 2 * port + 1)) {
printk(KERN_ERR "%s: I/O baseregs (BIOS) are reported " printk(KERN_ERR "%s %s: I/O baseregs (BIOS) are "
"as MEM for port %d!\n", d->name, port); "reported as MEM for port %d!\n",
d->name, pci_name(dev), port);
return -EINVAL; return -EINVAL;
} }
...@@ -325,8 +338,8 @@ static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d, ...@@ -325,8 +338,8 @@ static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d,
} }
if (!base || !ctl) { if (!base || !ctl) {
printk(KERN_ERR "%s: bad PCI BARs for port %d, skipping\n", printk(KERN_ERR "%s %s: bad PCI BARs for port %d, skipping\n",
d->name, port); d->name, pci_name(dev), port);
return -EINVAL; return -EINVAL;
} }
...@@ -414,14 +427,16 @@ static int ide_setup_pci_controller(struct pci_dev *dev, ...@@ -414,14 +427,16 @@ static int ide_setup_pci_controller(struct pci_dev *dev,
ret = pci_read_config_word(dev, PCI_COMMAND, &pcicmd); ret = pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "%s: error accessing PCI regs\n", d->name); printk(KERN_ERR "%s %s: error accessing PCI regs\n",
d->name, pci_name(dev));
goto out; goto out;
} }
if (!(pcicmd & PCI_COMMAND_IO)) { /* is device disabled? */ if (!(pcicmd & PCI_COMMAND_IO)) { /* is device disabled? */
ret = ide_pci_configure(dev, d); ret = ide_pci_configure(dev, d);
if (ret < 0) if (ret < 0)
goto out; goto out;
printk(KERN_INFO "%s: device enabled (Linux)\n", d->name); printk(KERN_INFO "%s %s: device enabled (Linux)\n",
d->name, pci_name(dev));
} }
out: out:
...@@ -460,7 +475,8 @@ void ide_pci_setup_ports(struct pci_dev *dev, const struct ide_port_info *d, ...@@ -460,7 +475,8 @@ void ide_pci_setup_ports(struct pci_dev *dev, const struct ide_port_info *d,
if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
(tmp & e->mask) != e->val)) { (tmp & e->mask) != e->val)) {
printk(KERN_INFO "%s: IDE port disabled\n", d->name); printk(KERN_INFO "%s %s: IDE port disabled\n",
d->name, pci_name(dev));
continue; /* port not enabled */ continue; /* port not enabled */
} }
...@@ -506,18 +522,15 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, ...@@ -506,18 +522,15 @@ static int do_ide_setup_pci_device(struct pci_dev *dev,
/* Is it an "IDE storage" device in non-PCI mode? */ /* Is it an "IDE storage" device in non-PCI mode? */
if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 5) != 5) { if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 5) != 5) {
if (noisy) if (noisy)
printk(KERN_INFO "%s: not 100%% native mode: " printk(KERN_INFO "%s %s: not 100%% native mode: will "
"will probe irqs later\n", d->name); "probe irqs later\n", d->name, pci_name(dev));
pciirq = ret; pciirq = ret;
} else if (!pciirq) { } else if (!pciirq && noisy) {
if (noisy) printk(KERN_WARNING "%s %s: bad irq (%d): will probe later\n",
printk(KERN_WARNING "%s: bad irq (%d): will probe later\n", d->name, pci_name(dev), pciirq);
d->name, pciirq); } else if (noisy) {
pciirq = 0; printk(KERN_INFO "%s %s: 100%% native mode on irq %d\n",
} else { d->name, pci_name(dev), pciirq);
if (noisy)
printk(KERN_INFO "%s: 100%% native mode on irq %d\n",
d->name, pciirq);
} }
ret = pciirq; ret = pciirq;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册