return slot;
}
- ctrl_err(ctrl, "%s: slot (device=0x%x) not found\n", __func__, device);
+ ctrl_err(ctrl, "Slot (device=0x%02x) not found\n", device);
return NULL;
}
{
struct slot *slot = hotplug_slot->private;
- ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
+ ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, hotplug_slot_name(hotplug_slot));
kfree(hotplug_slot->info);
slot->hotplug_slot = hotplug_slot;
snprintf(name, SLOT_NAME_SIZE, "%u", slot->number);
- ctrl_dbg(ctrl, "Registering bus=%x dev=%x hp_slot=%x sun=%x "
- "slot_device_offset=%x\n", slot->bus, slot->device,
- slot->hp_slot, slot->number, ctrl->slot_device_offset);
+ ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:%02x "
+ "hp_slot=%x sun=%x slot_device_offset=%x\n",
+ pci_domain_nr(ctrl->pci_dev->subordinate),
+ slot->bus, slot->device, slot->hp_slot, slot->number,
+ ctrl->slot_device_offset);
retval = pci_hp_register(hotplug_slot,
ctrl->pci_dev->subordinate,
slot->device,
&hotplug_slot_attr_lock.attr);
if (retval) {
pci_hp_deregister(hotplug_slot);
- ctrl_err(ctrl, "cannot create additional sysfs "
+ ctrl_err(ctrl, "Cannot create additional sysfs "
"entries\n");
goto error_info;
}
{
struct slot *slot = hotplug_slot->private;
- ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
+ ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot));
hotplug_slot->info->attention_status = status;
{
struct slot *slot = hotplug_slot->private;
- ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
+ ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot));
return pciehp_sysfs_enable_slot(slot);
{
struct slot *slot = hotplug_slot->private;
- ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
+ ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot));
return pciehp_sysfs_disable_slot(slot);
struct slot *slot = hotplug_slot->private;
int retval;
- ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
+ ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot));
retval = slot->hpc_ops->get_power_status(slot, value);
struct slot *slot = hotplug_slot->private;
int retval;
- ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
+ ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot));
retval = slot->hpc_ops->get_attention_status(slot, value);
struct slot *slot = hotplug_slot->private;
int retval;
- ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
+ ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot));
retval = slot->hpc_ops->get_latch_status(slot, value);
struct slot *slot = hotplug_slot->private;
int retval;
- ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
+ ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot));
retval = slot->hpc_ops->get_adapter_status(slot, value);
struct slot *slot = hotplug_slot->private;
int retval;
- ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
+ ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot));
retval = slot->hpc_ops->get_max_bus_speed(slot, value);
struct slot *slot = hotplug_slot->private;
int retval;
- ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
+ ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot));
retval = slot->hpc_ops->get_cur_bus_speed(slot, value);
ctrl = pcie_init(dev);
if (!ctrl) {
- dev_err(&dev->device, "controller initialization failed\n");
+ dev_err(&dev->device, "Controller initialization failed\n");
goto err_out_none;
}
set_service_data(dev, ctrl);
rc = init_slots(ctrl);
if (rc) {
if (rc == -EBUSY)
- ctrl_warn(ctrl, "slot already registered by another "
+ ctrl_warn(ctrl, "Slot already registered by another "
"hotplug driver\n");
else
- ctrl_err(ctrl, "slot initialization failed\n");
+ ctrl_err(ctrl, "Slot initialization failed\n");
goto err_out_release_ctlr;
}
dbg("pcie_port_service_register = %d\n", retval);
info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
if (retval)
- dbg("%s: Failure to register service\n", __func__);
+ dbg("Failure to register service\n");
return retval;
}
struct controller *ctrl = p_slot->ctrl;
/* Attention Button Change */
- ctrl_dbg(ctrl, "Attention button interrupt received.\n");
+ ctrl_dbg(ctrl, "Attention button interrupt received\n");
/*
* Button pressed - See if need to TAKE ACTION!!!
struct controller *ctrl = p_slot->ctrl;
/* Switch Change */
- ctrl_dbg(ctrl, "Switch interrupt received.\n");
+ ctrl_dbg(ctrl, "Switch interrupt received\n");
p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
if (getstatus) {
struct controller *ctrl = p_slot->ctrl;
/* Presence Change */
- ctrl_dbg(ctrl, "Presence/Notify input change.\n");
+ ctrl_dbg(ctrl, "Presence/Notify input change\n");
/* Switch is open, assume a presence change
* Save the presence state
struct controller *ctrl = p_slot->ctrl;
/* power fault */
- ctrl_dbg(ctrl, "Power fault interrupt received.\n");
+ ctrl_dbg(ctrl, "Power fault interrupt received\n");
if ( !(p_slot->hpc_ops->query_power_fault(p_slot))) {
/*
*/
ctrl_info(ctrl, "Power fault on Slot(%s)\n", slot_name(p_slot));
event_type = INT_POWER_FAULT;
- ctrl_info(ctrl, "power fault bit %x set\n", 0);
+ ctrl_info(ctrl, "Power fault bit %x set\n", 0);
}
queue_interrupt_event(p_slot, event_type);
if (POWER_CTRL(ctrl)) {
if (pslot->hpc_ops->power_off_slot(pslot)) {
ctrl_err(ctrl,
- "%s: Issue of Slot Power Off command failed\n",
- __func__);
+ "Issue of Slot Power Off command failed\n");
return;
}
}
if (ATTN_LED(ctrl)) {
if (pslot->hpc_ops->set_attention_status(pslot, 1)) {
- ctrl_err(ctrl, "%s: Issue of Set Attention "
- "Led command failed\n", __func__);
+ ctrl_err(ctrl,
+ "Issue of Set Attention Led command failed\n");
return;
}
}
{
int retval = 0;
struct controller *ctrl = p_slot->ctrl;
+ struct pci_bus *parent = ctrl->pci_dev->subordinate;
- ctrl_dbg(ctrl, "%s: slot device, slot offset, hp slot = %d, %d ,%d\n",
+ ctrl_dbg(ctrl, "%s: slot device, slot offset, hp slot = %d, %d, %d\n",
__func__, p_slot->device, ctrl->slot_device_offset,
p_slot->hp_slot);
/* Check link training status */
retval = p_slot->hpc_ops->check_lnk_status(ctrl);
if (retval) {
- ctrl_err(ctrl, "%s: Failed to check link status\n", __func__);
+ ctrl_err(ctrl, "Failed to check link status\n");
set_slot_off(ctrl, p_slot);
return retval;
}
/* Check for a power fault */
if (p_slot->hpc_ops->query_power_fault(p_slot)) {
- ctrl_dbg(ctrl, "%s: power fault detected\n", __func__);
+ ctrl_dbg(ctrl, "Power fault detected\n");
retval = POWER_FAILURE;
goto err_exit;
}
retval = pciehp_configure_device(p_slot);
if (retval) {
- ctrl_err(ctrl, "Cannot add device 0x%x:%x\n",
- p_slot->bus, p_slot->device);
+ ctrl_err(ctrl, "Cannot add device at %04x:%02x:%02x\n",
+ pci_domain_nr(parent), p_slot->bus, p_slot->device);
goto err_exit;
}
if (retval)
return retval;
- ctrl_dbg(ctrl, "In %s, hp_slot = %d\n", __func__, p_slot->hp_slot);
+ ctrl_dbg(ctrl, "%s: hp_slot = %d\n", __func__, p_slot->hp_slot);
if (POWER_CTRL(ctrl)) {
/* power off slot */
retval = p_slot->hpc_ops->power_off_slot(p_slot);
if (retval) {
- ctrl_err(ctrl, "%s: Issue of Slot Disable command "
- "failed\n", __func__);
+ ctrl_err(ctrl,
+ "Issue of Slot Disable command failed\n");
return retval;
}
}
switch (p_slot->state) {
case POWEROFF_STATE:
mutex_unlock(&p_slot->lock);
- ctrl_dbg(p_slot->ctrl, "%s: disabling bus:device(%x:%x)\n",
- __func__, p_slot->bus, p_slot->device);
+ ctrl_dbg(p_slot->ctrl,
+ "Disabling domain:bus:device=%04x:%02x:%02x\n",
+ pci_domain_nr(p_slot->ctrl->pci_dev->subordinate),
+ p_slot->bus, p_slot->device);
pciehp_disable_slot(p_slot);
mutex_lock(&p_slot->lock);
p_slot->state = STATIC_STATE;
* expires to cancel hot-add or hot-remove
*/
ctrl_info(ctrl, "Button cancel on Slot(%s)\n", slot_name(p_slot));
- ctrl_dbg(ctrl, "%s: button cancel\n", __func__);
cancel_delayed_work(&p_slot->work);
if (p_slot->state == BLINKINGOFF_STATE) {
if (PWR_LED(ctrl))
rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
if (rc || !getstatus) {
- ctrl_info(ctrl, "%s: no adapter on slot(%s)\n",
- __func__, slot_name(p_slot));
+ ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -ENODEV;
}
if (MRL_SENS(p_slot->ctrl)) {
rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
if (rc || getstatus) {
- ctrl_info(ctrl, "%s: latch open on slot(%s)\n",
- __func__, slot_name(p_slot));
+ ctrl_info(ctrl, "Latch open on slot(%s)\n",
+ slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -ENODEV;
}
if (POWER_CTRL(p_slot->ctrl)) {
rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
if (rc || getstatus) {
- ctrl_info(ctrl, "%s: already enabled on slot(%s)\n",
- __func__, slot_name(p_slot));
+ ctrl_info(ctrl, "Already enabled on slot(%s)\n",
+ slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -EINVAL;
}
if (!HP_SUPR_RM(p_slot->ctrl)) {
ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
if (ret || !getstatus) {
- ctrl_info(ctrl, "%s: no adapter on slot(%s)\n",
- __func__, slot_name(p_slot));
+ ctrl_info(ctrl, "No adapter on slot(%s)\n",
+ slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -ENODEV;
}
if (MRL_SENS(p_slot->ctrl)) {
ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
if (ret || getstatus) {
- ctrl_info(ctrl, "%s: latch open on slot(%s)\n",
- __func__, slot_name(p_slot));
+ ctrl_info(ctrl, "Latch open on slot(%s)\n",
+ slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -ENODEV;
}
if (POWER_CTRL(p_slot->ctrl)) {
ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
if (ret || !getstatus) {
- ctrl_info(ctrl, "%s: already disabled slot(%s)\n",
- __func__, slot_name(p_slot));
+ ctrl_info(ctrl, "Already disabled on slot(%s)\n",
+ slot_name(p_slot));
mutex_unlock(&p_slot->ctrl->crit_sect);
return -EINVAL;
}
* proceed forward to issue the next command according
* to spec. Just print out the error message.
*/
- ctrl_dbg(ctrl,
- "%s: CMD_COMPLETED not clear after 1 sec.\n",
- __func__);
+ ctrl_dbg(ctrl, "CMD_COMPLETED not clear after 1 sec\n");
} else if (!NO_CMD_CMPL(ctrl)) {
/*
* This controller semms to notify of command completed
* event even though it supports none of power
* controller, attention led, power led and EMI.
*/
- ctrl_dbg(ctrl, "%s: Unexpected CMD_COMPLETED. Need to "
- "wait for command completed event.\n",
- __func__);
+ ctrl_dbg(ctrl, "Unexpected CMD_COMPLETED. Need to "
+ "wait for command completed event.\n");
ctrl->no_cmd_complete = 0;
} else {
- ctrl_dbg(ctrl, "%s: Unexpected CMD_COMPLETED. Maybe "
- "the controller is broken.\n", __func__);
+ ctrl_dbg(ctrl, "Unexpected CMD_COMPLETED. Maybe "
+ "the controller is broken.\n");
}
}
smp_mb();
retval = pciehp_writew(ctrl, SLOTCTRL, slot_ctrl);
if (retval)
- ctrl_err(ctrl, "%s: Cannot write to SLOTCTRL register\n",
- __func__);
+ ctrl_err(ctrl, "Cannot write to SLOTCTRL register\n");
/*
* Wait for command completion.
retval = pciehp_readw(ctrl, LNKSTATUS, &lnk_status);
if (retval) {
- ctrl_err(ctrl, "%s: Cannot read LNKSTATUS register\n",
- __func__);
+ ctrl_err(ctrl, "Cannot read LNKSTATUS register\n");
return retval;
}
ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status);
if ( (lnk_status & LNK_TRN) || (lnk_status & LNK_TRN_ERR) ||
!(lnk_status & NEG_LINK_WD)) {
- ctrl_err(ctrl, "%s : Link Training Error occurs \n", __func__);
+ ctrl_err(ctrl, "Link Training Error occurs \n");
retval = -1;
return retval;
}
retval = pciehp_readw(ctrl, SLOTSTATUS, &slot_status);
if (retval) {
- ctrl_err(ctrl, "%s: Cannot check for power fault\n", __func__);
+ ctrl_err(ctrl, "Cannot check for power fault\n");
return retval;
}
pwr_fault = (u8)((slot_status & PWR_FAULT_DETECTED) >> 1);
retval = pciehp_readw(ctrl, SLOTSTATUS, &slot_status);
if (retval) {
- ctrl_err(ctrl, "%s : Cannot check EMI status\n", __func__);
+ ctrl_err(ctrl, "Cannot check EMI status\n");
return retval;
}
*status = (slot_status & EMI_STATE) >> EMI_STATUS_BIT;
retval = pcie_write_cmd(ctrl, slot_cmd, cmd_mask);
if (retval) {
- ctrl_err(ctrl, "%s: Write %x command failed!\n",
- __func__, slot_cmd);
+ ctrl_err(ctrl, "Write %x command failed!\n", slot_cmd);
return -1;
}
ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n",
retval = pcie_write_cmd(ctrl, slot_cmd, cmd_mask);
if (retval) {
- ctrl_err(ctrl, "%s: Write command failed!\n", __func__);
+ ctrl_err(ctrl, "Write command failed!\n");
retval = -1;
goto out;
}
PWR_FAULT_DETECT_ENABLE | HP_INTR_ENABLE | CMD_CMPL_INTR_ENABLE;
if (pcie_write_cmd(ctrl, cmd, mask)) {
- ctrl_err(ctrl, "%s: Cannot enable software notification\n",
- __func__);
+ ctrl_err(ctrl, "Cannot enable software notification\n");
return -1;
}
return 0;
mask = PRSN_DETECT_ENABLE | ATTN_BUTTN_ENABLE | MRL_DETECT_ENABLE |
PWR_FAULT_DETECT_ENABLE | HP_INTR_ENABLE | CMD_CMPL_INTR_ENABLE;
if (pcie_write_cmd(ctrl, 0, mask))
- ctrl_warn(ctrl, "%s: Cannot disable software notification\n",
- __func__);
+ ctrl_warn(ctrl, "Cannot disable software notification\n");
}
static int pcie_init_notification(struct controller *ctrl)
ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
if (!ctrl) {
- dev_err(&dev->device, "%s : out of memory\n", __func__);
+ dev_err(&dev->device, "%s: Out of memory\n", __func__);
goto abort;
}
INIT_LIST_HEAD(&ctrl->slot_list);
ctrl->pci_dev = pdev;
ctrl->cap_base = pci_find_capability(pdev, PCI_CAP_ID_EXP);
if (!ctrl->cap_base) {
- ctrl_err(ctrl, "%s: Cannot find PCI Express capability\n",
- __func__);
+ ctrl_err(ctrl, "Cannot find PCI Express capability\n");
goto abort_ctrl;
}
if (pciehp_readl(ctrl, SLOTCAP, &slot_cap)) {
- ctrl_err(ctrl, "%s: Cannot read SLOTCAP register\n", __func__);
+ ctrl_err(ctrl, "Cannot read SLOTCAP register\n");
goto abort_ctrl;
}
u16 pci_cmd, pci_bctl;
if (hpp->revision > 1) {
- printk(KERN_WARNING "%s: Rev.%d type0 record not supported\n",
- __func__, hpp->revision);
+ warn("Rev.%d type0 record not supported\n", hpp->revision);
return;
}
u32 reg32;
if (hpp->revision > 1) {
- printk(KERN_WARNING "%s: Rev.%d type2 record not supported\n",
- __func__, hpp->revision);
+ warn("Rev.%d type2 record not supported\n", hpp->revision);
return;
}
return;
if (pciehp_get_hp_params_from_firmware(dev, &hpp)) {
- printk(KERN_WARNING "%s: Could not get hotplug parameters\n",
- __func__);
+ warn("Could not get hotplug parameters\n");
return;
}
dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, 0));
if (dev) {
- ctrl_err(ctrl,
- "Device %s already exists at %x:%x, cannot hot-add\n",
- pci_name(dev), p_slot->bus, p_slot->device);
+ ctrl_err(ctrl, "Device %s already exists "
+ "at %04x:%02x:%02x, cannot hot-add\n", pci_name(dev),
+ pci_domain_nr(parent), p_slot->bus, p_slot->device);
pci_dev_put(dev);
return -EINVAL;
}
u16 command;
struct controller *ctrl = p_slot->ctrl;
- ctrl_dbg(ctrl, "%s: bus/dev = %x/%x\n", __func__,
- p_slot->bus, p_slot->device);
+ ctrl_dbg(ctrl, "%s: domain:bus:dev = %04x:%02x:%02x\n",
+ __func__, pci_domain_nr(parent), p_slot->bus, p_slot->device);
ret = p_slot->hpc_ops->get_adapter_status(p_slot, &presence);
if (ret)
presence = 0;