From patchwork Thu Nov 19 00:49:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 7653791 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 760C69F1D3 for ; Thu, 19 Nov 2015 00:51:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 986FD20494 for ; Thu, 19 Nov 2015 00:51:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B8022047D for ; Thu, 19 Nov 2015 00:51:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756214AbbKSAv1 (ORCPT ); Wed, 18 Nov 2015 19:51:27 -0500 Received: from mail-bl2on0077.outbound.protection.outlook.com ([65.55.169.77]:38592 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756315AbbKSAv0 (ORCPT ); Wed, 18 Nov 2015 19:51:26 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; Received: from ssuthiku-fedora-lt.amd.com (165.204.77.1) by SN1PR12MB0445.namprd12.prod.outlook.com (10.162.105.139) with Microsoft SMTP Server (TLS) id 15.1.325.17; Thu, 19 Nov 2015 00:51:17 +0000 From: Suravee Suthikulpanit To: , , CC: , , , , , Suravee Suthikulpanit , "Rafael J. Wysocki" , Suravee Suthikulpanit Subject: [PATCH] PCI: Fix logic OF logic in pci_dma_configure() Date: Wed, 18 Nov 2015 16:49:52 -0800 Message-ID: <1447894192-17210-1-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY1PR20CA0114.namprd20.prod.outlook.com (25.164.213.168) To SN1PR12MB0445.namprd12.prod.outlook.com (25.162.105.139) X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0445; 2:fKtnzdVM0eQjH/zbhXN1lZQtJy/i7U4RMdacLjruS37OxJEyLhtksH6r8W3kwM1fPheENPZK4Fhg/76F51inj8XbJ42bufESbwGg8t6cf+Om1QKTp43WVTlnLGWnB+xAU45C/L+IFIvqLiPq8vOdl3bkhO+1sZG0sgNGftNxg2I=; 3:jkOc5mRIw6jYCRmj4qv7MpLLMBdP5D1sYj0Dcqh2lLdLBXE5PaA+IrnQJq0ZX7x67yrOmGciKjjGtgkq+dYLmNcsuMxjQeeLwiRFmmwBKNkYJstQLawozvcSOuSaHKIQDzv+32WagWhQXdK9uBuXTw==; 25:VpjWzVHXD2z1TpUzji9oN5x13d84Rn38oX7UHNIvbSS/A7TpwHS8KGjpQ8qoNeDXsxSyifmQv5xMUhnTR0XhfcuKN9Z55mtro6ro7IhhIoRmXvFl7zKCvyHX4JzIob9fagabPv429ftP7rDT0J4gc3ljZBDWZjxcFwzOlchBv6QNvpRMuUrt1GP1AdPO6iPLUtHN3rzUIxl+rvZL6WzCB7HeN3soACHplonODuvvAWLiRxmuAh9BM/uW1SRziU35IRGPcrb40AY6abIEZ0EgtA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0445; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0445; 20:9yijyETWlPtRHPAk18Y6CIOT89pjKAtfWYd7mIdvGHnxoRjlrqJ9aPUNsCSA+dl5j3dkOGaMheJnFBttXtZo6G6vGiFZpS7BY6OPvG1HCa86OgeiQlkxR2UJ98hSB1yD4zykfm1jbGVfJguuePweEztB/ee88gscd8Dfp7SWwBoWe3ds9YQaroV/TLyMWYf/9ScR4clHK9B27YH4J93mlKOJ45PIPHTjSe1ATqYWnzu6FFJPDErt9pDieNvNreIf7Hs+cP40md+qAszKPvA2GC5hOOFhbAxxkibSx3Yq6GJ36ntCapUWOghJVdRwzs9iFiXgIJSqQkZrDx8Bq2UTTAbCkuL5vsgJfvCSYx5j/9pNaaqb0HNc3IU7JvUK/klXx4AykYEcvj1Wut9+O9WaCDrNWKs9csMR+sVRQk1/Enq1DsRqp0jC4sZJXaN+C8GHn976Kclsu9Y9lm9TDCJRuhdK1JWUJsNFG0FWN8UaPpy5DGcjHA+7jruBwDCoQh3v; 4:WHzSHrOG021PJymiogdezhVn92vN7rb9eNyYog7pJt0KL8fQ0sesfa4jt4JrRJTVnR3rqFYyjgwrNiZi6NvzIoVCoXDPfnS/AUAqGl+2u1qlskbKXbQqV0QZY6UeTfzuUWD99D66tnzBtUsXctH3aRhOtV3ho0KhL6N1wroVPWzo7shT15mW3gwU/zCI8SWFcmzdtaCKJXy2OkPlw6SofI+4yfYjdVyPIQe2hL45HRHGfrT18jsWmuxEkd27iNkbBbZIg2KhvAOs06uF/IadUKFJCd3K54cKTzuFBWYo11PYsMyRE97RfgzWjo68eoeZQIqP1PuF/JyMfzu5EnwX8xAQH2znkVOIViYRXsJllTrm0wCIm56ENx0/C/i3FMp8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(211936372134217)(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(10201501046)(3002001); SRVR:SN1PR12MB0445; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0445; X-Forefront-PRVS: 07658B8EA3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(189002)(199003)(40100003)(50226001)(53416004)(97736004)(5001770100001)(5001920100001)(42186005)(189998001)(5003940100001)(36756003)(19580395003)(106356001)(19580405001)(105586002)(5008740100001)(2201001)(86362001)(66066001)(48376002)(50986999)(87976001)(586003)(5007970100001)(50466002)(5004730100002)(122386002)(6116002)(229853001)(92566002)(3846002)(77096005)(47776003)(101416001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0445; H:ssuthiku-fedora-lt.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0445; 23:MVG7m/0ybTdKNNjSYgXbhlJTHXtTFWsgFBMF7zF0r?= =?us-ascii?Q?n2fmAVJ+yukpLpbnlpAtmiW18af6+gGtNYS36qrg/O6KMhytny7s5LGf9T3X?= =?us-ascii?Q?l8lppSoEPHHYJxHKY+uoaPOl5QAiF9z/SD/fNi3AjkZmdxEiLWunxhGQqSwl?= =?us-ascii?Q?dljhQ4kQFU+mhj3Cw8NI5a/4ulaqvNuz4N8i/MiB6a03eLJWQrYq7ZLtHzF9?= =?us-ascii?Q?BOJ7o1GobpVb3iUOlE10dbzP47T2R9ixf45tlgheYsOYhTyxLUltiGnSRptm?= =?us-ascii?Q?BJqgM7eaqISrKzdF/H+mf1aeK+6NUFOmDeott28i6BtQAIvvT8o3kwek+Kdp?= =?us-ascii?Q?9SJHltoEnaOXwq2a9JuRBfo6H9c2o8ELr5HTx9m6UXuooeZfqITKLVhcoYbM?= =?us-ascii?Q?iecMlSg4zK2xLO/PrQt2TC4BjfGgs1SOZXHMJNMvtWpeVILbXTGJJEPwO08G?= =?us-ascii?Q?wEqbMeFqkDizbBfCTQbqcYlyWs7xVQrB/KKJr2Z32rI0D3gJujPxgVQlEl2o?= =?us-ascii?Q?+CdwWuqaszLHBfrvHE2G0re2ElQogF9quIlkyK5pMYOSK5GdNeJQ7VrE8rFb?= =?us-ascii?Q?S/lZh0fWwtpF+ByHq5kT+JEnAgn7nrD3aMS/iqgJZ/TlO1UrrlSUTKxpLQeO?= =?us-ascii?Q?S0AQ3s0iTpb2A2ehe9TpbE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) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0445 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 This patch fixes a bug introduced by previous commit, which incorrectly checkes the of_node of the end-point device. Instead, it should check the of_node of the host bridge. Fixes: 50230713b639 ("PCI: OF: Move of_pci_dma_configure() to pci_dma_configure()") Reported-by: Robin Murphy Cc: Rafael J. Wysocki Cc: Bjorn Helgaas Cc: Arnd Bergmann Signed-off-by: Suravee Suthikulpanit Acked-by: Arnd Bergmann --- drivers/pci/probe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index e735c72..edb1984 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1685,8 +1685,8 @@ static void pci_dma_configure(struct pci_dev *dev) { struct device *bridge = pci_get_host_bridge_device(dev); - if (IS_ENABLED(CONFIG_OF) && dev->dev.of_node) { - if (bridge->parent) + if (IS_ENABLED(CONFIG_OF) && + bridge->parent && bridge->parent->of_node) { of_dma_configure(&dev->dev, bridge->parent->of_node); } else if (has_acpi_companion(bridge)) { struct acpi_device *adev = to_acpi_device_node(bridge->fwnode);