Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2477195ybb; Mon, 30 Mar 2020 06:59:22 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtXyo7hC6sXRiFdL1DNdWhdum0+rt9jq7mOf9mPICF3MO1ldeeR9DfjBNGIdawADHG+RlnP X-Received: by 2002:a9d:3b5:: with SMTP id f50mr8780646otf.31.1585576762105; Mon, 30 Mar 2020 06:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585576762; cv=none; d=google.com; s=arc-20160816; b=wNnWZuVoFwxDVOVBGfwfJ4yaE1F3mhU8QfEDc/5ZICXaRofBew/GWI+Rjpd6lFrgWo qQLaY+mdl6FkOjDKpQUAH5k59FVCX/6bX8BburOtKcaM1sJhOpgGaX6NVUvrD4C1f5Xp kTAwEQjxnKJtLE2XGiVxY22doDtnCl2eNB+qVgk3XSC6eVRMt9xa0NQUcWlSiBzN1+Hc oLDaTrE9Cuir/C8SmvpSd1W4aN3UttV2RZQKOEQpkn+OTpBQxpuJO2EqOlErtCST6FEf L0kN+ll96YW1sGMNA/4RyX20vDchnPQVuzPMhwH9LtaB/rVHOuhsdPntvW6GjsavEb1X QXKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=CMTqMgwFG5tqJgidUd5oMEQh79mmBxijxw/tBJhZNas=; b=WcnUb2DgQ7CYfHYvtwsODW/NBBz0YUDoUnaxcT06q4lijnxz7Mypn/COmiy0Yf96Rs uyOQm2xgK3OPLN5LLTiMtx+C5SE2CHBFestxi4sGj8a/vtwF0Y5bkjJacwuCZbuQIPmj p1Ko1C+W/TL9qmhVWv0jaqCY+HABKW4jzjKDA21n4slyGenHUVaBRdZCodlNX5BBhWsp ViYk+UkCkiC2wFnVqBpT7fu7qTfjw9ABW/BdAaVYwtNQ3LxEJwbVGB5qOSQcMVr77QdH 9AA+3ieH+2xG+051Jyrr6iyKJEBLwrKgsJfqLjk0vqUYAo/tt2o/lcCFy6QL4G9bJy2v g5Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JtAcIcmB; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s139si5806716oih.7.2020.03.30.06.59.07; Mon, 30 Mar 2020 06:59:22 -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=@gmail.com header.s=20161025 header.b=JtAcIcmB; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730280AbgC3NYE (ORCPT + 99 others); Mon, 30 Mar 2020 09:24:04 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41796 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729976AbgC3NYE (ORCPT ); Mon, 30 Mar 2020 09:24:04 -0400 Received: by mail-wr1-f68.google.com with SMTP id h9so21578052wrc.8 for ; Mon, 30 Mar 2020 06:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=CMTqMgwFG5tqJgidUd5oMEQh79mmBxijxw/tBJhZNas=; b=JtAcIcmB49EOq2i+ns9besXPK/mGZS6KK9LFemRR2CTN49cBDzOLntZVbLq0ta0uPB GLOVL7Bhys+xD/vH09YvCqIbTZrZp6Au416K7VZ6Pg0vW/UoW71gGeJ1OxI6sq/9QMXn nNaZXhecWIucMDwCkq8Ld7iFzHdS7Q3CJ8+Q2USCatVuK9AWHVB2qkWQgb3vHsuBpb0K hMIXZ2Fjpu9Ec2pzWrY72V4jFd/zcXggm+jVbaCUrcFwiTZyWBuClUC38xAvhyrjbaHg Tk6mTK+xvpcROO/0LPkbH+nagJ0nQ/M2Qdcqbb4cHdSlYWtnl9RcDV7ErU7F02lUdT3C QwHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=CMTqMgwFG5tqJgidUd5oMEQh79mmBxijxw/tBJhZNas=; b=AyU0RO/BDc/QMuo6+wDwIdJbgjjBQjb2yrTG/Vk1I4rWIJlCco4fhMbvQTVR/AGIDn n+7sm7wFC5N7LdO5NpnHTzPGpcG0zUurj63tHJoH9C7ll9rN4zVii7xLRnyFXi5HuQZT cw/Bo7nMFy/2GimVy1NTTro1k0RrHzbkYWzpugfcsAutr2gHRoV2xgA1Fxp22CdT4H09 tlk44zIHWwWyYYQlMxIOsuWTyQmpw6t5oslOLgnpNVSyoXN1fkHaEX2nsYMqRCNgVDOi SlSXIF9pkYWGt5vbkICynJ6aBWup042fLKZR7rTAaBgjN1DbWn7ieT5D+gAl+9Oo960j kgYw== X-Gm-Message-State: ANhLgQ1lcufsj9mDd9FgYCTUe8vPZOVpemlGbKp+b/Ew9fA5ROHXr0+F sJttjylWQOBpzngOiiCUg0voetUeoh9YBxn0BhQ= X-Received: by 2002:a5d:6742:: with SMTP id l2mr15754494wrw.124.1585574641716; Mon, 30 Mar 2020 06:24:01 -0700 (PDT) MIME-Version: 1.0 References: <20200325090741.21957-2-bigbeeshane@gmail.com> <4aef60ff-d9e4-d3d0-1a28-8c2dc3b94271@samsung.com> <82df6735-1cf0-e31f-29cc-f7d07bdaf346@amd.com> In-Reply-To: From: Alex Deucher Date: Mon, 30 Mar 2020 09:23:50 -0400 Message-ID: Subject: Re: [v4,1/3] drm/prime: use dma length macro when mapping sg To: Marek Szyprowski 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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=C3=B6nig 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 =3D 0; > >>>> for_each_sg(sgt->sgl, sg, sgt->nents, count) { > >>>> - len =3D sg->length; > >>>> + len =3D sg_dma_len(sg); > >>>> page =3D sg_page(sg); > >>>> addr =3D 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. Alex > > Best regards > -- > Marek Szyprowski, PhD > Samsung R&D Institute Poland > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel