Received: by 10.213.65.68 with SMTP id h4csp71039imn; Mon, 12 Mar 2018 07:04:49 -0700 (PDT) X-Google-Smtp-Source: AG47ELtC+mRa4P0xWOPEnLQBP2YzRx+IOa3iHIaEU3TatRwkvcnB6ma6WIDKiWL5DDXILcUaIZdK X-Received: by 10.99.144.199 with SMTP id a190mr6646086pge.359.1520863489889; Mon, 12 Mar 2018 07:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520863489; cv=none; d=google.com; s=arc-20160816; b=T2kbnhpaIlLIDSzN6ajMbU5RH5Tegu41L9IFj6dwRnITytlMgoUqhfdkoYY6js7Vsh MlAIvPIwx1YOWxy96CCpnf8ZO6l8SPBSBNhB2pHpQi/B7dGozqeyugeNQD7pAVGLXKxD W5XPsaAaUR3ZKOluCCYiFSBG1b7KGQbl1nAL827z+r1Ay832QB1CcEVMYPtQeXc7tb9N /htxPNMty1s96iNpJCXYEG2DWy7xJdpAVLVVGZ0/BReXDaQMxVI2Bzzs5HBtE1/eBemq t4ZW0pbnHelQNgOy2qduFxOcXMFELtwL+0moffNAZU+hA+3fz08GYz6hLc8/ANUK0g5r IrVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=eXTGAXwpLLU1Su2Bknle57xvbSD/lmkLLHnZQbXZdgY=; b=ZrESBJp+ybht9yj6GVvibn9eCvSjIQWvxEOU+yH71aTOBVhq2yH/X9v7eLc+R7Orwd 2oC+61PCclDDeHuOLFgRt+sVieN7xRk9xaj6YyuBlvrJZ6txRnVTKMJInZgIvNtYddz3 Zkb4AnyrXORcvZSvOH2sXXPbUmgZw4XtzDB0FIzDNNnqLIhGQPFUl1WYA+rp9/7r5Uf2 NJuSxLLbhnXZRjmmibgVUtrkyRLZsoqyeofmepb7a9qOjvHLaJLICzU9ZqvAkRIpT2vu R9tKQr+ltUJEuTgsU1Hu5nQ++qvZgHaKUxTii5qNlvc0iQxhyVebRf0LDsX4FslMobf+ jFIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u14si5855660pfa.271.2018.03.12.07.04.34; Mon, 12 Mar 2018 07:04:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932448AbeCLODW (ORCPT + 99 others); Mon, 12 Mar 2018 10:03:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:51476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932332AbeCLODS (ORCPT ); Mon, 12 Mar 2018 10:03:18 -0400 Received: from localhost (50-81-63-208.client.mchsi.com [50.81.63.208]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DB8BB204EF; Mon, 12 Mar 2018 14:03:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB8BB204EF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Date: Mon, 12 Mar 2018 09:03:16 -0500 From: Bjorn Helgaas To: Christoph Hellwig Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Keith Busch , Sinan Kaya , Lukas Wunner , Frederick Lawler Subject: Re: [PATCH v2 08/13] PCI/portdrv: Simplify PCIe feature permission checking Message-ID: <20180312140316.GB194000@bhelgaas-glaptop.roam.corp.google.com> References: <152062141493.77693.9630397416694091342.stgit@bhelgaas-glaptop.roam.corp.google.com> <152062203293.77693.8159909590216160503.stgit@bhelgaas-glaptop.roam.corp.google.com> <20180312080402.GE10358@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180312080402.GE10358@infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 12, 2018 at 01:04:02AM -0700, Christoph Hellwig wrote: > > + * We assume we can manage these PCIe features. Some systems may > > + * reserve these for use by the platform itself, e.g., an ACPI BIOS > > + * may implement its own AER handling and use _OSC to prevent the > > + * OS from interfering. > > + */ > > + bridge->use_aer = 1; > > + bridge->use_hotplug = 1; > > + bridge->use_pme = 1; > > If we start out with enabled maybe these should be disable_foo flags > instead? I went back and forth on that. "disable_foo" is nice because the default value is correct (zero means enabled). But then you end up with things like: if (pcie_ports_native || !host->disable_hotplug) where the "!host->disable_hotplug" is a double negative, and I have a really hard time reading that. > Also please use bool (or a bitfield bool) for true/false values. I'm a little ambivalent about bool in structs because of things like this: https://lkml.kernel.org/r/CA+55aFxnePDimkVKVtv3gNmRGcwc8KQ5mHYvUxY8sAQg6yvVYg@mail.gmail.com Bjorn