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

Reply via email to