diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/fifo')
-rw-r--r-- | drivers/gpu/nvgpu/common/fifo/channel.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/fifo/tsg.c | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index 7179d46e..2be72cb4 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * GK20A Graphics channel | 2 | * GK20A Graphics channel |
3 | * | 3 | * |
4 | * Copyright (c) 2011-2020, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2011-2021, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * Permission is hereby granted, free of charge, to any person obtaining a | 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
7 | * copy of this software and associated documentation files (the "Software"), | 7 | * copy of this software and associated documentation files (the "Software"), |
@@ -333,7 +333,7 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) | |||
333 | * have an open channel fd anymore to use for the unbind | 333 | * have an open channel fd anymore to use for the unbind |
334 | * ioctl. | 334 | * ioctl. |
335 | */ | 335 | */ |
336 | err = gk20a_tsg_unbind_channel(ch); | 336 | err = gk20a_tsg_unbind_channel(ch, true); |
337 | if (err) { | 337 | if (err) { |
338 | nvgpu_err(g, | 338 | nvgpu_err(g, |
339 | "failed to unbind channel %d from TSG", | 339 | "failed to unbind channel %d from TSG", |
diff --git a/drivers/gpu/nvgpu/common/fifo/tsg.c b/drivers/gpu/nvgpu/common/fifo/tsg.c index 841dd465..ebcdd2be 100644 --- a/drivers/gpu/nvgpu/common/fifo/tsg.c +++ b/drivers/gpu/nvgpu/common/fifo/tsg.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2014-2021, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -148,7 +148,7 @@ int gk20a_tsg_bind_channel(struct tsg_gk20a *tsg, | |||
148 | } | 148 | } |
149 | 149 | ||
150 | /* The caller must ensure that channel belongs to a tsg */ | 150 | /* The caller must ensure that channel belongs to a tsg */ |
151 | int gk20a_tsg_unbind_channel(struct channel_gk20a *ch) | 151 | int gk20a_tsg_unbind_channel(struct channel_gk20a *ch, bool force) |
152 | { | 152 | { |
153 | struct gk20a *g = ch->g; | 153 | struct gk20a *g = ch->g; |
154 | struct tsg_gk20a *tsg = tsg_gk20a_from_ch(ch); | 154 | struct tsg_gk20a *tsg = tsg_gk20a_from_ch(ch); |
@@ -159,6 +159,11 @@ int gk20a_tsg_unbind_channel(struct channel_gk20a *ch) | |||
159 | } | 159 | } |
160 | 160 | ||
161 | err = gk20a_fifo_tsg_unbind_channel(ch); | 161 | err = gk20a_fifo_tsg_unbind_channel(ch); |
162 | |||
163 | if (!force && err == -EAGAIN) { | ||
164 | return err; | ||
165 | } | ||
166 | |||
162 | if (err) { | 167 | if (err) { |
163 | nvgpu_err(g, "Channel %d unbind failed, tearing down TSG %d", | 168 | nvgpu_err(g, "Channel %d unbind failed, tearing down TSG %d", |
164 | ch->chid, tsg->tsgid); | 169 | ch->chid, tsg->tsgid); |