linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Alexander Gordeev <agordeev@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH 11/9] PCI/MSI: Phase out pci_enable_msi_block()
Date: Wed, 29 Jan 2014 15:22:00 -0700	[thread overview]
Message-ID: <20140129222200.GG16825@google.com> (raw)
In-Reply-To: <20140117092737.GB29340@dhcp-26-207.brq.redhat.com>

On Fri, Jan 17, 2014 at 10:27:38AM +0100, Alexander Gordeev wrote:
> This update obsoletes pci_enable_msi_block() function
> in favor of pci_enable_msi_range().
> 
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
>  drivers/pci/msi.c   |   17 +++++++++++++++--
>  include/linux/pci.h |    7 ++-----
>  2 files changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index 7a0fec6..49088d0 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -889,7 +889,7 @@ EXPORT_SYMBOL(pci_msi_vec_count);
>   * updates the @dev's irq member to the lowest new interrupt number; the
>   * other interrupt numbers allocated to this device are consecutive.
>   */
> -int pci_enable_msi_block(struct pci_dev *dev, int nvec)
> +static int pci_enable_msi_block(struct pci_dev *dev, int nvec)
>  {
>  	int status, maxvec;
>  
> @@ -918,7 +918,6 @@ int pci_enable_msi_block(struct pci_dev *dev, int nvec)
>  	status = msi_capability_init(dev, nvec);
>  	return status;
>  }
> -EXPORT_SYMBOL(pci_enable_msi_block);
>  
>  void pci_msi_shutdown(struct pci_dev *dev)
>  {
> @@ -1148,6 +1147,20 @@ int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec)
>  EXPORT_SYMBOL(pci_enable_msi_range);
>  
>  /**
> + * pci_enable_msi - configure device's MSI capability structure
> + * @dev: device to configure
> + *
> + * This function initializes the single MSI mode. It returns a negative errno
> + * if an error occurs. If it succeeds, it returns 0 and updates the @dev's
> + * irq member to the new interrupt number;
> + **/
> +int pci_enable_msi(struct pci_dev *dev)
> +{
> +	return pci_enable_msi_block(dev, 1);

I like un-exporting pci_enable_msi_block(), but I don't like the fact that
we keep it internally.  I'd rather fold it into pci_enable_msi_range()
directly, and then make pci_enable_msi() a wrapper around *that*.

pci_enable_msi_block() has some one-time checks (vector count, already
enabled) that should not be inside the loop in pci_enable_msi_range().
So I think some rearrangement could lead to cleaner code here.

> +}
> +EXPORT_SYMBOL(pci_enable_msi);
> +
> +/**
>   * pci_enable_msix_range - configure device's MSI-X capability structure
>   * @dev: pointer to the pci_dev data structure of MSI-X device function
>   * @entries: pointer to an array of MSI-X entries
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index fa959aa..5b58078 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1157,7 +1157,7 @@ struct msix_entry {
>  
>  #ifdef CONFIG_PCI_MSI
>  int pci_msi_vec_count(struct pci_dev *dev);
> -int pci_enable_msi_block(struct pci_dev *dev, int nvec);
> +int pci_enable_msi(struct pci_dev *dev);
>  void pci_msi_shutdown(struct pci_dev *dev);
>  void pci_disable_msi(struct pci_dev *dev);
>  int pci_msix_vec_count(struct pci_dev *dev);
> @@ -1172,8 +1172,7 @@ int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
>  			  int minvec, int maxvec);
>  #else
>  static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
> -static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec)
> -{ return -ENOSYS; }
> +static inline int pci_enable_msi(struct pci_dev *dev) { return -ENOSYS; }
>  static inline void pci_msi_shutdown(struct pci_dev *dev) { }
>  static inline void pci_disable_msi(struct pci_dev *dev) { }
>  static inline int pci_msix_vec_count(struct pci_dev *dev) { return -ENOSYS; }
> @@ -1223,8 +1222,6 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { }
>  static inline void pcie_ecrc_get_policy(char *str) { }
>  #endif
>  
> -#define pci_enable_msi(pdev)	pci_enable_msi_block(pdev, 1)
> -
>  #ifdef CONFIG_HT_IRQ
>  /* The functions a driver should call */
>  int  ht_create_irq(struct pci_dev *dev, int idx);
> -- 
> 1.7.7.6
> 
> -- 
> Regards,
> Alexander Gordeev
> agordeev@redhat.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-01-29 22:22 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17 16:02 [PATCH v2 0/9] Phase out pci_enable_msi_block() Alexander Gordeev
2014-01-17  9:26 ` [PATCH 10/9] PCI/MSI: Undeprecate pci_enable_msi() Alexander Gordeev
2014-01-29 22:10   ` Bjorn Helgaas
2014-01-17  9:27 ` [PATCH 11/9] PCI/MSI: Phase out pci_enable_msi_block() Alexander Gordeev
2014-01-29 22:22   ` Bjorn Helgaas [this message]
2014-01-17 16:02 ` [PATCH v2 1/9] ahci: Fix broken fallback to single MSI mode Alexander Gordeev
2014-01-17 16:02 ` [PATCH v2 2/9] ahci: Use pci_enable_msi_range() Alexander Gordeev
2014-01-17 16:02 ` [PATCH v2 3/9] ipr: Get rid of superfluous call to pci_disable_msi/msix() Alexander Gordeev
2014-01-17 16:02 ` [PATCH v2 4/9] ipr: Use pci_enable_msi_range() and pci_enable_msix_range() Alexander Gordeev
2014-01-28  9:54   ` Alexander Gordeev
2014-01-28 15:28     ` Brian King
2014-01-29 13:26       ` Alexander Gordeev
2014-01-30 14:06         ` Alexander Gordeev
2014-01-30 14:09           ` [PATCH v2 1/2] ipr: Get rid of superfluous call to pci_disable_msi/msix() Alexander Gordeev
2014-02-03 15:20             ` Brian King
2014-01-30 14:10           ` [PATCH v2 2/2] ipr: Use pci_enable_msi_range() and pci_enable_msix_range() Alexander Gordeev
2014-02-03 15:22             ` Brian King
2014-02-24  8:12           ` [PATCH v2 4/9] " Alexander Gordeev
2014-02-26 15:02             ` Brian King
2014-01-17 16:02 ` [PATCH v2 5/9] nvme: Fix invalid call to irq_set_affinity_hint() Alexander Gordeev
2014-01-17 19:40   ` Bjorn Helgaas
2014-01-17 22:01     ` Keith Busch
2014-01-20  8:38       ` Alexander Gordeev
2014-01-20  8:40         ` [PATCH v3 6/9] nvme: Use pci_enable_msi_range() and pci_enable_msix_range() Alexander Gordeev
2014-02-05 13:07           ` Alexander Gordeev
2014-02-18 17:54           ` Keith Busch
2014-01-20  8:42         ` [PATCH] nvme: Cleanup nvme_dev_start() and fix IRQ leak Alexander Gordeev
2014-01-20 22:48           ` Keith Busch
2014-01-21 10:03             ` Alexander Gordeev
2014-01-21 10:06               ` [PATCH 1/2] Revert "NVMe: Disable admin queue on init failure" Alexander Gordeev
2014-01-21 10:07               ` [PATCH 2/2] nvme: Cleanup nvme_dev_start() and fix IRQ leak Alexander Gordeev
2014-01-21 19:06                 ` Keith Busch
2014-01-20  8:43         ` [PATCH] nvme: Cleanup nvme_dev_start() Alexander Gordeev
2014-01-20 16:41           ` Keith Busch
2014-01-17 16:02 ` [PATCH v2 6/9] nvme: Use pci_enable_msi_range() and pci_enable_msix_range() Alexander Gordeev
2014-01-17 16:02 ` [PATCH v2 7/9] vfio: " Alexander Gordeev
2014-01-29 21:36   ` Bjorn Helgaas
2014-01-17 16:02 ` [PATCH v2 8/9] ath10k: Use pci_enable_msi_range() Alexander Gordeev
2014-01-30 13:48   ` [PATCH 1/3] ath10k: Get rid of superfluous call to pci_disable_msi() Alexander Gordeev
2014-02-04 18:32     ` Kalle Valo
2014-02-04 19:09       ` Alexander Gordeev
2014-02-05  8:21         ` Kalle Valo
2014-02-05  8:50           ` Alexander Gordeev
2014-02-05  8:54             ` Kalle Valo
2014-02-12  0:31               ` Bjorn Helgaas
2014-02-12 13:38                 ` Alexander Gordeev
2014-02-12 19:28                   ` Bjorn Helgaas
2014-02-12 21:30                     ` Kalle Valo
2014-02-12 21:40                       ` Bjorn Helgaas
2014-02-13 10:29                         ` Kalle Valo
2014-02-13 13:18                       ` Alexander Gordeev
2014-02-13 16:04     ` Kalle Valo
2014-01-30 13:48   ` [PATCH 2/3] ath10k: Disable MSI in case IRQ configuration is unknown Alexander Gordeev
2014-01-30 13:49   ` [PATCH v3 3/3] ath10k: Use pci_enable_msi_range() Alexander Gordeev
2014-02-03 11:02   ` [PATCH v2 8/9] " Alexander Gordeev
2014-01-17 16:02 ` [PATCH v2 9/9] wil6210: " Alexander Gordeev
2014-01-29 21:37   ` Bjorn Helgaas
2014-02-07 14:46   ` [PATCH] wil6210: Fix switch operator "missing break?" warning Alexander Gordeev
2014-02-10 10:54     ` Vladimir Kondratiev
2014-02-10 12:16       ` Alexander Gordeev
2014-02-11  1:32         ` Fengguang Wu
2014-01-17 21:00 ` [PATCH v2 0/9] Phase out pci_enable_msi_block() Bjorn Helgaas
2014-01-18  7:15   ` Alexander Gordeev
2014-01-18 14:38     ` Bjorn Helgaas
2014-01-18 14:59       ` Tejun Heo
2014-01-29 21:48         ` Bjorn Helgaas
2014-01-29 13:59   ` Alexander Gordeev

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=20140129222200.GG16825@google.com \
    --to=bhelgaas@google.com \
    --cc=agordeev@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=tj@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).