From patchwork Wed Dec 21 05:44:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Dubey X-Patchwork-Id: 9482497 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 191A160772 for ; Wed, 21 Dec 2016 05:43:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0963B27FB3 for ; Wed, 21 Dec 2016 05:43:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F14B3280B0; Wed, 21 Dec 2016 05:43:39 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F97427FB3 for ; Wed, 21 Dec 2016 05:43:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756016AbcLUFng (ORCPT ); Wed, 21 Dec 2016 00:43:36 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:53038 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756663AbcLUFnf (ORCPT ); Wed, 21 Dec 2016 00:43:35 -0500 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OII01CE8T8F0LB0@mailout2.samsung.com>; Wed, 21 Dec 2016 14:43:33 +0900 (KST) X-AuditID: cbfee61b-f79d86d00000197e-19-585a16857f72 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 03.4C.06526.5861A585; Wed, 21 Dec 2016 14:43:33 +0900 (KST) Received: from pankaj.com ([107.108.83.125]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OII003R2T8DIF80@mmp1.samsung.com>; Wed, 21 Dec 2016 14:43:33 +0900 (KST) From: Pankaj Dubey To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: m.szyprowski@samsung.com, robh+dt@kernel.org, frowand.list@gmail.com, hans.verkuil@cisco.com, krzk@kernel.org, kgene@kernel.org, Smitha T Murthy , Pankaj Dubey Subject: [PATCH] of: reserved_mem: set dma_ops for devices using reserved mem Date: Wed, 21 Dec 2016 11:14:31 +0530 Message-id: <1482299071-22637-1-git-send-email-pankaj.dubey@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRmVeSWpSXmKPExsVy+t9jAd1WsagIg+mn9SzmHznHajHzzX82 iyU/dzFZ9D9+zWxx/vwGdovLu+awWcw4v4/JYu2Ru+wWi7Z+Ybdo3XuE3eLunm2MDtweU35v ZPXYOesuu8emVZ1sHn1bVjF6fN4kF8Aa5WaTkZqYklqkkJqXnJ+SmZduqxQa4qZroaSQl5ib aqsUoesbEqSkUJaYUwrkGRmgAQfnAPdgJX27BLeMX0/tCj5yVEy8cZilgXEnexcjJ4eEgInE qk8vWSFsMYkL99azdTFycQgJLGWUuHf2IyuE845R4vqOd2wgVWwCuhJP3s9lBrFFBBIlWu42 MoMUMQvcYJRY/GIx2FhhAV+Jf9segNksAqoSO3c8BWvgFfCQ+PpvGzPEOjmJm+c6mScwci9g ZFjFKJFakFxQnJSea5SXWq5XnJhbXJqXrpecn7uJERzMz6R3MB7e5X6IUYCDUYmH1yEjMkKI NbGsuDL3EKMEB7OSCK+MSFSEEG9KYmVValF+fFFpTmrxIUZToAMmMkuJJucDIy2vJN7QxNzE 3NjAwtzS0sRISZy3cfazcCGB9MSS1OzU1ILUIpg+Jg5OqQZG2YK5jrINgm/59i844Rsnss3j 2f4HLWs9Apf0G9WqvylViow13536MrLu77ncma0PH55Y/lTq0ZwjPO8ue0wrqAtvW6wXsL37 pj7now2Tgw38NgqEvJJhjFvm1n5eltE3J5zN1/FEvLK/IdMf4Ytzrz7VP/ilxEzo4Z15W278 7DvC/SxeaF61EktxRqKhFnNRcSIABFLN2XwCAAA= X-MTR: 20000000000000000@CPGS Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Smitha T Murthy For some IPs, there may be virtual child devices created and for them its necessary to set the dma_ops if it's using reserved memory else it will call the dummy dma_ops during buffer operations for the child devices which will lead to memory mapping failure. Signed-off-by: Smitha T Murthy Signed-off-by: Pankaj Dubey Acked-by: Marek Szyprowski --- drivers/of/of_reserved_mem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 366d8c3..d507c35 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -354,6 +354,10 @@ int of_reserved_mem_device_init_by_idx(struct device *dev, mutex_lock(&of_rmem_assigned_device_mutex); list_add(&rd->list, &of_rmem_assigned_device_list); mutex_unlock(&of_rmem_assigned_device_mutex); + /* ensure that dma_ops is set for virtual devices + * using reserved memory + */ + of_dma_configure(dev, np); dev_info(dev, "assigned reserved memory node %s\n", rmem->name); } else {