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);
} }
} }
......
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