mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Chunkai Deng <chunkai.deng@oss.qualcomm.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	linux-kernel@vger.kernel.org, chris.lew@oss.qualcomm.com,
	tony.truong@oss.qualcomm.com
Subject: Re: [PATCH] rpmsg: glink: Split protocol start out of native_probe
Date: Fri, 17 Jul 2026 12:54:27 +0200	[thread overview]
Message-ID: <2be76246-3430-4f76-b6a9-11de39a961e7@oss.qualcomm.com> (raw)
In-Reply-To: <0585ee18-5bd3-424b-93b1-eb841c26b63d@oss.qualcomm.com>

On 7/6/26 10:59 AM, Chunkai Deng wrote:
> On 6/29/2026 8:47 PM, Konrad Dybcio wrote:
> 
>> On 6/19/26 7:01 AM, Chunkai Deng wrote:
>>> The SMEM and RPM transports request their receive interrupt with
>>> IRQF_NO_AUTOEN and enable it only after qcom_glink_native_probe()
>>> returns. Since native_probe() sends the initial version command, the
>>> remote may ACK before the local IRQ is enabled, stalling the version
>>> handshake on a fast remote.
>>>
>>> Split the protocol start (qcom_glink_send_version() and
>>> qcom_glink_create_chrdev()) into a new qcom_glink_native_start().
>>> Transports now enable their IRQ first, then call native_start(), so the
>>> version ACK is guaranteed to be serviced.
>>>
>>> Signed-off-by: Chunkai Deng <chunkai.deng@oss.qualcomm.com>
>>> ---
>> Would it not be simpler to just move the devm_request_irq a bit down
>> and remove the NO_AUTOEN flag then?
> 
> Thanks for the suggestion.
> I analyzed and verified it locally,but I'd personally still lean towards
> keeping the current change as-is. My reasoning:
> 
> (1) The IRQ must be live before the version handshake — that's the core
> point that can't change. The version command is sent from native_start(),
> so we need to request/enable the IRQ first and only then call
> native_start(). That ordering is only possible with the version send
> kept out of native_probe(), so the split needs to stay.
> 
> (2) Dropping IRQF_NO_AUTOEN does make the structure a little simpler,
> and functionally it's equivalent, but I'd lean towards keeping the
> request-disabled + explicit enable_irq() form. It makes the ordering
> constraint visible at the call site: the IRQ is requested up front,
> and enable_irq() marks the exact point where the handler becomes safe
> to run(glink assigned) and where we want RX servicing to begin. Folding
> that into an implicit auto-enable hides that intent, and I think the
> explicit form is easier to maintain.
> 
> That said, if you'd prefer the simpler form, I'm happy to do the IRQ
> cleanup as a separate follow-up patch on top of this fix rather than
> mixing the refactor into the race fix.

Please don't paste AI responses into your email client, there's a human
on the other side..

If this patch was also created with the use of a coding agent, it must
be disclosed and follow the rules established in:

Documentation/process/coding-assistants.rst

Konrad

  reply	other threads:[~2026-07-17 10:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19  5:01 Chunkai Deng
2026-06-29 12:47 ` Konrad Dybcio
2026-07-06  8:59   ` Chunkai Deng
2026-07-17 10:54     ` Konrad Dybcio [this message]
2026-07-20 10:35       ` Chunkai Deng

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=2be76246-3430-4f76-b6a9-11de39a961e7@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=chris.lew@oss.qualcomm.com \
    --cc=chunkai.deng@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=tony.truong@oss.qualcomm.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®