From patchwork Wed Aug 2 15:01:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 13338331 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A82ECC001DF for ; Wed, 2 Aug 2023 15:12:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234219AbjHBPMv (ORCPT ); Wed, 2 Aug 2023 11:12:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234034AbjHBPMm (ORCPT ); Wed, 2 Aug 2023 11:12:42 -0400 Received: from mgamail.intel.com (unknown [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 297122690 for ; Wed, 2 Aug 2023 08:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690989161; x=1722525161; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=znXh8jhk50KTy9cQHFdBDmGE/L6ZUCXCnIswbewkii8=; b=XmGqMrjP+vkgmsnacGQa1/lxWaq9Xkjt21z9cJ963JY5TGjfcCbSsOJi eAputgOxZ1tCSqXZWEb6ulfBou+sT/n6uSn6jiRVgdJvimf+je0irYScx 2FCKxEglmAFMlQsB6nZyF91ntLHg98E+ZQHA+1uHpU/jhM967wbRNgioJ VgzoiP1aNg7P0FZNq7CIRWAm/Ump1HD3sS49y6DcFKof6vn0SAZApRVPE lif279xJWRBzobUfgUVv9170Usz+knzHppr6tuI/xC4kgVWZq9UdEhnrX wkCbfQx2SuZlil25opMtGCt6VQpZPiaIlHaFLz8RoNkzN2j5wE+YiNbjZ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="369607282" X-IronPort-AV: E=Sophos;i="6.01,249,1684825200"; d="scan'208";a="369607282" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 08:01:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="732428698" X-IronPort-AV: E=Sophos;i="6.01,249,1684825200"; d="scan'208";a="732428698" Received: from rickylop-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.125.114]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 08:01:16 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org, Kai Vehmanen , Bard Liao , "T, Arun" , Pierre-Louis Bossart Subject: [PATCH 5/5] ALSA: hda/i915: extend connectivity check to cover Intel ARL Date: Wed, 2 Aug 2023 10:01:05 -0500 Message-Id: <20230802150105.24604-6-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230802150105.24604-1-pierre-louis.bossart@linux.intel.com> References: <20230802150105.24604-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Kai Vehmanen Expand the HDA/I915 connectivity check to correctly handle the PCI topology used in some Intel Arrow Lake products. Reviewed-by: Bard Liao Tested-by: "T, Arun" Signed-off-by: Kai Vehmanen Signed-off-by: Pierre-Louis Bossart --- sound/hda/hdac_i915.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c index 2a451ff4fe6a..b428537f284c 100644 --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c @@ -75,16 +75,22 @@ static bool connectivity_check(struct pci_dev *i915, struct pci_dev *hdac) if (bus_a == bus_b) return true; + bus_a = bus_a->parent; + bus_b = bus_b->parent; + + /* connected via parent bus (may be NULL!) */ + if (bus_a == bus_b) + return true; + + if (!bus_a || !bus_b) + return false; + /* * on i915 discrete GPUs with embedded HDA audio, the two * devices are connected via 2nd level PCI bridge */ bus_a = bus_a->parent; bus_b = bus_b->parent; - if (!bus_a || !bus_b) - return false; - bus_a = bus_a->parent; - bus_b = bus_b->parent; if (bus_a && bus_a == bus_b) return true;