public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dma-buf: add no-op stubs when CONFIG_DMA_SHARED_BUFFER is disabled
Date: Thu, 27 Nov 2025 11:26:23 +0100	[thread overview]
Message-ID: <79688e4f-203c-4e06-b73a-641dcc3f4c73@amd.com> (raw)
In-Reply-To: <4o3meb52jvgjrtqswpmrgkgjhn4zbzkvmyen4zqrkzeypsthpt@nt4vm7jwqash>

On 11/27/25 09:23, Viresh Kumar wrote:
> On 27-11-25, 09:07, Christian König wrote:
>> On 11/27/25 08:40, Viresh Kumar wrote:
>>> Move several dma-buf function declarations under
>>> CONFIG_DMA_SHARED_BUFFER and provide static inline no-op implementations
>>> for the disabled case to allow the callers to build when the feature is
>>> not compiled in.
>>
>> Good point, but which driver actually needs that?
> 
> This broke some WIP stuff [1] which isn't posted upstream yet. That's why I
> didn't mention anything in the commit log, though I could have added a comment
> about that in the non-commit-log part.

Well then better send that out with the full patch set.

>> In other words there should be a concrete example of what breaks in the commit message.
> 
> There is time for those changes to be posted and not sure if they will be
> accepted or not. But either way, this change made sense in general and so I
> thought there is nothing wrong to get this upstream right away.

Yeah when it is unused intermediately then that is usually a no-go even if I agree that it makes sense.

>>> +static inline struct dma_buf *dma_buf_get(int fd)
>>> +{
>>> +	return NULL;
>>
>> And here ERR_PTR(-EINVAL).
> 
> I am not really sure if this should be EINVAL in this case. EOPNOTSUPP still
> makes sense as the API isn't supported.

When the API isn't compiled in the fd can't be valid (because you can't create a dma_buf object in the first place).

So returning -EINVAL still makes a lot of sense.

Regards,
Christian.

> 
>>> +static inline struct dma_buf *dma_buf_iter_begin(void)
>>> +{
>>> +	return NULL;
>>> +}
>>> +
>>> +static inline struct dma_buf *dma_buf_iter_next(struct dma_buf *dmbuf)
>>> +{
>>> +	return NULL;
>>> +}
>>
>> Those two are only for BPF and not driver use.
> 
> Will drop them.
> 


      reply	other threads:[~2025-11-27 10:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-27  7:40 [PATCH] dma-buf: add no-op stubs when CONFIG_DMA_SHARED_BUFFER is disabled Viresh Kumar
2025-11-27  8:07 ` Christian König
2025-11-27  8:23   ` Viresh Kumar
2025-11-27 10:26     ` Christian König [this message]

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=79688e4f-203c-4e06-b73a-641dcc3f4c73@amd.com \
    --to=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=viresh.kumar@linaro.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