From patchwork Wed Feb 5 02:30:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 3584151 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C8ACA9F2E9 for ; Wed, 5 Feb 2014 02:30:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0655D2018E for ; Wed, 5 Feb 2014 02:30:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C07F0201C7 for ; Wed, 5 Feb 2014 02:30:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751333AbaBECaJ (ORCPT ); Tue, 4 Feb 2014 21:30:09 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:45079 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751234AbaBECaI (ORCPT ); Tue, 4 Feb 2014 21:30:08 -0500 Received: by mail-pa0-f46.google.com with SMTP id rd3so9253011pab.5 for ; Tue, 04 Feb 2014 18:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=V3yn0+wteANtHYx5+O2wwwJxxLo/UaVtMQdF7Eln7E0=; b=q2qQeMk1WOoOHKIrrgj5A7HHs+uZpr6rN+lCndDvDiZLYC72cmYSZewj6D3nrE/qoC C3L5mFavyNFdwWJ8N4eabD43d+21TDQ0UALoGpjaKsa4kIK6Njfiw6Ao4AUgou994NT6 rMJ+RNMdynSMCNz+19ADa4f4+yzBn6EjVFay5jcGK4wvalfMpmrHMkFzHMbofcKgfGqS iLrqaquwR02nmxvSUO7R5Abxrz2Jg+shQGdIY9iZK0NXjY7W9uVjcGrKCI6FphXQ/zkT apiti66PTKU/9wTELiksP/cQc565AqyTvMqxOTnRN9U9HNzMmje2hE8dQ9CaScZFZwu2 1mLQ== X-Received: by 10.68.184.66 with SMTP id es2mr1279003pbc.19.1391567408031; Tue, 04 Feb 2014 18:30:08 -0800 (PST) Received: from [192.168.211.137] ([66.129.239.13]) by mx.google.com with ESMTPSA id da3sm70801678pbc.30.2014.02.04.18.30.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 18:30:06 -0800 (PST) Message-ID: <52F1A22C.3090202@gmail.com> Date: Tue, 04 Feb 2014 18:30:04 -0800 From: Rajat Jain User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Bjorn Helgaas , "Rafael J. Wysocki" , Kenji Kaneshige , Alex Williamson , Yijing Wang , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Yinghai Lu CC: Guenter Roeck , Rajat Jain , Rajat Jain Subject: [PATCH v4 4/8] pciehp: Don't disable the link permanently, during removal Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We need future link up events for hot-add, thus don't disable the link permanently during device removal. Also, remove the static functions that are now left unused. This reverts part of 2debd9289997 ("PCI: pciehp: Disable/enable link during slot power off/on"). This was dicussed at http://marc.info/?l=linux-pci&m=138963477507425&w=2 where it was revealed that it was done for a bug in a pcie repeater chip on that particular platform. Signed-off-by: Rajat Jain Signed-off-by: Rajat Jain Signed-off-by: Guenter Roeck --- drivers/pci/hotplug/pciehp_hpc.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 245a3cb..15ca3a1 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -242,11 +242,6 @@ static void pcie_wait_link_active(struct controller *ctrl) __pcie_wait_link_active(ctrl, true); } -static void pcie_wait_link_not_active(struct controller *ctrl) -{ - __pcie_wait_link_active(ctrl, false); -} - static bool pci_bus_check_dev(struct pci_bus *bus, int devfn) { u32 l; @@ -332,11 +327,6 @@ static int pciehp_link_enable(struct controller *ctrl) return __pciehp_link_set(ctrl, true); } -static int pciehp_link_disable(struct controller *ctrl) -{ - return __pciehp_link_set(ctrl, false); -} - void pciehp_get_attention_status(struct slot *slot, u8 *status) { struct controller *ctrl = slot->ctrl; @@ -508,14 +498,6 @@ void pciehp_power_off_slot(struct slot * slot) { struct controller *ctrl = slot->ctrl; - /* Disable the link at first */ - pciehp_link_disable(ctrl); - /* wait the link is down */ - if (ctrl->link_active_reporting) - pcie_wait_link_not_active(ctrl); - else - msleep(1000); - pcie_write_cmd(ctrl, PCI_EXP_SLTCTL_PWR_OFF, PCI_EXP_SLTCTL_PCC); ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__, pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL,