From: "NG, TZE YEE" <tze.yee.ng@altera.com>
To: Xu Yilun <yilun.xu@linux.intel.com>
Cc: Moritz Fischer <mdf@kernel.org>, Xu Yilun <yilun.xu@intel.com>,
Tom Rix <trix@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Richard Gong <richard.gong@intel.com>,
Alan Tull <atull@kernel.org>,
"linux-fpga@vger.kernel.org" <linux-fpga@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Ang, Tien Sung" <tien.sung.ang@altera.com>
Subject: Re: [PATCH v3] fpga: stratix10-soc: Fix SVC mailbox handling during reconfiguration
Date: Tue, 30 Jun 2026 06:13:44 +0000 [thread overview]
Message-ID: <bb09519a-e2d0-4383-91b0-33fd32c23b1e@altera.com> (raw)
In-Reply-To: <aj6y2CLYpdaQOGd4@yilunxu-OptiPlex-7050>
On 27/6/2026 1:11 am, Xu Yilun wrote:
> [You don't often get email from yilun.xu@linux.intel.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
>> @@ -195,20 +195,20 @@ static int s10_ops_write_init(struct fpga_manager *mgr,
>> ret = s10_svc_send_msg(priv, COMMAND_RECONFIG,
>> &ctype, sizeof(ctype));
>> if (ret < 0)
>> - goto init_done;
>> + goto init_error;
>>
>> ret = wait_for_completion_timeout(
>> &priv->status_return_completion, S10_RECONFIG_TIMEOUT);
>> if (!ret) {
>> dev_err(dev, "timeout waiting for RECONFIG_REQUEST\n");
>> ret = -ETIMEDOUT;
>> - goto init_done;
>> + goto init_error;
>> }
>>
>> ret = 0;
>
> Why re-initialize ret here?
>
That was clearing the remaining jiffies left in ret by
wait_for_completion_timeout(). I'll drop it by not assigning the wait
result to ret.
>> if (!test_and_clear_bit(SVC_STATUS_OK, &priv->status)) {
>> ret = -ETIMEDOUT;
>> - goto init_done;
>> + goto init_error;
>> }
>>
>> /* Allocate buffers from the service layer's pool. */
>> @@ -216,16 +216,19 @@ static int s10_ops_write_init(struct fpga_manager *mgr,
>> kbuf = stratix10_svc_allocate_memory(priv->chan, SVC_BUF_SIZE);
>> if (IS_ERR(kbuf)) {
>> s10_free_buffers(mgr);
>> - ret = PTR_ERR(kbuf);
>> - goto init_done;
>> + ret = -ENOMEM;
>
> Why change the ret?
>
That was unrelated churn. I'll revert to PTR_ERR(kbuf).
>> + goto init_error;
>> }
>>
>> priv->svc_bufs[i].buf = kbuf;
>> priv->svc_bufs[i].lock = 0;
>> }
>>
>> -init_done:
>> + goto init_done;
>
> Happy path? why not just return 0; And you don't need init_done at all.
>
Agreed. I'll use return 0 on success and keep only init_error for
stratix10_svc_done() + return ret.
>> +
>> +init_error:
>> stratix10_svc_done(priv->chan);
>> +init_done:
>> return ret;
>> }
prev parent reply other threads:[~2026-06-30 6:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 10:11 [PATCH v3] fpga: stratix10-soc: Fix SVC mailbox handling during reconfiguration tze.yee.ng
2026-06-26 17:11 ` Xu Yilun
2026-06-30 6:13 ` NG, TZE YEE [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=bb09519a-e2d0-4383-91b0-33fd32c23b1e@altera.com \
--to=tze.yee.ng@altera.com \
--cc=atull@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=richard.gong@intel.com \
--cc=tien.sung.ang@altera.com \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.com \
--cc=yilun.xu@linux.intel.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