[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220118194857.26546-1-julianmarcusschroeder@gmail.com>
Date: Tue, 18 Jan 2022 13:48:57 -0600
From: julian schroeder <julianmarcusschroeder@...il.com>
To: robh@...nel.org
Cc: bhanumaiya@...gle.com,
julian schroeder <julianmarcusschroeder@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] fix serdev bind/unbind
On some chromebooks, the serdev is used to communicate with
an embedded controller. When the controller is updated, the
regular ttyS* is needed. Therefore unbind/bind needs to work
to be able to switch between the two modes without having to
reboot. In the case of ACPI enabled platforms, the underlying
serial device is marked as enumerated but this is not cleared
upon remove (unbind). In this state it can not be bound as
serdev.
Signed-off-by: julian schroeder <julianmarcusschroeder@...il.com>
---
drivers/tty/serdev/core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index 92e3433276f8..668fa570bc07 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -138,7 +138,11 @@ EXPORT_SYMBOL_GPL(serdev_device_add);
void serdev_device_remove(struct serdev_device *serdev)
{
struct serdev_controller *ctrl = serdev->ctrl;
+ struct acpi_device *adev;
+ adev = ACPI_COMPANION(&serdev->dev);
+ if (adev)
+ acpi_device_clear_enumerated(adev);
device_unregister(&serdev->dev);
ctrl->serdev = NULL;
}
--
2.20.1
Powered by blists - more mailing lists