Commit 36acf80f authored by Neil Armstrong's avatar Neil Armstrong Committed by Mark Brown

spi: meson-spicc: do not rely on busy flag in pow2 clk ops

Since [1], controller's busy flag isn't set anymore when the
__spi_transfer_message_noqueue() is used instead of the
__spi_pump_transfer_message() logic for spi_sync transfers.

Since the pow2 clock ops were limited to only be available when a
transfer is ongoing (between prepare_transfer_hardware and
unprepare_transfer_hardware callbacks), the only way to track this
down is to check for the controller cur_msg.

[1] ae7d2346 ("spi: Don't use the message queue if possible in spi_sync")

Fixes: 09992025 ("spi: meson-spicc: add local pow2 clock ops to preserve rate between messages")
Fixes: ae7d2346 ("spi: Don't use the message queue if possible in spi_sync")
Reported-by: default avatarMarkus Schneider-Pargmann <msp@baylibre.com>
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Tested-by: default avatarMarkus Schneider-Pargmann <msp@baylibre.com>
Link: https://lore.kernel.org/r/20220908121803.919943-1-narmstrong@baylibre.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 014eac3e
...@@ -537,7 +537,7 @@ static unsigned long meson_spicc_pow2_recalc_rate(struct clk_hw *hw, ...@@ -537,7 +537,7 @@ static unsigned long meson_spicc_pow2_recalc_rate(struct clk_hw *hw,
struct clk_divider *divider = to_clk_divider(hw); struct clk_divider *divider = to_clk_divider(hw);
struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider); struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider);
if (!spicc->master->cur_msg || !spicc->master->busy) if (!spicc->master->cur_msg)
return 0; return 0;
return clk_divider_ops.recalc_rate(hw, parent_rate); return clk_divider_ops.recalc_rate(hw, parent_rate);
...@@ -549,7 +549,7 @@ static int meson_spicc_pow2_determine_rate(struct clk_hw *hw, ...@@ -549,7 +549,7 @@ static int meson_spicc_pow2_determine_rate(struct clk_hw *hw,
struct clk_divider *divider = to_clk_divider(hw); struct clk_divider *divider = to_clk_divider(hw);
struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider); struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider);
if (!spicc->master->cur_msg || !spicc->master->busy) if (!spicc->master->cur_msg)
return -EINVAL; return -EINVAL;
return clk_divider_ops.determine_rate(hw, req); return clk_divider_ops.determine_rate(hw, req);
...@@ -561,7 +561,7 @@ static int meson_spicc_pow2_set_rate(struct clk_hw *hw, unsigned long rate, ...@@ -561,7 +561,7 @@ static int meson_spicc_pow2_set_rate(struct clk_hw *hw, unsigned long rate,
struct clk_divider *divider = to_clk_divider(hw); struct clk_divider *divider = to_clk_divider(hw);
struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider); struct meson_spicc_device *spicc = pow2_clk_to_spicc(divider);
if (!spicc->master->cur_msg || !spicc->master->busy) if (!spicc->master->cur_msg)
return -EINVAL; return -EINVAL;
return clk_divider_ops.set_rate(hw, rate, parent_rate); return clk_divider_ops.set_rate(hw, rate, parent_rate);
......
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