Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp903685imm; Wed, 18 Jul 2018 12:47:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc1PQ5nck+nO50vk9uvllLJD83RYiMt/vWekVkBFeoghk8BpeH/CLOpAXEsZ2MTCfuk7FsK X-Received: by 2002:a63:4f63:: with SMTP id p35-v6mr7052704pgl.167.1531943241617; Wed, 18 Jul 2018 12:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531943241; cv=none; d=google.com; s=arc-20160816; b=HGXxoLDRkTaSvvFP0hJ8CmMg0M6Edr56oDWcfizkxgMD2xbpckemqQBRvLFs5U8D67 itUHblo0qIN7/wnFRLSPKGRuZMelVCJtVNS7yNuwgoNse3e8cGUxRkcXrHH2hp3tHwHp EOPddWu+FYl6SPLkDKHMPokjs4UwKroQvaWC0T3g6CXFdHh6dm578iWB5ZJvtloNcM0x sUFiRSmygcslDLpcZSoCjSwnD4pebED595EvFUHWXltO3insao+KH2Iw3IxXQlIcgDeb pp7g9H2C1xPhoz73rJ3sO6uwFWxsTYdgJ8kXnILaMQiKxDw47lhrGRAsI+5ZiGf8LCd8 7IFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature:arc-authentication-results; bh=VLgH3rBR5r6lMjg7KHrEgg+Z/ISnPDUVsBMKG3MYH4M=; b=0g4Q+4i4eK1ylCG9lQEdFguK2GW7Ey+PERsDCh8kriLBwgVKkjBD4Rd9iLezUoCu2W 0cnau6mpUFRIjBP7/LV7nbko2RruxWh44lXtWueYysh6KZs31zALeWCTrPozoxW7z+qS G7W0a2D5dhtUiD9CjCAcnZAj+Yke9wWzp7iJVLhlfMl2a6opct9+0vLvwlnJrTLMKBRc RBWE8bxjjXchFl2yb7ruunzTvbb6jvFnM86fc9x5v4x6BxFkFa02o6EhrWmY89qKBV5b qKlKU6V1fD0FtVak5+tCYyado3tejWVDra4FiAZnmyn7d+uq3fKwqfVoPllrVv/rx6z0 ICkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="hZTo3Q8/"; 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 k80-v6si4039958pfg.42.2018.07.18.12.46.43; Wed, 18 Jul 2018 12:47:21 -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="hZTo3Q8/"; 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 S1730732AbeGRUYC (ORCPT + 99 others); Wed, 18 Jul 2018 16:24:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:33782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729642AbeGRUYC (ORCPT ); Wed, 18 Jul 2018 16:24:02 -0400 Received: from localhost (unknown [69.71.4.100]) (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 4E74A20850; Wed, 18 Jul 2018 19:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531943079; bh=Q9wDDbmMkKzgk35C9SEgDdC5qklVgwEr2qsRAGKyaXg=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=hZTo3Q8/nhGM+AFdYJwxZGbbRJ0b8HvcjuuusnNrgAvDWipsvnDUmqat+vePewtu2 2TOu2q1RyJEWO2Ke/1ia+8aYL79ycUhnVT+aO9Ga6zHJ+rjMqGB2kckKzy4gT0Jrk3 Ji4G10/TRbJnrZxMB7IcnDzkdqLQFFfH3PDHwkYg= Subject: [PATCH v3 3/7] PCI/AER: Factor out ERR_NONFATAL status bit clearing From: Bjorn Helgaas To: Oza Pawandeep Cc: Philippe Ombredanne , Thomas Gleixner , Greg Kroah-Hartman , Kate Stewart , Dongdong Liu , Keith Busch , Wei Zhang , Sinan Kaya , Timur Tabi , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 18 Jul 2018 14:44:38 -0500 Message-ID: <153194307824.191586.2110241671895539992.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <153194245964.191586.14782253252654776509.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <153194245964.191586.14782253252654776509.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oza Pawandeep aer_error_resume() clears all ERR_NONFATAL error status bits. This is exactly what pci_cleanup_aer_uncorrect_error_status(), so use that instead of duplicating the code. Signed-off-by: Oza Pawandeep [bhelgaas: split to separate patch] Signed-off-by: Bjorn Helgaas --- drivers/pci/pcie/aer.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 6f0f131b5e6a..b8972fe85043 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -1356,20 +1356,13 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev) */ static void aer_error_resume(struct pci_dev *dev) { - int pos; - u32 status, mask; u16 reg16; /* Clean up Root device status */ pcie_capability_read_word(dev, PCI_EXP_DEVSTA, ®16); pcie_capability_write_word(dev, PCI_EXP_DEVSTA, reg16); - /* Clean AER Root Error Status */ - pos = dev->aer_cap; - pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, &status); - pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_SEVER, &mask); - status &= ~mask; /* Clear corresponding nonfatal bits */ - pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, status); + pci_cleanup_aer_uncorrect_error_status(dev); } static struct pcie_port_service_driver aerdriver = {