From patchwork Tue Sep 27 20:23:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 9352747 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3716F6077A for ; Tue, 27 Sep 2016 20:12:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 299DB29034 for ; Tue, 27 Sep 2016 20:12:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DDB82905F; Tue, 27 Sep 2016 20:12:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38DE0290C1 for ; Tue, 27 Sep 2016 20:12:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934391AbcI0UMp (ORCPT ); Tue, 27 Sep 2016 16:12:45 -0400 Received: from mga09.intel.com ([134.134.136.24]:58177 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932747AbcI0UMo (ORCPT ); Tue, 27 Sep 2016 16:12:44 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 27 Sep 2016 13:12:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,406,1470726000"; d="scan'208";a="884426498" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.65]) by orsmga003.jf.intel.com with ESMTP; 27 Sep 2016 13:12:43 -0700 From: Keith Busch To: linux-pci@vger.kernel.org, Bjorn Helgaas Cc: Ralf Baechle , Lukas Wunner , Wei Zhang , Keith Busch , Atsushi Nemoto Subject: [PATCHv3 1/5] mips/pci: Reduce stack frame usage Date: Tue, 27 Sep 2016 16:23:31 -0400 Message-Id: <1475007815-28354-2-git-send-email-keith.busch@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1475007815-28354-1-git-send-email-keith.busch@intel.com> References: <1475007815-28354-1-git-send-email-keith.busch@intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The struct pci_dev is too large to allocate on the stack. This patch removes the fake pci device in early config access and instead uses the pci bus to get the same functionality. Signed-off-by: Keith Busch Cc: Atsushi Nemoto Cc: Ralf Baechle Reviewed-by: Atsushi Nemoto --- Got the 'ok' (link below), but I don't see this is merged yet. That's okay, since I need to include it in this series to avoid 0'day build failure. If this is ok with everyone, perhaps this can go through 'pci'. https://www.linux-mips.org/archives/linux-mips/2016-09/msg00255.html arch/mips/txx9/generic/pci.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c index 1f6bc9a..285d84e 100644 --- a/arch/mips/txx9/generic/pci.c +++ b/arch/mips/txx9/generic/pci.c @@ -29,12 +29,8 @@ static int __init early_read_config_word(struct pci_controller *hose, int top_bus, int bus, int devfn, int offset, u16 *value) { - struct pci_dev fake_dev; struct pci_bus fake_bus; - fake_dev.bus = &fake_bus; - fake_dev.sysdata = hose; - fake_dev.devfn = devfn; fake_bus.number = bus; fake_bus.sysdata = hose; fake_bus.ops = hose->pci_ops; @@ -45,7 +41,7 @@ early_read_config_word(struct pci_controller *hose, else fake_bus.parent = NULL; - return pci_read_config_word(&fake_dev, offset, value); + return pci_bus_read_config_word(&fake_bus, devfn, offset, value); } int __init txx9_pci66_check(struct pci_controller *hose, int top_bus,