Commit f905293d authored by Linus Walleij's avatar Linus Walleij Committed by Stephen Boyd

clk: gemini: Fix reset regression

commit e2860e1f ("serial: 8250_of: Add reset support")
introduced reset support for the 8250_of driver.

However it unconditionally uses the assert/deassert pair to
deassert reset on the device at probe and assert it at
remove. This does not work with systems that have a
self-deasserting reset controller, such as Gemini, that
recently added a reset controller.

As a result, the console will not probe on the Gemini with
this message:

Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
of_serial: probe of 42000000.serial failed with error -524

This (-ENOTSUPP) is the error code returned by the
deassert() operation on self-deasserting reset controllers.

To work around this, implement dummy .assert() and
.deassert() operations in the Gemini combined clock and
reset controller. This fixes the issue on this system.

Cc: Joel Stanley <joel@jms.id.au>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-serial@vger.kernel.org
Fixes: e2860e1f ("serial: 8250_of: Add reset support")
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 5771a8c0
...@@ -237,6 +237,18 @@ static int gemini_reset(struct reset_controller_dev *rcdev, ...@@ -237,6 +237,18 @@ static int gemini_reset(struct reset_controller_dev *rcdev,
BIT(GEMINI_RESET_CPU1) | BIT(id)); BIT(GEMINI_RESET_CPU1) | BIT(id));
} }
static int gemini_reset_assert(struct reset_controller_dev *rcdev,
unsigned long id)
{
return 0;
}
static int gemini_reset_deassert(struct reset_controller_dev *rcdev,
unsigned long id)
{
return 0;
}
static int gemini_reset_status(struct reset_controller_dev *rcdev, static int gemini_reset_status(struct reset_controller_dev *rcdev,
unsigned long id) unsigned long id)
{ {
...@@ -253,6 +265,8 @@ static int gemini_reset_status(struct reset_controller_dev *rcdev, ...@@ -253,6 +265,8 @@ static int gemini_reset_status(struct reset_controller_dev *rcdev,
static const struct reset_control_ops gemini_reset_ops = { static const struct reset_control_ops gemini_reset_ops = {
.reset = gemini_reset, .reset = gemini_reset,
.assert = gemini_reset_assert,
.deassert = gemini_reset_deassert,
.status = gemini_reset_status, .status = gemini_reset_status,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment