Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2229633yba; Fri, 19 Apr 2019 15:03:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDOcAiLUmkWta/Dgje/XlcnBzpasoGfNfPFkRgVwJqFU9MFHW1hLiHY6j2QXfMVV533/gJ X-Received: by 2002:aa7:8289:: with SMTP id s9mr6369722pfm.208.1555711406812; Fri, 19 Apr 2019 15:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555711406; cv=none; d=google.com; s=arc-20160816; b=fqe6ndh0ZS6tDNLbxRRSuMaCyg3cBO1bTUyprUR7RN11P1litxfcpJxGYeQhG+C5n5 dwnT7fc+YLAZ0ZvdC3ow1sumrwJC4DT5ia3N13ESMqQlA1ab6puTXyZElSMfE8z6hWuE GNTTpk5Eud03Pdou8SFvjIdL1Ne7FqbHDsBqrJaZ2o5k4zYZL9OW1QbtNoAo6UQ95uTQ 2OkCK/pBsdYqQfWUh8cq2nHJejtg8fPCwGpc+iZYjWuf5NFgy0QfKpt7lgQyZPo4glEq MdRIo8rPN9Erh4qPojxiydRWyzZi2fqz54aC7CPTbDdVZI5cpyEP7j1lSx3oGhxoOqoZ SPoA== 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:dkim-signature; bh=Syo778RyfCMDNBLYU5WerIjW5QB0ORB5GTtBzawryvA=; b=n1JGDOF8eHza3EXv+7kEz2jLKmYdvorBlqcifRZSEXYUAiDwSmSh1FhwGw9W3qv5Vv rs5fiHEJhmOYnC4l4nFkAlWwX+Jjzgv6a+R+OVh5bFMTb0HTjePK344kzsqmiV5E20XD +LusY6VCQbwgPHNl0u4UNGE14F+E/vXexjwUL5Cga0d4pFPVKKwG7ij9SwNpfoM87Uny 5Y6wpxKjXZMRSUS8tjS33B4lvtREEB+uuIbhoYmmbK4NVXL1j79rVtTrko9SroMgBxTa zDWaQcLKH4h5hQlbpUs6NclT8lxvOw9gVFEwV5qXw/JCKQjyBOlTB4IFKrfdUH6c3uZe r8tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZHRVVIkA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si5970309plo.422.2019.04.19.15.03.11; Fri, 19 Apr 2019 15:03:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ZHRVVIkA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727377AbfDSWCX (ORCPT + 99 others); Fri, 19 Apr 2019 18:02:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:38040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726126AbfDSWCX (ORCPT ); Fri, 19 Apr 2019 18:02:23 -0400 Received: from localhost (unknown [69.71.4.100]) (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 2365E217F9; Fri, 19 Apr 2019 22:02:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555711342; bh=PS8LjbJMCIT6Rk/Q4T0ozZ5oTgL2MhQCPvR+ZMlOi5E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZHRVVIkABdhs1cTCwNWWkHiCLHvqx/xUXWpDOJBurkmmqslnPD7aFroMGOm5TrysD iOJNNPOkRYG1xlhlqO3FI6conmai1R6HYV2iN8wA2+T/TJBIH3Gvpm4+ErYgveN+OR qTo6zXhUvSP21hb/gwavuQR72XBLAWkMKPDT2z3M= Date: Fri, 19 Apr 2019 17:02:20 -0500 From: Bjorn Helgaas To: Alexandru Gagniuc Cc: austin_bolen@dell.com, alex_gagniuc@dellteam.com, keith.busch@intel.com, Shyam_Iyer@Dell.com, lukas@wunner.de, okaya@kernel.org, "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 2/3] PCI / ACPI: Remove the need for 'struct hotplug_params' Message-ID: <20190419220220.GI173520@google.com> References: <20190208162414.3996-1-mr.nuke.me@gmail.com> <20190208162414.3996-3-mr.nuke.me@gmail.com> <20190419200745.GH173520@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190419200745.GH173520@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 19, 2019 at 03:07:45PM -0500, Bjorn Helgaas wrote: > On Fri, Feb 08, 2019 at 10:24:12AM -0600, Alexandru Gagniuc wrote: > > We used to first parse all the _HPP and _HPX tables before using the > > information to program registers of PCIe devices. Up until HPX type 2, > > there was only one structure of each type, so we could cheat and store > > it on the stack. > > > > With HPX type 3 we get an arbitrary number of entries, so the above > > model doesn't scale that well. Instead of parsing all tables at once, > > parse and program each entry separately. For _HPP and _HPX 0 thru 2, > > this is functionally equivalent. The change enables the upcoming _HPX3 > > to integrate more easily. > > I think this is tremendous! It's going to simplify this code > dramatically. Two comments below. > > static void pci_configure_device(struct pci_dev *dev) > > { > > - struct hotplug_params hpp; > > - int ret; > > + static const struct hotplug_program_ops hp_ops = { > > + .program_type0 = program_hpp_type0, > > + .program_type1 = program_hpp_type1, > > + .program_type2 = program_hpp_type2, > > + }; > > What if we just moved program_hpp_type0(), etc from probe.c to > pci-acpi.c? The only reason I see to have it in probe.c is for > pci_default_type0, and I think that is a pretty obtuse way of doing > default configuration. I would have no problem at all just hardcoding > those defaults in probe.c and then potentially having them overwritten > by _HPP/_HPX. Actually, never mind about this. This would be a perfect project for mentoring a Linux newbie. I'll merge this series as-is and any restructuring/cleanup can happen later, since it's not related to this series anyway. Bjorn