firewire: ohci: restore GUID on resume.
authorMaxim Levitsky <maximlevitsky@gmail.com>
Mon, 29 Nov 2010 02:09:49 +0000 (04:09 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Mon, 13 Dec 2010 19:39:15 +0000 (20:39 +0100)
Some lousy BIOSes, e.g. my Aspire 5720 BIOS forget to restore the GUID
register on resume from RAM.

Fix that by setting it to the last value that was read from it.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/ohci.c

index eb7b591e1c1b5813346f565b8fc9452c7015a0db..3a908038ff6243fa39938c1ed8c01271c47fac27 100644 (file)
@@ -3284,6 +3284,13 @@ static int pci_resume(struct pci_dev *dev)
                return err;
        }
 
+       /* Some systems don't setup GUID register on resume from ram  */
+       if (!reg_read(ohci, OHCI1394_GUIDLo) &&
+                                       !reg_read(ohci, OHCI1394_GUIDHi)) {
+               reg_write(ohci, OHCI1394_GUIDLo, (u32)ohci->card.guid);
+               reg_write(ohci, OHCI1394_GUIDHi, (u32)(ohci->card.guid >> 32));
+       }
+
        return ohci_enable(&ohci->card, NULL, 0);
 }
 #endif