From patchwork Tue Aug 15 13:58:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 9901941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78CAE60230 for ; Tue, 15 Aug 2017 13:59:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A75E28822 for ; Tue, 15 Aug 2017 13:59:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E5F328849; Tue, 15 Aug 2017 13:59:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CE8B228835 for ; Tue, 15 Aug 2017 13:59:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YJBLZ9eFJwHxtGHQ+bcnINnjy16SgaJN2ZnXmbYd5BY=; b=SKl7ie4YXNTF0V cLTymBRkzx+uaWH90qn9ISSv1ngiJ7uYc0/u577H0vzqdYsFHtb8glwp5cS1jBv2/kfC8sM09jGu3 q1jJR4UF2Rral1a0u/vep6hwahKj7YnhOtLn1tCeIJ6JQ54FEMYpIvwwYW5ixN26oX+DHGEY3LYsg nqatjJnlR+6SdjfhRDb+O3wLPWxCTebpLY26VNsJ9qjG3+JjvRnjAKn05/jY445CiKmcJRNvHMXld QgxL9uO+6bYuHxXdO/tPrLo0qsMPTQ1GKSG7p0JuIIAyo1WI1aTnCX7jVTeiBpf761TF68O10RU+d PfgKs5dlUdr/PgZ3VnTw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dhcNO-0001CP-Kq; Tue, 15 Aug 2017 13:59:22 +0000 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dhcNL-0000uG-CS for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2017 13:59:20 +0000 Received: by mail-pg0-x241.google.com with SMTP id u185so1632923pgb.0 for ; Tue, 15 Aug 2017 06:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=UUYZuw5iMd4p8rtJbFaXs+Wi7vMO2gwq0Uwk/wGyQN8=; b=L4j42kjr97YMf6yAQtMuHadO86dgsr/67ifqsDk9jQEOMk5rUXvQ11GaLKRNOpHRmS R7WBs3+efsS59By5F/PYAOlCNc+ZjLp1BQC8F5WrAKAFpCquTJy4IHa/ezaeceCR4WRc jRbRMR0UOzWYuGWgifqrpayB5ts+tw2hqNriwq4z2od/aTI1zGMb88N0f1Z+FSSHeOD8 RO80inkuh2w2zIVRLJ91Y5eDLMH4My2L0zfMftsqWHEp72ej6UW1NHHIW1Gv0y3kRpqI mScuGkVqRhUkXHZYHGGSPcmKCmsLmQ8RsV4/ATkp5VDhWAMOwJNaNkAw87DpchmHt/4T qalQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=UUYZuw5iMd4p8rtJbFaXs+Wi7vMO2gwq0Uwk/wGyQN8=; b=LeJSwXgOg4/FF5lk5XdX6KcM29GgR/J+qJT255IJ9H3n9PLRtsA6C9Jn3FaRIsRM7K wOytDHVHapBPzvc1AJ4tOaLNo1gLMUFytlAJZ5FrGXqPbNVxaNnDMZiUzhDsBQAy9w0Y CbzKAnIabqTRfnWIwHk2MUqkwqPEl8KE6JcdFDoKeTk6dfz2X/+W7K0QDxVI+pKbMVHW /2+V0mAQeI6O5SBkjPk/o9yojx87qBYIYRlVi6x0m8iW4R0WFj3ABtx3s3LxLTib+XiK EpAnyqiLy8UBMn3GejokacPy+vaVYssSeHq/zS4Wai86AoH6xtQdhh56e8RZVn+acbk9 oj/A== X-Gm-Message-State: AHYfb5jiC77r8MkG+zsxKX2x7xzZP7uzf9VmLpdwF17RWzc2ElWLhF0n BhcTZnfayX0TpA== X-Received: by 10.98.152.77 with SMTP id q74mr28303228pfd.40.1502805538335; Tue, 15 Aug 2017 06:58:58 -0700 (PDT) Received: from [192.168.86.171] (c-67-180-167-114.hsd1.ca.comcast.net. [67.180.167.114]) by smtp.googlemail.com with ESMTPSA id t3sm16464285pfb.147.2017.08.15.06.58.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Aug 2017 06:58:57 -0700 (PDT) Message-ID: <1502805534.4936.73.camel@edumazet-glaptop3.roam.corp.google.com> Subject: Re: [PATCH v11 0/5] Add new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag From: Eric Dumazet To: David Miller Date: Tue, 15 Aug 2017 06:58:54 -0700 In-Reply-To: <20170814.221512.1430356980828045690.davem@davemloft.net> References: <1502767407-6812-1-git-send-email-dingtianhong@huawei.com> <20170814.221512.1430356980828045690.davem@davemloft.net> X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170815_065919_457040_97226C2A X-CRM114-Status: GOOD ( 14.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, gabriele.paoloni@huawei.com, asit.k.mallick@intel.com, catalin.marinas@arm.com, will.deacon@arm.com, linuxarm@huawei.com, alexander.duyck@gmail.com, ashok.raj@intel.com, helgaas@kernel.org, jeffrey.t.kirsher@intel.com, dingtianhong@huawei.com, ganeshgr@chelsio.com, Bob.Shaw@amd.com, leedom@chelsio.com, patrick.j.cramer@intel.com, bhelgaas@google.com, werner@chelsio.com, linux-arm-kernel@lists.infradead.org, amira@mellanox.com, linux-pci@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, David.Laight@aculab.com, Suravee.Suthikulpanit@amd.com, robin.murphy@arm.com, l.stach@pengutronix.de Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, 2017-08-14 at 22:15 -0700, David Miller wrote: > From: Ding Tianhong > Date: Tue, 15 Aug 2017 11:23:22 +0800 > > > Some devices have problems with Transaction Layer Packets with the Relaxed > > Ordering Attribute set. This patch set adds a new PCIe Device Flag, > > PCI_DEV_FLAGS_NO_RELAXED_ORDERING, a set of PCI Quirks to catch some known > > devices with Relaxed Ordering issues, and a use of this new flag by the > > cxgb4 driver to avoid using Relaxed Ordering with problematic Root Complex > > Ports. > ... > > Series applied, thanks. I got a NULL deref in pci_find_pcie_root_port() Was it expected ? This local hack seems to fix the issue. diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index af0cc3456dc1b48b1325c06c5edd2ca8cc22a640..cfd8eb5a3d0ba8347d44952ffab28d9c761044d3 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -522,7 +522,7 @@ struct pci_dev *pci_find_pcie_root_port(struct pci_dev *dev) bridge = pci_upstream_bridge(bridge); } - if (pci_pcie_type(highest_pcie_bridge) != PCI_EXP_TYPE_ROOT_PORT) + if (highest_pcie_bridge && pci_pcie_type(highest_pcie_bridge) != PCI_EXP_TYPE_ROOT_PORT) return NULL; return highest_pcie_bridge;