Linux-remoteproc Archive mirror
 help / color / mirror / Atom feed
From: Hari Nagalla <hnagalla@ti.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>,
	Nishanth Menon <nm@ti.com>, "Nandan, Apurva" <a-nandan@ti.com>
Cc: "Bjorn Andersson" <andersson@kernel.org>,
	linux-remoteproc@vger.kernel.org, kernel@pengutronix.de,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH 1/3] remoteproc: k3-dsp: Suppress duplicate error message in .remove()
Date: Mon, 4 Dec 2023 12:53:28 -0600	[thread overview]
Message-ID: <3b569540-a53d-d84a-d8e1-1ccb1db219dd@ti.com> (raw)
In-Reply-To: <CANLsYky5tL6UZADgVBPEnPkN4GMKOhvn95oci7PywSZ2nyNXqg@mail.gmail.com>

Hi Mathieu, Uwe,


On 11/30/23 11:19, Mathieu Poirier wrote:
>> --- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c
>> +++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
>> @@ -835,8 +835,9 @@ static int k3_dsp_rproc_remove(struct platform_device *pdev)
>>          if (rproc->state == RPROC_ATTACHED) {
>>                  ret = rproc_detach(rproc);
>>                  if (ret) {
>> +                       /* Note this error path leaks resources */the
>>                          dev_err(dev, "failed to detach proc, ret = %d\n", ret);
>> -                       return ret;
>> +                       return 0;
> Please have a look at this error path.  As with the scenario where the
> remote processor is controlled by the remoteproc core, nothing can be
> done in .remove() to prevent the driver from going away.  As such and
> even if rproc_detach() fails, other resources associated with this
> remote processor should be cleaned-up.

Since, anyway the driver goes away we probably need a force cleanup of 
the resources even if 'rproc_detach' fails. Looking a bit into the 
remote core driver, the detach can fail if it fails to get mutex lock or 
unable to reset resource table. It appears to me failure of reset 
resource table is remote
IMO, we can throw an error message when 'rproc_detach' fails in 
'dsp_rproc_remove' and proceed with the rest of the resource clean 
up,i.e call 'rproc_del()', followed by calls to ti device manager to 
relinquish the remote dsp processor.

Best,
Hari Nagalla

  parent reply	other threads:[~2023-12-04 18:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23 21:16 [PATCH 0/3] remoteproc: k3-dsp: Some cleanups Uwe Kleine-König
2023-11-23 21:16 ` [PATCH 1/3] remoteproc: k3-dsp: Suppress duplicate error message in .remove() Uwe Kleine-König
2023-11-29 17:35   ` Mathieu Poirier
2023-11-29 22:50     ` Uwe Kleine-König
2023-11-30 16:36       ` Mathieu Poirier
2023-11-30 17:19   ` Mathieu Poirier
2023-12-01  8:39     ` Uwe Kleine-König
2023-12-04 18:53     ` Hari Nagalla [this message]
2023-11-23 21:17 ` [PATCH 2/3] remoteproc: k3-dsp: Use symbolic error codes in error messages Uwe Kleine-König
2023-11-23 21:17 ` [PATCH 3/3] remoteproc: k3-dsp: Convert to platform remove callback returning void Uwe Kleine-König

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=3b569540-a53d-d84a-d8e1-1ccb1db219dd@ti.com \
    --to=hnagalla@ti.com \
    --cc=a-nandan@ti.com \
    --cc=andersson@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=nm@ti.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).