From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 075BBECAAD3 for ; Thu, 15 Sep 2022 13:10:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229536AbiIONK1 (ORCPT ); Thu, 15 Sep 2022 09:10:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229852AbiIONKZ (ORCPT ); Thu, 15 Sep 2022 09:10:25 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2E272E9CC; Thu, 15 Sep 2022 06:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663247423; x=1694783423; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=HoCpplRGmLa8NMZ/Auv5ElmwuTYU4eLsbnw+GC1f8LU=; b=GDMbYg/7ty3Pnn48jYjN0+yMkqkSwD7PinOogk+POn/HTD8unqr/uy6d GAj26ots8CjQuvk/PXCCy0czqaA5weVyeKQQzp3t5cdsbwLn7gEOL7lZ+ wuH9ZCnmRXodRdP10T2buzXhaFzu7YRnBTlENk708uUVqxAGHuewLlfSM b1sF/sy0NZvwNSCkj0ttnmgk/Zfi4lARn83uWpIidpC2vGsr3vJhCym5/ 50M7OtmkhdycOtaG1DVsxEHjK6Vod0PgaiCVzPjxngUMS9fre3Q724LnU CJvHOVtYyEeIFKaGq1T50QkJIwQ/hOSOejAAN2IU/7KIzCqhIy1dgxtKx A==; X-IronPort-AV: E=McAfee;i="6500,9779,10470"; a="281737598" X-IronPort-AV: E=Sophos;i="5.93,318,1654585200"; d="scan'208";a="281737598" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2022 06:10:23 -0700 X-IronPort-AV: E=Sophos;i="5.93,318,1654585200"; d="scan'208";a="617269024" Received: from bhomann-mobl.ger.corp.intel.com (HELO [10.252.61.7]) ([10.252.61.7]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2022 06:10:21 -0700 Message-ID: <3962348a-33b4-5941-4a0b-cb447a513a41@linux.intel.com> Date: Thu, 15 Sep 2022 15:10:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: [PATCH] soundwire: qcom: update status from device id 1 Content-Language: en-US To: Srinivas Kandagatla , vkoul@kernel.org Cc: yung-chuan.liao@linux.intel.com, sanyog.r.kale@intel.com, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, quic_srivasam@quicinc.com References: <20220915124215.13703-1-srinivas.kandagatla@linaro.org> From: Pierre-Louis Bossart In-Reply-To: <20220915124215.13703-1-srinivas.kandagatla@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 9/15/22 14:42, Srinivas Kandagatla wrote: > By default autoenumeration is enabled on QCom SoundWire controller > which means the core should not be dealing with device 0 w.r.t enumeration. > Currently device 0 status is also shared with SoundWire core which confuses > the core sometimes and we endup adding 0:0:0:0 slave device. The change looks fine, but the description of the issue is surprising. Whether autoenumeration is enabled or not is irrelevant, by spec the device0 cannot be in ALERT status and throw in-band interrupts to the host with this mechanism. > Signed-off-by: Srinivas Kandagatla > --- > drivers/soundwire/qcom.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c > index e21a3306bf01..871e4d8b32c7 100644 > --- a/drivers/soundwire/qcom.c > +++ b/drivers/soundwire/qcom.c > @@ -428,7 +428,7 @@ static int qcom_swrm_get_alert_slave_dev_num(struct qcom_swrm_ctrl *ctrl) > > ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val); > > - for (dev_num = 0; dev_num <= SDW_MAX_DEVICES; dev_num++) { > + for (dev_num = 1; dev_num <= SDW_MAX_DEVICES; dev_num++) { > status = (val >> (dev_num * SWRM_MCP_SLV_STATUS_SZ)); > > if ((status & SWRM_MCP_SLV_STATUS_MASK) == SDW_SLAVE_ALERT) { > @@ -448,7 +448,7 @@ static void qcom_swrm_get_device_status(struct qcom_swrm_ctrl *ctrl) > ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val); > ctrl->slave_status = val; > > - for (i = 0; i <= SDW_MAX_DEVICES; i++) { > + for (i = 1; i <= SDW_MAX_DEVICES; i++) { > u32 s; > > s = (val >> (i * 2)); From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7236BECAAD3 for ; Thu, 15 Sep 2022 13:11:26 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 90CE319FD; Thu, 15 Sep 2022 15:10:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 90CE319FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1663247484; bh=HoCpplRGmLa8NMZ/Auv5ElmwuTYU4eLsbnw+GC1f8LU=; h=Date:Subject:To:References:From:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=f9bdtLAUa0FsaIDQQdXr2qd+pIytn9qqRnaxZAGhK7ehuL5JsR8t8w3Nll/5ClcV1 56cnELRZDI9mkLW+JR0spu8pnRqIonL4upiNYXLlZVkazf5j9889f/4DyMFIuObHrU 8s9OaCB7PoiE8Rl2QYqz/96/cxYdj9Sm+bzQg5EQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3896DF8013D; Thu, 15 Sep 2022 15:10:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E4D07F80238; Thu, 15 Sep 2022 15:10:32 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 48B48F800B5 for ; Thu, 15 Sep 2022 15:10:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 48B48F800B5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YnkEJwtC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663247427; x=1694783427; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=HoCpplRGmLa8NMZ/Auv5ElmwuTYU4eLsbnw+GC1f8LU=; b=YnkEJwtCS86KAIdLBtBJkHPyR/6ze0G/g3eeSp6y6sZ2FGH2IqPGFUuC fADpF4ExttjFM+dUBXxiZm6n3G1LDmnMsz2e+ykSK3+cG+WFnJCGYDw2/ krriiNi/wjLdtVTTIu1qVvoOKp5u5/8jUX8Z2Oe4bii9Vk6SI3vWLNew9 rtMGUOGUGrOUHCVhssCBxwmdDxiH7Cnfj7pMhTUQ7YqON/hQrQVkFGCyo cw9HmWFAJmClniyBemsOLpblNq3WTL5IsUEBOWUuGNyx8vE5xVPI8sVen 2JKlxIinLoMoJtRsfcILFeL4quZ4KyaNnAMNhc1vlOUtJsnEWEGKNO8mf Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10470"; a="362667803" X-IronPort-AV: E=Sophos;i="5.93,318,1654585200"; d="scan'208";a="362667803" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2022 06:10:23 -0700 X-IronPort-AV: E=Sophos;i="5.93,318,1654585200"; d="scan'208";a="617269024" Received: from bhomann-mobl.ger.corp.intel.com (HELO [10.252.61.7]) ([10.252.61.7]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2022 06:10:21 -0700 Message-ID: <3962348a-33b4-5941-4a0b-cb447a513a41@linux.intel.com> Date: Thu, 15 Sep 2022 15:10:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.11.0 Subject: Re: [PATCH] soundwire: qcom: update status from device id 1 Content-Language: en-US To: Srinivas Kandagatla , vkoul@kernel.org References: <20220915124215.13703-1-srinivas.kandagatla@linaro.org> From: Pierre-Louis Bossart In-Reply-To: <20220915124215.13703-1-srinivas.kandagatla@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, sanyog.r.kale@intel.com, yung-chuan.liao@linux.intel.com, quic_srivasam@quicinc.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 9/15/22 14:42, Srinivas Kandagatla wrote: > By default autoenumeration is enabled on QCom SoundWire controller > which means the core should not be dealing with device 0 w.r.t enumeration. > Currently device 0 status is also shared with SoundWire core which confuses > the core sometimes and we endup adding 0:0:0:0 slave device. The change looks fine, but the description of the issue is surprising. Whether autoenumeration is enabled or not is irrelevant, by spec the device0 cannot be in ALERT status and throw in-band interrupts to the host with this mechanism. > Signed-off-by: Srinivas Kandagatla > --- > drivers/soundwire/qcom.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c > index e21a3306bf01..871e4d8b32c7 100644 > --- a/drivers/soundwire/qcom.c > +++ b/drivers/soundwire/qcom.c > @@ -428,7 +428,7 @@ static int qcom_swrm_get_alert_slave_dev_num(struct qcom_swrm_ctrl *ctrl) > > ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val); > > - for (dev_num = 0; dev_num <= SDW_MAX_DEVICES; dev_num++) { > + for (dev_num = 1; dev_num <= SDW_MAX_DEVICES; dev_num++) { > status = (val >> (dev_num * SWRM_MCP_SLV_STATUS_SZ)); > > if ((status & SWRM_MCP_SLV_STATUS_MASK) == SDW_SLAVE_ALERT) { > @@ -448,7 +448,7 @@ static void qcom_swrm_get_device_status(struct qcom_swrm_ctrl *ctrl) > ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val); > ctrl->slave_status = val; > > - for (i = 0; i <= SDW_MAX_DEVICES; i++) { > + for (i = 1; i <= SDW_MAX_DEVICES; i++) { > u32 s; > > s = (val >> (i * 2));