Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp56200ybg; Mon, 8 Jun 2020 16:18:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwI8PFtKIZwX/JzhjEbE3Qqj9glDIhifMCeLff/U7XHkPwAxerbBKWW0roP/jtDEVm84kZj X-Received: by 2002:a50:ee01:: with SMTP id g1mr23441254eds.44.1591658288863; Mon, 08 Jun 2020 16:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591658288; cv=none; d=google.com; s=arc-20160816; b=VpZA/2kkv30pc9MDGwg+avjjMayfvGU9nRTdGaIMMWGjvYRJ/lPYg3eriodSsukeKN qYmqV3b47a/3AIfwEmKwWx32ZDSHN+iKnRDcsPzlr8vWIw2SsuNiVyeGf2/X3j6ACs7w 11vZ4YTurj0vxPc/zWLMrsWrdFcxDvmYouVrtssGeJS1xBBoE4BeEuHOH07Cx5tN57fZ 7E0I8tGZYw3sYN1WLOXbggyaDnlZLObcAMfbP6fHSUwh+dyy/KiIlPB/bhC4wG8wWyJP in04Y7Muk9WRqtAE4sR1XUb0BHmDfhuUtzhnZOaEx0iUlIocOlzhqi6QbLsaPFe6fIAJ EyJw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DEDQGg7pJYPvMdDHtldsgObyVFYLCvGrxhvSrTbRig0=; b=jPdGrAiLy4zdwFHw8NeMRKdsN9vIGT11COL1JI6osuNKDcIxOFx3irMsHpMNNyt4oQ wLGFlmCcNsKylQEtMzbmqfBS6+VPM3iPZ+mWjGdVW5I+puuPJJMwDUtGWlvGiALFujyz luUHSrCKZF3gaUa9t4qxOBk2CAHIGTQFumCieS95aY4KNWARgNIu6NrGuwFhX1GvFmRe 2K9cN1zfH5+DvOB3fimmlss7uRMbxoX8q2cnkU+ok2Q9vc+wACo3HwhUHPxGoOjuui2T kydtbVw+CHc05jY3KTyaZ7qHDe3nL6bUpgbBOh84j5aoLl7YkMHZV8EsLP+k+9ZZwV9G s/4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nPpl+WRg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si9525025ejx.370.2020.06.08.16.17.45; Mon, 08 Jun 2020 16:18:08 -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=nPpl+WRg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728383AbgFHXNd (ORCPT + 99 others); Mon, 8 Jun 2020 19:13:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:58170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728896AbgFHXLX (ORCPT ); Mon, 8 Jun 2020 19:11:23 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 18D1D20C09; Mon, 8 Jun 2020 23:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657882; bh=9ys1xBFDNMN3Zfx1f8ojZ9OcYMAvbWAV2H7WG3ATJA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nPpl+WRg1aRv7Zord3x1tl5h5yaXYlWqEnOdoRBfGijpXh6FMJhI0wI1UyH++svRU Ux2CXKefDuyR4IjonR9oygRJjCE3iqEkMZ69n/WJGyQLHTvaDo2U8mmXm1aAKqeUnr eXgPGaZVPa2lXxH2DDIIAKmS+WinsJDU5r4V/vt8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiaxun Yang , Bjorn Helgaas , Thomas Bogendoerfer , Sasha Levin , linux-pci@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 239/274] PCI: Don't disable decoding when mmio_always_on is set Date: Mon, 8 Jun 2020 19:05:32 -0400 Message-Id: <20200608230607.3361041-239-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 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"); -- 2.25.1