Received: by 10.192.165.148 with SMTP id m20csp2466701imm; Sun, 22 Apr 2018 07:38:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx49k/mCL3p3ut/bWH6XvFCMj7O6lqlWAjmD4Ntnv+4SDT9n2QCfMAiqiTjBpqd/IOHisfiHb X-Received: by 2002:a17:902:70c7:: with SMTP id l7-v6mr17177034plt.165.1524407891926; Sun, 22 Apr 2018 07:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524407891; cv=none; d=google.com; s=arc-20160816; b=pwCFdM+G0NUcDBGZhKy6RMZUtoKzkogZtUQQ5YjlP+GTL2wxWyHm+UnjiJZqhe0+OV c3xx4dJVGbyjD5+j8B6uG4nEAv6H/reAjQFh0j57/+5TdqInSPP9/qaZIJCSgfG3Jg4y h1fKHP7dypQA6HKHTgSt7pCqQLiAt14H6FcXqYz4jZ1mZK8i7CgYVM7maQiXKNadD46v ZTf6T/uHckNt3YNnppoZRMiaFnuyq2qIaXnWYt7qSN2D4jWeJCTHi8hhftlVlEiPSgBB pqqE0/16VHeXvLpQeWP5nNslh0zBFmLN8Pna8fKb+XNyGNLjvApbyDahqp9515i1GI2F 8PFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=XQGUV30mWhGlzQRHnhmdsOpo5TZuyxucWgwd4s8/RfI=; b=bB+45uNMfR8Cg9pE+YNumRlqTo8gt29p++MRoC+LD2AMkSyqXlQBKJ9QYsREeNwisE Xkzl3vCYMwvmMW++BKtz1A47M+3qAPbN11T+nnhqdbgd30Qwb7IAwkA0rq5V6wuSCI9F RoLqHOeZet7cvTRyunjDGzeWRSM4oX8iXILkSjlj9KKAImp0sdvoHEIGSkU+qTiK0aRY fQSzoUtWRbACCgsiLOUUvUlcYFV7my9w13yvmqisK1Omvmo892StXSENutEUEUoKmIgJ zTBy4F4VXNtJ8YSEIAemXcBsG2Rscp8MWzy1m9c3qz8ewUOr0M73qxqWXMkuzcJmjyYo NVPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si2922268pgc.283.2018.04.22.07.37.53; Sun, 22 Apr 2018 07:38:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757273AbeDVOgx (ORCPT + 99 others); Sun, 22 Apr 2018 10:36:53 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59250 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932518AbeDVOS6 (ORCPT ); Sun, 22 Apr 2018 10:18:58 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2DB2BD09; Sun, 22 Apr 2018 14:18:57 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pridhiviraj Paidipeddi , Michael Neuling , Russell Currey , Michael Ellerman Subject: [PATCH 4.4 86/97] powerpc/eeh: Fix enabling bridge MMIO windows Date: Sun, 22 Apr 2018 15:54:04 +0200 Message-Id: <20180422135309.888967753@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135304.577223025@linuxfoundation.org> References: <20180422135304.577223025@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Neuling commit 13a83eac373c49c0a081cbcd137e79210fe78acd upstream. On boot we save the configuration space of PCIe bridges. We do this so when we get an EEH event and everything gets reset that we can restore them. Unfortunately we save this state before we've enabled the MMIO space on the bridges. Hence if we have to reset the bridge when we come back MMIO is not enabled and we end up taking an PE freeze when the driver starts accessing again. This patch forces the memory/MMIO and bus mastering on when restoring bridges on EEH. Ideally we'd do this correctly by saving the configuration space writes later, but that will have to come later in a larger EEH rewrite. For now we have this simple fix. The original bug can be triggered on a boston machine by doing: echo 0x8000000000000000 > /sys/kernel/debug/powerpc/PCI0001/err_injct_outbound On boston, this PHB has a PCIe switch on it. Without this patch, you'll see two EEH events, 1 expected and 1 the failure we are fixing here. The second EEH event causes the anything under the PHB to disappear (i.e. the i40e eth). With this patch, only 1 EEH event occurs and devices properly recover. Fixes: 652defed4875 ("powerpc/eeh: Check PCIe link after reset") Cc: stable@vger.kernel.org # v3.11+ Reported-by: Pridhiviraj Paidipeddi Signed-off-by: Michael Neuling Acked-by: Russell Currey Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/eeh_pe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/arch/powerpc/kernel/eeh_pe.c +++ b/arch/powerpc/kernel/eeh_pe.c @@ -788,7 +788,8 @@ static void eeh_restore_bridge_bars(stru eeh_ops->write_config(pdn, 15*4, 4, edev->config_space[15]); /* PCI Command: 0x4 */ - eeh_ops->write_config(pdn, PCI_COMMAND, 4, edev->config_space[1]); + eeh_ops->write_config(pdn, PCI_COMMAND, 4, edev->config_space[1] | + PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); /* Check the PCIe link is ready */ eeh_bridge_check_link(edev);