Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp645546ybb; Wed, 25 Mar 2020 07:01:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvQzfvRK3IbV7YZkgZXF5PUHGYDIslRRtTuHTfi0pMjhNPEHQ85BP735weaXHfIjYipvjEH X-Received: by 2002:aca:a857:: with SMTP id r84mr2560591oie.65.1585144873350; Wed, 25 Mar 2020 07:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585144873; cv=none; d=google.com; s=arc-20160816; b=EwBSJi2ak7jspGYt2H90wsQRm5oN0bgypVhJ/fA2Q1DecHi7sFJR89iyKGjA/I8sit sEIHG2tLn4suma+aTuHf/6x0FceMlu3IdR4qiQMumBitQZRcuvc8ugkAvdp1cxDRwM/D xY3haFdWSjKgepvNMoNuRxMvCyt6U5sdgDpS+pddTVARLonhdqYGMFp2ulNNe17ozNxb G4PRDap4TyIV68pgCA3jkOKtQV8rW3/iw76+Ye4OtfmIXhJuqInBA5zohBeDeBFfImle 1a5l4w29OkkHW9xzMm9HH3yKI0+D2hjLJ43rwXpVkc5fTMEfv42mwntXts2S1WVGiVK8 7w9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=X0jl3LYOCnIKPaG2fpZ7fWN276mQDCKvTqRVjZ3FeZM=; b=Bvy5GikWq79Lj40Z0ZlD7P4GWXK3vQZRDmYWmXdMX3Bwb5zwDA8aie0gqvpoblbxlh jIxbs3nGblTMvNBDrAHezmGzf7xxxIQGwEKlKYNXaHjFsXHWJkd+KH959HbVgooPvg/j Jkx3SItcCeNQkoPZzUqwyl3v7RsoirsMnve9L/ZEtZycUKxp4DUMZLTG3PT08O/CcpwK uQ+uH51bOMKRYC+YKl4lUMbW+Yg25xdjsu31tCHQeuft7LpAhfpCb8alnwFg9CY1aHTq ET/IxuJP3CS/Ama4Lcilvbhzeas7HSKwDBVFUVaaP6sgrjSsov8kS5gJvyX6M3RDI9uI LKgA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si849376ook.91.2020.03.25.07.00.55; Wed, 25 Mar 2020 07:01:13 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727487AbgCYOA0 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 25 Mar 2020 10:00:26 -0400 Received: from mga18.intel.com ([134.134.136.126]:5496 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727394AbgCYOA0 (ORCPT ); Wed, 25 Mar 2020 10:00:26 -0400 IronPort-SDR: y8CTny0LC/V1noKToXyYmjlSRkjEWBCa8R9UyHHRDrsTg6H4pJD9E2pMDkdVBOVEFV2LhrUVDz C+pV3Pn3MXKw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 07:00:25 -0700 IronPort-SDR: EEp2Qq4JWbGjMbstSwM05aCaqBYkmtYJKSZCLXvQSF1cFKau87tiqI/8VXmeFP2pQCpZ5BbU8b N5MABNnXAMLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="247181286" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 25 Mar 2020 07:00:25 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Mar 2020 07:00:24 -0700 Received: from fmsmsx107.amr.corp.intel.com ([169.254.6.38]) by fmsmsx124.amr.corp.intel.com ([169.254.8.220]) with mapi id 14.03.0439.000; Wed, 25 Mar 2020 07:00:24 -0700 From: "Ruhl, Michael J" To: Shane Francis , "dri-devel@lists.freedesktop.org" CC: "airlied@linux.ie" , "linux-kernel@vger.kernel.org" , "amd-gfx-request@lists.freedesktop.org" , "alexander.deucher@amd.com" , "christian.koenig@amd.com" Subject: RE: [PATCH v4 2/3] drm/amdgpu: fix scatter-gather mapping with user pages Thread-Topic: [PATCH v4 2/3] drm/amdgpu: fix scatter-gather mapping with user pages Thread-Index: AQHWAoURGp10wyvAFUutB03QxzFyZahZVeWw Date: Wed, 25 Mar 2020 14:00:24 +0000 Message-ID: <14063C7AD467DE4B82DEDB5C278E8663FFFBD444@fmsmsx107.amr.corp.intel.com> References: <20200325090741.21957-1-bigbeeshane@gmail.com> <20200325090741.21957-3-bigbeeshane@gmail.com> In-Reply-To: <20200325090741.21957-3-bigbeeshane@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >-----Original Message----- >From: dri-devel On Behalf Of >Shane Francis >Sent: Wednesday, March 25, 2020 5:08 AM >To: dri-devel@lists.freedesktop.org >Cc: airlied@linux.ie; linux-kernel@vger.kernel.org; bigbeeshane@gmail.com; >amd-gfx-request@lists.freedesktop.org; alexander.deucher@amd.com; >christian.koenig@amd.com >Subject: [PATCH v4 2/3] drm/amdgpu: fix scatter-gather mapping with user >pages > >Calls to dma_map_sg may return segments / entries than requested "may return less segments/entries" ? ^^^ >if they fall on page bounderies. The old implementation did not >support this use case. > >Signed-off-by: Shane Francis >--- > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c >b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c >index dee446278417..c6e9885c071f 100644 >--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c >+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c >@@ -974,7 +974,7 @@ static int amdgpu_ttm_tt_pin_userptr(struct ttm_tt >*ttm) > /* Map SG to device */ > r = -ENOMEM; > nents = dma_map_sg(adev->dev, ttm->sg->sgl, ttm->sg->nents, >direction); >- if (nents != ttm->sg->nents) >+ if (nents == 0) > goto release_sg; this looks correct to me. Reviewed-by: Michael J. Ruhl > /* convert SG to linear array of pages and dma addresses */ >-- >2.26.0 > >_______________________________________________ >dri-devel mailing list >dri-devel@lists.freedesktop.org >https://lists.freedesktop.org/mailman/listinfo/dri-devel