* Re: [PATCH] NVMe: Only release requested regions [not found] <1462886068-14605-1-git-send-email-jthumshirn@suse.de> @ 2016-05-12 7:03 ` Christoph Hellwig 2016-05-12 7:34 ` Johannes Thumshirn 0 siblings, 1 reply; 2+ messages in thread From: Christoph Hellwig @ 2016-05-12 7:03 UTC (permalink / raw) To: Johannes Thumshirn Cc: Keith Busch, Jens Axboe, linux-kernel, linux-nvme, linux-pci > static void nvme_dev_unmap(struct nvme_dev *dev) > { > + struct pci_dev *pdev = to_pci_dev(dev->dev); > + int bars; > + > if (dev->bar) > iounmap(dev->bar); > - pci_release_regions(to_pci_dev(dev->dev)); > + > + bars = pci_select_bars(pdev, IORESOURCE_MEM); > + pci_release_selected_regions(pdev, bars); This looks fine, but I really hate this API. Can someone add these two nice helpers to pci.h: static inline int pci_request_mem_regions(struct pci_dev *pdev, const char *name) { return pci_request_selected_regions(pdev, pci_select_bars(pdev, IORESOURCE_MEM), name); } static inline void pci_release_mem_regions(struct pci_dev *pdev) { return pci_release_selected_regions(pdev, pci_select_bars(pdev, IORESOURCE_MEM)); } But for now this should do it: Reviewed-by: Christoph Hellwig <hch@lst.de> ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] NVMe: Only release requested regions 2016-05-12 7:03 ` [PATCH] NVMe: Only release requested regions Christoph Hellwig @ 2016-05-12 7:34 ` Johannes Thumshirn 0 siblings, 0 replies; 2+ messages in thread From: Johannes Thumshirn @ 2016-05-12 7:34 UTC (permalink / raw) To: Christoph Hellwig Cc: Keith Busch, Jens Axboe, linux-kernel, linux-nvme, linux-pci On Thu, May 12, 2016 at 12:03:52AM -0700, Christoph Hellwig wrote: > > static void nvme_dev_unmap(struct nvme_dev *dev) > > { > > + struct pci_dev *pdev = to_pci_dev(dev->dev); > > + int bars; > > + > > if (dev->bar) > > iounmap(dev->bar); > > - pci_release_regions(to_pci_dev(dev->dev)); > > + > > + bars = pci_select_bars(pdev, IORESOURCE_MEM); > > + pci_release_selected_regions(pdev, bars); > > This looks fine, but I really hate this API. > > Can someone add these two nice helpers to pci.h: Well I could send a patch, but then this is your code... > > static inline int > pci_request_mem_regions(struct pci_dev *pdev, const char *name) > { > return pci_request_selected_regions(pdev, > pci_select_bars(pdev, IORESOURCE_MEM), name); > } > > static inline void > pci_release_mem_regions(struct pci_dev *pdev) > { > return pci_release_selected_regions(pdev, > pci_select_bars(pdev, IORESOURCE_MEM)); > } > > But for now this should do it: > > Reviewed-by: Christoph Hellwig <hch@lst.de> Thanks -- 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 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-12 7:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1462886068-14605-1-git-send-email-jthumshirn@suse.de>
2016-05-12 7:03 ` [PATCH] NVMe: Only release requested regions Christoph Hellwig
2016-05-12 7:34 ` Johannes Thumshirn
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox