@@ -176,6 +176,8 @@ static void check_and_reset_hc(struct uhci_hcd *uhci)
176
176
*/
177
177
static void configure_hc (struct uhci_hcd * uhci )
178
178
{
179
+ struct pci_dev * pdev = to_pci_dev (uhci_dev (uhci ));
180
+
179
181
/* Set the frame length to the default: 1 ms exactly */
180
182
outb (USBSOF_DEFAULT , uhci -> io_addr + USBSOF );
181
183
@@ -191,8 +193,11 @@ static void configure_hc(struct uhci_hcd *uhci)
191
193
mb ();
192
194
193
195
/* Enable PIRQ */
194
- pci_write_config_word (to_pci_dev (uhci_dev (uhci )), USBLEGSUP ,
195
- USBLEGSUP_DEFAULT );
196
+ pci_write_config_word (pdev , USBLEGSUP , USBLEGSUP_DEFAULT );
197
+
198
+ /* Disable platform-specific non-PME# wakeup */
199
+ if (pdev -> vendor == PCI_VENDOR_ID_INTEL )
200
+ pci_write_config_byte (pdev , USBRES_INTEL , 0 );
196
201
}
197
202
198
203
@@ -791,6 +796,7 @@ static int uhci_rh_resume(struct usb_hcd *hcd)
791
796
static int uhci_pci_suspend (struct usb_hcd * hcd , bool do_wakeup )
792
797
{
793
798
struct uhci_hcd * uhci = hcd_to_uhci (hcd );
799
+ struct pci_dev * pdev = to_pci_dev (uhci_dev (uhci ));
794
800
int rc = 0 ;
795
801
796
802
dev_dbg (uhci_dev (uhci ), "%s\n" , __func__ );
@@ -808,11 +814,15 @@ static int uhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
808
814
/* All PCI host controllers are required to disable IRQ generation
809
815
* at the source, so we must turn off PIRQ.
810
816
*/
811
- pci_write_config_word (to_pci_dev (uhci_dev (uhci )), USBLEGSUP , 0 );
812
- mb ();
817
+ pci_write_config_word (pdev , USBLEGSUP , 0 );
813
818
clear_bit (HCD_FLAG_POLL_RH , & hcd -> flags );
814
819
815
- /* FIXME: Enable non-PME# remote wakeup? */
820
+ /* Enable platform-specific non-PME# wakeup */
821
+ if (do_wakeup ) {
822
+ if (pdev -> vendor == PCI_VENDOR_ID_INTEL )
823
+ pci_write_config_byte (pdev , USBRES_INTEL ,
824
+ USBPORT1EN | USBPORT2EN );
825
+ }
816
826
817
827
done_okay :
818
828
clear_bit (HCD_FLAG_HW_ACCESSIBLE , & hcd -> flags );
@@ -831,16 +841,13 @@ static int uhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
831
841
* even if the controller was dead.
832
842
*/
833
843
set_bit (HCD_FLAG_HW_ACCESSIBLE , & hcd -> flags );
834
- mb ();
835
844
836
845
spin_lock_irq (& uhci -> lock );
837
846
838
847
/* Make sure resume from hibernation re-enumerates everything */
839
848
if (hibernated )
840
849
uhci_hc_died (uhci );
841
850
842
- /* FIXME: Disable non-PME# remote wakeup? */
843
-
844
851
/* The firmware or a boot kernel may have changed the controller
845
852
* settings during a system wakeup. Check it and reconfigure
846
853
* to avoid problems.
@@ -850,12 +857,9 @@ static int uhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
850
857
/* If the controller was dead before, it's back alive now */
851
858
configure_hc (uhci );
852
859
853
- if (uhci -> rh_state == UHCI_RH_RESET ) {
854
-
855
- /* The controller had to be reset */
860
+ /* Tell the core if the controller had to be reset */
861
+ if (uhci -> rh_state == UHCI_RH_RESET )
856
862
usb_root_hub_lost_power (hcd -> self .root_hub );
857
- suspend_rh (uhci , UHCI_RH_SUSPENDED );
858
- }
859
863
860
864
spin_unlock_irq (& uhci -> lock );
861
865
0 commit comments