Re: [PATCH v2 5/5] ASoC: tegra: ahub: Reset hardware properly

From: Dmitry Osipenko
Date: Fri Jan 15 2021 - 09:25:47 EST


15.01.2021 17:01, Dmitry Osipenko пишет:
> @@ -65,12 +65,32 @@ static int tegra30_ahub_runtime_resume(struct device *dev)
> {
> int ret;
>
> + ret = reset_control_assert(ahub->reset);
> + if (ret)
> + return ret;
> +
> ret = clk_bulk_prepare_enable(ahub->nclocks, ahub->clocks);
> if (ret)
> return ret;
>
> + ret = reset_control_reset(ahub->reset);
> + if (ret) {
> + clk_bulk_disable_unprepare(ahub->nclocks, ahub->clocks);
> + return ret;
> + }
> +
> regcache_cache_only(ahub->regmap_apbif, false);
> regcache_cache_only(ahub->regmap_ahub, false);
> + regcache_mark_dirty(ahub->regmap_apbif);
> + regcache_mark_dirty(ahub->regmap_ahub);
> +
> + ret = regcache_sync(ahub->regmap_apbif);
> + if (ret)
> + return ret;
> +
> + ret = regcache_sync(ahub->regmap_ahub);
> + if (ret)
> + return ret;
>

The regcache syncing is corrected now in v2, but I missed to disable the
clocks in the error path :) I'll make a v3 around next Tuesday. If
you'll spot anything else that needs to be improved, please let me know.