Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp786921ybt; Fri, 19 Jun 2020 13:48:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDdmJuoWQKs8umCQr8drZW/fgWlFT4qDU/rOdx6nWNnpkaunOFY39pvVUtENqY0+gTXvDV X-Received: by 2002:a17:906:6c98:: with SMTP id s24mr5605465ejr.438.1592599718387; Fri, 19 Jun 2020 13:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592599718; cv=none; d=google.com; s=arc-20160816; b=apvJfVxehhohHhs8jsFRrPz9JzjCgrjAcBIaIKK/aKZY+wwBI3bk8X1GR7EyT91xF1 QTsNT6yEsZEWV+De2ktqO2xSte7X3ZqB50yjzXH9g85gF1zsy7p0pfi4gcr80Shh7Psa hZ2zQmzDpE+QjllKO2dNLDjJJ65LRnW9eXaYU/B07KKDvxO1/lQ45Z5ki4VcBetbFKRF /k1+U/kWvboiDV3Xxp3xxWOCnE15kHCcd5km95X5v2dJXUcdOVHU8sLScB0yCfAIYgol btcXPAG4QCqMJ0Ny3OqnacYjbdJ90vbJB7qV15/4s0NutBRXRI3NHniQ6oF7+VpmMafi jRtQ== 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:subject:cc:to :from:dkim-signature; bh=kntZcxwVC8yz+enWo2qemgPdrFnL3LaArLdu8doeiL4=; b=jOrTv0qpYibBIXm4DHjsoE7ywH+v+0PRm8Taq5fNYaL1qiqZ4p/fjZiRT/7Y5K8wnJ MTjAVjaHBKgdn4FDszP3z2DnR+Q4QRS7adSv59y9c+wRHyQbSmAS7ZrrYZi+/eEXlGLn 4aFFX7xgY6htadM+8sCeezN9Oqll73JcrBEvQ6u5seube8XfzlFW5F/Wh/uKynEbCPHV 03RcA7MyZCE34DguTb7ud5bMFEbGdTHKWDaGHjCDN1Ygrj/yOPl2hFEzFKYfPjNzcu5C wVNKsn3K0nm04FJvpXB6QOCfXlJM2yAYbDRZA7lmQOnV6hmUot5HkLAoUa8HgcuEFo2t zVTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DqikAN4b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si4622299eds.92.2020.06.19.13.48.09; Fri, 19 Jun 2020 13:48:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DqikAN4b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388039AbgFSPBY (ORCPT + 99 others); Fri, 19 Jun 2020 11:01:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:57050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390277AbgFSPAe (ORCPT ); Fri, 19 Jun 2020 11:00:34 -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 7DC7C20776; Fri, 19 Jun 2020 15:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592578835; bh=6ZTilro9TUJ7Kc4+PNa3OIDDZnDEfHbZlo9JY75x6is=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DqikAN4be4pw8T2hsirdId30QjnDoSYpd+8NdDA0He3wd0qDOqS2ZqPMIg5r7DLti O7v3VZB18IOvPQkBQQ0HDy8Z6ZUMjXWonO103ZuekU4O8iEKSVwihbWMeUXUSPP4eH EWLcC9zXmcSMzfNGO4zuRtNa+/vUs4ZOmpRcwZFE= 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.19 174/267] PCI: Dont disable decoding when mmio_always_on is set Date: Fri, 19 Jun 2020 16:32:39 +0200 Message-Id: <20200619141657.136698762@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141648.840376470@linuxfoundation.org> References: <20200619141648.840376470@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 fa4c386c8cd8..a21c04d8a40b 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1634,7 +1634,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"); -- 2.25.1