mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Wu <kunjinkao.jp@gmail.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	Vinod Koul <vkoul@kernel.org>,
	Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soundwire: stream: validate slave port against DisCo port bitmap
Date: Tue, 14 Jul 2026 16:35:28 +0800	[thread overview]
Message-ID: <48f0b6d7-6cf8-4f61-aee7-927660f063b6@gmail.com> (raw)
In-Reply-To: <cf0a24a9-40f1-4669-b616-9e244c1e7876@linux.dev>

> Smart, good idea. I would recommend adding the first sentence as code comments, I had to look up the code to figure out what it did.

I'll add a short comment explaining that the generic range check does
not verify whether the Slave exposes the port for the requested
direction.

> That's a problem in general, maybe push this patch first through the Intel/SOF CI to check that some SoundWire platforms are tested?

I'll run the updated patch through the Intel/SOF CI before posting v2.

> That comment is a tad misleading.
> 
> In the real world, all drivers ignore DisCo properties provided by platform firmware, and hard-code the values, e.g.
> 
> 	prop->source_ports = 0x14; /* BITMAP: 00010100 */
> 	prop->sink_ports = 0x8; /* BITMAP:  00001000 */
> 
> Those properties are really not optional at all, what's optional is that they are blindly read from firmware.

Agreed. Describing source_ports and sink_ports as optional is 
inaccurate.So I'll rework the comment.


> This test is a bit odd, there could be cases where only source_ports are defined so you would try to check for a sink_port in sdw_get_slave_dpn_prop()
> It probably works in the end but maybe you could check s_rt->direction with source/sink port first?

I'll select the relevant bitmap based on the stream direction first and
reject a zero bitmap for that direction.




  reply	other threads:[~2026-07-14  8:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13  7:15 Eric Wu
2026-07-13  8:01 ` Pierre-Louis Bossart
2026-07-14  8:35   ` Eric Wu [this message]
2026-07-14  8:44   ` chang wu
     [not found]     ` <CAMTmk-1rJ+iTfQCvi4kLFBE7Z9T=n2P2xaRDem7P8qAx29PHHw@mail.gmail.com>
2026-07-31 13:01       ` chang wu

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=48f0b6d7-6cf8-4f61-aee7-927660f063b6@gmail.com \
    --to=kunjinkao.jp@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@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

all inboxes | Powered by JetHome®