mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srini@kernel.org>
To: Avi Weiss <thnkslprpt@gmail.com>, Srinivas Kandagatla <srini@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] slimbus: return port disconnect errors from stream unprepare
Date: Tue, 24 Nov 2026 21:40:27 +0000	[thread overview]
Message-ID: <460a60f1-34a4-4c6a-977c-3e1c6543f8fc@kernel.org> (raw)
In-Reply-To: <20261029125631.1551141-2-thnkslprpt@gmail.com>



On 10/29/26 12:56 PM, Avi Weiss wrote:
> slim_stream_unprepare() ignores errors from slim_disconnect_port()
> and returns success even when a port disconnect transaction fails.
> 
> Continue attempting to disconnect all ports, but return the first
> error to the caller. Keep freeing the port array after the attempts
> so a failed disconnect does not prevent a subsequent stream prepare.
> 
> Fixes: abb9c9b8b51b ("slimbus: stream: add stream support")

cc stable is missing


> Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
> ---
> Changes in v2:
> - limit the fix to reporting the first disconnect error (still attempt
>   every port and always release the port array)
> - dropped v1's retained port state, selective retry, and stream_free()
>   change to avoid blocking re-prepare in existing codec callers
> 
> A complete recovery solution would also require the codec callers to
> handle disconnect failures and coordinate hardware state, retries, and
> stream lifetime across stop/start cycles. That broader work is left for
> future submissions - this revision fixes error reporting without changing
> stream cleanup semantics.
> 
> v1: https://lore.kernel.org/r/20261028145508.1111792-2-thnkslprpt@gmail.com
> 
>  drivers/slimbus/stream.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/slimbus/stream.c b/drivers/slimbus/stream.c
> index b4e70a7edd1cc..220e22088f8f6 100644
> --- a/drivers/slimbus/stream.c
> +++ b/drivers/slimbus/stream.c
> @@ -448,19 +448,22 @@ EXPORT_SYMBOL_GPL(slim_stream_disable);
>   */
>  int slim_stream_unprepare(struct slim_stream_runtime *stream)
>  {
> -	int i;
> +	int ret = 0, err, i;
>  
>  	if (!stream->ports || !stream->num_ports)
>  		return -EINVAL;
>  
> -	for (i = 0; i < stream->num_ports; i++)
> -		slim_disconnect_port(stream, &stream->ports[i]);
> +	for (i = 0; i < stream->num_ports; i++) {
> +		err = slim_disconnect_port(stream, &stream->ports[i]);
> +		if (err && !ret)
> +			ret = err;
> +	}
>  
>  	kfree(stream->ports);
>  	stream->ports = NULL;
>  	stream->num_ports = 0;
>  
> -	return 0;
> +	return ret;
>  }
>  EXPORT_SYMBOL_GPL(slim_stream_unprepare);
>  
> 
> base-commit: 65ba8f34ec886ec72b2c07ddc8cf3d815c32869d


      reply	other threads:[~2026-11-24 21:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 12:56 Avi Weiss
2026-11-24 21:40 ` Srinivas Kandagatla [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=460a60f1-34a4-4c6a-977c-3e1c6543f8fc@kernel.org \
    --to=srini@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=thnkslprpt@gmail.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®