From patchwork Mon Sep 12 04:17:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 668555 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sXZV10ZW4z9s3T for ; Mon, 12 Sep 2016 14:25:13 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3sXZV06kshzDsWS for ; Mon, 12 Sep 2016 14:25:12 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from russell.cc (russell.cc [IPv6:2404:9400:2:0:216:3eff:fee0:3370]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3sXZSx3SbRzDsMB for ; Mon, 12 Sep 2016 14:24:17 +1000 (AEST) Received: from snap.ozlabs.ibm.com (static-82-10.transact.net.au [122.99.82.10]) by russell.cc (OpenSMTPD) with ESMTPSA id 054f9867 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Mon, 12 Sep 2016 04:17:42 +0000 (UTC) From: Russell Currey To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 2/3] powernv/eeh: Skip finding bus for VF resets Date: Mon, 12 Sep 2016 14:17:23 +1000 Message-Id: <20160912041724.16646-2-ruscur@russell.cc> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160912041724.16646-1-ruscur@russell.cc> References: <20160912041724.16646-1-ruscur@russell.cc> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell Currey Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" When the PE used in pnv_eeh_reset() is that of a VF, pnv_eeh_reset_vf_pe() is used. Unlike the other reset functions called in pnv_eeh_reset(), the VF reset doesn't require a bus, and if a bus was missing the function would error out before resetting the VF PE. To avoid this, reorder the VF reset function to occur before finding and checking the bus. Cc: stable #3.10+ Signed-off-by: Russell Currey Reviewed-by: Andrew Donnellan --- arch/powerpc/platforms/powernv/eeh-powernv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index cb08e6a..68f1a85 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c @@ -1090,14 +1090,15 @@ static int pnv_eeh_reset(struct eeh_pe *pe, int option) } } + if (pe->type & EEH_PE_VF) + return pnv_eeh_reset_vf_pe(pe, option); + bus = eeh_pe_bus_get(pe); if (!bus) { pr_err("%s: Cannot find PCI bus for PHB#%d-PE#%x\n", __func__, pe->phb->global_number, pe->addr); return -EIO; } - if (pe->type & EEH_PE_VF) - return pnv_eeh_reset_vf_pe(pe, option); if (pci_is_root_bus(bus) || pci_is_root_bus(bus->parent))