* [PATCH] pcnet32: break in 2.6.18-rc1 identified (corrected)
@ 2006-08-04 16:26 Don Fry
2006-08-09 4:01 ` Jeff Garzik
0 siblings, 1 reply; 4+ messages in thread
From: Don Fry @ 2006-08-04 16:26 UTC (permalink / raw)
To: murrayma; +Cc: jeff, netdev
I noticed this morning that I had the polarity wrong in my patch
yesterday for older chips in the pcnet32_suspend routine. Here is the
correct patch to test.
> A change I made for 2.6.17 and another for 2.6.18 do not work on older
> pcnet32 chips which I do not have access to. Please test this patch if
> you have access to a 79C970, 79C974, or 79C965 (VLB) version of the
> pcnet32 and let me know if it solves any problems. I have tested with a
> 79C970A, 79C971, 79C972, 79C973, 79C975, 79C976, and 79C978 and the
> changes work as expected.
--- linux-2.6.18-rc3-git1/drivers/net/orig.pcnet32.c Tue Aug 1 14:47:07 2006
+++ linux-2.6.18-rc3-git1/drivers/net/pcnet32.c Thu Aug 3 08:36:26 2006
@@ -202,6 +202,8 @@ static int homepna[MAX_UNITS];
#define CSR15 15
#define PCNET32_MC_FILTER 8
+#define PCNET32_79C970A 0x2621
+
/* The PCNET32 Rx and Tx ring descriptors. */
struct pcnet32_rx_head {
u32 base;
@@ -289,6 +291,7 @@ struct pcnet32_private {
/* each bit indicates an available PHY */
u32 phymask;
+ unsigned short chip_version; /* which variant this is */
};
static int pcnet32_probe_pci(struct pci_dev *, const struct pci_device_id *);
@@ -724,9 +727,11 @@ static u32 pcnet32_get_link(struct net_d
spin_lock_irqsave(&lp->lock, flags);
if (lp->mii) {
r = mii_link_ok(&lp->mii_if);
- } else {
+ } else if (lp->chip_version >= PCNET32_79C970A) {
ulong ioaddr = dev->base_addr; /* card base I/O address */
r = (lp->a.read_bcr(ioaddr, 4) != 0xc0);
+ } else { /* can not detect link on really old chips */
+ r = 1;
}
spin_unlock_irqrestore(&lp->lock, flags);
@@ -1091,6 +1096,10 @@ static int pcnet32_suspend(struct net_de
ulong ioaddr = dev->base_addr;
int ticks;
+ /* really old chips have to be stopped. */
+ if (lp->chip_version < PCNET32_79C970A)
+ return 0;
+
/* set SUSPEND (SPND) - CSR5 bit 0 */
csr5 = a->read_csr(ioaddr, CSR5);
a->write_csr(ioaddr, CSR5, csr5 | CSR5_SUSPEND);
@@ -1529,6 +1538,7 @@ pcnet32_probe1(unsigned long ioaddr, int
lp->mii_if.reg_num_mask = 0x1f;
lp->dxsuflo = dxsuflo;
lp->mii = mii;
+ lp->chip_version = chip_version;
lp->msg_enable = pcnet32_debug;
if ((cards_found >= MAX_UNITS)
|| (options[cards_found] > sizeof(options_mapping)))
@@ -1839,10 +1849,7 @@ static int pcnet32_open(struct net_devic
val |= 2;
} else if (lp->options & PCNET32_PORT_ASEL) {
/* workaround of xSeries250, turn on for 79C975 only */
- i = ((lp->a.read_csr(ioaddr, 88) |
- (lp->a.
- read_csr(ioaddr, 89) << 16)) >> 12) & 0xffff;
- if (i == 0x2627)
+ if (lp->chip_version == 0x2627)
val |= 3;
}
lp->a.write_bcr(ioaddr, 9, val);
@@ -1986,9 +1993,11 @@ static int pcnet32_open(struct net_devic
netif_start_queue(dev);
- /* Print the link status and start the watchdog */
- pcnet32_check_media(dev, 1);
- mod_timer(&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT);
+ if (lp->chip_version >= PCNET32_79C970A) {
+ /* Print the link status and start the watchdog */
+ pcnet32_check_media(dev, 1);
+ mod_timer(&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT);
+ }
i = 0;
while (i++ < 100)
--
Don Fry
brazilnut@us.ibm.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pcnet32: break in 2.6.18-rc1 identified (corrected)
2006-08-04 16:26 [PATCH] pcnet32: break in 2.6.18-rc1 identified (corrected) Don Fry
@ 2006-08-09 4:01 ` Jeff Garzik
2006-08-09 15:35 ` Don Fry
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2006-08-09 4:01 UTC (permalink / raw)
To: Don Fry; +Cc: murrayma, netdev
Don Fry wrote:
> I noticed this morning that I had the polarity wrong in my patch
> yesterday for older chips in the pcnet32_suspend routine. Here is the
> correct patch to test.
>
>> A change I made for 2.6.17 and another for 2.6.18 do not work on older
>> pcnet32 chips which I do not have access to. Please test this patch if
>> you have access to a 79C970, 79C974, or 79C965 (VLB) version of the
>> pcnet32 and let me know if it solves any problems. I have tested with a
>> 79C970A, 79C971, 79C972, 79C973, 79C975, 79C976, and 79C978 and the
>> changes work as expected.
Did testing succeed?
signed-off-by?
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pcnet32: break in 2.6.18-rc1 identified (corrected)
2006-08-09 4:01 ` Jeff Garzik
@ 2006-08-09 15:35 ` Don Fry
2006-08-09 16:12 ` Jeff Garzik
0 siblings, 1 reply; 4+ messages in thread
From: Don Fry @ 2006-08-09 15:35 UTC (permalink / raw)
To: Jeff Garzik; +Cc: murrayma, netdev, strel
On Wed, Aug 09, 2006 at 12:01:34AM -0400, Jeff Garzik wrote:
> Don Fry wrote:
> >I noticed this morning that I had the polarity wrong in my patch
> >yesterday for older chips in the pcnet32_suspend routine. Here is the
> >correct patch to test.
> >
> >>A change I made for 2.6.17 and another for 2.6.18 do not work on older
> >>pcnet32 chips which I do not have access to. Please test this patch if
> >>you have access to a 79C970, 79C974, or 79C965 (VLB) version of the
> >>pcnet32 and let me know if it solves any problems. I have tested with a
> >>79C970A, 79C971, 79C972, 79C973, 79C975, 79C976, and 79C978 and the
> >>changes work as expected.
>
> Did testing succeed?
>
I have not heard anything about testing results yet. I have tested
successfully with the hardware I have, but there are at least three
variants of the chip that I have not been able to find. "It should
work" are the famous last words of most programmers ;-(. I received an
email from Martin on Saturday that he had been traveling and would get
back to me. I believe that the patch will resolve the issue with older
cards. The patch is no worse than what is in 2.6.18-rc4 today, but
removing the offending patch is also an option.
The patch also addresses an issue raised by Yuri Strelenko that the
changes in 2.6.17 caused his 79C970 to stop working. I have sent him a
patch as well, but have heard nothing from him. Those changes I am much
more positive about, but I would like confirmation that I have not
broken something else.
When I have some positive results, I will add the signed-off-by line and
resubmit the patch or ask for the old patch to be removed. When does
the patch need to be submitted in order to be included in 2.6.18?
> signed-off-by?
>
> Jeff
--
Don Fry
brazilnut@us.ibm.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pcnet32: break in 2.6.18-rc1 identified (corrected)
2006-08-09 15:35 ` Don Fry
@ 2006-08-09 16:12 ` Jeff Garzik
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2006-08-09 16:12 UTC (permalink / raw)
To: Don Fry; +Cc: murrayma, netdev, strel
Don Fry wrote:
> When I have some positive results, I will add the signed-off-by line and
> resubmit the patch or ask for the old patch to be removed. When does
> the patch need to be submitted in order to be included in 2.6.18?
A couple weeks, Linus posted that he won't be back until towards the end
of August.
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-08-09 16:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-04 16:26 [PATCH] pcnet32: break in 2.6.18-rc1 identified (corrected) Don Fry
2006-08-09 4:01 ` Jeff Garzik
2006-08-09 15:35 ` Don Fry
2006-08-09 16:12 ` Jeff Garzik
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).