Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp110626imu; Thu, 8 Nov 2018 15:52:14 -0800 (PST) X-Google-Smtp-Source: AJdET5cHgorw9BY3TdtjQZ1znsKRxsD9sBMEOZQ37kKR3nVmrIXNK7yVX8UpUjNoDw3P1rmKcTnf X-Received: by 2002:a17:902:c5:: with SMTP id a63-v6mr6605704pla.201.1541721134470; Thu, 08 Nov 2018 15:52:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541721134; cv=none; d=google.com; s=arc-20160816; b=WqxktsAIM1urxJHBr6K0MstPORpmuEbHSltpwQd4LvO4d/8vff0dLaNmAhVSWFLWi2 9ZdQJ6r70kuJFmCwZlsQMrbjmN674AN/JhDTo752h8h7saORBHm596RvseJJZSDf143x UmqWzsxnBNH164xRHS/r98Bh+OdZvSfHoeZc/kDXKH0kyyA6lCcw0LB9whnXwIdW1Zqy vEy4/3ygIN6d8mW1FXR/bKQuwB2fiAoIWbS2C+fVSpvrPZTNftKsKjhcWZi5flX6Sn93 8jUFbr4+OvRdqRThZ+wR4BNzrIVzIWFxNkNxiv1iCFgNuxOsVzRCCYl703R6MGQfDC4P M8BA== 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=6um27q76tmcTveu3MmydmqrnZXu9F8InsmOJZZjBB5E=; b=K09Akgc4ECAEM2OthVcMHZXclY0/WRCFjrQqARJbi5jvgpqTQzFtDsqxtMoQimgxIQ oYYzD8w/yL/wFT/SSn/BEDlzxR8dstNnrbXJw+X0PGCo2KIwqp0AS8As3/RAsd1eeXMt 0L+0BQK4fVkTR71vHssVJps+FlZziOwJvTxEBYW4Cc1N5e8y9EOPJuYgWZkRjNoZ3vSw EDy3mwcGD4QbKspR6YGFutQEdG9WUw3TeZOqSJD1lQ+3J738vhAJI5gV2806XczBTJ7h TF6bkCXn0tuIjBZVe87Yn57G2c/5aCdXN5aj3LAOu2nBm6a4rfJnSs6NnZuUrqx2RiSO oT9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jX4Fq3mi; 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 j185-v6si6005053pfc.186.2018.11.08.15.51.58; Thu, 08 Nov 2018 15:52:14 -0800 (PST) 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=jX4Fq3mi; 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 S1727318AbeKIJ3e (ORCPT + 99 others); Fri, 9 Nov 2018 04:29:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:57346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727016AbeKIJ3e (ORCPT ); Fri, 9 Nov 2018 04:29:34 -0500 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 C8EE12081D; Thu, 8 Nov 2018 23:51:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541721097; bh=0MMIe8Fdp3N8poRuOsUcNeLtbIOFsxYbwuvN10aDJ9s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jX4Fq3miU65JoT/BSGDbBCEET4MdOiyZe/O4jRrSC3oMuHBT7wpA0zDI0FUGbN145 /r4QGsoprE8WsppdK0Dp+0iqm14gL6buWUXIzygjMk+EBFWb0F4kQBrw3dL3a7x1Ln O2tmppwTtChBf141zseGW7k2MUzHH6APwPDLSQhk= Date: Thu, 8 Nov 2018 17:51:35 -0600 From: Bjorn Helgaas To: Zubin Mithra Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, hch@infradead.org, groeck@chromium.org, keescook@chromium.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [RFC] x86/pci: Mark pci_root_ops as const Message-ID: <20181108235134.GH41183@google.com> References: <20181108171115.216060-1-zsm@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181108171115.216060-1-zsm@chromium.org> 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 Hi Zubin, On Thu, Nov 08, 2018 at 09:11:15AM -0800, Zubin Mithra wrote: > pci_root_ops is only written to from within intel_mid_pci_init. This > is linked in only when CONFIG_X86_INTEL_MID is set. If not for this, > pci_root_ops could be marked as const. > > Fix this by replacing pci_root_ops usage with pci_root_ops_ptr. If > CONFIG_X86_INTEL_MID is set, pci_root_ops_ptr will be set to > intel_mid_pci_ops inside intel_mid_pci_init. > > Introduce pci_acpi_set_ops for intel_mid_pci_init to set > acpi_pci_root_ops.pci_ops. > > This also means that intel_mid_pci_ops cannot be freed after init, hence > remove __initconst. > > Signed-off-by: Zubin Mithra > --- > arch/x86/include/asm/pci_x86.h | 4 +++- > arch/x86/pci/acpi.c | 5 +++++ > arch/x86/pci/common.c | 5 +++-- > arch/x86/pci/intel_mid_pci.c | 5 +++-- > drivers/pci/access.c | 4 ++-- > drivers/pci/probe.c | 4 ++-- > include/linux/pci-acpi.h | 2 +- > include/linux/pci.h | 11 ++++++----- > 8 files changed, 25 insertions(+), 15 deletions(-) Can you: - Split this into an x86 patch and a PCI core patch (if possible)? - Make the same fixes for other arches? Bjorn