Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2096569imm; Thu, 9 Aug 2018 07:17:00 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx++JsGP5ISNh4kTZo5CEGNlQCzYKh6ignq7Lp+TxtvVChVYNSX22np31OfDDa7JFWr+zQe X-Received: by 2002:a17:902:59da:: with SMTP id d26-v6mr2299023plj.42.1533824220825; Thu, 09 Aug 2018 07:17:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533824220; cv=none; d=google.com; s=arc-20160816; b=dOy7ZrtlfFzsOnQEhb8KiTj4EuJ2sDQijR6J2iQ4yfRA7PvDy9XehVh/QVvw+3jiIA kZpstF6yplpn10YXN9HTcxvyP7z4AV7EZJvJdJN276XkQ1Gb+eOkubLSkfQF6DLxOJDG BiC57PyYwQeldK+ZcDWLrhyTrP/VmDKWXSiHelqUQOiONFX+IsVzbG71o1rO/EjuOqD8 ohZguxl00kKz7kd1sYwO/AdUviRZHGN5xYb+csW9SsgQDM2zuereBAM2ePUHthU5s2xh REZz7gN0ZLJsCqM7NNBdZ3FR8Uwo4JdocPyM7ZEDhlr/GBqXzNlprBK1Mk2pRdTRI2ea jEMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=e9xGpymSSP7Pj08bIhdX0Ur+ioFWKB28baqrWdu9FuE=; b=E5e6YECXbsbvIdrzZ5CTBLkGKHTKtMw9gO/SJWig4jSOn3o0dUNuckJx8LXuM0kwrG I+mcGqyfQHfURFbfTvV44EFmPzz+hyt3eJifWBKg6J525tmnQ2BnQnsnsfo/VD6oViOW cT/+CKxxGz3CrUwDZ4wu5PS3H6YqeraiVTj6ytXjB32CRhGGvMMYVkC3rCRPyLhJjIqd +SYqlia8COCzFQklTAA8b7ytY97pnEm+mY7jT2Nh6AwFXdriDz0V1gVnX82rxUHvl9Ni SOzpcHIA7HprG8TBv2T1pl8g+E+OPRhpncdHou+3+ngejYkbxgQxI8OkPo+WOez+35ZV voKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1mTlHsTl; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b82-v6si8259120pfb.18.2018.08.09.07.16.46; Thu, 09 Aug 2018 07:17:00 -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=@kernel.org header.s=default header.b=1mTlHsTl; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732154AbeHIQk6 (ORCPT + 99 others); Thu, 9 Aug 2018 12:40:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:51764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730880AbeHIQk6 (ORCPT ); Thu, 9 Aug 2018 12:40:58 -0400 Received: from localhost (173-25-171-118.client.mchsi.com [173.25.171.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8879621E21; Thu, 9 Aug 2018 14:15:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533824152; bh=Uu5sRSv8oJbas8tLraIrf/kYMvX+HMnTBtSBa4A+Tk8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1mTlHsTl+Cs/C5d2VfuZlFLdbFGP4EsbkQTg+PHmcs6WAs+IpzlHyRxoEBrkmzpHn TqzTQDb9+EX+eXeWr6Kcq0p/emEtc1CZp2jn7N/r94NxEWoquHcQ3Kf30NTPawboIz 8wHRYOqXGQGdEUQIJsrDecdE4sEXsbzfj+ETA0fU= Date: Thu, 9 Aug 2018 09:15:51 -0500 From: Bjorn Helgaas To: Alexandru Gagniuc Cc: bhelgaas@google.com, keith.busch@intel.com, alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, Frederick Lawler , Oza Pawandeep , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI/AER: Do not clear AER bits if we don't own AER Message-ID: <20180809141551.GH49411@bhelgaas-glaptop.roam.corp.google.com> References: <20180717153135.25925-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180717153135.25925-1-mr.nuke.me@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 17, 2018 at 10:31:23AM -0500, Alexandru Gagniuc wrote: > 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; I like this patch. Do we need the same thing in the following places that also clear AER status bits or write AER control bits? enable_ecrc_checking() disable_ecrc_checking() pci_cleanup_aer_uncorrect_error_status() pci_aer_clear_fatal_status() > pos = dev->aer_cap; > if (!pos) > return -EIO; > -- > 2.14.3 >