All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: netdev@vger.kernel.org,
	Realtek linux nic maintainers <nic_swsd@realtek.com>,
	Corinna Vinschen <vinschen@redhat.com>
Subject: Re: [PATCH v2] r8169: Don't claim WoL works if LanWake flag is not set
Date: Thu, 10 Dec 2015 10:51:35 +0100	[thread overview]
Message-ID: <20151210095135.GA21583@calimero.vinschen.de> (raw)
In-Reply-To: <20151209224306.GA5082@electric-eye.fr.zoreil.com>

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

On Dec  9 23:43, Francois Romieu wrote:
> Corinna Vinschen <vinschen@redhat.com> :
> [...]
> > This patch is supposed to fix this behaviour.  If LanWake is 0, the
> > function now returns 0.  Thus ethtool correctly reports "Wake-on: d".
> 
> Can you turn it into a DMI controlled one (something like
> drivers/net/ethernet/marvell/skge.c use of dmi_check_system)

I could do this (after I could lay my hands on such a board, that is),
but I'm not convinced that this makes a lot of sense for two reasons.

> in order to
> avoid a global change of behavior ?

1.  There is no global change in behaviour.  The usual way to handle the
    WoL flags is to set the affected method flags and additionally set
    LanWake if any of the method flags is set.  The fact that the method
    flags don't enable WoL without also settting the LanWake flag is
    documented.

    __rtl8169_get_wol not reflecting this is a bug.  The code lazily
    assumes that checking the WoL method flags is sufficient while in
    fact it isn't.  __rtl8169_set_wol sets the LanWake flag accordingly,
    but that doesn't mean the driver may assume that the flags haven't
    been set differently.  I can easily hack the driver to set LanWake
    to 0 and ethtool would still happily report WoL is active.  That's
    plain wrong.

2. While we now know a single board which neglects to set the LanWake
   flag, that doesn't mean there aren't other boards out there doing the
   same.
   
   On top of that, the state of the NIC registers in terms of WoL are
   *not* board-specific.  They are regular NIC registers which are just
   set in a combination which the driver in it's current state evaluates
   wrongly.  It doesn't matter who and why the flags have been set that
   way.  The driver should reflect the actual state, and that requires
   to check for LanWake.

For those reasons I think that my fix is the right thing to do.

> Btw it's probably time to emit some warning during driver probe if wol
> bits are not consistent with LanWake.

That's a good idea.  I'll propose a followup patch with this addition.


Thanks,
Corinna

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

  reply	other threads:[~2015-12-10  9:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 10:08 [PATCH] r8169: Don't claim WoL works if LanWake flag is not set Corinna Vinschen
2015-12-09 10:43 ` [PATCH v2] " Corinna Vinschen
2015-12-09 22:43   ` Francois Romieu
2015-12-10  9:51     ` Corinna Vinschen [this message]
2015-12-10 20:40       ` Francois Romieu
2015-12-10 22:02         ` Corinna Vinschen
2015-12-11  0:06           ` Francois Romieu
2015-12-11  9:42             ` 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=20151210095135.GA21583@calimero.vinschen.de \
    --to=vinschen@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.