* [patch] e100: early reset fix
@ 2004-11-22 9:52 Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2004-11-22 9:52 UTC (permalink / raw)
To: john.ronciak, ganesh.venkatesan, jesse.brandeburg; +Cc: netdev
Gents, what do we think of the below fix?
Thanks.
My IBM A21P laptop is getting an IRQ storm at boot.
IRQ #11 is shared between USB and e100, and USB is getting in there first.
Consequently, when e100 initialises the hardware, that interrupt line is ready
to go. As soon as e100.c runs pci_set_master(), the interrupt hits the CPU.
But of course the e100 driver isn't ready to handle the interrupt yet, so the
system disables IRQ #11.
This only happens on warm boots (/sbin/reboot). Things work OK from power-on.
So I assume that the BIOS is failing to fully reset the NIC and that some
sort of interrupt is internally pending.
The patch rearranges e100_probe() so that we issue e100_hw_reset() prior to
running pci_set_master(), and fixes the problem.
Note that e100_probe() is now running e100_hw_reset() twice - I didn't remove
the later call for general paranoia reasons.
eepro100.c has the same lockup, and needs a similar fix.
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
25-akpm/drivers/net/e100.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff -puN drivers/net/e100.c~e100-early-reset-fix drivers/net/e100.c
--- 25/drivers/net/e100.c~e100-early-reset-fix 2004-11-22 01:44:59.031615736 -0800
+++ 25-akpm/drivers/net/e100.c 2004-11-22 01:44:59.036614976 -0800
@@ -2205,23 +2205,25 @@ static int __devinit e100_probe(struct p
goto err_out_disable_pdev;
}
+ nic->csr = ioremap(pci_resource_start(pdev, 0), sizeof(struct csr));
+ if(!nic->csr) {
+ DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n");
+ err = -ENOMEM;
+ goto err_out_free_res;
+ }
+
+ e100_hw_reset(nic);
+
pci_set_master(pdev);
if((err = pci_set_dma_mask(pdev, 0xFFFFFFFFULL))) {
DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n");
- goto err_out_free_res;
+ goto err_out_iounmap;
}
SET_MODULE_OWNER(netdev);
SET_NETDEV_DEV(netdev, &pdev->dev);
- nic->csr = ioremap(pci_resource_start(pdev, 0), sizeof(struct csr));
- if(!nic->csr) {
- DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n");
- err = -ENOMEM;
- goto err_out_free_res;
- }
-
if(ent->driver_data)
nic->flags |= ich;
else
_
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [patch] e100: early reset fix
@ 2004-11-23 22:22 Venkatesan, Ganesh
0 siblings, 0 replies; 2+ messages in thread
From: Venkatesan, Ganesh @ 2004-11-23 22:22 UTC (permalink / raw)
To: Andrew Morton, sfeldma
Cc: Ronciak, John, Brandeburg, Jesse, Jeff Garzik, netdev
Andy:
Please forward this patch to Linus for inclusion into 2.6.10. We missed
our internal driver release window and will have to wait another ~ 6
weeks before we release another version of e100.
Thanks,
Ganesh.
>-----Original Message-----
>From: Andrew Morton [mailto:akpm@osdl.org]
>Sent: Monday, November 22, 2004 5:42 PM
>To: sfeldma@pobox.com
>Cc: Ronciak, John; Venkatesan, Ganesh; Brandeburg, Jesse; Jeff Garzik
>Subject: Re: [patch] e100: early reset fix
>
>Scott Feldman <sfeldma@pobox.com> wrote:
>>
>> On Mon, 2004-11-22 at 01:52, Andrew Morton wrote:
>> > Gents, what do we think of the below fix?
>>
>> This keeps just one reset, and adds a comment so someone doesn't
>> rearrange things later.
>>
>> Signed-off-by: Scott Feldman <sfeldma@pobox.com>
>
>It works, of course. You want me to feed it into Linus for 2.6.10?
>
>> --------------
>>
>> --- linux-2.6.10-rc2/drivers/net/e100.c 2004-11-22
11:15:50.180163536 -
>0800
>> +++ linux-2.6.10-rc2/drivers/net/e100.c.mod 2004-11-22
>11:41:23.893003744 -0800
>> @@ -2204,8 +2204,6 @@ static int __devinit e100_probe(struct p
>> goto err_out_disable_pdev;
>> }
>>
>> - pci_set_master(pdev);
>> -
>> if((err = pci_set_dma_mask(pdev, 0xFFFFFFFFULL))) {
>> DPRINTK(PROBE, ERR, "No usable DMA configuration,
>aborting.\n");
>> goto err_out_free_res;
>> @@ -2226,6 +2224,15 @@ static int __devinit e100_probe(struct p
>> else
>> nic->flags &= ~ich;
>>
>> + e100_get_defaults(nic);
>> +
>> + /* Reset the device before pci_set_master() in case device is in
some
>> + * funky state and has an interrupt pending - hint: we don't
have the
>> + * interrupt handler registered yet. */
>> + e100_hw_reset(nic);
>> +
>> + pci_set_master(pdev);
>> +
>> spin_lock_init(&nic->cb_lock);
>> spin_lock_init(&nic->cmd_lock);
>>
>> @@ -2241,8 +2248,6 @@ static int __devinit e100_probe(struct p
>> goto err_out_iounmap;
>> }
>>
>> - e100_get_defaults(nic);
>> - e100_hw_reset(nic);
>> e100_phy_init(nic);
>>
>> if((err = e100_eeprom_load(nic)))
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-11-23 22:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-22 9:52 [patch] e100: early reset fix Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2004-11-23 22:22 Venkatesan, Ganesh
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).