From patchwork Wed May 20 11:06:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 186976 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp499112ilb; Wed, 20 May 2020 04:06:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTIIsTvzGzeDVbv8pgK7JL7k+gnOaZTY5/VSkHoSzOiQBxXWgVRfYKD/35gDKwsGteaSTn X-Received: by 2002:a17:90a:cd02:: with SMTP id d2mr4675099pju.207.1589972805861; Wed, 20 May 2020 04:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589972805; cv=none; d=google.com; s=arc-20160816; b=Vzkzh7E9laxBbpVCROgsXvvKjmbbS2FO88cUduOslEOVC+DmfW0SsnV0QQbvNGU8bl zki8YZejuYzSYHbNhjGfL0fStmJr5AxVHgOu6zmdioT4rgSf86O9XlgLaUyivZG1q27u Shx8O+KsLaGScWvJZaneBhglFZNsIkhsdChqVjXYiHsWxixYB39bN4+ZbTRwbRu+5e+1 kHADj2UKxbADJwQ4pMBIZctWutt/mO1r1wHa5knT6hFJcWAd/DsrIC6KqAyuJI0+TwDt bGO2zuffdmk4hAzQ4+KePysbDvqlMQl4P9Kz+yVdHEdKLFlHAXFhRK832xNw7FeNHdNn FhQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:cms-type:message-id:date:subject:to :from:dkim-signature:dkim-filter:delivered-to; bh=bQsSlgLndql+CFgsveeB0vHG8glniCfU9QdOy+C6c7k=; b=zSsHiLBLAs0pFkhfABbvKLXoA5lopMO5G9cMsWPb0L+X4sxJlTmTQFa3I/jWIoPEjK tvJEzW5xa1/TkVDyKOkXDT6Fg1W9LuAOOHCx6/VTregp3bT563s4JNwl5YuWfmE6zlP+ Hv2a2iUaDdy9YfxHXtYtT4Ce3GWrThgFNg5I0Rigon27EkiNgye40nE9nAE5/JcNLdyH Xrwzwv8VukXjVeg0wnh//bIDSSD4ySeZ8rklQawgHSH5BxGuoQazqfJDNuOnEoBzk8aZ eSamGxqofpH16RkrfKmZbcDNPo3ElYb2sM3wkGa3Nv8QE/t+YOc/k+vupaLVNsqx2PUr +vFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=MDzF9iOX; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id z19si1770933pfg.294.2020.05.20.04.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 04:06:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=MDzF9iOX; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D3746E13F; Wed, 20 May 2020 11:06:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id EAC0B6E13F for ; Wed, 20 May 2020 11:06:41 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200520110639euoutp01eb5f66c16c290f628e8c438ef631ba16~Qt9ZnhnGx0969909699euoutp013 for ; Wed, 20 May 2020 11:06:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200520110639euoutp01eb5f66c16c290f628e8c438ef631ba16~Qt9ZnhnGx0969909699euoutp013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1589972799; bh=XYYLvuirlx2iYlHmL4T+w8ygTONp7ydAWbttHA716H8=; h=From:To:Cc:Subject:Date:References:From; b=MDzF9iOX3FYUy5AVsZoOSc2dnCGzl7XHajIngaFU7j7StIRCrTTmpbnre58sf0oLv ns2GgDBissE5K4gY/93i8/ghfWf0NMt2wFUlMvqONE4/QUQ4BiV1Du6EMuNpftdHdo iF0jiK/A5qIp604eUbOH7ll/Vmt7ZKiwSYZXoVeA= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200520110639eucas1p2834bfb96b03bcf641a71a1963fcaad0a~Qt9Yys7z62609526095eucas1p2B; Wed, 20 May 2020 11:06:39 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id B2.47.60679.E3F05CE5; Wed, 20 May 2020 12:06:38 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200520110638eucas1p1d92eb5d669f195d2124ce93d9789850e~Qt9YZ6kz-1950319503eucas1p1f; Wed, 20 May 2020 11:06:38 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200520110638eusmtrp1d65230e218ad13ae5a7c1f38d9e6b407~Qt9YZTmke1958119581eusmtrp1Z; Wed, 20 May 2020 11:06:38 +0000 (GMT) X-AuditID: cbfec7f4-0e5ff7000001ed07-30-5ec50f3ebc18 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id AB.DA.07950.E3F05CE5; Wed, 20 May 2020 12:06:38 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200520110638eusmtip2bf5f64479691f3d16221df354e7fb320~Qt9YBPsVo1552115521eusmtip2K; Wed, 20 May 2020 11:06:38 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH] drm/exynos: Fix dma_parms allocation Date: Wed, 20 May 2020 13:06:32 +0200 Message-Id: <20200520110632.30780-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKIsWRmVeSWpSXmKPExsWy7djP87p2/EfjDNYfsLa4te4cq8XGGetZ La58fc9mMen+BBaLGef3MVmsPXKX3WLG5JdsDuwe97uPM3n0bVnF6PF5k1wAcxSXTUpqTmZZ apG+XQJXxtu9n9gKdglWTPl9mrGB8SZfFyMHh4SAicSDlYVdjFwcQgIrGCV+3T7GCuF8YZTY 3PgKyvnMKLGo/TVjFyMnWEd/9zM2iMRyRomVm/YzwbVsXbGSCaSKTcBQouttFxuILSLgJtF0 eCbYKGaB64wS334sYgdJCAuYSvRv+cQIcgiLgKrEnD/MIGFeAVuJYw3bmSG2yUus3nCAGaRX QuAEm8TDmxegEi4Se9v/skHYwhKvjm9hh7BlJE5P7mGBaGhmlHh4bi07hNPDKHG5aQbUE9YS d879YgPZzCygKbF+lz5E2FHi4bF/TJCQ4ZO48VYQJMwMZE7aNp0ZIswr0dEmBFGtJjHr+Dq4 tQcvXII6zUOidcZ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xpmNrRGrXS1WJa1wyzGZPc9PKfbQ3MjepVEKlk77w/dZELh2Hf+QnH9nLFezec eMU4ZV9Yo7n6payrz3Z1J7zv35Av13bV67Bh99MAJZbijERDLeai4kQAfrfDJk4CAAA= X-CMS-MailID: 20200520110638eucas1p1d92eb5d669f195d2124ce93d9789850e X-Msg-Generator: CA X-RootMTR: 20200520110638eucas1p1d92eb5d669f195d2124ce93d9789850e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200520110638eucas1p1d92eb5d669f195d2124ce93d9789850e References: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Marek Szyprowski MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Since commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices") driver core handles allocation of the dma_parms structure for platform device, so there is no need to manually allocate nor free it. Reported-by: Tomi Valkeinen Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_dma.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) -- 1.9.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel Reported-by: kbuild test robot diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c b/drivers/gpu/drm/exynos/exynos_drm_dma.c index 619f814..3d59800 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dma.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c @@ -31,23 +31,6 @@ #define EXYNOS_DEV_ADDR_START 0x20000000 #define EXYNOS_DEV_ADDR_SIZE 0x40000000 -static inline int configure_dma_max_seg_size(struct device *dev) -{ - if (!dev->dma_parms) - dev->dma_parms = kzalloc(sizeof(*dev->dma_parms), GFP_KERNEL); - if (!dev->dma_parms) - return -ENOMEM; - - dma_set_max_seg_size(dev, DMA_BIT_MASK(32)); - return 0; -} - -static inline void clear_dma_max_seg_size(struct device *dev) -{ - kfree(dev->dma_parms); - dev->dma_parms = NULL; -} - /* * drm_iommu_attach_device- attach device to iommu mapping * @@ -69,10 +52,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev, return -EINVAL; } - ret = configure_dma_max_seg_size(subdrv_dev); - if (ret) - return ret; - + dma_set_max_seg_size(subdrv_dev, DMA_BIT_MASK(32)); if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)) { /* * Keep the original DMA mapping of the sub-device and @@ -89,9 +69,6 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev, ret = iommu_attach_device(priv->mapping, subdrv_dev); } - if (ret) - clear_dma_max_seg_size(subdrv_dev); - return 0; } @@ -114,8 +91,6 @@ static void drm_iommu_detach_device(struct drm_device *drm_dev, arm_iommu_attach_device(subdrv_dev, *dma_priv); } else if (IS_ENABLED(CONFIG_IOMMU_DMA)) iommu_detach_device(priv->mapping, subdrv_dev); - - clear_dma_max_seg_size(subdrv_dev); } int exynos_drm_register_dma(struct drm_device *drm, struct device *dev,