All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "M Henning" <mhenning@darkrefraction.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Simona Vetter <simona@ffwll.ch>, Mary Guillemard <mary@mary.zone>,
	dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] drm/nouveau: Fetch zcull info from device
Date: Fri, 13 Feb 2026 23:22:15 +0100	[thread overview]
Message-ID: <DGE6O1OYR4F3.2PSFQLJ8XXJ78@kernel.org> (raw)
In-Reply-To: <CAAgWFh0zX=u7OZYq3QBrs0ySve897LXb1PN9QFzhYg0gtHy5wQ@mail.gmail.com>

On Fri Feb 13, 2026 at 10:48 PM CET, M Henning wrote:
> On Fri, Feb 13, 2026 at 12:12 PM Danilo Krummrich <dakr@kernel.org> wrote:
>>
>> On Thu Feb 5, 2026 at 7:56 PM CET, Mel Henning wrote:
>> > This information will be exposed to userspace in the following commit.
>> >
>> > Signed-off-by: Mel Henning <mhenning@darkrefraction.com>
>>
>> For someone looking at this commit, this commit message is not very useful.
>>
>> Please add at least a brief explanation of what the patch does and - even more
>> important - why it does it. See also [1].
>>
>> [1] https://docs.kernel.org/process/submitting-patches.html#describe-your-changes
>
> What I'm struggling with is that I don't know how to do this without
> repeating myself. If you want, I can copy-paste my explanation of
> zcull here too and then it will appear three times, once in each
> commit and once in the cover letter. But that kind of repetition
> doesn't seem very helpful to me.

Again, the commit message should explain what the commit does and why. For
instance, I asked you why you did combine those two callbacks below.

The commit message could mention this, e.g. it could be something along the lines
of:

"Add struct nvkm_gr_zcull_info, which serves as abstraction layer between the
corresponding uAPI (added in a subsequent patch) and the firmware (version
specific) structure.

This is needed in order to not leak the uAPI layer into nvkm. Also note that we
are bypassing the nvif layer, since ...

Also note that we reuse the get_ctxbufs_info() callback, since ..."

I.e. make it obvious to maintainers what's going on and what's the motivation
for the patch and it's implementation details.

> Because of this, I decided that it was simplest to combine them in a
> single call, which avoids repeated rpc calls to the gpu without the
> complexity of handling partially complete states.

Ok, that seems reasonable.

>> > +     if (WARN_ON(IS_ERR(zcull_info)))
>>
>> What justifies this WARN_ON()? To me this seems like normal error handling, i.e.
>> it is not a violation of some API invariant, etc. Also, this is in the driver's
>> probe() path.
>
> I was just copying the error handling that already exists in this function.
>
> I do think these are weird error cases though - they mean that the gpu
> was partially but not fully initialized which shouldn't happen during
> normal usage. The only cases I can think of that would trigger this
> warning are a kernel bug or an intermittent PCI link, which I think
> are both reasonable to warn on.

It could also be that the firmware is buggy, etc. In any case, I don't see that
a WARN_ON() is justified. Please use dev_err() instead.

WARNING: multiple messages have this Message-ID (diff)
From: "Danilo Krummrich" <dakr@kernel.org>
To: "M Henning" <mhenning@darkrefraction.com>
Cc: "Lyude Paul" <lyude@redhat.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Mary Guillemard" <mary@mary.zone>,
	<dri-devel@lists.freedesktop.org>,
	<nouveau@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] drm/nouveau: Fetch zcull info from device
Date: Fri, 13 Feb 2026 23:22:15 +0100	[thread overview]
Message-ID: <DGE6O1OYR4F3.2PSFQLJ8XXJ78@kernel.org> (raw)
In-Reply-To: <CAAgWFh0zX=u7OZYq3QBrs0ySve897LXb1PN9QFzhYg0gtHy5wQ@mail.gmail.com>

On Fri Feb 13, 2026 at 10:48 PM CET, M Henning wrote:
> On Fri, Feb 13, 2026 at 12:12 PM Danilo Krummrich <dakr@kernel.org> wrote:
>>
>> On Thu Feb 5, 2026 at 7:56 PM CET, Mel Henning wrote:
>> > This information will be exposed to userspace in the following commit.
>> >
>> > Signed-off-by: Mel Henning <mhenning@darkrefraction.com>
>>
>> For someone looking at this commit, this commit message is not very useful.
>>
>> Please add at least a brief explanation of what the patch does and - even more
>> important - why it does it. See also [1].
>>
>> [1] https://docs.kernel.org/process/submitting-patches.html#describe-your-changes
>
> What I'm struggling with is that I don't know how to do this without
> repeating myself. If you want, I can copy-paste my explanation of
> zcull here too and then it will appear three times, once in each
> commit and once in the cover letter. But that kind of repetition
> doesn't seem very helpful to me.

Again, the commit message should explain what the commit does and why. For
instance, I asked you why you did combine those two callbacks below.

The commit message could mention this, e.g. it could be something along the lines
of:

"Add struct nvkm_gr_zcull_info, which serves as abstraction layer between the
corresponding uAPI (added in a subsequent patch) and the firmware (version
specific) structure.

This is needed in order to not leak the uAPI layer into nvkm. Also note that we
are bypassing the nvif layer, since ...

Also note that we reuse the get_ctxbufs_info() callback, since ..."

I.e. make it obvious to maintainers what's going on and what's the motivation
for the patch and it's implementation details.

> Because of this, I decided that it was simplest to combine them in a
> single call, which avoids repeated rpc calls to the gpu without the
> complexity of handling partially complete states.

Ok, that seems reasonable.

>> > +     if (WARN_ON(IS_ERR(zcull_info)))
>>
>> What justifies this WARN_ON()? To me this seems like normal error handling, i.e.
>> it is not a violation of some API invariant, etc. Also, this is in the driver's
>> probe() path.
>
> I was just copying the error handling that already exists in this function.
>
> I do think these are weird error cases though - they mean that the gpu
> was partially but not fully initialized which shouldn't happen during
> normal usage. The only cases I can think of that would trigger this
> warning are a kernel bug or an intermittent PCI link, which I think
> are both reasonable to warn on.

It could also be that the firmware is buggy, etc. In any case, I don't see that
a WARN_ON() is justified. Please use dev_err() instead.

  reply	other threads:[~2026-02-13 22:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05 18:56 [PATCH v2 0/2] drm/nouveau: zcull support Mel Henning
2026-02-05 18:56 ` Mel Henning
2026-02-05 18:56 ` [PATCH v2 1/2] drm/nouveau: Fetch zcull info from device Mel Henning
2026-02-05 18:56   ` Mel Henning
2026-02-13 17:12   ` Danilo Krummrich
2026-02-13 17:12     ` Danilo Krummrich
2026-02-13 21:48     ` M Henning
2026-02-13 21:48       ` M Henning
2026-02-13 22:22       ` Danilo Krummrich [this message]
2026-02-13 22:22         ` Danilo Krummrich
2026-02-13 23:11         ` M Henning
2026-02-13 23:11           ` M Henning
2026-02-05 18:56 ` [PATCH v2 2/2] drm/nouveau: Add DRM_IOCTL_NOUVEAU_GET_ZCULL_INFO Mel Henning
2026-02-05 18:56   ` Mel Henning
2026-02-13 17:13   ` Danilo Krummrich
2026-02-13 17:13     ` Danilo Krummrich
2026-02-13 22:06     ` M Henning
2026-02-13 22:06       ` M Henning

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=DGE6O1OYR4F3.2PSFQLJ8XXJ78@kernel.org \
    --to=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mary@mary.zone \
    --cc=mhenning@darkrefraction.com \
    --cc=mripard@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=simona@ffwll.ch \
    /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.