From: Peng Fan <peng.fan@oss.nxp.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: oe-kbuild@lists.linux.dev, Peng Fan <peng.fan@nxp.com>,
Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Andrew Davis <afd@ti.com>,
Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
Daniel Baluta <daniel.baluta@nxp.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
lkp@intel.com, oe-kbuild-all@lists.linux.dev,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 4/7] remoteproc: core: Use cleanup.h macros to simplify lock handling
Date: Tue, 14 Oct 2025 18:45:11 +0800 [thread overview]
Message-ID: <20251014104511.GA14479@nxa18884-linux.ap.freescale.net> (raw)
In-Reply-To: <202510121908.7aduLIkw-lkp@intel.com>
Hi Dan,
I am not sure, Is this false alarm?
On Tue, Oct 14, 2025 at 11:39:41AM +0300, Dan Carpenter wrote:
>Hi Peng,
>
>
>vim +/ret +1841 drivers/remoteproc/remoteproc_core.c
>
>70b85ef83ce3523 Fernando Guzman Lugo 2012-08-30 1829 int rproc_trigger_recovery(struct rproc *rproc)
>70b85ef83ce3523 Fernando Guzman Lugo 2012-08-30 1830 {
>7e83cab824a8670 Sarangdhar Joshi 2017-05-26 1831 struct device *dev = &rproc->dev;
>7e83cab824a8670 Sarangdhar Joshi 2017-05-26 1832 int ret;
>7e83cab824a8670 Sarangdhar Joshi 2017-05-26 1833
>c42baf6f84c7694 Peng Fan 2025-10-10 1834 ACQUIRE(mutex_intr, lock)(&rproc->lock);
>c42baf6f84c7694 Peng Fan 2025-10-10 1835 ret = ACQUIRE_ERR(mutex_intr, &lock);
>7e83cab824a8670 Sarangdhar Joshi 2017-05-26 1836 if (ret)
>7e83cab824a8670 Sarangdhar Joshi 2017-05-26 1837 return ret;
>7e83cab824a8670 Sarangdhar Joshi 2017-05-26 1838
>0b145574b6cd2b3 Alex Elder 2020-02-28 1839 /* State could have changed before we got the mutex */
>0b145574b6cd2b3 Alex Elder 2020-02-28 1840 if (rproc->state != RPROC_CRASHED)
>c42baf6f84c7694 Peng Fan 2025-10-10 @1841 return ret;
>
>Please change this to either "return 0;" or "return -ERRORCODE;"
ACQUIRE_ERR should already returns 0. This change does not change the
assignment to ret as my understanding. Please help to see if this is false
alarm or I miss something?
>
>400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1980
>c42baf6f84c7694 Peng Fan 2025-10-10 1981 ACQUIRE(mutex_intr, lock)(&rproc->lock);
>c42baf6f84c7694 Peng Fan 2025-10-10 1982 ret = ACQUIRE_ERR(mutex_intr, &lock);
>400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1983 if (ret) {
>400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1984 dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, ret);
>c13b780c4597e1e Suman Anna 2022-02-13 1985 return ret;
>400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1986 }
>400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1987
>c42baf6f84c7694 Peng Fan 2025-10-10 1988 if (rproc->state != RPROC_RUNNING && rproc->state != RPROC_ATTACHED)
>c42baf6f84c7694 Peng Fan 2025-10-10 1989 return -EINVAL;
>5e6a0e05270e3a4 Shengjiu Wang 2022-03-28 1990
>400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1991 /* if the remote proc is still needed, bail out */
>400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1992 if (!atomic_dec_and_test(&rproc->power))
>c42baf6f84c7694 Peng Fan 2025-10-10 @1993 return ret;
>
>Same.
Same as above.
Thanks,
Peng
>
next prev parent reply other threads:[~2025-10-14 9:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 12:24 [PATCH v2 0/7] remoteproc: core: misc update Peng Fan
2025-10-10 12:24 ` [PATCH v2 1/7] remoteproc: core: Drop redundant initialization of 'ret' in rproc_shutdown() Peng Fan
2025-10-11 0:22 ` Andrew Davis
2025-10-10 12:24 ` [PATCH v2 2/7] remoteproc: core: Sort header includes Peng Fan
2025-10-11 0:23 ` Andrew Davis
2025-10-10 12:24 ` [PATCH v2 3/7] remoteproc: core: Removed unused headers Peng Fan
2025-10-11 0:26 ` Andrew Davis
2025-10-10 12:24 ` [PATCH v2 4/7] remoteproc: core: Use cleanup.h macros to simplify lock handling Peng Fan
2025-10-11 0:34 ` Andrew Davis
2025-10-14 10:55 ` Peng Fan
2025-10-14 8:39 ` Dan Carpenter
2025-10-14 10:45 ` Peng Fan [this message]
2025-10-14 11:31 ` Dan Carpenter
2025-10-10 12:24 ` [PATCH v2 5/7] remoteproc: core: Remove unused export of rproc_va_to_pa Peng Fan
2025-10-11 0:34 ` Andrew Davis
2025-10-10 12:24 ` [PATCH v2 6/7] remoteproc: stm32: Avoid directly taking address of auto_boot Peng Fan
2025-10-11 0:37 ` Andrew Davis
2025-10-10 12:24 ` [PATCH v2 7/7] remoteproc: core: Consolidate bool flags into 1-bit bitfields Peng Fan
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=20251014104511.GA14479@nxa18884-linux.ap.freescale.net \
--to=peng.fan@oss.nxp.com \
--cc=afd@ti.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andersson@kernel.org \
--cc=arnaud.pouliquen@foss.st.com \
--cc=dan.carpenter@linaro.org \
--cc=daniel.baluta@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=lkp@intel.com \
--cc=mathieu.poirier@linaro.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=peng.fan@nxp.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