OpenCloudOS-Kernel/drivers/pnp
Hans de Goede 62a0ec9dc1 PNP: Do not disable devices on suspend when they cannot be re-enabled on resume
On an Advantech MICA-071 tablet, with a builtin barcode scanner connected
to ttyS0, the following message is shown on suspend:

serial 00:02: disabled

And after suspend/resume trying to use the barcode scanner / ttyS0 shows:

serial 00:02: LSR safety check engaged!

Indicating that the UARTs io-ports are no longer reachable.

This is caused by __pnp_bus_suspend() calling pnp_stop_dev() on the "00:02"
pnp device on suspend (this outputs the disabled message).

The problem is that pnp_can_write() returns false for the "00:02" pnp
device, so after disabling it (disabling its decoding of IO addresses)
during suspend, it cannot be re-enabled.

Add a pnp_can_write() check to the suspend path and only disable devices
which can actually be re-enabled on resume.

This fixes the Advantech MICA-071's ttyS0 no longer working after
a suspend/resume.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2022-11-25 19:36:52 +01:00
..
isapnp proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
pnpacpi ACPI: resources: Add wake_capable parameter to acpi_dev_irq_flags 2022-10-04 15:41:12 +02:00
pnpbios PNPBIOS: remove unused pnpid32_to_pnpid() declaration 2022-09-24 18:07:42 +02:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
base.h PNP: Remove pnp_alloc() 2021-05-17 16:54:01 +02:00
card.c Char / Misc driver updates for 5.14-rc1 2021-07-05 13:42:16 -07:00
core.c PNP: fix name memory leak in pnp_alloc_dev() 2022-11-22 20:37:21 +01:00
driver.c PNP: Do not disable devices on suspend when they cannot be re-enabled on resume 2022-11-25 19:36:52 +01:00
interface.c PNP: Remove pnp_alloc() 2021-05-17 16:54:01 +02:00
manager.c PNP: moved EXPORT_SYMBOL so that it immediately followed its function/variable 2021-06-24 15:55:23 +02:00
quirks.c PNP: quirks: Fix duplicate included pci.h 2020-09-25 18:01:06 +02:00
resource.c PCI: Remove pci_get_legacy_ide_irq() and asm-generic/pci.h 2022-07-22 17:23:45 -05:00
support.c PNP: moved EXPORT_SYMBOL so that it immediately followed its function/variable 2021-06-24 15:55:23 +02:00
system.c PNP: system.c: unmark a comment as being kernel-doc 2021-10-05 15:56:03 +02:00