From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754368AbdKAJFS (ORCPT ); Wed, 1 Nov 2017 05:05:18 -0400 Received: from mga03.intel.com ([134.134.136.65]:31189 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751390AbdKAJFQ (ORCPT ); Wed, 1 Nov 2017 05:05:16 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,327,1505804400"; d="scan'208";a="916162250" Date: Wed, 1 Nov 2017 14:38:20 +0530 From: Vinod Koul To: Pierre-Louis Bossart Cc: Takashi Iwai , Greg Kroah-Hartman , ALSA , Charles Keepax , Sudheer Papothi , plai@codeaurora.org, LKML , patches.audio@intel.com, Mark , srinivas.kandagatla@linaro.org, Shreyas NC , Sanyog Kale , Sagar Dharia , alan@linux.intel.com Subject: Re: [alsa-devel] [PATCH 08/14] soundwire: Add Slave status handling helpers Message-ID: <20171101090820.GA3187@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <98f1b39a-b48d-2603-8e9d-88b4f804e2c8@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 02:49:15AM +0530, Pierre-Louis Bossart wrote: > > > > >>>+ if (found == false) { > >>>+ /* TODO: Park this device in Group 13 */ > >>>+ dev_err(bus->dev, "Slave Entry not found"); > >> > >>No break here? Otherwise... > > > >Thats intentional. We want to still read next device that show up > > > >> > >>>+ } > >>>+ > >>>+ } while (ret == 0); > >> > >>... the outer loop may go endlessly. > >>This condition doesn't look effective. > > > >not really. We cant keep reading successfully. At some point all slaves will > >ignore and return ENODATA and we exit. Bus errors will also make it exit > > > >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. -- ~Vinod From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vinod Koul Subject: Re: [PATCH 08/14] soundwire: Add Slave status handling helpers Date: Wed, 1 Nov 2017 14:38:20 +0530 Message-ID: <20171101090820.GA3187@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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 6F53E266AE1 for ; Wed, 1 Nov 2017 10:05:16 +0100 (CET) Content-Disposition: inline In-Reply-To: <98f1b39a-b48d-2603-8e9d-88b4f804e2c8@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org 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 List-Id: alsa-devel@alsa-project.org On Wed, Nov 01, 2017 at 02:49:15AM +0530, Pierre-Louis Bossart wrote: > > > > >>>+ if (found == false) { > >>>+ /* TODO: Park this device in Group 13 */ > >>>+ dev_err(bus->dev, "Slave Entry not found"); > >> > >>No break here? Otherwise... > > > >Thats intentional. We want to still read next device that show up > > > >> > >>>+ } > >>>+ > >>>+ } while (ret == 0); > >> > >>... the outer loop may go endlessly. > >>This condition doesn't look effective. > > > >not really. We cant keep reading successfully. At some point all slaves will > >ignore and return ENODATA and we exit. Bus errors will also make it exit > > > >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. -- ~Vinod