All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
	 maarten.lankhorst@linux.intel.com, airlied@gmail.com,
	tzimmermann@suse.de, rodrigo.vivi@intel.com,
	intel-xe@lists.freedesktop.org,
	Thomas Hellstr_m <thomas.hellstrom@linux.intel.com>
Subject: Re: [PATCH v3 1/4] drm: add devm release action
Date: Thu, 2 May 2024 15:42:18 +0200	[thread overview]
Message-ID: <20240502-wakeful-rattlesnake-of-tornado-af78f5@houat> (raw)
In-Reply-To: <e54a0551-9484-40c9-abf7-f2e39e101497@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2599 bytes --]

On Wed, Apr 24, 2024 at 06:06:52PM +0530, Aravind Iddamsetty wrote:
> 
> On 24/04/24 17:21, Maxime Ripard wrote:
> > On Mon, Apr 22, 2024 at 12:27:53PM +0530, Aravind Iddamsetty wrote:
> >> In scenarios where drm_dev_put is directly called by driver we want to
> >> release devm_drm_dev_init_release action associated with struct
> >> drm_device.
> >>
> >> v2: Directly expose the original function, instead of introducing a
> >> helper (Rodrigo)
> >>
> >> v3: add kernel-doc (Maxime Ripard)
> >>
> >> Cc: Maxime Ripard <mripard@kernel.org>
> >> Cc: Thomas Hellstr_m <thomas.hellstrom@linux.intel.com>
> >> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> >>
> >> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> >> Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
> >> ---
> >>  drivers/gpu/drm/drm_drv.c | 13 +++++++++++++
> >>  include/drm/drm_drv.h     |  2 ++
> >>  2 files changed, 15 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> >> index 243cacb3575c..9d0409165f1e 100644
> >> --- a/drivers/gpu/drm/drm_drv.c
> >> +++ b/drivers/gpu/drm/drm_drv.c
> >> @@ -714,6 +714,19 @@ static int devm_drm_dev_init(struct device *parent,
> >>  					devm_drm_dev_init_release, dev);
> >>  }
> >>  
> >> +/**
> >> + * devm_drm_dev_release_action - Call the final release action of the device
> >> + * @dev: DRM device
> >> + *
> >> + * In scenarios where drm_dev_put is directly called by driver we want to release
> >> + * devm_drm_dev_init_release action associated with struct drm_device.
> >> + */
> > I'm not entirely sure what you mean by that documentation. "In scenarios
> > where drm_dev_put is directly called by the driver", we wouldn't need to
> > consider that function at all, right?
> 
> the drm_dev_put is not being invoked by drivers directly but that is
> associated with devres releases and the scenario here I meant if
> drivers want to have that called by themselves.

Then that needs to be rephrased to mention both that it applies only to
drivers using devm_drm_dev_alloc, and if they want to drop their
reference earlier than anticipated.

> > Also, we should reference it in drm_dev_put and devm_drm_dev_alloc too.
> 
> sorry I didn't get this can you please elaborate.

devm_drm_dev_alloc needs to point at this new function to mention that
we can drop the reference explicitly. And drm_dev_put needs to mention
that it only applies to non-devm drivers, and if we want to drop the
reference on a devm driver, we need to call this new function.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

  reply	other threads:[~2024-05-02 13:42 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22  6:57 [PATCH v4 0/4] drm/xe: Support PCIe FLR Aravind Iddamsetty
2024-04-22  6:57 ` [PATCH v3 1/4] drm: add devm release action Aravind Iddamsetty
2024-04-22 20:54   ` Rodrigo Vivi
2024-04-23  8:55     ` Aravind Iddamsetty
2024-04-23 17:42       ` Rodrigo Vivi
2024-04-24 11:30         ` Aravind Iddamsetty
2024-04-24 11:49         ` Maxime Ripard
2024-04-24 12:20           ` Rodrigo Vivi
2024-04-25 12:52             ` Maxime Ripard
2024-04-25 14:42               ` Aravind Iddamsetty
2024-04-24 11:51   ` Maxime Ripard
2024-04-24 12:36     ` Aravind Iddamsetty
2024-05-02 13:42       ` Maxime Ripard [this message]
2024-04-22  6:57 ` [PATCH 2/4] drm/xe: Save and restore PCI state Aravind Iddamsetty
2024-04-23  4:18   ` Ghimiray, Himal Prasad
2024-04-22  6:57 ` [PATCH v2 3/4] drm/xe: Extract xe_gt_idle() helper Aravind Iddamsetty
2024-04-22  6:57 ` [PATCH v3 4/4] drm/xe/FLR: Support PCIe FLR Aravind Iddamsetty
2024-04-23  4:18   ` Ghimiray, Himal Prasad
2024-04-23 15:04   ` Nilawar, Badal
2024-04-24  3:12     ` Aravind Iddamsetty
2024-04-24 11:12       ` Nilawar, Badal
2024-04-25  4:07         ` Aravind Iddamsetty
2024-04-23 23:49   ` Michał Winiarski
2024-04-24  5:12     ` Aravind Iddamsetty
2024-04-24 23:29       ` Michał Winiarski
2024-04-25  6:17         ` Aravind Iddamsetty
2024-04-26  0:53           ` Michał Winiarski
2024-04-22  8:21 ` ✓ CI.Patch_applied: success for drm/xe: Support PCIe FLR (rev5) Patchwork
2024-04-22  8:21 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-22  8:23 ` ✓ CI.KUnit: success " Patchwork
2024-04-22  8:34 ` ✓ CI.Build: " Patchwork
2024-04-22  8:37 ` ✓ CI.Hooks: " Patchwork
2024-04-22  8:38 ` ✗ CI.checksparse: warning " Patchwork
2024-04-22 15:54 ` ✓ CI.Patch_applied: success " Patchwork
2024-04-22 15:55 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-22 15:56 ` ✓ CI.KUnit: success " Patchwork
2024-04-22 16:13 ` ✓ CI.Build: " Patchwork
2024-04-22 16:15 ` ✓ CI.Hooks: " Patchwork
2024-04-22 16:17 ` ✗ CI.checksparse: warning " Patchwork
2024-04-23 14:09 ` ✓ CI.Patch_applied: success for drm/xe: Support PCIe FLR (rev6) Patchwork
2024-04-23 14:09 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-23 14:10 ` ✓ CI.KUnit: success " Patchwork
2024-04-23 14:22 ` ✓ CI.Build: " Patchwork
2024-04-23 14:24 ` ✓ CI.Hooks: " Patchwork
2024-04-23 14:26 ` ✗ CI.checksparse: warning " Patchwork
2024-04-23 14:48 ` ✓ CI.BAT: success " Patchwork
2024-04-23 21:41 ` ✓ CI.FULL: " Patchwork

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=20240502-wakeful-rattlesnake-of-tornado-af78f5@houat \
    --to=mripard@kernel.org \
    --cc=airlied@gmail.com \
    --cc=aravind.iddamsetty@linux.intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=tzimmermann@suse.de \
    /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: link
Be 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.