From patchwork Tue May 17 04:37:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 12851898 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F06DCC433F5 for ; Tue, 17 May 2022 04:38:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235351AbiEQEib (ORCPT ); Tue, 17 May 2022 00:38:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbiEQEi3 (ORCPT ); Tue, 17 May 2022 00:38:29 -0400 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AA5D3B293; Mon, 16 May 2022 21:38:27 -0700 (PDT) Received: from localhost.localdomain (unknown [10.101.196.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 9650A3FF60; Tue, 17 May 2022 04:38:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1652762305; bh=dUk5UzPbAaK7id+XUtZylZ2adMIECcKVZu5iTLHqEf8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=CttwaKjmY6Rb+SwcDC6GP2cJgX6AnpP161M7TDY6Gsd6OqSXEh2ir7hmyWc68ySS/ 0Xiu8Brr4RfCdJv+q/9iiA9Y1lvaDL0fxEbb5/aqDPk/+lpZx3R1HlMaQfH34ngkdT Je7svv90dhn86eMG4zVo3qRP+48JOXrEeDzTJ8CZ+iQj/3kMJGLl2N1KuIaejU89oj aCW85us93jeVniQSll64foNExtEoG0fakIVaapMYX9zIobm4p79/YRC6POz8tijeDL VIHH0v3Qa+oUmzjt0t5Fj4qnmrddC0X8oNXZqHg807cxpvK5uTzfMNmzupJUxWHrls cvcYmatj0lTfA== From: Kai-Heng Feng To: bhelgaas@google.com Cc: Kai-Heng Feng , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI: Clear PCI_STATUS when setting up the device Date: Tue, 17 May 2022 12:37:38 +0800 Message-Id: <20220517043738.2308499-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org We are seeing Master Abort bit is set on Intel I350 ethernet device and its root port right after boot, probably happened during BIOS phase: 00:06.0 PCI bridge [0604]: Intel Corporation Device [8086:464d] (rev 05) (prog-if 00 [Normal decode]) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- TAbort- SERR- TAbort- SERR- --- drivers/pci/probe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 17a969942d370..414f659dc8735 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1890,6 +1890,9 @@ int pci_setup_device(struct pci_dev *dev) dev->broken_intx_masking = pci_intx_mask_broken(dev); + /* Clear errors left from system firmware */ + pci_write_config_word(dev, PCI_STATUS, 0xffff); + switch (dev->hdr_type) { /* header type */ case PCI_HEADER_TYPE_NORMAL: /* standard header */ if (class == PCI_CLASS_BRIDGE_PCI)