Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9255477rwd; Wed, 21 Jun 2023 05:16:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6BawBofIK0cgBLCLrJTSHu1DhJaKYYT2BVHGriOhBK2aF9ungabuERwLkV2w1oa7DGNKFa X-Received: by 2002:a05:6a00:3393:b0:666:eaac:993c with SMTP id cm19-20020a056a00339300b00666eaac993cmr16133099pfb.1.1687349774937; Wed, 21 Jun 2023 05:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687349774; cv=none; d=google.com; s=arc-20160816; b=kyGOWBc7HZ6jQuGply3VKD+gCGGd/TsVZ1uQ9XqyRk1B/uaeFT2Q6DxYXmi5V9US2G X8KiLsVbxu2urf5aa43X+tHW6MKoZiklbt7kOiKYcRCO3GVRFjMWn5YC0f6gsctRHi0d ytF46IbufUsOnTiOD7nuxNuC82ZPQW44F6qUzmwEbhaeQkKyX5GVHyiT9xhhms4tmnrn eqHWLW6HqHV7Hqo1e5uxtx1Pn/p+eFvRbw6/2XRTKx1ajg3Jm3ptjTo52IifukOufCOG wvHK1bB/lSH+VZIy45RladjnQHlkSi3VpY+pX7NQiTPpaEhz5w9jnjeDqee4AcQJahyp 1UoQ== 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=UBh/rbH6XHv7OjncrPeBKQho5f1stze3ewL8M0HIfvE=; b=vlfUFzU4U8cO+589X09mNpRdllaD2NDX9ekiR9XGBAHXeETmt+0NWKc3Rn5Ihq4tc1 Gzv0dtC2D2nQy4htgH7KtN82zUAuCklqv5zKaOKtq5M64i9SEOVyErXyyUKSXY6h3ive Zs8pBax8O+eR+T78ULSvrAIbhEGU248B2XwUE5I7AjLPAoguJFUk5lBb3LtDxKmGZTGt ucJuwtwWi3S4lsy57dcBqEHjNm03kjEc/+FpTtUI3j1JlTEdgtIUycUKPUbtyCe0J8nX U+DbnwUOK3k2SuiOmtzdConeFrbrRXUyGl7az5kV/7SRbbBTB5/klwLcEX8vSt7wf/tp prKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aTRVgq9n; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020a63db44000000b0055381e05244si406824pgi.777.2023.06.21.05.16.02; Wed, 21 Jun 2023 05:16:14 -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=@intel.com header.s=Intel header.b=aTRVgq9n; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231129AbjFUL4J (ORCPT + 99 others); Wed, 21 Jun 2023 07:56:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbjFUL4H (ORCPT ); Wed, 21 Jun 2023 07:56:07 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FAF51704 for ; Wed, 21 Jun 2023 04:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687348566; x=1718884566; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=7QBHZaWGpgML3bccn9yBAWgsyF73qca2uv8Bv8Cwr00=; b=aTRVgq9nBm8uX0TQuRRIO6A1Gs9XlY0+NEVhKOMsC6o8PFwy8WXJ0sf/ BagwD85eTQVwAGgq4ZB26HZOdbJrKAmCHpZE+bp4CWw+NZmuUdb6oiHbC o/KyQXl0exwYl1pVqYv6wXBYCS1WMzEOK3ZXjr1JXJcI2okLoGddHk9QO pBAJ2M9bUjBcu5bvDVNFPuwW1YVekw4HZA2/APJabcTSpAczyjNG/GOe5 J4S+3j7RvSy/Ol3GbnMCKlBh9qusvNPdkS0nkdad2MKmP+yGLMMcEvU9y h7vbEQ3qeCQ5xty7IsromufOdZBR0w621tfB27VR4Q8xX5IyMHPMxkDMO g==; X-IronPort-AV: E=McAfee;i="6600,9927,10747"; a="349880691" X-IronPort-AV: E=Sophos;i="6.00,260,1681196400"; d="scan'208";a="349880691" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2023 04:56:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10747"; a="714451259" X-IronPort-AV: E=Sophos;i="6.00,260,1681196400"; d="scan'208";a="714451259" Received: from taoki-mobl1.gar.corp.intel.com (HELO [10.254.114.157]) ([10.254.114.157]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2023 04:56:04 -0700 Message-ID: Date: Wed, 21 Jun 2023 13:28:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.11.0 Subject: Re: [PATCH 2/4] soundwire: introduce SDW_DEV_NUM_ALLOC_IDA_WAKE_ONLY Content-Language: en-US To: Vinod Koul Cc: Bard Liao , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, bard.liao@intel.com References: <20230531033736.792464-1-yung-chuan.liao@linux.intel.com> <20230531033736.792464-3-yung-chuan.liao@linux.intel.com> <6c75e986-29a4-d97c-3862-d20397f8b8b4@linux.intel.com> From: Pierre-Louis Bossart In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 >>> This seems to be a consequence of Intel hardware decisions, so I guess >>> best suited place for this is Intel controller, do we really want to >>> have this in core logic? >> >> It's a valid objection. >> >> The reason why I added the alternate strategies in the core logic is >> that the IDA and hybrid approach are just software-based with no >> specific hardware dependencies. If QCOM or AMD wanted to use the >> strategies contributed and tested by Intel, it'd be a two-line change on >> their side. >> >> That said, it's likely that at some point *someone* will want to >> constrain the device number allocation further, be it with ACPI/DT >> properties or reading hardware registers. The device number is a >> de-facto priority given the way we scan the PING frames, so some systems >> may want to give a higher priority to a specific peripherals. >> >> This would push us to add a master ops callback to control the device >> number allocation. It's a bit invasive but that would give the ultimate >> flexibility. Reuse between vendors could be possible if 'generic' >> callbacks were part of a library to pick from. >> >> I don't really have any objections if this vendor-specific callback was >> preferred, it may be a bit early to add this but long-term it's probably >> what makes more sense. >> >> I'll go with the flow on suggested recommendations. > > Thanks, if it all one of the other two controller start using this, it > would make sense to move it to core then, for now would be better to > have this in specific driver The code is much cleaner indeed that way. I still have to work on a race condition if the codec driver probe happens *after* the enumeration. In that case, the properties needed to decide which allocation to use are not initialized yet. We may need to either force the codec to re-enumerate with a ForceReset, or to switch the device number. In theory the latter is straightforward but there can be additional races if there are interrupts thrown just before the device number change happens.