public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soundwire: intel: Make DEV_NUM_IDA_MIN a module param
@ 2023-05-08 10:39 Richard Fitzgerald
  2023-05-08 13:59 ` Pierre-Louis Bossart
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2023-05-08 10:39 UTC (permalink / raw)
  To: vkoul, pierre-louis.bossart
  Cc: yung-chuan.liao, sanyog.r.kale, alsa-devel, linux-kernel, patches,
	Richard Fitzgerald

Add a module param so that globally-unique peripheral ID
allocation is only enabled if wanted.

The globally-unique IDs were introduced by
commit c60561014257
("soundwire: bus: allow device number to be unique at system level")

and
commit 1f2dcf3a154a ("soundwire: intel: set dev_num_ida_min")

Assigning globally-unique IDs limits the total number of
peripherals in a system, and the above two commits limit to a
maximum of 8 peripherals. We now have hardware with more than
8 peripherals in total, so this limit is a problem. As the
original commit says that it is only for debug it can be made
optional.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 drivers/soundwire/intel_auxdevice.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c
index b21e86084f7b..9ebbf652e47a 100644
--- a/drivers/soundwire/intel_auxdevice.c
+++ b/drivers/soundwire/intel_auxdevice.c
@@ -23,8 +23,13 @@
 #include "intel.h"
 #include "intel_auxdevice.h"
 
-/* IDA min selected to avoid conflicts with HDaudio/iDISP SDI values */
-#define INTEL_DEV_NUM_IDA_MIN           4
+/*
+ * sdw_dev_num_min: Set to non-zero to enable globally-unique peripheral IDs.
+ * The value is the minimum ID that will be allocated.
+ */
+static int intel_dev_num_ida_min;
+module_param_named(sdw_dev_num_min, intel_dev_num_ida_min, int, 0444);
+MODULE_PARM_DESC(sdw_dev_num_min, "SoundWire Intel Master min globally-unique ID (0 to disable)");
 
 #define INTEL_MASTER_SUSPEND_DELAY_MS	3000
 
@@ -148,7 +153,7 @@ static int intel_link_probe(struct auxiliary_device *auxdev,
 	cdns->msg_count = 0;
 
 	bus->link_id = auxdev->id;
-	bus->dev_num_ida_min = INTEL_DEV_NUM_IDA_MIN;
+	bus->dev_num_ida_min = intel_dev_num_ida_min;
 	bus->clk_stop_timeout = 1;
 
 	sdw_cdns_probe(cdns);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] soundwire: intel: Make DEV_NUM_IDA_MIN a module param
  2023-05-08 10:39 [PATCH] soundwire: intel: Make DEV_NUM_IDA_MIN a module param Richard Fitzgerald
@ 2023-05-08 13:59 ` Pierre-Louis Bossart
  0 siblings, 0 replies; 2+ messages in thread
From: Pierre-Louis Bossart @ 2023-05-08 13:59 UTC (permalink / raw)
  To: Richard Fitzgerald, vkoul
  Cc: yung-chuan.liao, sanyog.r.kale, alsa-devel, linux-kernel, patches



On 5/8/23 05:39, Richard Fitzgerald wrote:
> Add a module param so that globally-unique peripheral ID
> allocation is only enabled if wanted.
> 
> The globally-unique IDs were introduced by
> commit c60561014257
> ("soundwire: bus: allow device number to be unique at system level")
> 
> and
> commit 1f2dcf3a154a ("soundwire: intel: set dev_num_ida_min")
> 
> Assigning globally-unique IDs limits the total number of
> peripherals in a system, and the above two commits limit to a
> maximum of 8 peripherals. We now have hardware with more than
> 8 peripherals in total, so this limit is a problem. As the
> original commit says that it is only for debug it can be made
> optional.
I think it's a misunderstanding, the introduction of these IDs was
related to hardware programming sequences, not just debug.

I'll talk to Richard on this, please do not apply this patch for now.

> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> ---
>  drivers/soundwire/intel_auxdevice.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c
> index b21e86084f7b..9ebbf652e47a 100644
> --- a/drivers/soundwire/intel_auxdevice.c
> +++ b/drivers/soundwire/intel_auxdevice.c
> @@ -23,8 +23,13 @@
>  #include "intel.h"
>  #include "intel_auxdevice.h"
>  
> -/* IDA min selected to avoid conflicts with HDaudio/iDISP SDI values */
> -#define INTEL_DEV_NUM_IDA_MIN           4
> +/*
> + * sdw_dev_num_min: Set to non-zero to enable globally-unique peripheral IDs.
> + * The value is the minimum ID that will be allocated.
> + */
> +static int intel_dev_num_ida_min;
> +module_param_named(sdw_dev_num_min, intel_dev_num_ida_min, int, 0444);
> +MODULE_PARM_DESC(sdw_dev_num_min, "SoundWire Intel Master min globally-unique ID (0 to disable)");
>  
>  #define INTEL_MASTER_SUSPEND_DELAY_MS	3000
>  
> @@ -148,7 +153,7 @@ static int intel_link_probe(struct auxiliary_device *auxdev,
>  	cdns->msg_count = 0;
>  
>  	bus->link_id = auxdev->id;
> -	bus->dev_num_ida_min = INTEL_DEV_NUM_IDA_MIN;
> +	bus->dev_num_ida_min = intel_dev_num_ida_min;
>  	bus->clk_stop_timeout = 1;
>  
>  	sdw_cdns_probe(cdns);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-08 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-08 10:39 [PATCH] soundwire: intel: Make DEV_NUM_IDA_MIN a module param Richard Fitzgerald
2023-05-08 13:59 ` Pierre-Louis Bossart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox