Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5809184rwd; Sun, 18 Jun 2023 20:12:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4aQyEKQjxDJwEpaJOr/VKJ7izFSdFD8D08NMj2yE/uOgVpGaauC/iYAjY3pxHgB+EPAVzG X-Received: by 2002:a05:6870:d2aa:b0:1a6:67e2:6eaf with SMTP id d42-20020a056870d2aa00b001a667e26eafmr7185811oae.19.1687144358020; Sun, 18 Jun 2023 20:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687144357; cv=none; d=google.com; s=arc-20160816; b=vj1niIv1dgwLqhV3una3+uJ8vUl1kMcoAP4NF0Km2m2OWp9lG4OXir4gjHepg8+tS9 d96Tj5fAzyd6Krsl8hSAsLWN0OMUc7bZzPn9O+Uy7G775kaJcPgqoWxO2VUF4qBu/2HP IthXY6QWvCAZ1CLhFJYj15doYOCV8RyfylisEC2g4eAT4S4z/ujCtr/r5mp0tjMJ/R/o IQ0WITs25q9sA36zBXv7C3G4HOlgW1wswhNly4h3JBRNAsEEJMC/PlUTDLaieEevSTpx 4WpOAkBzn+RlNI96ZFn28XguJAXMbL+K8yAqw0VeOmx5PjxKb/6U6sXG5mq4FPzSk6sb itAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=hn3jRVx9R+QJmpBWzd5qRw7dbuNso5m5h37q/HQ2/pc=; b=x8Qj96t7VKupXp/FI6eb9Q7+yPa7A6LRN0buOo2FSV16j1JmSSrLrRMB+B0N5I8vaq jrX7qlbetEUlQGx4F4ComEU6bn7L4NO0jIB5QfITwzp2HAdHTU43V6hlJSvoZEZ5Xl7B aEVoWqbJ2IuY1ndEK09t6cP1nAVF5zhN/l0k+6n0gjORcQRTECwxp8x03G3CZ5hQBZjR xD4fnegJkK/RwXCaXCnLyECitXIN0d/Vk6H7AnLdZcnnkoe3n7rs38+QEjphpQROV5Ui Ebi0vuJY7ZhAarH2FM0A7dc5nP7Sgilm4JW3I/6AEF5ofK1EgcMNK537CTce4434bscd QHrA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u64-20020a638543000000b005509c8e0ac3si8405495pgd.698.2023.06.18.20.12.26; Sun, 18 Jun 2023 20:12:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229640AbjFSDDN (ORCPT + 99 others); Sun, 18 Jun 2023 23:03:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjFSDCu (ORCPT ); Sun, 18 Jun 2023 23:02:50 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C2E9A1BD; Sun, 18 Jun 2023 20:02:49 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id BF25592009C; Mon, 19 Jun 2023 05:02:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id B0C1092009B; Mon, 19 Jun 2023 04:02:48 +0100 (BST) Date: Mon, 19 Jun 2023 04:02:48 +0100 (BST) From: "Maciej W. Rozycki" To: Sui Jingfeng <15330273260@189.cn> cc: Bjorn Helgaas , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-fbdev@vger.kernel.org, Sui Jingfeng Subject: Re: [PATCH v7 2/8] PCI/VGA: Deal only with VGA class devices In-Reply-To: <20230613030151.216625-3-15330273260@189.cn> Message-ID: References: <20230613030151.216625-1-15330273260@189.cn> <20230613030151.216625-3-15330273260@189.cn> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Tue, 13 Jun 2023, Sui Jingfeng wrote: > Deal only with the VGA devcie(pdev->class == 0x0300), so replace the Typo here: s/devcie/device/. > pci_get_subsys() function with pci_get_class(). Filter the non-PCI display > device(pdev->class != 0x0300) out. There no need to process the non-display > PCI device. I've only come across this patch series now. Without diving into what this code actually does I have just one question as a matter of interest. > diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c > index c1bc6c983932..22a505e877dc 100644 > --- a/drivers/pci/vgaarb.c > +++ b/drivers/pci/vgaarb.c > @@ -1500,7 +1496,9 @@ static int pci_notify(struct notifier_block *nb, unsigned long action, > struct pci_dev *pdev = to_pci_dev(dev); > bool notify = false; > > - vgaarb_dbg(dev, "%s\n", __func__); > + /* Only deal with VGA class devices */ > + if (pdev->class != PCI_CLASS_DISPLAY_VGA << 8) > + return 0; Hmm, shouldn't this also handle PCI_CLASS_NOT_DEFINED_VGA? As far as I know it is the equivalent of PCI_CLASS_DISPLAY_VGA for PCI <= 2.0 devices that were implemented before the idea of PCI device classes has developed into its current form. I may have such a VGA device somewhere. Maciej