From: Johannes Stezenbach <js@sig21.net>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Ben Hutchings <ben@decadent.org.uk>,
netdev@vger.kernel.org, mcgrof@do-not-panic.com,
kvalo@adurom.com, adrian.chadd@gmail.com
Subject: Re: [PATCH v2 1/1] alx: add a simple AR816x/AR817x device driver
Date: Sat, 22 Jun 2013 12:17:58 +0200 [thread overview]
Message-ID: <20130622101758.GA5427@sig21.net> (raw)
In-Reply-To: <1371764438.8333.20.camel@jlt4.sipsolutions.net>
On Thu, Jun 20, 2013 at 11:40:38PM +0200, Johannes Berg wrote:
>
> On Tue, 2013-06-18 at 02:18 +0100, Ben Hutchings wrote:
> > > + /* Workaround for PCI problem when BIOS sets MMRBC incorrectly. */
> > > + pci_read_config_word(hw->pdev, PCI_COMMAND, &val16);
> > > + if (!(val16 & ALX_PCI_CMD) || (val16 & PCI_COMMAND_INTX_DISABLE)) {
> > > + val16 = (val16 | ALX_PCI_CMD) & ~PCI_COMMAND_INTX_DISABLE;
> > > + pci_write_config_word(hw->pdev, PCI_COMMAND, val16);
> > > + }
> > [...]
> >
> > I don't understand what this is trying to work around but it looks
> > extremely dodgy. The driver already appears to be doing
> > pci_{save,restore}_state() in suspend/resume which is the right thing to
> > do.
>
> I have no idea, but ~PCI_COMMAND_INTX_DISABLE seems really just like
> what we do with PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG... maybe this was
> some sort of workaround for that.
>
> Johannes, can you try to remove this chunk of code and see if your
> device still works? If so I'd just kill it.
I removed it and did a full power cycle, alx still works.
Also tried suspend-to-RAM and alx still works. However,
since the comment for this code is about BIOS bugs it might
be that it is required on some other machine? Not sure
if it is wise to remove it...
Another thing: When testing suspend-to-RAM my machine immediately
woke up. ethtool said wol is enabled by default:
Supports Wake-on: pg
Wake-on: pg
but even after "ethtool -s eth0 wol d" it still woke up.
I did a few experiments, it seems that once the alx driver
is loaded, even when the interface is down, the other end
of the link (laptop with e1000e) reports the link goes
into 10Mbit/s speed during suspend (actually it goes
1G -> down -> 10M), I have to unplug the cable to
prevent the wakeup. Even after "ifconfig eth down"
and "rmmod alx" the link is still up.
# ethtool -s eth0 wol d
# ifconfig eth0 down
# ethtool eth0
...
Wake-on: d
Link detected: no
But the link LEDs are still on and the other side says
"Link detected: yes" and it can't get some sleep.
I think hw->sleep_ctrl should be initialized to 0 in alx_init_sw(),
but I cannot find why the link stays up after "ifconfig eth0 down".
Thanks,
Johannes
next prev parent reply other threads:[~2013-06-22 10:19 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-10 21:26 [PATCH 0/1] alx driver Johannes Berg
2013-06-10 21:26 ` [PATCH 1/1] alx: add a simple AR816x/AR817x device driver Johannes Berg
2013-06-10 21:29 ` [PATCH v2 " Johannes Berg
2013-06-11 22:23 ` Francois Romieu
2013-06-12 18:02 ` Johannes Berg
2013-06-18 1:18 ` Ben Hutchings
2013-06-20 21:40 ` Johannes Berg
2013-06-20 21:58 ` Ben Hutchings
2013-06-20 22:09 ` Johannes Berg
2013-06-21 12:45 ` Ben Hutchings
2013-06-21 20:42 ` Johannes Berg
2013-06-21 21:39 ` Ben Hutchings
2013-06-22 10:17 ` Johannes Stezenbach [this message]
2013-06-22 14:21 ` Ben Hutchings
2013-06-25 18:24 ` Johannes Berg
2013-06-12 7:11 ` [PATCH 0/1] alx driver Johannes Stezenbach
2013-06-12 18:00 ` Johannes Berg
2013-06-12 20:33 ` [PATCH] alx: add a simple AR816x/AR817x device driver Johannes Berg
2013-06-12 20:48 ` Stephen Hemminger
2013-06-12 20:51 ` Johannes Berg
2013-06-12 23:02 ` Francois Romieu
2013-06-13 3:46 ` Joe Perches
2013-06-13 6:47 ` Francois Romieu
2013-06-13 21:52 ` Johannes Berg
2013-06-13 23:03 ` Francois Romieu
2013-06-15 18:38 ` Johannes Berg
2013-06-13 22:24 ` Johannes Stezenbach
2013-06-13 22:29 ` Johannes Berg
2013-06-14 5:53 ` Johannes Stezenbach
2013-06-15 18:26 ` Johannes Berg
2013-06-15 20:15 ` Johannes Berg
2013-06-16 9:49 ` Johannes Stezenbach
2013-06-16 11:17 ` Johannes Berg
2013-06-16 17:48 ` Johannes Stezenbach
2013-06-16 18:06 ` Johannes Stezenbach
2013-06-16 18:42 ` Johannes Stezenbach
2013-06-16 19:41 ` Johannes Berg
2013-06-16 20:37 ` Johannes Stezenbach
2013-06-16 12:14 ` Johannes Berg
2013-06-17 20:44 ` [PATCH v4] " Johannes Berg
2013-06-17 23:05 ` David Miller
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=20130622101758.GA5427@sig21.net \
--to=js@sig21.net \
--cc=adrian.chadd@gmail.com \
--cc=ben@decadent.org.uk \
--cc=johannes@sipsolutions.net \
--cc=kvalo@adurom.com \
--cc=mcgrof@do-not-panic.com \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).