From: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
I'm announcing the release of the 4.9.261 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2
drivers/block/rsxx/core.c | 8 +-
drivers/iommu/amd_iommu.c | 10 +--
drivers/md/dm-table.c | 91 ++++++++++++++++++-----------
drivers/misc/eeprom/eeprom_93xx46.c | 15 ++++
drivers/pci/quirks.c | 3
drivers/platform/x86/acer-wmi.c | 8 ++
fs/btrfs/raid56.c | 58 +++++++-----------
include/linux/eeprom_93xx46.h | 2
sound/pci/ctxfi/cthw20k2.c | 2
tools/usb/usbip/libsrc/usbip_host_common.c | 2
11 files changed, 123 insertions(+), 78 deletions(-)
Andrey Ryabinin (1):
iommu/amd: Fix sleeping in atomic in increase_address_space()
Antonio Borneo (1):
usbip: tools: fix build error for multiple definition
Aswath Govindraju (1):
misc: eeprom_93xx46: Add quirk to support Microchip 93LC46B eeprom
Bjorn Helgaas (1):
PCI: Add function 1 DMA alias quirk for Marvell 9215 SATA controller
Colin Ian King (1):
ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits
Dan Carpenter (1):
rsxx: Return -EFAULT if copy_to_user() fails
David Sterba (1):
btrfs: raid56: simplify tracking of Q stripe presence
Greg Kroah-Hartman (1):
Linux 4.9.261
Hans de Goede (1):
platform/x86: acer-wmi: Add new force_caps module parameter
Ira Weiny (1):
btrfs: fix raid6 qstripe kmap
Jeffle Xu (2):
dm table: fix iterate_devices based device capability checks
dm table: fix DAX iterate_devices based device capability checks
From: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
I'm announcing the release of the 4.4.261 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2
drivers/block/rsxx/core.c | 8 ++-
drivers/md/dm-table.c | 83 +++++++++++++++++++++++++---------------
drivers/pci/quirks.c | 3 +
drivers/platform/x86/acer-wmi.c | 8 +++
kernel/futex.c | 4 +
sound/pci/ctxfi/cthw20k2.c | 2
7 files changed, 73 insertions(+), 37 deletions(-)
Bjorn Helgaas (1):
PCI: Add function 1 DMA alias quirk for Marvell 9215 SATA controller
Colin Ian King (1):
ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits
Dan Carpenter (1):
rsxx: Return -EFAULT if copy_to_user() fails
Greg Kroah-Hartman (1):
Linux 4.4.261
Hans de Goede (1):
platform/x86: acer-wmi: Add new force_caps module parameter
Jeffle Xu (1):
dm table: fix iterate_devices based device capability checks
Thomas Schoebel-Theuer (2):
futex: fix irq self-deadlock and satisfy assertion
futex: fix spin_lock() / spin_unlock_irq() imbalance
From: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
This is the start of the stable review cycle for the 5.10.23 release.
There are 49 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Fri, 12 Mar 2021 13:23:09 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.23-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.10.23-rc1
Pascal Terjan <pterjan(a)google.com>
nvme-pci: add quirks for Lexar 256GB SSD
Julian Einwag <jeinwag-nvme(a)marcapo.com>
nvme-pci: mark Seagate Nytro XM1440 as QUIRK_NO_NS_DESC_LIST.
Babu Moger <babu.moger(a)amd.com>
KVM: SVM: Clear the CR4 register on reset
Avri Altman <avri.altman(a)wdc.com>
scsi: ufs: Fix a duplicate dev quirk number
Pierre-Louis Bossart <pierre-louis.bossart(a)linux.intel.com>
ASoC: Intel: sof_sdw: add quirk for HP Spectre x360 convertible
Pierre-Louis Bossart <pierre-louis.bossart(a)linux.intel.com>
ASoC: Intel: sof_sdw: reorganize quirks by generation
Nadeem Athani <nadeem(a)cadence.com>
PCI: cadence: Retrain Link to work around Gen2 training defect
Fabian Lesniak <fabian(a)lesniak-it.de>
ALSA: usb-audio: add mixer quirks for Pioneer DJM-900NXS2
Olivia Mackintosh <livvy(a)base.nu>
ALSA: usb-audio: Add DJM750 to Pioneer mixer quirk
Hans de Goede <hdegoede(a)redhat.com>
HID: i2c-hid: Add I2C_HID_QUIRK_NO_IRQ_AFTER_RESET for ITE8568 EC on Voyo Winpad A15
Jisheng Zhang <Jisheng.Zhang(a)synaptics.com>
mmc: sdhci-of-dwcmshc: set SDHCI_QUIRK2_PRESET_VALUE_BROKEN
AngeloGioacchino Del Regno <angelogioacchino.delregno(a)somainline.org>
drm/msm/a5xx: Remove overwriting A5XX_PC_DBG_ECO_CNTL register
Kiwoong Kim <kwmad.kim(a)samsung.com>
scsi: ufs: ufs-exynos: Use UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE
Kiwoong Kim <kwmad.kim(a)samsung.com>
scsi: ufs: ufs-exynos: Apply vendor-specific values for three timeouts
Kiwoong Kim <kwmad.kim(a)samsung.com>
scsi: ufs: Introduce a quirk to allow only page-aligned sg entries
Aswath Govindraju <a-govindraju(a)ti.com>
misc: eeprom_93xx46: Add quirk to support Microchip 93LC46B eeprom
Kiwoong Kim <kwmad.kim(a)samsung.com>
scsi: ufs: Add a quirk to permit overriding UniPro defaults
Stanley Chu <stanley.chu(a)mediatek.com>
scsi: ufs-mediatek: Enable UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL
Pierre-Louis Bossart <pierre-louis.bossart(a)linux.intel.com>
ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A32
Vitaly Kuznetsov <vkuznets(a)redhat.com>
KVM: x86: Supplement __cr4_reserved_bits() with X86_FEATURE_PCID check
Bjorn Helgaas <bhelgaas(a)google.com>
PCI: Add function 1 DMA alias quirk for Marvell 9215 SATA controller
Roger Quadros <rogerq(a)ti.com>
usb: cdns3: fix NULL pointer dereference on no platform data
Peter Chen <peter.chen(a)nxp.com>
usb: cdns3: add quirk for enable runtime pm by default
Peter Chen <peter.chen(a)nxp.com>
usb: cdns3: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT
Peter Chen <peter.chen(a)nxp.com>
usb: cdns3: host: add .suspend_quirk for xhci-plat.c
Chris Chiu <chiu(a)endlessos.org>
ASoC: Intel: bytcr_rt5640: Add quirk for ARCHOS Cesium 140
Jasper St. Pierre <jstpierre(a)mecheye.net>
ACPI: video: Add DMI quirk for GIGABYTE GB-BXBT-2807
Daniel Lee Kruse <daniel.lee.kruse(a)protonmail.com>
media: cx23885: add more quirks for reset DMA on some AMD IOMMU
Ethan Warth <redyoshi49q(a)gmail.com>
HID: mf: add support for 0079:1846 Mayflash/Dragonrise USB Gamecube Adapter
Hans de Goede <hdegoede(a)redhat.com>
platform/x86: acer-wmi: Add ACER_CAP_KBD_DOCK quirk for the Aspire Switch 10E SW3-016
Hans de Goede <hdegoede(a)redhat.com>
platform/x86: acer-wmi: Add support for SW_TABLET_MODE on Switch devices
Hans de Goede <hdegoede(a)redhat.com>
platform/x86: acer-wmi: Add ACER_CAP_SET_FUNCTION_MODE capability flag
Hans de Goede <hdegoede(a)redhat.com>
platform/x86: acer-wmi: Add new force_caps module parameter
Hans de Goede <hdegoede(a)redhat.com>
platform/x86: acer-wmi: Cleanup accelerometer device handling
Hans de Goede <hdegoede(a)redhat.com>
platform/x86: acer-wmi: Cleanup ACER_CAP_FOO defines
Alex Elder <elder(a)linaro.org>
net: ipa: ignore CHANNEL_NOT_RUNNING errors
Tony Lindgren <tony(a)atomide.com>
bus: ti-sysc: Implement GPMC debug quirk to drop platform data
Pierre-Louis Bossart <pierre-louis.bossart(a)linux.intel.com>
ASoC: Intel: sof_sdw: add quirk for new TigerLake-SDCA device
Tsuchiya Yuto <kitakar(a)gmail.com>
mwifiex: pcie: skip cancel_work_sync() on reset failure path
Abhishek Pandit-Subedi <abhishekpandit(a)chromium.org>
Bluetooth: btqca: Add valid le states quirk
Brent Lu <brent.lu(a)intel.com>
ASoC: intel: sof_rt5682: Add quirk for Dooly
Andrey Ryabinin <arbn(a)yandex-team.com>
iommu/amd: Fix sleeping in atomic in increase_address_space()
Nikolay Borisov <nborisov(a)suse.com>
btrfs: don't flush from btrfs_delayed_inode_reserve_metadata
Nikolay Borisov <nborisov(a)suse.com>
btrfs: export and rename qgroup_reserve_meta
Nathan Chancellor <nathan(a)kernel.org>
arm64: Make CPU_BIG_ENDIAN depend on ld.bfd or ld.lld 13.0.0+
Helge Deller <deller(a)gmx.de>
parisc: Enable -mlong-calls gcc option with CONFIG_COMPILE_TEST
Zoltán Böszörményi <zboszor(a)gmail.com>
nvme-pci: mark Kingston SKC2000 as not supporting the deepest power state
Pierre-Louis Bossart <pierre-louis.bossart(a)linux.intel.com>
ASoC: SOF: Intel: broadwell: fix mutual exclusion with catpt driver
Hans de Goede <hdegoede(a)redhat.com>
ACPICA: Fix race in generic_serial_bus (I2C) and GPIO op_region parameter handling
-------------
Diffstat:
Makefile | 4 +-
arch/arm64/Kconfig | 5 +-
arch/parisc/Kconfig | 7 +-
arch/x86/kvm/svm/svm.c | 1 +
arch/x86/kvm/x86.h | 2 +
drivers/acpi/acpica/acobject.h | 1 +
drivers/acpi/acpica/evhandler.c | 7 +
drivers/acpi/acpica/evregion.c | 64 +++-
drivers/acpi/acpica/evxfregn.c | 2 +
drivers/acpi/video_detect.c | 7 +
drivers/bluetooth/hci_qca.c | 19 +-
drivers/bus/ti-sysc.c | 10 +
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 2 -
drivers/hid/hid-ids.h | 3 +
drivers/hid/hid-mf.c | 2 +
drivers/hid/hid-quirks.c | 2 +
drivers/hid/i2c-hid/i2c-hid-core.c | 2 +
drivers/iommu/amd/iommu.c | 10 +-
drivers/media/pci/cx23885/cx23885-core.c | 4 +
drivers/misc/eeprom/eeprom_93xx46.c | 15 +
drivers/mmc/host/sdhci-of-dwcmshc.c | 1 +
drivers/net/ipa/gsi.c | 24 +-
drivers/net/wireless/marvell/mwifiex/pcie.c | 18 +-
drivers/net/wireless/marvell/mwifiex/pcie.h | 2 +
drivers/nvme/host/pci.c | 8 +-
drivers/pci/controller/cadence/pci-j721e.c | 3 +
drivers/pci/controller/cadence/pcie-cadence-host.c | 81 ++++-
drivers/pci/controller/cadence/pcie-cadence.h | 11 +-
drivers/pci/quirks.c | 3 +
drivers/platform/x86/acer-wmi.c | 169 ++++++++--
drivers/scsi/ufs/ufs-exynos.c | 9 +-
drivers/scsi/ufs/ufs-mediatek.c | 1 +
drivers/scsi/ufs/ufshcd.c | 42 +--
drivers/scsi/ufs/ufshcd.h | 10 +
drivers/usb/cdns3/core.c | 3 +-
drivers/usb/cdns3/core.h | 4 +
drivers/usb/cdns3/host-export.h | 6 +
drivers/usb/cdns3/host.c | 60 +++-
fs/btrfs/delayed-inode.c | 3 +-
fs/btrfs/inode.c | 2 +-
fs/btrfs/qgroup.c | 8 +-
fs/btrfs/qgroup.h | 2 +
include/linux/eeprom_93xx46.h | 2 +
include/linux/platform_data/ti-sysc.h | 1 +
sound/soc/intel/boards/bytcr_rt5640.c | 12 +
sound/soc/intel/boards/sof_rt5682.c | 18 +
sound/soc/intel/boards/sof_sdw.c | 78 +++--
sound/soc/sof/intel/Kconfig | 2 +-
sound/usb/mixer_quirks.c | 367 ++++++++++++++-------
49 files changed, 861 insertions(+), 258 deletions(-)
This is a note to let you know that I've just added the patch titled
xhci: Improve detection of device initiated wake signal.
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 253f588c70f66184b1f3a9bbb428b49bbda73e80 Mon Sep 17 00:00:00 2001
From: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Date: Thu, 11 Mar 2021 13:53:51 +0200
Subject: xhci: Improve detection of device initiated wake signal.
A xHC USB 3 port might miss the first wake signal from a USB 3 device
if the port LFPS reveiver isn't enabled fast enough after xHC resume.
xHC host will anyway be resumed by a PME# signal, but will go back to
suspend if no port activity is seen.
The device resends the U3 LFPS wake signal after a 100ms delay, but
by then host is already suspended, starting all over from the
beginning of this issue.
USB 3 specs say U3 wake LFPS signal is sent for max 10ms, then device
needs to delay 100ms before resending the wake.
Don't suspend immediately if port activity isn't detected in resume.
Instead add a retry. If there is no port activity then delay for 120ms,
and re-check for port activity.
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Link: https://lore.kernel.org/r/20210311115353.2137560-3-mathias.nyman@linux.inte…
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/host/xhci.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index bd27bd670104..48a68fcf2b36 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1088,6 +1088,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
struct usb_hcd *secondary_hcd;
int retval = 0;
bool comp_timer_running = false;
+ bool pending_portevent = false;
if (!hcd->state)
return 0;
@@ -1226,13 +1227,22 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
done:
if (retval == 0) {
- /* Resume root hubs only when have pending events. */
- if (xhci_pending_portevent(xhci)) {
+ /*
+ * Resume roothubs only if there are pending events.
+ * USB 3 devices resend U3 LFPS wake after a 100ms delay if
+ * the first wake signalling failed, give it that chance.
+ */
+ pending_portevent = xhci_pending_portevent(xhci);
+ if (!pending_portevent) {
+ msleep(120);
+ pending_portevent = xhci_pending_portevent(xhci);
+ }
+
+ if (pending_portevent) {
usb_hcd_resume_root_hub(xhci->shared_hcd);
usb_hcd_resume_root_hub(hcd);
}
}
-
/*
* If system is subject to the Quirk, Compliance Mode Timer needs to
* be re-initialized Always after a system resume. Ports are subject
--
2.30.2
This is a note to let you know that I've just added the patch titled
usb: xhci: do not perform Soft Retry for some xHCI hosts
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From a4a251f8c23518899d2078c320cf9ce2fa459c9f Mon Sep 17 00:00:00 2001
From: Stanislaw Gruszka <stf_xl(a)wp.pl>
Date: Thu, 11 Mar 2021 13:53:50 +0200
Subject: usb: xhci: do not perform Soft Retry for some xHCI hosts
On some systems rt2800usb and mt7601u devices are unable to operate since
commit f8f80be501aa ("xhci: Use soft retry to recover faster from
transaction errors")
Seems that some xHCI controllers can not perform Soft Retry correctly,
affecting those devices.
To avoid the problem add xhci->quirks flag that restore pre soft retry
xhci behaviour for affected xHCI controllers. Currently those are
AMD_PROMONTORYA_4 and AMD_PROMONTORYA_2, since it was confirmed
by the users: on those xHCI hosts issue happen and is gone after
disabling Soft Retry.
[minor commit message rewording for checkpatch -Mathias]
Fixes: f8f80be501aa ("xhci: Use soft retry to recover faster from transaction errors")
Cc: <stable(a)vger.kernel.org> # 4.20+
Reported-by: Bernhard <bernhard.gebetsberger(a)gmx.at>
Tested-by: Bernhard <bernhard.gebetsberger(a)gmx.at>
Signed-off-by: Stanislaw Gruszka <stf_xl(a)wp.pl>
Signed-off-by: Mathias Nyman <mathias.nyman(a)linux.intel.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202541
Link: https://lore.kernel.org/r/20210311115353.2137560-2-mathias.nyman@linux.inte…
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/host/xhci-pci.c | 5 +++++
drivers/usb/host/xhci-ring.c | 3 ++-
drivers/usb/host/xhci.h | 1 +
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 84da8406d5b4..1f989a49c8c6 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -295,6 +295,11 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
pdev->device == 0x9026)
xhci->quirks |= XHCI_RESET_PLL_ON_DISCONNECT;
+ if (pdev->vendor == PCI_VENDOR_ID_AMD &&
+ (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_2 ||
+ pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4))
+ xhci->quirks |= XHCI_NO_SOFT_RETRY;
+
if (xhci->quirks & XHCI_RESET_ON_RESUME)
xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
"QUIRK: Resetting on resume");
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 5e548a1c93ab..ce38076901e2 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2484,7 +2484,8 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td,
remaining = 0;
break;
case COMP_USB_TRANSACTION_ERROR:
- if ((ep_ring->err_count++ > MAX_SOFT_RETRY) ||
+ if (xhci->quirks & XHCI_NO_SOFT_RETRY ||
+ (ep_ring->err_count++ > MAX_SOFT_RETRY) ||
le32_to_cpu(slot_ctx->tt_info) & TT_SLOT)
break;
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index d41de5dc0452..ca822ad3b65b 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1891,6 +1891,7 @@ struct xhci_hcd {
#define XHCI_SKIP_PHY_INIT BIT_ULL(37)
#define XHCI_DISABLE_SPARSE BIT_ULL(38)
#define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39)
+#define XHCI_NO_SOFT_RETRY BIT_ULL(40)
unsigned int num_active_eps;
unsigned int limit_active_eps;
--
2.30.2
If port terminations are detected in suspend, but link never reaches U0
then xHCI may have an internal uncleared wake state that will cause an
immediate wake after suspend.
This wake state is normally cleared when driver clears the PORT_CSC bit,
which is set after a device is enabled and in U0.
Write 1 to clear PORT_CSC for ports that don't have anything connected
when suspending. This makes sure any pending internal wake states in
xHCI are cleared.
Cc: stable(a)vger.kernel.org
Tested-by: Mika Westerberg <mika.westerberg(a)linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman(a)linux.intel.com>
---
drivers/usb/host/xhci.c | 62 ++++++++++++++++++++---------------------
1 file changed, 30 insertions(+), 32 deletions(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 48a68fcf2b36..1975016f46bf 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -883,44 +883,42 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci)
xhci_set_cmd_ring_deq(xhci);
}
-static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci)
+/*
+ * Disable port wake bits if do_wakeup is not set.
+ *
+ * Also clear a possible internal port wake state left hanging for ports that
+ * detected termination but never successfully enumerated (trained to 0U).
+ * Internal wake causes immediate xHCI wake after suspend. PORT_CSC write done
+ * at enumeration clears this wake, force one here as well for unconnected ports
+ */
+
+static void xhci_disable_hub_port_wake(struct xhci_hcd *xhci,
+ struct xhci_hub *rhub,
+ bool do_wakeup)
{
- struct xhci_port **ports;
- int port_index;
unsigned long flags;
u32 t1, t2, portsc;
+ int i;
spin_lock_irqsave(&xhci->lock, flags);
- /* disable usb3 ports Wake bits */
- port_index = xhci->usb3_rhub.num_ports;
- ports = xhci->usb3_rhub.ports;
- while (port_index--) {
- t1 = readl(ports[port_index]->addr);
- portsc = t1;
- t1 = xhci_port_state_to_neutral(t1);
- t2 = t1 & ~PORT_WAKE_BITS;
- if (t1 != t2) {
- writel(t2, ports[port_index]->addr);
- xhci_dbg(xhci, "disable wake bits port %d-%d, portsc: 0x%x, write: 0x%x\n",
- xhci->usb3_rhub.hcd->self.busnum,
- port_index + 1, portsc, t2);
- }
- }
+ for (i = 0; i < rhub->num_ports; i++) {
+ portsc = readl(rhub->ports[i]->addr);
+ t1 = xhci_port_state_to_neutral(portsc);
+ t2 = t1;
+
+ /* clear wake bits if do_wake is not set */
+ if (!do_wakeup)
+ t2 &= ~PORT_WAKE_BITS;
+
+ /* Don't touch csc bit if connected or connect change is set */
+ if (!(portsc & (PORT_CSC | PORT_CONNECT)))
+ t2 |= PORT_CSC;
- /* disable usb2 ports Wake bits */
- port_index = xhci->usb2_rhub.num_ports;
- ports = xhci->usb2_rhub.ports;
- while (port_index--) {
- t1 = readl(ports[port_index]->addr);
- portsc = t1;
- t1 = xhci_port_state_to_neutral(t1);
- t2 = t1 & ~PORT_WAKE_BITS;
if (t1 != t2) {
- writel(t2, ports[port_index]->addr);
- xhci_dbg(xhci, "disable wake bits port %d-%d, portsc: 0x%x, write: 0x%x\n",
- xhci->usb2_rhub.hcd->self.busnum,
- port_index + 1, portsc, t2);
+ writel(t2, rhub->ports[i]->addr);
+ xhci_dbg(xhci, "config port %d-%d wake bits, portsc: 0x%x, write: 0x%x\n",
+ rhub->hcd->self.busnum, i + 1, portsc, t2);
}
}
spin_unlock_irqrestore(&xhci->lock, flags);
@@ -983,8 +981,8 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
return -EINVAL;
/* Clear root port wake on bits if wakeup not allowed. */
- if (!do_wakeup)
- xhci_disable_port_wake_on_bits(xhci);
+ xhci_disable_hub_port_wake(xhci, &xhci->usb3_rhub, do_wakeup);
+ xhci_disable_hub_port_wake(xhci, &xhci->usb2_rhub, do_wakeup);
if (!HCD_HW_ACCESSIBLE(hcd))
return 0;
--
2.25.1