Skip to content

Commit 0890186

Browse files
jwrdegoederafaeljw
authored andcommitted
serdev: Do not instantiate serdevs on boards with known bogus DSDT entries
x86 ACPI devices which ship with only Android as their factory image use older kernels which do not yet support ACPI serdev enumeration, as such the serdev information in their ACPI tables is not reliable. For example on the Asus ME176C tablet the serdev describing the Bluetooth HCI points to the serdev_controller connected to the GPS and the other way around. Use the new acpi_quirk_skip_serdev_enumeration() helper to identify known boards with this issue and then either abort adding the serdev controller (creating a tty cdev instead) or only create the controller leaving the instantation of the serdev itself up to platform code. In the case where only the serdev controller is created the necessary serdevs will instead be instantiated by the drivers/platform/x86/x86-android-tablets.c kernel module. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent a6e1445 commit 0890186

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

drivers/tty/serdev/core.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,10 +727,24 @@ static acpi_status acpi_serdev_add_device(acpi_handle handle, u32 level,
727727
static int acpi_serdev_register_devices(struct serdev_controller *ctrl)
728728
{
729729
acpi_status status;
730+
bool skip;
731+
int ret;
730732

731733
if (!has_acpi_companion(ctrl->dev.parent))
732734
return -ENODEV;
733735

736+
/*
737+
* Skip registration on boards where the ACPI tables are known to
738+
* contain buggy devices. Note serdev_controller_add() must still
739+
* succeed in this case, so that the proper serdev devices can be
740+
* added "manually" later.
741+
*/
742+
ret = acpi_quirk_skip_serdev_enumeration(ctrl->dev.parent, &skip);
743+
if (ret)
744+
return ret;
745+
if (skip)
746+
return 0;
747+
734748
status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
735749
SERDEV_ACPI_MAX_SCAN_DEPTH,
736750
acpi_serdev_add_device, NULL, ctrl, NULL);

0 commit comments

Comments
 (0)