Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3676304imm; Tue, 17 Jul 2018 08:33:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc1rf1d8ojYxDV/3KnYET/W8KnIAYM5HIVeBp+LPm/bGH5No4HaSlM3Y04s353kpV6EvN6T X-Received: by 2002:a17:902:20ca:: with SMTP id v10-v6mr2055188plg.255.1531841591074; Tue, 17 Jul 2018 08:33:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531841591; cv=none; d=google.com; s=arc-20160816; b=WREf4zCdrvDTZouXsEMI0PU69yvD82uM117wURLtsIroqkt3NCmmqe8RCX4hN0AM5C zA1xZ1NzdoisL6unfIkZRcKTvBiZH10+Z9K6lrWiKqiFzsUIFoqSMSB/PI1+BQhVxVuL Apsx8FmGDuvN+kE3w5MHgWYn24k12uQyXA+VfhCqOTs4F23ZdR+cdGZqtv6BVEzFsqey G7w6FO8h6C7zGPbX8RvLtMBqNNSz43+HMZcj6TPY6Dlyg04ROU6K0NjI9KLOk8ugNdPC u00XYHhi5ierFNc1xynuoGyBjzer/92xvplLe9ZYF6NvDjDCD7aO3V2qLghxSd1bCKAG Dtig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=xrsanRdLjNaIa5W58QfGTnIblsjPmqFD0nL3D5ylARg=; b=ADfGDdXVl2EwwKA3F3SLdpiYMPANIlgqO10uKmYgJDwq1JcA1zPDEx539lNEqkRuxE CpU/vRnDqjbyl/pIWHqKSgOUAJUsHmAxVOiqTLHJXsWn7k5wTzmm0GIGsFsN3ermlTQW YnVaSvzuAr2lK5SMby07WXqercN7vVX6blH9GEKYAqpkmhsRHVLb2kUP8CCGF48UCN63 6J/c/HBHj3meegVa6vt4/RTsmlWeJub6aXAImctiHXRt+Iv9MiF4atWmmSKT6yTaKZu5 A4KTq/SfyFY+yCr9qxd9T0KcOtQPSbvYhEgVeITcZaZR+kRcB2UI8zqOkRdSbDEIaH9R lKVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=km16vpuW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a85-v6si1240961pfa.109.2018.07.17.08.32.56; Tue, 17 Jul 2018 08:33: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=km16vpuW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731164AbeGQQFH (ORCPT + 99 others); Tue, 17 Jul 2018 12:05:07 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:42966 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729657AbeGQQFG (ORCPT ); Tue, 17 Jul 2018 12:05:06 -0400 Received: by mail-oi0-f65.google.com with SMTP id n84-v6so2798585oib.9; Tue, 17 Jul 2018 08:31:56 -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=xrsanRdLjNaIa5W58QfGTnIblsjPmqFD0nL3D5ylARg=; b=km16vpuWyMrdXwEgRXeq5qDA88P7zGjejI6ZynWbHF7OlLDdTK6qbK1HJzpeDt3E3x jV0yRH2rsIrgho6ogt7sP1kx+Q5ygMd8JPZ6B3M67zBXf441TLp2yxeQIXuaTPouawPa XO2RfiD+kMOLz32HNf91QkgBUiASActxpp51xMLz5AbMDuLErD0YfleIchGhNqAANxy3 fncf9v/xiM9YIzpy28iXb6/hwz2D6Ewg8uwN7TLLweLPGj5W6AEX/vR2mI+O5sqUgJEX Ls3/F9SP76AEFmajJieOxnRCGDmN3oAC2erU2jJbmv2T2cjPZ+TUIfqsr7rpFGN432NS yQEw== 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=xrsanRdLjNaIa5W58QfGTnIblsjPmqFD0nL3D5ylARg=; b=jDsAXFVHKF2ut07DYxxO0M8bSvnOtwXAstlhfO9oBL5BWimsVyqsgsqK7H1xB7TODn 17E/qmT0SSkue0CRZQgM3wNo6+gWV29OORvv3AOjTKllMVRzZA7aIgjnESiRDAdDAWSe Xep18Lam2rd+Yqes2HdyH3jtRVbQKK1MJRU5gmiDRh6endAygjSCG7gigzVuchm6LLa+ 65V9eOCO/3rh2+esp3rTduzTLk7P+EcFWWevoCfzB52TNUIivc4cgQGax7DNjHwiuW+n QlaQyPCa2UCiNQzilOStFW6ruay+YCHyCtALJIoAZf6nG4HcRSMH6pClib6oDvBdkGcW e+0w== X-Gm-Message-State: AOUpUlGx8oN/qK+1Dym6A+TtpuGIbufS1sytDid+Jac4DnJof+P9Izjv nLUCD8wq7yaWJdx5agVDduw= X-Received: by 2002:aca:5bd5:: with SMTP id p204-v6mr2293879oib.91.1531841515901; Tue, 17 Jul 2018 08:31:55 -0700 (PDT) Received: from nuclearis2_1.gtech (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id a14-v6sm1819595oih.54.2018.07.17.08.31.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Jul 2018 08:31:55 -0700 (PDT) From: Alexandru Gagniuc To: bhelgaas@google.com, keith.busch@intel.com Cc: alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, Alexandru Gagniuc , Frederick Lawler , Oza Pawandeep , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI/AER: Do not clear AER bits if we don't own AER Date: Tue, 17 Jul 2018 10:31:23 -0500 Message-Id: <20180717153135.25925-1-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.14.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When we don't own AER, we shouldn't touch the AER error bits. This happens unconditionally on device probe(). Clearing AER bits willy-nilly might cause firmware to miss errors. Instead these bits should get cleared by FFS, or via ACPI _HPX method. This race is mostly of theoretical significance, as it is not easy to reasonably demonstrate it in testing. Signed-off-by: Alexandru Gagniuc --- drivers/pci/pcie/aer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index a2e88386af28..18037a2a8231 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -383,6 +383,9 @@ int pci_cleanup_aer_error_status_regs(struct pci_dev *dev) if (!pci_is_pcie(dev)) return -ENODEV; + if (pcie_aer_get_firmware_first(dev)) + return -EIO; + pos = dev->aer_cap; if (!pos) return -EIO; -- 2.14.3