Message ID | 20230508103901.7840-1-rf@opensource.cirrus.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2067136vqo; Mon, 8 May 2023 04:07:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5CaxZdiFj0ZdYF8ZUKQaWQ4mLq0Pn2D/87HQV6ieBS5sEikGKCy/HtHKdPMIm4RlhifASY X-Received: by 2002:a05:6a20:9385:b0:ef:e240:b564 with SMTP id x5-20020a056a20938500b000efe240b564mr12524272pzh.47.1683544047258; Mon, 08 May 2023 04:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683544047; cv=none; d=google.com; s=arc-20160816; b=EhVQzPgeFK9vku6FUI7zljLpQiw+fhjmquMrxLSGDJXbmRIut/xkoyju8RlfkXn8fA OFMF3Enq5gRYKjBsahfowARzGrrky3L+rtn8x+B7RkHRnqlB9o775paP6zOxz2Vi4Xf5 HFhU/6ajEqbgGC/Se5TnYrKVUpp5b/fkvrKZoTzfvnrutBvTEEUksVqXYCNRQaGTcXHp hEu629WHnLmISmy4cGuG9PZswC+yJ/4XttIdvzmR+9oNuPOyTc+BeA82wTt9rRy6J7A2 8lVov3GsrPPgQPbExZtcgHzujGBF1r6m/WrEF6FFjy5QId70edzY/tdUw6eatK+d1QjJ rR4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=GndCEdzK1snefdFRYVEkK8R4R1g8K0x/+ofecHZlDn4=; b=bbMOlJyjbvbUkoT3I6ksOAJsl928MvqUxqFK218Jg+r5n1VJ5pVkJ89G2rOvi6lu+t TxsngoHg0GgiR+3uq7sI2ultlMZUAeMMCgRT9XNzCOLwejKrj3+a277S1GUyobziVEHi jX3V0RmdM7UVy4d4Gl5izwfeTh95RMER3oEcamUjV0YzBDCY3rVZEHscnti/JIMfaP9w gmzLm1YVSeiupho3+GxcPlbwakM96mDAh/yyyziBXFtb2sCnmwyPs/TV5fc1zLXk5mN+ u7uCaOwDqpRkZbMvPcAZtqFp6RBD63tGuM0gzVDEJ5xUqcfk28jk70ZMC7R/NL1Xl77o fhjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=AP3UEY2x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l128-20020a622586000000b0063473a51539si149525pfl.398.2023.05.08.04.07.14; Mon, 08 May 2023 04:07:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=AP3UEY2x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234861AbjEHKj0 (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Mon, 8 May 2023 06:39:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234836AbjEHKjY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 8 May 2023 06:39:24 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AA0A2945B for <linux-kernel@vger.kernel.org>; Mon, 8 May 2023 03:39:22 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3489EmkA028057; Mon, 8 May 2023 05:39:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=GndCEdzK1snefdFRYVEkK8R4R1g8K0x/+ofecHZlDn4=; b=AP3UEY2x4slF7flmnqfWGrDWKWt3hEX6gXgE0YteQ05jmVw3Y3AljJQzbzjUpArLXqfY d8xMcma5cap0OCe4f9GuJjHUheFwZ0FJSknpCNjwbiq9CtC/g1g2LYuVS6JathPHubKp eZ9Y8jAkMIGEIZxvhgbptTeOxh86XflN+u1bMYjCMGkX0ffBFpsNKxkkF2Mf80hJERMr jOdV0Jy8xH3Y0Fwida6/LYYnvTwh870DehUgTwerTVXdUPQQ0x50FehX/qQQ2ZQlFm29 Y+93Dy+j6p8pLZDb8g6l1Q4wd83Vmj5aTjisr2xImqusZKe+mdY5luNmTgG+c+HtK3oe 8Q== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3qdkaqt25u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 May 2023 05:39:05 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 8 May 2023 05:39:04 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 8 May 2023 05:39:04 -0500 Received: from EDIN4L06LR3.ad.cirrus.com (EDIN4L06LR3.ad.cirrus.com [198.61.64.221]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id BD87B475; Mon, 8 May 2023 10:39:03 +0000 (UTC) From: Richard Fitzgerald <rf@opensource.cirrus.com> To: <vkoul@kernel.org>, <pierre-louis.bossart@linux.intel.com> CC: <yung-chuan.liao@linux.intel.com>, <sanyog.r.kale@intel.com>, <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>, <patches@opensource.cirrus.com>, Richard Fitzgerald <rf@opensource.cirrus.com> Subject: [PATCH] soundwire: intel: Make DEV_NUM_IDA_MIN a module param Date: Mon, 8 May 2023 11:39:01 +0100 Message-ID: <20230508103901.7840-1-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 4RI7U7Hf5yYf6td2Ckif9-tZ5xmGGciR X-Proofpoint-GUID: 4RI7U7Hf5yYf6td2Ckif9-tZ5xmGGciR X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765323882930688096?= X-GMAIL-MSGID: =?utf-8?q?1765323882930688096?= |
Series |
soundwire: intel: Make DEV_NUM_IDA_MIN a module param
|
|
Commit Message
Richard Fitzgerald
May 8, 2023, 10:39 a.m. UTC
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(-)
Comments
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);
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);