From patchwork Wed Mar 11 16:40:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 5987211 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 2D09DBF90F for ; Wed, 11 Mar 2015 16:40:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 685C9203A0 for ; Wed, 11 Mar 2015 16:40:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 20C89201BC for ; Wed, 11 Mar 2015 16:40:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752639AbbCKQkb (ORCPT ); Wed, 11 Mar 2015 12:40:31 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:47401 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbbCKQk1 (ORCPT ); Wed, 11 Mar 2015 12:40:27 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t2BGe2uh016316; Wed, 11 Mar 2015 11:40:02 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t2BGe0Bk003609; Wed, 11 Mar 2015 11:40:01 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Wed, 11 Mar 2015 11:40:00 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t2BGdxnm016715; Wed, 11 Mar 2015 11:40:00 -0500 From: Murali Karicheri To: , , , , , , , , , , CC: Murali Karicheri Subject: [PATCH v1] of/pci : fix of_pci_dma_configure parent ptr NULL Date: Wed, 11 Mar 2015 12:40:03 -0400 Message-ID: <1426092003-16925-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); }