Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1414728

Re: [PATCH v2 3/6] lpfc: Use pci_(request|release)_mem_regions

From Johannes Thumshirn <jthumshirn@suse.de>
Newsgroups linux.kernel
Subject Re: [PATCH v2 3/6] lpfc: Use pci_(request|release)_mem_regions
Date 2016-06-06 10:20 +0200
Message-ID <rGXVo-2jv-19@gated-at.bofh.it> (permalink)
References <rFvot-2Z6-1@gated-at.bofh.it> <rFvou-2Z6-7@gated-at.bofh.it> <rGXVo-2jv-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jun 02, 2016 at 07:57:43AM -0400, Dick Kennedy wrote:
> Thanks Johannes, it looks good.
Hi Dick, 

Can I use this as an Acked-by in the next submission?

Thanks,
	Johannes

> 
> On Thu, Jun 2, 2016 at 3:30 AM, Johannes Thumshirn <jthumshirn@suse.de>
> wrote:
> 
> > Now that we do have pci_request_mem_regions() and
> > pci_release_mem_regions() at
> > hand, use it in the lpfc driver.
> >
> > Suggested-by: Christoph Hellwig <hch@infradead.org>
> > Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> > Cc: James Smart <james.smart@avagotech.com>
> > Cc: Dick Kennedy <dick.kennedy@avagotech.com>
> > Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
> > Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
> > Cc: linux-scsi@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > ---
> >  drivers/scsi/lpfc/lpfc_init.c | 15 ++++-----------
> >  1 file changed, 4 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> > index f57d02c..a8735f7 100644
> > --- a/drivers/scsi/lpfc/lpfc_init.c
> > +++ b/drivers/scsi/lpfc/lpfc_init.c
> > @@ -4775,20 +4775,17 @@ static int
> >  lpfc_enable_pci_dev(struct lpfc_hba *phba)
> >  {
> >         struct pci_dev *pdev;
> > -       int bars = 0;
> >
> >         /* Obtain PCI device reference */
> >         if (!phba->pcidev)
> >                 goto out_error;
> >         else
> >                 pdev = phba->pcidev;
> > -       /* Select PCI BARs */
> > -       bars = pci_select_bars(pdev, IORESOURCE_MEM);
> >         /* Enable PCI device */
> >         if (pci_enable_device_mem(pdev))
> >                 goto out_error;
> >         /* Request PCI resource for the device */
> > -       if (pci_request_selected_regions(pdev, bars, LPFC_DRIVER_NAME))
> > +       if (pci_request_mem_regions(pdev, LPFC_DRIVER_NAME))
> >                 goto out_disable_device;
> >         /* Set up device as PCI master and save state for EEH */
> >         pci_set_master(pdev);
> > @@ -4805,7 +4802,7 @@ out_disable_device:
> >         pci_disable_device(pdev);
> >  out_error:
> >         lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
> > -                       "1401 Failed to enable pci device, bars:x%x\n",
> > bars);
> > +                       "1401 Failed to enable pci device\n");
> >         return -ENODEV;
> >  }
> >
> > @@ -4820,17 +4817,14 @@ static void
> >  lpfc_disable_pci_dev(struct lpfc_hba *phba)
> >  {
> >         struct pci_dev *pdev;
> > -       int bars;
> >
> >         /* Obtain PCI device reference */
> >         if (!phba->pcidev)
> >                 return;
> >         else
> >                 pdev = phba->pcidev;
> > -       /* Select PCI BARs */
> > -       bars = pci_select_bars(pdev, IORESOURCE_MEM);
> >         /* Release PCI resource and disable PCI device */
> > -       pci_release_selected_regions(pdev, bars);
> > +       pci_release_mem_regions(pdev);
> >         pci_disable_device(pdev);
> >
> >         return;
> > @@ -9705,7 +9699,6 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev)
> >         struct lpfc_vport **vports;
> >         struct lpfc_hba   *phba = vport->phba;
> >         int i;
> > -       int bars = pci_select_bars(pdev, IORESOURCE_MEM);
> >
> >         spin_lock_irq(&phba->hbalock);
> >         vport->load_flag |= FC_UNLOADING;
> > @@ -9780,7 +9773,7 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev)
> >
> >         lpfc_hba_free(phba);
> >
> > -       pci_release_selected_regions(pdev, bars);
> > +       pci_release_mem_regions(pdev);
> >         pci_disable_device(pdev);
> >  }
> >
> > --
> > 1.8.5.6
> >
> >

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/6] Introduce pci_(request|release)_(mem|io)_regions Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-02 09:40 +0200
  [PATCH v2 2/6] NVMe: Use pci_(request|release)_mem_regions Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-02 09:40 +0200
  [PATCH v2 4/6] GenWQE: Use pci_(request|release)_mem_regions Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-02 09:40 +0200
  [PATCH v2 6/6] alx: Use pci_(request|release)_mem_regions Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-02 09:40 +0200
  [PATCH v2 1/6] PCI: Add helpers to request/release memory and I/O regions Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-02 09:40 +0200
    Re: [PATCH v2 1/6] PCI: Add helpers to request/release memory and  I/O regions kbuild test robot <lkp@intel.com> - 2016-06-05 01:30 +0200
    Re: [PATCH v2 1/6] PCI: Add helpers to request/release memory and  I/O regions kbuild test robot <lkp@intel.com> - 2016-06-05 01:40 +0200
      Re: [PATCH v2 1/6] PCI: Add helpers to request/release memory and  I/O regions Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-06 10:20 +0200
  [PATCH v2 5/6] ethernet/intel: Use pci_(request|release)_mem_regions Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-02 09:40 +0200
    Re: [PATCH v2 5/6] ethernet/intel: Use  pci_(request|release)_mem_regions Jeff Kirsher <jeffrey.t.kirsher@intel.com> - 2016-06-02 23:10 +0200
  [PATCH v2 3/6] lpfc: Use pci_(request|release)_mem_regions Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-02 09:40 +0200
    Re: [PATCH v2 3/6] lpfc: Use pci_(request|release)_mem_regions Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-06 10:20 +0200

csiph-web