From patchwork Tue Mar 10 15:25:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 5978491 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BD26EBF440 for ; Tue, 10 Mar 2015 15:26:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03A4520222 for ; Tue, 10 Mar 2015 15:26:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F7212014A for ; Tue, 10 Mar 2015 15:26:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753009AbbCJP0J (ORCPT ); Tue, 10 Mar 2015 11:26:09 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:49154 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753324AbbCJP0I (ORCPT ); Tue, 10 Mar 2015 11:26:08 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id t2AFPdhC010563; Tue, 10 Mar 2015 10:25:39 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t2AFPbO3015300; Tue, 10 Mar 2015 10:25:38 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Tue, 10 Mar 2015 10:25:37 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t2AFPauT007484; Tue, 10 Mar 2015 10:25:36 -0500 From: Murali Karicheri To: , , , , , , , , , , CC: Murali Karicheri Subject: [PATCH] pci: of : fix BUG: unable to handle kernel Date: Tue, 10 Mar 2015 11:25:39 -0400 Message-ID: <1426001139-18419-1-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On some platforms such as that based on x86, ia64 etc, root bus is created with parent node passed in as NULL to pci_create_root_bus(). On these platforms, the patch series "PCI: get DMA configuration from parent device" when applied causes kernel crash. So add a check for this in of_pci_dma_configure() Signed-off-by: Murali Karicheri Acked-by: Rob Herring --- drivers/of/of_pci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c index 86d3c38..a8e485c 100644 --- a/drivers/of/of_pci.c +++ b/drivers/of/of_pci.c @@ -129,6 +129,10 @@ void of_pci_dma_configure(struct pci_dev *pci_dev) struct device *dev = &pci_dev->dev; struct device *bridge = pci_get_host_bridge_device(pci_dev); + /* Some platforms can have bridge->parent set to NULL */ + if (!bridge->parent) + return; + of_dma_configure(dev, bridge->parent->of_node); pci_put_host_bridge_device(bridge); }