Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp659977pxv; Fri, 9 Jul 2021 06:22:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzgsSsC9ieDeGiE81gI45OjFX0qHb8TuwSl8IXJfycjkp6fTvlwVKItB7/Jx8nha0DnN6g X-Received: by 2002:a92:ddc3:: with SMTP id d3mr27538615ilr.190.1625836966003; Fri, 09 Jul 2021 06:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625836965; cv=none; d=google.com; s=arc-20160816; b=VN+CUdNkjGvEToW8zyTuG+le45nzO8H4xWduUsnMTwnI6+pKUSLLyYOg22JiKQUFCD T5TCTk14fEjITvF9OlU5VyZqv6eVnHkJijMZznvgyFoj5eRetR0Yg+s5eBjmUpigBp5I C/JVgQcRJ8lmnJOpmsgy+iqEJF79epY0xmmcq+lHkyaFMGH+iG8WPQEMKPLFooztRk1n +BwJctF9f5fbtNU0T8Pw6d1a2taZYBzlOlX7tt7hg9t7A6aUiaBeaKVzTUFagFBqVHF7 LzXjrn5h8RH1dYKSi30+nS8VFK3z/mfwY6o0eRH9JhCViuSC/phvl4Nt5bAKjBSUrS69 i3SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NHhy8vahjiqoCRfeAaQ2emXjHJLNa83rUS30eEOrGqs=; b=ZFpiLpNweuQqaP1gBx44rBWXb7pgf/+xi44BM5RJckIZBHuyje3iTK0Gqd/qSEY7Ua 2MeVHyTI3kef1a+4RbLPSbzXigrJLAg5QK37CFtALtBDLo5sPtFrWDwMu40vh6+G2M7s iFFQc8OkAJT0+dvIkqDTR1tQUIedK0ACIeQlg8kwgN0STna83ktTCx7A8/f0LMS6CjJF bXzP/RAQ6qZP951kVNSI7xCddLlzJh0LcOqv2iEe1raDVnSoSJBnzwevZyGtsbdSmALC NoQ7Ul4OCtTIsi0xTby/ahy2vPrHNXnJLzkvd+wJDE+GbRmpY4ABhcfqmutOzl9sJTxh tPaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xAebzRqg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si6629390ilh.42.2021.07.09.06.22.30; Fri, 09 Jul 2021 06:22:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xAebzRqg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232433AbhGINW6 (ORCPT + 99 others); Fri, 9 Jul 2021 09:22:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:54008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232438AbhGINWr (ORCPT ); Fri, 9 Jul 2021 09:22:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 532E5613C1; Fri, 9 Jul 2021 13:20:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1625836803; bh=RwhlPo07q9Dnn5VRY+Wwcbl/ggE2l517T8cSxQVsESI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xAebzRqgryajMjf+/BME3Vcx3O7HgUPP47M9PalCHOLQ5ORML2eOcBMtAJAsYG1mk kk1MczJHNl8xyoebEyh94x0+Tz3BUD3FWiDTRhcUb3HEZ2xs9DLFBjtggMwkFCW1zn iDRjm4a0BXnyx3F2Wgo6x6dZC48kFdIbRi6+i3R4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Sasha Levin Subject: [PATCH 4.14 21/25] drm/nouveau: fix dma_address check for CPU/GPU sync Date: Fri, 9 Jul 2021 15:18:52 +0200 Message-Id: <20210709131640.641808247@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709131627.928131764@linuxfoundation.org> References: <20210709131627.928131764@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christian König [ Upstream commit d330099115597bbc238d6758a4930e72b49ea9ba ] AGP for example doesn't have a dma_address array. Signed-off-by: Christian König Acked-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20210614110517.1624-1-christian.koenig@amd.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index e427f80344c4..a2d770acd10a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -450,7 +450,7 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo) struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm; int i; - if (!ttm_dma) + if (!ttm_dma || !ttm_dma->dma_address) return; /* Don't waste time looping if the object is coherent */ @@ -470,7 +470,7 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo) struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm; int i; - if (!ttm_dma) + if (!ttm_dma || !ttm_dma->dma_address) return; /* Don't waste time looping if the object is coherent */ -- 2.30.2