From patchwork Fri Jun 19 14:33:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 223648 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 159A8C433E2 for ; Fri, 19 Jun 2020 16:49:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CFD53206B7 for ; Fri, 19 Jun 2020 16:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592585380; bh=VISYukPm7ye8bXDmblrcmepv+XIDapPrb/mUM23OnE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MGuZBnqEHy2JNy3MW8ETrIL9Sqx2/DIk/CgOrpZ/JFs4ptZWlEcxBrtor10L3QTmE 1bwl5Qrn3lxPUynBYBBUgp9d/SZ4CxK7MuRr6LQOUpmoEgs5FgJKYgw67ylc9N8l/z lYEnVnY+YhXZiventaiptQ3g3gNdLTBDavffLAh0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388031AbgFSQtk (ORCPT ); Fri, 19 Jun 2020 12:49:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:56890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388008AbgFSOj0 (ORCPT ); Fri, 19 Jun 2020 10:39:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 13FAC20CC7; Fri, 19 Jun 2020 14:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577566; bh=VISYukPm7ye8bXDmblrcmepv+XIDapPrb/mUM23OnE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uxkwdN11LNbL+pNKUL8vlru55AUNWaEBNQsXeydcc9teRhDb8iEvYq67I0dNrEcZA JKdHgL07fCh/Rkqep1XWlJHZGSA3D7D6RoSjMVw7FLxuPTh60HFUq+JT+2Q40vRyXS zLoUw/4FMDV2ZVNDECr257O3E3+yW8U+/LxeTA08= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiaxun Yang , Bjorn Helgaas , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 4.4 071/101] PCI: Dont disable decoding when mmio_always_on is set Date: Fri, 19 Jun 2020 16:33:00 +0200 Message-Id: <20200619141617.760175302@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141614.001544111@linuxfoundation.org> References: <20200619141614.001544111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jiaxun Yang [ Upstream commit b6caa1d8c80cb71b6162cb1f1ec13aa655026c9f ] 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 Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- 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 5f040619393f..46656322d23e 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1226,7 +1226,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)) { dev_info(&dev->dev, "device has non-compliant BARs; disabling IO/MEM decoding\n");