From patchwork Thu May 28 14:03:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 213339 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 026F4C433DF for ; Thu, 28 May 2020 14:03:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C41452084C for ; Thu, 28 May 2020 14:03:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="XecfCbPH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390801AbgE1ODl (ORCPT ); Thu, 28 May 2020 10:03:41 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:47293 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390540AbgE1ODj (ORCPT ); Thu, 28 May 2020 10:03:39 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200528140337euoutp02897029067b8a73ac45708f6f80004b28~TNiMjbqIX1355913559euoutp02A for ; Thu, 28 May 2020 14:03:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200528140337euoutp02897029067b8a73ac45708f6f80004b28~TNiMjbqIX1355913559euoutp02A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1590674617; bh=BoBpzWtQk0bQcFWn1Zb2vxzp/8/yk26E0UGKv9aCJSo=; h=From:To:Cc:Subject:Date:References:From; b=XecfCbPHF5bLQNxvT6fZyIUa+UszSUKVUIXwvi/J5NwPW5oHsuuuYzF7aVIxgHC9+ y6h4VzR0akHuJa0Y0nFlK+cdnvn4HNShF+GqUqN20cd9qKbTfXqVhJQJbCajRRwggi n2tSsJ1DCNhMAsacYelPdgAuercBy6N49WmFX4bQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200528140337eucas1p19cd023d3486e172d7496c49f21dd7f0e~TNiMPY7tb1292012920eucas1p1K; Thu, 28 May 2020 14:03:37 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 1E.6F.60679.9B4CFCE5; Thu, 28 May 2020 15:03:37 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200528140337eucas1p2499a623f10d9bedf568f3a9bf55320f7~TNiL7ONs93205532055eucas1p2a; Thu, 28 May 2020 14:03:37 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200528140337eusmtrp1ba85f890c39986f4c037b6f1d4bdcf79~TNiL6k3I40180301803eusmtrp1m; Thu, 28 May 2020 14:03:37 +0000 (GMT) X-AuditID: cbfec7f4-0cbff7000001ed07-53-5ecfc4b929a2 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 51.C1.07950.9B4CFCE5; Thu, 28 May 2020 15:03:37 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200528140336eusmtip2fdcb6bfbd262b20784ff45201ae2a627~TNiLfEGfU2018020180eusmtip2k; Thu, 28 May 2020 14:03:36 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Tomi Valkeinen , Ulf Hansson Subject: [PATCH] media: s5p-mfc: Properly handle dma_parms for the allocated devices Date: Thu, 28 May 2020 16:03:26 +0200 Message-Id: <20200528140326.5215-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFIsWRmVeSWpSXmKPExsWy7djPc7o7j5yPM5jZq2hxa905VoueDVtZ LWac38dksfbIXXaLw2/aWS3Wz7/FZnF8bbgDu8eda3vYPPq2rGL0OH5jO5PH501yASxRXDYp qTmZZalF+nYJXBlHDzxnKvjAUzH17Eb2BsYvXF2MnBwSAiYSPyZtYgaxhQRWMErMe+DXxcgF ZH9hlJjbuJoNwvnMKHHi7HMmmI6vf6ewQiSWM0o0zH/DDNeybv4RVpAqNgFDia63XWwgtoiA k8TCWX/ZQYqYBS4zSlzf94wdJCEsECbx4/QcFhCbRUBV4taTT2AreAVsJM7O28QKsU5eYvWG A2AbJATOsEm0XHjMDpFwkTj//TbUTcISr45vgYrLSJye3MMC0dDMKPHw3Fp2CKeHUeJy0wxG iCpriTvnfgHdxwF0k6bE+l36EGFHiQVn97CDhCUE+CRuvBUECTMDmZO2TWeGCPNKdLQJQVSr Scw6vg5u7cELl5ghbA+Jzg//mSCBGiuxddlF5gmMcrMQdi1gZFzFKJ5aWpybnlpslJdarlec mFtcmpeul5yfu4kRmAJO/zv+ZQfjrj9JhxgFOBiVeHg3zDwfJ8SaWFZcmXuIUYKDWUmE1+ns 6Tgh3pTEyqrUovz4otKc1OJDjNIcLErivMaLXsYKCaQnlqRmp6YWpBbBZJk4OKUaGAN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ator: CA X-RootMTR: 20200528140337eucas1p2499a623f10d9bedf568f3a9bf55320f7 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200528140337eucas1p2499a623f10d9bedf568f3a9bf55320f7 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices") in v5.7-rc5 added allocation of dma_parms structure to all platform devices. Then vb2_dma_contig_set_max_seg_size() have been changed not to allocate dma_parms structure and rely on the one allocated by the device core. Lets allocate the needed structure also for the devices created for the 2 MFC device memory ports. Reported-by: Tomi Valkeinen Suggested-by: Ulf Hansson Fixes: 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices") Signed-off-by: Marek Szyprowski --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 5c2a23b953a4..eba2b9f040df 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1089,6 +1089,10 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev, child->coherent_dma_mask = dev->coherent_dma_mask; child->dma_mask = dev->dma_mask; child->release = s5p_mfc_memdev_release; + child->dma_parms = devm_kzalloc(dev, sizeof(*child->dma_parms), + GFP_KERNEL); + if (!child->dma_parms) + goto err; /* * The memdevs are not proper OF platform devices, so in order for them @@ -1104,7 +1108,7 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev, return child; device_del(child); } - +err: put_device(child); return NULL; }