From patchwork Mon Apr 27 06:05:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 11511183 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 F3A6092A for ; Mon, 27 Apr 2020 06:06:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1DA321707 for ; Mon, 27 Apr 2020 06:06:16 +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="GH9RTTnj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726512AbgD0GGQ (ORCPT ); Mon, 27 Apr 2020 02:06:16 -0400 Received: from vultr.net.flygoat.com ([149.28.68.211]:60110 "EHLO vultr.net.flygoat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbgD0GGP (ORCPT ); Mon, 27 Apr 2020 02:06:15 -0400 Received: from localhost.localdomain (unknown [IPv6:2001:da8:20f:4430:250:56ff:fe9a:7470]) by vultr.net.flygoat.com (Postfix) with ESMTPSA id 7D17320CF4; Mon, 27 Apr 2020 06:06:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=vultr; t=1587967574; bh=NE5sCt6ssdL9diqa/uHtsH6X8dScz66rvMdDwvKjb94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GH9RTTnjT/o2eJFEMiy55OMLVbHnBAORssZ+EwGSmFuDvo39o95+Xj36jaNyquAHR +pWlRkIWo2KR2pI2AJjYqXByWV84UvRqd9mkNw8ZqbOZdyhc3P4RSyxVoixVWWO/b7 vgXaDdEXQigrs8ueWeBchOd6NZmlM0SAZePvVmrqmJZRTvQlhMHvD+g0rzvBj1rsSQ cQNRFiD8mGpg928rW7RUdtin0ZTBs7Ku3eltiACFOP4kMxhxiqH0yP2d5WO72y8coa jwIObL/ubGQ63+wACFqu/lg1fKOsxU/j+W3LGbMaVRvfaktJoXIZj5GNxnzUIEf3Ww QSrzVhsKvUi8Q== 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 v6 1/5] PCI: Don't disable decoding when mmio_always_on is set Date: Mon, 27 Apr 2020 14:05:38 +0800 Message-Id: <20200427060551.1372591-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.26.0.rc2 In-Reply-To: <20200427060551.1372591-1-jiaxun.yang@flygoat.com> References: <20200427060551.1372591-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 decoing 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 --- 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");