mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Adrian Bunk <bunk@stusta.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.16.27] Fix broken suspend/resume in ohci1394
Date: Thu, 10 Aug 2006 18:43:57 +0200 (CEST)	[thread overview]
Message-ID: <tkrat.9c03382e3448b2ab@s5r6.in-berlin.de> (raw)
In-Reply-To: <44DB1F19.8000504@s5r6.in-berlin.de>

Date: Mon, 22 May 2006 16:57:16 -0600
From: Robert Hancock <hancockr@shaw.ca>
Subject: Fix broken suspend/resume in ohci1394 (Was: ACPI suspend problems revisited)

I've been experimenting to track down the cause of suspend/resume problems
on my Compaq Presario X1050 laptop:

http://bugzilla.kernel.org/show_bug.cgi?id=6075

Essentially the ACPI Embedded Controller and keyboard controller would
get into a bizarre, confused state after resume.

I found that unloading the ohci1394 module before suspend and reloading it
after resume made the problem go away.  Diffing the dmesg output from
resume, with and without the module loaded, I found that with the module
loaded I was missing these:

PM: Writing back config space on device 0000:02:00.0 at offset 1. (Was 2100080, writing 2100007)
PM: Writing back config space on device 0000:02:00.0 at offset 3. (Was 0, writing 8008)
PM: Writing back config space on device 0000:02:00.0 at offset 4. (Was 0, writing 90200000)
PM: Writing back config space on device 0000:02:00.0 at offset 5. (Was 1, writing 2401)
PM: Writing back config space on device 0000:02:00.0 at offset f. (Was 20000100, writing 2000010a)

The default PCI driver performs the pci_restore_state when no driver is
loaded for the device.  When the ohci1394 driver is loaded, it is supposed
to do this, however it appears not to do so.

I created the patch below and tested it, and it appears to resolve the
suspend problems I was having with the module loaded.  I only added in the
pci_save_state and pci_restore_state - however, though I know little of
this hardware, surely the driver should really be doing more than this when
suspending and resuming?  Currently it does almost nothing, what if there
are commands in progress, etc?

Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
This patch also appeared in 2.6.17.2 and 2.6.18.  There is still some
functionality missing for full resume capability in ohci1394.

Index: linux-2.6.16.27/drivers/ieee1394/ohci1394.c
===================================================================
--- linux-2.6.16.27.orig/drivers/ieee1394/ohci1394.c	2006-08-10 18:10:13.000000000 +0200
+++ linux-2.6.16.27/drivers/ieee1394/ohci1394.c	2006-08-10 18:11:45.000000000 +0200
@@ -3536,6 +3536,7 @@ static int ohci1394_pci_resume (struct p
 	}
 #endif /* CONFIG_PPC_PMAC */
 
+	pci_restore_state(pdev);
 	pci_enable_device(pdev);
 
 	return 0;
@@ -3555,6 +3556,8 @@ static int ohci1394_pci_suspend (struct 
 	}
 #endif
 
+	pci_save_state(pdev);
+
 	return 0;
 }
 



  reply	other threads:[~2006-08-10 16:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-09 21:45 Adrian Bunk is now taking over the 2.6.16-stable branch Chuck Ebbert
2006-08-09 22:00 ` Adrian Bunk
2006-08-09 22:18   ` Greg KH
2006-08-09 22:45     ` Adrian Bunk
2006-08-09 22:53       ` Greg KH
2006-08-09 23:05         ` Chris Wright
2006-08-09 23:20     ` Rene Scharfe
2006-08-10 11:57   ` Stefan Richter
2006-08-10 16:43     ` Stefan Richter [this message]
2006-08-10 16:45     ` [PATCH 2.6.16.27] ieee1394: sbp2: enable auto spin-up for Maxtor disks Stefan Richter
2006-08-12 16:24     ` Adrian Bunk is now taking over the 2.6.16-stable branch Adrian Bunk

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=tkrat.9c03382e3448b2ab@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=bunk@stusta.de \
    --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®