Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ofir Bitton <obitton@habana.ai>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	"airlied@gmail.com" <airlied@gmail.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	Francois Dugast <francois.dugast@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [Intel-xe] [PATCH] drm/xe/uapi: Remove MMIO ioctl
Date: Mon, 18 Sep 2023 12:54:47 +0300	[thread overview]
Message-ID: <874jjrvmag.fsf@intel.com> (raw)
In-Reply-To: <bf33b2c3-5111-e4ed-0a3d-5616ce0fc9f6@habana.ai>

On Mon, 18 Sep 2023, Ofir Bitton <obitton@habana.ai> wrote:
> On 14/09/2023 23:47, Daniel Vetter wrote:
>> On Thu, 14 Sept 2023 at 16:21, Ofir Bitton <obitton@habana.ai> wrote:
>>>
>>> On 14/09/2023 11:35, Jani Nikula wrote:
>>>> On Tue, 12 Sep 2023, Ofir Bitton <obitton@habana.ai> wrote:
>>>>> On 12/09/2023 14:11, Jani Nikula wrote:
>>>>>> On Tue, 12 Sep 2023, Ofir Bitton <obitton@habana.ai> wrote:
>>>>>>> On 12/09/2023 3:25, Matt Roper wrote:
>>>>>>> Hey Matt, I totally undesrstand your concern, I might have another
>>>>>>> suggestion. We can create another FD in debugfs and move this ioctl
>>>>>>> there (I can take ownership on this), This way ABI is not an issue.
>>>>>>
>>>>>> FD or ioctl in debugfs? Or do you just mean adding a debugfs file for
>>>>>> register access?
>>>>>>
>>>>>> BR,
>>>>>> Jani.
>>>>>>
>>>>>
>>>>> Add a new file in debugfs to which we will send debug ioctls such as the
>>>>> mmio ioctl.
>>>>
>>>> It's so rare to do ioctl on debugfs files that I first had to check it's
>>>> possible, and then try to find examples in the kernel. I found one so
>>>> far, though there are probably more.
>>>>
>>>> If it's that rare, usually the question is, does it make sense?
>>>>
>>>>
>>>> BR,
>>>> Jani.
>>>>
>>>>
>>>
>>> I actually got this idea from Daniel few months back during a different
>>> discussion. Daniel any thoughts on this?
>>
>> So the backstory is that some simulation interface for gaudi used a
>> chardev node, for the efficiency/flexibilty of ioctl. Which for
>> upstream is a no-go, we really don't want to make val/sim stuff stable
>> uapi. But in general I'm very much welcome to upstreaming
>> debug/sim/val infrastructure, anything that's reasonable and reduces
>> the delta against internal/downstream trees is good, and the ioctl
>> interface seems like the right fit, and the stable uapi issue can be
>> avoided by moving it all into debugfs.
>>
>> That's how the debugfs-with-ioctl idea was born.
>>
>> Now since it's debugfs I really don't care much (but maybe
>> double-check with Dave Airlie), as long as we don't go overboard and
>> use ioctl for absolutely everything just because we can. Because in
>> general I think debugfs should be human readable and useable with just
>> commandline, very often that's really the most convenient interface.
>> But if we need something where ioctl is just the better fit, then yeah
>> ioctl in debugfs is imo ok.
>>
>> Cheers!
>>
>
> Thanks Daniel for the detailed input! I think in our case we can use
> a debugfs ioctl ONLY for the mmio case, as indeed here it is the best
> fit. Jani, any objection?

Ack on the plan.

And since it's debugfs, we can actually change it afterwards. :)

BR,
Jani.


>
>>> If you are uncomfortable with the ioctl approach we can go with a
>>> different approach, for example what we did in the habanalabs driver:
>>>
>>> setting read/write address:
>>> https://elixir.bootlin.com/linux/v6.6-rc1/source/drivers/accel/habanalabs/common/debugfs.c#L1630
>>>
>>> read32:
>>> https://elixir.bootlin.com/linux/v6.6-rc1/source/drivers/accel/habanalabs/common/debugfs.c#L844
>>>
>>> I liked the ioctl approach so much because it requires a single system
>>> call instead of 2 and the implementation is much cleaner.
>>>
>>> Ofir.
>>>
>>>
>>
>>
>

-- 
Jani Nikula, Intel

  reply	other threads:[~2023-09-18  9:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07 19:35 [Intel-xe] [PATCH] drm/xe/uapi: Remove MMIO ioctl Francois Dugast
2023-09-07 19:44 ` Souza, Jose
2023-09-08  1:16 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-09-08  1:17 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-09-08  1:18 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-09-08  1:25 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-09-08  1:25 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-09-08  1:27 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-09-08  2:02 ` [Intel-xe] ✗ CI.BAT: failure " Patchwork
2023-09-10 16:34 ` [Intel-xe] [PATCH] " Ofir Bitton
2023-09-11  3:45   ` Lucas De Marchi
2023-09-11  4:21     ` Ofir Bitton
2023-09-12  0:25       ` Matt Roper
2023-09-12  8:43         ` Ofir Bitton
2023-09-12 11:11           ` Jani Nikula
2023-09-12 18:33             ` Ofir Bitton
2023-09-14  8:35               ` Jani Nikula
2023-09-14 14:20                 ` Ofir Bitton
2023-09-14 20:47                   ` Daniel Vetter
2023-09-18  6:40                     ` Ofir Bitton
2023-09-18  9:54                       ` Jani Nikula [this message]
2023-09-12 14:42           ` Lucas De Marchi
2023-09-13 13:56             ` Francois Dugast
2023-09-14  8:43               ` Jani Nikula
2023-09-11  3:47 ` Lucas De Marchi
2023-09-11 11:53   ` Jani Nikula

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=874jjrvmag.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=francois.dugast@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=obitton@habana.ai \
    /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