From patchwork Tue Apr 28 01:14:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 11513573 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9EFC1392 for ; Tue, 28 Apr 2020 01:16:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9193620728 for ; Tue, 28 Apr 2020 01:16:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="B67G5c2k" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726391AbgD1BQf (ORCPT ); Mon, 27 Apr 2020 21:16:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726233AbgD1BQf (ORCPT ); Mon, 27 Apr 2020 21:16:35 -0400 Received: from vultr.net.flygoat.com (vultr.net.flygoat.com [IPv6:2001:19f0:6001:3633:5400:2ff:fe8c:553]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93963C03C1A8; Mon, 27 Apr 2020 18:16:35 -0700 (PDT) Received: from localhost.localdomain (unknown [IPv6:2001:da8:20f:4430:250:56ff:fe9a:7470]) by vultr.net.flygoat.com (Postfix) with ESMTPSA id 582482049F; Tue, 28 Apr 2020 01:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=vultr; t=1588036594; bh=BsYKKDVjGrGZ45XtSJs9R6ZJaKv6eacQRLmTdmKpjC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B67G5c2k9HMZJWWXwLWPgC7XfOSzJXxwRJ5eXaXIqCb31daEsTLI+7Iv9cGyHdG5/ qjdk2xXxUefX6Vl3rp54A0pJnWPCdEEP+nkpRbmopQqFhGDRTI32GB/RefvsH/3dTd JwzDyg8yvJnGchbtZEEg9t+4z40hYseST2sdS+Cf4NbiYaBLGP/Tfo/rzTzOzN6Rzt VP4dHfKU8WFCb/Bl9QYgGcgy+vSQ0EUzAAN8AnXL2QuuvZOIzdIpC4h5hnLrlfG/nn xv4Cc/Q4OaBGKzrTcX5Lq2yb+k9yBbuPy6Laf+v9LphCS8ISV/pekZGU/0vuDKV4E+ 5lM0LDo9KR5TQ== From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: Jiaxun Yang , Bjorn Helgaas , Rob Herring , Thomas Bogendoerfer , Huacai Chen , Lorenzo Pieralisi , Paul Burton , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 1/5] PCI: Don't disable decoding when mmio_always_on is set Date: Tue, 28 Apr 2020 09:14:16 +0800 Message-Id: <20200428011429.1852081-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.26.0.rc2 In-Reply-To: <20200428011429.1852081-1-jiaxun.yang@flygoat.com> References: <20200428011429.1852081-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Don't disable MEM/IO decoding when a device have both non_compliant_bars and mmio_always_on. That would allow us quirk devices with junk in BARs but can't disable their decoding. Signed-off-by: Jiaxun Yang Acked-by: Bjorn Helgaas Acked-by: Rob Herring --- drivers/pci/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 77b8a145c39b..d9c2c3301a8a 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1822,7 +1822,7 @@ int pci_setup_device(struct pci_dev *dev) /* Device class may be changed after fixup */ class = dev->class >> 8; - if (dev->non_compliant_bars) { + if (dev->non_compliant_bars && !dev->mmio_always_on) { pci_read_config_word(dev, PCI_COMMAND, &cmd); if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { pci_info(dev, "device has non-compliant BARs; disabling IO/MEM decoding\n");