From: Grant Grundler <grundler@parisc-linux.org>
To: Greg KH <gregkh@suse.de>
Cc: Jeff Garzik <jgarzik@pobox.com>,
"David S. Miller" <davem@davemloft.net>,
tom.l.nguyen@intel.com, roland@topspin.com,
linux-pci@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org,
ak@suse.de
Subject: Re: [RFC PATCH] PCI: remove access to pci_[enable|disable]_msi() for drivers
Date: Tue, 7 Jun 2005 09:53:24 -0600 [thread overview]
Message-ID: <20050607155324.GA29220@colo.lackof.org> (raw)
In-Reply-To: <20050607002045.GA12849@suse.de>
On Mon, Jun 06, 2005 at 05:20:45PM -0700, Greg KH wrote:
> -EXPORT_SYMBOL(pci_enable_msi);
> -EXPORT_SYMBOL(pci_disable_msi);
> +//EXPORT_SYMBOL(pci_enable_msi);
> +//EXPORT_SYMBOL(pci_disable_msi);
You do plan on deleting these lines, right? (Just a reminder)
> --- gregkh-2.6.orig/drivers/pci/pci.c 2005-06-06 16:16:30.000000000 -0700
> +++ gregkh-2.6/drivers/pci/pci.c 2005-06-06 16:20:06.000000000 -0700
> @@ -402,6 +402,7 @@
> if ((err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1)))
> return err;
> pci_fixup_device(pci_fixup_enable, dev);
> + pci_enable_msi(dev);
> dev->is_enabled = 1;
> return 0;
> }
I'm wondering if it would be better/possible to call
enable_msi before calling fixup_device.
But I couldn't find any references to DECLARE_PCI_FIXUP_ENABLE
to see if it would matter.
> @@ -427,7 +428,8 @@
> pci_disable_device(struct pci_dev *dev)
> {
> u16 pci_command;
> -
> +
> + pci_disable_msi(dev);
> pci_read_config_word(dev, PCI_COMMAND, &pci_command);
> if (pci_command & PCI_COMMAND_MASTER) {
> pci_command &= ~PCI_COMMAND_MASTER;
reminder: you probably need to check that msi is still enabled
here or in pci_disable_msi(). I'm thinking of the case where
the driver switched to MSI-X.
> +#ifndef CONFIG_PCI_MSI
> +static inline int pci_enable_msi(struct pci_dev *dev) {return -1;}
> +static inline void pci_disable_msi(struct pci_dev *dev) {}
> +#else
> +extern int pci_enable_msi(struct pci_dev *dev);
> +extern void pci_disable_msi(struct pci_dev *dev);
> +#endif
wouldn't it make more sense to invert this to "ifdef" (vs ifndef)?
> @@ -398,8 +397,6 @@
> /* Switch to INTx by default if MSI enabled */
> if (interrupt_mode == PCIE_PORT_MSIX_MODE)
> pci_disable_msix(dev);
> - else if (interrupt_mode == PCIE_PORT_MSI_MODE)
> - pci_disable_msi(dev);
Why disable msix here but not msi?
This doesn't seem like a good design choice.
I'm suspicious more occurrances will need special handling of MSIX.
Will assign_interrupt_mode() in drivers/pci/pcie/portdrv_core.c
need more changes to deal with the switch to/from MSI/MSIX?
> +++ gregkh-2.6/drivers/net/tg3.c 2005-06-06 16:57:34.000000000 -0700
> @@ -5984,7 +5984,6 @@
> tp->dev->name);
>
> free_irq(tp->pdev->irq, dev);
> - pci_disable_msi(tp->pdev);
>
> tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI;
This chunk of tg3 code will need more than just deleting
the call to pci_disable_msi(). The printk will be wrong
and it's changing the semantics of what TG3_FLG2_USING_MSI
means.
> @@ -6047,7 +6046,7 @@
> if (!(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)) {
> printk(KERN_WARNING PFX "%s: MSI without TAGGED? "
> "Not using MSI.\n", tp->dev->name);
> - } else if (pci_enable_msi(tp->pdev) == 0) {
> + } else if (pci_in_msi_mode(tp->pdev)) {
Again - the "Not Using MSI" msg here needs more help to be correct.
hth,
grant
next prev parent reply other threads:[~2005-06-07 15:50 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20050608060242.GA8035@mellanox.co.il>
2005-06-07 0:20 ` [RFC PATCH] PCI: remove access to pci_[enable|disable]_msi() for drivers Greg KH
2005-06-07 1:09 ` Andrew Vasquez
2005-06-07 5:15 ` Greg KH
2005-06-07 7:31 ` Arjan van de Ven
2005-06-07 16:08 ` Grant Grundler
2005-06-07 16:10 ` Greg KH
2005-06-07 20:41 ` Arjan van de Ven
2005-06-07 22:08 ` Greg KH
2005-06-07 22:43 ` Roland Dreier
2005-06-08 4:42 ` Grant Grundler
2005-06-08 13:34 ` Andi Kleen
2005-06-08 13:37 ` Andi Kleen
2005-06-08 17:04 ` Grant Grundler
2005-06-09 4:54 ` Stefan Smietanowski
2005-06-09 5:26 ` Greg KH
2005-06-07 15:53 ` Grant Grundler [this message]
2005-06-07 16:12 ` Greg KH
2005-06-07 20:21 ` [RFC PATCH] PCI: remove access to pci_[enable|disable]_msi() for drivers - take 2 Greg KH
2005-06-07 22:17 ` Jeff Garzik
2005-06-08 5:55 ` Andrew Grover
2005-06-08 6:14 ` Jeff Garzik
2005-06-08 6:18 ` Jeff Garzik
2005-06-08 13:35 ` Andi Kleen
2005-06-08 15:57 ` Roland Dreier
2005-06-08 5:02 ` Grant Grundler
2005-06-08 13:32 ` Andi Kleen
2005-06-08 15:52 ` Roland Dreier
2005-06-09 14:03 ` Andi Kleen
2005-06-08 16:09 ` Ashok Raj
2005-06-09 1:37 ` Zwane Mwaikambo
2005-06-09 14:11 ` Andi Kleen
2005-06-09 15:58 ` Ashok Raj
2005-06-08 15:47 ` Roland Dreier
2005-06-08 13:31 ` Andi Kleen
2005-06-08 17:56 ` Greg KH
2005-06-08 15:18 ` Luben Tuikov
2005-06-08 18:47 ` Michael S. Tsirkin
2005-06-07 22:24 [RFC PATCH] PCI: remove access to pci_[enable|disable]_msi() for drivers Nguyen, Tom L
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=20050607155324.GA29220@colo.lackof.org \
--to=grundler@parisc-linux.org \
--cc=ak@suse.de \
--cc=davem@davemloft.net \
--cc=gregkh@suse.de \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=roland@topspin.com \
--cc=tom.l.nguyen@intel.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