From patchwork Wed Oct 28 06:15:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 56225 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9S6FOZo003407 for ; Wed, 28 Oct 2009 06:15:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757401AbZJ1GPR (ORCPT ); Wed, 28 Oct 2009 02:15:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757400AbZJ1GPR (ORCPT ); Wed, 28 Oct 2009 02:15:17 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:57966 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757229AbZJ1GPQ (ORCPT ); Wed, 28 Oct 2009 02:15:16 -0400 Received: from m6.gw.fujitsu.co.jp ([10.0.50.76]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id n9S6FJAh001163 (envelope-from kaneshige.kenji@jp.fujitsu.com); Wed, 28 Oct 2009 15:15:19 +0900 Received: from smail (m6 [127.0.0.1]) by outgoing.m6.gw.fujitsu.co.jp (Postfix) with ESMTP id 2945245DE4E; Wed, 28 Oct 2009 15:15:19 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (s6.gw.fujitsu.co.jp [10.0.50.96]) by m6.gw.fujitsu.co.jp (Postfix) with ESMTP id F336145DE50; Wed, 28 Oct 2009 15:15:18 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id D0950E08001; Wed, 28 Oct 2009 15:15:18 +0900 (JST) Received: from m108.s.css.fujitsu.com (m108.s.css.fujitsu.com [10.249.87.108]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id 6A9551DB803E; Wed, 28 Oct 2009 15:15:18 +0900 (JST) Received: from m108.css.fujitsu.com (m108 [127.0.0.1]) by m108.s.css.fujitsu.com (Postfix) with ESMTP id 3E908B68007; Wed, 28 Oct 2009 15:15:18 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.100.137]) by m108.s.css.fujitsu.com (Postfix) with ESMTP id C90DD428052; Wed, 28 Oct 2009 15:15:17 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from KANE-LIFEBOOK[10.124.100.137] by KANE-LIFEBOOK (FujitsuOutboundMailChecker v1.3.1/9992[10.124.100.137]); Wed, 28 Oct 2009 15:15:08 +0900 (JST) Message-ID: <4AE7E164.80408@jp.fujitsu.com> Date: Wed, 28 Oct 2009 15:15:00 +0900 From: Kenji Kaneshige User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Jens Axboe CC: Alex Chiang , Mark Lord , Greg KH , Linux Kernel , jbarnes@virtuousgeek.org, linux-pci@vger.kernel.org Subject: Re: pci-express hotplug References: <20091012145700.GJ9228@kernel.dk> <4AD34494.7020602@rtr.ca> <20091012150603.GK9228@kernel.dk> <20091012214854.GA14102@ldl.fc.hp.com> <20091013082903.GQ9228@kernel.dk> <20091013172731.GB22797@ldl.fc.hp.com> <20091014081309.GM9228@kernel.dk> <20091020190707.GA25615@ldl.fc.hp.com> <20091026105419.GA10727@kernel.dk> <4AE693D9.3070100@jp.fujitsu.com> <20091027082720.GT10727@kernel.dk> In-Reply-To: <20091027082720.GT10727@kernel.dk> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Index: 20091026/drivers/pci/hotplug/pciehp_hpc.c =================================================================== --- 20091026.orig/drivers/pci/hotplug/pciehp_hpc.c +++ 20091026/drivers/pci/hotplug/pciehp_hpc.c @@ -612,6 +612,7 @@ static irqreturn_t pcie_isr(int irq, voi struct controller *ctrl = (struct controller *)dev_id; struct slot *slot = ctrl->slot; u16 detected, intr_loc; + static int nr_power_faults = 0; /* * In order to guarantee that all interrupt events are @@ -664,6 +665,13 @@ static irqreturn_t pcie_isr(int irq, voi if (intr_loc & PCI_EXP_SLTSTA_PDC) pciehp_handle_presence_change(slot); + if ((intr_loc & PCI_EXP_SLTSTA_PFD) && (++nr_power_faults > 100)) { + u16 reg16; + pciehp_readw(ctrl, PCI_EXP_SLTCTL, ®16); + reg16 &= ~PCI_EXP_SLTCTL_PFDE; + pciehp_writew(ctrl, PCI_EXP_SLTCTL, reg16); + } + /* Check Power Fault Detected */ if ((intr_loc & PCI_EXP_SLTSTA_PFD) && !ctrl->power_fault_detected) { ctrl->power_fault_detected = 1;