From mboxrd@z Thu Jan 1 00:00:00 1970 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B951C43334 for ; Mon, 20 Jun 2022 15:04:10 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 94AA81848; Mon, 20 Jun 2022 17:03:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 94AA81848 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655737448; bh=Y1fi247ft0oWSmzxxU/3YXXEXdB3FkAZemiwOXtWzys=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ftfca7ik+EeLU2xY0s0MH60Al1LQkIPmWU6q2vtZ8eb9pDf/5cGKUaCChwsMNa2rA r+0UzokNQ5kC6SfpkejeiHaZrZ40ULiGNe5YhmM36QnAaKt6dCH6wBhi5StTScCN0D x6f9cpB2ZI9Jehe+6vSsyr376mE0NlvPPKX38j0c= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2F8C1F804CF; Mon, 20 Jun 2022 17:03:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F395BF804D2; Mon, 20 Jun 2022 17:03:16 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 01FBFF800CB for ; Mon, 20 Jun 2022 17:03:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 01FBFF800CB Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Lrtm5VxC"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ZD/Q2ewz" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 61F3F21B8B; Mon, 20 Jun 2022 15:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1655737387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Px+U3Ac/+enqRkMwsj3oS3ibt/sflNGYtJovDmVGWfQ=; b=Lrtm5VxCCWDMSW4f/l52WN/Uyw/7yVPqfelIM215p87+hn+4EhIJhbTLSj29E+ku+8kINy TrA375fkQioUOGVJk+UOScZjq9z91j+jFfG1rzyldAB+fPxlDqAXbCzl85lYvqhE7aZqal yj+cfFEtko/ZWtcPpvuIrDs2ckqctAU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1655737387; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Px+U3Ac/+enqRkMwsj3oS3ibt/sflNGYtJovDmVGWfQ=; b=ZD/Q2ewz0kDDlKEaEsy9Y6o6wi2oJVtvuJZLNa41uBCotF1FCu61Qd0VDJcS74tgZYqcdo A4X7G/jdZTTQgwDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 45EB913638; Mon, 20 Jun 2022 15:03:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id zK4nECuMsGI7cAAAMHmgww (envelope-from ); Mon, 20 Jun 2022 15:03:07 +0000 Date: Mon, 20 Jun 2022 17:03:06 +0200 Message-ID: <87r13jpec5.wl-tiwai@suse.de> From: Takashi Iwai To: Kai Vehmanen Subject: Re: Intel HDMI probe regression on IVB (and older?) In-Reply-To: References: <87bkunztec.wl-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, Lucas De Marchi X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, 20 Jun 2022 11:26:52 +0200, Kai Vehmanen wrote: > > Hi, > > On Mon, 20 Jun 2022, Takashi Iwai wrote: > > > we've got a regression report about Intel HDMI. It seems that the > > recent change to skip the component binding (commit c9db8a30d9f0) > > throws away the devices incorrectly on IvyBridge. I guess the similar > > issue could happen on older chips. The bug report is found at > > https://bugzilla.opensuse.org/show_bug.cgi?id=1200611 > > we'll check. We actually have IVB (and older), in the i915 CI and I can > see the binding check working correctly there (with 5.19-rc2). But > obviously something goes wrong in the reporter's case, so needs more > debug. So this looks like a bug due to the use of pci_get_class(). Since there is no pci_get_base_class(), we likely need to open-code the search, e.g. something like below. Takashi -- 8< -- From: Takashi Iwai Subject: [PATCH] ALSA: hda: Fix discovery of i915 graphics PCI device It's been reported that the recent fix for skipping the component-binding with D-GPU caused a regression on some systems; it resulted in the completely missing component binding with i915 GPU. The problem was the use of pci_get_class() function. It matches with the full PCI class bits, while we want to match only partially the PCI base class bits. So, when a system has an i915 graphics device with the PCI class 0380, it won't hit because we're looking for only the PCI class 0300. This patch fixes i915_gfx_present() to look up each PCI device and match with PCI base class explicitly instead of pci_get_class(). Fixes: c9db8a30d9f0 ("ALSA: hda/i915 - skip acomp init if no matching display") Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1200611 Cc: Signed-off-by: Takashi Iwai --- sound/hda/hdac_i915.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c index 3f35972e1cf7..161a9711cd63 100644 --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c @@ -119,21 +119,18 @@ static int i915_component_master_match(struct device *dev, int subcomponent, /* check whether Intel graphics is present and reachable */ static int i915_gfx_present(struct pci_dev *hdac_pci) { - unsigned int class = PCI_BASE_CLASS_DISPLAY << 16; struct pci_dev *display_dev = NULL; - bool match = false; - do { - display_dev = pci_get_class(class, display_dev); - - if (display_dev && display_dev->vendor == PCI_VENDOR_ID_INTEL && + for_each_pci_dev(display_dev) { + if (display_dev->vendor == PCI_VENDOR_ID_INTEL && + (display_dev->class >> 16) == PCI_BASE_CLASS_DISPLAY && connectivity_check(display_dev, hdac_pci)) { pci_dev_put(display_dev); - match = true; + return true; } - } while (!match && display_dev); + } - return match; + return false; } /** -- 2.35.3