netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
	pomidorabelisima@gmail.com
Subject: Re: [PATCH net 3/3] r8169: increase the lifespan of the hardware counters dump area.
Date: Tue, 8 Sep 2015 22:23:15 +0200	[thread overview]
Message-ID: <20150908202315.GH20288@calimero.vinschen.de> (raw)
In-Reply-To: <20150908000202.GA5059@electric-eye.fr.zoreil.com>

[-- Attachment #1: Type: text/plain, Size: 1910 bytes --]

On Sep  8 02:02, Francois Romieu wrote:
> Francois Romieu <romieu@fr.zoreil.com> :
> [...]
> > Updated patch is on the way.
> 
> Fixed memcpy in patch 0001, moved counters allocation from open() 
> to probe(), returned open() to its original state but something is
> still wrong: the link does not come up.

I tested and debugged the attached patches.  Just as you noticed, the
interfaces (my test machine has two) don't come up at boot time and
subsequently I can also reproduce two kinds of crashes:

- Calling `ip link ... up' crashes the kernel in rtl_open like this:

[  138.031190]  [<ffffffff81670f92>] dump_stack+0x44/0x55
[  138.036311]  [<ffffffff810d92d5>] __setup_irq+0x515/0x580
[  138.041693]  [<ffffffffa006cf00>] ? rtl8169_gset_xmii+0x20/0x20 [r8169]
[  138.048284]  [<ffffffff810d94c4>] request_threaded_irq+0xf4/0x1a0
[  138.054357]  [<ffffffffa0075cf7>] rtl_open+0x3a7/0xab4 [r8169]
[...]

- Alternatively I can still reproduce the SEGV in rtl_remove_one
  when trying to rmmod the module, I just don't have the stack dump
  handy while writing this mail.  I can show it if needed.

I debugged this on and off the entire day (tweaking, compiling, rebooting,
kernel crash, rinse and repeat).

And the result of my debugging is totally crazy:

If I disable the call to rtl_init_counter_offsets in rtl_open, as in

  #if 0
        retval = rtl_init_counter_offsets(dev);
	if (retval < 0)
		netif_warn(tp, hw, dev, "counter reset/update failed\n");
  #endif

the interfaces come up just fine.

If I reenable the rtl_init_counter_offsets call in rtl_open, and reduce
the rtl_init_counter_offsets function to just this:

  static int rtl_init_counter_offsets(struct net_device *dev)
  {
	  return 1;
  }

then the interfaces refuse to come up, and a subsequent `ip link ... up'
crashes the kernel.

No, I do not understand this :(


Corinna

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-09-08 20:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-05 12:18 [PATCH net 0/3] r8169: fix sleepable allocation during netdevice stats retrieval romieu
2015-09-05 12:18 ` [PATCH net 1/3] r8169: decouple the counters data and the device private area romieu
2015-09-06 10:38   ` Corinna Vinschen
2015-09-05 12:18 ` [PATCH net 2/3] r8169: move rtl_reset_counters_cond before the hardware counters helpers romieu
2015-09-05 12:18 ` [PATCH net 3/3] r8169: increase the lifespan of the hardware counters dump area romieu
2015-09-06 10:37   ` Corinna Vinschen
2015-09-06 20:21     ` Francois Romieu
2015-09-07  7:05       ` David Miller
2015-09-07  9:29       ` Corinna Vinschen
2015-09-08  0:00         ` David Miller
2015-09-08  8:05           ` Corinna Vinschen
2015-09-07 14:44     ` Corinna Vinschen
2015-09-07 21:52       ` Francois Romieu
2015-09-08  0:02         ` Francois Romieu
2015-09-08 20:23           ` Corinna Vinschen [this message]
2015-09-08 23:27             ` Francois Romieu
2015-09-09  9:00               ` Corinna Vinschen
2015-09-08  8:09         ` Corinna Vinschen

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=20150908202315.GH20288@calimero.vinschen.de \
    --to=vinschen@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=pomidorabelisima@gmail.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).