From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Oleksij Rempel (fishor)" <bug-track@fisher-privat.net>,
	"Dâniel Fraga" <fragabr@gmail.com>,
	"Andrey Rahmatullin" <wrar@wrar.name>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	linux-pm@lists.linux-foundation.org,
	"ACPI Devel Mailing List" <linux-acpi@vger.kernel.org>
Subject: Re: [RFT] PCI changes related to wakeup (was: Re: [linux-pm] ehci_hcd related S3 lockup on ASUS laptops, again)
Date: Wed, 13 Jun 2012 11:22:35 +0200	[thread overview]
Message-ID: <201206131122.36198.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1205311704340.1178-100000@iolanthe.rowland.org>
Hi Alan,
On Thursday, May 31, 2012, Alan Stern wrote:
> On Tue, 29 May 2012, Rafael J. Wysocki wrote:
> 
> > > > > Therefore we really do need a quirk, probably in ehci-hcd like the 
> > > > > original patch.  If it is restricted to apply only in cases where the 
> > > > > DMI information lists ASUSTeK as the manufacturer, perhaps that will be 
> > > > > sufficient.  (For some reason, the manufacturer field in Dâniel's BIOS 
> > > > > isn't initialized.)
> > > > 
> > > > Yeah.
> > > > 
> > > > I'll have a deeper look at this later today, I think.
> > > 
> > > It's easy enough to write such a check (or perhaps more reliably, check
> > > for a product name matching "P8Z68-V").
> > 
> > I think we should try to express it as a PCI quirk in quirks.c, though.
> 
> Here's my attempt.  Everybody, please try this patch with the
> 151b61284776 commit removed.  Make sure that CONFIG_USB_DEBUG is
> enabled so we can check the controller's power state during suspend, 
> and check that the "broken D3 during system sleep on ASUS" message 
> shows up during booting.
It looks like this worked for everyone concerned, is that correct?
In that case, do you intend to send this patch for inclusion any time soon?
It would be good to have this particular issue taken care of.
Thanks,
Rafael
> Index: usb-3.4/drivers/pci/pci.c
> ===================================================================
> --- usb-3.4.orig/drivers/pci/pci.c
> +++ usb-3.4/drivers/pci/pci.c
> @@ -1743,6 +1743,11 @@ int pci_prepare_to_sleep(struct pci_dev
>  	if (target_state == PCI_POWER_ERROR)
>  		return -EIO;
>  
> +	/* Some devices mustn't be in D3 during system sleep */
> +	if (target_state == PCI_D3hot &&
> +			(dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP))
> +		return 0;
> +
>  	pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev));
>  
>  	error = pci_set_power_state(dev, target_state);
> Index: usb-3.4/drivers/pci/quirks.c
> ===================================================================
> --- usb-3.4.orig/drivers/pci/quirks.c
> +++ usb-3.4/drivers/pci/quirks.c
> @@ -2917,6 +2917,32 @@ static void __devinit disable_igfx_irq(s
>  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq);
>  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
>  
> +/*
> + * The Intel 6 Series/C200 Series chipset's EHCI controllers on many
> + * ASUS motherboards will cause memory corruption or a system crash
> + * if they are in D3 while the system is put into S3 sleep.
> + */
> +static void __devinit asus_ehci_no_d3(struct pci_dev *dev)
> +{
> +	const char *sys_info;
> +	static const char good_Asus_board[] = "P8Z68-V";
> +
> +	if (dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP)
> +		return;
> +	if (dev->subsystem_vendor != PCI_VENDOR_ID_ASUSTEK)
> +		return;
> +	sys_info = dmi_get_system_info(DMI_BOARD_NAME);
> +	if (sys_info && memcmp(sys_info, good_Asus_board,
> +			sizeof(good_Asus_board) - 1) == 0)
> +		return;
> +
> +	dev_info(&dev->dev, "broken D3 during system sleep on ASUS\n");
> +	dev->dev_flags |= PCI_DEV_FLAGS_NO_D3_DURING_SLEEP;
> +	device_set_wakeup_capable(&dev->dev, false);
> +}
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1c26, asus_ehci_no_d3);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1c2d, asus_ehci_no_d3);
> +
>  static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
>  			  struct pci_fixup *end)
>  {
> Index: usb-3.4/include/linux/pci.h
> ===================================================================
> --- usb-3.4.orig/include/linux/pci.h
> +++ usb-3.4/include/linux/pci.h
> @@ -176,6 +176,8 @@ enum pci_dev_flags {
>  	PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2,
>  	/* Provide indication device is assigned by a Virtual Machine Manager */
>  	PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4,
> +	/* Device causes system crash if in D3 during S3 sleep */
> +	PCI_DEV_FLAGS_NO_D3_DURING_SLEEP = (__force pci_dev_flags_t) 8,
>  };
>  
>  enum pci_irq_reroute_variant {
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
next prev parent reply	other threads:[~2012-06-13  9:17 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44L0.1205252157430.24286-100000@saphir.localdomain>
     [not found] ` <1338005001.13348.279.camel@gandalf.stny.rr.com>
     [not found]   ` <201205262227.47442.rjw@sisk.pl>
2012-05-26 21:16     ` [RFT] PCI changes related to wakeup (was: Re: ehci_hcd related S3 lockup on ASUS laptops, again) Rafael J. Wysocki
2012-05-26 21:19       ` [RFT][PATCH 1/4] ACPI / PM: Make acpi_pm_device_sleep_state() follow the specification Rafael J. Wysocki
2012-05-26 21:20       ` [RFT][PATCH 2/4] PCI / PM: Make platform choose target low-power states of more devices Rafael J. Wysocki
2012-05-26 21:21       ` [RFT][PATCH 3/4] ACPI / PM: Shorten variable name in acpi_pm_device_sleep_state() Rafael J. Wysocki
2012-05-26 21:21       ` [RFT][PATCH 4/4] ACPI / PM: Fix interactions between _SxD and _SxW Rafael J. Wysocki
2012-05-26 21:47       ` [RFT] PCI changes related to wakeup (was: Re: ehci_hcd related S3 lockup on ASUS laptops, again) Andrey Rahmatullin
2012-05-26 22:06         ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Rafael J. Wysocki
2012-05-26 22:36           ` [RFT] PCI changes related to wakeup (was: " Andrey Rahmatullin
2012-05-26 22:40             ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Alan Stern
2012-05-26 22:59               ` [RFT] PCI changes related to wakeup (was: " Rafael J. Wysocki
2012-05-29 14:23                 ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Alan Stern
2012-05-29 17:29                   ` Rafael J. Wysocki
2012-05-29 18:50                     ` Alan Stern
2012-05-29 19:16                       ` Rafael J. Wysocki
2012-05-31 21:07                         ` Alan Stern
2012-05-31 21:29                           ` Rafael J. Wysocki
2012-06-01 15:13                             ` Alan Stern
2012-06-01 15:50                               ` Steven Rostedt
2012-06-01 15:59                                 ` [RFT] PCI changes related to wakeup (was: " Alan Stern
2012-06-01 17:01                                   ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Steven Rostedt
2012-06-01 17:17                                     ` [RFT] PCI changes related to wakeup (was: " Alan Stern
2012-06-01 17:23                                       ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Steven Rostedt
2012-06-01 16:01                                 ` [RFT] PCI changes related to wakeup (was: " Andrey Rahmatullin
2012-06-01 16:33                                   ` Alan Stern
2012-05-31 22:02                           ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Dâniel Fraga
2012-06-01 14:55                             ` Alan Stern
2012-05-31 22:25                           ` Andrey Rahmatullin
2012-06-13  9:22                           ` Rafael J. Wysocki [this message]
2012-06-13 14:21                             ` [RFT] PCI changes related to wakeup (was: " Alan Stern
2012-05-27 16:41             ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Alan Stern
2012-05-27 21:17               ` Andrey Rahmatullin
2012-05-28 20:13                 ` [RFT] PCI changes related to wakeup (was: " Rafael J. Wysocki
2012-05-29  7:48                   ` Andrey Rahmatullin
2012-05-29 17:30                     ` [RFT] PCI changes related to wakeup (was: Re: [linux-pm] " Rafael J. Wysocki
2012-05-29 22:39                   ` [RFT] PCI changes related to wakeup (was: " Steven Rostedt
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=201206131122.36198.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=bug-track@fisher-privat.net \
    --cc=fragabr@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rostedt@goodmis.org \
    --cc=stern@rowland.harvard.edu \
    --cc=wrar@wrar.name \
    /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;
as well as URLs for NNTP newsgroup(s).