Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp601900ybz; Fri, 24 Apr 2020 06:12:27 -0700 (PDT) X-Google-Smtp-Source: APiQypKEHZT1pBmtzxqoHlfAmn8c/OI+a20WcwVDONTx3rU0QnIy3D1xgrRKkpoTS7qOLWEtcDWf X-Received: by 2002:a50:a0c7:: with SMTP id 65mr7327162edo.7.1587733947679; Fri, 24 Apr 2020 06:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587733947; cv=none; d=google.com; s=arc-20160816; b=iFbO1oCryhdaGOtQNS+VnyFlA3v/+fvLNILFNHS8KP1k6ZNvEBjxHigHJed7OAvieD yVwJQ3ooNecBllJH99pe2fpv8G5yYpw3YXTgJnXIBFe013wTsSZsdhqLDEW9YwnmOJfX KYDzaBwvBUJQ2YczuPL7AYynNMshuj8+z0dAsw5f3xDPp4AsU1ppgZoz7ira2a0lUTty 9JZKWbnwKX5wtdd9Pf5u7dLVFJ4l8dl/o3+nwzB2pWR9QQmKPxYKt6WhJtt7Z5WC/BPW nUXpO8bMUkTC7Le6kZBb6y1kS6LM2x6b6muocsdt2Sfqg9nA+OwFoubiCJOsehfYd4JF nyvQ== 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=52phoi14/0RbWzX44wjG8elLRUFqTXQlWJ1IalT2Yls=; b=C+v1njzfOPSIQMcvngt5YtAVymqgdLeRxD43D9qrK3I0+1tOWyy9R9M2yIs/oG/Pkm lE+gmuAe3b352vO+FCpy0MWSy3Z3eW4Ew5nu9W0PqlLf6tPa57GzpbqA6KPg1dJdgfxt KCsYTpsp+Yw/5gj5LSG3c0Ekk6XsDkUu5U7gplntgk8HeUYkQUBNUjRLNtriMANRqTq2 valkWGmUTxwDniRbKjfiKCUhMnHDSbh4MspNVpdH5g2MGNjuqoHTl37lcZbdPK8h/y4+ QBW688GStNk/O8aF5kJ2gO5gfQpOeIbj6amYzj3uLX394WkZkaE493bAHgP+qXjx6IkU OmNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=CQdNKTrq; 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=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx19si3140523edb.230.2020.04.24.06.12.02; Fri, 24 Apr 2020 06:12:27 -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=fail header.i=@flygoat.com header.s=vultr header.b=CQdNKTrq; 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=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727965AbgDXNKI (ORCPT + 99 others); Fri, 24 Apr 2020 09:10:08 -0400 Received: from vultr.net.flygoat.com ([149.28.68.211]:59560 "EHLO vultr.net.flygoat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726699AbgDXNKH (ORCPT ); Fri, 24 Apr 2020 09:10:07 -0400 Received: from localhost.localdomain (unknown [IPv6:2001:da8:20f:4430:250:56ff:fe9a:7470]) by vultr.net.flygoat.com (Postfix) with ESMTPSA id 89E0B2049C; Fri, 24 Apr 2020 13:09:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=vultr; t=1587733794; bh=NE5sCt6ssdL9diqa/uHtsH6X8dScz66rvMdDwvKjb94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CQdNKTrq4hjEUOjpAq+0bEdnMwI1+HBwBGmevMxwByx2FC/iK9/SrbXpOgdTPmQ+j wwsp6tGx+i0ALTtwb8pidNshvb+4iGxVghtPBKFviUxhtikbqUIskPCflMcWhEfLNB IxlOr4Ix2GO6UW/nVAyCoYusaCIAVztUyQiHBs0d7Z63QXv6IvGPUmrGbSGj8ps/V9 iVQ0y5IpC6CX7M4kywqE8j2lUWm0QnX6DoHmGR7NUD702Vo2KOM3RYdv5bDQQU5jx8 oyyjCcAQGtPGzd2nxVGl/QNcEUBMfV8Nm6zRwWuUynrsZzXtaIXCJwGzJ6b2cD0w8K OAJCyA0d10zOg== From: Jiaxun Yang To: linux-pci@vger.kernel.org Cc: Jiaxun Yang , Bjorn Helgaas , Rob Herring , Thomas Bogendoerfer , Huacai Chen , Lorenzo Pieralisi , Andrew Murray , Paul Burton , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v5 2/6] PCI: Don't disable decoding when mmio_always_on is set Date: Fri, 24 Apr 2020 21:08:33 +0800 Message-Id: <20200424130847.328584-3-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.26.0.rc2 In-Reply-To: <20200424130847.328584-1-jiaxun.yang@flygoat.com> References: <20200424130847.328584-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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"); -- 2.26.0.rc2