mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aksh Garg <a-garg7@ti.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: <linux-pci@vger.kernel.org>, <linux-doc@vger.kernel.org>,
	<bhelgaas@google.com>, <corbet@lwn.net>, <cassel@kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <s-vadapalli@ti.com>,
	<danishanwar@ti.com>, <srk@ti.com>
Subject: Re: [RFC PATCH 3/4] PCI/DOE: Add DOE mailbox support for endpoint functions
Date: Mon, 23 Feb 2026 16:14:42 +0530	[thread overview]
Message-ID: <33c4d9c3-d4aa-44bd-bab0-65445cb7014e@ti.com> (raw)
In-Reply-To: <aZr_cD9LIQgvywri@wunner.de>



On 22/02/26 18:36, Lukas Wunner wrote:
> On Fri, Feb 13, 2026 at 06:06:02PM +0530, Aksh Garg wrote:
>> Add the DOE support for PCIe endpoint devices, enabling endpoint
>> functions to process the DOE requests from the host. The implementation
>> provides framework APIs for controller drivers to register mailboxes,
>> protocol handler registration for different DOE data object types, and
>> request processing with workqueues ensuring sequential handling per
>> mailbox. The Discovery protocol is handled internally by the DOE core.
> 
> This looks like it is largely a duplication of drivers/pci/doe.c,
> including the asynchronous request support that was originally added
> but was never needed and so was clearly a mistake.
> 
> I'm wondering why the async suport is needed in the endpoint case?
> Why can't this (only) be synchronous?

The DOE framework for the endpoint case needs to be asynchronous because
a PF can have multiple instances of DOE mailboxes, and the requests may
be interleaved across the mailboxes (the request processing of one
mailbox should not result in blocking the request processing of other
mailbox, as per the DOE ECN). Hence, the request on each of them needs
to be handled in parallel for optimization. For the EP controller driver
to handle requests on multiple mailboxes per-PF in parallel,
pci_ep_doe_process_request() needs to be asynchronous.
However, I noticed the use of wait_for_completion() within this function
makes the overall function synchronous for the caller, which I
overlooked while posting this patch.


Please provide feedback if the following framework would work instead:

The function pci_ep_doe_process_request() would be called by the EP
controller driver when a request arrives on a mailbox. Instead of
wait_for_completion() in this function, the function would return
immediately after submitting the work in the queue, hence eliminating
the need of private data for completion in the task structure.

A completion callback from the EP driver would be passed to this
function along with the current parameters, which would be passed to the
task structure as task->complete. Whenever signal_task_complete() is
invoked, the completion callback of the EP driver would be called, which
would take func_no, cap_offset (to help the EP driver to identify the
mailbox), and the status of the work as input, hence eliminating the
need of task_status in the task structure as well.

This would make pci_ep_doe_process_request() asynchronous as per the
requirement.


While going through the driver implementation of doe.c, I noticed that
the pci_doe() was made synchronous in commit 62e8b17ffc2f ("PCI/DOE:
Provide synchronous API and use it internally"), which builds on the
internal asynchronous machinery using WORK_QUEUES. As the pci_doe() is
synchronous for the callers, why the WORK_QUEUE framework was not 
removed from the doe.c implementation in that commit?

> 
> Thanks,
> 
> Lukas


  reply	other threads:[~2026-02-23 10:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-13 12:35 [RFC PATCH 0/4] PCI: Add DOE support for endpoint Aksh Garg
2026-02-13 12:36 ` [RFC PATCH 1/4] PCI: Add documentation for DOE endpoint support Aksh Garg
2026-02-13 20:33   ` Niklas Cassel
2026-02-18 11:21     ` Aksh Garg
2026-02-13 12:36 ` [RFC PATCH 2/4] PCI/DOE: Move common definitions to the header file Aksh Garg
2026-02-22 13:01   ` Lukas Wunner
2026-02-23  7:30     ` Aksh Garg
2026-02-13 12:36 ` [RFC PATCH 3/4] PCI/DOE: Add DOE mailbox support for endpoint functions Aksh Garg
2026-02-13 13:21   ` Niklas Cassel
2026-02-18  4:28   ` Alistair Francis
2026-03-04 14:18     ` Manivannan Sadhasivam
2026-03-06 12:14       ` Aksh Garg
2026-02-22 13:06   ` Lukas Wunner
2026-02-23 10:44     ` Aksh Garg [this message]
2026-03-04 14:17   ` Manivannan Sadhasivam
2026-03-06  8:17     ` Aksh Garg
2026-02-13 12:36 ` [RFC PATCH 4/4] PCI: Document APIs for endpoint DOE implementation Aksh Garg
2026-02-13 13:16 ` [RFC PATCH 0/4] PCI: Add DOE support for endpoint Niklas Cassel
2026-03-04 14:22 ` Manivannan Sadhasivam

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=33c4d9c3-d4aa-44bd-bab0-65445cb7014e@ti.com \
    --to=a-garg7@ti.com \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=corbet@lwn.net \
    --cc=danishanwar@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=s-vadapalli@ti.com \
    --cc=srk@ti.com \
    /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

all inboxes | Powered by JetHome®