netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Wu <lekensteyn@gmail.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: netdev@vger.kernel.org,
	Realtek linux nic maintainers <nic_swsd@realtek.com>
Subject: Re: r8169: is the work queue is initialized at wrong place?
Date: Fri, 19 Jul 2013 11:23:46 +0200	[thread overview]
Message-ID: <23723601.GBD7pm82ZA@al> (raw)
In-Reply-To: <20130719061017.GA3334@electric-eye.fr.zoreil.com>

On Friday 19 July 2013 08:10:17 Francois Romieu wrote:
> Peter Wu <lekensteyn@gmail.com> :
> > On Thursday 18 July 2013 23:53:43 Francois Romieu wrote:
> [...]
> 
> > > (or cancel_work_sync in rtl8169_close to reduce the scope)
> > 
> > Will this also work with multiple adapters? I currently have an on-board
> > chip using the r8169 driver and a separate PCI card.
> 
> As stated by David, yes.
Thanks for confirming.

> > > I do not see how the current code could hurt but it's really ugly.
> > 
> > When I googled for the warning, I found some hint about something not
> > being
> > initialized. From that I guessed that rtl_open is never called when the
> > network interface is not brought up (which seems to match the
> > documentation of struct net_device_ops[1]).
> 
> You guessed right. Please note that the relevant struct is zeroed during
> initialization (see net/core/dev.c::alloc_netdev_mqs). While it's true
> that the struct is not initialized for use by the device, cancel_work_sync
> will cope with it (bail out thanks to a 0 bitflag).
> 
> You can ignore the warning and proceed with the driver as-is.
Well, the driver appears to work, but due to this I also miss future lockdep 
warnings until I reboot.

> I'll fix it anyway. It's too ugly to be kept as is.
> 
> Side-note: if you can publish your eeprom reading code, it would be
> interesting to know how it differs from what has already been tried
> in the past.
I will certainly do this. Right not I am leveraging the existing 93cx6 driver 
in the kernel. I am having difficulties with making the reads reliable though, 
only after writing at least once to the EEPROM (which is logged as timeout, 
although the word is written), I am able to read it. Otherwise, I will only 
read 00s. This is on an external RTL8169SB Gbe PCI card (on the chip itself, I 
can read RTL8169SC though). (bought for 10$ on Ebay :P).

Initially, this chip could not detect a link (it reported itself with PCI 
VID:PID 10ec:8129), probably due to a bad driver that overwrote part of the 
EEPROM (maybe this one[1]?). After writing the EEPROM signature (29 81) (and 
making the card load from EEPROM by writing 0x40 to register 0x50)), the card 
MAC version does not get recognized and is detected as generic "RTL8169" 
(unbind/bind). After a reboot, the card got detected "properly" 
RTL8169sb/8110sb ("properly", because I really see "RTL8169SC" on the 
chip...).

On another onboard RTL8111E chip, I only read FFs. I haven't tried writing to 
that one as it is working perfectly.

Regards,
Peter

 [1]: http://www.gossamer-threads.com/lists/linux/kernel/990061

  reply	other threads:[~2013-07-19  9:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18  9:17 r8169: is the work queue is initialized at wrong place? Peter Wu
2013-07-18 21:53 ` Francois Romieu
2013-07-18 22:41   ` Peter Wu
2013-07-19  3:16     ` David Miller
2013-07-19  6:10     ` Francois Romieu
2013-07-19  9:23       ` Peter Wu [this message]
2013-07-20 23:22   ` Peter Wu

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=23723601.GBD7pm82ZA@al \
    --to=lekensteyn@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=romieu@fr.zoreil.com \
    /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;
as well as URLs for NNTP newsgroup(s).