From patchwork Wed Nov 21 18:25:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 1781921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id BCAE53FCA5 for ; Wed, 21 Nov 2012 18:27:58 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TbEzN-0002Qg-TK; Wed, 21 Nov 2012 18:25:34 +0000 Received: from quartz.orcorp.ca ([184.70.90.242]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TbEzJ-0002Pe-Mv for linux-arm-kernel@lists.infradead.org; Wed, 21 Nov 2012 18:25:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=obsidianresearch.com; s=rsa1; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=4dcbSJQeKnwhpbpiRqefZhV2mePXDVChQXeJ+N42khk=; b=qsfkR5pxmPi3tYegAjqrPJl5wzTZbEQsBn8a+UwMQNFml6STAnGl1xHDbFFyTQkVR1af3LVHsOGiHoPV1BqLOWxv4djMPNZpKdm+UGLZ11kzgdh22bIhPWr2Ojids/nPDZm5+Sei+++FGPKx6X7J39RztVPGqq9tv81Dix27/Gk=; Received: from [10.0.0.162] (helo=jggl.edm.orcorp.ca) by quartz.orcorp.ca with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1TbEzI-00033v-AC; Wed, 21 Nov 2012 11:25:28 -0700 Received: from jgg by jggl.edm.orcorp.ca with local (Exim 4.76) (envelope-from ) id 1TbEzI-0003Ja-3k; Wed, 21 Nov 2012 11:25:28 -0700 Date: Wed, 21 Nov 2012 11:25:28 -0700 From: Jason Gunthorpe To: linux-arm-kernel@lists.infradead.org, Jason Cooper , Andrew Lunn Subject: [PATCH] ARM: Kirkwood: Support basic hotplug for PCI-E Message-ID: <20121121182528.GA12715@obsidianresearch.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.162 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121121_132530_611489_DECF4588 X-CRM114-Status: GOOD ( 12.97 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Unconditionally register the PCI-E bus, even if the link is currently down. When the link is brought up the bus can be scanned through /sys/bus/pci/rescan or otherwise. Since the HW has no interrupt for link up, userspace will have to take care of the timing. An earlier version of this was contingent on CONFIG_HOTPLUG, but that is being removed from the kernel. This also fixes printing the link up/down message to be displayed on one line (structured logging broke this?) Signed-off-by: Jason Gunthorpe --- arch/arm/mach-kirkwood/pcie.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) All PCI-E ports are required to support hot plug at the link training level. Our systems support it electrically, and userspace sequences everything to work properly. But the PCI-E root port needs to be registered with the kernel to initiate a rescan via sysfs when things are ready. diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index 59c97fe..80fd4f2 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c @@ -244,13 +244,9 @@ static struct hw_pci kirkwood_pci __initdata = { static void __init add_pcie_port(int index, void __iomem *base) { - printk(KERN_INFO "Kirkwood PCIe port %d: ", index); - - if (orion_pcie_link_up(base)) { - printk(KERN_INFO "link up\n"); - pcie_port_map[num_pcie_ports++] = index; - } else - printk(KERN_INFO "link down, ignoring\n"); + pcie_port_map[num_pcie_ports++] = index; + pr_info("Kirkwood PCIe port %d: link %s\n", index, + orion_pcie_link_up(base) ? "up" : "down"); } void __init kirkwood_pcie_init(unsigned int portmask)