* [PATCH 0/3] mv643xx fixes
From: Brent Cook @ 2006-06-27 14:51 UTC (permalink / raw)
To: netdev
This is a series of fixes that for problems that we've found with the Marvell
MV643xx Gigabit MAC.
* Disable interrupts on all ports during initialization
* Increment TX bytes statistics counter
* Support BCM5461 PHY initialization
^ permalink raw reply
* [PATCH 1/3] mv643xx fixes - Disable interrupts on all ports during initialization
From: Brent Cook @ 2006-06-27 14:51 UTC (permalink / raw)
To: netdev
This patch disable interrupts on all ports during initialization. The current
assumes that the firmware has already disabled all interrupts on all ports.
We have encountered some boards that do not always disable interrupts (XES
XPedite 6200 for instance) on a soft reset. This patch prevents a kernel
panic if a packet is received before the DMA ring buffers are setup for a
port on which interrupts are left enabled by the firmware.
Signed-off-by: Brent Cook <bcook@bpointsys.com>
Index: linux-2.6-bps/drivers/net/mv643xx_eth.c
===================================================================
--- linux-2.6-bps/drivers/net/mv643xx_eth.c (revision 100)
+++ linux-2.6-bps/drivers/net/mv643xx_eth.c (revision 101)
@@ -777,6 +777,13 @@
unsigned int size;
int err;
+ /* Mask all interrupts on ethernet port */
+ mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num),
+ ETH_INT_MASK_ALL);
+ /* wait for previous write to complete */
+ mv_read(MV643XX_ETH_INTERRUPT_MASK_REG(port_num));
+
err = request_irq(dev->irq, mv643xx_eth_int_handler,
SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);
if (err) {
^ permalink raw reply
* [PATCH] use dev_printk() in some net drivers
From: Jeff Garzik @ 2006-06-27 14:51 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
commit 25a0324ef1c1b181c9d00f09837e8757875ee2a4
Author: Jeff Garzik <jeff@garzik.org>
Date: Tue Jun 27 10:47:51 2006 -0400
[netdrvr] Use dev_printk() when ethernet interface isn't available
For messages prior to register_netdev(), prefer dev_printk() because
that prints out both our driver name and our [PCI | whatever] bus id.
Updates: 8139{cp,too}, b44, bnx2, cassini, {eepro,epic}100, fealnx,
hamachi, ne2k-pci, ns83820, pci-skeleton, r8169.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/8139cp.c | 36 +++++++++++++++++++++---------------
drivers/net/8139too.c | 41 +++++++++++++++++++++++++----------------
drivers/net/b44.c | 28 +++++++++++++++-------------
drivers/net/bnx2.c | 37 ++++++++++++++++++++++---------------
drivers/net/cassini.c | 20 ++++++++++----------
drivers/net/eepro100.c | 8 +++++---
drivers/net/epic100.c | 23 ++++++++++++-----------
drivers/net/fealnx.c | 17 +++++++++--------
drivers/net/hamachi.c | 3 ++-
drivers/net/ne2k-pci.c | 12 ++++++++----
drivers/net/ns83820.c | 14 +++++++++-----
drivers/net/pci-skeleton.c | 24 +++++++++++++++---------
drivers/net/r8169.c | 43 +++++++++++++++++++------------------------
13 files changed, 172 insertions(+), 134 deletions(-)
25a0324ef1c1b181c9d00f09837e8757875ee2a4
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 0cdc830..c38e352 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -1837,9 +1837,11 @@ #endif
if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) {
- printk(KERN_ERR PFX "pci dev %s (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",
- pci_name(pdev), pdev->vendor, pdev->device, pci_rev);
- printk(KERN_ERR PFX "Try the \"8139too\" driver instead.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",
+ pdev->vendor, pdev->device, pci_rev);
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Try the \"8139too\" driver instead.\n");
return -ENODEV;
}
@@ -1877,14 +1879,14 @@ #endif
pciaddr = pci_resource_start(pdev, 1);
if (!pciaddr) {
rc = -EIO;
- printk(KERN_ERR PFX "no MMIO resource for pci dev %s\n",
- pci_name(pdev));
+ dev_printk(KERN_ERR, &pdev->dev, "no MMIO resource\n");
goto err_out_res;
}
if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) {
rc = -EIO;
- printk(KERN_ERR PFX "MMIO resource (%lx) too small on pci dev %s\n",
- pci_resource_len(pdev, 1), pci_name(pdev));
+ dev_printk(KERN_ERR, &pdev->dev,
+ "MMIO resource (%lx) too small\n",
+ pci_resource_len(pdev, 1));
goto err_out_res;
}
@@ -1898,14 +1900,15 @@ #endif
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
- printk(KERN_ERR PFX "No usable DMA configuration, "
- "aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "No usable DMA configuration, aborting.\n");
goto err_out_res;
}
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
- printk(KERN_ERR PFX "No usable consistent DMA configuration, "
- "aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "No usable consistent DMA configuration, "
+ "aborting.\n");
goto err_out_res;
}
}
@@ -1916,8 +1919,9 @@ #endif
regs = ioremap(pciaddr, CP_REGS_SIZE);
if (!regs) {
rc = -EIO;
- printk(KERN_ERR PFX "Cannot map PCI MMIO (%lx@%lx) on pci dev %s\n",
- pci_resource_len(pdev, 1), pciaddr, pci_name(pdev));
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Cannot map PCI MMIO (%lx@%lx)\n",
+ pci_resource_len(pdev, 1), pciaddr);
goto err_out_res;
}
dev->base_addr = (unsigned long) regs;
@@ -1986,7 +1990,8 @@ #endif
/* enable busmastering and memory-write-invalidate */
pci_set_master(pdev);
- if (cp->wol_enabled) cp_set_d3_state (cp);
+ if (cp->wol_enabled)
+ cp_set_d3_state (cp);
return 0;
@@ -2011,7 +2016,8 @@ static void cp_remove_one (struct pci_de
BUG_ON(!dev);
unregister_netdev(dev);
iounmap(cp->regs);
- if (cp->wol_enabled) pci_set_power_state (pdev, PCI_D0);
+ if (cp->wol_enabled)
+ pci_set_power_state (pdev, PCI_D0);
pci_release_regions(pdev);
pci_clear_mwi(pdev);
pci_disable_device(pdev);
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index abd6261..b2592c4 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -769,7 +769,8 @@ static int __devinit rtl8139_init_board
/* dev and priv zeroed in alloc_etherdev */
dev = alloc_etherdev (sizeof (*tp));
if (dev == NULL) {
- printk (KERN_ERR PFX "%s: Unable to alloc new net device\n", pci_name(pdev));
+ dev_printk (KERN_ERR, &pdev->dev,
+ "Unable to alloc new net device\n");
return -ENOMEM;
}
SET_MODULE_OWNER(dev);
@@ -801,31 +802,35 @@ static int __devinit rtl8139_init_board
#ifdef USE_IO_OPS
/* make sure PCI base addr 0 is PIO */
if (!(pio_flags & IORESOURCE_IO)) {
- printk (KERN_ERR PFX "%s: region #0 not a PIO resource, aborting\n", pci_name(pdev));
+ dev_printk (KERN_ERR, &pdev->dev,
+ "region #0 not a PIO resource, aborting\n");
rc = -ENODEV;
goto err_out;
}
/* check for weird/broken PCI region reporting */
if (pio_len < RTL_MIN_IO_SIZE) {
- printk (KERN_ERR PFX "%s: Invalid PCI I/O region size(s), aborting\n", pci_name(pdev));
+ dev_printk (KERN_ERR, &pdev->dev,
+ "Invalid PCI I/O region size(s), aborting\n");
rc = -ENODEV;
goto err_out;
}
#else
/* make sure PCI base addr 1 is MMIO */
if (!(mmio_flags & IORESOURCE_MEM)) {
- printk (KERN_ERR PFX "%s: region #1 not an MMIO resource, aborting\n", pci_name(pdev));
+ dev_printk (KERN_ERR, &pdev->dev,
+ "region #1 not an MMIO resource, aborting\n");
rc = -ENODEV;
goto err_out;
}
if (mmio_len < RTL_MIN_IO_SIZE) {
- printk (KERN_ERR PFX "%s: Invalid PCI mem region size(s), aborting\n", pci_name(pdev));
+ dev_printk (KERN_ERR, &pdev->dev,
+ "Invalid PCI mem region size(s), aborting\n");
rc = -ENODEV;
goto err_out;
}
#endif
- rc = pci_request_regions (pdev, "8139too");
+ rc = pci_request_regions (pdev, DRV_NAME);
if (rc)
goto err_out;
disable_dev_on_err = 1;
@@ -836,7 +841,7 @@ #endif
#ifdef USE_IO_OPS
ioaddr = ioport_map(pio_start, pio_len);
if (!ioaddr) {
- printk (KERN_ERR PFX "%s: cannot map PIO, aborting\n", pci_name(pdev));
+ dev_printk (KERN_ERR, &pdev->dev, "cannot map PIO, aborting\n");
rc = -EIO;
goto err_out;
}
@@ -847,7 +852,8 @@ #else
/* ioremap MMIO region */
ioaddr = pci_iomap(pdev, 1, 0);
if (ioaddr == NULL) {
- printk (KERN_ERR PFX "%s: cannot remap MMIO, aborting\n", pci_name(pdev));
+ dev_printk (KERN_ERR, &pdev->dev,
+ "cannot remap MMIO, aborting\n");
rc = -EIO;
goto err_out;
}
@@ -861,8 +867,8 @@ #endif /* USE_IO_OPS */
/* check for missing/broken hardware */
if (RTL_R32 (TxConfig) == 0xFFFFFFFF) {
- printk (KERN_ERR PFX "%s: Chip not responding, ignoring board\n",
- pci_name(pdev));
+ dev_printk (KERN_ERR, &pdev->dev,
+ "Chip not responding, ignoring board\n");
rc = -EIO;
goto err_out;
}
@@ -876,9 +882,10 @@ #endif /* USE_IO_OPS */
}
/* if unknown chip, assume array element #0, original RTL-8139 in this case */
- printk (KERN_DEBUG PFX "%s: unknown chip version, assuming RTL-8139\n",
- pci_name(pdev));
- printk (KERN_DEBUG PFX "%s: TxConfig = 0x%lx\n", pci_name(pdev), RTL_R32 (TxConfig));
+ dev_printk (KERN_DEBUG, &pdev->dev,
+ "unknown chip version, assuming RTL-8139\n");
+ dev_printk (KERN_DEBUG, &pdev->dev,
+ "TxConfig = 0x%lx\n", RTL_R32 (TxConfig));
tp->chipset = 0;
match:
@@ -955,9 +962,11 @@ #endif
if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) {
- printk(KERN_INFO PFX "pci dev %s (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n",
- pci_name(pdev), pdev->vendor, pdev->device, pci_rev);
- printk(KERN_INFO PFX "Use the \"8139cp\" driver for improved performance and stability.\n");
+ dev_printk(KERN_INFO, &pdev->dev,
+ "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n",
+ pdev->vendor, pdev->device, pci_rev);
+ dev_printk(KERN_INFO, &pdev->dev,
+ "Use the \"8139cp\" driver for improved performance and stability.\n");
}
i = rtl8139_init_board (pdev, &dev);
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index a7e4ba5..6d7748d 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -2120,13 +2120,14 @@ static int __devinit b44_init_one(struct
err = pci_enable_device(pdev);
if (err) {
- printk(KERN_ERR PFX "Cannot enable PCI device, "
+ dev_printk(KERN_ERR, &pdev->dev, "Cannot enable PCI device, "
"aborting.\n");
return err;
}
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
- printk(KERN_ERR PFX "Cannot find proper PCI device "
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Cannot find proper PCI device "
"base address, aborting.\n");
err = -ENODEV;
goto err_out_disable_pdev;
@@ -2134,8 +2135,8 @@ static int __devinit b44_init_one(struct
err = pci_request_regions(pdev, DRV_MODULE_NAME);
if (err) {
- printk(KERN_ERR PFX "Cannot obtain PCI resources, "
- "aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Cannot obtain PCI resources, aborting.\n");
goto err_out_disable_pdev;
}
@@ -2143,15 +2144,15 @@ static int __devinit b44_init_one(struct
err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK);
if (err) {
- printk(KERN_ERR PFX "No usable DMA configuration, "
- "aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "No usable DMA configuration, aborting.\n");
goto err_out_free_res;
}
err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK);
if (err) {
- printk(KERN_ERR PFX "No usable DMA configuration, "
- "aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "No usable DMA configuration, aborting.\n");
goto err_out_free_res;
}
@@ -2160,7 +2161,8 @@ static int __devinit b44_init_one(struct
dev = alloc_etherdev(sizeof(*bp));
if (!dev) {
- printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Etherdev alloc failed, aborting.\n");
err = -ENOMEM;
goto err_out_free_res;
}
@@ -2181,7 +2183,7 @@ static int __devinit b44_init_one(struct
bp->regs = ioremap(b44reg_base, b44reg_len);
if (bp->regs == 0UL) {
- printk(KERN_ERR PFX "Cannot map device registers, "
+ dev_printk(KERN_ERR, &pdev->dev, "Cannot map device registers, "
"aborting.\n");
err = -ENOMEM;
goto err_out_free_dev;
@@ -2212,8 +2214,8 @@ #endif
err = b44_get_invariants(bp);
if (err) {
- printk(KERN_ERR PFX "Problem fetching invariants of chip, "
- "aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Problem fetching invariants of chip, aborting.\n");
goto err_out_iounmap;
}
@@ -2233,7 +2235,7 @@ #endif
err = register_netdev(dev);
if (err) {
- printk(KERN_ERR PFX "Cannot register net device, "
+ dev_printk(KERN_ERR, &pdev->dev, "Cannot register net device, "
"aborting.\n");
goto err_out_iounmap;
}
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 7635736..171e498 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -5566,20 +5566,22 @@ bnx2_init_board(struct pci_dev *pdev, st
/* enable device (incl. PCI PM wakeup), and bus-mastering */
rc = pci_enable_device(pdev);
if (rc) {
- printk(KERN_ERR PFX "Cannot enable PCI device, aborting.");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Cannot enable PCI device, aborting.");
goto err_out;
}
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
- printk(KERN_ERR PFX "Cannot find PCI device base address, "
- "aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Cannot find PCI device base address, aborting.\n");
rc = -ENODEV;
goto err_out_disable;
}
rc = pci_request_regions(pdev, DRV_MODULE_NAME);
if (rc) {
- printk(KERN_ERR PFX "Cannot obtain PCI resources, aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Cannot obtain PCI resources, aborting.\n");
goto err_out_disable;
}
@@ -5587,15 +5589,16 @@ bnx2_init_board(struct pci_dev *pdev, st
bp->pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
if (bp->pm_cap == 0) {
- printk(KERN_ERR PFX "Cannot find power management capability, "
- "aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Cannot find power management capability, aborting.\n");
rc = -EIO;
goto err_out_release;
}
bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX);
if (bp->pcix_cap == 0) {
- printk(KERN_ERR PFX "Cannot find PCIX capability, aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Cannot find PCIX capability, aborting.\n");
rc = -EIO;
goto err_out_release;
}
@@ -5603,14 +5606,15 @@ bnx2_init_board(struct pci_dev *pdev, st
if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) {
bp->flags |= USING_DAC_FLAG;
if (pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK) != 0) {
- printk(KERN_ERR PFX "pci_set_consistent_dma_mask "
- "failed, aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "pci_set_consistent_dma_mask failed, aborting.\n");
rc = -EIO;
goto err_out_release;
}
}
else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) {
- printk(KERN_ERR PFX "System does not support DMA, aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "System does not support DMA, aborting.\n");
rc = -EIO;
goto err_out_release;
}
@@ -5630,7 +5634,8 @@ bnx2_init_board(struct pci_dev *pdev, st
bp->regview = ioremap_nocache(dev->base_addr, mem_len);
if (!bp->regview) {
- printk(KERN_ERR PFX "Cannot map register space, aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Cannot map register space, aborting.\n");
rc = -ENOMEM;
goto err_out_release;
}
@@ -5702,8 +5707,8 @@ bnx2_init_board(struct pci_dev *pdev, st
else if ((CHIP_ID(bp) == CHIP_ID_5706_A1) &&
!(bp->flags & PCIX_FLAG)) {
- printk(KERN_ERR PFX "5706 A1 can only be used in a PCIX bus, "
- "aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "5706 A1 can only be used in a PCIX bus, aborting.\n");
goto err_out_unmap;
}
@@ -5724,7 +5729,8 @@ bnx2_init_board(struct pci_dev *pdev, st
if ((reg & BNX2_DEV_INFO_SIGNATURE_MAGIC_MASK) !=
BNX2_DEV_INFO_SIGNATURE_MAGIC) {
- printk(KERN_ERR PFX "Firmware not running, aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Firmware not running, aborting.\n");
rc = -ENODEV;
goto err_out_unmap;
}
@@ -5886,7 +5892,8 @@ #if defined(HAVE_POLL_CONTROLLER) || def
#endif
if ((rc = register_netdev(dev))) {
- printk(KERN_ERR PFX "Cannot register net device\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Cannot register net device\n");
if (bp->regview)
iounmap(bp->regview);
pci_release_regions(pdev);
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 565a54f..ccff239 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -4888,13 +4888,13 @@ static int __devinit cas_init_one(struct
err = pci_enable_device(pdev);
if (err) {
- printk(KERN_ERR PFX "Cannot enable PCI device, "
+ dev_printk(KERN_ERR, &pdev->dev, "Cannot enable PCI device, "
"aborting.\n");
return err;
}
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
- printk(KERN_ERR PFX "Cannot find proper PCI device "
+ dev_printk(KERN_ERR, &pdev->dev, "Cannot find proper PCI device "
"base address, aborting.\n");
err = -ENODEV;
goto err_out_disable_pdev;
@@ -4902,7 +4902,7 @@ static int __devinit cas_init_one(struct
dev = alloc_etherdev(sizeof(*cp));
if (!dev) {
- printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n");
+ dev_printk(KERN_ERR, &pdev->dev, "Etherdev alloc failed, aborting.\n");
err = -ENOMEM;
goto err_out_disable_pdev;
}
@@ -4911,7 +4911,7 @@ static int __devinit cas_init_one(struct
err = pci_request_regions(pdev, dev->name);
if (err) {
- printk(KERN_ERR PFX "Cannot obtain PCI resources, "
+ dev_printk(KERN_ERR, &pdev->dev, "Cannot obtain PCI resources, "
"aborting.\n");
goto err_out_free_netdev;
}
@@ -4942,7 +4942,7 @@ #if 1
if (pci_write_config_byte(pdev,
PCI_CACHE_LINE_SIZE,
cas_cacheline_size)) {
- printk(KERN_ERR PFX "Could not set PCI cache "
+ dev_printk(KERN_ERR, &pdev->dev, "Could not set PCI cache "
"line size\n");
goto err_write_cacheline;
}
@@ -4956,7 +4956,7 @@ #endif
err = pci_set_consistent_dma_mask(pdev,
DMA_64BIT_MASK);
if (err < 0) {
- printk(KERN_ERR PFX "Unable to obtain 64-bit DMA "
+ dev_printk(KERN_ERR, &pdev->dev, "Unable to obtain 64-bit DMA "
"for consistent allocations\n");
goto err_out_free_res;
}
@@ -4964,7 +4964,7 @@ #endif
} else {
err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (err) {
- printk(KERN_ERR PFX "No usable DMA configuration, "
+ dev_printk(KERN_ERR, &pdev->dev, "No usable DMA configuration, "
"aborting.\n");
goto err_out_free_res;
}
@@ -5024,7 +5024,7 @@ #endif
/* give us access to cassini registers */
cp->regs = pci_iomap(pdev, 0, casreg_len);
if (cp->regs == 0UL) {
- printk(KERN_ERR PFX "Cannot map device registers, "
+ dev_printk(KERN_ERR, &pdev->dev, "Cannot map device registers, "
"aborting.\n");
goto err_out_free_res;
}
@@ -5041,7 +5041,7 @@ #endif
pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
&cp->block_dvma);
if (!cp->init_block) {
- printk(KERN_ERR PFX "Cannot allocate init block, "
+ dev_printk(KERN_ERR, &pdev->dev, "Cannot allocate init block, "
"aborting.\n");
goto err_out_iounmap;
}
@@ -5086,7 +5086,7 @@ #endif
dev->features |= NETIF_F_HIGHDMA;
if (register_netdev(dev)) {
- printk(KERN_ERR PFX "Cannot register net device, "
+ dev_printk(KERN_ERR, &pdev->dev, "Cannot register net device, "
"aborting.\n");
goto err_out_free_consistent;
}
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index ecf5ad8..0b65a31 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -556,12 +556,14 @@ #endif
if (!request_region(pci_resource_start(pdev, 1),
pci_resource_len(pdev, 1), "eepro100")) {
- printk (KERN_ERR "eepro100: cannot reserve I/O ports\n");
+ dev_printk (KERN_ERR, &pdev->dev,
+ "eepro100: cannot reserve I/O ports\n");
goto err_out_none;
}
if (!request_mem_region(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0), "eepro100")) {
- printk (KERN_ERR "eepro100: cannot reserve MMIO region\n");
+ dev_printk (KERN_ERR, &pdev->dev,
+ "eepro100: cannot reserve MMIO region\n");
goto err_out_free_pio_region;
}
@@ -574,7 +576,7 @@ #endif
ioaddr = pci_iomap(pdev, pci_bar, 0);
if (!ioaddr) {
- printk (KERN_ERR "eepro100: cannot remap IO\n");
+ dev_printk (KERN_ERR, &pdev->dev, "eepro100: cannot remap IO\n");
goto err_out_free_mmio_region;
}
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index 8dacd0d..1ec06a5 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -423,8 +423,7 @@ #endif
((u16 *)dev->dev_addr)[i] = le16_to_cpu(inw(ioaddr + LAN0 + i*4));
if (debug > 2) {
- printk(KERN_DEBUG DRV_NAME "(%s): EEPROM contents\n",
- pci_name(pdev));
+ dev_printk(KERN_DEBUG, &pdev->dev, "EEPROM contents:\n");
for (i = 0; i < 64; i++)
printk(" %4.4x%s", read_eeprom(ioaddr, i),
i % 16 == 15 ? "\n" : "");
@@ -446,21 +445,23 @@ #endif
int mii_status = mdio_read(dev, phy, MII_BMSR);
if (mii_status != 0xffff && mii_status != 0x0000) {
ep->phys[phy_idx++] = phy;
- printk(KERN_INFO DRV_NAME "(%s): MII transceiver #%d control "
- "%4.4x status %4.4x.\n",
- pci_name(pdev), phy, mdio_read(dev, phy, 0), mii_status);
+ dev_printk(KERN_INFO, &pdev->dev,
+ "MII transceiver #%d control "
+ "%4.4x status %4.4x.\n",
+ phy, mdio_read(dev, phy, 0), mii_status);
}
}
ep->mii_phy_cnt = phy_idx;
if (phy_idx != 0) {
phy = ep->phys[0];
ep->mii.advertising = mdio_read(dev, phy, MII_ADVERTISE);
- printk(KERN_INFO DRV_NAME "(%s): Autonegotiation advertising %4.4x link "
+ dev_printk(KERN_INFO, &pdev->dev,
+ "Autonegotiation advertising %4.4x link "
"partner %4.4x.\n",
- pci_name(pdev), ep->mii.advertising, mdio_read(dev, phy, 5));
+ ep->mii.advertising, mdio_read(dev, phy, 5));
} else if ( ! (ep->chip_flags & NO_MII)) {
- printk(KERN_WARNING DRV_NAME "(%s): ***WARNING***: No MII transceiver found!\n",
- pci_name(pdev));
+ dev_printk(KERN_WARNING, &pdev->dev,
+ "***WARNING***: No MII transceiver found!\n");
/* Use the known PHY address of the EPII. */
ep->phys[0] = 3;
}
@@ -475,8 +476,8 @@ #endif
/* The lower four bits are the media type. */
if (duplex) {
ep->mii.force_media = ep->mii.full_duplex = 1;
- printk(KERN_INFO DRV_NAME "(%s): Forced full duplex operation requested.\n",
- pci_name(pdev));
+ dev_printk(KERN_INFO, &pdev->dev,
+ "Forced full duplex operation requested.\n");
}
dev->if_port = ep->default_port = option;
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index 958ea51..9369082 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -578,9 +578,9 @@ #endif
if (mii_status != 0xffff && mii_status != 0x0000) {
np->phys[phy_idx++] = phy;
- printk(KERN_INFO
- "%s: MII PHY found at address %d, status "
- "0x%4.4x.\n", dev->name, phy, mii_status);
+ dev_printk(KERN_INFO, &pdev->dev,
+ "MII PHY found at address %d, status "
+ "0x%4.4x.\n", phy, mii_status);
/* get phy type */
{
unsigned int data;
@@ -603,10 +603,10 @@ #endif
}
np->mii_cnt = phy_idx;
- if (phy_idx == 0) {
- printk(KERN_WARNING "%s: MII PHY not found -- this device may "
- "not operate correctly.\n", dev->name);
- }
+ if (phy_idx == 0)
+ dev_printk(KERN_WARNING, &pdev->dev,
+ "MII PHY not found -- this device may "
+ "not operate correctly.\n");
} else {
np->phys[0] = 32;
/* 89/6/23 add, (begin) */
@@ -632,7 +632,8 @@ #endif
np->mii.full_duplex = full_duplex[card_idx];
if (np->mii.full_duplex) {
- printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name);
+ dev_printk(KERN_INFO, &pdev->dev,
+ "Media type forced to Full Duplex.\n");
/* 89/6/13 add, (begin) */
// if (np->PHYType==MarvellPHY)
if ((np->PHYType == MarvellPHY) || (np->PHYType == LevelOnePHY)) {
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index 2b91099..168eb4e 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -601,7 +601,8 @@ #endif
pci_set_master(pdev);
i = pci_request_regions(pdev, DRV_NAME);
- if (i) return i;
+ if (i)
+ return i;
irq = pdev->irq;
ioaddr = ioremap(base, 0x400);
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c
index ced9fdb..b5bf53f 100644
--- a/drivers/net/ne2k-pci.c
+++ b/drivers/net/ne2k-pci.c
@@ -231,12 +231,14 @@ #endif
irq = pdev->irq;
if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) {
- printk (KERN_ERR PFX "no I/O resource at PCI BAR #0\n");
+ dev_printk (KERN_ERR, &pdev->dev,
+ "no I/O resource at PCI BAR #0\n");
return -ENODEV;
}
if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) {
- printk (KERN_ERR PFX "I/O resource 0x%x @ 0x%lx busy\n",
+ dev_printk (KERN_ERR, &pdev->dev,
+ "I/O resource 0x%x @ 0x%lx busy\n",
NE_IO_EXTENT, ioaddr);
return -EBUSY;
}
@@ -263,7 +265,8 @@ #endif
/* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */
dev = alloc_ei_netdev();
if (!dev) {
- printk (KERN_ERR PFX "cannot allocate ethernet device\n");
+ dev_printk (KERN_ERR, &pdev->dev,
+ "cannot allocate ethernet device\n");
goto err_out_free_res;
}
SET_MODULE_OWNER(dev);
@@ -281,7 +284,8 @@ #endif
while ((inb(ioaddr + EN0_ISR) & ENISR_RESET) == 0)
/* Limit wait: '2' avoids jiffy roll-over. */
if (jiffies - reset_start_time > 2) {
- printk(KERN_ERR PFX "Card failure (no reset ack).\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "Card failure (no reset ack).\n");
goto err_out_free_netdev;
}
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 706aed7..916ec99 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1833,7 +1833,8 @@ static int __devinit ns83820_init_one(st
} else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
using_dac = 0;
} else {
- printk(KERN_WARNING "ns83820.c: pci_set_dma_mask failed!\n");
+ dev_printk(KERN_WARNING, &pci_dev->dev,
+ "pci_set_dma_mask failed!\n");
return -ENODEV;
}
@@ -1856,7 +1857,8 @@ static int __devinit ns83820_init_one(st
err = pci_enable_device(pci_dev);
if (err) {
- printk(KERN_INFO "ns83820: pci_enable_dev failed: %d\n", err);
+ dev_printk(KERN_INFO, &pci_dev->dev,
+ "pci_enable_dev failed: %d\n", err);
goto out_free;
}
@@ -1885,8 +1887,9 @@ static int __devinit ns83820_init_one(st
err = request_irq(pci_dev->irq, ns83820_irq, SA_SHIRQ,
DRV_NAME, ndev);
if (err) {
- printk(KERN_INFO "ns83820: unable to register irq %d\n",
- pci_dev->irq);
+ dev_printk(KERN_INFO, &pci_dev->dev,
+ "unable to register irq %d, err %d\n",
+ pci_dev->irq, err);
goto out_disable;
}
@@ -1900,7 +1903,8 @@ static int __devinit ns83820_init_one(st
rtnl_lock();
err = dev_alloc_name(ndev, ndev->name);
if (err < 0) {
- printk(KERN_INFO "ns83820: unable to get netdev name: %d\n", err);
+ dev_printk(KERN_INFO, &pci_dev->dev,
+ "unable to get netdev name: %d\n", err);
goto out_free_irq;
}
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index a7bb54d..2754fad 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -602,7 +602,8 @@ static int __devinit netdrv_init_board (
/* dev zeroed in alloc_etherdev */
dev = alloc_etherdev (sizeof (*tp));
if (dev == NULL) {
- printk (KERN_ERR PFX "unable to alloc new ethernet\n");
+ dev_printk (KERN_ERR, &pdev->dev,
+ "unable to alloc new ethernet\n");
DPRINTK ("EXIT, returning -ENOMEM\n");
return -ENOMEM;
}
@@ -632,14 +633,16 @@ static int __devinit netdrv_init_board (
/* make sure PCI base addr 0 is PIO */
if (!(pio_flags & IORESOURCE_IO)) {
- printk (KERN_ERR PFX "region #0 not a PIO resource, aborting\n");
+ dev_printk (KERN_ERR, &pdev->dev,
+ "region #0 not a PIO resource, aborting\n");
rc = -ENODEV;
goto err_out;
}
/* make sure PCI base addr 1 is MMIO */
if (!(mmio_flags & IORESOURCE_MEM)) {
- printk (KERN_ERR PFX "region #1 not an MMIO resource, aborting\n");
+ dev_printk (KERN_ERR, &pdev->dev,
+ "region #1 not an MMIO resource, aborting\n");
rc = -ENODEV;
goto err_out;
}
@@ -647,12 +650,13 @@ static int __devinit netdrv_init_board (
/* check for weird/broken PCI region reporting */
if ((pio_len < NETDRV_MIN_IO_SIZE) ||
(mmio_len < NETDRV_MIN_IO_SIZE)) {
- printk (KERN_ERR PFX "Invalid PCI region size(s), aborting\n");
+ dev_printk (KERN_ERR, &pdev->dev,
+ "Invalid PCI region size(s), aborting\n");
rc = -ENODEV;
goto err_out;
}
- rc = pci_request_regions (pdev, "pci-skeleton");
+ rc = pci_request_regions (pdev, MODNAME);
if (rc)
goto err_out;
@@ -664,7 +668,8 @@ #else
/* ioremap MMIO region */
ioaddr = ioremap (mmio_start, mmio_len);
if (ioaddr == NULL) {
- printk (KERN_ERR PFX "cannot remap MMIO, aborting\n");
+ dev_printk (KERN_ERR, &pdev->dev,
+ "cannot remap MMIO, aborting\n");
rc = -EIO;
goto err_out_free_res;
}
@@ -700,9 +705,10 @@ #endif /* !USE_IO_OPS */
}
/* if unknown chip, assume array element #0, original RTL-8139 in this case */
- printk (KERN_DEBUG PFX "PCI device %s: unknown chip version, assuming RTL-8139\n",
- pci_name(pdev));
- printk (KERN_DEBUG PFX "PCI device %s: TxConfig = 0x%lx\n", pci_name(pdev), NETDRV_R32 (TxConfig));
+ dev_printk (KERN_DEBUG, &pdev->dev,
+ "unknown chip version, assuming RTL-8139\n");
+ dev_printk (KERN_DEBUG, &pdev->dev, "TxConfig = 0x%lx\n",
+ NETDRV_R32 (TxConfig));
tp->chipset = 0;
match:
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 12d1cb2..24a5b31 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1406,7 +1406,8 @@ rtl8169_init_board(struct pci_dev *pdev,
dev = alloc_etherdev(sizeof (*tp));
if (dev == NULL) {
if (netif_msg_drv(&debug))
- printk(KERN_ERR PFX "unable to alloc new ethernet\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "unable to alloc new ethernet\n");
goto err_out;
}
@@ -1418,10 +1419,8 @@ rtl8169_init_board(struct pci_dev *pdev,
/* enable device (incl. PCI PM wakeup and hotplug setup) */
rc = pci_enable_device(pdev);
if (rc < 0) {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX "%s: enable failure\n",
- pci_name(pdev));
- }
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev, "enable failure\n");
goto err_out_free_dev;
}
@@ -1437,37 +1436,33 @@ rtl8169_init_board(struct pci_dev *pdev,
pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command);
acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
} else {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev,
"PowerManagement capability not found.\n");
- }
}
/* make sure PCI base addr 1 is MMIO */
if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev,
"region #1 not an MMIO resource, aborting\n");
- }
rc = -ENODEV;
goto err_out_mwi;
}
/* check for weird/broken PCI region reporting */
if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev,
"Invalid PCI region size(s), aborting\n");
- }
rc = -ENODEV;
goto err_out_mwi;
}
rc = pci_request_regions(pdev, MODULENAME);
if (rc < 0) {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX "%s: could not request regions.\n",
- pci_name(pdev));
- }
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev,
+ "could not request regions.\n");
goto err_out_mwi;
}
@@ -1480,10 +1475,9 @@ rtl8169_init_board(struct pci_dev *pdev,
} else {
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc < 0) {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev,
"DMA configuration failed.\n");
- }
goto err_out_free_res;
}
}
@@ -1494,7 +1488,8 @@ rtl8169_init_board(struct pci_dev *pdev,
ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE);
if (ioaddr == NULL) {
if (netif_msg_probe(tp))
- printk(KERN_ERR PFX "cannot remap MMIO, aborting\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "cannot remap MMIO, aborting\n");
rc = -EIO;
goto err_out_free_res;
}
@@ -1526,9 +1521,9 @@ rtl8169_init_board(struct pci_dev *pdev,
if (i < 0) {
/* Unknown chip: assume array element #0, original RTL-8169 */
if (netif_msg_probe(tp)) {
- printk(KERN_DEBUG PFX "PCI device %s: "
+ dev_printk(KERN_DEBUG, &pdev->dev,
"unknown chip version, assuming %s\n",
- pci_name(pdev), rtl_chip_info[0].name);
+ rtl_chip_info[0].name);
}
i++;
}
^ permalink raw reply related
* [PATCH 2/3] mv643xx fixes - Increment TX bytes statistics counter
From: Brent Cook @ 2006-06-27 14:52 UTC (permalink / raw)
To: netdev
This fixes a simple typo from the last set of driver simplifications patches.
Now TX bytes stats are actually incremented rather than just containing the
size of the last packet sent.
Signed-off-by: Brent Cook <bcook@bpointsys.com>
--- a/drivers/net/mv643xx_eth.c 2006-05-04 00:51:47.000000000 -0500
+++ b/drivers/net/mv643xx_eth.c 2006-06-27 09:20:58.000000000 -0500
@@ -1211,7 +1218,7 @@
spin_lock_irqsave(&mp->lock, flags);
eth_tx_submit_descs_for_skb(mp, skb);
- stats->tx_bytes = skb->len;
+ stats->tx_bytes += skb->len;
stats->tx_packets++;
dev->trans_start = jiffies;
^ permalink raw reply
* [PATCH 3/3] mv643xx fixes - Support BCM5461 PHY initialization
From: Brent Cook @ 2006-06-27 14:52 UTC (permalink / raw)
To: netdev
A couple of PrPMC MV64x60 boards have Broadcom BCM5461 PHYs rather than
Marvell. This patch adds the initialization bits required by these PHYs.
There was infrastructure prior to the 2.6.16 kernel for the ppc platform
support to add extra flags to the ethernet ports during initialization but
driver simplifaction removed this ability, so I just put the required
TX_CLK_DELAY flag in the main driver instead. This does not appear to have
any affect on the Marvell PHY-based board that I tested it on.
Signed-off-by: Brent Cook <bcook@bpointsys.com>
--- a/drivers/net/mv643xx_eth.c 2006-05-04 00:51:47.000000000 -0500
+++ b/drivers/net/mv643xx_eth.c 2006-06-27 09:20:58.000000000 -0500
@@ -1788,6 +1795,7 @@
MV643XX_ETH_DISABLE_AUTO_NEG_SPEED_GMII |
MV643XX_ETH_DISABLE_AUTO_NEG_FOR_DUPLX |
MV643XX_ETH_DO_NOT_FORCE_LINK_FAIL |
+ MV643XX_ETH_TX_CLK_DELAY |
MV643XX_ETH_SERIAL_PORT_CONTROL_RESERVED;
mv_write(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port_num), pscr);
@@ -2275,6 +2283,7 @@
static void ethernet_phy_reset(unsigned int eth_port_num)
{
unsigned int phy_reg_data;
+ unsigned int id1, id2;
/* Reset the PHY */
eth_port_read_smi_reg(eth_port_num, 0, &phy_reg_data);
@@ -2286,6 +2295,14 @@
udelay(1);
eth_port_read_smi_reg(eth_port_num, 0, &phy_reg_data);
} while (phy_reg_data & 0x8000);
+
+ /* Check PHY type */
+ eth_port_read_smi_reg(eth_port_num, 0x02, &id1);
+ eth_port_read_smi_reg(eth_port_num, 0x03, &id2);
+ if ((id1 == 0x0020) && ((id2 & 0xfff0) == 0x60c0)) {
+ /* BCM5461 fixup: Disable GTXC delay */
+ eth_port_write_smi_reg(eth_port_num, 0x1c, 0x8c00);
+ }
}
static void mv643xx_eth_port_enable_tx(unsigned int port_num,
^ permalink raw reply
* Re: [PATCH Round 2 0/2][RFC] Network Event Notifier Mechanism
From: Steve Wise @ 2006-06-27 15:02 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20060627.030920.108743110.davem@davemloft.net>
On Tue, 2006-06-27 at 03:09 -0700, David Miller wrote:
> From: Steve Wise <swise@opengridcomputing.com>
> Date: Mon, 26 Jun 2006 15:36:38 -0500
>
> > Round 2 Changes:
> >
> > - cleaned up event structures per review feedback.
> > - began integration with netlink (see neighbour changes in patch 2).
> > - added IPv6 support.
>
> Yes, ipv6 support is the main think I saw lacking.
> Especially the neighbour stuff.
>
> How will you interpret the neighbour object properly, by
> looking at neigh->ops->family?
>
Yea.
Also: WRT a netlink message for REDIRECT events. After thinking more
about this, it seems like users will already get notification of a
REDIRECT in the form of 2 messages, a RTM_DELROUTE for the old route and
a RTM_NEWROUTE message with the RTPROT_REDIRECT protocol type. I think
this is perhaps sufficient for user mode notifications. What do you
think?
For the RDMA kernel subsystem, however, we still need a specific event.
We need both the old and new dst_entry struct ptrs to figure out which
active connections were using the old dst_entry and should be updated to
use the new dst_entry.
Steve.
^ permalink raw reply
* Re: [PATCHSET] Towards accurate incoming interface information
From: Thomas Graf @ 2006-06-27 15:07 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <20060626145446.948105000@postel.suug.ch>
* Thomas Graf <tgraf@suug.ch> 2006-06-26 16:54
> This patchset transforms skb->input_dev based on a device
> reference to skb->iif based on an interface index moving
> towards accurate iif information for routing and classification
> through the following changesets:
Hold on with this, I haven't noticed this ifb device
go in and thus missed to update it. I'll post an
updated patch shortly
^ permalink raw reply
* Re: [PATCH] use dev_printk() in some net drivers
From: Jiri Slaby @ 2006-06-27 15:10 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, linux-kernel
In-Reply-To: <20060627145145.GA30053@havoc.gtf.org>
Jeff Garzik napsal(a):
> commit 25a0324ef1c1b181c9d00f09837e8757875ee2a4
> Author: Jeff Garzik <jeff@garzik.org>
> Date: Tue Jun 27 10:47:51 2006 -0400
>
> [netdrvr] Use dev_printk() when ethernet interface isn't available
>
> For messages prior to register_netdev(), prefer dev_printk() because
> that prints out both our driver name and our [PCI | whatever] bus id.
>
> Updates: 8139{cp,too}, b44, bnx2, cassini, {eepro,epic}100, fealnx,
> hamachi, ne2k-pci, ns83820, pci-skeleton, r8169.
>
> Signed-off-by: Jeff Garzik <jeff@garzik.org>
>
> drivers/net/8139cp.c | 36 +++++++++++++++++++++---------------
> drivers/net/8139too.c | 41 +++++++++++++++++++++++++----------------
> drivers/net/b44.c | 28 +++++++++++++++-------------
> drivers/net/bnx2.c | 37 ++++++++++++++++++++++---------------
> drivers/net/cassini.c | 20 ++++++++++----------
> drivers/net/eepro100.c | 8 +++++---
> drivers/net/epic100.c | 23 ++++++++++++-----------
> drivers/net/fealnx.c | 17 +++++++++--------
> drivers/net/hamachi.c | 3 ++-
> drivers/net/ne2k-pci.c | 12 ++++++++----
> drivers/net/ns83820.c | 14 +++++++++-----
> drivers/net/pci-skeleton.c | 24 +++++++++++++++---------
> drivers/net/r8169.c | 43 +++++++++++++++++++------------------------
> 13 files changed, 172 insertions(+), 134 deletions(-)
>
> 25a0324ef1c1b181c9d00f09837e8757875ee2a4
> diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
> index 0cdc830..c38e352 100644
> --- a/drivers/net/8139cp.c
> +++ b/drivers/net/8139cp.c
> @@ -1837,9 +1837,11 @@ #endif
>
> if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
> pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) {
> - printk(KERN_ERR PFX "pci dev %s (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",
> - pci_name(pdev), pdev->vendor, pdev->device, pci_rev);
> - printk(KERN_ERR PFX "Try the \"8139too\" driver instead.\n");
> + dev_printk(KERN_ERR, &pdev->dev,
> + "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",
> + pdev->vendor, pdev->device, pci_rev);
> + dev_printk(KERN_ERR, &pdev->dev,
> + "Try the \"8139too\" driver instead.\n");
> return -ENODEV;
> }
>
Don't you consider to use s#dev_printk(KERN_ERR, #dev_err(# macro?
regards,
--
Jiri Slaby www.fi.muni.cz/~xslaby
~\-/~ jirislaby@gmail.com ~\-/~
B67499670407CE62ACC8 22A032CC55C339D47A7E
^ permalink raw reply
* Re: [RFC][patch 1/4] Network namespaces: cleanup of dev_base list use
From: Kirill Korotaev @ 2006-06-27 15:08 UTC (permalink / raw)
To: Eric W. Biederman
Cc: Andrey Savochkin, dlezcano, linux-kernel, netdev, serue, haveblue,
clg, Andrew Morton, herbert, devel, sam, viro
In-Reply-To: <m11wtaonqf.fsf@ebiederm.dsl.xmission.com>
>>>>Cleanup of dev_base list use, with the aim to make device list per-namespace.
>>>>In almost every occasion, use of dev_base variable and dev->next pointer
>>>>could be easily replaced by for_each_netdev loop.
>>>>A few most complicated places were converted to using
>>>>first_netdev()/next_netdev().
>>>
>>>As a proof of concept patch this is ok.
>>>As a real world patch this is much too big, which prevents review.
>>>Plus it takes a few actions that are more than replace just
>>>iterators through the device list.
>>
>>Mmm, actually it is a whole changeset and should go as a one patch. I didn't
>>find it to be big and my review took only 5-10mins..
>>I also don't think that mailing each driver maintainer is a good idea.
>>Only if we want to make some buzz :)
>
>
> Thanks for supporting my case. You reviewed it and missed the obvious typo.
> I do agree that a patchset doing it all should happen at once.
This doesn't support anything. e.g. I caught quite a lot of bugs after
Ingo Molnar, but this doesn't make his code "poor". People are people.
Anyway, I would be happy to see the typo.
> As for not mailing the maintainers of the code we are changing. That
> would just be irresponsible.
Kirill
^ permalink raw reply
* Re: [PATCH] use dev_printk() in some net drivers
From: Jeff Garzik @ 2006-06-27 15:13 UTC (permalink / raw)
To: Jiri Slaby; +Cc: netdev, linux-kernel
In-Reply-To: <44A14A5F.3090607@gmail.com>
Jiri Slaby wrote:
> Don't you consider to use s#dev_printk(KERN_ERR, #dev_err(# macro?
Why, yes. I had forgotten about those, thanks.
Jeff
^ permalink raw reply
* Re: [PATCH 1/3] mv643xx fixes - Disable interrupts on all ports during initialization
From: John Haller @ 2006-06-27 15:16 UTC (permalink / raw)
To: Brent Cook; +Cc: netdev
In-Reply-To: <200606270951.59024.bcook@bpointsys.com>
Brent Cook wrote:
> This patch disable interrupts on all ports during initialization. The current
> assumes that the firmware has already disabled all interrupts on all ports.
> We have encountered some boards that do not always disable interrupts (XES
> XPedite 6200 for instance) on a soft reset. This patch prevents a kernel
> panic if a packet is received before the DMA ring buffers are setup for a
> port on which interrupts are left enabled by the firmware.
You probably have bigger problems than the interrupt being left
enabled. If the interrupt is left enabled, the DMA engine
is probably left enabled, and if a packet happens
to come in before the driver can properly configure them,
some random part of memory will get overwritten.
The firmware needs to disable this device before transferring
control to the kernel, both the interrupts and the DMA,
there is no way to fix this in the kernel.
^ permalink raw reply
* Re: Please pull 'upstream' branch of wireless-2.6
From: Michael Buesch @ 2006-06-27 15:25 UTC (permalink / raw)
To: Jeff Garzik; +Cc: bcm43xx-dev, Larry Finger, John W. Linville, netdev
In-Reply-To: <44A13C81.2050503@garzik.org>
On Tuesday 27 June 2006 16:11, Jeff Garzik wrote:
> Michael Buesch wrote:
> > On Tuesday 27 June 2006 04:27, Larry Finger wrote:
> >> Jeff Garzik wrote:
> >>> John W. Linville wrote:
> >>>> + assert(bcm->mac_suspended >= 0);
> >>>> + if (bcm->mac_suspended == 0) {
> >>>> + bcm43xx_power_saving_ctl_bits(bcm, -1, 1);
> >>>> + bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD,
> >>>> + bcm43xx_read32(bcm,
> >>>> BCM43xx_MMIO_STATUS_BITFIELD)
> >>>> + & ~BCM43xx_SBF_MAC_ENABLED);
> >>>> + bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); /* dummy
> >>>> read */
> >>>> + for (i = 100000; i; i--) {
> >>>> + tmp = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON);
> >>>> + if (tmp & BCM43xx_IRQ_READY)
> >>>> + goto out;
> >>>> + udelay(10);
> >>>> + }
> >>>> + printkl(KERN_ERR PFX "MAC suspend failed\n");
> >>>> }
> >>>
> >>> NAK this super-long delay... should be done in a workqueue, looks like?
> >>>
> >>> ACK everything else.
> >>>
> >> That delay was set to try to accommodate my interface when it refused to suspend the MAC, which
> >> resulted in transmit errors. That problem has since been cured by reworking the periodic work
> >> handlers - thus such a long delay should not be needed. The original spec from the clean-room group
> >> was a delay loop of 1000. I'm currently testing that value now. If it passes the test, would a for
> >> (i=1000; i; i--) be acceptable?
> >
> > Short: Don't touch it. Fullstop.
> >
> > Long: The delay will _never_ be exhausted. Actually the for-counter
> > is only there to not lock up the machine, if there is a Bug in the
> > driver. (__much__ easier debugging).
> > The loop will only iterate a few times, typically.
> > Actually, _if_ we want to change something, we should do this:
> >
> > for (i = 1000000; i; i--) {
> > ...
> > udelay(1);
> > }
> >
> > (max loop multiplied by 10, delay value divided by 10).
> > This will shorten the whole delay by a few usecs (up to 10).
> > I will send a patch for this, if it is desired.
> >
> > But lowering the loop counter value is NACKed by me,
> > because it simply does not make sense.
>
>
> My overriding concern was that this type of loop spins the CPU at 100%
> until the hardware condition is satisfied, which starves all other
> kernel work on that CPU, and is very unfriendly to power consumption
> (though I believe monitor/mwait/cpu_relax helps on x86).
Ok, I did a testrun. Here's the result:
[ 68.711243] bcm43xx_d80211: Chip ID 0x4306, rev 0x3
[ 68.712662] bcm43xx_d80211: Number of cores: 5
[ 68.714023] bcm43xx_d80211: Core 0: ID 0x800, rev 0x4, vendor 0x4243, enabled
[ 68.715536] bcm43xx_d80211: Core 1: ID 0x812, rev 0x5, vendor 0x4243, disabled
[ 68.717062] bcm43xx_d80211: Core 2: ID 0x80d, rev 0x2, vendor 0x4243, enabled
[ 68.718575] bcm43xx_d80211: Core 3: ID 0x807, rev 0x2, vendor 0x4243, disabled
[ 68.720089] bcm43xx_d80211: Core 4: ID 0x804, rev 0x9, vendor 0x4243, enabled
[ 68.724897] bcm43xx_d80211: PHY connected
[ 68.726154] bcm43xx_d80211: Detected PHY: Version: 2, Type 2, Revision 2
[ 68.727638] bcm43xx_d80211: Detected Radio: ID: 2205017f (Manuf: 17f Ver: 2050 Rev: 2)
[ 68.729232] bcm43xx_d80211: Radio turned off
[ 68.730512] bcm43xx_d80211: Radio turned off
[ 68.745153] wmaster0: Selected rate control algorithm 'simple'
[ 69.853876] bcm43xx_d80211: Virtual interface added (type: 0x00000002, ID: 7, MAC: 00:11:24:a0:de:8b)
[ 69.861872] bcm43xx_d80211: PHY connected
[ 70.000713] bcm43xx_d80211: Radio turned on
[ 70.190153] bcm43xx_d80211: Chip initialized
[ 70.192051] bcm43xx_d80211: DMA initialized
[ 70.193987] bcm43xx_d80211: 80211 cores initialized
[ 70.195550] bcm43xx_d80211: Keys cleared
[ 70.212565] wmaster0: Does not support passive scan, disabled
[ 70.252321] bcm43xx_d80211: mac_suspend() took 1 loops == 10 usec
[ 70.542160] NET: Registered protocol family 17
[ 70.692256] sta0: starting scan
[ 70.702234] HW CONFIG: channel=1 freq=2412 phymode=3
[ 70.762225] HW CONFIG: channel=2 freq=2417 phymode=3
[ 70.822227] HW CONFIG: channel=3 freq=2422 phymode=3
[ 70.882225] HW CONFIG: channel=4 freq=2427 phymode=3
[ 70.942225] HW CONFIG: channel=5 freq=2432 phymode=3
[ 71.002285] HW CONFIG: channel=6 freq=2437 phymode=3
[ 71.062229] HW CONFIG: channel=7 freq=2442 phymode=3
[ 71.122230] HW CONFIG: channel=8 freq=2447 phymode=3
[ 71.182239] HW CONFIG: channel=9 freq=2452 phymode=3
[ 71.242226] HW CONFIG: channel=10 freq=2457 phymode=3
[ 71.302226] HW CONFIG: channel=11 freq=2462 phymode=3
[ 71.512225] HW CONFIG: channel=1 freq=2412 phymode=3
[ 71.520066] sta0: scan completed
[ 71.523437] HW CONFIG: channel=6 freq=2437 phymode=3
[ 71.531600] sta0: Initial auth_alg=0
[ 71.531806] sta0: authenticate with AP 00:90:4c:60:04:00
[ 71.533279] sta0: RX authentication from 00:90:4c:60:04:00 (alg=0 transaction=2 status=0)
[ 71.533292] sta0: authenticated
[ 71.533301] sta0: associate with AP 00:90:4c:60:04:00
[ 71.536264] sta0: RX AssocResp from 00:90:4c:60:04:00 (capab=0x411 status=0 aid=1)
[ 71.536276] sta0: associated
[ 71.536352] wmaster0: Added STA 00:90:4c:60:04:00
[ 130.292251] bcm43xx_d80211: mac_suspend() took 1 loops == 10 usec
[ 190.322251] bcm43xx_d80211: mac_suspend() took 1 loops == 10 usec
[ 250.362252] bcm43xx_d80211: mac_suspend() took 0 loops == 0 usec
[ 310.392278] bcm43xx_d80211: mac_suspend() took 1 loops == 10 usec
So, I will submit a patch to lower the udelay(10) to udelay(1)
and we can close the discussion? ;)
--
Greetings Michael.
^ permalink raw reply
* Re: [RFC][patch 1/4] Network namespaces: cleanup of dev_base list use
From: Serge E. Hallyn @ 2006-06-27 15:26 UTC (permalink / raw)
To: Kirill Korotaev
Cc: Eric W. Biederman, Andrey Savochkin, dlezcano, linux-kernel,
netdev, serue, haveblue, clg, Andrew Morton, herbert, devel, sam,
viro
In-Reply-To: <44A149F5.2060204@sw.ru>
Quoting Kirill Korotaev (dev@sw.ru):
> >>>>Cleanup of dev_base list use, with the aim to make device list
> >>>>per-namespace.
> >>>>In almost every occasion, use of dev_base variable and dev->next pointer
> >>>>could be easily replaced by for_each_netdev loop.
> >>>>A few most complicated places were converted to using
> >>>>first_netdev()/next_netdev().
> >>>
> >>>As a proof of concept patch this is ok.
> >>>As a real world patch this is much too big, which prevents review.
> >>>Plus it takes a few actions that are more than replace just
> >>>iterators through the device list.
> >>
> >>Mmm, actually it is a whole changeset and should go as a one patch. I
> >>didn't
> >>find it to be big and my review took only 5-10mins..
> >>I also don't think that mailing each driver maintainer is a good idea.
> >>Only if we want to make some buzz :)
> >
> >
> >Thanks for supporting my case. You reviewed it and missed the obvious
> >typo.
> >I do agree that a patchset doing it all should happen at once.
> This doesn't support anything. e.g. I caught quite a lot of bugs after
> Ingo Molnar, but this doesn't make his code "poor". People are people.
Exactly - people are people, and they will do a better review of a
well-constructed set of small patches than of one large patch. Eyes
glaze over, it just happens.
-serge
^ permalink raw reply
* RE: Labeled Networking Requirements and Design (formerly RE: [PAT CH 01/06] MLSXFRM: Granular IPSec associations for use in MLS environmen ts)
From: Venkat Yekkirala @ 2006-06-27 15:29 UTC (permalink / raw)
To: James Morris; +Cc: netdev, selinux, davem, sds, paul.moore, eparis
> > 5. Patch for ITEM7: TCS currently have no plans to design
> and implement this.
> >
>
> (Datagram labeling)
>
> I guess we'd probably use SCM_SECURITY for this (similar to
> IP_CMSG_PASSEC for receiving the label).
Seems like a logical way to do it.
>
> Is this enough support for user API support at the kernel
> level in terms
> of setting and getting labels?
Actually I missed mentioning the following under User API:
4. iptables contexts
a. Specify labels with iptables rules.
Can't think of anything else being needed at this point in time.
Also, for the sake of the discussion, one "requirement" that some
may have is "Label-based routing", which would basically be a
polyinstantiated routing table. This is something TCS is currently
not interested in pursuing.
So, under USER REQUIREMENTS:
4. Routing support
a. provision for a label-based routing mechanism (aka
polyinstantiated
routing table).
^ permalink raw reply
* Re: [PATCH] use dev_printk() in some net drivers
From: Jeff Garzik @ 2006-06-27 15:41 UTC (permalink / raw)
To: Jiri Slaby; +Cc: netdev, linux-kernel
In-Reply-To: <44A14A5F.3090607@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 103 bytes --]
Jiri Slaby wrote:
> Don't you consider to use s#dev_printk(KERN_ERR, #dev_err(# macro?
Done.
Jeff
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 27754 bytes --]
685aa11f7f1de42802cb0a8d5816c1efb08f65cd
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index c38e352..2f3fb2e 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -1837,11 +1837,10 @@ #endif
if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",
pdev->vendor, pdev->device, pci_rev);
- dev_printk(KERN_ERR, &pdev->dev,
- "Try the \"8139too\" driver instead.\n");
+ dev_err(&pdev->dev, "Try the \"8139too\" driver instead.\n");
return -ENODEV;
}
@@ -1879,13 +1878,12 @@ #endif
pciaddr = pci_resource_start(pdev, 1);
if (!pciaddr) {
rc = -EIO;
- dev_printk(KERN_ERR, &pdev->dev, "no MMIO resource\n");
+ dev_err(&pdev->dev, "no MMIO resource\n");
goto err_out_res;
}
if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) {
rc = -EIO;
- dev_printk(KERN_ERR, &pdev->dev,
- "MMIO resource (%lx) too small\n",
+ dev_err(&pdev->dev, "MMIO resource (%lx) too small\n",
pci_resource_len(pdev, 1));
goto err_out_res;
}
@@ -1900,13 +1898,13 @@ #endif
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"No usable DMA configuration, aborting.\n");
goto err_out_res;
}
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"No usable consistent DMA configuration, "
"aborting.\n");
goto err_out_res;
@@ -1919,8 +1917,7 @@ #endif
regs = ioremap(pciaddr, CP_REGS_SIZE);
if (!regs) {
rc = -EIO;
- dev_printk(KERN_ERR, &pdev->dev,
- "Cannot map PCI MMIO (%lx@%lx)\n",
+ dev_err(&pdev->dev, "Cannot map PCI MMIO (%lx@%lx)\n",
pci_resource_len(pdev, 1), pciaddr);
goto err_out_res;
}
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index b2592c4..173e59e 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -769,8 +769,7 @@ static int __devinit rtl8139_init_board
/* dev and priv zeroed in alloc_etherdev */
dev = alloc_etherdev (sizeof (*tp));
if (dev == NULL) {
- dev_printk (KERN_ERR, &pdev->dev,
- "Unable to alloc new net device\n");
+ dev_err(&pdev->dev, "Unable to alloc new net device\n");
return -ENOMEM;
}
SET_MODULE_OWNER(dev);
@@ -802,29 +801,25 @@ static int __devinit rtl8139_init_board
#ifdef USE_IO_OPS
/* make sure PCI base addr 0 is PIO */
if (!(pio_flags & IORESOURCE_IO)) {
- dev_printk (KERN_ERR, &pdev->dev,
- "region #0 not a PIO resource, aborting\n");
+ dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
rc = -ENODEV;
goto err_out;
}
/* check for weird/broken PCI region reporting */
if (pio_len < RTL_MIN_IO_SIZE) {
- dev_printk (KERN_ERR, &pdev->dev,
- "Invalid PCI I/O region size(s), aborting\n");
+ dev_err(&pdev->dev, "Invalid PCI I/O region size(s), aborting\n");
rc = -ENODEV;
goto err_out;
}
#else
/* make sure PCI base addr 1 is MMIO */
if (!(mmio_flags & IORESOURCE_MEM)) {
- dev_printk (KERN_ERR, &pdev->dev,
- "region #1 not an MMIO resource, aborting\n");
+ dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
rc = -ENODEV;
goto err_out;
}
if (mmio_len < RTL_MIN_IO_SIZE) {
- dev_printk (KERN_ERR, &pdev->dev,
- "Invalid PCI mem region size(s), aborting\n");
+ dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n");
rc = -ENODEV;
goto err_out;
}
@@ -841,7 +836,7 @@ #endif
#ifdef USE_IO_OPS
ioaddr = ioport_map(pio_start, pio_len);
if (!ioaddr) {
- dev_printk (KERN_ERR, &pdev->dev, "cannot map PIO, aborting\n");
+ dev_err(&pdev->dev, "cannot map PIO, aborting\n");
rc = -EIO;
goto err_out;
}
@@ -852,8 +847,7 @@ #else
/* ioremap MMIO region */
ioaddr = pci_iomap(pdev, 1, 0);
if (ioaddr == NULL) {
- dev_printk (KERN_ERR, &pdev->dev,
- "cannot remap MMIO, aborting\n");
+ dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
rc = -EIO;
goto err_out;
}
@@ -867,8 +861,7 @@ #endif /* USE_IO_OPS */
/* check for missing/broken hardware */
if (RTL_R32 (TxConfig) == 0xFFFFFFFF) {
- dev_printk (KERN_ERR, &pdev->dev,
- "Chip not responding, ignoring board\n");
+ dev_err(&pdev->dev, "Chip not responding, ignoring board\n");
rc = -EIO;
goto err_out;
}
@@ -962,10 +955,10 @@ #endif
if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) {
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_info(&pdev->dev,
"This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n",
pdev->vendor, pdev->device, pci_rev);
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_info(&pdev->dev,
"Use the \"8139cp\" driver for improved performance and stability.\n");
}
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 6d7748d..9fce7e6 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -2120,13 +2120,13 @@ static int __devinit b44_init_one(struct
err = pci_enable_device(pdev);
if (err) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot enable PCI device, "
+ dev_err(&pdev->dev, "Cannot enable PCI device, "
"aborting.\n");
return err;
}
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"Cannot find proper PCI device "
"base address, aborting.\n");
err = -ENODEV;
@@ -2135,7 +2135,7 @@ static int __devinit b44_init_one(struct
err = pci_request_regions(pdev, DRV_MODULE_NAME);
if (err) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"Cannot obtain PCI resources, aborting.\n");
goto err_out_disable_pdev;
}
@@ -2144,15 +2144,13 @@ static int __devinit b44_init_one(struct
err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK);
if (err) {
- dev_printk(KERN_ERR, &pdev->dev,
- "No usable DMA configuration, aborting.\n");
+ dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n");
goto err_out_free_res;
}
err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK);
if (err) {
- dev_printk(KERN_ERR, &pdev->dev,
- "No usable DMA configuration, aborting.\n");
+ dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n");
goto err_out_free_res;
}
@@ -2161,8 +2159,7 @@ static int __devinit b44_init_one(struct
dev = alloc_etherdev(sizeof(*bp));
if (!dev) {
- dev_printk(KERN_ERR, &pdev->dev,
- "Etherdev alloc failed, aborting.\n");
+ dev_err(&pdev->dev, "Etherdev alloc failed, aborting.\n");
err = -ENOMEM;
goto err_out_free_res;
}
@@ -2183,8 +2180,7 @@ static int __devinit b44_init_one(struct
bp->regs = ioremap(b44reg_base, b44reg_len);
if (bp->regs == 0UL) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot map device registers, "
- "aborting.\n");
+ dev_err(&pdev->dev, "Cannot map device registers, aborting.\n");
err = -ENOMEM;
goto err_out_free_dev;
}
@@ -2214,7 +2210,7 @@ #endif
err = b44_get_invariants(bp);
if (err) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"Problem fetching invariants of chip, aborting.\n");
goto err_out_iounmap;
}
@@ -2235,8 +2231,7 @@ #endif
err = register_netdev(dev);
if (err) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot register net device, "
- "aborting.\n");
+ dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
goto err_out_iounmap;
}
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 171e498..152de92 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -5566,13 +5566,12 @@ bnx2_init_board(struct pci_dev *pdev, st
/* enable device (incl. PCI PM wakeup), and bus-mastering */
rc = pci_enable_device(pdev);
if (rc) {
- dev_printk(KERN_ERR, &pdev->dev,
- "Cannot enable PCI device, aborting.");
+ dev_err(&pdev->dev, "Cannot enable PCI device, aborting.");
goto err_out;
}
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"Cannot find PCI device base address, aborting.\n");
rc = -ENODEV;
goto err_out_disable;
@@ -5580,8 +5579,7 @@ bnx2_init_board(struct pci_dev *pdev, st
rc = pci_request_regions(pdev, DRV_MODULE_NAME);
if (rc) {
- dev_printk(KERN_ERR, &pdev->dev,
- "Cannot obtain PCI resources, aborting.\n");
+ dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n");
goto err_out_disable;
}
@@ -5589,7 +5587,7 @@ bnx2_init_board(struct pci_dev *pdev, st
bp->pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
if (bp->pm_cap == 0) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"Cannot find power management capability, aborting.\n");
rc = -EIO;
goto err_out_release;
@@ -5597,8 +5595,7 @@ bnx2_init_board(struct pci_dev *pdev, st
bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX);
if (bp->pcix_cap == 0) {
- dev_printk(KERN_ERR, &pdev->dev,
- "Cannot find PCIX capability, aborting.\n");
+ dev_err(&pdev->dev, "Cannot find PCIX capability, aborting.\n");
rc = -EIO;
goto err_out_release;
}
@@ -5606,15 +5603,14 @@ bnx2_init_board(struct pci_dev *pdev, st
if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) {
bp->flags |= USING_DAC_FLAG;
if (pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK) != 0) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"pci_set_consistent_dma_mask failed, aborting.\n");
rc = -EIO;
goto err_out_release;
}
}
else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) {
- dev_printk(KERN_ERR, &pdev->dev,
- "System does not support DMA, aborting.\n");
+ dev_err(&pdev->dev, "System does not support DMA, aborting.\n");
rc = -EIO;
goto err_out_release;
}
@@ -5634,8 +5630,7 @@ bnx2_init_board(struct pci_dev *pdev, st
bp->regview = ioremap_nocache(dev->base_addr, mem_len);
if (!bp->regview) {
- dev_printk(KERN_ERR, &pdev->dev,
- "Cannot map register space, aborting.\n");
+ dev_err(&pdev->dev, "Cannot map register space, aborting.\n");
rc = -ENOMEM;
goto err_out_release;
}
@@ -5707,7 +5702,7 @@ bnx2_init_board(struct pci_dev *pdev, st
else if ((CHIP_ID(bp) == CHIP_ID_5706_A1) &&
!(bp->flags & PCIX_FLAG)) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"5706 A1 can only be used in a PCIX bus, aborting.\n");
goto err_out_unmap;
}
@@ -5729,8 +5724,7 @@ bnx2_init_board(struct pci_dev *pdev, st
if ((reg & BNX2_DEV_INFO_SIGNATURE_MAGIC_MASK) !=
BNX2_DEV_INFO_SIGNATURE_MAGIC) {
- dev_printk(KERN_ERR, &pdev->dev,
- "Firmware not running, aborting.\n");
+ dev_err(&pdev->dev, "Firmware not running, aborting.\n");
rc = -ENODEV;
goto err_out_unmap;
}
@@ -5892,8 +5886,7 @@ #if defined(HAVE_POLL_CONTROLLER) || def
#endif
if ((rc = register_netdev(dev))) {
- dev_printk(KERN_ERR, &pdev->dev,
- "Cannot register net device\n");
+ dev_err(&pdev->dev, "Cannot register net device\n");
if (bp->regview)
iounmap(bp->regview);
pci_release_regions(pdev);
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index ccff239..79ea9db 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -4888,13 +4888,12 @@ static int __devinit cas_init_one(struct
err = pci_enable_device(pdev);
if (err) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot enable PCI device, "
- "aborting.\n");
+ dev_err(&pdev->dev, "Cannot enable PCI device, aborting.\n");
return err;
}
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot find proper PCI device "
+ dev_err(&pdev->dev, "Cannot find proper PCI device "
"base address, aborting.\n");
err = -ENODEV;
goto err_out_disable_pdev;
@@ -4902,7 +4901,7 @@ static int __devinit cas_init_one(struct
dev = alloc_etherdev(sizeof(*cp));
if (!dev) {
- dev_printk(KERN_ERR, &pdev->dev, "Etherdev alloc failed, aborting.\n");
+ dev_err(&pdev->dev, "Etherdev alloc failed, aborting.\n");
err = -ENOMEM;
goto err_out_disable_pdev;
}
@@ -4911,8 +4910,7 @@ static int __devinit cas_init_one(struct
err = pci_request_regions(pdev, dev->name);
if (err) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot obtain PCI resources, "
- "aborting.\n");
+ dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n");
goto err_out_free_netdev;
}
pci_set_master(pdev);
@@ -4942,7 +4940,7 @@ #if 1
if (pci_write_config_byte(pdev,
PCI_CACHE_LINE_SIZE,
cas_cacheline_size)) {
- dev_printk(KERN_ERR, &pdev->dev, "Could not set PCI cache "
+ dev_err(&pdev->dev, "Could not set PCI cache "
"line size\n");
goto err_write_cacheline;
}
@@ -4956,7 +4954,7 @@ #endif
err = pci_set_consistent_dma_mask(pdev,
DMA_64BIT_MASK);
if (err < 0) {
- dev_printk(KERN_ERR, &pdev->dev, "Unable to obtain 64-bit DMA "
+ dev_err(&pdev->dev, "Unable to obtain 64-bit DMA "
"for consistent allocations\n");
goto err_out_free_res;
}
@@ -4964,7 +4962,7 @@ #endif
} else {
err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (err) {
- dev_printk(KERN_ERR, &pdev->dev, "No usable DMA configuration, "
+ dev_err(&pdev->dev, "No usable DMA configuration, "
"aborting.\n");
goto err_out_free_res;
}
@@ -5024,8 +5022,7 @@ #endif
/* give us access to cassini registers */
cp->regs = pci_iomap(pdev, 0, casreg_len);
if (cp->regs == 0UL) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot map device registers, "
- "aborting.\n");
+ dev_err(&pdev->dev, "Cannot map device registers, aborting.\n");
goto err_out_free_res;
}
cp->casreg_len = casreg_len;
@@ -5041,8 +5038,7 @@ #endif
pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
&cp->block_dvma);
if (!cp->init_block) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot allocate init block, "
- "aborting.\n");
+ dev_err(&pdev->dev, "Cannot allocate init block, aborting.\n");
goto err_out_iounmap;
}
@@ -5086,8 +5082,7 @@ #endif
dev->features |= NETIF_F_HIGHDMA;
if (register_netdev(dev)) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot register net device, "
- "aborting.\n");
+ dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
goto err_out_free_consistent;
}
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index 0b65a31..7795de6 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -556,14 +556,12 @@ #endif
if (!request_region(pci_resource_start(pdev, 1),
pci_resource_len(pdev, 1), "eepro100")) {
- dev_printk (KERN_ERR, &pdev->dev,
- "eepro100: cannot reserve I/O ports\n");
+ dev_err(&pdev->dev, "eepro100: cannot reserve I/O ports\n");
goto err_out_none;
}
if (!request_mem_region(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0), "eepro100")) {
- dev_printk (KERN_ERR, &pdev->dev,
- "eepro100: cannot reserve MMIO region\n");
+ dev_err(&pdev->dev, "eepro100: cannot reserve MMIO region\n");
goto err_out_free_pio_region;
}
@@ -576,7 +574,7 @@ #endif
ioaddr = pci_iomap(pdev, pci_bar, 0);
if (!ioaddr) {
- dev_printk (KERN_ERR, &pdev->dev, "eepro100: cannot remap IO\n");
+ dev_err(&pdev->dev, "eepro100: cannot remap IO\n");
goto err_out_free_mmio_region;
}
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index 1ec06a5..7c1240d 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -336,7 +336,7 @@ #endif
irq = pdev->irq;
if (pci_resource_len(pdev, 0) < EPIC_TOTAL_SIZE) {
- dev_printk(KERN_ERR, &pdev->dev, "no PCI region space\n");
+ dev_err(&pdev->dev, "no PCI region space\n");
ret = -ENODEV;
goto err_out_disable;
}
@@ -351,7 +351,7 @@ #endif
dev = alloc_etherdev(sizeof (*ep));
if (!dev) {
- dev_printk(KERN_ERR, &pdev->dev, "no memory for eth device\n");
+ dev_err(&pdev->dev, "no memory for eth device\n");
goto err_out_free_res;
}
SET_MODULE_OWNER(dev);
@@ -363,7 +363,7 @@ #else
ioaddr = pci_resource_start (pdev, 1);
ioaddr = (long) ioremap (ioaddr, pci_resource_len (pdev, 1));
if (!ioaddr) {
- dev_printk(KERN_ERR, &pdev->dev, "ioremap failed\n");
+ dev_err(&pdev->dev, "ioremap failed\n");
goto err_out_free_netdev;
}
#endif
@@ -445,7 +445,7 @@ #endif
int mii_status = mdio_read(dev, phy, MII_BMSR);
if (mii_status != 0xffff && mii_status != 0x0000) {
ep->phys[phy_idx++] = phy;
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_info(&pdev->dev,
"MII transceiver #%d control "
"%4.4x status %4.4x.\n",
phy, mdio_read(dev, phy, 0), mii_status);
@@ -455,12 +455,12 @@ #endif
if (phy_idx != 0) {
phy = ep->phys[0];
ep->mii.advertising = mdio_read(dev, phy, MII_ADVERTISE);
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_info(&pdev->dev,
"Autonegotiation advertising %4.4x link "
"partner %4.4x.\n",
ep->mii.advertising, mdio_read(dev, phy, 5));
} else if ( ! (ep->chip_flags & NO_MII)) {
- dev_printk(KERN_WARNING, &pdev->dev,
+ dev_warn(&pdev->dev,
"***WARNING***: No MII transceiver found!\n");
/* Use the known PHY address of the EPII. */
ep->phys[0] = 3;
@@ -476,8 +476,7 @@ #endif
/* The lower four bits are the media type. */
if (duplex) {
ep->mii.force_media = ep->mii.full_duplex = 1;
- dev_printk(KERN_INFO, &pdev->dev,
- "Forced full duplex operation requested.\n");
+ dev_info(&pdev->dev, "Forced full duplex requested.\n");
}
dev->if_port = ep->default_port = option;
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index 9369082..e2955ee 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -505,7 +505,7 @@ #endif
len = pci_resource_len(pdev, bar);
if (len < MIN_REGION_SIZE) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"region size %ld too small, aborting\n", len);
return -ENODEV;
}
@@ -578,7 +578,7 @@ #endif
if (mii_status != 0xffff && mii_status != 0x0000) {
np->phys[phy_idx++] = phy;
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_info(&pdev->dev,
"MII PHY found at address %d, status "
"0x%4.4x.\n", phy, mii_status);
/* get phy type */
@@ -604,7 +604,7 @@ #endif
np->mii_cnt = phy_idx;
if (phy_idx == 0)
- dev_printk(KERN_WARNING, &pdev->dev,
+ dev_warn(&pdev->dev,
"MII PHY not found -- this device may "
"not operate correctly.\n");
} else {
@@ -632,8 +632,7 @@ #endif
np->mii.full_duplex = full_duplex[card_idx];
if (np->mii.full_duplex) {
- dev_printk(KERN_INFO, &pdev->dev,
- "Media type forced to Full Duplex.\n");
+ dev_info(&pdev->dev, "Media type forced to Full Duplex.\n");
/* 89/6/13 add, (begin) */
// if (np->PHYType==MarvellPHY)
if ((np->PHYType == MarvellPHY) || (np->PHYType == LevelOnePHY)) {
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c
index b5bf53f..7b808da 100644
--- a/drivers/net/ne2k-pci.c
+++ b/drivers/net/ne2k-pci.c
@@ -231,14 +231,12 @@ #endif
irq = pdev->irq;
if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) {
- dev_printk (KERN_ERR, &pdev->dev,
- "no I/O resource at PCI BAR #0\n");
+ dev_err(&pdev->dev, "no I/O resource at PCI BAR #0\n");
return -ENODEV;
}
if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) {
- dev_printk (KERN_ERR, &pdev->dev,
- "I/O resource 0x%x @ 0x%lx busy\n",
+ dev_err(&pdev->dev, "I/O resource 0x%x @ 0x%lx busy\n",
NE_IO_EXTENT, ioaddr);
return -EBUSY;
}
@@ -265,8 +263,7 @@ #endif
/* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */
dev = alloc_ei_netdev();
if (!dev) {
- dev_printk (KERN_ERR, &pdev->dev,
- "cannot allocate ethernet device\n");
+ dev_err(&pdev->dev, "cannot allocate ethernet device\n");
goto err_out_free_res;
}
SET_MODULE_OWNER(dev);
@@ -284,7 +281,7 @@ #endif
while ((inb(ioaddr + EN0_ISR) & ENISR_RESET) == 0)
/* Limit wait: '2' avoids jiffy roll-over. */
if (jiffies - reset_start_time > 2) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"Card failure (no reset ack).\n");
goto err_out_free_netdev;
}
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 916ec99..7ab2ab7 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1833,8 +1833,7 @@ static int __devinit ns83820_init_one(st
} else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
using_dac = 0;
} else {
- dev_printk(KERN_WARNING, &pci_dev->dev,
- "pci_set_dma_mask failed!\n");
+ dev_warn(&pci_dev->dev, "pci_set_dma_mask failed!\n");
return -ENODEV;
}
@@ -1857,8 +1856,7 @@ static int __devinit ns83820_init_one(st
err = pci_enable_device(pci_dev);
if (err) {
- dev_printk(KERN_INFO, &pci_dev->dev,
- "pci_enable_dev failed: %d\n", err);
+ dev_info(&pci_dev->dev, "pci_enable_dev failed: %d\n", err);
goto out_free;
}
@@ -1887,8 +1885,7 @@ static int __devinit ns83820_init_one(st
err = request_irq(pci_dev->irq, ns83820_irq, SA_SHIRQ,
DRV_NAME, ndev);
if (err) {
- dev_printk(KERN_INFO, &pci_dev->dev,
- "unable to register irq %d, err %d\n",
+ dev_info(&pci_dev->dev, "unable to register irq %d, err %d\n",
pci_dev->irq, err);
goto out_disable;
}
@@ -1903,8 +1900,7 @@ static int __devinit ns83820_init_one(st
rtnl_lock();
err = dev_alloc_name(ndev, ndev->name);
if (err < 0) {
- dev_printk(KERN_INFO, &pci_dev->dev,
- "unable to get netdev name: %d\n", err);
+ dev_info(&pci_dev->dev, "unable to get netdev name: %d\n", err);
goto out_free_irq;
}
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index 2754fad..71c1bfe 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -602,8 +602,7 @@ static int __devinit netdrv_init_board (
/* dev zeroed in alloc_etherdev */
dev = alloc_etherdev (sizeof (*tp));
if (dev == NULL) {
- dev_printk (KERN_ERR, &pdev->dev,
- "unable to alloc new ethernet\n");
+ dev_err(&pdev->dev, "unable to alloc new ethernet\n");
DPRINTK ("EXIT, returning -ENOMEM\n");
return -ENOMEM;
}
@@ -633,16 +632,14 @@ static int __devinit netdrv_init_board (
/* make sure PCI base addr 0 is PIO */
if (!(pio_flags & IORESOURCE_IO)) {
- dev_printk (KERN_ERR, &pdev->dev,
- "region #0 not a PIO resource, aborting\n");
+ dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
rc = -ENODEV;
goto err_out;
}
/* make sure PCI base addr 1 is MMIO */
if (!(mmio_flags & IORESOURCE_MEM)) {
- dev_printk (KERN_ERR, &pdev->dev,
- "region #1 not an MMIO resource, aborting\n");
+ dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
rc = -ENODEV;
goto err_out;
}
@@ -650,8 +647,7 @@ static int __devinit netdrv_init_board (
/* check for weird/broken PCI region reporting */
if ((pio_len < NETDRV_MIN_IO_SIZE) ||
(mmio_len < NETDRV_MIN_IO_SIZE)) {
- dev_printk (KERN_ERR, &pdev->dev,
- "Invalid PCI region size(s), aborting\n");
+ dev_err(&pdev->dev, "Invalid PCI region size(s), aborting\n");
rc = -ENODEV;
goto err_out;
}
@@ -668,8 +664,7 @@ #else
/* ioremap MMIO region */
ioaddr = ioremap (mmio_start, mmio_len);
if (ioaddr == NULL) {
- dev_printk (KERN_ERR, &pdev->dev,
- "cannot remap MMIO, aborting\n");
+ dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
rc = -EIO;
goto err_out_free_res;
}
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 24a5b31..a9d227f 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1406,8 +1406,7 @@ rtl8169_init_board(struct pci_dev *pdev,
dev = alloc_etherdev(sizeof (*tp));
if (dev == NULL) {
if (netif_msg_drv(&debug))
- dev_printk(KERN_ERR, &pdev->dev,
- "unable to alloc new ethernet\n");
+ dev_err(&pdev->dev, "unable to alloc new ethernet\n");
goto err_out;
}
@@ -1420,7 +1419,7 @@ rtl8169_init_board(struct pci_dev *pdev,
rc = pci_enable_device(pdev);
if (rc < 0) {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev, "enable failure\n");
+ dev_err(&pdev->dev, "enable failure\n");
goto err_out_free_dev;
}
@@ -1437,14 +1436,14 @@ rtl8169_init_board(struct pci_dev *pdev,
acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
} else {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"PowerManagement capability not found.\n");
}
/* make sure PCI base addr 1 is MMIO */
if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"region #1 not an MMIO resource, aborting\n");
rc = -ENODEV;
goto err_out_mwi;
@@ -1452,7 +1451,7 @@ rtl8169_init_board(struct pci_dev *pdev,
/* check for weird/broken PCI region reporting */
if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"Invalid PCI region size(s), aborting\n");
rc = -ENODEV;
goto err_out_mwi;
@@ -1461,8 +1460,7 @@ rtl8169_init_board(struct pci_dev *pdev,
rc = pci_request_regions(pdev, MODULENAME);
if (rc < 0) {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev,
- "could not request regions.\n");
+ dev_err(&pdev->dev, "could not request regions.\n");
goto err_out_mwi;
}
@@ -1476,7 +1474,7 @@ rtl8169_init_board(struct pci_dev *pdev,
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc < 0) {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"DMA configuration failed.\n");
goto err_out_free_res;
}
@@ -1488,8 +1486,7 @@ rtl8169_init_board(struct pci_dev *pdev,
ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE);
if (ioaddr == NULL) {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev,
- "cannot remap MMIO, aborting\n");
+ dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
rc = -EIO;
goto err_out_free_res;
}
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 7412400..b0cb56d 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -697,14 +697,14 @@ static int __devinit velocity_found1(str
* can support more than MAX_UNITS.
*/
if (velocity_nics >= MAX_UNITS) {
- dev_printk(KERN_NOTICE, &pdev->dev, "already found %d NICs.\n",
+ dev_notice(&pdev->dev, "already found %d NICs.\n",
velocity_nics);
return -ENODEV;
}
dev = alloc_etherdev(sizeof(struct velocity_info));
if (!dev) {
- dev_printk(KERN_ERR, &pdev->dev, "allocate net device failed.\n");
+ dev_err(&pdev->dev, "allocate net device failed.\n");
goto out;
}
@@ -741,7 +741,7 @@ static int __devinit velocity_found1(str
ret = pci_request_regions(pdev, VELOCITY_NAME);
if (ret < 0) {
- dev_printk(KERN_ERR, &pdev->dev, "No PCI resources.\n");
+ dev_err(&pdev->dev, "No PCI resources.\n");
goto err_disable;
}
@@ -897,19 +897,19 @@ static int __devinit velocity_get_pci_in
vptr->memaddr = pci_resource_start(pdev, 1);
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_IO)) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"region #0 is not an I/O resource, aborting.\n");
return -EINVAL;
}
if ((pci_resource_flags(pdev, 1) & IORESOURCE_IO)) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"region #1 is an I/O resource, aborting.\n");
return -EINVAL;
}
if (pci_resource_len(pdev, 1) < VELOCITY_IO_SIZE) {
- dev_printk(KERN_ERR, &pdev->dev, "region #1 is too small.\n");
+ dev_err(&pdev->dev, "region #1 is too small.\n");
return -EINVAL;
}
vptr->pdev = pdev;
^ permalink raw reply related
* Re: [PATCH 10/21] e1000: force register write flushes to circumvent broken platforms
From: Jeff Garzik @ 2006-06-27 15:41 UTC (permalink / raw)
To: Auke Kok; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
In-Reply-To: <44A14283.50301@intel.com>
Auke Kok wrote:
> If there is an in-kernel fix for this that would make these flushes
> obsolete I would certainly prefer it too, unfortunately we can't fix
> already released kernels and our driver still needs to work there too,
> so that's why I queued it. It can be dropped from this series if that's
> preferred.
Yes, definitely drop it from the series...
Jeff
^ permalink raw reply
* Re: Labeled Networking Requirements and Design (formerly RE: [PATCH 01/06] MLSXFRM: Granular IPSec associations for use in MLS environments)
From: Venkat Yekkirala @ 2006-06-27 15:45 UTC (permalink / raw)
To: paul.moore; +Cc: jmorris, netdev, selinux, davem, sds, eparis
In-Reply-To: <44A0684D.9080904@trustedcs.com>
> Keeping in mind (R1a), I wonder if it makes more sense for (OTBND1a) to take
> the label of the process/domain which sends the data to the socket? After
> all, the process/domain is the "origin" of the data.
Right. This is what "ends up" happening in the non-privileged case. In the
privileged multi-level process case, the label of the data has in fact been
established at the socket creation time itself, and here we are trusting the
privileged multi-level process with sending data out on the right socket with
the knowledge that the data would be labeled with the label of the socket.
> This seems to be
> particularly important in the case of fork()-then-exec() where you could have
> a socket created at a different context from the domain currently writing to
> it.
It would also help to remember that there are additional process-to-socket
controls (sendmsg, recvmsg) already in place in SELinux.
^ permalink raw reply
* Re: Labeled Networking Requirements and Design (formerly RE: [PATCH 01/06] MLSXFRM: Granular IPSec associations for use in MLS environments)
From: Venkat Yekkirala @ 2006-06-27 15:47 UTC (permalink / raw)
To: paul.moore; +Cc: jmorris, netdev, selinux, davem, sds, eparis
In-Reply-To: <44A152A6.3060809@trustedcs.com>
Venkat Yekkirala wrote:
>> Keeping in mind (R1a), I wonder if it makes more sense for (OTBND1a)
>> to take the label of the process/domain which sends the data to the
>> socket? After all, the process/domain is the "origin" of the data.
>
> Right. This is what "ends up" happening in the non-privileged case. In the
> privileged multi-level process case, the label of the data has in fact been
> established at the socket creation time itself, and here we are trusting
> the
> privileged multi-level process with sending data out on the right socket
> with
> the knowledge that the data would be labeled with the label of the socket.
>
>> This seems to be particularly important in the case of
>> fork()-then-exec() where you could have a socket created at a
>> different context from the domain currently writing to it.
>
> It would also help to remember that there are additional process-to-socket
> controls (sendmsg, recvmsg) already in place in SELinux.
>
In summary it's a matter of architecture.
^ permalink raw reply
* Re: [patch 2/6] [Network namespace] Network device sharing by view
From: Herbert Poetzl @ 2006-06-27 15:48 UTC (permalink / raw)
To: Andrey Savochkin
Cc: Eric W. Biederman, Daniel Lezcano, linux-kernel, netdev, serue,
haveblue, clg, Andrew Morton, dev, devel, sam, viro,
Alexey Kuznetsov
In-Reply-To: <20060627130911.A13959@castle.nmd.msu.ru>
On Tue, Jun 27, 2006 at 01:09:11PM +0400, Andrey Savochkin wrote:
> Herbert,
>
> On Mon, Jun 26, 2006 at 10:02:25PM +0200, Herbert Poetzl wrote:
> >
> > keep in mind that you actually have three kinds
> > of network traffic on a typical host/guest system:
> >
> > - traffic between unit and outside
> > - host traffic should be quite minimal
> > - guest traffic will be quite high
> >
> > - traffic between host and guest
> > probably minimal too (only for shared services)
> >
> > - traffic between guests
> > can be as high (or even higher) than the
> > outbound traffic, just think web guest and
> > database guest
>
> My experience with host-guest systems tells me the opposite: outside
> traffic is a way higher than traffic between guests. People put web
> server and database in different guests not more frequent than they
> put them on separate physical server. Unless people are building a
> really huge system when 1 server can't take the whole load, web and
> database live together and benefit from communications over UNIX
> sockets.
well, that's probably because you (or your company)
focuses on providers which simply (re)sell the entities
to their customers, in which case it would be more
expensive to put e.g. the database into a separate
guest. but let me state here that this is not the only
application for this technology
many folks use Linux-VServer for separating services
(e.g. mail, web, database, ...) and here a _lot_ of
traffic happens between guests (as it would on a normal
linux system or within a single guest in your case)
> Guests are usually comprised of web-db pairs, and people place many
> such guests on a single computer.
in case two guests cost more than one, yes, in case
two guests allow for better isolation and easier
maintainance without additional cost, no :)
> > > The routing between network namespaces does have the potential to
> > > be more expensive than just a packet trivially coming off the wire
> > > into a socket.
> >
> > IMHO the routing between network namespaces should
> > not require more than the current local traffic
> > does (i.e. you should be able to achieve loopback
> > speed within an insignificant tolerance) and not
> > nearly the time required for on-wire stuff ...
>
> I'd like to caution about over-optimizing communications between
> different network namespaces. Many optimizations of local traffic
> (such as high MTU) don't look so appealing when you start to think
> about live migration of namespaces.
I think the 'optimization' (or to be precise: desire
not to sacrifice local/loopback traffic for some use
case as you describe it) does not interfere with live
migration at all, we still will have 'local' and 'remote'
traffic, and personally I doubt that the live migration
is a feature for the masses ...
best,
Herbert
> Regards
> Andrey
^ permalink raw reply
* [PATCH] bcm43xx: lower mac_suspend udelay
From: Michael Buesch @ 2006-06-27 15:56 UTC (permalink / raw)
To: linville; +Cc: Jeff Garzik, bcm43xx-dev, Larry Finger, netdev
Microoptimization:
This reduces the udelay in bcm43xx_mac_suspend.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Index: wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c 2006-06-27 17:47:24.000000000 +0200
+++ wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c 2006-06-27 17:53:29.000000000 +0200
@@ -2328,7 +2328,7 @@
tmp = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON);
if (tmp & BCM43xx_IRQ_READY)
goto out;
- udelay(10);
+ udelay(1);
}
printkl(KERN_ERR PFX "MAC suspend failed\n");
}
--
Greetings Michael.
^ permalink raw reply
* [PATCH] bcm43xx-d80211: lower mac_suspend udelay
From: Michael Buesch @ 2006-06-27 15:57 UTC (permalink / raw)
To: linville; +Cc: Jeff Garzik, bcm43xx-dev, Larry Finger, netdev
Microoptimization:
This reduces the udelay in bcm43xx_mac_suspend.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c 2006-06-27 17:51:21.000000000 +0200
+++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c 2006-06-27 17:52:17.000000000 +0200
@@ -2199,7 +2199,7 @@
tmp = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON);
if (tmp & BCM43xx_IRQ_READY)
goto out;
- udelay(10);
+ udelay(1);
}
printkl(KERN_ERR PFX "MAC suspend failed\n");
}
--
Greetings Michael.
^ permalink raw reply
* Re: [patch 2/6] [Network namespace] Network device sharing by view
From: Herbert Poetzl @ 2006-06-27 16:02 UTC (permalink / raw)
To: Eric W. Biederman
Cc: Daniel Lezcano, Andrey Savochkin, linux-kernel, netdev, serue,
haveblue, clg, Andrew Morton, dev, devel, sam, viro,
Alexey Kuznetsov
In-Reply-To: <m1sllqn7cb.fsf@ebiederm.dsl.xmission.com>
On Tue, Jun 27, 2006 at 05:52:52AM -0600, Eric W. Biederman wrote:
> Daniel Lezcano <dlezcano@fr.ibm.com> writes:
>
> >>>>My point is that if you make namespace tagging at routing time,
> >>>>and your packets are being routed only once, you lose the ability
> >>>>to have separate routing tables in each namespace.
> >>>
> >>>Right. What is the advantage of having separate the routing tables ?
> >> Routing is everything. For example, I want namespaces to have their
> >> private tunnel devices. It means that namespaces should be allowed
> >> have private routes of local type, private default routes, and so
> >> on...
> >>
> >
> > Ok, we are talking about the same things. We do it only in a different way:
> >
> > * separate routing table :
> > namespace
> > |
> > \--- route_tables
> > |
> > \---routes
> >
> > * tagged routing table :
> > route_tables
> > |
> > \---routes
> > |
> > \---namespace
>
> There is a third possibility, that falls in between these two if local
> communication is really the bottle neck.
>
> We have the dst cache for caching routes and cache multiple
> transformations that happen on a packet.
>
> With a little extra knowledge it is possible to have the separate
> routing tables but have special logic that recognizes the local
> tunnel device that connects namespaces and have it look into the next
> namespaces routes, and build up a complete stack of dst entries of
> where the packet needs to go.
>
> I keep forgetting about that possibility. But as long as everything is
> done at the routing layer that should work.
>
> > I use the second method, because I think it is more effecient and
> > reduce the overhead. But the isolation is minimalist and only aims
> > to avoid the application using ressources outside of the container
> > (aka namespace) without taking care of the system. For example, I
> > didn't take care of network devices, because as far as see I can't
> > imagine an administrator wanting to change the network device name
> > while there are hundred of containers running. Concerning tunnel
> > devices for example, they should be created inside the container.
>
> Inside the containers I want all network devices named eth0!
huh? even if there are two of them? also tun?
I think you meant, you want to be able to have eth0 in
_more_ than one guest where eth0 in a guest can also
be/use/relate to eth1 on the host, right?
> > I think, private network ressources method is more elegant
> > and involves more network ressources, but there is probably a
> > significant overhead and some difficulties to have __lightweight__
> > container (aka application container), make nfs working well,
> > etc... I did some tests with tbench and the loopback with the
> > private namespace and there is roughly an overhead of 4 % without
> > the isolation since with the tagging method there is 1 % with the
> > isolation.
>
> The overhead went down?
yes, this might actually happen, because the guest
has only to look at a certain subset of entries
but this needs a lot more testing, especially with
a lot of guests
> > The network namespace aims the isolation for now, but the container
> > based on the namespaces will probably need checkpoint/restart and
> > migration ability. The migration is needed not only for servers but
> > for HPC jobs too.
>
> Yes.
>
> > So I don't know what level of isolation/virtualization is really
> > needed by users, what should be acceptable (strong isolation and
> > overhead / weak isolation and efficiency). I don't know if people
> > wanting strong isolation will not prefer Xen (cleary with much more
> > overhead than your patches ;) )
well, Xen claims something below 2% IIRC, and would
be clearly the better choice if you want strict
separation with the complete functionality, especially
with hardware support
> We need a clean abstraction that optimizes well.
>
> However local communication between containers is not what we
> should benchmark. That can always be improved later. So long as
> the performance is reasonable. What needs to be benchmarked is the
> overhead of namespaces when connected to physical networking devices
> and on their own local loopback, and comparing that to a kernel
> without namespace support.
well, for me (obviously advocating the lightweight case)
it seems improtant that the following conditions are met:
- loopback traffic inside a guest is insignificantly
slower than on a normal system
- loopback traffic on the host is insignificantly
slower than on a normal system
- inter guest traffic is faster than on-wire traffic,
and should be withing a small tolerance of the
loopback case (as it really isn't different)
- network (on-wire) traffic should be as fast as without
the namespace (i.e. within 1% or so, better not really
measurable)
- all this should be true in a setup with a significant
number of guests, when only one guest is active, but
all other guests are ready/configured
- all this should scale well with a few hundred guests
> If we don't hurt that core case we have an implementation we can
> merge. There are a lot of optimization opportunities for local
> communications and we can do that after we have a correct and accepted
> implementation. Anything else is optimizing too soon, and will
> just be muddying the waters.
what I fear is that once something is in, the kernel will
just become slower (as it already did in some areas) and
nobody will care/be-able to fix that later on ...
best,
Herbert
> Eric
^ permalink raw reply
* Re: [PATCH 10/21] e1000: force register write flushes to circumvent broken platforms
From: Auke Kok @ 2006-06-27 15:56 UTC (permalink / raw)
To: Auke Kok; +Cc: Jeff Garzik, netdev, Brandeburg, Jesse, Kok, Auke, Ronciak, John
In-Reply-To: <44A14283.50301@intel.com>
Auke Kok wrote:
> Jeff Garzik wrote:
>> Kok, Auke wrote:
>>> A certain AMD64 bridge (8132) has an option to turn on write combining
>>> which breaks our adapter. To circumvent this we need to flush every
>>> write.
>>>
>>> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
>>> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
>>> ---
>>>
>>> drivers/net/e1000/e1000_hw.c | 24 ++++++++++++++++++++++--
>>> drivers/net/e1000/e1000_main.c | 18 +++++++++++-------
>>> 2 files changed, 33 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
>>> index 3959039..749d621 100644
>>> --- a/drivers/net/e1000/e1000_hw.c
>>> +++ b/drivers/net/e1000/e1000_hw.c
>>> @@ -705,8 +705,12 @@ e1000_init_hw(struct e1000_hw *hw)
>>> /* Zero out the Multicast HASH table */
>>> DEBUGOUT("Zeroing the MTA\n");
>>> mta_size = E1000_MC_TBL_SIZE;
>>> - for(i = 0; i < mta_size; i++)
>>> + for(i = 0; i < mta_size; i++) {
>>> E1000_WRITE_REG_ARRAY(hw, MTA, i, 0);
>>> + /* use write flush to prevent Memory Write Block (MWB) from
>>> + * occuring when accessing our register space */
>>> + E1000_WRITE_FLUSH(hw);
>>> + }
>>
>> NAK. We can't crap up every driver just for one weird piece of hardware.
>>
>> If this problem falls outside the grounds of mmiowb() [see
>> Documentation/memory-barriers.txt], then other solutions need to be
>> looked into... ioremap_nocache() ? Tweaking the MTRR for this region?
>> Chipset quirk? ...
>
> If there is an in-kernel fix for this that would make these flushes
> obsolete I would certainly prefer it too, unfortunately we can't fix
> already released kernels and our driver still needs to work there too,
> so that's why I queued it. It can be dropped from this series if that's
> preferred.
I have to get back on that - it's not as simple as "the platform is broken".
e1000's don't support write-combining in hardware but the problem only shows
itself during initialization. This patch makes it work on AMD platforms with
write-combining enabled, the platform itself isn't broken - technically the
NIC is (ixgb doesn't have this problem for instance).
The added write flushes are at initialization only, and fix the problem for
any other case. I don't see much harm in that.
Auke
^ permalink raw reply
* Re: [patch 2/6] [Network namespace] Network device sharing by view
From: Herbert Poetzl @ 2006-06-27 16:09 UTC (permalink / raw)
To: Kirill Korotaev
Cc: Daniel Lezcano, Andrey Savochkin, linux-kernel, netdev, serue,
haveblue, clg, Andrew Morton, devel, sam, ebiederm, viro,
Alexey Kuznetsov
In-Reply-To: <44A1006B.3040700@sw.ru>
On Tue, Jun 27, 2006 at 01:54:51PM +0400, Kirill Korotaev wrote:
> >>My point is that if you make namespace tagging at routing time, and
> >>your packets are being routed only once, you lose the ability
> >>to have separate routing tables in each namespace.
> >
> >
> >Right. What is the advantage of having separate the routing tables ?
> it is impossible to have bridged networking, tun/tap and many other
> features without it. I even doubt that it is possible to introduce
> private netfilter rules w/o virtualization of routing.
why? iptables work quite fine on a typical linux
system when you 'delegate' certain functionality
to certain chains (i.e. doesn't require access to
_all_ of them)
> The question is do we want to have fully featured namespaces which
> allow to create isolated virtual environments with semantics and
> behaviour of standalone linux box or do we want to introduce some
> hacks with new rules/restrictions to meet ones goals only?
well, soemtimes 'hacks' are not only simpler but also
a much better solution for a given problem than the
straight forward approach ...
for example, you won't have multiple routing tables
in a kernel where this feature is disabled, no?
so why should it affect a guest, or require modified
apps inside a guest when we would decide to provide
only a single routing table?
> From my POV, fully virtualized namespaces are the future.
the future is already there, it's called Xen or UML, or QEMU :)
> It is what makes virtualization solution usable (w/o apps
> modifications), provides all the features and doesn't require much
> efforts from people to be used.
and what if they want to use virtualization inside
their guests? where do you draw the line?
best,
Herbert
> Thanks,
> Kirill
^ permalink raw reply
* Re: [PATCH 1/3] mv643xx fixes - Disable interrupts on all ports during initialization
From: Nathaniel Case @ 2006-06-27 16:09 UTC (permalink / raw)
To: John Haller; +Cc: Brent Cook, netdev
In-Reply-To: <44A14BCC.5060708@lucent.com>
On Tue, 2006-06-27 at 10:16 -0500, John Haller wrote:
> Brent Cook wrote:
> > This patch disable interrupts on all ports during initialization. The current
> > assumes that the firmware has already disabled all interrupts on all ports.
> > We have encountered some boards that do not always disable interrupts (XES
> > XPedite 6200 for instance) on a soft reset. This patch prevents a kernel
> > panic if a packet is received before the DMA ring buffers are setup for a
> > port on which interrupts are left enabled by the firmware.
> You probably have bigger problems than the interrupt being left
> enabled. If the interrupt is left enabled, the DMA engine
> is probably left enabled, and if a packet happens
> to come in before the driver can properly configure them,
> some random part of memory will get overwritten.
> The firmware needs to disable this device before transferring
> control to the kernel, both the interrupts and the DMA,
> there is no way to fix this in the kernel.
I agree that the patch isn't the best fix for this problem.
Brent, for this particular case, I believe there's chip errata for the
Discovery bridge preventing it from resetting itself when the board
resets itself in non-monarch mode. That's why interrupts are left
enabled. This issue should never crop up if the board is monarch on the
PCI bus.
So the proper workaround would be for our firmware to account for this
case and disable interrupts, ethernet, etc. on a soft non-monarch reset.
We could also do this in the boot wrapper code as a safety measure.
Also, note that the firmware _will_ already explicitly disable ethernet
before transferring control over to the OS _if_ you're booting over
ethernet instead of flash.
- Nate Case <ncase@xes-inc.com>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox