Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3149671ybb; Mon, 30 Mar 2020 22:26:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsao4odgkqIvB97EDcZ9vGcGqIF0qNKZr7ojZzpsh7+QU1MvERS/QyMYoudfssvRzzFpVCm X-Received: by 2002:a4a:a88a:: with SMTP id q10mr12172380oom.17.1585632410392; Mon, 30 Mar 2020 22:26:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585632410; cv=none; d=google.com; s=arc-20160816; b=BZA0j1DB/ii3cfcVD3qCjXP+0nrdsYJ1kUZQAd4kLxVh+YCVK0eN+moikQ/BhVRmXO HC5gua8KIY75hRI9xEuoC0HeF8LHHlJceLDudPxb/RDzYGT0kTZQtmMXEUbuCsaSxQjk EMjxWtSSDrHm6g05jqjJ/+wkRCx6VLXNKD3Nj7WmoGybFAEC85SrRTYerfWGTE7VCb2J WbYNOCfosw+A3oJdUx8iqXe6U225xNriMAQYslTxPTzJlLNhO2b0qP8c4Do7Ppf/R5i2 eE+SjqmEok/XjekK+eB/GDwSHGu3IQe75dMXdAsfOEYmNlRS2b1kZ1aYo1zB/u7ZiqD8 HFVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=bxin13ZKuOM8u8O8i3qTxcRZcgLrefdmNLGj7iJHNdY=; b=d7mH9fCBHFQlsv2Afz6LFGS7s8AVLSL0dhOx59T/j736o9UVdELHqTd83RZjr85cfm Dg5ujLUDj/IyJVQ/uAP9DrtzyhFh2EKZsKFm2utZEkBImMrVNk+h0WQCVDFp0tIoyun7 92fkM+OjLgr3KZ9bViJTvAD4mqA0/geRv2iEfL93wdsgy2XpQ6RuVS4APDniKEEq8KnE ATmrbYA9QttPwmiYgpjkgKj4XVdSxn2SRGLqhLqoe3OtcnyFzHzqNCimIhPynZy+WZo4 w0I2qglGo4ZiExPsOEEjpOJY3KKuZHxpODROM0AUp8cUwVK34+dHIoB5BfRU+I39NY9b 0xww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=kHHex9Xf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si6810285oou.47.2020.03.30.22.26.37; Mon, 30 Mar 2020 22:26:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=kHHex9Xf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726236AbgCaFZ6 (ORCPT + 99 others); Tue, 31 Mar 2020 01:25:58 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:51450 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725809AbgCaFZ5 (ORCPT ); Tue, 31 Mar 2020 01:25:57 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200331052555euoutp0232c1fa837f56b67a1b591784f5223a21~BTDn4mKny1197211972euoutp02D for ; Tue, 31 Mar 2020 05:25:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200331052555euoutp0232c1fa837f56b67a1b591784f5223a21~BTDn4mKny1197211972euoutp02D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1585632355; bh=bxin13ZKuOM8u8O8i3qTxcRZcgLrefdmNLGj7iJHNdY=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=kHHex9Xf3yjMXTEGVMqVtWhm1bOcMYTTTPDoAtX8eqeSpGELjfUvnuYo4nOQLikEH gzPDl9uSyMSPaYCwwaEVn37GzjP4d7k4xuCKLz+b90jCYPsvdJbm/jCdKxDyKFA9Z7 IGIJA4hjo+GdBFeemud8CwWosA4NQQZrzJCcS+xY= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200331052555eucas1p11806bcd25402c052d63b6bd00e87771d~BTDntTJcq2193321933eucas1p1W; Tue, 31 Mar 2020 05:25:55 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 3C.96.61286.364D28E5; Tue, 31 Mar 2020 06:25:55 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200331052555eucas1p28e4c454f5fcd33457798f6d4b85220d1~BTDnVY7rC2534025340eucas1p2K; Tue, 31 Mar 2020 05:25:55 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200331052555eusmtrp1ba37869771f488e7696c1ccc827b8c1a~BTDnUsVzN0739607396eusmtrp18; Tue, 31 Mar 2020 05:25:55 +0000 (GMT) X-AuditID: cbfec7f2-ef1ff7000001ef66-ee-5e82d46348e1 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id D0.07.08375.264D28E5; Tue, 31 Mar 2020 06:25:55 +0100 (BST) Received: from [106.210.88.143] (unknown [106.210.88.143]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200331052554eusmtip2467d68d39da6150963074cae38eafd67~BTDm1pL_L0092300923eusmtip2g; Tue, 31 Mar 2020 05:25:54 +0000 (GMT) Subject: Re: [v4,1/3] drm/prime: use dma length macro when mapping sg To: Alex Deucher Cc: =?UTF-8?Q?Christian_K=c3=b6nig?= , Shane Francis , Maling list - DRI developers , Dave Airlie , "Deucher, Alexander" , LKML , amd-gfx-request@lists.freedesktop.org From: Marek Szyprowski Message-ID: <3a0cb2bc-84be-6f9f-a0e8-ecb653026301@samsung.com> Date: Tue, 31 Mar 2020 07:25:52 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAKsWRmVeSWpSXmKPExsWy7djP87rJV5riDM63SFv0njvJZDHtzm5W izt/ZrFbrPt3k8WicWcfk8Xb+0CxK1/fs1lc3jWHzYHDo/XSXzaPnbPusnts//aA1eN+93Em j8+b5AJYo7hsUlJzMstSi/TtErgyDs7ayF6wQbhi8f9nzA2MR/i7GDk4JARMJO6v8eli5OIQ EljBKLG8/zELhPOFUWL1vW+sEM5nRoneXx+Yuxg5wTpe/13NBpFYzihx6Xw3lPOeUeLt7wXs IFXCAq4SO5taGUF2iAhoSKz/AraDWeAMk8S1Q5PBatgEDCW63naxgdi8AnYS02Y+BouzCKhK tDcuA7NFBWIkLh7uZ4WoEZQ4OfMJC4jNKRAo8fPLGrA4s4C8RPPW2cwQtrjErSfzmUCWSQhs Y5c492wmI8TZLhJ7/m5lgrCFJV4d38IOYctInJ7cwwLR0Mwo8fDcWnYIp4dR4nLTDKhua4k7 536xgbzDLKApsX6XPkTYUeLZlZPMkJDkk7jxVhDiCD6JSdumQ4V5JTrahCCq1SRmHV8Ht/bg hUvMExiVZiF5bRa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DU6qBkTfUfX/TWvPoY6EfXvDy7/4Q5nrM8q7TDt4f OgedD3NyN+sE3H14V9hVNfvprINN1s6vjeaLTp9ic/RXrKbSV/twQZH6ekV11Y0/tN0VSwpZ JRMOF6ycc8F5uUXepMLut4euF4j8ytkvEH//g7av7tzIxILmEmY371mr/j2Tkr5tmLQhVsRc iaU4I9FQi7moOBEAjHl1W9YCAAA= X-CMS-MailID: 20200331052555eucas1p28e4c454f5fcd33457798f6d4b85220d1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200327075458eucas1p2f1011560c5d2d2a754d2394f56367ebb X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200327075458eucas1p2f1011560c5d2d2a754d2394f56367ebb References: <20200325090741.21957-2-bigbeeshane@gmail.com> <4aef60ff-d9e4-d3d0-1a28-8c2dc3b94271@samsung.com> <82df6735-1cf0-e31f-29cc-f7d07bdaf346@amd.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex, On 2020-03-30 15:23, Alex Deucher wrote: > On Mon, Mar 30, 2020 at 4:18 AM Marek Szyprowski > wrote: >> Hi >> >> On 2020-03-27 10:10, Marek Szyprowski wrote: >>> Hi Christian, >>> >>> On 2020-03-27 09:11, Christian König wrote: >>>> Am 27.03.20 um 08:54 schrieb Marek Szyprowski: >>>>> On 2020-03-25 10:07, Shane Francis wrote: >>>>>> As dma_map_sg can reorganize scatter-gather lists in a >>>>>> way that can cause some later segments to be empty we should >>>>>> always use the sg_dma_len macro to fetch the actual length. >>>>>> >>>>>> This could now be 0 and not need to be mapped to a page or >>>>>> address array >>>>>> >>>>>> Signed-off-by: Shane Francis >>>>>> Reviewed-by: Michael J. Ruhl >>>>> This patch landed in linux-next 20200326 and it causes a kernel >>>>> panic on >>>>> various Exynos SoC based boards. >>>>>> --- >>>>>> drivers/gpu/drm/drm_prime.c | 2 +- >>>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>>> >>>>>> diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c >>>>>> index 86d9b0e45c8c..1de2cde2277c 100644 >>>>>> --- a/drivers/gpu/drm/drm_prime.c >>>>>> +++ b/drivers/gpu/drm/drm_prime.c >>>>>> @@ -967,7 +967,7 @@ int drm_prime_sg_to_page_addr_arrays(struct >>>>>> sg_table *sgt, struct page **pages, >>>>>> index = 0; >>>>>> for_each_sg(sgt->sgl, sg, sgt->nents, count) { >>>>>> - len = sg->length; >>>>>> + len = sg_dma_len(sg); >>>>>> page = sg_page(sg); >>>>>> addr = sg_dma_address(sg); >>>>> Sorry, but this code is wrong :( >>>> Well it is at least better than before because it makes most drivers >>>> work correctly again. >>> Well, I'm not sure that a half-broken fix should be considered as a >>> fix ;) >>> >>> Anyway, I just got the comment from Shane, that my patch is fixing the >>> issues with amdgpu and radeon, while still working fine for exynos, so >>> it is indeed a proper fix. >> Today I've noticed that this patch went to final v5.6 without even a day >> of testing in linux-next, so v5.6 is broken on Exynos and probably a few >> other ARM archs, which rely on the drm_prime_sg_to_page_addr_arrays >> function. > Please commit your patch and cc stable. I've already did that: https://lkml.org/lkml/2020/3/27/555 Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland