From: Thomas Zimmermann <tzimmermann@suse.de> To: Matthew Auld <matthew.auld@intel.com>, intel-gfx@lists.freedesktop.org Cc: Michael Mason <michael.w.mason@intel.com>, dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm/i915: return DRIVER_NAME for the fence driver name Date: Wed, 23 Jun 2021 12:12:26 +0200 [thread overview] Message-ID: <e8e98f7f-0654-90b0-f56c-25827dd998a0@suse.de> (raw) In-Reply-To: <20210616122833.332954-1-matthew.auld@intel.com> [-- Attachment #1.1: Type: text/plain, Size: 1811 bytes --] Hi Am 16.06.21 um 14:28 schrieb Matthew Auld: > The first tracepoint for a request is trace_dma_fence_init which is > called in the ctor before we have properly setup the request->engine. So > if it's a non-recycled request the rq->engine might be NULL, or some > garbage value, which leads to a crash. > > Since we are not permitted to use kmem_cache_zalloc() here with > SLAB_TYPESAFE_BY_RCU, one approach is simply to return DRIVER_NAME. We > can then revisit this later if we decide to get rid of > SLAB_TYPESAFE_BY_RCU. > > Fixes: 855e39e65cfc ("drm/i915: Initialise basic fence before acquiring seqno") > Signed-off-by: Matthew Auld <matthew.auld@intel.com> > Cc: Michael Mason <michael.w.mason@intel.com> > Cc: Daniel Vetter <daniel@ffwll.ch> > --- > drivers/gpu/drm/i915/i915_request.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c > index 1014c71cf7f5..55fa94bde22e 100644 > --- a/drivers/gpu/drm/i915/i915_request.c > +++ b/drivers/gpu/drm/i915/i915_request.c > @@ -61,7 +61,7 @@ static struct i915_global_request { > > static const char *i915_fence_get_driver_name(struct dma_fence *fence) > { > - return dev_name(to_request(fence)->engine->i915->drm.dev); > + return DRIVER_NAME; There was recently a discussion about using struct drm_driver.name consistently throughout the source code. I'd like to suggest to do this here. Best regards Thomas > } > > static const char *i915_fence_get_timeline_name(struct dma_fence *fence) > -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 840 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Thomas Zimmermann <tzimmermann@suse.de> To: Matthew Auld <matthew.auld@intel.com>, intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH] drm/i915: return DRIVER_NAME for the fence driver name Date: Wed, 23 Jun 2021 12:12:26 +0200 [thread overview] Message-ID: <e8e98f7f-0654-90b0-f56c-25827dd998a0@suse.de> (raw) In-Reply-To: <20210616122833.332954-1-matthew.auld@intel.com> [-- Attachment #1.1.1: Type: text/plain, Size: 1811 bytes --] Hi Am 16.06.21 um 14:28 schrieb Matthew Auld: > The first tracepoint for a request is trace_dma_fence_init which is > called in the ctor before we have properly setup the request->engine. So > if it's a non-recycled request the rq->engine might be NULL, or some > garbage value, which leads to a crash. > > Since we are not permitted to use kmem_cache_zalloc() here with > SLAB_TYPESAFE_BY_RCU, one approach is simply to return DRIVER_NAME. We > can then revisit this later if we decide to get rid of > SLAB_TYPESAFE_BY_RCU. > > Fixes: 855e39e65cfc ("drm/i915: Initialise basic fence before acquiring seqno") > Signed-off-by: Matthew Auld <matthew.auld@intel.com> > Cc: Michael Mason <michael.w.mason@intel.com> > Cc: Daniel Vetter <daniel@ffwll.ch> > --- > drivers/gpu/drm/i915/i915_request.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c > index 1014c71cf7f5..55fa94bde22e 100644 > --- a/drivers/gpu/drm/i915/i915_request.c > +++ b/drivers/gpu/drm/i915/i915_request.c > @@ -61,7 +61,7 @@ static struct i915_global_request { > > static const char *i915_fence_get_driver_name(struct dma_fence *fence) > { > - return dev_name(to_request(fence)->engine->i915->drm.dev); > + return DRIVER_NAME; There was recently a discussion about using struct drm_driver.name consistently throughout the source code. I'd like to suggest to do this here. Best regards Thomas > } > > static const char *i915_fence_get_timeline_name(struct dma_fence *fence) > -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer [-- Attachment #1.2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 840 bytes --] [-- Attachment #2: Type: text/plain, Size: 160 bytes --] _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2021-06-23 10:12 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-16 12:28 [PATCH] drm/i915: return DRIVER_NAME for the fence driver name Matthew Auld 2021-06-16 12:28 ` [Intel-gfx] " Matthew Auld 2021-06-16 13:32 ` Daniel Vetter 2021-06-16 13:32 ` [Intel-gfx] " Daniel Vetter 2021-06-16 19:19 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork 2021-06-16 22:40 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork 2021-06-22 21:32 ` [PATCH] " Mason, Michael W 2021-06-22 21:32 ` [Intel-gfx] " Mason, Michael W 2021-06-23 10:12 ` Thomas Zimmermann [this message] 2021-06-23 10:12 ` Thomas Zimmermann
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=e8e98f7f-0654-90b0-f56c-25827dd998a0@suse.de \ --to=tzimmermann@suse.de \ --cc=dri-devel@lists.freedesktop.org \ --cc=intel-gfx@lists.freedesktop.org \ --cc=matthew.auld@intel.com \ --cc=michael.w.mason@intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.