Commit e3414786 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pci-v3.13-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI updates from Bjorn Helgaas:
 "Miscellaneous
   - Remove duplicate disable from pcie_portdrv_remove() (Yinghai Lu)
   - Fix whitespace, capitalization, and spelling errors (Bjorn Helgaas)"

* tag 'pci-v3.13-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  PCI: Remove duplicate pci_disable_device() from pcie_portdrv_remove()
  PCI: Fix whitespace, capitalization, and spelling errors
parents b0e3636f e7cc5cf7
...@@ -410,7 +410,7 @@ EXPORT_SYMBOL_GPL(pci_disable_pasid); ...@@ -410,7 +410,7 @@ EXPORT_SYMBOL_GPL(pci_disable_pasid);
* Otherwise is returns a bitmask with supported features. Current * Otherwise is returns a bitmask with supported features. Current
* features reported are: * features reported are:
* PCI_PASID_CAP_EXEC - Execute permission supported * PCI_PASID_CAP_EXEC - Execute permission supported
* PCI_PASID_CAP_PRIV - Priviledged mode supported * PCI_PASID_CAP_PRIV - Privileged mode supported
*/ */
int pci_pasid_features(struct pci_dev *pdev) int pci_pasid_features(struct pci_dev *pdev)
{ {
......
...@@ -249,7 +249,7 @@ struct tegra_pcie { ...@@ -249,7 +249,7 @@ struct tegra_pcie {
void __iomem *afi; void __iomem *afi;
int irq; int irq;
struct list_head busses; struct list_head buses;
struct resource *cs; struct resource *cs;
struct resource io; struct resource io;
...@@ -399,14 +399,14 @@ static struct tegra_pcie_bus *tegra_pcie_bus_alloc(struct tegra_pcie *pcie, ...@@ -399,14 +399,14 @@ static struct tegra_pcie_bus *tegra_pcie_bus_alloc(struct tegra_pcie *pcie,
/* /*
* Look up a virtual address mapping for the specified bus number. If no such * Look up a virtual address mapping for the specified bus number. If no such
* mapping existis, try to create one. * mapping exists, try to create one.
*/ */
static void __iomem *tegra_pcie_bus_map(struct tegra_pcie *pcie, static void __iomem *tegra_pcie_bus_map(struct tegra_pcie *pcie,
unsigned int busnr) unsigned int busnr)
{ {
struct tegra_pcie_bus *bus; struct tegra_pcie_bus *bus;
list_for_each_entry(bus, &pcie->busses, list) list_for_each_entry(bus, &pcie->buses, list)
if (bus->nr == busnr) if (bus->nr == busnr)
return (void __iomem *)bus->area->addr; return (void __iomem *)bus->area->addr;
...@@ -414,7 +414,7 @@ static void __iomem *tegra_pcie_bus_map(struct tegra_pcie *pcie, ...@@ -414,7 +414,7 @@ static void __iomem *tegra_pcie_bus_map(struct tegra_pcie *pcie,
if (IS_ERR(bus)) if (IS_ERR(bus))
return NULL; return NULL;
list_add_tail(&bus->list, &pcie->busses); list_add_tail(&bus->list, &pcie->buses);
return (void __iomem *)bus->area->addr; return (void __iomem *)bus->area->addr;
} }
...@@ -808,7 +808,7 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie) ...@@ -808,7 +808,7 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
value &= ~AFI_FUSE_PCIE_T0_GEN2_DIS; value &= ~AFI_FUSE_PCIE_T0_GEN2_DIS;
afi_writel(pcie, value, AFI_FUSE); afi_writel(pcie, value, AFI_FUSE);
/* initialze internal PHY, enable up to 16 PCIE lanes */ /* initialize internal PHY, enable up to 16 PCIE lanes */
pads_writel(pcie, 0x0, PADS_CTL_SEL); pads_writel(pcie, 0x0, PADS_CTL_SEL);
/* override IDDQ to 1 on all 4 lanes */ /* override IDDQ to 1 on all 4 lanes */
...@@ -1624,7 +1624,7 @@ static int tegra_pcie_probe(struct platform_device *pdev) ...@@ -1624,7 +1624,7 @@ static int tegra_pcie_probe(struct platform_device *pdev)
if (!pcie) if (!pcie)
return -ENOMEM; return -ENOMEM;
INIT_LIST_HEAD(&pcie->busses); INIT_LIST_HEAD(&pcie->buses);
INIT_LIST_HEAD(&pcie->ports); INIT_LIST_HEAD(&pcie->ports);
pcie->soc_data = match->data; pcie->soc_data = match->data;
pcie->dev = &pdev->dev; pcie->dev = &pdev->dev;
......
...@@ -197,7 +197,7 @@ static int find_valid_pos0(struct pcie_port *pp, int msgvec, int pos, int *pos0) ...@@ -197,7 +197,7 @@ static int find_valid_pos0(struct pcie_port *pp, int msgvec, int pos, int *pos0)
return -ENOSPC; return -ENOSPC;
/* /*
* Check if this position is at correct offset.nvec is always a * Check if this position is at correct offset.nvec is always a
* power of two. pos0 must be nvec bit alligned. * power of two. pos0 must be nvec bit aligned.
*/ */
if (pos % msgvec) if (pos % msgvec)
pos += msgvec - (pos % msgvec); pos += msgvec - (pos % msgvec);
......
...@@ -133,8 +133,8 @@ config HOTPLUG_PCI_RPA_DLPAR ...@@ -133,8 +133,8 @@ config HOTPLUG_PCI_RPA_DLPAR
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called rpadlpar_io. module will be called rpadlpar_io.
When in doubt, say N. When in doubt, say N.
config HOTPLUG_PCI_SGI config HOTPLUG_PCI_SGI
tristate "SGI PCI Hotplug Support" tristate "SGI PCI Hotplug Support"
......
...@@ -31,7 +31,7 @@ pci_hotplug-objs += cpci_hotplug_core.o \ ...@@ -31,7 +31,7 @@ pci_hotplug-objs += cpci_hotplug_core.o \
cpci_hotplug_pci.o cpci_hotplug_pci.o
endif endif
ifdef CONFIG_ACPI ifdef CONFIG_ACPI
pci_hotplug-objs += acpi_pcihp.o pci_hotplug-objs += acpi_pcihp.o
endif endif
cpqphp-objs := cpqphp_core.o \ cpqphp-objs := cpqphp_core.o \
......
...@@ -111,7 +111,7 @@ int acpiphp_register_attention(struct acpiphp_attention_info *info) ...@@ -111,7 +111,7 @@ int acpiphp_register_attention(struct acpiphp_attention_info *info)
* @info: must match the pointer used to register * @info: must match the pointer used to register
* *
* Description: This is used to un-register a hardware specific acpi * Description: This is used to un-register a hardware specific acpi
* driver that manipulates the attention LED. The pointer to the * driver that manipulates the attention LED. The pointer to the
* info struct must be the same as the one used to set it. * info struct must be the same as the one used to set it.
*/ */
int acpiphp_unregister_attention(struct acpiphp_attention_info *info) int acpiphp_unregister_attention(struct acpiphp_attention_info *info)
...@@ -169,8 +169,8 @@ static int disable_slot(struct hotplug_slot *hotplug_slot) ...@@ -169,8 +169,8 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
* was registered with us. This allows hardware specific * was registered with us. This allows hardware specific
* ACPI implementations to blink the light for us. * ACPI implementations to blink the light for us.
*/ */
static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
{ {
int retval = -ENODEV; int retval = -ENODEV;
pr_debug("%s - physical_slot = %s\n", __func__, pr_debug("%s - physical_slot = %s\n", __func__,
...@@ -182,8 +182,8 @@ static int disable_slot(struct hotplug_slot *hotplug_slot) ...@@ -182,8 +182,8 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
} else } else
attention_info = NULL; attention_info = NULL;
return retval; return retval;
} }
/** /**
* get_power_status - get power status of a slot * get_power_status - get power status of a slot
...@@ -323,7 +323,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot, ...@@ -323,7 +323,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot,
if (retval) { if (retval) {
pr_err("pci_hp_register failed with error %d\n", retval); pr_err("pci_hp_register failed with error %d\n", retval);
goto error_hpslot; goto error_hpslot;
} }
pr_info("Slot [%s] registered\n", slot_name(slot)); pr_info("Slot [%s] registered\n", slot_name(slot));
......
...@@ -325,7 +325,7 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data, ...@@ -325,7 +325,7 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
list_add_tail(&slot->node, &bridge->slots); list_add_tail(&slot->node, &bridge->slots);
/* Register slots for ejectable funtions only. */ /* Register slots for ejectable functions only. */
if (acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle)) { if (acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle)) {
unsigned long long sun; unsigned long long sun;
int retval; int retval;
......
...@@ -116,7 +116,7 @@ static struct bin_attribute ibm_apci_table_attr = { ...@@ -116,7 +116,7 @@ static struct bin_attribute ibm_apci_table_attr = {
.read = ibm_read_apci_table, .read = ibm_read_apci_table,
.write = NULL, .write = NULL,
}; };
static struct acpiphp_attention_info ibm_attention_info = static struct acpiphp_attention_info ibm_attention_info =
{ {
.set_attn = ibm_set_attention_status, .set_attn = ibm_set_attention_status,
.get_attn = ibm_get_attention_status, .get_attn = ibm_get_attention_status,
...@@ -171,9 +171,9 @@ static union apci_descriptor *ibm_slot_from_id(int id) ...@@ -171,9 +171,9 @@ static union apci_descriptor *ibm_slot_from_id(int id)
*/ */
static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status) static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
{ {
union acpi_object args[2]; union acpi_object args[2];
struct acpi_object_list params = { .pointer = args, .count = 2 }; struct acpi_object_list params = { .pointer = args, .count = 2 };
acpi_status stat; acpi_status stat;
unsigned long long rc; unsigned long long rc;
union apci_descriptor *ibm_slot; union apci_descriptor *ibm_slot;
...@@ -208,7 +208,7 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status) ...@@ -208,7 +208,7 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
* *
* Description: This method is registered with the acpiphp module as a * Description: This method is registered with the acpiphp module as a
* callback to do the device specific task of getting the LED status. * callback to do the device specific task of getting the LED status.
* *
* Because there is no direct method of getting the LED status directly * Because there is no direct method of getting the LED status directly
* from an ACPI call, we read the aPCI table and parse out our * from an ACPI call, we read the aPCI table and parse out our
* slot descriptor to read the status from that. * slot descriptor to read the status from that.
...@@ -259,7 +259,7 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context) ...@@ -259,7 +259,7 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
pr_debug("%s: Received notification %02x\n", __func__, event); pr_debug("%s: Received notification %02x\n", __func__, event);
if (subevent == 0x80) { if (subevent == 0x80) {
pr_debug("%s: generationg bus event\n", __func__); pr_debug("%s: generating bus event\n", __func__);
acpi_bus_generate_netlink_event(note->device->pnp.device_class, acpi_bus_generate_netlink_event(note->device->pnp.device_class,
dev_name(&note->device->dev), dev_name(&note->device->dev),
note->event, detail); note->event, detail);
...@@ -387,7 +387,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle, ...@@ -387,7 +387,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
u32 lvl, void *context, void **rv) u32 lvl, void *context, void **rv)
{ {
acpi_handle *phandle = (acpi_handle *)context; acpi_handle *phandle = (acpi_handle *)context;
acpi_status status; acpi_status status;
struct acpi_device_info *info; struct acpi_device_info *info;
int retval = 0; int retval = 0;
...@@ -405,7 +405,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle, ...@@ -405,7 +405,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
info->hardware_id.string, handle); info->hardware_id.string, handle);
*phandle = handle; *phandle = handle;
/* returning non-zero causes the search to stop /* returning non-zero causes the search to stop
* and returns this value to the caller of * and returns this value to the caller of
* acpi_walk_namespace, but it also causes some warnings * acpi_walk_namespace, but it also causes some warnings
* in the acpi debug code to print... * in the acpi debug code to print...
*/ */
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
do { \ do { \
if (cpci_debug) \ if (cpci_debug) \
printk (KERN_DEBUG "%s: " format "\n", \ printk (KERN_DEBUG "%s: " format "\n", \
MY_NAME , ## arg); \ MY_NAME , ## arg); \
} while (0) } while (0)
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) #define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
......
...@@ -39,7 +39,7 @@ extern int cpci_debug; ...@@ -39,7 +39,7 @@ extern int cpci_debug;
do { \ do { \
if (cpci_debug) \ if (cpci_debug) \
printk (KERN_DEBUG "%s: " format "\n", \ printk (KERN_DEBUG "%s: " format "\n", \
MY_NAME , ## arg); \ MY_NAME , ## arg); \
} while (0) } while (0)
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) #define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
......
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
* option) any later version. * option) any later version.
* *
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
#define dbg(format, arg...) \ #define dbg(format, arg...) \
do { \ do { \
if(debug) \ if (debug) \
printk (KERN_DEBUG "%s: " format "\n", \ printk (KERN_DEBUG "%s: " format "\n", \
MY_NAME , ## arg); \ MY_NAME , ## arg); \
} while(0) } while(0)
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) #define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
......
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
* option) any later version. * option) any later version.
* *
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
#define dbg(format, arg...) \ #define dbg(format, arg...) \
do { \ do { \
if(debug) \ if (debug) \
printk (KERN_DEBUG "%s: " format "\n", \ printk (KERN_DEBUG "%s: " format "\n", \
MY_NAME , ## arg); \ MY_NAME , ## arg); \
} while(0) } while(0)
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) #define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
...@@ -285,7 +285,7 @@ static struct pci_device_id zt5550_hc_pci_tbl[] = { ...@@ -285,7 +285,7 @@ static struct pci_device_id zt5550_hc_pci_tbl[] = {
{ 0, } { 0, }
}; };
MODULE_DEVICE_TABLE(pci, zt5550_hc_pci_tbl); MODULE_DEVICE_TABLE(pci, zt5550_hc_pci_tbl);
static struct pci_driver zt5550_hc_driver = { static struct pci_driver zt5550_hc_driver = {
.name = "zt5550_hc", .name = "zt5550_hc",
.id_table = zt5550_hc_pci_tbl, .id_table = zt5550_hc_pci_tbl,
......
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
* option) any later version. * option) any later version.
* *
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
#define HC_CMD_REG 0x0C #define HC_CMD_REG 0x0C
#define ARB_CONFIG_GNT_REG 0x10 #define ARB_CONFIG_GNT_REG 0x10
#define ARB_CONFIG_CFG_REG 0x12 #define ARB_CONFIG_CFG_REG 0x12
#define ARB_CONFIG_REG 0x10 #define ARB_CONFIG_REG 0x10
#define ISOL_CONFIG_REG 0x18 #define ISOL_CONFIG_REG 0x18
#define FAULT_STATUS_REG 0x20 #define FAULT_STATUS_REG 0x20
#define FAULT_CONFIG_REG 0x24 #define FAULT_CONFIG_REG 0x24
......
...@@ -862,10 +862,10 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -862,10 +862,10 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_disable_device; goto err_disable_device;
} }
/* Check for the proper subsystem ID's /* Check for the proper subsystem IDs
* Intel uses a different SSID programming model than Compaq. * Intel uses a different SSID programming model than Compaq.
* For Intel, each SSID bit identifies a PHP capability. * For Intel, each SSID bit identifies a PHP capability.
* Also Intel HPC's may have RID=0. * Also Intel HPCs may have RID=0.
*/ */
if ((pdev->revision <= 2) && (vendor_id != PCI_VENDOR_ID_INTEL)) { if ((pdev->revision <= 2) && (vendor_id != PCI_VENDOR_ID_INTEL)) {
err(msg_HPC_not_supported); err(msg_HPC_not_supported);
......
...@@ -1231,7 +1231,7 @@ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_ ...@@ -1231,7 +1231,7 @@ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_
/* Only if mode change...*/ /* Only if mode change...*/
if (((bus->cur_bus_speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) || if (((bus->cur_bus_speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) ||
((bus->cur_bus_speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz))) ((bus->cur_bus_speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz)))
set_SOGO(ctrl); set_SOGO(ctrl);
wait_for_ctrl_irq(ctrl); wait_for_ctrl_irq(ctrl);
...@@ -1828,7 +1828,7 @@ static void interrupt_event_handler(struct controller *ctrl) ...@@ -1828,7 +1828,7 @@ static void interrupt_event_handler(struct controller *ctrl)
if (ctrl->event_queue[loop].event_type == INT_BUTTON_PRESS) { if (ctrl->event_queue[loop].event_type == INT_BUTTON_PRESS) {
dbg("button pressed\n"); dbg("button pressed\n");
} else if (ctrl->event_queue[loop].event_type == } else if (ctrl->event_queue[loop].event_type ==
INT_BUTTON_CANCEL) { INT_BUTTON_CANCEL) {
dbg("button cancel\n"); dbg("button cancel\n");
del_timer(&p_slot->task_event); del_timer(&p_slot->task_event);
...@@ -2411,11 +2411,11 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func ...@@ -2411,11 +2411,11 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func
if (rc) if (rc)
return rc; return rc;
/* find range of busses to use */ /* find range of buses to use */
dbg("find ranges of buses to use\n"); dbg("find ranges of buses to use\n");
bus_node = get_max_resource(&(resources->bus_head), 1); bus_node = get_max_resource(&(resources->bus_head), 1);
/* If we don't have any busses to allocate, we can't continue */ /* If we don't have any buses to allocate, we can't continue */
if (!bus_node) if (!bus_node)
return -ENOMEM; return -ENOMEM;
...@@ -2900,7 +2900,7 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func ...@@ -2900,7 +2900,7 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func
/* If this function needs an interrupt and we are behind /* If this function needs an interrupt and we are behind
* a bridge and the pin is tied to something that's * a bridge and the pin is tied to something that's
* alread mapped, set this one the same */ * already mapped, set this one the same */
if (temp_byte && resources->irqs && if (temp_byte && resources->irqs &&
(resources->irqs->valid_INT & (resources->irqs->valid_INT &
(0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) { (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) {
......
...@@ -291,7 +291,7 @@ int cpqhp_get_bus_dev (struct controller *ctrl, u8 * bus_num, u8 * dev_num, u8 s ...@@ -291,7 +291,7 @@ int cpqhp_get_bus_dev (struct controller *ctrl, u8 * bus_num, u8 * dev_num, u8 s
* *
* Reads configuration for all slots in a PCI bus and saves info. * Reads configuration for all slots in a PCI bus and saves info.
* *
* Note: For non-hot plug busses, the slot # saved is the device # * Note: For non-hot plug buses, the slot # saved is the device #
* *
* returns 0 if success * returns 0 if success
*/ */
...@@ -455,7 +455,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug) ...@@ -455,7 +455,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
* cpqhp_save_slot_config * cpqhp_save_slot_config
* *
* Saves configuration info for all PCI devices in a given slot * Saves configuration info for all PCI devices in a given slot
* including subordinate busses. * including subordinate buses.
* *
* returns 0 if success * returns 0 if success
*/ */
...@@ -1556,4 +1556,3 @@ void cpqhp_destroy_board_resources (struct pci_func * func) ...@@ -1556,4 +1556,3 @@ void cpqhp_destroy_board_resources (struct pci_func * func)
kfree(tres); kfree(tres);
} }
} }
...@@ -59,7 +59,7 @@ extern int ibmphp_debug; ...@@ -59,7 +59,7 @@ extern int ibmphp_debug;
/************************************************************ /************************************************************
* RESOURE TYPE * * RESOURCE TYPE *
************************************************************/ ************************************************************/
#define EBDA_RSRC_TYPE_MASK 0x03 #define EBDA_RSRC_TYPE_MASK 0x03
...@@ -103,7 +103,7 @@ extern int ibmphp_debug; ...@@ -103,7 +103,7 @@ extern int ibmphp_debug;
//-------------------------------------------------------------- //--------------------------------------------------------------
struct rio_table_hdr { struct rio_table_hdr {
u8 ver_num; u8 ver_num;
u8 scal_count; u8 scal_count;
u8 riodev_count; u8 riodev_count;
u16 offset; u16 offset;
...@@ -127,7 +127,7 @@ struct scal_detail { ...@@ -127,7 +127,7 @@ struct scal_detail {
}; };
//-------------------------------------------------------------- //--------------------------------------------------------------
// RIO DETAIL // RIO DETAIL
//-------------------------------------------------------------- //--------------------------------------------------------------
struct rio_detail { struct rio_detail {
...@@ -152,7 +152,7 @@ struct opt_rio { ...@@ -152,7 +152,7 @@ struct opt_rio {
u8 first_slot_num; u8 first_slot_num;
u8 middle_num; u8 middle_num;
struct list_head opt_rio_list; struct list_head opt_rio_list;
}; };
struct opt_rio_lo { struct opt_rio_lo {
u8 rio_type; u8 rio_type;
...@@ -161,7 +161,7 @@ struct opt_rio_lo { ...@@ -161,7 +161,7 @@ struct opt_rio_lo {
u8 middle_num; u8 middle_num;
u8 pack_count; u8 pack_count;
struct list_head opt_rio_lo_list; struct list_head opt_rio_lo_list;
}; };
/**************************************************************** /****************************************************************
* HPC DESCRIPTOR NODE * * HPC DESCRIPTOR NODE *
...@@ -574,7 +574,7 @@ void ibmphp_hpc_stop_poll_thread(void); ...@@ -574,7 +574,7 @@ void ibmphp_hpc_stop_poll_thread(void);
#define HPC_CTLR_IRQ_PENDG 0x80 #define HPC_CTLR_IRQ_PENDG 0x80
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// HPC_CTLR_WROKING status return codes // HPC_CTLR_WORKING status return codes
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#define HPC_CTLR_WORKING_NO 0x00 #define HPC_CTLR_WORKING_NO 0x00
#define HPC_CTLR_WORKING_YES 0x01 #define HPC_CTLR_WORKING_YES 0x01
......
This diff is collapsed.
This diff is collapsed.
...@@ -258,7 +258,7 @@ static u8 i2c_ctrl_write (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8 ...@@ -258,7 +258,7 @@ static u8 i2c_ctrl_write (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8
{ {
u8 rc; u8 rc;
void __iomem *wpg_addr; // base addr + offset void __iomem *wpg_addr; // base addr + offset
unsigned long wpg_data; // data to/from WPG LOHI format unsigned long wpg_data; // data to/from WPG LOHI format
unsigned long ultemp; unsigned long ultemp;
unsigned long data; // actual data HILO format unsigned long data; // actual data HILO format
int i; int i;
...@@ -351,7 +351,7 @@ static u8 i2c_ctrl_write (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8 ...@@ -351,7 +351,7 @@ static u8 i2c_ctrl_write (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8
} }
//------------------------------------------------------------ //------------------------------------------------------------
// Read from ISA type HPC // Read from ISA type HPC
//------------------------------------------------------------ //------------------------------------------------------------
static u8 isa_ctrl_read (struct controller *ctlr_ptr, u8 offset) static u8 isa_ctrl_read (struct controller *ctlr_ptr, u8 offset)
{ {
...@@ -372,7 +372,7 @@ static void isa_ctrl_write (struct controller *ctlr_ptr, u8 offset, u8 data) ...@@ -372,7 +372,7 @@ static void isa_ctrl_write (struct controller *ctlr_ptr, u8 offset, u8 data)
{ {
u16 start_address; u16 start_address;
u16 port_address; u16 port_address;
start_address = ctlr_ptr->u.isa_ctlr.io_start; start_address = ctlr_ptr->u.isa_ctlr.io_start;
port_address = start_address + (u16) offset; port_address = start_address + (u16) offset;
outb (data, port_address); outb (data, port_address);
...@@ -656,11 +656,11 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus) ...@@ -656,11 +656,11 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus)
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// cleanup // cleanup
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// remove physical to logical address mapping // remove physical to logical address mapping
if ((ctlr_ptr->ctlr_type == 2) || (ctlr_ptr->ctlr_type == 4)) if ((ctlr_ptr->ctlr_type == 2) || (ctlr_ptr->ctlr_type == 4))
iounmap (wpg_bbar); iounmap (wpg_bbar);
free_hpc_access (); free_hpc_access ();
debug_polling ("%s - Exit rc[%d]\n", __func__, rc); debug_polling ("%s - Exit rc[%d]\n", __func__, rc);
...@@ -835,7 +835,7 @@ static int poll_hpc(void *data) ...@@ -835,7 +835,7 @@ static int poll_hpc(void *data)
down (&semOperations); down (&semOperations);
switch (poll_state) { switch (poll_state) {
case POLL_LATCH_REGISTER: case POLL_LATCH_REGISTER:
oldlatchlow = curlatchlow; oldlatchlow = curlatchlow;
ctrl_count = 0x00; ctrl_count = 0x00;
list_for_each (pslotlist, &ibmphp_slot_head) { list_for_each (pslotlist, &ibmphp_slot_head) {
...@@ -892,16 +892,16 @@ static int poll_hpc(void *data) ...@@ -892,16 +892,16 @@ static int poll_hpc(void *data)
if (kthread_should_stop()) if (kthread_should_stop())
goto out_sleep; goto out_sleep;
down (&semOperations); down (&semOperations);
if (poll_count >= POLL_LATCH_CNT) { if (poll_count >= POLL_LATCH_CNT) {
poll_count = 0; poll_count = 0;
poll_state = POLL_SLOTS; poll_state = POLL_SLOTS;
} else } else
poll_state = POLL_LATCH_REGISTER; poll_state = POLL_LATCH_REGISTER;
break; break;
} }
/* give up the hardware semaphore */ /* give up the hardware semaphore */
up (&semOperations); up (&semOperations);
/* sleep for a short time just for good measure */ /* sleep for a short time just for good measure */
...@@ -958,7 +958,7 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot) ...@@ -958,7 +958,7 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot)
// bit 5 - HPC_SLOT_PWRGD // bit 5 - HPC_SLOT_PWRGD
if ((pslot->status & 0x20) != (poldslot->status & 0x20)) if ((pslot->status & 0x20) != (poldslot->status & 0x20))
// OFF -> ON: ignore, ON -> OFF: disable slot // OFF -> ON: ignore, ON -> OFF: disable slot
if ((poldslot->status & 0x20) && (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status))) if ((poldslot->status & 0x20) && (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status)))
disable = 1; disable = 1;
// bit 6 - HPC_SLOT_BUS_SPEED // bit 6 - HPC_SLOT_BUS_SPEED
...@@ -980,7 +980,7 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot) ...@@ -980,7 +980,7 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot)
pslot->status &= ~HPC_SLOT_POWER; pslot->status &= ~HPC_SLOT_POWER;
} }
} }
// CLOSE -> OPEN // CLOSE -> OPEN
else if ((SLOT_PWRGD (poldslot->status) == HPC_SLOT_PWRGD_GOOD) else if ((SLOT_PWRGD (poldslot->status) == HPC_SLOT_PWRGD_GOOD)
&& (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status))) { && (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status))) {
disable = 1; disable = 1;
...@@ -1075,7 +1075,7 @@ void __exit ibmphp_hpc_stop_poll_thread (void) ...@@ -1075,7 +1075,7 @@ void __exit ibmphp_hpc_stop_poll_thread (void)
debug ("before locking operations \n"); debug ("before locking operations \n");
ibmphp_lock_operations (); ibmphp_lock_operations ();
debug ("after locking operations \n"); debug ("after locking operations \n");
// wait for poll thread to exit // wait for poll thread to exit
debug ("before sem_exit down \n"); debug ("before sem_exit down \n");
down (&sem_exit); down (&sem_exit);
......
This diff is collapsed.
This diff is collapsed.
...@@ -131,7 +131,7 @@ static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf, ...@@ -131,7 +131,7 @@ static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf,
} }
module_put(slot->ops->owner); module_put(slot->ops->owner);
exit: exit:
if (retval) if (retval)
return retval; return retval;
return count; return count;
...@@ -177,7 +177,7 @@ static ssize_t attention_write_file(struct pci_slot *slot, const char *buf, ...@@ -177,7 +177,7 @@ static ssize_t attention_write_file(struct pci_slot *slot, const char *buf,
retval = ops->set_attention_status(slot->hotplug, attention); retval = ops->set_attention_status(slot->hotplug, attention);
module_put(ops->owner); module_put(ops->owner);
exit: exit:
if (retval) if (retval)
return retval; return retval;
return count; return count;
...@@ -247,7 +247,7 @@ static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf, ...@@ -247,7 +247,7 @@ static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf,
retval = slot->ops->hardware_test(slot, test); retval = slot->ops->hardware_test(slot, test);
module_put(slot->ops->owner); module_put(slot->ops->owner);
exit: exit:
if (retval) if (retval)
return retval; return retval;
return count; return count;
...@@ -512,7 +512,7 @@ int pci_hp_deregister(struct hotplug_slot *hotplug) ...@@ -512,7 +512,7 @@ int pci_hp_deregister(struct hotplug_slot *hotplug)
* @hotplug: pointer to the slot whose info has changed * @hotplug: pointer to the slot whose info has changed
* @info: pointer to the info copy into the slot's info structure * @info: pointer to the info copy into the slot's info structure
* *
* @slot must have been registered with the pci * @slot must have been registered with the pci
* hotplug subsystem previously with a call to pci_hp_register(). * hotplug subsystem previously with a call to pci_hp_register().
* *
* Returns 0 if successful, anything else for an error. * Returns 0 if successful, anything else for an error.
......
...@@ -180,5 +180,5 @@ static inline int pciehp_acpi_slot_detection_check(struct pci_dev *dev) ...@@ -180,5 +180,5 @@ static inline int pciehp_acpi_slot_detection_check(struct pci_dev *dev)
{ {
return 0; return 0;
} }
#endif /* CONFIG_ACPI */ #endif /* CONFIG_ACPI */
#endif /* _PCIEHP_H */ #endif /* _PCIEHP_H */
...@@ -78,7 +78,7 @@ static int __initdata dup_slot_id; ...@@ -78,7 +78,7 @@ static int __initdata dup_slot_id;
static int __initdata acpi_slot_detected; static int __initdata acpi_slot_detected;
static struct list_head __initdata dummy_slots = LIST_HEAD_INIT(dummy_slots); static struct list_head __initdata dummy_slots = LIST_HEAD_INIT(dummy_slots);
/* Dummy driver for dumplicate name detection */ /* Dummy driver for duplicate name detection */
static int __init dummy_probe(struct pcie_device *dev) static int __init dummy_probe(struct pcie_device *dev)
{ {
u32 slot_cap; u32 slot_cap;
......
...@@ -351,8 +351,8 @@ static int __init pcied_init(void) ...@@ -351,8 +351,8 @@ static int __init pcied_init(void)
pciehp_firmware_init(); pciehp_firmware_init();
retval = pcie_port_service_register(&hpdriver_portdrv); retval = pcie_port_service_register(&hpdriver_portdrv);
dbg("pcie_port_service_register = %d\n", retval); dbg("pcie_port_service_register = %d\n", retval);
info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
if (retval) if (retval)
dbg("Failure to register service\n"); dbg("Failure to register service\n");
......
...@@ -92,7 +92,7 @@ static void start_int_poll_timer(struct controller *ctrl, int sec) ...@@ -92,7 +92,7 @@ static void start_int_poll_timer(struct controller *ctrl, int sec)
{ {
/* Clamp to sane value */ /* Clamp to sane value */
if ((sec <= 0) || (sec > 60)) if ((sec <= 0) || (sec > 60))
sec = 2; sec = 2;
ctrl->poll_timer.function = &int_poll_timeout; ctrl->poll_timer.function = &int_poll_timeout;
ctrl->poll_timer.data = (unsigned long)ctrl; ctrl->poll_timer.data = (unsigned long)ctrl;
...@@ -194,7 +194,7 @@ static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask) ...@@ -194,7 +194,7 @@ static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
ctrl_dbg(ctrl, "CMD_COMPLETED not clear after 1 sec\n"); ctrl_dbg(ctrl, "CMD_COMPLETED not clear after 1 sec\n");
} else if (!NO_CMD_CMPL(ctrl)) { } else if (!NO_CMD_CMPL(ctrl)) {
/* /*
* This controller semms to notify of command completed * This controller seems to notify of command completed
* event even though it supports none of power * event even though it supports none of power
* controller, attention led, power led and EMI. * controller, attention led, power led and EMI.
*/ */
...@@ -926,7 +926,7 @@ struct controller *pcie_init(struct pcie_device *dev) ...@@ -926,7 +926,7 @@ struct controller *pcie_init(struct pcie_device *dev)
if (pciehp_writew(ctrl, PCI_EXP_SLTSTA, 0x1f)) if (pciehp_writew(ctrl, PCI_EXP_SLTSTA, 0x1f))
goto abort_ctrl; goto abort_ctrl;
/* Disable sotfware notification */ /* Disable software notification */
pcie_disable_notification(ctrl); pcie_disable_notification(ctrl);
ctrl_info(ctrl, "HPC vendor_id %x device_id %x ss_vid %x ss_did %x\n", ctrl_info(ctrl, "HPC vendor_id %x device_id %x ss_vid %x ss_did %x\n",
......
...@@ -52,7 +52,7 @@ static LIST_HEAD(slot_list); ...@@ -52,7 +52,7 @@ static LIST_HEAD(slot_list);
do { \ do { \
if (debug) \ if (debug) \
printk (KERN_DEBUG "%s: " format "\n", \ printk (KERN_DEBUG "%s: " format "\n", \
MY_NAME , ## arg); \ MY_NAME , ## arg); \
} while (0) } while (0)
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) #define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
...@@ -287,7 +287,7 @@ static int __init init_slots(void) ...@@ -287,7 +287,7 @@ static int __init init_slots(void)
hotplug_slot->release = &release_slot; hotplug_slot->release = &release_slot;
make_slot_name(slot); make_slot_name(slot);
hotplug_slot->ops = &skel_hotplug_slot_ops; hotplug_slot->ops = &skel_hotplug_slot_ops;
/* /*
* Initialize the slot info structure with some known * Initialize the slot info structure with some known
* good values. * good values.
...@@ -296,7 +296,7 @@ static int __init init_slots(void) ...@@ -296,7 +296,7 @@ static int __init init_slots(void)
get_attention_status(hotplug_slot, &info->attention_status); get_attention_status(hotplug_slot, &info->attention_status);
get_latch_status(hotplug_slot, &info->latch_status); get_latch_status(hotplug_slot, &info->latch_status);
get_adapter_status(hotplug_slot, &info->adapter_status); get_adapter_status(hotplug_slot, &info->adapter_status);
dbg("registering slot %d\n", i); dbg("registering slot %d\n", i);
retval = pci_hp_register(slot->hotplug_slot); retval = pci_hp_register(slot->hotplug_slot);
if (retval) { if (retval) {
...@@ -336,7 +336,7 @@ static void __exit cleanup_slots(void) ...@@ -336,7 +336,7 @@ static void __exit cleanup_slots(void)
pci_hp_deregister(slot->hotplug_slot); pci_hp_deregister(slot->hotplug_slot);
} }
} }
static int __init pcihp_skel_init(void) static int __init pcihp_skel_init(void)
{ {
int retval; int retval;
......
...@@ -217,7 +217,7 @@ static int dlpar_remove_phb(char *drc_name, struct device_node *dn) ...@@ -217,7 +217,7 @@ static int dlpar_remove_phb(char *drc_name, struct device_node *dn)
if (!pcibios_find_pci_bus(dn)) if (!pcibios_find_pci_bus(dn))
return -EINVAL; return -EINVAL;
/* If pci slot is hotplugable, use hotplug to remove it */ /* If pci slot is hotpluggable, use hotplug to remove it */
slot = find_php_slot(dn); slot = find_php_slot(dn);
if (slot && rpaphp_deregister_slot(slot)) { if (slot && rpaphp_deregister_slot(slot)) {
printk(KERN_ERR "%s: unable to remove hotplug slot %s\n", printk(KERN_ERR "%s: unable to remove hotplug slot %s\n",
......
...@@ -49,9 +49,9 @@ ...@@ -49,9 +49,9 @@
extern bool rpaphp_debug; extern bool rpaphp_debug;
#define dbg(format, arg...) \ #define dbg(format, arg...) \
do { \ do { \
if (rpaphp_debug) \ if (rpaphp_debug) \
printk(KERN_DEBUG "%s: " format, \ printk(KERN_DEBUG "%s: " format, \
MY_NAME , ## arg); \ MY_NAME , ## arg); \
} while (0) } while (0)
#define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME , ## arg) #define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg) #define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
...@@ -99,5 +99,5 @@ void dealloc_slot_struct(struct slot *slot); ...@@ -99,5 +99,5 @@ void dealloc_slot_struct(struct slot *slot);
struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain); struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
int rpaphp_register_slot(struct slot *slot); int rpaphp_register_slot(struct slot *slot);
int rpaphp_deregister_slot(struct slot *slot); int rpaphp_deregister_slot(struct slot *slot);
#endif /* _PPC64PHP_H */ #endif /* _PPC64PHP_H */
...@@ -226,7 +226,7 @@ int rpaphp_get_drc_props(struct device_node *dn, int *drc_index, ...@@ -226,7 +226,7 @@ int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
for (i = 0; i < indexes[0]; i++) { for (i = 0; i < indexes[0]; i++) {
if ((unsigned int) indexes[i + 1] == *my_index) { if ((unsigned int) indexes[i + 1] == *my_index) {
if (drc_name) if (drc_name)
*drc_name = name_tmp; *drc_name = name_tmp;
if (drc_type) if (drc_type)
*drc_type = type_tmp; *drc_type = type_tmp;
if (drc_index) if (drc_index)
...@@ -289,7 +289,7 @@ static int is_php_dn(struct device_node *dn, const int **indexes, ...@@ -289,7 +289,7 @@ static int is_php_dn(struct device_node *dn, const int **indexes,
* rpaphp_add_slot -- declare a hotplug slot to the hotplug subsystem. * rpaphp_add_slot -- declare a hotplug slot to the hotplug subsystem.
* @dn: device node of slot * @dn: device node of slot
* *
* This subroutine will register a hotplugable slot with the * This subroutine will register a hotpluggable slot with the
* PCI hotplug infrastructure. This routine is typically called * PCI hotplug infrastructure. This routine is typically called
* during boot time, if the hotplug slots are present at boot time, * during boot time, if the hotplug slots are present at boot time,
* or is called later, by the dlpar add code, if the slot is * or is called later, by the dlpar add code, if the slot is
...@@ -328,7 +328,7 @@ int rpaphp_add_slot(struct device_node *dn) ...@@ -328,7 +328,7 @@ int rpaphp_add_slot(struct device_node *dn)
return -ENOMEM; return -ENOMEM;
slot->type = simple_strtoul(type, NULL, 10); slot->type = simple_strtoul(type, NULL, 10);
dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n", dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n",
indexes[i + 1], name, type); indexes[i + 1], name, type);
...@@ -356,7 +356,7 @@ static void __exit cleanup_slots(void) ...@@ -356,7 +356,7 @@ static void __exit cleanup_slots(void)
/* /*
* Unregister all of our slots with the pci_hotplug subsystem, * Unregister all of our slots with the pci_hotplug subsystem,
* and free up all memory that we had allocated. * and free up all memory that we had allocated.
* memory will be freed in release_slot callback. * memory will be freed in release_slot callback.
*/ */
list_for_each_safe(tmp, n, &rpaphp_slot_head) { list_for_each_safe(tmp, n, &rpaphp_slot_head) {
......
...@@ -44,7 +44,7 @@ int rpaphp_get_sensor_state(struct slot *slot, int *state) ...@@ -44,7 +44,7 @@ int rpaphp_get_sensor_state(struct slot *slot, int *state)
dbg("%s: slot must be power up to get sensor-state\n", dbg("%s: slot must be power up to get sensor-state\n",
__func__); __func__);
/* some slots have to be powered up /* some slots have to be powered up
* before get-sensor will succeed. * before get-sensor will succeed.
*/ */
rc = rtas_set_power_level(slot->power_domain, POWER_ON, rc = rtas_set_power_level(slot->power_domain, POWER_ON,
...@@ -133,4 +133,3 @@ int rpaphp_enable_slot(struct slot *slot) ...@@ -133,4 +133,3 @@ int rpaphp_enable_slot(struct slot *slot)
return 0; return 0;
} }
/* /*
* RPA Virtual I/O device functions * RPA Virtual I/O device functions
* Copyright (C) 2004 Linda Xie <lxie@us.ibm.com> * Copyright (C) 2004 Linda Xie <lxie@us.ibm.com>
* *
* All rights reserved. * All rights reserved.
...@@ -51,27 +51,27 @@ struct slot *alloc_slot_struct(struct device_node *dn, ...@@ -51,27 +51,27 @@ struct slot *alloc_slot_struct(struct device_node *dn,
int drc_index, char *drc_name, int power_domain) int drc_index, char *drc_name, int power_domain)
{ {
struct slot *slot; struct slot *slot;
slot = kzalloc(sizeof(struct slot), GFP_KERNEL); slot = kzalloc(sizeof(struct slot), GFP_KERNEL);
if (!slot) if (!slot)
goto error_nomem; goto error_nomem;
slot->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL); slot->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
if (!slot->hotplug_slot) if (!slot->hotplug_slot)
goto error_slot; goto error_slot;
slot->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info), slot->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info),
GFP_KERNEL); GFP_KERNEL);
if (!slot->hotplug_slot->info) if (!slot->hotplug_slot->info)
goto error_hpslot; goto error_hpslot;
slot->name = kstrdup(drc_name, GFP_KERNEL); slot->name = kstrdup(drc_name, GFP_KERNEL);
if (!slot->name) if (!slot->name)
goto error_info; goto error_info;
slot->dn = dn; slot->dn = dn;
slot->index = drc_index; slot->index = drc_index;
slot->power_domain = power_domain; slot->power_domain = power_domain;
slot->hotplug_slot->private = slot; slot->hotplug_slot->private = slot;
slot->hotplug_slot->ops = &rpaphp_hotplug_slot_ops; slot->hotplug_slot->ops = &rpaphp_hotplug_slot_ops;
slot->hotplug_slot->release = &rpaphp_release_slot; slot->hotplug_slot->release = &rpaphp_release_slot;
return (slot); return (slot);
error_info: error_info:
...@@ -91,7 +91,7 @@ static int is_registered(struct slot *slot) ...@@ -91,7 +91,7 @@ static int is_registered(struct slot *slot)
list_for_each_entry(tmp_slot, &rpaphp_slot_head, rpaphp_slot_list) { list_for_each_entry(tmp_slot, &rpaphp_slot_head, rpaphp_slot_list) {
if (!strcmp(tmp_slot->name, slot->name)) if (!strcmp(tmp_slot->name, slot->name))
return 1; return 1;
} }
return 0; return 0;
} }
...@@ -104,7 +104,7 @@ int rpaphp_deregister_slot(struct slot *slot) ...@@ -104,7 +104,7 @@ int rpaphp_deregister_slot(struct slot *slot)
__func__, slot->name); __func__, slot->name);
list_del(&slot->rpaphp_slot_list); list_del(&slot->rpaphp_slot_list);
retval = pci_hp_deregister(php_slot); retval = pci_hp_deregister(php_slot);
if (retval) if (retval)
err("Problem unregistering a slot %s\n", slot->name); err("Problem unregistering a slot %s\n", slot->name);
...@@ -120,7 +120,7 @@ int rpaphp_register_slot(struct slot *slot) ...@@ -120,7 +120,7 @@ int rpaphp_register_slot(struct slot *slot)
int retval; int retval;
int slotno; int slotno;
dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n", dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n",
__func__, slot->dn->full_name, slot->index, slot->name, __func__, slot->dn->full_name, slot->index, slot->name,
slot->power_domain, slot->type); slot->power_domain, slot->type);
...@@ -128,7 +128,7 @@ int rpaphp_register_slot(struct slot *slot) ...@@ -128,7 +128,7 @@ int rpaphp_register_slot(struct slot *slot)
if (is_registered(slot)) { if (is_registered(slot)) {
err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name); err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name);
return -EAGAIN; return -EAGAIN;
} }
if (slot->dn->child) if (slot->dn->child)
slotno = PCI_SLOT(PCI_DN(slot->dn->child)->devfn); slotno = PCI_SLOT(PCI_DN(slot->dn->child)->devfn);
...@@ -145,4 +145,3 @@ int rpaphp_register_slot(struct slot *slot) ...@@ -145,4 +145,3 @@ int rpaphp_register_slot(struct slot *slot)
info("Slot [%s] registered\n", slot->name); info("Slot [%s] registered\n", slot->name);
return 0; return 0;
} }
...@@ -216,13 +216,13 @@ struct ctrl_reg { ...@@ -216,13 +216,13 @@ struct ctrl_reg {
/* offsets to the controller registers based on the above structure layout */ /* offsets to the controller registers based on the above structure layout */
enum ctrl_offsets { enum ctrl_offsets {
BASE_OFFSET = offsetof(struct ctrl_reg, base_offset), BASE_OFFSET = offsetof(struct ctrl_reg, base_offset),
SLOT_AVAIL1 = offsetof(struct ctrl_reg, slot_avail1), SLOT_AVAIL1 = offsetof(struct ctrl_reg, slot_avail1),
SLOT_AVAIL2 = offsetof(struct ctrl_reg, slot_avail2), SLOT_AVAIL2 = offsetof(struct ctrl_reg, slot_avail2),
SLOT_CONFIG = offsetof(struct ctrl_reg, slot_config), SLOT_CONFIG = offsetof(struct ctrl_reg, slot_config),
SEC_BUS_CONFIG = offsetof(struct ctrl_reg, sec_bus_config), SEC_BUS_CONFIG = offsetof(struct ctrl_reg, sec_bus_config),
MSI_CTRL = offsetof(struct ctrl_reg, msi_ctrl), MSI_CTRL = offsetof(struct ctrl_reg, msi_ctrl),
PROG_INTERFACE = offsetof(struct ctrl_reg, prog_interface), PROG_INTERFACE = offsetof(struct ctrl_reg, prog_interface),
CMD = offsetof(struct ctrl_reg, cmd), CMD = offsetof(struct ctrl_reg, cmd),
CMD_STATUS = offsetof(struct ctrl_reg, cmd_status), CMD_STATUS = offsetof(struct ctrl_reg, cmd_status),
INTR_LOC = offsetof(struct ctrl_reg, intr_loc), INTR_LOC = offsetof(struct ctrl_reg, intr_loc),
......
...@@ -143,11 +143,11 @@ static int init_slots(struct controller *ctrl) ...@@ -143,11 +143,11 @@ static int init_slots(struct controller *ctrl)
snprintf(name, SLOT_NAME_SIZE, "%d", slot->number); snprintf(name, SLOT_NAME_SIZE, "%d", slot->number);
hotplug_slot->ops = &shpchp_hotplug_slot_ops; hotplug_slot->ops = &shpchp_hotplug_slot_ops;
ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:%02x " ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:%02x "
"hp_slot=%x sun=%x slot_device_offset=%x\n", "hp_slot=%x sun=%x slot_device_offset=%x\n",
pci_domain_nr(ctrl->pci_dev->subordinate), pci_domain_nr(ctrl->pci_dev->subordinate),
slot->bus, slot->device, slot->hp_slot, slot->number, slot->bus, slot->device, slot->hp_slot, slot->number,
ctrl->slot_device_offset); ctrl->slot_device_offset);
retval = pci_hp_register(slot->hotplug_slot, retval = pci_hp_register(slot->hotplug_slot,
ctrl->pci_dev->subordinate, slot->device, name); ctrl->pci_dev->subordinate, slot->device, name);
if (retval) { if (retval) {
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
#define SLOT_REG_RSVDZ_MASK ((1 << 15) | (7 << 21)) #define SLOT_REG_RSVDZ_MASK ((1 << 15) | (7 << 21))
/* /*
* SHPC Command Code definitnions * SHPC Command Code definitions
* *
* Slot Operation 00h - 3Fh * Slot Operation 00h - 3Fh
* Set Bus Segment Speed/Mode A 40h - 47h * Set Bus Segment Speed/Mode A 40h - 47h
......
...@@ -610,7 +610,7 @@ resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno) ...@@ -610,7 +610,7 @@ resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno)
struct resource tmp; struct resource tmp;
enum pci_bar_type type; enum pci_bar_type type;
int reg = pci_iov_resource_bar(dev, resno, &type); int reg = pci_iov_resource_bar(dev, resno, &type);
if (!reg) if (!reg)
return 0; return 0;
......
...@@ -25,7 +25,7 @@ static void pci_note_irq_problem(struct pci_dev *pdev, const char *reason) ...@@ -25,7 +25,7 @@ static void pci_note_irq_problem(struct pci_dev *pdev, const char *reason)
/** /**
* pci_lost_interrupt - reports a lost PCI interrupt * pci_lost_interrupt - reports a lost PCI interrupt
* @pdev: device whose interrupt is lost * @pdev: device whose interrupt is lost
* *
* The primary function of this routine is to report a lost interrupt * The primary function of this routine is to report a lost interrupt
* in a standard way which users can recognise (instead of blaming the * in a standard way which users can recognise (instead of blaming the
* driver). * driver).
......
...@@ -784,7 +784,7 @@ static int msix_capability_init(struct pci_dev *dev, ...@@ -784,7 +784,7 @@ static int msix_capability_init(struct pci_dev *dev,
* @nvec: how many MSIs have been requested ? * @nvec: how many MSIs have been requested ?
* @type: are we checking for MSI or MSI-X ? * @type: are we checking for MSI or MSI-X ?
* *
* Look at global flags, the device itself, and its parent busses * Look at global flags, the device itself, and its parent buses
* to determine if MSI/-X are supported for the device. If MSI/-X is * to determine if MSI/-X are supported for the device. If MSI/-X is
* supported return 0, else return an error code. * supported return 0, else return an error code.
**/ **/
......
...@@ -141,7 +141,7 @@ phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle) ...@@ -141,7 +141,7 @@ phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle)
* if (_PRW at S-state x) * if (_PRW at S-state x)
* choose from highest power _SxD to lowest power _SxW * choose from highest power _SxD to lowest power _SxW
* else // no _PRW at S-state x * else // no _PRW at S-state x
* choose highest power _SxD or any lower power * choose highest power _SxD or any lower power
*/ */
static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev) static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev)
......
...@@ -312,7 +312,7 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev, ...@@ -312,7 +312,7 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
* __pci_device_probe - check if a driver wants to claim a specific PCI device * __pci_device_probe - check if a driver wants to claim a specific PCI device
* @drv: driver to call to check if it wants the PCI device * @drv: driver to call to check if it wants the PCI device
* @pci_dev: PCI device being probed * @pci_dev: PCI device being probed
* *
* returns 0 on success, else error. * returns 0 on success, else error.
* side-effect: pci_dev->driver is set to drv when drv claims pci_dev. * side-effect: pci_dev->driver is set to drv when drv claims pci_dev.
*/ */
...@@ -378,7 +378,7 @@ static int pci_device_remove(struct device * dev) ...@@ -378,7 +378,7 @@ static int pci_device_remove(struct device * dev)
* We would love to complain here if pci_dev->is_enabled is set, that * We would love to complain here if pci_dev->is_enabled is set, that
* the driver should have called pci_disable_device(), but the * the driver should have called pci_disable_device(), but the
* unfortunate fact is there are too many odd BIOS and bridge setups * unfortunate fact is there are too many odd BIOS and bridge setups
* that don't like drivers doing that all of the time. * that don't like drivers doing that all of the time.
* Oh well, we can dream of sane hardware when we sleep, no matter how * Oh well, we can dream of sane hardware when we sleep, no matter how
* horrible the crap we have to deal with is when we are awake... * horrible the crap we have to deal with is when we are awake...
*/ */
...@@ -1156,10 +1156,10 @@ static const struct dev_pm_ops pci_dev_pm_ops = { ...@@ -1156,10 +1156,10 @@ static const struct dev_pm_ops pci_dev_pm_ops = {
* @drv: the driver structure to register * @drv: the driver structure to register
* @owner: owner module of drv * @owner: owner module of drv
* @mod_name: module name string * @mod_name: module name string
* *
* Adds the driver structure to the list of registered drivers. * Adds the driver structure to the list of registered drivers.
* Returns a negative value on error, otherwise 0. * Returns a negative value on error, otherwise 0.
* If no error occurred, the driver remains registered even if * If no error occurred, the driver remains registered even if
* no device was claimed during registration. * no device was claimed during registration.
*/ */
int __pci_register_driver(struct pci_driver *drv, struct module *owner, int __pci_register_driver(struct pci_driver *drv, struct module *owner,
...@@ -1181,7 +1181,7 @@ int __pci_register_driver(struct pci_driver *drv, struct module *owner, ...@@ -1181,7 +1181,7 @@ int __pci_register_driver(struct pci_driver *drv, struct module *owner,
/** /**
* pci_unregister_driver - unregister a pci driver * pci_unregister_driver - unregister a pci driver
* @drv: the driver structure to unregister * @drv: the driver structure to unregister
* *
* Deletes the driver structure from the list of registered PCI drivers, * Deletes the driver structure from the list of registered PCI drivers,
* gives it a chance to clean up by calling its remove() function for * gives it a chance to clean up by calling its remove() function for
* each device it was responsible for, and marks those devices as * each device it was responsible for, and marks those devices as
...@@ -1203,7 +1203,7 @@ static struct pci_driver pci_compat_driver = { ...@@ -1203,7 +1203,7 @@ static struct pci_driver pci_compat_driver = {
* pci_dev_driver - get the pci_driver of a device * pci_dev_driver - get the pci_driver of a device
* @dev: the device to query * @dev: the device to query
* *
* Returns the appropriate pci_driver structure or %NULL if there is no * Returns the appropriate pci_driver structure or %NULL if there is no
* registered driver for the device. * registered driver for the device.
*/ */
struct pci_driver * struct pci_driver *
...@@ -1224,7 +1224,7 @@ pci_dev_driver(const struct pci_dev *dev) ...@@ -1224,7 +1224,7 @@ pci_dev_driver(const struct pci_dev *dev)
* pci_bus_match - Tell if a PCI device structure has a matching PCI device id structure * pci_bus_match - Tell if a PCI device structure has a matching PCI device id structure
* @dev: the PCI device structure to match against * @dev: the PCI device structure to match against
* @drv: the device driver to search for matching PCI device id structures * @drv: the device driver to search for matching PCI device id structures
* *
* Used by a driver to check whether a PCI device present in the * Used by a driver to check whether a PCI device present in the
* system is in its list of supported devices. Returns the matching * system is in its list of supported devices. Returns the matching
* pci_device_id structure or %NULL if there is no match. * pci_device_id structure or %NULL if there is no match.
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
* *
* Copyright (C) 2008 Red Hat, Inc. * Copyright (C) 2008 Red Hat, Inc.
* Author: * Author:
* Chris Wright * Chris Wright
* *
* This work is licensed under the terms of the GNU GPL, version 2. * This work is licensed under the terms of the GNU GPL, version 2.
* *
* Usage is simple, allocate a new id to the stub driver and bind the * Usage is simple, allocate a new id to the stub driver and bind the
* device to it. For example: * device to it. For example:
* *
* # echo "8086 10f5" > /sys/bus/pci/drivers/pci-stub/new_id * # echo "8086 10f5" > /sys/bus/pci/drivers/pci-stub/new_id
* # echo -n 0000:00:19.0 > /sys/bus/pci/drivers/e1000e/unbind * # echo -n 0000:00:19.0 > /sys/bus/pci/drivers/e1000e/unbind
* # echo -n 0000:00:19.0 > /sys/bus/pci/drivers/pci-stub/bind * # echo -n 0000:00:19.0 > /sys/bus/pci/drivers/pci-stub/bind
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* File attributes for PCI devices * File attributes for PCI devices
* *
* Modeled after usb's driverfs.c * Modeled after usb's driverfs.c
* *
*/ */
...@@ -270,13 +270,17 @@ msi_bus_store(struct device *dev, struct device_attribute *attr, ...@@ -270,13 +270,17 @@ msi_bus_store(struct device *dev, struct device_attribute *attr,
if (kstrtoul(buf, 0, &val) < 0) if (kstrtoul(buf, 0, &val) < 0)
return -EINVAL; return -EINVAL;
/* bad things may happen if the no_msi flag is changed /*
* while some drivers are loaded */ * Bad things may happen if the no_msi flag is changed
* while drivers are loaded.
*/
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
/* Maybe pci devices without subordinate busses shouldn't even have this /*
* attribute in the first place? */ * Maybe devices without subordinate buses shouldn't have this
* attribute in the first place?
*/
if (!pdev->subordinate) if (!pdev->subordinate)
return count; return count;
...@@ -670,7 +674,7 @@ pci_write_config(struct file* filp, struct kobject *kobj, ...@@ -670,7 +674,7 @@ pci_write_config(struct file* filp, struct kobject *kobj,
size = dev->cfg_size - off; size = dev->cfg_size - off;
count = size; count = size;
} }
pci_config_pm_runtime_get(dev); pci_config_pm_runtime_get(dev);
if ((off & 1) && size) { if ((off & 1) && size) {
...@@ -678,7 +682,7 @@ pci_write_config(struct file* filp, struct kobject *kobj, ...@@ -678,7 +682,7 @@ pci_write_config(struct file* filp, struct kobject *kobj,
off++; off++;
size--; size--;
} }
if ((off & 3) && size > 2) { if ((off & 3) && size > 2) {
u16 val = data[off - init_off]; u16 val = data[off - init_off];
val |= (u16) data[off - init_off + 1] << 8; val |= (u16) data[off - init_off + 1] << 8;
...@@ -696,7 +700,7 @@ pci_write_config(struct file* filp, struct kobject *kobj, ...@@ -696,7 +700,7 @@ pci_write_config(struct file* filp, struct kobject *kobj,
off += 4; off += 4;
size -= 4; size -= 4;
} }
if (size >= 2) { if (size >= 2) {
u16 val = data[off - init_off]; u16 val = data[off - init_off];
val |= (u16) data[off - init_off + 1] << 8; val |= (u16) data[off - init_off + 1] << 8;
...@@ -1229,21 +1233,21 @@ pci_read_rom(struct file *filp, struct kobject *kobj, ...@@ -1229,21 +1233,21 @@ pci_read_rom(struct file *filp, struct kobject *kobj,
if (!pdev->rom_attr_enabled) if (!pdev->rom_attr_enabled)
return -EINVAL; return -EINVAL;
rom = pci_map_rom(pdev, &size); /* size starts out as PCI window size */ rom = pci_map_rom(pdev, &size); /* size starts out as PCI window size */
if (!rom || !size) if (!rom || !size)
return -EIO; return -EIO;
if (off >= size) if (off >= size)
count = 0; count = 0;
else { else {
if (off + count > size) if (off + count > size)
count = size - off; count = size - off;
memcpy_fromio(buf, rom + off, count); memcpy_fromio(buf, rom + off, count);
} }
pci_unmap_rom(pdev, rom); pci_unmap_rom(pdev, rom);
return count; return count;
} }
......
...@@ -198,7 +198,7 @@ static int __pci_bus_find_cap_start(struct pci_bus *bus, ...@@ -198,7 +198,7 @@ static int __pci_bus_find_cap_start(struct pci_bus *bus,
} }
/** /**
* pci_find_capability - query for devices' capabilities * pci_find_capability - query for devices' capabilities
* @dev: PCI device to query * @dev: PCI device to query
* @cap: capability code * @cap: capability code
* *
...@@ -207,12 +207,12 @@ static int __pci_bus_find_cap_start(struct pci_bus *bus, ...@@ -207,12 +207,12 @@ static int __pci_bus_find_cap_start(struct pci_bus *bus,
* device's PCI configuration space or 0 in case the device does not * device's PCI configuration space or 0 in case the device does not
* support it. Possible values for @cap: * support it. Possible values for @cap:
* *
* %PCI_CAP_ID_PM Power Management * %PCI_CAP_ID_PM Power Management
* %PCI_CAP_ID_AGP Accelerated Graphics Port * %PCI_CAP_ID_AGP Accelerated Graphics Port
* %PCI_CAP_ID_VPD Vital Product Data * %PCI_CAP_ID_VPD Vital Product Data
* %PCI_CAP_ID_SLOTID Slot Identification * %PCI_CAP_ID_SLOTID Slot Identification
* %PCI_CAP_ID_MSI Message Signalled Interrupts * %PCI_CAP_ID_MSI Message Signalled Interrupts
* %PCI_CAP_ID_CHSWP CompactPCI HotSwap * %PCI_CAP_ID_CHSWP CompactPCI HotSwap
* %PCI_CAP_ID_PCIX PCI-X * %PCI_CAP_ID_PCIX PCI-X
* %PCI_CAP_ID_EXP PCI Express * %PCI_CAP_ID_EXP PCI Express
*/ */
...@@ -228,13 +228,13 @@ int pci_find_capability(struct pci_dev *dev, int cap) ...@@ -228,13 +228,13 @@ int pci_find_capability(struct pci_dev *dev, int cap)
} }
/** /**
* pci_bus_find_capability - query for devices' capabilities * pci_bus_find_capability - query for devices' capabilities
* @bus: the PCI bus to query * @bus: the PCI bus to query
* @devfn: PCI device to query * @devfn: PCI device to query
* @cap: capability code * @cap: capability code
* *
* Like pci_find_capability() but works for pci devices that do not have a * Like pci_find_capability() but works for pci devices that do not have a
* pci_dev structure set up yet. * pci_dev structure set up yet.
* *
* Returns the address of the requested capability structure within the * Returns the address of the requested capability structure within the
* device's PCI configuration space or 0 in case the device does not * device's PCI configuration space or 0 in case the device does not
...@@ -515,7 +515,7 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state) ...@@ -515,7 +515,7 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state)
return -EINVAL; return -EINVAL;
/* Validate current state: /* Validate current state:
* Can enter D0 from any state, but if we can only go deeper * Can enter D0 from any state, but if we can only go deeper
* to sleep if we're already in a low power state * to sleep if we're already in a low power state
*/ */
if (state != PCI_D0 && dev->current_state <= PCI_D3cold if (state != PCI_D0 && dev->current_state <= PCI_D3cold
...@@ -998,7 +998,7 @@ static void pci_restore_config_space(struct pci_dev *pdev) ...@@ -998,7 +998,7 @@ static void pci_restore_config_space(struct pci_dev *pdev)
} }
} }
/** /**
* pci_restore_state - Restore the saved state of a PCI device * pci_restore_state - Restore the saved state of a PCI device
* @dev: - PCI device that we're dealing with * @dev: - PCI device that we're dealing with
*/ */
...@@ -1030,7 +1030,7 @@ struct pci_saved_state { ...@@ -1030,7 +1030,7 @@ struct pci_saved_state {
* the device saved state. * the device saved state.
* @dev: PCI device that we're dealing with * @dev: PCI device that we're dealing with
* *
* Rerturn NULL if no state or error. * Return NULL if no state or error.
*/ */
struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev) struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev)
{ {
...@@ -1880,7 +1880,7 @@ int pci_finish_runtime_suspend(struct pci_dev *dev) ...@@ -1880,7 +1880,7 @@ int pci_finish_runtime_suspend(struct pci_dev *dev)
* pci_dev_run_wake - Check if device can generate run-time wake-up events. * pci_dev_run_wake - Check if device can generate run-time wake-up events.
* @dev: Device to check. * @dev: Device to check.
* *
* Return true if the device itself is cabable of generating wake-up events * Return true if the device itself is capable of generating wake-up events
* (through the platform or using the native PCIe PME) or if the device supports * (through the platform or using the native PCIe PME) or if the device supports
* PME and one of its upstream bridges can generate wake-up events. * PME and one of its upstream bridges can generate wake-up events.
*/ */
...@@ -2447,7 +2447,7 @@ bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags) ...@@ -2447,7 +2447,7 @@ bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags)
switch (pci_pcie_type(pdev)) { switch (pci_pcie_type(pdev)) {
/* /*
* PCI/X-to-PCIe bridges are not specifically mentioned by the spec, * PCI/X-to-PCIe bridges are not specifically mentioned by the spec,
* but since their primary inteface is PCI/X, we conservatively * but since their primary interface is PCI/X, we conservatively
* handle them as we would a non-PCIe device. * handle them as we would a non-PCIe device.
*/ */
case PCI_EXP_TYPE_PCIE_BRIDGE: case PCI_EXP_TYPE_PCIE_BRIDGE:
...@@ -2471,7 +2471,7 @@ bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags) ...@@ -2471,7 +2471,7 @@ bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags)
/* /*
* PCIe 3.0, 6.12.1.2 specifies ACS capabilities that should be * PCIe 3.0, 6.12.1.2 specifies ACS capabilities that should be
* implemented by the remaining PCIe types to indicate peer-to-peer * implemented by the remaining PCIe types to indicate peer-to-peer
* capabilities, but only when they are part of a multifunciton * capabilities, but only when they are part of a multifunction
* device. The footnote for section 6.12 indicates the specific * device. The footnote for section 6.12 indicates the specific
* PCIe types included here. * PCIe types included here.
*/ */
...@@ -2486,7 +2486,7 @@ bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags) ...@@ -2486,7 +2486,7 @@ bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags)
} }
/* /*
* PCIe 3.0, 6.12.1.3 specifies no ACS capabilties are applicable * PCIe 3.0, 6.12.1.3 specifies no ACS capabilities are applicable
* to single function devices with the exception of downstream ports. * to single function devices with the exception of downstream ports.
*/ */
return true; return true;
...@@ -2622,7 +2622,7 @@ void pci_release_region(struct pci_dev *pdev, int bar) ...@@ -2622,7 +2622,7 @@ void pci_release_region(struct pci_dev *pdev, int bar)
* *
* If @exclusive is set, then the region is marked so that userspace * If @exclusive is set, then the region is marked so that userspace
* is explicitly not allowed to map the resource via /dev/mem or * is explicitly not allowed to map the resource via /dev/mem or
* sysfs MMIO access. * sysfs MMIO access.
* *
* Returns 0 on success, or %EBUSY on error. A warning * Returns 0 on success, or %EBUSY on error. A warning
* message is also printed on failure. * message is also printed on failure.
...@@ -2634,7 +2634,7 @@ static int __pci_request_region(struct pci_dev *pdev, int bar, const char *res_n ...@@ -2634,7 +2634,7 @@ static int __pci_request_region(struct pci_dev *pdev, int bar, const char *res_n
if (pci_resource_len(pdev, bar) == 0) if (pci_resource_len(pdev, bar) == 0)
return 0; return 0;
if (pci_resource_flags(pdev, bar) & IORESOURCE_IO) { if (pci_resource_flags(pdev, bar) & IORESOURCE_IO) {
if (!request_region(pci_resource_start(pdev, bar), if (!request_region(pci_resource_start(pdev, bar),
pci_resource_len(pdev, bar), res_name)) pci_resource_len(pdev, bar), res_name))
...@@ -2694,7 +2694,7 @@ int pci_request_region(struct pci_dev *pdev, int bar, const char *res_name) ...@@ -2694,7 +2694,7 @@ int pci_request_region(struct pci_dev *pdev, int bar, const char *res_name)
* *
* The key difference that _exclusive makes it that userspace is * The key difference that _exclusive makes it that userspace is
* explicitly not allowed to map the resource via /dev/mem or * explicitly not allowed to map the resource via /dev/mem or
* sysfs. * sysfs.
*/ */
int pci_request_region_exclusive(struct pci_dev *pdev, int bar, const char *res_name) int pci_request_region_exclusive(struct pci_dev *pdev, int bar, const char *res_name)
{ {
...@@ -2799,7 +2799,7 @@ int pci_request_regions(struct pci_dev *pdev, const char *res_name) ...@@ -2799,7 +2799,7 @@ int pci_request_regions(struct pci_dev *pdev, const char *res_name)
* successfully. * successfully.
* *
* pci_request_regions_exclusive() will mark the region so that * pci_request_regions_exclusive() will mark the region so that
* /dev/mem and the sysfs MMIO access will not be allowed. * /dev/mem and the sysfs MMIO access will not be allowed.
* *
* Returns 0 on success, or %EBUSY on error. A warning * Returns 0 on success, or %EBUSY on error. A warning
* message is also printed on failure. * message is also printed on failure.
...@@ -2967,7 +2967,7 @@ pci_set_mwi(struct pci_dev *dev) ...@@ -2967,7 +2967,7 @@ pci_set_mwi(struct pci_dev *dev)
cmd |= PCI_COMMAND_INVALIDATE; cmd |= PCI_COMMAND_INVALIDATE;
pci_write_config_word(dev, PCI_COMMAND, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd);
} }
return 0; return 0;
} }
...@@ -3292,7 +3292,7 @@ static int pci_af_flr(struct pci_dev *dev, int probe) ...@@ -3292,7 +3292,7 @@ static int pci_af_flr(struct pci_dev *dev, int probe)
* *
* NOTE: This causes the caller to sleep for twice the device power transition * NOTE: This causes the caller to sleep for twice the device power transition
* cooldown period, which for the D0->D3hot and D3hot->D0 transitions is 10 ms * cooldown period, which for the D0->D3hot and D3hot->D0 transitions is 10 ms
* by devault (i.e. unless the @dev's d3_delay field has a different value). * by default (i.e. unless the @dev's d3_delay field has a different value).
* Moreover, only devices in D0 can be reset by this function. * Moreover, only devices in D0 can be reset by this function.
*/ */
static int pci_pm_reset(struct pci_dev *dev, int probe) static int pci_pm_reset(struct pci_dev *dev, int probe)
...@@ -3341,7 +3341,7 @@ void pci_reset_bridge_secondary_bus(struct pci_dev *dev) ...@@ -3341,7 +3341,7 @@ void pci_reset_bridge_secondary_bus(struct pci_dev *dev)
pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl); pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl);
/* /*
* PCI spec v3.0 7.6.4.2 requires minimum Trst of 1ms. Double * PCI spec v3.0 7.6.4.2 requires minimum Trst of 1ms. Double
* this to 2ms to ensure that we meet the minium requirement. * this to 2ms to ensure that we meet the minimum requirement.
*/ */
msleep(2); msleep(2);
...@@ -3998,7 +3998,7 @@ int pcie_set_mps(struct pci_dev *dev, int mps) ...@@ -3998,7 +3998,7 @@ int pcie_set_mps(struct pci_dev *dev, int mps)
return -EINVAL; return -EINVAL;
v = ffs(mps) - 8; v = ffs(mps) - 8;
if (v > dev->pcie_mpss) if (v > dev->pcie_mpss)
return -EINVAL; return -EINVAL;
v <<= 5; v <<= 5;
......
...@@ -525,7 +525,7 @@ static void handle_error_source(struct pcie_device *aerdev, ...@@ -525,7 +525,7 @@ static void handle_error_source(struct pcie_device *aerdev,
if (info->severity == AER_CORRECTABLE) { if (info->severity == AER_CORRECTABLE) {
/* /*
* Correctable error does not need software intevention. * Correctable error does not need software intervention.
* No need to go through error recovery process. * No need to go through error recovery process.
*/ */
pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
......
...@@ -548,7 +548,7 @@ static struct pcie_link_state *alloc_pcie_link_state(struct pci_dev *pdev) ...@@ -548,7 +548,7 @@ static struct pcie_link_state *alloc_pcie_link_state(struct pci_dev *pdev)
/* /*
* pcie_aspm_init_link_state: Initiate PCI express link state. * pcie_aspm_init_link_state: Initiate PCI express link state.
* It is called after the pcie and its children devices are scaned. * It is called after the pcie and its children devices are scanned.
* @pdev: the root port or switch downstream port * @pdev: the root port or switch downstream port
*/ */
void pcie_aspm_init_link_state(struct pci_dev *pdev) void pcie_aspm_init_link_state(struct pci_dev *pdev)
......
...@@ -419,8 +419,8 @@ static void pcie_pme_remove(struct pcie_device *srv) ...@@ -419,8 +419,8 @@ static void pcie_pme_remove(struct pcie_device *srv)
static struct pcie_port_service_driver pcie_pme_driver = { static struct pcie_port_service_driver pcie_pme_driver = {
.name = "pcie_pme", .name = "pcie_pme",
.port_type = PCI_EXP_TYPE_ROOT_PORT, .port_type = PCI_EXP_TYPE_ROOT_PORT,
.service = PCIE_PORT_SERVICE_PME, .service = PCIE_PORT_SERVICE_PME,
.probe = pcie_pme_probe, .probe = pcie_pme_probe,
.suspend = pcie_pme_suspend, .suspend = pcie_pme_suspend,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define PCIE_PORT_DEVICE_MAXSERVICES 4 #define PCIE_PORT_DEVICE_MAXSERVICES 4
/* /*
* According to the PCI Express Base Specification 2.0, the indices of * According to the PCI Express Base Specification 2.0, the indices of
* the MSI-X table entires used by port services must not exceed 31 * the MSI-X table entries used by port services must not exceed 31
*/ */
#define PCIE_PORT_MAX_MSIX_ENTRIES 32 #define PCIE_PORT_MAX_MSIX_ENTRIES 32
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
static int pcie_port_bus_match(struct device *dev, struct device_driver *drv); static int pcie_port_bus_match(struct device *dev, struct device_driver *drv);
struct bus_type pcie_port_bus_type = { struct bus_type pcie_port_bus_type = {
.name = "pci_express", .name = "pci_express",
.match = pcie_port_bus_match, .match = pcie_port_bus_match,
}; };
EXPORT_SYMBOL_GPL(pcie_port_bus_type); EXPORT_SYMBOL_GPL(pcie_port_bus_type);
......
...@@ -46,7 +46,7 @@ static void release_pcie_device(struct device *dev) ...@@ -46,7 +46,7 @@ static void release_pcie_device(struct device *dev)
* pcie_port_msix_add_entry - add entry to given array of MSI-X entries * pcie_port_msix_add_entry - add entry to given array of MSI-X entries
* @entries: Array of MSI-X entries * @entries: Array of MSI-X entries
* @new_entry: Index of the entry to add to the array * @new_entry: Index of the entry to add to the array
* @nr_entries: Number of entries aleady in the array * @nr_entries: Number of entries already in the array
* *
* Return value: Position of the added entry in the array * Return value: Position of the added entry in the array
*/ */
......
...@@ -223,7 +223,6 @@ static int pcie_portdrv_probe(struct pci_dev *dev, ...@@ -223,7 +223,6 @@ static int pcie_portdrv_probe(struct pci_dev *dev,
static void pcie_portdrv_remove(struct pci_dev *dev) static void pcie_portdrv_remove(struct pci_dev *dev)
{ {
pcie_port_device_remove(dev); pcie_port_device_remove(dev);
pci_disable_device(dev);
} }
static int error_detected_iter(struct device *device, void *data) static int error_detected_iter(struct device *device, void *data)
...@@ -390,9 +389,9 @@ static struct pci_driver pcie_portdriver = { ...@@ -390,9 +389,9 @@ static struct pci_driver pcie_portdriver = {
.probe = pcie_portdrv_probe, .probe = pcie_portdrv_probe,
.remove = pcie_portdrv_remove, .remove = pcie_portdrv_remove,
.err_handler = &pcie_portdrv_err_handler, .err_handler = &pcie_portdrv_err_handler,
.driver.pm = PCIE_PORTDRV_PM_OPS, .driver.pm = PCIE_PORTDRV_PM_OPS,
}; };
static int __init dmi_pcie_pme_disable_msi(const struct dmi_system_id *d) static int __init dmi_pcie_pme_disable_msi(const struct dmi_system_id *d)
...@@ -412,7 +411,7 @@ static struct dmi_system_id __initdata pcie_portdrv_dmi_table[] = { ...@@ -412,7 +411,7 @@ static struct dmi_system_id __initdata pcie_portdrv_dmi_table[] = {
.ident = "MSI Wind U-100", .ident = "MSI Wind U-100",
.matches = { .matches = {
DMI_MATCH(DMI_SYS_VENDOR, DMI_MATCH(DMI_SYS_VENDOR,
"MICRO-STAR INTERNATIONAL CO., LTD"), "MICRO-STAR INTERNATIONAL CO., LTD"),
DMI_MATCH(DMI_PRODUCT_NAME, "U-100"), DMI_MATCH(DMI_PRODUCT_NAME, "U-100"),
}, },
}, },
......
...@@ -582,7 +582,7 @@ static enum pci_bus_speed agp_speed(int agp3, int agpstat) ...@@ -582,7 +582,7 @@ static enum pci_bus_speed agp_speed(int agp3, int agpstat)
index = 1; index = 1;
else else
goto out; goto out;
if (agp3) { if (agp3) {
index += 2; index += 2;
if (index == 5) if (index == 5)
...@@ -789,7 +789,7 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) ...@@ -789,7 +789,7 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
} }
/* Disable MasterAbortMode during probing to avoid reporting /* Disable MasterAbortMode during probing to avoid reporting
of bus errors (in some architectures) */ of bus errors (in some architectures) */
pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &bctl); pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &bctl);
pci_write_config_word(dev, PCI_BRIDGE_CONTROL, pci_write_config_word(dev, PCI_BRIDGE_CONTROL,
bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT); bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT);
...@@ -1005,7 +1005,7 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev) ...@@ -1005,7 +1005,7 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev)
* pci_setup_device - fill in class and map information of a device * pci_setup_device - fill in class and map information of a device
* @dev: the device structure to fill * @dev: the device structure to fill
* *
* Initialize the device structure with information about the device's * Initialize the device structure with information about the device's
* vendor,class,memory and IO-space addresses,IRQ lines etc. * vendor,class,memory and IO-space addresses,IRQ lines etc.
* Called at initialisation of the PCI subsystem and by CardBus services. * Called at initialisation of the PCI subsystem and by CardBus services.
* Returns 0 on success and negative if unknown type of device (not normal, * Returns 0 on success and negative if unknown type of device (not normal,
...@@ -1111,7 +1111,7 @@ int pci_setup_device(struct pci_dev *dev) ...@@ -1111,7 +1111,7 @@ int pci_setup_device(struct pci_dev *dev)
goto bad; goto bad;
/* The PCI-to-PCI bridge spec requires that subtractive /* The PCI-to-PCI bridge spec requires that subtractive
decoding (i.e. transparent) bridge must have programming decoding (i.e. transparent) bridge must have programming
interface code of 0x01. */ interface code of 0x01. */
pci_read_irq(dev); pci_read_irq(dev);
dev->transparent = ((dev->class & 0xff) == 1); dev->transparent = ((dev->class & 0xff) == 1);
pci_read_bases(dev, 2, PCI_ROM_ADDRESS1); pci_read_bases(dev, 2, PCI_ROM_ADDRESS1);
...@@ -1570,7 +1570,7 @@ static void pcie_write_mrrs(struct pci_dev *dev) ...@@ -1570,7 +1570,7 @@ static void pcie_write_mrrs(struct pci_dev *dev)
* subsequent read will verify if the value is acceptable or not. * subsequent read will verify if the value is acceptable or not.
* If the MRRS value provided is not acceptable (e.g., too large), * If the MRRS value provided is not acceptable (e.g., too large),
* shrink the value until it is acceptable to the HW. * shrink the value until it is acceptable to the HW.
*/ */
while (mrrs != pcie_get_readrq(dev) && mrrs >= 128) { while (mrrs != pcie_get_readrq(dev) && mrrs >= 128) {
rc = pcie_set_readrq(dev, mrrs); rc = pcie_set_readrq(dev, mrrs);
if (!rc) if (!rc)
......
...@@ -222,7 +222,7 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, ...@@ -222,7 +222,7 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd,
default: default:
ret = -EINVAL; ret = -EINVAL;
break; break;
}; }
return ret; return ret;
} }
......
This diff is collapsed.
...@@ -7,7 +7,7 @@ static void pci_free_resources(struct pci_dev *dev) ...@@ -7,7 +7,7 @@ static void pci_free_resources(struct pci_dev *dev)
{ {
int i; int i;
msi_remove_pci_irq_vectors(dev); msi_remove_pci_irq_vectors(dev);
pci_cleanup_rom(dev); pci_cleanup_rom(dev);
for (i = 0; i < PCI_NUM_RESOURCES; i++) { for (i = 0; i < PCI_NUM_RESOURCES; i++) {
......
/* /*
* PCI searching functions. * PCI searching functions.
* *
* Copyright (C) 1993 -- 1997 Drew Eckhardt, Frederic Potter, * Copyright (C) 1993 -- 1997 Drew Eckhardt, Frederic Potter,
* David Mosberger-Tang * David Mosberger-Tang
...@@ -96,12 +96,12 @@ struct pci_bus * pci_find_bus(int domain, int busnr) ...@@ -96,12 +96,12 @@ struct pci_bus * pci_find_bus(int domain, int busnr)
* pci_find_next_bus - begin or continue searching for a PCI bus * pci_find_next_bus - begin or continue searching for a PCI bus
* @from: Previous PCI bus found, or %NULL for new search. * @from: Previous PCI bus found, or %NULL for new search.
* *
* Iterates through the list of known PCI busses. A new search is * Iterates through the list of known PCI buses. A new search is
* initiated by passing %NULL as the @from argument. Otherwise if * initiated by passing %NULL as the @from argument. Otherwise if
* @from is not %NULL, searches continue from next device on the * @from is not %NULL, searches continue from next device on the
* global list. * global list.
*/ */
struct pci_bus * struct pci_bus *
pci_find_next_bus(const struct pci_bus *from) pci_find_next_bus(const struct pci_bus *from)
{ {
struct list_head *n; struct list_head *n;
...@@ -119,11 +119,11 @@ pci_find_next_bus(const struct pci_bus *from) ...@@ -119,11 +119,11 @@ pci_find_next_bus(const struct pci_bus *from)
/** /**
* pci_get_slot - locate PCI device for a given PCI slot * pci_get_slot - locate PCI device for a given PCI slot
* @bus: PCI bus on which desired PCI device resides * @bus: PCI bus on which desired PCI device resides
* @devfn: encodes number of PCI slot in which the desired PCI * @devfn: encodes number of PCI slot in which the desired PCI
* device resides and the logical device number within that slot * device resides and the logical device number within that slot
* in case of multi-function devices. * in case of multi-function devices.
* *
* Given a PCI bus and slot/function number, the desired PCI device * Given a PCI bus and slot/function number, the desired PCI device
* is located in the list of PCI devices. * is located in the list of PCI devices.
* If the device is found, its reference count is increased and this * If the device is found, its reference count is increased and this
* function returns a pointer to its data structure. The caller must * function returns a pointer to its data structure. The caller must
......
...@@ -292,8 +292,8 @@ static void assign_requested_resources_sorted(struct list_head *head, ...@@ -292,8 +292,8 @@ static void assign_requested_resources_sorted(struct list_head *head,
(!(res->flags & IORESOURCE_ROM_ENABLE)))) (!(res->flags & IORESOURCE_ROM_ENABLE))))
add_to_list(fail_head, add_to_list(fail_head,
dev_res->dev, res, dev_res->dev, res,
0 /* dont care */, 0 /* don't care */,
0 /* dont care */); 0 /* don't care */);
} }
reset_resource(res); reset_resource(res);
} }
...@@ -667,9 +667,9 @@ static void pci_bridge_check_ranges(struct pci_bus *bus) ...@@ -667,9 +667,9 @@ static void pci_bridge_check_ranges(struct pci_bus *bus)
if (!io) { if (!io) {
pci_write_config_word(bridge, PCI_IO_BASE, 0xf0f0); pci_write_config_word(bridge, PCI_IO_BASE, 0xf0f0);
pci_read_config_word(bridge, PCI_IO_BASE, &io); pci_read_config_word(bridge, PCI_IO_BASE, &io);
pci_write_config_word(bridge, PCI_IO_BASE, 0x0); pci_write_config_word(bridge, PCI_IO_BASE, 0x0);
} }
if (io) if (io)
b_res[0].flags |= IORESOURCE_IO; b_res[0].flags |= IORESOURCE_IO;
/* DECchip 21050 pass 2 errata: the bridge may miss an address /* DECchip 21050 pass 2 errata: the bridge may miss an address
disconnect boundary by one PCI data phase. disconnect boundary by one PCI data phase.
...@@ -819,7 +819,7 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size, ...@@ -819,7 +819,7 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
resource_size_t min_align, align; resource_size_t min_align, align;
if (!b_res) if (!b_res)
return; return;
min_align = window_alignment(bus, IORESOURCE_IO); min_align = window_alignment(bus, IORESOURCE_IO);
list_for_each_entry(dev, &bus->devices, bus_list) { list_for_each_entry(dev, &bus->devices, bus_list) {
...@@ -950,7 +950,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, ...@@ -950,7 +950,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
if (realloc_head && i >= PCI_IOV_RESOURCES && if (realloc_head && i >= PCI_IOV_RESOURCES &&
i <= PCI_IOV_RESOURCE_END) { i <= PCI_IOV_RESOURCE_END) {
r->end = r->start - 1; r->end = r->start - 1;
add_to_list(realloc_head, dev, r, r_size, 0/* dont' care */); add_to_list(realloc_head, dev, r, r_size, 0/* don't care */);
children_add_size += r_size; children_add_size += r_size;
continue; continue;
} }
...@@ -1456,8 +1456,8 @@ static enum enable_type pci_realloc_detect(struct pci_bus *bus, ...@@ -1456,8 +1456,8 @@ static enum enable_type pci_realloc_detect(struct pci_bus *bus,
/* /*
* first try will not touch pci bridge res * first try will not touch pci bridge res
* second and later try will clear small leaf bridge res * second and later try will clear small leaf bridge res
* will stop till to the max deepth if can not find good one * will stop till to the max depth if can not find good one
*/ */
void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus) void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
{ {
......
...@@ -159,7 +159,7 @@ resource_size_t __weak pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx) ...@@ -159,7 +159,7 @@ resource_size_t __weak pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx)
return 0; return 0;
} }
static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev, static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
int resno, resource_size_t size) int resno, resource_size_t size)
{ {
struct resource *root, *conflict; struct resource *root, *conflict;
......
...@@ -53,7 +53,7 @@ static ssize_t address_read_file(struct pci_slot *slot, char *buf) ...@@ -53,7 +53,7 @@ static ssize_t address_read_file(struct pci_slot *slot, char *buf)
static const char *pci_bus_speed_strings[] = { static const char *pci_bus_speed_strings[] = {
"33 MHz PCI", /* 0x00 */ "33 MHz PCI", /* 0x00 */
"66 MHz PCI", /* 0x01 */ "66 MHz PCI", /* 0x01 */
"66 MHz PCI-X", /* 0x02 */ "66 MHz PCI-X", /* 0x02 */
"100 MHz PCI-X", /* 0x03 */ "100 MHz PCI-X", /* 0x03 */
"133 MHz PCI-X", /* 0x04 */ "133 MHz PCI-X", /* 0x04 */
NULL, /* 0x05 */ NULL, /* 0x05 */
......
...@@ -44,7 +44,7 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn, ...@@ -44,7 +44,7 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn,
default: default:
err = -EINVAL; err = -EINVAL;
goto error; goto error;
}; }
err = -EIO; err = -EIO;
if (cfg_ret != PCIBIOS_SUCCESSFUL) if (cfg_ret != PCIBIOS_SUCCESSFUL)
......
...@@ -26,11 +26,11 @@ struct msi_desc { ...@@ -26,11 +26,11 @@ struct msi_desc {
struct { struct {
__u8 is_msix : 1; __u8 is_msix : 1;
__u8 multiple: 3; /* log2 number of messages */ __u8 multiple: 3; /* log2 number of messages */
__u8 maskbit : 1; /* mask-pending bit supported ? */ __u8 maskbit : 1; /* mask-pending bit supported ? */
__u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */
__u8 pos; /* Location of the msi capability */ __u8 pos; /* Location of the msi capability */
__u16 entry_nr; /* specific enabled entry */ __u16 entry_nr; /* specific enabled entry */
unsigned default_irq; /* default pre-assigned irq */ unsigned default_irq; /* default pre-assigned irq */
} msi_attrib; } msi_attrib;
u32 masked; /* mask bits */ u32 masked; /* mask bits */
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <linux/irqreturn.h> #include <linux/irqreturn.h>
#include <uapi/linux/pci.h> #include <uapi/linux/pci.h>
/* Include the ID list */
#include <linux/pci_ids.h> #include <linux/pci_ids.h>
/* /*
...@@ -42,9 +41,10 @@ ...@@ -42,9 +41,10 @@
* *
* 7:3 = slot * 7:3 = slot
* 2:0 = function * 2:0 = function
* PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined uapi/linux/pci.h *
* PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined in uapi/linux/pci.h.
* In the interest of not exposing interfaces to user-space unnecessarily, * In the interest of not exposing interfaces to user-space unnecessarily,
* the following kernel only defines are being added here. * the following kernel-only defines are being added here.
*/ */
#define PCI_DEVID(bus, devfn) ((((u16)bus) << 8) | devfn) #define PCI_DEVID(bus, devfn) ((((u16)bus) << 8) | devfn)
/* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */ /* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */
...@@ -153,10 +153,10 @@ enum pcie_reset_state { ...@@ -153,10 +153,10 @@ enum pcie_reset_state {
/* Reset is NOT asserted (Use to deassert reset) */ /* Reset is NOT asserted (Use to deassert reset) */
pcie_deassert_reset = (__force pcie_reset_state_t) 1, pcie_deassert_reset = (__force pcie_reset_state_t) 1,
/* Use #PERST to reset PCI-E device */ /* Use #PERST to reset PCIe device */
pcie_warm_reset = (__force pcie_reset_state_t) 2, pcie_warm_reset = (__force pcie_reset_state_t) 2,
/* Use PCI-E Hot Reset to reset device */ /* Use PCIe Hot Reset to reset device */
pcie_hot_reset = (__force pcie_reset_state_t) 3 pcie_hot_reset = (__force pcie_reset_state_t) 3
}; };
...@@ -259,13 +259,13 @@ struct pci_dev { ...@@ -259,13 +259,13 @@ struct pci_dev {
unsigned int class; /* 3 bytes: (base,sub,prog-if) */ unsigned int class; /* 3 bytes: (base,sub,prog-if) */
u8 revision; /* PCI revision, low byte of class word */ u8 revision; /* PCI revision, low byte of class word */
u8 hdr_type; /* PCI header type (`multi' flag masked out) */ u8 hdr_type; /* PCI header type (`multi' flag masked out) */
u8 pcie_cap; /* PCI-E capability offset */ u8 pcie_cap; /* PCIe capability offset */
u8 msi_cap; /* MSI capability offset */ u8 msi_cap; /* MSI capability offset */
u8 msix_cap; /* MSI-X capability offset */ u8 msix_cap; /* MSI-X capability offset */
u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ u8 pcie_mpss:3; /* PCIe Max Payload Size Supported */
u8 rom_base_reg; /* which config register controls the ROM */ u8 rom_base_reg; /* which config register controls the ROM */
u8 pin; /* which interrupt pin this device uses */ u8 pin; /* which interrupt pin this device uses */
u16 pcie_flags_reg; /* cached PCI-E Capabilities Register */ u16 pcie_flags_reg; /* cached PCIe Capabilities Register */
struct pci_driver *driver; /* which driver has allocated this device */ struct pci_driver *driver; /* which driver has allocated this device */
u64 dma_mask; /* Mask of the bits of bus address this u64 dma_mask; /* Mask of the bits of bus address this
...@@ -300,7 +300,7 @@ struct pci_dev { ...@@ -300,7 +300,7 @@ struct pci_dev {
unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */
#ifdef CONFIG_PCIEASPM #ifdef CONFIG_PCIEASPM
struct pcie_link_state *link_state; /* ASPM link state. */ struct pcie_link_state *link_state; /* ASPM link state */
#endif #endif
pci_channel_state_t error_state; /* current connectivity state */ pci_channel_state_t error_state; /* current connectivity state */
...@@ -317,7 +317,7 @@ struct pci_dev { ...@@ -317,7 +317,7 @@ struct pci_dev {
bool match_driver; /* Skip attaching driver */ bool match_driver; /* Skip attaching driver */
/* These fields are used by common fixups */ /* These fields are used by common fixups */
unsigned int transparent:1; /* Transparent PCI bridge */ unsigned int transparent:1; /* Subtractive decode PCI bridge */
unsigned int multifunction:1;/* Part of multi-function device */ unsigned int multifunction:1;/* Part of multi-function device */
/* keep track of device state */ /* keep track of device state */
unsigned int is_added:1; unsigned int is_added:1;
...@@ -326,7 +326,7 @@ struct pci_dev { ...@@ -326,7 +326,7 @@ struct pci_dev {
unsigned int block_cfg_access:1; /* config space access is blocked */ unsigned int block_cfg_access:1; /* config space access is blocked */
unsigned int broken_parity_status:1; /* Device generates false positive parity */ unsigned int broken_parity_status:1; /* Device generates false positive parity */
unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */
unsigned int msi_enabled:1; unsigned int msi_enabled:1;
unsigned int msix_enabled:1; unsigned int msix_enabled:1;
unsigned int ari_enabled:1; /* ARI forwarding */ unsigned int ari_enabled:1; /* ARI forwarding */
unsigned int is_managed:1; unsigned int is_managed:1;
...@@ -371,7 +371,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) ...@@ -371,7 +371,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
if (dev->is_virtfn) if (dev->is_virtfn)
dev = dev->physfn; dev = dev->physfn;
#endif #endif
return dev; return dev;
} }
...@@ -456,7 +455,7 @@ struct pci_bus { ...@@ -456,7 +455,7 @@ struct pci_bus {
char name[48]; char name[48];
unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */
pci_bus_flags_t bus_flags; /* Inherited by child busses */ pci_bus_flags_t bus_flags; /* inherited by child buses */
struct device *bridge; struct device *bridge;
struct device dev; struct device dev;
struct bin_attribute *legacy_io; /* legacy I/O for this bus */ struct bin_attribute *legacy_io; /* legacy I/O for this bus */
...@@ -468,7 +467,7 @@ struct pci_bus { ...@@ -468,7 +467,7 @@ struct pci_bus {
#define to_pci_bus(n) container_of(n, struct pci_bus, dev) #define to_pci_bus(n) container_of(n, struct pci_bus, dev)
/* /*
* Returns true if the pci bus is root (behind host-pci bridge), * Returns true if the PCI bus is root (behind host-PCI bridge),
* false otherwise * false otherwise
* *
* Some code assumes that "bus->self == NULL" means that bus is a root bus. * Some code assumes that "bus->self == NULL" means that bus is a root bus.
...@@ -510,7 +509,7 @@ static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { return false; ...@@ -510,7 +509,7 @@ static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { return false;
#define PCIBIOS_BUFFER_TOO_SMALL 0x89 #define PCIBIOS_BUFFER_TOO_SMALL 0x89
/* /*
* Translate above to generic errno for passing back through non-pci. * Translate above to generic errno for passing back through non-PCI code.
*/ */
static inline int pcibios_err_to_errno(int err) static inline int pcibios_err_to_errno(int err)
{ {
...@@ -561,11 +560,12 @@ struct pci_dynids { ...@@ -561,11 +560,12 @@ struct pci_dynids {
struct list_head list; /* for IDs added at runtime */ struct list_head list; /* for IDs added at runtime */
}; };
/* ---------------------------------------------------------------- */
/** PCI Error Recovery System (PCI-ERS). If a PCI device driver provides /*
* a set of callbacks in struct pci_error_handlers, then that device driver * PCI Error Recovery System (PCI-ERS). If a PCI device driver provides
* will be notified of PCI bus errors, and will be driven to recovery * a set of callbacks in struct pci_error_handlers, that device driver
* when an error occurs. * will be notified of PCI bus errors, and will be driven to recovery
* when an error occurs.
*/ */
typedef unsigned int __bitwise pci_ers_result_t; typedef unsigned int __bitwise pci_ers_result_t;
...@@ -609,7 +609,6 @@ struct pci_error_handlers { ...@@ -609,7 +609,6 @@ struct pci_error_handlers {
void (*resume)(struct pci_dev *dev); void (*resume)(struct pci_dev *dev);
}; };
/* ---------------------------------------------------------------- */
struct module; struct module;
struct pci_driver { struct pci_driver {
...@@ -713,10 +712,10 @@ extern enum pcie_bus_config_types pcie_bus_config; ...@@ -713,10 +712,10 @@ extern enum pcie_bus_config_types pcie_bus_config;
extern struct bus_type pci_bus_type; extern struct bus_type pci_bus_type;
/* Do NOT directly access these two variables, unless you are arch specific pci /* Do NOT directly access these two variables, unless you are arch-specific PCI
* code, or pci core code. */ * code, or PCI core code. */
extern struct list_head pci_root_buses; /* list of all known PCI buses */ extern struct list_head pci_root_buses; /* list of all known PCI buses */
/* Some device drivers need know if pci is initiated */ /* Some device drivers need know if PCI is initiated */
int no_pci_devices(void); int no_pci_devices(void);
void pcibios_resource_survey_bus(struct pci_bus *bus); void pcibios_resource_survey_bus(struct pci_bus *bus);
...@@ -724,7 +723,7 @@ void pcibios_add_bus(struct pci_bus *bus); ...@@ -724,7 +723,7 @@ void pcibios_add_bus(struct pci_bus *bus);
void pcibios_remove_bus(struct pci_bus *bus); void pcibios_remove_bus(struct pci_bus *bus);
void pcibios_fixup_bus(struct pci_bus *); void pcibios_fixup_bus(struct pci_bus *);
int __must_check pcibios_enable_device(struct pci_dev *, int mask); int __must_check pcibios_enable_device(struct pci_dev *, int mask);
/* Architecture specific versions may override this (weak) */ /* Architecture-specific versions may override this (weak) */
char *pcibios_setup(char *str); char *pcibios_setup(char *str);
/* Used only when drivers/pci/setup.c is used */ /* Used only when drivers/pci/setup.c is used */
...@@ -1258,7 +1257,7 @@ void pci_cfg_access_unlock(struct pci_dev *dev); ...@@ -1258,7 +1257,7 @@ void pci_cfg_access_unlock(struct pci_dev *dev);
/* /*
* PCI domain support. Sometimes called PCI segment (eg by ACPI), * PCI domain support. Sometimes called PCI segment (eg by ACPI),
* a PCI domain is defined to be a set of PCI busses which share * a PCI domain is defined to be a set of PCI buses which share
* configuration space. * configuration space.
*/ */
#ifdef CONFIG_PCI_DOMAINS #ifdef CONFIG_PCI_DOMAINS
...@@ -1672,7 +1671,7 @@ extern u8 pci_cache_line_size; ...@@ -1672,7 +1671,7 @@ extern u8 pci_cache_line_size;
extern unsigned long pci_hotplug_io_size; extern unsigned long pci_hotplug_io_size;
extern unsigned long pci_hotplug_mem_size; extern unsigned long pci_hotplug_mem_size;
/* Architecture specific versions may override these (weak) */ /* Architecture-specific versions may override these (weak) */
int pcibios_add_platform_entries(struct pci_dev *dev); int pcibios_add_platform_entries(struct pci_dev *dev);
void pcibios_disable_device(struct pci_dev *dev); void pcibios_disable_device(struct pci_dev *dev);
void pcibios_set_master(struct pci_dev *dev); void pcibios_set_master(struct pci_dev *dev);
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
* @hardware_test: Called to run a specified hardware test on the specified * @hardware_test: Called to run a specified hardware test on the specified
* slot. * slot.
* @get_power_status: Called to get the current power status of a slot. * @get_power_status: Called to get the current power status of a slot.
* If this field is NULL, the value passed in the struct hotplug_slot_info * If this field is NULL, the value passed in the struct hotplug_slot_info
* will be used when this value is requested by a user. * will be used when this value is requested by a user.
* @get_attention_status: Called to get the current attention status of a slot. * @get_attention_status: Called to get the current attention status of a slot.
* If this field is NULL, the value passed in the struct hotplug_slot_info * If this field is NULL, the value passed in the struct hotplug_slot_info
* will be used when this value is requested by a user. * will be used when this value is requested by a user.
...@@ -191,4 +191,3 @@ static inline int pci_get_hp_params(struct pci_dev *dev, ...@@ -191,4 +191,3 @@ static inline int pci_get_hp_params(struct pci_dev *dev,
void pci_configure_slot(struct pci_dev *dev); void pci_configure_slot(struct pci_dev *dev);
#endif #endif
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT)
struct pcie_device { struct pcie_device {
int irq; /* Service IRQ/MSI/MSI-X Vector */ int irq; /* Service IRQ/MSI/MSI-X Vector */
struct pci_dev *port; /* Root/Upstream/Downstream Port */ struct pci_dev *port; /* Root/Upstream/Downstream Port */
u32 service; /* Port service this device represents */ u32 service; /* Port service this device represents */
void *priv_data; /* Service Private Data */ void *priv_data; /* Service Private Data */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment