aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x/dev.c
diff options
context:
space:
mode:
authorMikko Perttunen <mperttunen@nvidia.com>2017-06-14 19:18:42 -0400
committerThierry Reding <treding@nvidia.com>2017-06-15 08:25:38 -0400
commit8474b02531c4881a762c52ef869c52429e38633f (patch)
tree41cdb37fa4e424170bd7670e07ca0981c9f6c81f /drivers/gpu/host1x/dev.c
parent03f0de770eda7a3f2e3950ca9f15d73e1dfd4596 (diff)
gpu: host1x: Refactor channel allocation code
This is largely a rewrite of the Host1x channel allocation code, bringing several changes: - The previous code could deadlock due to an interaction between the 'reflock' mutex and CDMA timeout handling. This gets rid of the mutex. - Support for more than 32 channels, required for Tegra186 - General refactoring, including better encapsulation of channel ownership handling into channel.c Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Tested-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x/dev.c')
-rw-r--r--drivers/gpu/host1x/dev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
index f05ebb14fa63..5c1c711a21af 100644
--- a/drivers/gpu/host1x/dev.c
+++ b/drivers/gpu/host1x/dev.c
@@ -198,7 +198,8 @@ static int host1x_probe(struct platform_device *pdev)
198 host->iova_end = geometry->aperture_end; 198 host->iova_end = geometry->aperture_end;
199 } 199 }
200 200
201 err = host1x_channel_list_init(host); 201 err = host1x_channel_list_init(&host->channel_list,
202 host->info->nb_channels);
202 if (err) { 203 if (err) {
203 dev_err(&pdev->dev, "failed to initialize channel list\n"); 204 dev_err(&pdev->dev, "failed to initialize channel list\n");
204 goto fail_detach_device; 205 goto fail_detach_device;
@@ -207,7 +208,7 @@ static int host1x_probe(struct platform_device *pdev)
207 err = clk_prepare_enable(host->clk); 208 err = clk_prepare_enable(host->clk);
208 if (err < 0) { 209 if (err < 0) {
209 dev_err(&pdev->dev, "failed to enable clock\n"); 210 dev_err(&pdev->dev, "failed to enable clock\n");
210 goto fail_detach_device; 211 goto fail_free_channels;
211 } 212 }
212 213
213 err = reset_control_deassert(host->rst); 214 err = reset_control_deassert(host->rst);
@@ -244,6 +245,8 @@ fail_reset_assert:
244 reset_control_assert(host->rst); 245 reset_control_assert(host->rst);
245fail_unprepare_disable: 246fail_unprepare_disable:
246 clk_disable_unprepare(host->clk); 247 clk_disable_unprepare(host->clk);
248fail_free_channels:
249 host1x_channel_list_free(&host->channel_list);
247fail_detach_device: 250fail_detach_device:
248 if (host->domain) { 251 if (host->domain) {
249 put_iova_domain(&host->iova); 252 put_iova_domain(&host->iova);