Commit 1a9ed1bf authored by rajesh.shah@intel.com's avatar rajesh.shah@intel.com Committed by Greg Kroah-Hartman

[PATCH] pciehp: reduce debug message verbosity

Reduce the number of debug messages generated if pciehp debug is
enabled. I tried to restrict this to removing debug messages that
are either early-driver-debug type messages, or print information
that can be inferred through other debug prints.
Signed-off-by: default avatarRajesh Shah <rajesh.shah@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ed6cbcf2
...@@ -207,12 +207,9 @@ static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device) ...@@ -207,12 +207,9 @@ static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device)
p_slot = ctrl->slot; p_slot = ctrl->slot;
dbg("p_slot = %p\n", p_slot);
while (p_slot && (p_slot->device != device)) { while (p_slot && (p_slot->device != device)) {
tmp_slot = p_slot; tmp_slot = p_slot;
p_slot = p_slot->next; p_slot = p_slot->next;
dbg("In while loop, p_slot = %p\n", p_slot);
} }
if (p_slot == NULL) { if (p_slot == NULL) {
err("ERROR: pciehp_find_slot device=0x%x\n", device); err("ERROR: pciehp_find_slot device=0x%x\n", device);
...@@ -228,7 +225,6 @@ static inline int wait_for_ctrl_irq(struct controller *ctrl) ...@@ -228,7 +225,6 @@ static inline int wait_for_ctrl_irq(struct controller *ctrl)
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
dbg("%s : start\n", __FUNCTION__);
add_wait_queue(&ctrl->queue, &wait); add_wait_queue(&ctrl->queue, &wait);
if (!pciehp_poll_mode) if (!pciehp_poll_mode)
/* Sleep for up to 1 second */ /* Sleep for up to 1 second */
...@@ -240,7 +236,6 @@ static inline int wait_for_ctrl_irq(struct controller *ctrl) ...@@ -240,7 +236,6 @@ static inline int wait_for_ctrl_irq(struct controller *ctrl)
if (signal_pending(current)) if (signal_pending(current))
retval = -EINTR; retval = -EINTR;
dbg("%s : end\n", __FUNCTION__);
return retval; return retval;
} }
......
...@@ -106,8 +106,6 @@ static int init_slots(struct controller *ctrl) ...@@ -106,8 +106,6 @@ static int init_slots(struct controller *ctrl)
u32 slot_number; u32 slot_number;
int result = -ENOMEM; int result = -ENOMEM;
dbg("%s\n",__FUNCTION__);
number_of_slots = ctrl->num_slots; number_of_slots = ctrl->num_slots;
slot_device = ctrl->slot_device_offset; slot_device = ctrl->slot_device_offset;
slot_number = ctrl->first_slot; slot_number = ctrl->first_slot;
...@@ -362,7 +360,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_ ...@@ -362,7 +360,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
u8 value; u8 value;
struct pci_dev *pdev; struct pci_dev *pdev;
dbg("%s: Called by hp_drv\n", __FUNCTION__);
ctrl = kmalloc(sizeof(*ctrl), GFP_KERNEL); ctrl = kmalloc(sizeof(*ctrl), GFP_KERNEL);
if (!ctrl) { if (!ctrl) {
err("%s : out of memory\n", __FUNCTION__); err("%s : out of memory\n", __FUNCTION__);
...@@ -370,8 +367,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_ ...@@ -370,8 +367,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
} }
memset(ctrl, 0, sizeof(struct controller)); memset(ctrl, 0, sizeof(struct controller));
dbg("%s: DRV_thread pid = %d\n", __FUNCTION__, current->pid);
pdev = dev->port; pdev = dev->port;
ctrl->pci_dev = pdev; ctrl->pci_dev = pdev;
...@@ -389,7 +384,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_ ...@@ -389,7 +384,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
rc = -ENOMEM; rc = -ENOMEM;
goto err_out_unmap_mmio_region; goto err_out_unmap_mmio_region;
} }
dbg("%s: ctrl->pci_bus %p\n", __FUNCTION__, ctrl->pci_bus);
memcpy (ctrl->pci_bus, pdev->bus, sizeof (*ctrl->pci_bus)); memcpy (ctrl->pci_bus, pdev->bus, sizeof (*ctrl->pci_bus));
ctrl->bus = pdev->bus->number; /* ctrl bus */ ctrl->bus = pdev->bus->number; /* ctrl bus */
ctrl->slot_bus = pdev->subordinate->number; /* bus controlled by this HPC */ ctrl->slot_bus = pdev->subordinate->number; /* bus controlled by this HPC */
...@@ -419,7 +413,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_ ...@@ -419,7 +413,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
} }
t_slot = pciehp_find_slot(ctrl, first_device_num); t_slot = pciehp_find_slot(ctrl, first_device_num);
dbg("%s: t_slot %p\n", __FUNCTION__, t_slot);
/* Finish setting up the hot plug ctrl device */ /* Finish setting up the hot plug ctrl device */
ctrl->next_event = 0; ctrl->next_event = 0;
...@@ -436,7 +429,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_ ...@@ -436,7 +429,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
down(&ctrl->crit_sect); down(&ctrl->crit_sect);
t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */ t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */
dbg("%s: adpater value %x\n", __FUNCTION__, value);
if ((POWER_CTRL(ctrl->ctrlcap)) && !value) { if ((POWER_CTRL(ctrl->ctrlcap)) && !value) {
rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/ rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/
...@@ -585,7 +577,6 @@ static void __exit pcied_cleanup(void) ...@@ -585,7 +577,6 @@ static void __exit pcied_cleanup(void)
dbg("unload_pciehpd()\n"); dbg("unload_pciehpd()\n");
unload_pciehpd(); unload_pciehpd();
dbg("pcie_port_service_unregister\n");
pcie_port_service_unregister(&hpdriver_portdrv); pcie_port_service_unregister(&hpdriver_portdrv);
info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
......
...@@ -277,7 +277,9 @@ static int board_added(struct slot *p_slot) ...@@ -277,7 +277,9 @@ static int board_added(struct slot *p_slot)
hp_slot = p_slot->device - ctrl->slot_device_offset; hp_slot = p_slot->device - ctrl->slot_device_offset;
dbg("%s: p_slot->device, slot_offset, hp_slot = %d, %d ,%d\n", __FUNCTION__, p_slot->device, ctrl->slot_device_offset, hp_slot); dbg("%s: slot device, slot offset, hp slot = %d, %d ,%d\n",
__FUNCTION__, p_slot->device,
ctrl->slot_device_offset, hp_slot);
/* Wait for exclusive access to hardware */ /* Wait for exclusive access to hardware */
down(&ctrl->crit_sect); down(&ctrl->crit_sect);
...@@ -305,9 +307,7 @@ static int board_added(struct slot *p_slot) ...@@ -305,9 +307,7 @@ static int board_added(struct slot *p_slot)
up(&ctrl->crit_sect); up(&ctrl->crit_sect);
/* Wait for ~1 second */ /* Wait for ~1 second */
dbg("%s: before long_delay\n", __FUNCTION__);
wait_for_ctrl_irq (ctrl); wait_for_ctrl_irq (ctrl);
dbg("%s: afterlong_delay\n", __FUNCTION__);
/* Check link training status */ /* Check link training status */
rc = p_slot->hpc_ops->check_lnk_status(ctrl); rc = p_slot->hpc_ops->check_lnk_status(ctrl);
...@@ -444,13 +444,15 @@ static void pciehp_pushbutton_thread(unsigned long slot) ...@@ -444,13 +444,15 @@ static void pciehp_pushbutton_thread(unsigned long slot)
p_slot->hpc_ops->get_power_status(p_slot, &getstatus); p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
if (getstatus) { if (getstatus) {
p_slot->state = POWEROFF_STATE; p_slot->state = POWEROFF_STATE;
dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); dbg("%s: disabling bus:device(%x:%x)\n", __FUNCTION__,
p_slot->bus, p_slot->device);
pciehp_disable_slot(p_slot); pciehp_disable_slot(p_slot);
p_slot->state = STATIC_STATE; p_slot->state = STATIC_STATE;
} else { } else {
p_slot->state = POWERON_STATE; p_slot->state = POWERON_STATE;
dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); dbg("%s: adding bus:device(%x:%x)\n", __FUNCTION__,
p_slot->bus, p_slot->device);
if (pciehp_enable_slot(p_slot) && PWR_LED(p_slot->ctrl->ctrlcap)) { if (pciehp_enable_slot(p_slot) && PWR_LED(p_slot->ctrl->ctrlcap)) {
/* Wait for exclusive access to hardware */ /* Wait for exclusive access to hardware */
...@@ -492,13 +494,15 @@ static void pciehp_surprise_rm_thread(unsigned long slot) ...@@ -492,13 +494,15 @@ static void pciehp_surprise_rm_thread(unsigned long slot)
p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
if (!getstatus) { if (!getstatus) {
p_slot->state = POWEROFF_STATE; p_slot->state = POWEROFF_STATE;
dbg("In removing board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); dbg("%s: removing bus:device(%x:%x)\n",
__FUNCTION__, p_slot->bus, p_slot->device);
pciehp_disable_slot(p_slot); pciehp_disable_slot(p_slot);
p_slot->state = STATIC_STATE; p_slot->state = STATIC_STATE;
} else { } else {
p_slot->state = POWERON_STATE; p_slot->state = POWERON_STATE;
dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); dbg("%s: adding bus:device(%x:%x)\n",
__FUNCTION__, p_slot->bus, p_slot->device);
if (pciehp_enable_slot(p_slot) && PWR_LED(p_slot->ctrl->ctrlcap)) { if (pciehp_enable_slot(p_slot) && PWR_LED(p_slot->ctrl->ctrlcap)) {
/* Wait for exclusive access to hardware */ /* Wait for exclusive access to hardware */
...@@ -564,7 +568,6 @@ int pciehp_event_start_thread(void) ...@@ -564,7 +568,6 @@ int pciehp_event_start_thread(void)
err ("Can't start up our event thread\n"); err ("Can't start up our event thread\n");
return -1; return -1;
} }
dbg("Our event thread pid = %d\n", pid);
return 0; return 0;
} }
...@@ -572,9 +575,7 @@ int pciehp_event_start_thread(void) ...@@ -572,9 +575,7 @@ int pciehp_event_start_thread(void)
void pciehp_event_stop_thread(void) void pciehp_event_stop_thread(void)
{ {
event_finished = 1; event_finished = 1;
dbg("event_thread finish command given\n");
up(&event_semaphore); up(&event_semaphore);
dbg("wait for event_thread to exit\n");
down(&event_exit); down(&event_exit);
} }
...@@ -619,8 +620,6 @@ static void interrupt_event_handler(struct controller *ctrl) ...@@ -619,8 +620,6 @@ static void interrupt_event_handler(struct controller *ctrl)
p_slot = pciehp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); p_slot = pciehp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
dbg("hp_slot %d, p_slot %p\n", hp_slot, p_slot);
if (ctrl->event_queue[loop].event_type == INT_BUTTON_CANCEL) { if (ctrl->event_queue[loop].event_type == INT_BUTTON_CANCEL) {
dbg("button cancel\n"); dbg("button cancel\n");
del_timer(&p_slot->task_event); del_timer(&p_slot->task_event);
...@@ -712,7 +711,6 @@ static void interrupt_event_handler(struct controller *ctrl) ...@@ -712,7 +711,6 @@ static void interrupt_event_handler(struct controller *ctrl)
p_slot->task_event.function = (void (*)(unsigned long)) pushbutton_helper_thread; p_slot->task_event.function = (void (*)(unsigned long)) pushbutton_helper_thread;
p_slot->task_event.data = (unsigned long) p_slot; p_slot->task_event.data = (unsigned long) p_slot;
dbg("add_timer p_slot = %p\n", (void *) p_slot);
add_timer(&p_slot->task_event); add_timer(&p_slot->task_event);
} }
} }
......
...@@ -274,7 +274,6 @@ static int pcie_write_cmd(struct slot *slot, u16 cmd) ...@@ -274,7 +274,6 @@ static int pcie_write_cmd(struct slot *slot, u16 cmd)
DBG_ENTER_ROUTINE DBG_ENTER_ROUTINE
dbg("%s : Enter\n", __FUNCTION__);
if (!php_ctlr) { if (!php_ctlr) {
err("%s: Invalid HPC controller handle!\n", __FUNCTION__); err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
return -1; return -1;
...@@ -285,7 +284,6 @@ static int pcie_write_cmd(struct slot *slot, u16 cmd) ...@@ -285,7 +284,6 @@ static int pcie_write_cmd(struct slot *slot, u16 cmd)
err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__); err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__);
return retval; return retval;
} }
dbg("%s : hp_register_read_word SLOT_STATUS %x\n", __FUNCTION__, slot_status);
if ((slot_status & CMD_COMPLETED) == CMD_COMPLETED ) { if ((slot_status & CMD_COMPLETED) == CMD_COMPLETED ) {
/* After 1 sec and CMD_COMPLETED still not set, just proceed forward to issue /* After 1 sec and CMD_COMPLETED still not set, just proceed forward to issue
...@@ -293,14 +291,11 @@ static int pcie_write_cmd(struct slot *slot, u16 cmd) ...@@ -293,14 +291,11 @@ static int pcie_write_cmd(struct slot *slot, u16 cmd)
dbg("%s : CMD_COMPLETED not clear after 1 sec.\n", __FUNCTION__); dbg("%s : CMD_COMPLETED not clear after 1 sec.\n", __FUNCTION__);
} }
dbg("%s: Before hp_register_write_word SLOT_CTRL %x\n", __FUNCTION__, cmd);
retval = hp_register_write_word(php_ctlr->pci_dev, SLOT_CTRL(slot->ctrl->cap_base), cmd | CMD_CMPL_INTR_ENABLE); retval = hp_register_write_word(php_ctlr->pci_dev, SLOT_CTRL(slot->ctrl->cap_base), cmd | CMD_CMPL_INTR_ENABLE);
if (retval) { if (retval) {
err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__);
return retval; return retval;
} }
dbg("%s : hp_register_write_word SLOT_CTRL %x\n", __FUNCTION__, cmd | CMD_CMPL_INTR_ENABLE);
dbg("%s : Exit\n", __FUNCTION__);
DBG_LEAVE_ROUTINE DBG_LEAVE_ROUTINE
return retval; return retval;
...@@ -516,7 +511,8 @@ static int hpc_set_attention_status(struct slot *slot, u8 value) ...@@ -516,7 +511,8 @@ static int hpc_set_attention_status(struct slot *slot, u8 value)
u16 slot_ctrl; u16 slot_ctrl;
int rc = 0; int rc = 0;
dbg("%s: \n", __FUNCTION__); DBG_ENTER_ROUTINE
if (!php_ctlr) { if (!php_ctlr) {
err("%s: Invalid HPC controller handle!\n", __FUNCTION__); err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
return -1; return -1;
...@@ -532,7 +528,6 @@ static int hpc_set_attention_status(struct slot *slot, u8 value) ...@@ -532,7 +528,6 @@ static int hpc_set_attention_status(struct slot *slot, u8 value)
err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__);
return rc; return rc;
} }
dbg("%s : hp_register_read_word SLOT_CTRL %x\n", __FUNCTION__, slot_ctrl);
switch (value) { switch (value) {
case 0 : /* turn off */ case 0 : /* turn off */
...@@ -553,6 +548,7 @@ static int hpc_set_attention_status(struct slot *slot, u8 value) ...@@ -553,6 +548,7 @@ static int hpc_set_attention_status(struct slot *slot, u8 value)
pcie_write_cmd(slot, slot_cmd); pcie_write_cmd(slot, slot_cmd);
dbg("%s: SLOT_CTRL %x write cmd %x\n", __FUNCTION__, SLOT_CTRL(slot->ctrl->cap_base), slot_cmd); dbg("%s: SLOT_CTRL %x write cmd %x\n", __FUNCTION__, SLOT_CTRL(slot->ctrl->cap_base), slot_cmd);
DBG_LEAVE_ROUTINE
return rc; return rc;
} }
...@@ -564,7 +560,8 @@ static void hpc_set_green_led_on(struct slot *slot) ...@@ -564,7 +560,8 @@ static void hpc_set_green_led_on(struct slot *slot)
u16 slot_ctrl; u16 slot_ctrl;
int rc = 0; int rc = 0;
dbg("%s: \n", __FUNCTION__); DBG_ENTER_ROUTINE
if (!php_ctlr) { if (!php_ctlr) {
err("%s: Invalid HPC controller handle!\n", __FUNCTION__); err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
return ; return ;
...@@ -581,7 +578,6 @@ static void hpc_set_green_led_on(struct slot *slot) ...@@ -581,7 +578,6 @@ static void hpc_set_green_led_on(struct slot *slot)
err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__);
return; return;
} }
dbg("%s : hp_register_read_word SLOT_CTRL %x\n", __FUNCTION__, slot_ctrl);
slot_cmd = (slot_ctrl & ~PWR_LED_CTRL) | 0x0100; slot_cmd = (slot_ctrl & ~PWR_LED_CTRL) | 0x0100;
if (!pciehp_poll_mode) if (!pciehp_poll_mode)
slot_cmd = slot_cmd | HP_INTR_ENABLE; slot_cmd = slot_cmd | HP_INTR_ENABLE;
...@@ -589,6 +585,7 @@ static void hpc_set_green_led_on(struct slot *slot) ...@@ -589,6 +585,7 @@ static void hpc_set_green_led_on(struct slot *slot)
pcie_write_cmd(slot, slot_cmd); pcie_write_cmd(slot, slot_cmd);
dbg("%s: SLOT_CTRL %x write cmd %x\n",__FUNCTION__, SLOT_CTRL(slot->ctrl->cap_base), slot_cmd); dbg("%s: SLOT_CTRL %x write cmd %x\n",__FUNCTION__, SLOT_CTRL(slot->ctrl->cap_base), slot_cmd);
DBG_LEAVE_ROUTINE
return; return;
} }
...@@ -599,7 +596,8 @@ static void hpc_set_green_led_off(struct slot *slot) ...@@ -599,7 +596,8 @@ static void hpc_set_green_led_off(struct slot *slot)
u16 slot_ctrl; u16 slot_ctrl;
int rc = 0; int rc = 0;
dbg("%s: \n", __FUNCTION__); DBG_ENTER_ROUTINE
if (!php_ctlr) { if (!php_ctlr) {
err("%s: Invalid HPC controller handle!\n", __FUNCTION__); err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
return ; return ;
...@@ -616,7 +614,6 @@ static void hpc_set_green_led_off(struct slot *slot) ...@@ -616,7 +614,6 @@ static void hpc_set_green_led_off(struct slot *slot)
err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__);
return; return;
} }
dbg("%s : hp_register_read_word SLOT_CTRL %x\n", __FUNCTION__, slot_ctrl);
slot_cmd = (slot_ctrl & ~PWR_LED_CTRL) | 0x0300; slot_cmd = (slot_ctrl & ~PWR_LED_CTRL) | 0x0300;
...@@ -625,6 +622,7 @@ static void hpc_set_green_led_off(struct slot *slot) ...@@ -625,6 +622,7 @@ static void hpc_set_green_led_off(struct slot *slot)
pcie_write_cmd(slot, slot_cmd); pcie_write_cmd(slot, slot_cmd);
dbg("%s: SLOT_CTRL %x write cmd %x\n", __FUNCTION__, SLOT_CTRL(slot->ctrl->cap_base), slot_cmd); dbg("%s: SLOT_CTRL %x write cmd %x\n", __FUNCTION__, SLOT_CTRL(slot->ctrl->cap_base), slot_cmd);
DBG_LEAVE_ROUTINE
return; return;
} }
...@@ -635,7 +633,8 @@ static void hpc_set_green_led_blink(struct slot *slot) ...@@ -635,7 +633,8 @@ static void hpc_set_green_led_blink(struct slot *slot)
u16 slot_ctrl; u16 slot_ctrl;
int rc = 0; int rc = 0;
dbg("%s: \n", __FUNCTION__); DBG_ENTER_ROUTINE
if (!php_ctlr) { if (!php_ctlr) {
err("%s: Invalid HPC controller handle!\n", __FUNCTION__); err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
return ; return ;
...@@ -652,7 +651,6 @@ static void hpc_set_green_led_blink(struct slot *slot) ...@@ -652,7 +651,6 @@ static void hpc_set_green_led_blink(struct slot *slot)
err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__);
return; return;
} }
dbg("%s : hp_register_read_word SLOT_CTRL %x\n", __FUNCTION__, slot_ctrl);
slot_cmd = (slot_ctrl & ~PWR_LED_CTRL) | 0x0200; slot_cmd = (slot_ctrl & ~PWR_LED_CTRL) | 0x0200;
...@@ -661,6 +659,7 @@ static void hpc_set_green_led_blink(struct slot *slot) ...@@ -661,6 +659,7 @@ static void hpc_set_green_led_blink(struct slot *slot)
pcie_write_cmd(slot, slot_cmd); pcie_write_cmd(slot, slot_cmd);
dbg("%s: SLOT_CTRL %x write cmd %x\n",__FUNCTION__, SLOT_CTRL(slot->ctrl->cap_base), slot_cmd); dbg("%s: SLOT_CTRL %x write cmd %x\n",__FUNCTION__, SLOT_CTRL(slot->ctrl->cap_base), slot_cmd);
DBG_LEAVE_ROUTINE
return; return;
} }
...@@ -757,7 +756,6 @@ static int hpc_power_on_slot(struct slot * slot) ...@@ -757,7 +756,6 @@ static int hpc_power_on_slot(struct slot * slot)
int retval = 0; int retval = 0;
DBG_ENTER_ROUTINE DBG_ENTER_ROUTINE
dbg("%s: \n", __FUNCTION__);
if (!php_ctlr) { if (!php_ctlr) {
err("%s: Invalid HPC controller handle!\n", __FUNCTION__); err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
...@@ -776,8 +774,6 @@ static int hpc_power_on_slot(struct slot * slot) ...@@ -776,8 +774,6 @@ static int hpc_power_on_slot(struct slot * slot)
err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__);
return retval; return retval;
} }
dbg("%s: SLOT_CTRL %x, value read %xn", __FUNCTION__, SLOT_CTRL(slot->ctrl->cap_base),
slot_ctrl);
slot_cmd = (slot_ctrl & ~PWR_CTRL) | POWER_ON; slot_cmd = (slot_ctrl & ~PWR_CTRL) | POWER_ON;
...@@ -806,7 +802,6 @@ static int hpc_power_off_slot(struct slot * slot) ...@@ -806,7 +802,6 @@ static int hpc_power_off_slot(struct slot * slot)
int retval = 0; int retval = 0;
DBG_ENTER_ROUTINE DBG_ENTER_ROUTINE
dbg("%s: \n", __FUNCTION__);
if (!php_ctlr) { if (!php_ctlr) {
err("%s: Invalid HPC controller handle!\n", __FUNCTION__); err("%s: Invalid HPC controller handle!\n", __FUNCTION__);
...@@ -825,8 +820,6 @@ static int hpc_power_off_slot(struct slot * slot) ...@@ -825,8 +820,6 @@ static int hpc_power_off_slot(struct slot * slot)
err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__);
return retval; return retval;
} }
dbg("%s: SLOT_CTRL %x, value read %x\n", __FUNCTION__, SLOT_CTRL(slot->ctrl->cap_base),
slot_ctrl);
slot_cmd = (slot_ctrl & ~PWR_CTRL) | POWER_OFF; slot_cmd = (slot_ctrl & ~PWR_CTRL) | POWER_OFF;
...@@ -901,7 +894,6 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs) ...@@ -901,7 +894,6 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs)
return IRQ_NONE; return IRQ_NONE;
} }
dbg("%s: Set Mask Hot-plug Interrupt Enable\n", __FUNCTION__);
dbg("%s: hp_register_read_word SLOT_CTRL with value %x\n", __FUNCTION__, temp_word); dbg("%s: hp_register_read_word SLOT_CTRL with value %x\n", __FUNCTION__, temp_word);
temp_word = (temp_word & ~HP_INTR_ENABLE & ~CMD_CMPL_INTR_ENABLE) | 0x00; temp_word = (temp_word & ~HP_INTR_ENABLE & ~CMD_CMPL_INTR_ENABLE) | 0x00;
...@@ -910,7 +902,6 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs) ...@@ -910,7 +902,6 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs)
err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__);
return IRQ_NONE; return IRQ_NONE;
} }
dbg("%s: hp_register_write_word SLOT_CTRL with value %x\n", __FUNCTION__, temp_word);
rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), slot_status); rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), slot_status);
if (rc) { if (rc) {
...@@ -926,14 +917,12 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs) ...@@ -926,14 +917,12 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs)
err("%s : hp_register_write_word SLOT_STATUS failed\n", __FUNCTION__); err("%s : hp_register_write_word SLOT_STATUS failed\n", __FUNCTION__);
return IRQ_NONE; return IRQ_NONE;
} }
dbg("%s: hp_register_write_word SLOT_STATUS with value %x\n", __FUNCTION__, temp_word);
} }
if (intr_loc & CMD_COMPLETED) { if (intr_loc & CMD_COMPLETED) {
/* /*
* Command Complete Interrupt Pending * Command Complete Interrupt Pending
*/ */
dbg("%s: In Command Complete Interrupt Pending\n", __FUNCTION__);
wake_up_interruptible(&ctrl->queue); wake_up_interruptible(&ctrl->queue);
} }
...@@ -966,7 +955,6 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs) ...@@ -966,7 +955,6 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs)
} }
dbg("%s: Unmask Hot-plug Interrupt Enable\n", __FUNCTION__); dbg("%s: Unmask Hot-plug Interrupt Enable\n", __FUNCTION__);
dbg("%s: hp_register_read_word SLOT_CTRL with value %x\n", __FUNCTION__, temp_word);
temp_word = (temp_word & ~HP_INTR_ENABLE) | HP_INTR_ENABLE; temp_word = (temp_word & ~HP_INTR_ENABLE) | HP_INTR_ENABLE;
rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_CTRL(ctrl->cap_base), temp_word); rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_CTRL(ctrl->cap_base), temp_word);
...@@ -974,14 +962,12 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs) ...@@ -974,14 +962,12 @@ static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs)
err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__);
return IRQ_NONE; return IRQ_NONE;
} }
dbg("%s: hp_register_write_word SLOT_CTRL with value %x\n", __FUNCTION__, temp_word);
rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), slot_status); rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), slot_status);
if (rc) { if (rc) {
err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__); err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__);
return IRQ_NONE; return IRQ_NONE;
} }
dbg("%s: hp_register_read_word SLOT_STATUS with value %x\n", __FUNCTION__, slot_status);
/* Clear command complete interrupt caused by this write */ /* Clear command complete interrupt caused by this write */
temp_word = 0x1F; temp_word = 0x1F;
...@@ -1254,8 +1240,8 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev) ...@@ -1254,8 +1240,8 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
pdev = dev->port; pdev = dev->port;
php_ctlr->pci_dev = pdev; /* save pci_dev in context */ php_ctlr->pci_dev = pdev; /* save pci_dev in context */
dbg("%s: pdev->vendor %x pdev->device %x\n", __FUNCTION__, dbg("%s: hotplug controller vendor id 0x%x device id 0x%x\n",
pdev->vendor, pdev->device); __FUNCTION__, pdev->vendor, pdev->device);
saved_cap_base = pcie_cap_base; saved_cap_base = pcie_cap_base;
...@@ -1312,8 +1298,6 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev) ...@@ -1312,8 +1298,6 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
first = 0; first = 0;
} }
dbg("pdev = %p: b:d:f:irq=0x%x:%x:%x:%x\n", pdev, pdev->bus->number,
PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), dev->irq);
for ( rc = 0; rc < DEVICE_COUNT_RESOURCE; rc++) for ( rc = 0; rc < DEVICE_COUNT_RESOURCE; rc++)
if (pci_resource_len(pdev, rc) > 0) if (pci_resource_len(pdev, rc) > 0)
dbg("pci resource[%d] start=0x%lx(len=0x%lx)\n", rc, dbg("pci resource[%d] start=0x%lx(len=0x%lx)\n", rc,
...@@ -1331,7 +1315,6 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev) ...@@ -1331,7 +1315,6 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
/* find the IRQ */ /* find the IRQ */
php_ctlr->irq = dev->irq; php_ctlr->irq = dev->irq;
dbg("HPC interrupt = %d\n", php_ctlr->irq);
/* Save interrupt callback info */ /* Save interrupt callback info */
php_ctlr->attention_button_callback = pciehp_handle_attention_button; php_ctlr->attention_button_callback = pciehp_handle_attention_button;
...@@ -1359,15 +1342,12 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev) ...@@ -1359,15 +1342,12 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__);
goto abort_free_ctlr; goto abort_free_ctlr;
} }
dbg("%s : Mask HPIE hp_register_write_word SLOT_CTRL %x\n", __FUNCTION__, temp_word);
rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), slot_status); rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), slot_status);
if (rc) { if (rc) {
err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__); err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__);
goto abort_free_ctlr; goto abort_free_ctlr;
} }
dbg("%s: Mask HPIE SLOT_STATUS offset %x reads slot_status %x\n", __FUNCTION__, SLOT_STATUS(ctrl->cap_base)
, slot_status);
temp_word = 0x1F; /* Clear all events */ temp_word = 0x1F; /* Clear all events */
rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), temp_word); rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), temp_word);
...@@ -1375,7 +1355,6 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev) ...@@ -1375,7 +1355,6 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
err("%s : hp_register_write_word SLOT_STATUS failed\n", __FUNCTION__); err("%s : hp_register_write_word SLOT_STATUS failed\n", __FUNCTION__);
goto abort_free_ctlr; goto abort_free_ctlr;
} }
dbg("%s: SLOT_STATUS offset %x writes slot_status %x\n", __FUNCTION__, SLOT_STATUS(ctrl->cap_base), temp_word);
if (pciehp_poll_mode) {/* Install interrupt polling code */ if (pciehp_poll_mode) {/* Install interrupt polling code */
/* Install and start the interrupt polling timer */ /* Install and start the interrupt polling timer */
...@@ -1391,13 +1370,14 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev) ...@@ -1391,13 +1370,14 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
} }
} }
dbg("pciehp ctrl b:d:f:irq=0x%x:%x:%x:%x\n", pdev->bus->number,
PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), dev->irq);
rc = hp_register_read_word(pdev, SLOT_CTRL(ctrl->cap_base), temp_word); rc = hp_register_read_word(pdev, SLOT_CTRL(ctrl->cap_base), temp_word);
if (rc) { if (rc) {
err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_read_word SLOT_CTRL failed\n", __FUNCTION__);
goto abort_free_ctlr; goto abort_free_ctlr;
} }
dbg("%s: SLOT_CTRL %x value read %x\n", __FUNCTION__, SLOT_CTRL(ctrl->cap_base), temp_word);
dbg("%s: slot_cap %x\n", __FUNCTION__, slot_cap);
intr_enable = intr_enable | PRSN_DETECT_ENABLE; intr_enable = intr_enable | PRSN_DETECT_ENABLE;
...@@ -1417,7 +1397,6 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev) ...@@ -1417,7 +1397,6 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
} else { } else {
temp_word = (temp_word & ~HP_INTR_ENABLE) | HP_INTR_ENABLE; temp_word = (temp_word & ~HP_INTR_ENABLE) | HP_INTR_ENABLE;
} }
dbg("%s: temp_word %x\n", __FUNCTION__, temp_word);
/* Unmask Hot-plug Interrupt Enable for the interrupt notification mechanism case */ /* Unmask Hot-plug Interrupt Enable for the interrupt notification mechanism case */
rc = hp_register_write_word(pdev, SLOT_CTRL(ctrl->cap_base), temp_word); rc = hp_register_write_word(pdev, SLOT_CTRL(ctrl->cap_base), temp_word);
...@@ -1425,14 +1404,11 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev) ...@@ -1425,14 +1404,11 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__); err("%s : hp_register_write_word SLOT_CTRL failed\n", __FUNCTION__);
goto abort_free_ctlr; goto abort_free_ctlr;
} }
dbg("%s : Unmask HPIE hp_register_write_word SLOT_CTRL with %x\n", __FUNCTION__, temp_word);
rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), slot_status); rc = hp_register_read_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), slot_status);
if (rc) { if (rc) {
err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__); err("%s : hp_register_read_word SLOT_STATUS failed\n", __FUNCTION__);
goto abort_free_ctlr; goto abort_free_ctlr;
} }
dbg("%s: Unmask HPIE SLOT_STATUS offset %x reads slot_status %x\n", __FUNCTION__,
SLOT_STATUS(ctrl->cap_base), slot_status);
temp_word = 0x1F; /* Clear all events */ temp_word = 0x1F; /* Clear all events */
rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), temp_word); rc = hp_register_write_word(php_ctlr->pci_dev, SLOT_STATUS(ctrl->cap_base), temp_word);
...@@ -1440,7 +1416,6 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev) ...@@ -1440,7 +1416,6 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
err("%s : hp_register_write_word SLOT_STATUS failed\n", __FUNCTION__); err("%s : hp_register_write_word SLOT_STATUS failed\n", __FUNCTION__);
goto abort_free_ctlr; goto abort_free_ctlr;
} }
dbg("%s: SLOT_STATUS offset %x writes slot_status %x\n", __FUNCTION__, SLOT_STATUS(ctrl->cap_base), temp_word);
rc = get_hp_hw_control_from_firmware(ctrl->pci_dev); rc = get_hp_hw_control_from_firmware(ctrl->pci_dev);
if (rc) if (rc)
......
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