[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4638EF0B.9050701@interia.pl>
Date: Wed, 02 May 2007 22:05:31 +0200
From: RafaĆ Bilski <rafalbilski@...eria.pl>
To: Tim Hockin <thockin@...kin.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Mark Brown <broonie@...ena.org.uk>,
linux-kernel@...r.kernel.org
Subject: Re: Natsemi DP83815 driver spaming
>> > I'm not sure what the right answer is. The code was designed to do
>> > the right thing, and yet in your case it's broken. Does it need to be
>> > a build option to work around broken hardware? Yuck.
>>
>> Without a system that really needs the original problem that was being
>> worked around it's going to be hard to see if the workaround still does
>> the job. Given the nature of the failure I wouldn't be surprised if it
>> broke different things on every board that has problems.
>
> I'm sure if you were to revert that code today, you'd find people who
> had problems :)
>
>> How about a sysfs tuneable? It's not nice but at least it's runtime.
>
> Fine by me - but I have very little time to do the work.
What about module option?
---
drivers/net/natsemi.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 349b96a..933e106 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -90,6 +90,10 @@ static int rx_copybreak;
static int options[MAX_UNITS];
static int full_duplex[MAX_UNITS];
+/* Used to disable "is PHY alive" check for compatibility with broken
+ * designs using rev. C chips. */
+static int disable_phy_check;
+
/* Operational parameters that are set at compile time. */
/* Keep the ring sizes a power of two for compile efficiency.
@@ -141,6 +145,7 @@ module_param(debug, int, 0);
module_param(rx_copybreak, int, 0);
module_param_array(options, int, NULL, 0);
module_param_array(full_duplex, int, NULL, 0);
+module_param(disable_phy_check, int, 0);
MODULE_PARM_DESC(mtu, "DP8381x MTU (all boards)");
MODULE_PARM_DESC(debug, "DP8381x default debug level");
MODULE_PARM_DESC(rx_copybreak,
@@ -148,6 +153,8 @@ MODULE_PARM_DESC(rx_copybreak,
MODULE_PARM_DESC(options,
"DP8381x: Bits 0-3: media type, bit 17: full duplex");
MODULE_PARM_DESC(full_duplex, "DP8381x full duplex setting(s) (1)");
+MODULE_PARM_DESC(disable_phy_check, "DP8381[56]: PHY lockup check disable"
+ " (all boards)");
/*
Theory of Operation
@@ -1753,7 +1760,7 @@ static void netdev_timer(unsigned long data)
writew(1, ioaddr+PGSEL);
dspcfg = readw(ioaddr+DSPCFG);
writew(0, ioaddr+PGSEL);
- if (dspcfg != np->dspcfg) {
+ if (!disable_phy_check && dspcfg != np->dspcfg) {
if (!netif_queue_stopped(dev)) {
spin_unlock_irq(&np->lock);
if (netif_msg_hw(np))
--
1.5.0.6
----------------------------------------------------------------------
Zrob numer kumplom >> http://link.interia.pl/f1a5d
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists