Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp696663ybh; Sat, 3 Aug 2019 07:58:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQ0Ha+HVTPdnGdM8gljA/Kxu1mf5gXs6jx2R5u+0quqDwFAzNQFi1O0tHJTUxzGtj9AG0w X-Received: by 2002:a17:902:20ec:: with SMTP id v41mr129019982plg.142.1564844331599; Sat, 03 Aug 2019 07:58:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564844331; cv=none; d=google.com; s=arc-20160816; b=GFt/PRg+fQY7pItEPxuci/TqTahDAaXihKRqsjbfibWXNUoT7fr0CuQTQpUTEweQXF ReHRrrGZBtXjVyQO1xG20Oqdcj6GDB5tmREq8Wr6krMPofAL8+T7pU/LSmlQP+viBZzb CGjgOm2chRe0SnFmUOgTI6Behx+FSL3sQRY7zizOXcdCEZg33YbzviNFbVEARUTgDOwH 2rkOyxaxQ6ap+m6tlHrskPwISzlEQpvhxDkdRXPZAtWj0bfRsrgQsVoS8kBvO9Gl3cnu qp7ByMPAq1dVx5WY1qmacOT5xbc9pivsD1JJkpS/VeBAOvU79hcysiQPFXkU3g17712s AUZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2VI0TokbIywBDMas/ZXUB+VDKZ66LN/zNU/LqQfBLNo=; b=JAGprvqq6UpPnmjOSd0IXs2SShtYjBrQ1J5707RsAhthRJCso3HSWCZeAihb3AETFG qvlCHQicvYf0G+hLWzq04B+Gs9TfM3kRpYOeTwx3/zTNnz/bfb5dOuIjmT4ZsqmGHb7B W0e5KFSFzHmzzPxgvqQQIaP3dLLGInN96NfLQeKnO3kyCumhtR1Fxli/YsjhrT++pfpk VvO1XJCvdppuwfcMMEE3xZp/uR2c4/M9x8mtJF0qEhFRU4u1m7wwKhtR43rmGxx4l8S1 RjU34KlaIBfNhhiuevbD5/296/KYQLje65glcnq/LjnNiM+yWBjzaPdE5svU1r1j+mnS 6/2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PI+K16Wn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si35696873pll.377.2019.08.03.07.58.36; Sat, 03 Aug 2019 07:58:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PI+K16Wn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388785AbfHBQCf (ORCPT + 99 others); Fri, 2 Aug 2019 12:02:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:44018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388743AbfHBQCe (ORCPT ); Fri, 2 Aug 2019 12:02:34 -0400 Received: from localhost (unknown [122.167.106.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6AE70216C8; Fri, 2 Aug 2019 16:02:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564761753; bh=HqRMBzEVJ91zUIcc/7XgWIBNC/V47cjTHlM+0R3V3G0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PI+K16WnDzjYDJFQEXnmXMix0PX19y08kd4ZT7xqWqQzxOGKlt8aKzwzK64V758RH Gjns+UqAJSEnLz8c6Vg0mgFUP4NH9P2EiZvGc28KyevydcpjqtlxFMKtX+fssge1Sf VA23rXbwNn07SqLJBqMiULQ1y2kgdJEBHZ/ljO3M= Date: Fri, 2 Aug 2019 21:31:15 +0530 From: Vinod Koul To: Pierre-Louis Bossart Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Sanyog Kale Subject: Re: [RFC PATCH 15/40] soundwire: cadence_master: handle multiple status reports per Slave Message-ID: <20190802160115.GS12733@vkoul-mobl.Dlink> References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-16-pierre-louis.bossart@linux.intel.com> <20190802122003.GQ12733@vkoul-mobl.Dlink> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02-08-19, 10:29, Pierre-Louis Bossart wrote: > On 8/2/19 7:20 AM, Vinod Koul wrote: > > On 25-07-19, 18:40, Pierre-Louis Bossart wrote: > > > + status[i] = SDW_SLAVE_UNATTACHED; > > > + break; > > > + case 1: > > > + status[i] = SDW_SLAVE_ATTACHED; > > > + break; > > > + case 2: > > > + status[i] = SDW_SLAVE_ALERT; > > > + break; > > > + default: > > > + status[i] = SDW_SLAVE_RESERVED; > > > + break; > > > + } > > > > we have same logic in the code block preceding this, maybe good idea to > > write a helper and use for both > > Yes, I am thinking about this. There are multiple cases where we want to > re-check the status and clear some bits, so helpers would be good. > > > > > Also IIRC we can have multiple status set right? > > Yes, the status bits are sticky and mirror all values reported in PING > frames. I am still working on how to clear those bits, there are cases where > we clear bits and end-up never hearing from that device ever again. classic > edge/level issue I suppose. Then the case logic above doesn't work, it should be like the code block preceding this.. Thanks -- ~Vinod