From patchwork Mon Jul 30 21:29:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 174095 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E33232C008F for ; Tue, 31 Jul 2012 07:30:07 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754537Ab2G3VaF (ORCPT ); Mon, 30 Jul 2012 17:30:05 -0400 Received: from acsinet15.oracle.com ([141.146.126.227]:36224 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754526Ab2G3VaE (ORCPT ); Mon, 30 Jul 2012 17:30:04 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q6ULTvn3005612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 30 Jul 2012 21:29:58 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q6ULTuvk001112 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Jul 2012 21:29:56 GMT Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q6ULTtgo011449; Mon, 30 Jul 2012 16:29:55 -0500 Received: from linux-siqj.site (/10.132.126.191) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 30 Jul 2012 14:29:55 -0700 From: Yinghai Lu To: Bjorn Helgaas Cc: Kenji Kaneshige , linux-pci@vger.kernel.org, Yinghai Lu , stable@vger.kernel.org Subject: [PATCH] PCI, pciehp: turn on link again after power off the slot Date: Mon, 30 Jul 2012 14:29:57 -0700 Message-Id: <1343683797-19017-1-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.7.7 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org During debugging hotplug surpise support, found slot status reg does not report present status anymore after removing the card. That present bit does not get cleared even that card is removed. So no interrupt is generated later after reinsert the card. That problem is caused by commit: | commit 2debd9289997fc5d1c0043b41201a8b40d5e11d0 | | PCI: pciehp: Disable/enable link during slot power off/on Try turn on link after power off. With the fix present bit will report correctly, also still avoid the aer during the power off. Signed-off-by: Yinghai Lu Cc: Kenji Kaneshige Cc: stable@vger.kernel.org --- drivers/pci/hotplug/pciehp_hpc.c | 2 ++ 1 file changed, 2 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/pci/hotplug/pciehp_hpc.c =================================================================== --- linux-2.6.orig/drivers/pci/hotplug/pciehp_hpc.c +++ linux-2.6/drivers/pci/hotplug/pciehp_hpc.c @@ -631,6 +631,8 @@ int pciehp_power_off_slot(struct slot * slot_cmd = POWER_OFF; cmd_mask = PCI_EXP_SLTCTL_PCC; retval = pcie_write_cmd(ctrl, slot_cmd, cmd_mask); + /* need to enable link again for present bit report */ + pciehp_link_enable(ctrl); if (retval) { ctrl_err(ctrl, "Write command failed!\n"); return retval;