Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp831132imu; Tue, 27 Nov 2018 23:40:31 -0800 (PST) X-Google-Smtp-Source: AJdET5cjOw16KGVuUUJtIyhcbMIqvUW7sg5RF4f9gJ9InKZgP8GQ4BnArxbLpdY09ZrBAI2J6cFh X-Received: by 2002:a63:4706:: with SMTP id u6mr30693275pga.95.1543390831825; Tue, 27 Nov 2018 23:40:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543390831; cv=none; d=google.com; s=arc-20160816; b=n0FHGw9ksMd+kf6/oBp2D6+VNJhTpgFAdeOnZUnrPEmI5h8rISQXlXtBsACpkhrrvS PUaW2rsNwXDssFuQX09PJvaw98cyeO/lbN6icUdou5SKl2tAOCWomphsezkCwNqZ7afl dCk7PMs39DxEE8fkj6M/+tcOicgR4bUM11naG5IHF5fWkvuW2Jq9hFg4L7ILINeueGIN niYKZJ2Vyt0g0cAuexjeTjpUslfnVXIfa4Ze7JUMLRcmHLkCUMgWZjU8xO3QtwBXFI64 uktGZlJsbbLWHs99M9vfoMC/y9xibbJAGekBcAdTD7gOhSiTDlcH+SZKIC4JYt7EM8rA kxlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ErAFqOvgcD85IUXCMoZh61H8AXDyZEZHHutRK7/9vn4=; b=ywiQ8K/k4qwupz1Jt+0lJSdndcP5Z+semmRpjFA9NtutG8S+hV7nW432LqLw4VXG02 AKB1kToOvsx+HBKnvuOjn0N2Xo/tVTXbwayAY8wEwtYBPi+G3UAD2j/kLfEKvSe7C4Lw DpwjffR6SNSySj48TxOjpk9YddzsJOyd/E9WaJpmOSgIHUykXv22jyj3L5KU6d/VxjCV pT6yFPPS+GOQH9EJNXN4JBiweKdIjcX0ued7ttDC54wia4jzXKSOUBA0Q+s3fUjBJYaL yHoozfGWtyYRasnLM+OUrMw//xej8T/k0GDu3u/x8cKoOvXjH3BLcxaoV92B1LoW6xW2 LuQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gRkJj9Bn; 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 z19si7365635pfc.95.2018.11.27.23.40.16; Tue, 27 Nov 2018 23:40:31 -0800 (PST) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gRkJj9Bn; 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 S1727486AbeK1SkX (ORCPT + 99 others); Wed, 28 Nov 2018 13:40:23 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:43696 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727230AbeK1SkX (ORCPT ); Wed, 28 Nov 2018 13:40:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ErAFqOvgcD85IUXCMoZh61H8AXDyZEZHHutRK7/9vn4=; b=gRkJj9BnQlXoVv7Ew0C1fAYJ1 11NO5eEToraV2ok46bMdatF6gTXbZneXKnmAsZ7aAk/IZPuzg3WKKMY0qr6A8vdjtxSxaAO/6irxK aFP7Q26uAn0gqHKiFV9x8NslWlOcYuvz4XxT5QYSCNPfmZ6TBklHzQOm397N4P+0/kf7K4nnsf0Vw mVmRPKH8gctm145RBQgBvMK/pFJxRIStJI1kQNSFPwrKMRmfkS0yaf6lF50XxO196qM4ArUqUxX3K MmAMaxdSNj/ys+7jMgvYwYn7Zeop9oFhopDSaiZv8v2Jka8cDBpeVIFQXvy1/3AHs1TA/4btpu9sn Rut1+f4SA==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRuRg-0003Sl-T6; Wed, 28 Nov 2018 07:39:40 +0000 Date: Tue, 27 Nov 2018 23:39:40 -0800 From: Christoph Hellwig To: Vivek Gautam Cc: airlied@linux.ie, robdclark@gmail.com, tfiga@chromium.org, linux-kernel@vger.kernel.org, freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Jordan Crouse , Sean Paul Subject: Re: [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg* Message-ID: <20181128073940.GA13072@infradead.org> References: <20181126213710.3084-1-vivek.gautam@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181126213710.3084-1-vivek.gautam@codeaurora.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + /* > + * dma_sync_sg_*() flush the physical pages, so point > + * sg->dma_address to the physical ones for the right behavior. > + */ > + for_each_sg(msm_obj->sgt->sgl, s, msm_obj->sgt->nents, i) > + sg_dma_address(s) = sg_phys(s); > + I'm sorry, but this is completely bogus and not acceptable. The only place that is allowed to initialize sg_dma_address is dma_map_sg. If the default dma ops don't work for your setup we have major a problem and need to fix the dma api / iommu integration instead of hacking around it.