From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: Kent E Yoder <yoder1@us.ibm.com>
Cc: marcelo@conectiva.com.br, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] IBM Lanstreamer bugfixes
Date: Thu, 17 Jan 2002 05:57:06 -0500 [thread overview]
Message-ID: <3C46AE02.FAEEFA7B@mandrakesoft.com> (raw)
In-Reply-To: <OFDECC5A17.29748904-ON85256B43.006B2B67@raleigh.ibm.com>
Kent E Yoder wrote:
> This patch fixes several bugs and works around known hardware problems
> which conspired to lock up the system randomly. Its somewhat large,
> therefore available at:
http://oss.software.ibm.com/developer/opensource/linux/patches/tr/lanstreamer-0.5.1.patch.gz
>
> * Interrupt function rearranged
> * PCI Configuration changed
> * Tx descriptors had to be reduced to 1 (!)
> * Send/Receive operations are nearly serialized
Marcelo, please do not apply this patch...
Sorry for the delay, review:
1) (in code, not in your patch) prefer kernel-standard types like u32 or
u16 to __u32 and __u16
2) poor formatting:
> +#if STREAMER_IOCTL
> + dev->do_ioctl = &streamer_ioctl;
> +#else
> dev->do_ioctl = NULL;
> +#endif
3) I don't like this playing around with magic numbers. pci_set_master
and pci_enable_device and pci_disable_device twiddle PCI_COMMAND bits,
too. Use constants from pci.h make it clear what bits you are clearing,
and what bits you are setting.
> + pci_write_config_byte (pdev, PCI_CACHE_LINE_SIZE, cls);
> + pci_read_config_word (pdev, PCI_COMMAND, &pcr);
> +
> + /* Turn off Fast B2B enable */
> + pcr &= 0xfdff;
> + /* Turn on SERR# enable and others */
> + pcr |= 0x0157;
> +
> + pci_write_config_word (pdev, PCI_COMMAND, pcr);
> + pci_read_config_word (pdev, PCI_COMMAND, &pcr);
4) Your code appears to -always- set cache line size to zero. Is that a
hardware bug? Look at acenic.c to see a better example of setting PCI
cache line size.
5) what is the purpose of the spin_lock in streamer_open, if open is
serialized? it worries me that the previous streamer_open code disabled
interrupts and the new one does not, but replaces with a non-irq-saving
lock that appears superfluous.
6) udelay(1) after brand new spin_lock in streamer_interrupt is
suspicious
7) disabling interrupts by zeroing NIC intr mask, in interrupt handler,
is general not needed. why was this added? interrupt handlers are not
re-entered so this is not a worry.
8) the while loop in the interrupt looks like it could go on for quite a
while under heavy load, starving out a lot of other kernel code. it
needs a work limit at the very least...
9) disabling interrupts at the beginning of each TX is wrong. you
probably want spin_lock_irqsave at critical parts of the xmit.
10) udelay(100) is likely wrong and a sign of a race (perhaps #9, above,
fixes this)
11) replacing save_flags/cli with normal spin_lock in streamer_close is
suspicious and likely wrong. See issue #5 about streamer_open
serialization. Have you read Documentation/networking/netdevices.txt ?
12) formatting of streamer_ioctl is grossly different from the rest of
the code
13) SIOCDEVPRIVATE ioctls are going away in 2.5. (you can implement
include/linux/ethtool.h SIOCETHTOOL interface for lot of the
functionality, though)
--
Jeff Garzik | Alternate titles for LOTR:
Building 1024 | Fast Times at Uruk-Hai
MandrakeSoft | The Took, the Elf, His Daughter and Her Lover
| Samwise Gamgee: International Hobbit of Mystery
next prev parent reply other threads:[~2002-01-17 10:57 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-16 19:42 [PATCH] IBM Lanstreamer bugfixes Kent E Yoder
2002-01-17 10:57 ` Jeff Garzik [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-01-17 15:29 Kent E Yoder
2002-01-18 20:52 Kent E Yoder
2002-01-18 21:35 ` Alan Cox
2002-01-18 22:32 Kent E Yoder
2002-01-18 22:47 ` Alan Cox
2002-01-18 22:39 Kent E Yoder
2002-01-18 23:02 Kent E Yoder
2002-01-18 23:19 ` Alan Cox
2002-01-18 23:52 ` Gérard Roudier
2002-01-19 17:14 ` Mike Phillips
2002-01-21 16:44 Kent E Yoder
2002-01-21 17:46 ` Mike Phillips
2002-01-30 19:27 Kent E Yoder
2002-01-30 19:48 ` Jeff Garzik
2002-01-30 19:58 ` David Weinehall
2002-01-30 20:43 ` Alan Cox
2002-01-30 20:04 ` Mike Phillips
2002-01-30 20:47 ` Alan Cox
2002-02-01 20:53 Kent E Yoder
2002-02-01 23:38 ` Alan Cox
2002-02-01 23:40 ` Alan Cox
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=3C46AE02.FAEEFA7B@mandrakesoft.com \
--to=jgarzik@mandrakesoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=yoder1@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox