From: Dave Airlie <airlied@linux.ie>
To: linux-kernel@vger.kernel.org
Subject: fix suspend/resume irq request free for yenta..
Date: Fri, 22 Jul 2005 23:33:20 +0100 (IST) [thread overview]
Message-ID: <Pine.LNX.4.58.0507222331580.15287@skynet> (raw)
[-- Attachment #1: Type: TEXT/PLAIN, Size: 265 bytes --]
Without this patch my laptop fails to resume from suspend to RAM...
It applies against a pretty recent 2.6.13-rc3 from git..
Dave.
--
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
Linux kernel - DRI, VAX / pam_smb / ILUG
[-- Attachment #2: Type: TEXT/PLAIN, Size: 1875 bytes --]
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -872,10 +872,20 @@ static irqreturn_t yenta_probe_handler(i
return IRQ_NONE;
}
+static int yenta_request_irq(struct yenta_socket *socket)
+{
+ if (request_irq(socket->cb_irq, yenta_probe_handler, SA_SHIRQ, "yenta", socket)) {
+ printk(KERN_WARNING "Yenta: request_irq() in yenta_probe_cb_irq() failed!\n");
+ return -1;
+ }
+ return 0;
+}
+
/* probes the PCI interrupt, use only on override functions */
static int yenta_probe_cb_irq(struct yenta_socket *socket)
{
u16 bridge_ctrl;
+ int ret;
if (!socket->cb_irq)
return -1;
@@ -887,10 +897,9 @@ static int yenta_probe_cb_irq(struct yen
bridge_ctrl &= ~CB_BRIDGE_INTR;
config_writew(socket, CB_BRIDGE_CONTROL, bridge_ctrl);
- if (request_irq(socket->cb_irq, yenta_probe_handler, SA_SHIRQ, "yenta", socket)) {
- printk(KERN_WARNING "Yenta: request_irq() in yenta_probe_cb_irq() failed!\n");
- return -1;
- }
+ ret = yenta_request_irq(socket);
+ if (ret==-1)
+ return ret;
/* generate interrupt, wait */
exca_writeb(socket, I365_CSCINT, I365_CSC_STSCHG);
@@ -1101,6 +1110,7 @@ static int yenta_dev_suspend (struct pci
if (socket->type && socket->type->save_state)
socket->type->save_state(socket);
+ free_irq(dev->irq, socket);
/* FIXME: pci_save_state needs to have a better interface */
pci_save_state(dev);
pci_read_config_dword(dev, 16*4, &socket->saved_state[0]);
@@ -1131,6 +1141,7 @@ static int yenta_dev_resume (struct pci_
pci_write_config_dword(dev, 17*4, socket->saved_state[1]);
pci_enable_device(dev);
pci_set_master(dev);
+ yenta_request_irq(socket);
if (socket->type && socket->type->restore_state)
socket->type->restore_state(socket);
next reply other threads:[~2005-07-22 22:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-22 22:33 Dave Airlie [this message]
2005-07-22 23:16 ` Dmitry Torokhov
2005-07-23 0:29 ` Pavel Machek
2005-07-23 7:40 ` Russell King
2005-07-23 15:41 ` Zwane Mwaikambo
2005-07-23 22:40 ` Dave Airlie
2005-07-24 8:19 ` Russell King
2005-07-23 23:46 Daniel Ritz
2005-07-26 5:44 Brown, Len
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=Pine.LNX.4.58.0507222331580.15287@skynet \
--to=airlied@linux.ie \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®