Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757211AbcLUFni (ORCPT ); Wed, 21 Dec 2016 00:43:38 -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 X-AuditID: cbfee61b-f79d86d00000197e-19-585a16857f72 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1105 Lines: 30 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 --- 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 { -- 2.7.4