Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 1/2] drm/i915/params: add i915 parameters to debugfs
Date: Wed, 08 Jan 2020 17:07:56 +0200	[thread overview]
Message-ID: <87sgkqouk3.fsf@intel.com> (raw)
In-Reply-To: <157849474809.2273.10126647469755480457@skylake-alporthouse-com>

On Wed, 08 Jan 2020, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Jani Nikula (2019-12-05 15:43:40)
>> +static int i915_param_int_open(struct inode *inode, struct file *file)
>> +{
>> +       return single_open(file, i915_param_int_show, inode->i_private);
>
> What I've always wanted with this style of approach was a means that the
> parameter is only set while the debugfs remained open.
>
> 	fd = open("/debug/my_parameter", O_WRONLY | O_EXCL);
> 	write(fd, "1", 1);
>
> 	... run test ..
>
> System reverts to default on process termination, or explicit close(fd).
>
> I'd make the open implicitly O_EXCL, i.e. return -EBUSY if something
> else already holds the parameter set. Or, you can use the O_EXCL to
> select between the different modes of operation.
>
> Moving the parameters to debugfs is more than worth it imo if we can
> enable this mode of operation.

I understand the use case, and I'd like something like that. But
(obviously?) I think the regular use case of 'echo 1 >
/debug/my_parameter' needs to work as one would expect.

Reading open(2) man page, feels like using O_EXCL for this would be a
hack. Granted, it's debugfs to begin with, but still. Makes me a bit
hesitant about abusing O_EXCL for this. (Or am I missing something?)

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-01-08 15:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 15:43 [Intel-gfx] [PATCH 0/2] drm/i915: debugfs device parameters Jani Nikula
2019-12-05 15:43 ` [Intel-gfx] [PATCH 1/2] drm/i915/params: add i915 parameters to debugfs Jani Nikula
2019-12-05 17:19   ` Tvrtko Ursulin
2019-12-09  9:53     ` Jani Nikula
2020-01-08 14:45   ` Chris Wilson
2020-01-08 15:07     ` Jani Nikula [this message]
2020-01-15 10:04   ` Chris Wilson
2020-01-15 10:39     ` Jani Nikula
2020-01-15 13:12       ` Jani Nikula
2019-12-05 15:43 ` [Intel-gfx] [PATCH 2/2] drm/i915/params: support bool values for int and uint params Jani Nikula
2020-01-15 10:05   ` Chris Wilson
2019-12-05 17:24 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: debugfs device parameters Patchwork
2019-12-05 17:26 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2019-12-05 17:56 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2019-12-05 23:06 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=87sgkqouk3.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox