Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1901546rwn; Fri, 16 Sep 2022 02:35:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7j4anvWid54B86trl5ZAZMEtwZioyK4PjGr49MUuNCV6X4k/6gx87ul7XuLqLmNGlCcwz+ X-Received: by 2002:a17:902:ef45:b0:170:8b19:4e0f with SMTP id e5-20020a170902ef4500b001708b194e0fmr3981207plx.120.1663320911032; Fri, 16 Sep 2022 02:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663320911; cv=none; d=google.com; s=arc-20160816; b=UyXdlnCT4DXeRfIok8dTYwClnRS6lRnmoUP8bOoBw66cWAFMhfEu1d/ujgynbl/kog jOTwhLaFMjqAD39dX/GhDsLvPpTLdoHtZLhvFBI3IBUbLk5TpWPBCGa+4mtbqtDcdimb +YGh+OFYtIV4ksbzw33vJ1MbUAq2V2qsnaPwsBfYTZ+PWcDDfSQhcyPL7uRgPIn7iA+O zMS/FRiAlZH3L0Jxa8dj2LFco9SdIM4Pa4K6c2czD/LMsfoSRVL7GHMC/5IHau9S+W/n dt3Li8MNlKln/TsDO7w0YyWuDrU4R8ckdrBlwPfdZRzQgaMJmG+/cjYUVL6VP24ojWM5 oOLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mlaT4dkUmey+WYaJiYLCVZ+l1HaRfFbeV5h9SKJM/6M=; b=SrJy5rYCqc4UhL7fgoWTdoJ1Ww2BQT8a9QQa99FJCOmV7h+q2jxql6dbECn9Dveq9H qpvh5tN/E69ciKB+uFWhhAdprM94zwa/wxGOAwDHcr3SQyyACvJY2wUBb9D8GrQVP8oZ M3Z7/mmKoaTrtsMaD7woPmjZhZ97awhl3ZDnbZDJyNtZHAPA57J3efnQRQnpnrubhvfD t42X9vn5gNr47MoTOS/i7rpXD5ww3rVjn6Nw1gJ7A58eTBSxTBSEWPLfSa2wnbEyXeye oJjlBPxIiGdOLX91D9nPKTiZIQfeX4kTbPpMkI6ipzFypKwKdrvOlcjALsDreSdXbViL QDDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d2qcsHql; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f8-20020a656288000000b0042b60954b4fsi12483639pgv.324.2022.09.16.02.35.00; Fri, 16 Sep 2022 02:35:11 -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=@linaro.org header.s=google header.b=d2qcsHql; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230181AbiIPJMU (ORCPT + 99 others); Fri, 16 Sep 2022 05:12:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbiIPJMS (ORCPT ); Fri, 16 Sep 2022 05:12:18 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4171C6F251 for ; Fri, 16 Sep 2022 02:12:16 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id r5-20020a1c4405000000b003b494ffc00bso755743wma.0 for ; Fri, 16 Sep 2022 02:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=mlaT4dkUmey+WYaJiYLCVZ+l1HaRfFbeV5h9SKJM/6M=; b=d2qcsHqlhbDrF7hMGXrk69KrkRyLIM0KsG91A88dSqc6m9oNU1AhLqbkfHn8VmenI/ faZhxTdqbshYTPV9bEjex0lIx+MEaqaRYWNMjODryyYJghYdTfe+IM44WgcXKC0+Xk3E tHgLeNzdUd8oDDGNNqs6zSfLOBfoJb9Va6Wu2yltaC76HdSpeKeqiU1PxmT087DesfNO YGti+RSQwXKJ1t8reFU09wD/o3J2G7aQa2WkTWfG3TuRUiV26WyvB/CWS/kpYI5PtDD9 IrF1hnEVclUlYlEZ28m0i2nD++dPzrUOX4OaWIWt1mHoNweIcgpi3xfaMyo+ylLk7oMC Nptw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=mlaT4dkUmey+WYaJiYLCVZ+l1HaRfFbeV5h9SKJM/6M=; b=uTBM3XETqFnOix169lURrQ/CBma2PY0Ad712tr4IS+01mWsH9amY7gQcii/xoBzC58 mnVxD3PGwfEWakZC/RQ5YiAu4N2fUhOq4kjLMO9RWmB2z7Jcy3LESqagbVpj4K/eIdX/ 2vp025N6KWfIOrbT+6QGNtI/GNBt8bNv3CFUIQ9slAYxVAKBQ/hN9V1pSMe0qcm8kI7k WnDAz/vBkBk91o/WH6HkcUNy/iTHfb3DivaTdSNkFibowGzrfUuqbO8WrpIe4F9tRvul nblORj/v6luXfSMqNZpDG+KQsXJ4Y/TzgpPIHQJZQOH3WAmXx+5893tsuQ/aR8KZpF+T IbFg== X-Gm-Message-State: ACrzQf2V9hpps0pC64PREGmowwqC908m/wVC5RX2uoEWUzjjH1PafB1v 6kNDnaSL2r9utZ4wluh7m9TZPzUxEr3JTw== X-Received: by 2002:a05:600c:3d05:b0:3b4:9a42:10d0 with SMTP id bh5-20020a05600c3d0500b003b49a4210d0mr2682614wmb.135.1663319534795; Fri, 16 Sep 2022 02:12:14 -0700 (PDT) Received: from [192.168.86.238] (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.googlemail.com with ESMTPSA id e4-20020a05600c4e4400b003a6a3595edasm1580200wmq.27.2022.09.16.02.12.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Sep 2022 02:12:13 -0700 (PDT) Message-ID: Date: Fri, 16 Sep 2022 10:12:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] soundwire: qcom: update status from device id 1 Content-Language: en-US To: Pierre-Louis Bossart , 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> <3962348a-33b4-5941-4a0b-cb447a513a41@linux.intel.com> From: Srinivas Kandagatla In-Reply-To: <3962348a-33b4-5941-4a0b-cb447a513a41@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org On 15/09/2022 14:10, Pierre-Louis Bossart wrote: > > > 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. Thanks Pierre, > > 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. This issue is more of around enumeration stage in specific during device status change interrupt from controller. Sharing the device 0 status with core makes it think that there is a device with 0:0:0:0 address and it tries to park device to group 13. --srini > >> 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));