Skip to content

Commit

Permalink
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/jbarnes/pci-2.6

* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (32 commits)
  PCI hotplug: fix logic in Compaq hotplug controller bus speed setup
  PCI: don't export linux/io.h from pci.h
  PCI: PCI_QUIRKS depends on PCI
  PCI hotplug: pciehp: poll data link layer link active
  PCI hotplug: pciehp: fix possible memory leak in pcie_init
  PCI: Workaround invalid P2P bridge bus numbers
  PCI Hotplug: fakephp: add duplicate slot name debugging
  PCI: Hotplug core: remove 'name'
  PCI: shcphp: remove 'name' parameter
  PCI: SGI Hotplug: stop managing bss_hotplug_slot->name
  PCI: rpaphp: kmalloc/kfree slot->name directly
  PCI: pciehp: remove 'name' parameter
  PCI: ibmphp: stop managing hotplug_slot->name
  PCI: fakephp: remove 'name' parameter
  PCI, PCI Hotplug: introduce slot_name helpers
  PCI: cpqphp: stop managing hotplug_slot->name
  PCI: cpci_hotplug: stop managing hotplug_slot->name
  PCI: acpiphp: remove 'name' parameter
  PCI: prevent duplicate slot names
  PCI Hotplug: serialize pci_hp_register and pci_hp_deregister
  ...
  • Loading branch information
Linus Torvalds committed Oct 23, 2008
2 parents b4d0b08 + 05a34f5 commit a3415dc
Show file tree
Hide file tree
Showing 34 changed files with 637 additions and 399 deletions.
5 changes: 0 additions & 5 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3257,11 +3257,6 @@ L: linux-pci@vger.kernel.org
T: git kernel.org:/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git
S: Supported

PCI HOTPLUG CORE
P: Kristen Carlson Accardi
M: kristen.c.accardi@intel.com
S: Supported

PCIE HOTPLUG DRIVER
P: Kristen Carlson Accardi
M: kristen.c.accardi@intel.com
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/pci_slot.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
}

snprintf(name, sizeof(name), "%u", (u32)sun);
pci_slot = pci_create_slot(pci_bus, device, name);
pci_slot = pci_create_slot(pci_bus, device, name, NULL);
if (IS_ERR(pci_slot)) {
err("pci_create_slot returned %ld\n", PTR_ERR(pci_slot));
kfree(slot);
Expand Down
9 changes: 5 additions & 4 deletions drivers/pci/hotplug/acpiphp.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@
#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
#define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)

/* name size which is used for entries in pcihpfs */
#define SLOT_NAME_SIZE 20 /* {_SUN} */

struct acpiphp_bridge;
struct acpiphp_slot;

Expand All @@ -63,9 +60,13 @@ struct slot {
struct hotplug_slot *hotplug_slot;
struct acpiphp_slot *acpi_slot;
struct hotplug_slot_info info;
char name[SLOT_NAME_SIZE];
};

static inline const char *slot_name(struct slot *slot)
{
return hotplug_slot_name(slot->hotplug_slot);
}

/*
* struct acpiphp_bridge - PCI bridge information
*
Expand Down
32 changes: 17 additions & 15 deletions drivers/pci/hotplug/acpiphp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@

#define MY_NAME "acpiphp"

/* name size which is used for entries in pcihpfs */
#define SLOT_NAME_SIZE 21 /* {_SUN} */

static int debug;
int acpiphp_debug;

Expand Down Expand Up @@ -84,7 +87,6 @@ static struct hotplug_slot_ops acpi_hotplug_slot_ops = {
.get_adapter_status = get_adapter_status,
};


/**
* acpiphp_register_attention - set attention LED callback
* @info: must be completely filled with LED callbacks
Expand Down Expand Up @@ -136,7 +138,7 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));

/* enable the specified slot */
return acpiphp_enable_slot(slot->acpi_slot);
Expand All @@ -154,7 +156,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
struct slot *slot = hotplug_slot->private;
int retval;

dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));

/* disable the specified slot */
retval = acpiphp_disable_slot(slot->acpi_slot);
Expand All @@ -177,7 +179,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
{
int retval = -ENODEV;

dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
dbg("%s - physical_slot = %s\n", __func__, hotplug_slot_name(hotplug_slot));

if (attention_info && try_module_get(attention_info->owner)) {
retval = attention_info->set_attn(hotplug_slot, status);
Expand All @@ -200,7 +202,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));

*value = acpiphp_get_power_status(slot->acpi_slot);

Expand All @@ -222,7 +224,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
int retval = -EINVAL;

dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
dbg("%s - physical_slot = %s\n", __func__, hotplug_slot_name(hotplug_slot));

if (attention_info && try_module_get(attention_info->owner)) {
retval = attention_info->get_attn(hotplug_slot, value);
Expand All @@ -245,7 +247,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));

*value = acpiphp_get_latch_status(slot->acpi_slot);

Expand All @@ -265,7 +267,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));

*value = acpiphp_get_adapter_status(slot->acpi_slot);

Expand Down Expand Up @@ -299,7 +301,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));

kfree(slot->hotplug_slot);
kfree(slot);
Expand All @@ -310,6 +312,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
{
struct slot *slot;
int retval = -ENOMEM;
char name[SLOT_NAME_SIZE];

slot = kzalloc(sizeof(*slot), GFP_KERNEL);
if (!slot)
Expand All @@ -321,8 +324,6 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot)

slot->hotplug_slot->info = &slot->info;

slot->hotplug_slot->name = slot->name;

slot->hotplug_slot->private = slot;
slot->hotplug_slot->release = &release_slot;
slot->hotplug_slot->ops = &acpi_hotplug_slot_ops;
Expand All @@ -336,19 +337,20 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN;

acpiphp_slot->slot = slot;
snprintf(slot->name, sizeof(slot->name), "%u", slot->acpi_slot->sun);
snprintf(name, SLOT_NAME_SIZE, "%u", slot->acpi_slot->sun);

retval = pci_hp_register(slot->hotplug_slot,
acpiphp_slot->bridge->pci_bus,
acpiphp_slot->device);
acpiphp_slot->device,
name);
if (retval == -EBUSY)
goto error_hpslot;
if (retval) {
err("pci_hp_register failed with error %d\n", retval);
goto error_hpslot;
}

info("Slot [%s] registered\n", slot->hotplug_slot->name);
info("Slot [%s] registered\n", slot_name(slot));

return 0;
error_hpslot:
Expand All @@ -365,7 +367,7 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
struct slot *slot = acpiphp_slot->slot;
int retval = 0;

info ("Slot [%s] unregistered\n", slot->hotplug_slot->name);
info("Slot [%s] unregistered\n", slot_name(slot));

retval = pci_hp_deregister(slot->hotplug_slot);
if (retval)
Expand Down
6 changes: 6 additions & 0 deletions drivers/pci/hotplug/cpci_hotplug.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include <linux/types.h>
#include <linux/pci.h>
#include <linux/pci_hotplug.h>

/* PICMG 2.1 R2.0 HS CSR bits: */
#define HS_CSR_INS 0x0080
Expand Down Expand Up @@ -69,6 +70,11 @@ struct cpci_hp_controller {
struct cpci_hp_controller_ops *ops;
};

static inline const char *slot_name(struct slot *slot)
{
return hotplug_slot_name(slot->hotplug_slot);
}

extern int cpci_hp_register_controller(struct cpci_hp_controller *controller);
extern int cpci_hp_unregister_controller(struct cpci_hp_controller *controller);
extern int cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last);
Expand Down
Loading

0 comments on commit a3415dc

Please sign in to comment.