From: Jeff Garzik <jeff@garzik.org>
To: Andy Gospodarek <andy@greyhouse.net>
Cc: mcarlson@broadcom.com, netdev@vger.kernel.org,
mchan@broadcom.com, davem@davemloft.net
Subject: Re: [PATCH net-next] tg3: inconsistent interrupt value reported
Date: Fri, 31 Oct 2008 12:09:08 -0400 [thread overview]
Message-ID: <490B2DA4.30903@garzik.org> (raw)
In-Reply-To: <20081031155421.GB6181@gospo.rdu.redhat.com>
Andy Gospodarek wrote:
> Systems that use MSI do not report the correct 'Interrupt' value in
> ifconfig output. This patch sets dev->irq after initializing the
> interrupt as the value will change when using MSI.
>
> I suspect this is a problem with a lot of drivers, so I'll snoop around
> and post some more patches if needed.
>
> Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
> ---
>
> tg3.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> index eb9f8f3..fa95e99 100644
> --- a/drivers/net/tg3.c
> +++ b/drivers/net/tg3.c
> @@ -7892,6 +7892,7 @@ static int tg3_request_irq(struct tg3 *tp)
> irq_handler_t fn;
> unsigned long flags;
> struct net_device *dev = tp->dev;
> + int ret;
>
> if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) {
> fn = tg3_msi;
> @@ -7904,7 +7905,9 @@ static int tg3_request_irq(struct tg3 *tp)
> fn = tg3_interrupt_tagged;
> flags = IRQF_SHARED | IRQF_SAMPLE_RANDOM;
> }
> - return (request_irq(tp->pdev->irq, fn, flags, dev->name, dev));
> + ret = request_irq(tp->pdev->irq, fn, flags, dev->name, dev);
> + dev->irq = tp->pdev->irq;
> + return ret;
The ifconfig value is useless, and was never designed to carry and
display that kind of information (MSI vectors, etc.).
In fact, part of the reason why the ethtool bus-id information was added
was to give better insight into the hardware attached to the device,
notably including the interrupt information.
In modern drivers (read: newer than [E]ISA), dev->irq use is
inconsistent and largely for __best effort__ display purposes only.
I'd argue that a policy of leaving dev->irq at zero might be a better
idea. That ensures users do not pay attention to what is already an
inconsistent/truncate/device-dependent piece of information.
Jeff
next prev parent reply other threads:[~2008-10-31 16:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-31 15:54 [PATCH net-next] tg3: inconsistent interrupt value reported Andy Gospodarek
2008-10-31 16:09 ` Jeff Garzik [this message]
2008-10-31 16:38 ` Andy Gospodarek
2008-10-31 16:47 ` zeroing dev->irq (was Re: [PATCH net-next] tg3: inconsistent interrupt value reported) Jeff Garzik
2008-11-04 3:28 ` zeroing dev->irq 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=490B2DA4.30903@garzik.org \
--to=jeff@garzik.org \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=mcarlson@broadcom.com \
--cc=mchan@broadcom.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).