From patchwork Wed May 16 21:33:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 914961 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UVmPykV3"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40mSNN1MZtz9s0q for ; Thu, 17 May 2018 07:33:24 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751293AbeEPVdW (ORCPT ); Wed, 16 May 2018 17:33:22 -0400 Received: from mail-ot0-f194.google.com ([74.125.82.194]:38429 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750953AbeEPVdV (ORCPT ); Wed, 16 May 2018 17:33:21 -0400 Received: by mail-ot0-f194.google.com with SMTP id n3-v6so2680081ota.5; Wed, 16 May 2018 14:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=GBXIhsOhBjXGoA3oWD2UdLGC6hGKYUzn9wDlrg1znt0=; b=UVmPykV3vY1yKeFwm1KUn4hOzyxRidK7c4MSoT/VWYte+o0WsJh/EkSuzEpUoSe3P5 c0+Nsi8miZAUVwlJ9br40fjp5kGuAXnu7r1KAKDfEFcQbyy3s7pe5s7H8EwmpYM08+dQ pdgLfPU9Hqw2Xe4iAhayGwtjwvYXG8JOFryqFO1d7FU6Q6EBPSwXNEPZJHCoPqACNQSw LktYrNpZ3jL57kLUioxe4O3y+NjkLfHFNHcxQeknEVg+Jy0fhEIBjaRTcxdPJlEQRA8Y Dc19sDFS4CcpiLSsb7nnFC5Dh8bpBPkAhM3cQ68cM1XAYtputeAvm6x7Trlyk5U5E2/m M98w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GBXIhsOhBjXGoA3oWD2UdLGC6hGKYUzn9wDlrg1znt0=; b=U4hnzlvNHb05hdYZQeDo8rmrgvee7ZNKNRdwnh4l07NZw88jq+mIE5yJ2ucoBN3g6p ZwnW59gvlDGKol7VOFQL0P1mBvMw6TofbEbgKGqgx78ITvi3IxXR3G4nkv951Bo/yBYQ Z5PhsboolHefqPUe/NznhJoU1MTvC2dkFHkPTYDiEYWKeYk60QYr4vXsF5UXg1T+YFLw Y3VNukTlsOgbhbD9uEaqclIN+pk9JBXOIZP76sGE1cboPRvGKJz6Yt2UKgxE9dIV+12/ Qrj5B2ZcnSK0aUR4y3AjSOunSIyYP8LY4l7gs7gCpeY/O3udRPa043pn/4ISoiL0+fZa tbUQ== X-Gm-Message-State: ALKqPwePwoSO29i1Da56F+QYBfLxMqBUQED9gkY8cyBnPXzEiyfhboi2 BFCvfGG8pJ0BoQx8sAZz7Ysjf97c X-Google-Smtp-Source: AB8JxZpADwIXilGcUzr3wIEjs7qCgL289A8kAwe3kd/wqD0BzBSONZe0YsmIjR9Wb71w0lMgv0r7FA== X-Received: by 2002:a9d:210b:: with SMTP id i11-v6mr1894740otb.5.1526506400730; Wed, 16 May 2018 14:33:20 -0700 (PDT) Received: from nuclearis2_1.lan (c-98-201-114-184.hsd1.tx.comcast.net. [98.201.114.184]) by smtp.gmail.com with ESMTPSA id k54-v6sm2247362otb.49.2018.05.16.14.33.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 14:33:19 -0700 (PDT) From: Alexandru Gagniuc To: bhelgaas@google.com Cc: alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, Alexandru Gagniuc , Keith Busch , Sinan Kaya , Dongdong Liu , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI: DPC: Clear AER status bits before disabling port containment Date: Wed, 16 May 2018 16:33:02 -0500 Message-Id: <20180516213306.27027-1-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.14.3 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org AER status bits are sticky, and they survive system resets. Downstream devices are usually taken care of after re-enumerating the downstream busses, as the AER bits are cleared during probe(). However, nothing clears the bits of the port which contained the error. These sticky bits may leave some BIOSes to think that something bad happened, and print ominous messages on next boot. To prevent this, tidy up the AER status bits before releasing containment. Signed-off-by: Alexandru Gagniuc --- drivers/pci/pcie/dpc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c index 8c57d607e603..bf82d6936556 100644 --- a/drivers/pci/pcie/dpc.c +++ b/drivers/pci/pcie/dpc.c @@ -112,6 +112,10 @@ static void dpc_work(struct work_struct *work) dpc->rp_pio_status = 0; } + /* DPC event made a mess of our AER status bits. Clean them up. */ + pci_cleanup_aer_error_status_regs(pdev); + /* TODO: Should we also use aer_print_error to log the event? */ + pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS, PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT);