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 B4EDDC433EF for ; Mon, 20 Jun 2022 15:50:47 +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 D18982905; Mon, 20 Jun 2022 17:49:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D18982905 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655740245; bh=fhV6IEPrAKwH3ezExgMD3h2VJzk5i5WMcVwj2e6QXk8=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VqQ5AwjD4QFMpAuqY+/BokEpzMNb0rQcM+HW+OEwaLtTq5oJ1pa4rJklSSsS5uMWB 1VqslRQ0VvVnVcvmKxf8DL6cPl9dgLWdckZxzOk4FUFzmMOE/6b/wcNrjLQBhKspYI mJ2j8nAYXb4QRikCt180/xaNpuv0WVn1YDRQQZSM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 77905F800FB; Mon, 20 Jun 2022 17:49:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7CF6BF800E3; Mon, 20 Jun 2022 17:49:54 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (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 750E2F800E3 for ; Mon, 20 Jun 2022 17:49:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 750E2F800E3 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="n+CaAAbh"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ZjgIfk2r" 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-out2.suse.de (Postfix) with ESMTPS id 968291F461; Mon, 20 Jun 2022 15:49:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1655740185; 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=F2IKDtDYFxyTVrKjEcWA08vh/uP/FX5Ybn3HwusOgzk=; b=n+CaAAbhYqvl3H4kDkHShIfQnd4Bwta0ADFKoVBA+u0wsKP4G0uBXoR7RNox1Paue2GWQE rc/cJSOlL3cYazL20ozTl68YtbP3bc27HYjlamDK2d9IYhcZ1pOAfF4tjStbzr6+vCJjTI SsAhmbdkKm+6cSeOvYvLipS/T+HuLKY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1655740185; 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=F2IKDtDYFxyTVrKjEcWA08vh/uP/FX5Ybn3HwusOgzk=; b=ZjgIfk2rLZV/mYbINAqv3y1gqO7DCymxSvIfSUNb74Zn/+tNKMfcNdlbVkpeXi6350NS5v C2VQb7ZD5ikjOnCA== 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 783AE134CA; Mon, 20 Jun 2022 15:49:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id nun/GxmXsGKBBwAAMHmgww (envelope-from ); Mon, 20 Jun 2022 15:49:45 +0000 Date: Mon, 20 Jun 2022 17:49:44 +0200 Message-ID: <87h74fpc6f.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> <87r13jpec5.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 17:31:09 +0200, Kai Vehmanen wrote: > > Hi, > > On Mon, 20 Jun 2022, Takashi Iwai wrote: > > > 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. > > yes, this indeed seems to be the case. > > > 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, > [...] > > - 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); > > + } > > To open code a bit less, I was first thinking: > > --cut-- > --- a/sound/hda/hdac_i915.c > +++ b/sound/hda/hdac_i915.c > @@ -124,9 +124,9 @@ static int i915_gfx_present(struct pci_dev *hdac_pci) > bool match = false; > > do { > - display_dev = pci_get_class(class, display_dev); > + display_dev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, display_dev); > > - if (display_dev && display_dev->vendor == PCI_VENDOR_ID_INTEL && > + if (display_dev && (display_dev->class >> 16) == PCI_BASE_CLASS_DISPLAY && > connectivity_check(display_dev, hdac_pci)) { > --cut-- > > But it's a marginal difference, so for your version: > > Reviewed-by: Kai Vehmanen OK, could you throw the patch to CI for verification? I can merge it for the next pull request (probably in this week) once after confirmation. thanks, Takashi