From patchwork Thu Apr 30 06:48:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yanmin Zhang X-Patchwork-Id: 20960 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 n3U6m7Sr021041 for ; Thu, 30 Apr 2009 06:48:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751781AbZD3GsG (ORCPT ); Thu, 30 Apr 2009 02:48:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752912AbZD3GsF (ORCPT ); Thu, 30 Apr 2009 02:48:05 -0400 Received: from mga12.intel.com ([143.182.124.36]:30384 "EHLO azsmga102.ch.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751971AbZD3GsE (ORCPT ); Thu, 30 Apr 2009 02:48:04 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 29 Apr 2009 23:48:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.40,270,1239001200"; d="scan'208";a="137609237" Received: from ymzhang.sh.intel.com (HELO [10.239.36.211]) ([10.239.36.211]) by azsmga001.ch.intel.com with ESMTP; 29 Apr 2009 23:48:03 -0700 Subject: [PATCH] Fix pci-e port driver slot_reset bad default return value From: "Zhang, Yanmin" To: Jesse Barnes Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Date: Thu, 30 Apr 2009 14:48:29 +0800 Message-Id: <1241074109.2567.901.camel@ymzhang> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org When an upstream port reports an AER error to root port, kernel starts error recovery procedures. The default return value of function pcie_portdrv_slot_reset is PCI_ERS_RESULT_NONE. If all port service drivers of the downstream port under the upstream port have no slot_reset method in pci_error_handlers, aer recovery would stop without resume. Below patch against 2.6.30-rc3 fixes it. Signed-off-by: Zhang Yanmin --- -- 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 diff -Nraup linux-2.6.30-rc3/drivers/pci/pcie/aer/aerdrv.h linux-2.6.30-rc3_aerport/drivers/pci/pcie/aer/aerdrv.h --- linux-2.6.30-rc3/drivers/pci/pcie/aer/aerdrv.h 2009-04-29 15:51:28.000000000 +0800 +++ linux-2.6.30-rc3_aerport/drivers/pci/pcie/aer/aerdrv.h 2009-04-30 14:06:58.000000000 +0800 @@ -95,6 +95,9 @@ struct aer_broadcast_data { static inline pci_ers_result_t merge_result(enum pci_ers_result orig, enum pci_ers_result new) { + if (new == PCI_ERS_RESULT_NONE) + return orig; + switch (orig) { case PCI_ERS_RESULT_CAN_RECOVER: case PCI_ERS_RESULT_RECOVERED: diff -Nraup linux-2.6.30-rc3/drivers/pci/pcie/portdrv_pci.c linux-2.6.30-rc3_aerport/drivers/pci/pcie/portdrv_pci.c --- linux-2.6.30-rc3/drivers/pci/pcie/portdrv_pci.c 2009-04-29 15:52:23.000000000 +0800 +++ linux-2.6.30-rc3_aerport/drivers/pci/pcie/portdrv_pci.c 2009-04-30 14:02:25.000000000 +0800 @@ -200,7 +200,7 @@ static int slot_reset_iter(struct device static pci_ers_result_t pcie_portdrv_slot_reset(struct pci_dev *dev) { - pci_ers_result_t status = PCI_ERS_RESULT_NONE; + pci_ers_result_t status = PCI_ERS_RESULT_RECOVERED; int retval; /* If fatal, restore cfg space for possible link reset at upstream */