From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI fixes for 2.6.4-rc1
Date: Fri, 27 Feb 2004 16:09:43 -0800 [thread overview]
Message-ID: <10779269834095@kroah.com> (raw)
In-Reply-To: <10779269831109@kroah.com>
ChangeSet 1.1617, 2004/02/24 11:08:29-08:00, dlsy@snoqualmie.dp.intel.com
[PATCH] PCI Hotplug: Patch to get polling mode in SHPC hot-plug driver properly working
Here is the patch to get polling mode in SHPC hot-plug properly
working.
drivers/pci/hotplug/pciehp_ctrl.c | 2 +
drivers/pci/hotplug/shpchp.h | 4 +--
drivers/pci/hotplug/shpchp_ctrl.c | 2 +
drivers/pci/hotplug/shpchp_hpc.c | 49 ++++++++++++++++++++++----------------
4 files changed, 35 insertions(+), 22 deletions(-)
diff -Nru a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
--- a/drivers/pci/hotplug/pciehp_ctrl.c Fri Feb 27 15:57:17 2004
+++ b/drivers/pci/hotplug/pciehp_ctrl.c Fri Feb 27 15:57:17 2004
@@ -188,11 +188,13 @@
/*
* Card Present
*/
+ info("Card present on Slot(%d)\n", ctrl->first_slot + hp_slot);
taskInfo->event_type = INT_PRESENCE_ON;
} else {
/*
* Not Present
*/
+ info("Card not present on Slot(%d)\n", ctrl->first_slot + hp_slot);
taskInfo->event_type = INT_PRESENCE_OFF;
}
diff -Nru a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
--- a/drivers/pci/hotplug/shpchp.h Fri Feb 27 15:57:17 2004
+++ b/drivers/pci/hotplug/shpchp.h Fri Feb 27 15:57:17 2004
@@ -390,8 +390,8 @@
/* Sleep for up to 1 second */
schedule_timeout(1*HZ);
} else {
- /* Sleep for up to 1.5 second */
- schedule_timeout(1.5*HZ);
+ /* Sleep for up to 2 seconds */
+ schedule_timeout(2*HZ);
}
set_current_state(TASK_RUNNING);
remove_wait_queue(&ctrl->queue, &wait);
diff -Nru a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
--- a/drivers/pci/hotplug/shpchp_ctrl.c Fri Feb 27 15:57:17 2004
+++ b/drivers/pci/hotplug/shpchp_ctrl.c Fri Feb 27 15:57:17 2004
@@ -192,11 +192,13 @@
/*
* Card Present
*/
+ info("Card present on Slot(%d)\n", ctrl->first_slot + hp_slot);
taskInfo->event_type = INT_PRESENCE_ON;
} else {
/*
* Not Present
*/
+ info("Card not present on Slot(%d)\n", ctrl->first_slot + hp_slot);
taskInfo->event_type = INT_PRESENCE_OFF;
}
diff -Nru a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c
--- a/drivers/pci/hotplug/shpchp_hpc.c Fri Feb 27 15:57:17 2004
+++ b/drivers/pci/hotplug/shpchp_hpc.c Fri Feb 27 15:57:17 2004
@@ -1071,9 +1071,14 @@
if (!shpchp_poll_mode) {
ctrl = (struct controller *)dev_id;
php_ctlr = ctrl->hpc_ctlr_handle;
- } else
+ } else {
php_ctlr = (struct php_ctlr_state_s *) dev_id;
+ ctrl = (struct controller *)php_ctlr->callback_instance_id;
+ }
+ if (!ctrl)
+ return IRQ_NONE;
+
if (!php_ctlr || !php_ctlr->creg)
return IRQ_NONE;
@@ -1085,18 +1090,20 @@
dbg("%s: shpc_isr proceeds\n", __FUNCTION__);
dbg("%s: intr_loc = %x\n",__FUNCTION__, intr_loc);
- /* Mask Global Interrupt Mask - see implementation note on p. 139 */
- /* of SHPC spec rev 1.0*/
- temp_dword = readl(php_ctlr->creg + SERR_INTR_ENABLE);
- dbg("%s: Before masking global interrupt, temp_dword = %x\n",
- __FUNCTION__, temp_dword);
- temp_dword |= 0x00000001;
- dbg("%s: After masking global interrupt, temp_dword = %x\n",
- __FUNCTION__, temp_dword);
- writel(temp_dword, php_ctlr->creg + SERR_INTR_ENABLE);
+ if(!shpchp_poll_mode) {
+ /* Mask Global Interrupt Mask - see implementation note on p. 139 */
+ /* of SHPC spec rev 1.0*/
+ temp_dword = readl(php_ctlr->creg + SERR_INTR_ENABLE);
+ dbg("%s: Before masking global interrupt, temp_dword = %x\n",
+ __FUNCTION__, temp_dword);
+ temp_dword |= 0x00000001;
+ dbg("%s: After masking global interrupt, temp_dword = %x\n",
+ __FUNCTION__, temp_dword);
+ writel(temp_dword, php_ctlr->creg + SERR_INTR_ENABLE);
- intr_loc2 = readl(php_ctlr->creg + INTR_LOC);
- dbg("%s: intr_loc2 = %x\n",__FUNCTION__, intr_loc2);
+ intr_loc2 = readl(php_ctlr->creg + INTR_LOC);
+ dbg("%s: intr_loc2 = %x\n",__FUNCTION__, intr_loc2);
+ }
if (intr_loc & 0x0001) {
/*
@@ -1159,14 +1166,16 @@
dbg("%s: intr_loc2 = %x\n",__FUNCTION__, intr_loc2);
}
}
- /* Unmask Global Interrupt Mask */
- temp_dword = readl(php_ctlr->creg + SERR_INTR_ENABLE);
- dbg("%s: 2-Before unmasking global interrupt, temp_dword = %x\n",
- __FUNCTION__, temp_dword);
- temp_dword &= 0xfffffffe;
- dbg("%s: 2-After unmasking global interrupt, temp_dword = %x\n",
- __FUNCTION__, temp_dword);
- writel(temp_dword, php_ctlr->creg + SERR_INTR_ENABLE);
+ if (!shpchp_poll_mode) {
+ /* Unmask Global Interrupt Mask */
+ temp_dword = readl(php_ctlr->creg + SERR_INTR_ENABLE);
+ dbg("%s: 2-Before unmasking global interrupt, temp_dword = %x\n",
+ __FUNCTION__, temp_dword);
+ temp_dword &= 0xfffffffe;
+ dbg("%s: 2-After unmasking global interrupt, temp_dword = %x\n",
+ __FUNCTION__, temp_dword);
+ writel(temp_dword, php_ctlr->creg + SERR_INTR_ENABLE);
+ }
return IRQ_HANDLED;
}
next prev parent reply other threads:[~2004-02-28 0:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-28 0:07 [BK PATCH] PCI fixes for 2.6.4-rc1 Greg KH
2004-02-28 0:09 ` [PATCH] " Greg KH
2004-02-28 0:09 ` Greg KH
2004-02-28 0:09 ` Greg KH
2004-02-28 0:09 ` Greg KH
2004-02-28 0:09 ` Greg KH [this message]
2004-02-28 0:09 ` Greg KH
2004-02-28 0:09 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10779269834095@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.