Message ID | 20180605190302.18279-3-eric@anholt.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Am Dienstag, den 05.06.2018, 12:03 -0700 schrieb Eric Anholt: > This isn't the first time I've had to argue to myself why the '++' was > safe. And now you need to do the same thing with me... > Signed-off-by: Eric Anholt <eric@anholt.net> > --- > drivers/gpu/drm/v3d/v3d_fence.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/v3d/v3d_fence.c b/drivers/gpu/drm/v3d/v3d_fence.c > index bfe31a89668b..6265e9ab4a13 100644 > --- a/drivers/gpu/drm/v3d/v3d_fence.c > +++ b/drivers/gpu/drm/v3d/v3d_fence.c > @@ -3,6 +3,9 @@ > > #include "v3d_drv.h" > > +/* Note that V3D fences are created during v3d_job_run(), so we're > + * already implictly locked. > + */ I don't see where you would be locked in the job_run path. I think what you mean is that this path needs no locks, as it is driven by a single scheduler thread, right? Regards, Lucas
Lucas Stach <l.stach@pengutronix.de> writes: > Am Dienstag, den 05.06.2018, 12:03 -0700 schrieb Eric Anholt: >> This isn't the first time I've had to argue to myself why the '++' was >> safe. > > And now you need to do the same thing with me... > >> Signed-off-by: Eric Anholt <eric@anholt.net> >> --- >> drivers/gpu/drm/v3d/v3d_fence.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/gpu/drm/v3d/v3d_fence.c b/drivers/gpu/drm/v3d/v3d_fence.c >> index bfe31a89668b..6265e9ab4a13 100644 >> --- a/drivers/gpu/drm/v3d/v3d_fence.c >> +++ b/drivers/gpu/drm/v3d/v3d_fence.c >> @@ -3,6 +3,9 @@ >> >> #include "v3d_drv.h" >> >> +/* Note that V3D fences are created during v3d_job_run(), so we're >> + * already implictly locked. >> + */ > I don't see where you would be locked in the job_run path. I think what > you mean is that this path needs no locks, as it is driven by a single > scheduler thread, right? Yeah, it's only called from run_job, and run_job can't reenter.
diff --git a/drivers/gpu/drm/v3d/v3d_fence.c b/drivers/gpu/drm/v3d/v3d_fence.c index bfe31a89668b..6265e9ab4a13 100644 --- a/drivers/gpu/drm/v3d/v3d_fence.c +++ b/drivers/gpu/drm/v3d/v3d_fence.c @@ -3,6 +3,9 @@ #include "v3d_drv.h" +/* Note that V3D fences are created during v3d_job_run(), so we're + * already implictly locked. + */ struct dma_fence *v3d_fence_create(struct v3d_dev *v3d, enum v3d_queue queue) { struct v3d_fence *fence;
This isn't the first time I've had to argue to myself why the '++' was safe. Signed-off-by: Eric Anholt <eric@anholt.net> --- drivers/gpu/drm/v3d/v3d_fence.c | 3 +++ 1 file changed, 3 insertions(+)