public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "J.A. Magallón" <jamagallon@ono.com>
To: Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: Re: Linux 2.6.27-git3: rtl8169 oops and wireless missing symbols
Date: Tue, 14 Oct 2008 22:03:57 +0200	[thread overview]
Message-ID: <20081014220357.64266be8@werewolf.home> (raw)
In-Reply-To: <20081014193316.GA8223@electric-eye.fr.zoreil.com>

On Tue, 14 Oct 2008 21:33:16 +0200, Francois Romieu <romieu@fr.zoreil.com> wrote:

> J.A. Magallón <jamagallon@ono.com> :
> [...]
> > Oct 14 02:27:45 one kernel: r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
> > Oct 14 02:27:45 one kernel: r8169 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
> > Oct 14 02:27:45 one kernel: r8169 0000:02:00.0: setting latency timer to 64
> > Oct 14 02:27:45 one kernel: eth0: RTL8102e at 0xdfffe000, 00:00:00:00:00:00, XID 24a00000 IRQ 219
> 
> The MAC address does not look sane. Does the revert below cure it ?
> 
> diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
> index c821da2..5b8f8ba 100644
> --- a/drivers/net/r8169.c
> +++ b/drivers/net/r8169.c
> @@ -1911,74 +1911,6 @@ static void rtl_disable_msi(struct pci_dev *pdev, struct rtl8169_private *tp)
>  	}
>  }
>  
> -static int rtl_eeprom_read(struct pci_dev *pdev, int cap, int addr, __le32 *val)
> -{
> -	int ret, count = 100;
> -	u16 status = 0;
> -	u32 value;
> -
> -	ret = pci_write_config_word(pdev, cap + PCI_VPD_ADDR, addr);
> -	if (ret < 0)
> -		return ret;
> -
> -	do {
> -		udelay(10);
> -		ret = pci_read_config_word(pdev, cap + PCI_VPD_ADDR, &status);
> -		if (ret < 0)
> -			return ret;
> -	} while (!(status & PCI_VPD_ADDR_F) && --count);
> -
> -	if (!(status & PCI_VPD_ADDR_F))
> -		return -ETIMEDOUT;
> -
> -	ret = pci_read_config_dword(pdev, cap + PCI_VPD_DATA, &value);
> -	if (ret < 0)
> -		return ret;
> -
> -	*val = cpu_to_le32(value);
> -
> -	return 0;
> -}
> -
> -static void rtl_init_mac_address(struct rtl8169_private *tp,
> -				 void __iomem *ioaddr)
> -{
> -	struct pci_dev *pdev = tp->pci_dev;
> -	u8 cfg1;
> -	int vpd_cap;
> -	u8 mac[8];
> -	DECLARE_MAC_BUF(buf);
> -
> -	cfg1 = RTL_R8(Config1);
> -	if (!(cfg1  & VPD)) {
> -		dprintk("VPD access not enabled, enabling\n");
> -		RTL_W8(Cfg9346, Cfg9346_Unlock);
> -		RTL_W8(Config1, cfg1 | VPD);
> -		RTL_W8(Cfg9346, Cfg9346_Lock);
> -	}
> -
> -	vpd_cap = pci_find_capability(pdev, PCI_CAP_ID_VPD);
> -	if (!vpd_cap)
> -		return;
> -
> -	/* MAC address is stored in EEPROM at offset 0x0e
> -	 * Realtek says: "The VPD address does not have to be a DWORD-aligned
> -	 * address as defined in the PCI 2.2 Specifications, but the VPD data
> -	 * is always consecutive 4-byte data starting from the VPD address
> -	 * specified."
> -	 */
> -	if (rtl_eeprom_read(pdev, vpd_cap, 0x000e, (__le32*)&mac[0]) < 0 ||
> -	    rtl_eeprom_read(pdev, vpd_cap, 0x0012, (__le32*)&mac[4]) < 0) {
> -		dprintk("Reading MAC address from EEPROM failed\n");
> -		return;
> -	}
> -
> -	dprintk("MAC address found in EEPROM: %s\n", print_mac(buf, mac));
> -
> -	/* Write MAC address */
> -	rtl_rar_set(tp, mac);
> -}
> -
>  static int __devinit
>  rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  {
> @@ -2156,8 +2088,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  
>  	tp->mmio_addr = ioaddr;
>  
> -	rtl_init_mac_address(tp, ioaddr);
> -
>  	/* Get MAC address */
>  	for (i = 0; i < MAC_ADDR_LEN; i++)
>  		dev->dev_addr[i] = RTL_R8(MAC0 + i);

Yes. I have updated to git4, and it works with this patch.

-- 
J.A. Magallon <jamagallon()ono!com>     \               Software is like sex:
                                         \         It's better when it's free
Mandriva Linux release 2009.0 (Cooker) for i586
Linux 2.6.25-jam18 (gcc 4.3.1 20080626 (GCC) #1 SMP

  reply	other threads:[~2008-10-14 20:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-13 23:02 Linux 2.6.27-git3: rtl8169 oops and wireless missing symbols J.A. Magallón
2008-10-13 23:12 ` David Miller
2008-10-13 23:24   ` J.A. Magallón
2008-10-14  0:30     ` J.A. Magallón
2008-10-14 19:33       ` Francois Romieu
2008-10-14 20:03         ` J.A. Magallón [this message]
2008-10-14 23:39         ` Stefan Lippers-Hollmann
2008-10-13 23:24 ` John W. Linville
2008-10-13 23:44   ` J.A. Magallón
2008-10-14 16:59     ` John W. Linville
2008-10-14  0:23   ` Luis R. Rodriguez
2008-10-14  1:13     ` J.A. Magallón
2008-10-17 20:41     ` Stefanik Gábor
2008-10-17 21:24       ` Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081014220357.64266be8@werewolf.home \
    --to=jamagallon@ono.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox