* [PATCH 3/3] pci: Remove pci_enable_device_bars()
@ 2007-12-20 4:28 Benjamin Herrenschmidt
2007-12-21 2:59 ` patch pci-remove-pci_enable_device_bars.patch added to gregkh-2.6 tree gregkh
2007-12-21 4:28 ` [PATCH 3/3] pci: Remove pci_enable_device_bars() Greg KH
0 siblings, 2 replies; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2007-12-20 4:28 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-pci, linux-kernel, ink, Alan Cox, james.smart, linux-driver,
Bartlomiej Zolnierkiewicz
Now that all in-tree users are gone, this removes pci_enable_device_bars()
completely.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/pci/pci.c | 24 ------------------------
include/linux/pci.h | 1 -
2 files changed, 25 deletions(-)
--- linux-work.orig/drivers/pci/pci.c 2007-12-18 11:01:20.000000000 +1100
+++ linux-work/drivers/pci/pci.c 2007-12-18 11:01:28.000000000 +1100
@@ -713,29 +713,6 @@ int pci_reenable_device(struct pci_dev *
return 0;
}
-/**
- * pci_enable_device_bars - Initialize some of a device for use
- * @dev: PCI device to be initialized
- * @bars: bitmask of BAR's that must be configured
- *
- * Initialize device before it's used by a driver. Ask low-level code
- * to enable selected I/O and memory resources. Wake up the device if it
- * was suspended. Beware, this function can fail.
- */
-int
-pci_enable_device_bars(struct pci_dev *dev, int bars)
-{
- int err;
-
- if (atomic_add_return(1, &dev->enable_cnt) > 1)
- return 0; /* already enabled */
-
- err = do_pci_enable_device(dev, bars);
- if (err < 0)
- atomic_dec(&dev->enable_cnt);
- return err;
-}
-
static int __pci_enable_device_flags(struct pci_dev *dev,
resource_size_t flags)
{
@@ -1665,7 +1642,6 @@ device_initcall(pci_init);
EXPORT_SYMBOL_GPL(pci_restore_bars);
EXPORT_SYMBOL(pci_reenable_device);
-EXPORT_SYMBOL(pci_enable_device_bars);
EXPORT_SYMBOL(pci_enable_device_io);
EXPORT_SYMBOL(pci_enable_device_mem);
EXPORT_SYMBOL(pci_enable_device);
Index: linux-work/include/linux/pci.h
===================================================================
--- linux-work.orig/include/linux/pci.h 2007-12-18 11:00:33.000000000 +1100
+++ linux-work/include/linux/pci.h 2007-12-18 11:01:28.000000000 +1100
@@ -547,7 +547,6 @@ static inline int pci_write_config_dword
}
int __must_check pci_enable_device(struct pci_dev *dev);
-int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask);
int __must_check pci_enable_device_io(struct pci_dev *dev);
int __must_check pci_enable_device_mem(struct pci_dev *dev);
int __must_check pci_reenable_device(struct pci_dev *);
^ permalink raw reply [flat|nested] 8+ messages in thread* patch pci-remove-pci_enable_device_bars.patch added to gregkh-2.6 tree
2007-12-20 4:28 [PATCH 3/3] pci: Remove pci_enable_device_bars() Benjamin Herrenschmidt
@ 2007-12-21 2:59 ` gregkh
2007-12-21 4:28 ` [PATCH 3/3] pci: Remove pci_enable_device_bars() Greg KH
1 sibling, 0 replies; 8+ messages in thread
From: gregkh @ 2007-12-21 2:59 UTC (permalink / raw)
To: benh, alan, bzolnier, greg, gregkh, ink, james.smart,
linux-driver, linux-kernel
This is a note to let you know that I've just added the patch titled
Subject: PCI: Remove pci_enable_device_bars()
to my gregkh-2.6 tree. Its filename is
pci-remove-pci_enable_device_bars.patch
This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
>From owner-linux-pci@atrey.karlin.mff.cuni.cz Wed Dec 19 20:30:57 2007
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Thu, 20 Dec 2007 15:28:10 +1100
Subject: PCI: Remove pci_enable_device_bars()
To: Greg Kroah-Hartman <greg@kroah.com>
Cc: linux-pci@atrey.karlin.mff.cuni.cz, <linux-kernel@vger.kernel.org>, <ink@jurassic.park.msu.ru>, Alan Cox <alan@redhat.com>, <james.smart@emulex.com>, <linux-driver@qlogic.com>, Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Message-ID: <20071220042812.706D0DDEE7@ozlabs.org>
Now that all in-tree users are gone, this removes pci_enable_device_bars()
completely.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/pci/pci.c | 24 ------------------------
include/linux/pci.h | 1 -
2 files changed, 25 deletions(-)
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -741,29 +741,6 @@ int pci_reenable_device(struct pci_dev *
return 0;
}
-/**
- * pci_enable_device_bars - Initialize some of a device for use
- * @dev: PCI device to be initialized
- * @bars: bitmask of BAR's that must be configured
- *
- * Initialize device before it's used by a driver. Ask low-level code
- * to enable selected I/O and memory resources. Wake up the device if it
- * was suspended. Beware, this function can fail.
- */
-int
-pci_enable_device_bars(struct pci_dev *dev, int bars)
-{
- int err;
-
- if (atomic_add_return(1, &dev->enable_cnt) > 1)
- return 0; /* already enabled */
-
- err = do_pci_enable_device(dev, bars);
- if (err < 0)
- atomic_dec(&dev->enable_cnt);
- return err;
-}
-
static int __pci_enable_device_flags(struct pci_dev *dev,
resource_size_t flags)
{
@@ -1695,7 +1672,6 @@ early_param("pci", pci_setup);
device_initcall(pci_init);
EXPORT_SYMBOL(pci_reenable_device);
-EXPORT_SYMBOL(pci_enable_device_bars);
EXPORT_SYMBOL(pci_enable_device_io);
EXPORT_SYMBOL(pci_enable_device_mem);
EXPORT_SYMBOL(pci_enable_device);
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -543,7 +543,6 @@ static inline int pci_write_config_dword
}
int __must_check pci_enable_device(struct pci_dev *dev);
-int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask);
int __must_check pci_enable_device_io(struct pci_dev *dev);
int __must_check pci_enable_device_mem(struct pci_dev *dev);
int __must_check pci_reenable_device(struct pci_dev *);
Patches currently in gregkh-2.6 which might be from benh@kernel.crashing.org are
bad/battery-class-driver.patch
driver/adb-convert-from-class_device-to-device.patch
driver/kobject-convert-hvc_console-to-use-kref-not-kobject.patch
driver/kobject-convert-hvcs-to-use-kref-not-kobject.patch
driver/kobject-convert-icom-to-use-kref-not-kobject.patch
pci/pci-fix-bus-resource-assignment-on-32-bits-with-64b-resources.patch
pci/pci-fix-warning-in-setup-res.c-on-32-bit-platforms-with-64-bit-resources.patch
pci/pci-add-pci_enable_device_-io-mem-intefaces.patch
pci/pci-remove-pci_enable_device_bars.patch
pci/pci-remove-users-of-pci_enable_device_bars.patch
usb/usb-remove-ohci-useless-masking-unmasking-of-wdh-interrupt.patch
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 3/3] pci: Remove pci_enable_device_bars()
2007-12-20 4:28 [PATCH 3/3] pci: Remove pci_enable_device_bars() Benjamin Herrenschmidt
2007-12-21 2:59 ` patch pci-remove-pci_enable_device_bars.patch added to gregkh-2.6 tree gregkh
@ 2007-12-21 4:28 ` Greg KH
2007-12-21 4:44 ` Benjamin Herrenschmidt
2007-12-21 4:47 ` Benjamin Herrenschmidt
1 sibling, 2 replies; 8+ messages in thread
From: Greg KH @ 2007-12-21 4:28 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linux-pci, linux-kernel, ink, Alan Cox, james.smart, linux-driver,
Bartlomiej Zolnierkiewicz
On Thu, Dec 20, 2007 at 03:28:10PM +1100, Benjamin Herrenschmidt wrote:
> Now that all in-tree users are gone, this removes pci_enable_device_bars()
> completely.
Hm, looks like you missed drivers/scsi/qla2xxx/qla_os.c
Quick, before akpm gets mad at you for breaking the build, send me a
patch! :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] pci: Remove pci_enable_device_bars()
2007-12-21 4:28 ` [PATCH 3/3] pci: Remove pci_enable_device_bars() Greg KH
@ 2007-12-21 4:44 ` Benjamin Herrenschmidt
2007-12-21 4:47 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2007-12-21 4:44 UTC (permalink / raw)
To: Greg KH
Cc: linux-pci, linux-kernel, ink, Alan Cox, james.smart, linux-driver,
Bartlomiej Zolnierkiewicz
On Thu, 2007-12-20 at 20:28 -0800, Greg KH wrote:
> On Thu, Dec 20, 2007 at 03:28:10PM +1100, Benjamin Herrenschmidt wrote:
> > Now that all in-tree users are gone, this removes pci_enable_device_bars()
> > completely.
>
> Hm, looks like you missed drivers/scsi/qla2xxx/qla_os.c
>
> Quick, before akpm gets mad at you for breaking the build, send me a
> patch! :)
Argh... there was 2 users in that file and I fixed only one...
Followup patch in a blink.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] pci: Remove pci_enable_device_bars()
2007-12-21 4:28 ` [PATCH 3/3] pci: Remove pci_enable_device_bars() Greg KH
2007-12-21 4:44 ` Benjamin Herrenschmidt
@ 2007-12-21 4:47 ` Benjamin Herrenschmidt
2007-12-21 5:11 ` Greg KH
1 sibling, 1 reply; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2007-12-21 4:47 UTC (permalink / raw)
To: Greg KH
Cc: linux-pci, linux-kernel, ink, Alan Cox, james.smart, linux-driver,
Bartlomiej Zolnierkiewicz
pci: Remove pci_enable_device_bars() fix for qla
The previous patch missed one occurence of pci_enable_device_bars()
in the qla2xxx driver. This fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Index: linux-merge/drivers/scsi/qla2xxx/qla_def.h
===================================================================
--- linux-merge.orig/drivers/scsi/qla2xxx/qla_def.h 2007-12-21 15:45:41.000000000 +1100
+++ linux-merge/drivers/scsi/qla2xxx/qla_def.h 2007-12-21 15:46:12.000000000 +1100
@@ -2272,6 +2272,7 @@ typedef struct scsi_qla_host {
spinlock_t hardware_lock ____cacheline_aligned;
int bars;
+ int mem_only;
device_reg_t __iomem *iobase; /* Base I/O address */
unsigned long pio_address;
unsigned long pio_length;
Index: linux-merge/drivers/scsi/qla2xxx/qla_os.c
===================================================================
--- linux-merge.orig/drivers/scsi/qla2xxx/qla_os.c 2007-12-21 15:46:10.000000000 +1100
+++ linux-merge/drivers/scsi/qla2xxx/qla_os.c 2007-12-21 15:46:12.000000000 +1100
@@ -1626,6 +1626,7 @@ qla2x00_probe_one(struct pci_dev *pdev,
sprintf(ha->host_str, "%s_%ld", QLA2XXX_DRIVER_NAME, ha->host_no);
ha->parent = NULL;
ha->bars = bars;
+ ha->mem_only = mem_only;
/* Set ISP-type information. */
qla2x00_set_isp_flags(ha);
@@ -2905,8 +2906,14 @@ qla2xxx_pci_slot_reset(struct pci_dev *p
{
pci_ers_result_t ret = PCI_ERS_RESULT_DISCONNECT;
scsi_qla_host_t *ha = pci_get_drvdata(pdev);
+ int rc;
- if (pci_enable_device_bars(pdev, ha->bars)) {
+ if (ha->mem_only)
+ rc = pci_enable_device_mem(pdev);
+ else
+ rc = pci_enable_device(pdev);
+
+ if (rc) {
qla_printk(KERN_WARNING, ha,
"Can't re-enable PCI device after reset.\n");
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 3/3] pci: Remove pci_enable_device_bars()
2007-12-21 4:47 ` Benjamin Herrenschmidt
@ 2007-12-21 5:11 ` Greg KH
2007-12-21 5:32 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2007-12-21 5:11 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linux-pci, linux-kernel, ink, Alan Cox, james.smart, linux-driver,
Bartlomiej Zolnierkiewicz
On Fri, Dec 21, 2007 at 03:47:28PM +1100, Benjamin Herrenschmidt wrote:
> pci: Remove pci_enable_device_bars() fix for qla
>
> The previous patch missed one occurence of pci_enable_device_bars()
> in the qla2xxx driver. This fixes it.
Should I just merge this with your 2/3 patch so everything is sane?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] pci: Remove pci_enable_device_bars()
2007-12-21 5:11 ` Greg KH
@ 2007-12-21 5:32 ` Benjamin Herrenschmidt
2007-12-21 17:40 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2007-12-21 5:32 UTC (permalink / raw)
To: Greg KH
Cc: linux-pci, linux-kernel, ink, Alan Cox, james.smart, linux-driver,
Bartlomiej Zolnierkiewicz
On Thu, 2007-12-20 at 21:11 -0800, Greg KH wrote:
> On Fri, Dec 21, 2007 at 03:47:28PM +1100, Benjamin Herrenschmidt wrote:
> > pci: Remove pci_enable_device_bars() fix for qla
> >
> > The previous patch missed one occurence of pci_enable_device_bars()
> > in the qla2xxx driver. This fixes it.
>
> Should I just merge this with your 2/3 patch so everything is sane?
Sure.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] pci: Remove pci_enable_device_bars()
2007-12-21 5:32 ` Benjamin Herrenschmidt
@ 2007-12-21 17:40 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2007-12-21 17:40 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linux-pci, linux-kernel, ink, Alan Cox, james.smart, linux-driver,
Bartlomiej Zolnierkiewicz
On Fri, Dec 21, 2007 at 04:32:11PM +1100, Benjamin Herrenschmidt wrote:
>
> On Thu, 2007-12-20 at 21:11 -0800, Greg KH wrote:
> > On Fri, Dec 21, 2007 at 03:47:28PM +1100, Benjamin Herrenschmidt wrote:
> > > pci: Remove pci_enable_device_bars() fix for qla
> > >
> > > The previous patch missed one occurence of pci_enable_device_bars()
> > > in the qla2xxx driver. This fixes it.
> >
> > Should I just merge this with your 2/3 patch so everything is sane?
>
> Sure.
Ok, now merged and pushed out, thanks.
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-12-21 17:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-20 4:28 [PATCH 3/3] pci: Remove pci_enable_device_bars() Benjamin Herrenschmidt
2007-12-21 2:59 ` patch pci-remove-pci_enable_device_bars.patch added to gregkh-2.6 tree gregkh
2007-12-21 4:28 ` [PATCH 3/3] pci: Remove pci_enable_device_bars() Greg KH
2007-12-21 4:44 ` Benjamin Herrenschmidt
2007-12-21 4:47 ` Benjamin Herrenschmidt
2007-12-21 5:11 ` Greg KH
2007-12-21 5:32 ` Benjamin Herrenschmidt
2007-12-21 17:40 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox