Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp263967rwi; Mon, 31 Oct 2022 00:31:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5L6KuJjSG92IkEmGnd6jQu59IYgADQ1SBUtBvZinGkYXAuzKNo4x9sZ0TqsWx09I0mAgj5 X-Received: by 2002:aa7:c2ca:0:b0:461:89a6:2281 with SMTP id m10-20020aa7c2ca000000b0046189a62281mr12741117edp.260.1667201465719; Mon, 31 Oct 2022 00:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667201465; cv=none; d=google.com; s=arc-20160816; b=hTqRNYQzrrJgWJFoLMXo/buk2v/EjKXZfAlb00jnH3HKoC88oNAmgoGEabhLy/0QIf uPQaV0PKPnC4T+YYlPpsxZ9Roka6vZoTIaTwh2trxhRjW4X88FWEFJoraZzzfJ7Eko8V 69QEBFFaG39f2M14QprJ7hqwWSlFBpRaccGfeC+fgrJxNmVvWKvhHmBAxS60dvjGDo9L Q2D0cbmaNiDLxQ9AaLxU+E5Oi9ubqNuiCMEK7D8gBSuaR9OivVEyYgFzyR8ygjGKNKjz 67bSTWdeI14AZtklDVWKQBqNkO6/UU4bzKwnpY/bdndv+YmBwCnOODKcn3gaKMmBTKqy BVJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yB7TuPhJxsYJmYHxwnJhbQKU+AWipYLkGa91vvCmT1M=; b=zW0W5PIdbDZm56yJCUJY7QiAeV9nuQVh7TortkYxtLF71GG6Jzcexl6gnRF1DOdRZx KFTIhLfnnBpUVfckrldbHX2wC8rOeog5sQKzMVc2sZZrdOKQCcy+oRT+mGB98yWOKQYg Z9ShGOmGPgJMB/zapkF6shzpArc5qxUW/iV/WVIE+iRe489GfBZJMlD9vITtPjqvFbUc lpNpLKNwI9oUqj5uF4CKh8h9Ze9IaLxL0ilglRZKKBWrhkFkr6qEhIX6vKnc7uxtqLq3 OVdg6HZL9UVBY8LIPvTf5PqSBobzpvxwX4bXXfLS4S4TtSxw8GZFS778sEAsfXMpOLS3 zqPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=3HdaFZPi; 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 hv10-20020a17090760ca00b0078cbe9d08c6si9021866ejc.197.2022.10.31.00.30.41; Mon, 31 Oct 2022 00:31:05 -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=@infradead.org header.s=bombadil.20210309 header.b=3HdaFZPi; 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 S229846AbiJaHEn (ORCPT + 99 others); Mon, 31 Oct 2022 03:04:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiJaHEh (ORCPT ); Mon, 31 Oct 2022 03:04:37 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23259283; Mon, 31 Oct 2022 00:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=yB7TuPhJxsYJmYHxwnJhbQKU+AWipYLkGa91vvCmT1M=; b=3HdaFZPiiOeqwjmboOZCkb9adz QWemucASqnpQyWUzGwCZCG2/kdwLZL9wMgZxALZ4bdsdcUgc1QbWZsR/QIHK+UJ++AcWY7djcBHd6 ciRqvaPI+3KAkgta9MjA62r8f+r9dR/hxv/9lar0K0s24gDp3a4JS4i6rnVFwtOcqctqe35b8xeRF wUdtNu00EeJsbybqCTxXuaBZIt227TUXFOAWL99jm/sl/muTxFIt/nqctTHMVZFLIZdzdAO5SCA2C QpGg3Y6Qz4KV1B60tmr9CgbhYm1uItvYJp00+ty+fRNlJExd5ppfT1CGAfmlpQayNUhmivMdWwXji QxJGyW5w==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1opOqH-008wfI-3a; Mon, 31 Oct 2022 07:04:17 +0000 Date: Mon, 31 Oct 2022 00:04:17 -0700 From: Christoph Hellwig To: Bjorn Helgaas Cc: "David E. Box" , nirmal.patel@linux.intel.com, jonathan.derrick@linux.dev, lorenzo.pieralisi@arm.com, hch@infradead.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com, michael.a.bottini@intel.com, rafael@kernel.org, me@adhityamohan.in, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V7 3/4] PCI: vmd: Add vmd_device_data Message-ID: References: <20221025004411.2910026-4-david.e.box@linux.intel.com> <20221028191308.GA903098@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221028191308.GA903098@bhelgaas> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 Fri, Oct 28, 2022 at 02:13:08PM -0500, Bjorn Helgaas wrote: > It looks like these devices come in families where several device IDs > share the same features. I think this would be more readable if you > defined each family outside this table and simply referenced the > family here. E.g., you could do something like: > > static struct vmd_device_data vmd_v1 = { > .features = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP | > VMD_FEAT_HAS_BUS_RESTRICTIONS | > VMD_FEAT_OFFSET_FIRST_VECTOR, > }; > > {PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_VMD_9A0B), > .driver_data = (kernel_ulong_t) &vmd_v1, > > Then you can add VMD_FEAT_BIOS_PM_QUIRK and the .ltr value in one place > instead of repeating it a half dozen times. I wonder why we need the ltr field at all. For those that set it is always the same value, so it could just be a quirk flag to set it. Tat being said I think thegrouping makes a lot of sense, but I'd just do it with a #define for the set of common quirk flags.