Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp352888ybb; Sat, 28 Mar 2020 00:18:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtCbWFuQUiL+rUmXL8ndS6SJdUrFWh3fHAJjPbdpvjbCYbUgaV7jExmpkD1CUbBoZkjU41V X-Received: by 2002:aca:56cd:: with SMTP id k196mr1750410oib.85.1585379939685; Sat, 28 Mar 2020 00:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585379939; cv=none; d=google.com; s=arc-20160816; b=mVZsOnPDohVvyF9xzeQ8dkCB4QeSOHtpZC8xjb5ePjxjR/4natzcJqmpWUzcF1yafw JRZAxs3YtYew4mD1HdzMJ9eI/bOnKG1zuWgFk8QKBJssV93v8yCnBCQL5GJkiVcpv9l3 JLmdZXxtSFZjIlSjI3HKmI6uBlIfx35OI16aMNHf75eeYbSBp02rx3o35gTkOQhNZXLk R93iJ31/wcW57+HzVm3c3/epEl1SkNSD6mLk3PnPo+DiTno8H9ju4aT9DKd5CmOsq7DB iGOc2EnFN2LnGg/ibiMM1L4U81UDAUUZ8nZcAkMDVKf9th8GyZeMM5nf9qESQhR2eAdm Dn2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=rZJPKsnnFp/RagyMxYKzCRpBY0/sF+L0HVd6yCNH43A=; b=kutY9AndEvXBtgjPGyso5KJp6ZJJJS8r8FOSE3Gk9GGvpAmOr4w9WWUQcXsPBrfyrR EtDaNoELe7yiCnvElM2LkyiQ1waTzCq1UQgnIAxEqUXbM/UBepFN/jaR7yApT5rTz3Ao VU6+RpwN8I2RQwid+WrVVyzSzxLe2cgbidFOtVtbJds3qD7g8/zXxBKF/JWZ7m86o39x kcGSSww+RRf3NVgL8xBouNRPcnOsALhM5DPVi1hlTFMbayHoQ4+Zhbmm/zAuWjhY49HR n05i+TcW0uYWKbpJPheeL++khJooKFQDvipo4XqutMLiFtxWTeO3/v4c9wgXns3U6DnK 7Tww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zbkUekwS; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h59si3315302oth.233.2020.03.28.00.18.45; Sat, 28 Mar 2020 00:18:59 -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=@kernel.org header.s=default header.b=zbkUekwS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726088AbgC1HSb (ORCPT + 99 others); Sat, 28 Mar 2020 03:18:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:59782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725372AbgC1HSb (ORCPT ); Sat, 28 Mar 2020 03:18:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 127DB20716; Sat, 28 Mar 2020 07:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585379910; bh=fopRQnzfuZZmkeKyFYK+9X+U66QuYhhnOGDinwvF0D0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zbkUekwSZrpAyJ+cqSsFaNK7G+QRKY3ESZtvptrtyX0IUtb2UiG5fWiXHB9bjOgEA R0ApSP9Rui4R8co+SrOXQMxxdiBtrwx8V8EJ2viXLCJE6zu2B7KrbHj2LJ3BB8o/06 vvPzTbPm7pHKn0UhY8wZ20FdRhpCxarV8+nipG5M= Date: Sat, 28 Mar 2020 08:18:27 +0100 From: Greg KH To: Marek Szyprowski Cc: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Bartlomiej Zolnierkiewicz , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Alex Deucher , Shane Francis , "Michael J . Ruhl" Subject: Re: [PATCH v2] drm/prime: fix extracting of the DMA addresses from a scatterlist Message-ID: <20200328071827.GA3648919@kroah.com> References: <20200327162126.29705-1-m.szyprowski@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200327162126.29705-1-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 27, 2020 at 05:21:26PM +0100, Marek Szyprowski wrote: > Scatterlist elements contains both pages and DMA addresses, but one > should not assume 1:1 relation between them. The sg->length is the size > of the physical memory chunk described by the sg->page, while > sg_dma_len(sg) is the size of the DMA (IO virtual) chunk described by > the sg_dma_address(sg). > > The proper way of extracting both: pages and DMA addresses of the whole > buffer described by a scatterlist it to iterate independently over the > sg->pages/sg->length and sg_dma_address(sg)/sg_dma_len(sg) entries. > > Fixes: 42e67b479eab ("drm/prime: use dma length macro when mapping sg") > Signed-off-by: Marek Szyprowski > Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/drm_prime.c | 37 +++++++++++++++++++++++++------------ > 1 file changed, 25 insertions(+), 12 deletions(-) This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.