From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 D3D65C4727D for ; Tue, 22 Sep 2020 21:13:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B6DD23600 for ; Tue, 22 Sep 2020 21:13:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="Eo9od3Yg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B6DD23600 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CE9A76E8EC; Tue, 22 Sep 2020 21:13:09 +0000 (UTC) Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9FF086E8EC for ; Tue, 22 Sep 2020 21:13:06 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 22 Sep 2020 14:12:18 -0700 Received: from [10.20.170.18] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 22 Sep 2020 21:12:54 +0000 Date: Tue, 22 Sep 2020 16:12:49 -0500 From: Alex Goins X-X-Sender: agoins@agoins-DiGiTS To: Marek Szyprowski Subject: Re: [PATCH v5 05/38] drm: prime: use sgtable iterators in drm_prime_sg_to_page_addr_arrays() In-Reply-To: Message-ID: References: <20200513132114.6046-1-m.szyprowski@samsung.com> <20200513133245.6408-1-m.szyprowski@samsung.com> <20200513133245.6408-5-m.szyprowski@samsung.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) X-NVConfidentiality: public MIME-Version: 1.0 X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1600809138; bh=eDw/Y+WvGisaFJLGeLDL1cgx4wGsvRwxMR3w6+tFJgE=; h=Date:From:X-X-Sender:To:CC:Subject:In-Reply-To:Message-ID: References:User-Agent:X-NVConfidentiality:MIME-Version: Content-Type:X-Originating-IP:X-ClientProxiedBy; b=Eo9od3YgFzrokUrlC+GkylUgaEM6H3/JoZ8VAsxxdIl9L1k7fmfTTeaMtcSVONyNe ugVp5jMHoqMBBnEgkhlJLszfUZYtSl8RQ5G3uRlXt7zoCgIY/0h6XX4FNuiH8Kb0S7 WyRCcKI/bgFvn3zgzEfYD2tAqDxNiPDV/Dq3tjbte0g6Nhf4/YhF6akfbfcy/Styf4 bUNbi2Zb7AFaWAuZBIsbRGocbT6iAy6lQbVA6v2eMw6KTlEKdB+PzvydytW5YeufYd t70q9gBMMRUD1C9tRuLLmMiYDa1OQo3J792HaY7U0hejkWFXmjlraDz1/kB/W6H1mV 4/CT5hDoP5xiQ== 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: Bartlomiej Zolnierkiewicz , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, iommu@lists.linux-foundation.org, Thomas Zimmermann , Robin Murphy , Christoph Hellwig , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Marek, On Tue, 22 Sep 2020, Marek Szyprowski wrote: > External email: Use caution opening links or attachments > > > Hi Alex, > > On 22.09.2020 01:15, Alex Goins wrote: > > Tested-by: Alex Goins > > > > This change fixes a regression with drm_prime_sg_to_page_addr_arrays() and > > AMDGPU in v5.9. > > Thanks for testing! > > > Commit 39913934 similarly revamped AMDGPU to use sgtable helper functions. When > > it changed from dma_map_sg_attrs() to dma_map_sgtable(), as a side effect it > > started correctly updating sgt->nents to the return value of dma_map_sg_attrs(). > > However, drm_prime_sg_to_page_addr_arrays() incorrectly uses sgt->nents to > > iterate over pages, rather than sgt->orig_nents, resulting in it now returning > > the incorrect number of pages on AMDGPU. > > > > I had written a patch that changes drm_prime_sg_to_page_addr_arrays() to use > > for_each_sgtable_sg() instead of for_each_sg(), iterating using sgt->orig_nents: > > > > - for_each_sg(sgt->sgl, sg, sgt->nents, count) { > > + for_each_sgtable_sg(sgt, sg, count) { > > > > This patch takes it further, but still has the effect of fixing the number of > > pages that drm_prime_sg_to_page_addr_arrays() returns. Something like this > > should be included in v5.9 to prevent a regression with AMDGPU. > > Probably the easiest way to handle a fix for v5.9 would be to simply > merge the latest version of this patch also to v5.9-rcX: > https://lore.kernel.org/dri-devel/20200904131711.12950-3-m.szyprowski@samsung.com/ Tested-by: Alex Goins that version too. > > This way we would get it fixed and avoid possible conflict in the -next. > Do you have any AMDGPU fixes for v5.9 in the queue? Maybe you can add that > patch to the queue? I don't have any more AMDGPU fixes, just want to ensure that this makes it in. Thanks, Alex > Dave: would it be okay that way? > > 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