Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755072AbXHISjX (ORCPT ); Thu, 9 Aug 2007 14:39:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752167AbXHISjG (ORCPT ); Thu, 9 Aug 2007 14:39:06 -0400 Received: from smtp2.linux-foundation.org ([207.189.120.14]:49181 "EHLO smtp2.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752299AbXHISjE (ORCPT ); Thu, 9 Aug 2007 14:39:04 -0400 Date: Thu, 9 Aug 2007 11:37:10 -0700 From: Andrew Morton To: Michal Piotrowski Cc: linux-kernel@vger.kernel.org, Netdev , Jeff Garzik Subject: Re: 2.6.23-rc2-mm1 Message-Id: <20070809113710.bc0e3b80.akpm@linux-foundation.org> In-Reply-To: <46BB155D.8050501@googlemail.com> References: <20070809015106.cd0bfc53.akpm@linux-foundation.org> <46BB155D.8050501@googlemail.com> X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6503 Lines: 184 On Thu, 09 Aug 2007 15:23:41 +0200 Michal Piotrowski wrote: > Andrew Morton pisze: > > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc2/2.6.23-rc2-mm1/ > > I am experiencing some problems with 8139too > > [ 28.847004] 8139too 0000:02:0d.0: region #0 not a PIO resource, aborting > [ 28.854722] Bad IO access at port 0 () > [ 28.859459] WARNING: at /home/devel/linux-mm/lib/iomap.c:44 bad_io_access() > [ 28.867415] [] show_trace_log_lvl+0x1a/0x30 > [ 28.873568] [] show_trace+0x12/0x14 > [ 28.879015] [] dump_stack+0x16/0x18 > [ 28.884451] [] bad_io_access+0x58/0x5a > [ 28.890129] [] pci_iounmap+0x21/0x2b > [ 28.895635] [] __rtl8139_cleanup_dev+0x75/0xc6 > [ 28.902037] [] rtl8139_init_one+0x59b/0xa9f > [ 28.908170] [] pci_device_probe+0x44/0x5f > [ 28.914116] [] driver_probe_device+0xa7/0x19a > [ 28.920402] [] __driver_attach+0xa6/0xa8 > [ 28.926236] [] bus_for_each_dev+0x43/0x61 > [ 28.932139] [] driver_attach+0x19/0x1b > [ 28.937776] [] bus_add_driver+0x7e/0x1a5 > [ 28.943567] [] driver_register+0x45/0x75 > [ 28.949358] [] __pci_register_driver+0x56/0x84 > [ 28.955678] [] rtl8139_init_module+0x14/0x1c > [ 28.961832] [] kernel_init+0x132/0x306 > [ 28.967451] [] kernel_thread_helper+0x7/0x14 > [ 28.973588] ======================= > [ 28.978151] initcall 0xc0819104: rtl8139_init_module+0x0/0x1c() returned 0. > [ 28.986114] initcall 0xc0819104 ran for 161 msecs: rtl8139_init_module+0x0/0x1c() > > http://www.stardust.webpages.pl/files/tbf/bitis-gabonica/2.6.23-rc2-mm1/mm-dmesg > http://www.stardust.webpages.pl/files/tbf/bitis-gabonica/2.6.23-rc2-mm1/mm-config > Please try reverting 8139too-force-media-setting-fix.patch, then applying this: From: Andrew Morton Revert git-netdev-all's 9ee6b32a47b9abc565466a9c3b127a5246b452e5 Cc: Michal Piotrowski Cc: Jeff Garzik Signed-off-by: Andrew Morton --- drivers/net/8139too.c | 50 +++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff -puN drivers/net/8139too.c~revert-8139too-clean-up-i-o-remapping drivers/net/8139too.c --- a/drivers/net/8139too.c~revert-8139too-clean-up-i-o-remapping +++ a/drivers/net/8139too.c @@ -121,15 +121,8 @@ /* enable PIO instead of MMIO, if CONFIG_8139TOO_PIO is selected */ -enum rtl_bar_map_info { - rtl_pio_bar = 0, /* PCI BAR #0: PIO */ - rtl_mmio_bar = 1, /* PCI BAR #1: MMIO */ -}; - #ifdef CONFIG_8139TOO_PIO -static int use_pio = 1; -#else -static int use_pio; +#define USE_IO_OPS 1 #endif /* define to 1, 2 or 3 to enable copious debugging info */ @@ -620,17 +613,14 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fa MODULE_LICENSE("GPL"); MODULE_VERSION(DRV_VERSION); -module_param(multicast_filter_limit, int, 0444); +module_param(multicast_filter_limit, int, 0); module_param_array(media, int, NULL, 0); module_param_array(full_duplex, int, NULL, 0); -module_param(debug, int, 0444); -module_param(use_pio, int, 0444); - +module_param(debug, int, 0); +MODULE_PARM_DESC (debug, "8139too bitmapped message enable number"); MODULE_PARM_DESC (multicast_filter_limit, "8139too maximum number of filtered multicast addresses"); MODULE_PARM_DESC (media, "8139too: Bits 4+9: force full duplex, bit 5: 100Mbps"); MODULE_PARM_DESC (full_duplex, "8139too: Force full duplex for board(s) (1)"); -MODULE_PARM_DESC (debug, "8139too bitmapped message enable number"); -MODULE_PARM_DESC (use_pio, "Non-zero to enable PIO (rather than MMIO) register mapping"); static int read_eeprom (void __iomem *ioaddr, int location, int addr_len); static int rtl8139_open (struct net_device *dev); @@ -718,7 +708,13 @@ static void __rtl8139_cleanup_dev (struc assert (tp->pci_dev != NULL); pdev = tp->pci_dev; - pci_iounmap (pdev, tp->mmio_addr); +#ifdef USE_IO_OPS + if (tp->mmio_addr) + ioport_unmap (tp->mmio_addr); +#else + if (tp->mmio_addr) + pci_iounmap (pdev, tp->mmio_addr); +#endif /* USE_IO_OPS */ /* it's ok to call this even if we have no regions to free */ pci_release_regions (pdev); @@ -794,32 +790,32 @@ static int __devinit rtl8139_init_board DPRINTK("PIO region size == 0x%02X\n", pio_len); DPRINTK("MMIO region size == 0x%02lX\n", mmio_len); +#ifdef USE_IO_OPS /* make sure PCI base addr 0 is PIO */ if (!(pio_flags & IORESOURCE_IO)) { 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_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_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n"); rc = -ENODEV; goto err_out; } - if (mmio_len < RTL_MIN_IO_SIZE) { dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n"); rc = -ENODEV; goto err_out; } +#endif rc = pci_request_regions (pdev, DRV_NAME); if (rc) @@ -829,16 +825,28 @@ static int __devinit rtl8139_init_board /* enable PCI bus-mastering */ pci_set_master (pdev); - /* iomap MMIO region */ - ioaddr = pci_iomap(pdev, use_pio ? rtl_pio_bar : rtl_mmio_bar, 0); +#ifdef USE_IO_OPS + ioaddr = ioport_map(pio_start, pio_len); + if (!ioaddr) { + dev_err(&pdev->dev, "cannot map PIO, aborting\n"); + rc = -EIO; + goto err_out; + } + dev->base_addr = pio_start; + tp->mmio_addr = ioaddr; + tp->regs_len = pio_len; +#else + /* ioremap MMIO region */ + ioaddr = pci_iomap(pdev, 1, 0); if (ioaddr == NULL) { - dev_err(&pdev->dev, "cannot map I/O regions, aborting\n"); + dev_err(&pdev->dev, "cannot remap MMIO, aborting\n"); rc = -EIO; goto err_out; } dev->base_addr = (long) ioaddr; tp->mmio_addr = ioaddr; tp->regs_len = mmio_len; +#endif /* USE_IO_OPS */ /* Bring old chips out of low-power mode. */ RTL_W8 (HltClk, 'R'); _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/