From: Xu Yilun <yilun.xu@linux.intel.com>
To: tze.yee.ng@altera.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-kernel@vger.kernel.org,
tien.sung.ang@altera.com
Subject: Re: [PATCH v3] fpga: stratix10-soc: Fix SVC mailbox handling during reconfiguration
Date: Sat, 27 Jun 2026 01:11:52 +0800 [thread overview]
Message-ID: <aj6y2CLYpdaQOGd4@yilunxu-OptiPlex-7050> (raw)
In-Reply-To: <0119f69b467e2b90240ebaa3aee3120f621ddee3.1782295811.git.tze.yee.ng@altera.com>
> @@ -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?
> 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?
> + 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.
> +
> +init_error:
> stratix10_svc_done(priv->chan);
> +init_done:
> return ret;
> }
next prev parent reply other threads:[~2026-06-26 17:11 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 [this message]
2026-06-30 6:13 ` NG, TZE YEE
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=aj6y2CLYpdaQOGd4@yilunxu-OptiPlex-7050 \
--to=yilun.xu@linux.intel.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=tze.yee.ng@altera.com \
--cc=yilun.xu@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 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.