From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964792AbdKBDZx (ORCPT ); Wed, 1 Nov 2017 23:25:53 -0400 Received: from mga07.intel.com ([134.134.136.100]:55789 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751760AbdKBDZw (ORCPT ); Wed, 1 Nov 2017 23:25:52 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,331,1505804400"; d="scan'208";a="168178857" Date: Thu, 2 Nov 2017 08:58:55 +0530 From: Vinod Koul To: Pierre-Louis Bossart Cc: ALSA , Charles Keepax , Takashi Iwai , Greg Kroah-Hartman , plai@codeaurora.org, LKML , Sagar Dharia , patches.audio@intel.com, Mark , srinivas.kandagatla@linaro.org, Shreyas NC , Sanyog Kale , Sudheer Papothi , alan@linux.intel.com Subject: Re: [alsa-devel] [PATCH 08/14] soundwire: Add Slave status handling helpers Message-ID: <20171102032855.GB3187@localhost> References: <1508382211-3154-1-git-send-email-vinod.koul@intel.com> <1508382211-3154-9-git-send-email-vinod.koul@intel.com> <20171031130412.GW3187@localhost> <98f1b39a-b48d-2603-8e9d-88b4f804e2c8@linux.intel.com> <20171101090820.GA3187@localhost> <11066ca7-f71c-5867-67f5-3c597b26bf61@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11066ca7-f71c-5867-67f5-3c597b26bf61@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 01, 2017 at 04:10:08PM -0500, Pierre-Louis Bossart wrote: > On 11/1/17 4:08 AM, Vinod Koul wrote: > >On Wed, Nov 01, 2017 at 02:49:15AM +0530, Pierre-Louis Bossart wrote: > >>> > >>>BUT given that we have seen stuff i am inclined to add a counter, we cant > >>>have more than 11 device so that's a sane value to use :) > >> > >>Yep. Keep in mind however that there could be theoretical corner cases: if a > >>device is enumerated, loses sync and becomes attached again while you deal > >>with others, you'd have more than 11 iterations. > > > >Not really as that would be another interrupt and another status report. > > You are in a loop where you keep reading the devId registers, and that > really has nothing to do with interrupts or status report. The point was > that the number of times you read may be higher that the number of devices > with a device being handled several times. > As mentioned above you need to limit this loop to a sane value. Oh yes, I was thinking from status point of view which triggers this but yes we keep reading so your point is valid. Lets add 2x buffer for that. -- ~Vinod