Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp661016pxv; Fri, 9 Jul 2021 06:23:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzq4jUMiM4WtZ4J1btZBSGYGYtBw1e+DKOnUIIKOoSx45XJae7v+7XEG5n7r55jBme8+xrt X-Received: by 2002:a92:c504:: with SMTP id r4mr1402799ilg.131.1625837028921; Fri, 09 Jul 2021 06:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625837028; cv=none; d=google.com; s=arc-20160816; b=xlZGX9UZrm2rn3tcIZgHKjJFafjPr0TPCOaH4Qd1Zfd9cSYlX/phXNMxHCCG9ibXFY 2e7jqymBbwnPcZ/4jqaUfMeNMwjoCgdVCOqF2Vmfo+vn7kphhwUc7oaE4SYlYslLB59U 4Jjb1oW0Vpkz2cSgkSYfPK1fRsxmtQNnILLMyjbp1zSieHuq3wGoZI8rQ3KbDItrcSOq aTAvxrgVaMY3rqodHJuiXFVKcEaHZXntNMg0z3+rcAKbMboGtGvg96SRrDrWKWpuk5sx qa9x2Tn3SKIr48SDFAqzTuXyCIycx1cnFAUXE6mtqGX+8cuVERQqWS/LCDy02a/zQKKm SSVA== 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=Av1f1fgn7fYaeXg1s96QBNQtQ+EUrabEANaQv6ZHJVU=; b=bHvVzW7QoiCNXsnI/6dUBidHSNc6BG6Qj3FFZzhcH/Swoey1gJnG3++c0TAasT0jmf Zo7gmhU3k5Mo4zS11nxCwoELzmVlFwMRjAH17b6jpUtODQrI0lnp5i7QY/Hsv2euNlkx itgHmP8NDmI53Gxx9AFBbequCRCNrHCnlQrldpbSbhECHGOFU6ROc5WuCRXFx2L2r9Lq a2CM0lzKSUc+CJoJO9q2AlOnuPfcKw4R26iNrmBEFHSMOljhTFUO+omv7190hdYuwna8 e7l8p58ybtfb9Mo7S7sSFP0XEmMctGKT9DDQAf23EyhjR8DEJ6HL8oRnEtNTk852o71W ZmHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ps309hhk; 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 n19si5879405jaj.117.2021.07.09.06.23.37; Fri, 09 Jul 2021 06:23:48 -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=ps309hhk; 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 S232664AbhGINYk (ORCPT + 99 others); Fri, 9 Jul 2021 09:24:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:56074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232588AbhGINY0 (ORCPT ); Fri, 9 Jul 2021 09:24:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F627608FE; Fri, 9 Jul 2021 13:21:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1625836903; bh=kIaYFbU2EySHbd7T6advKyzdNKMGLNOuQMH/Y3eXtBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ps309hhkyR08Xfpo32reSNLsCMJKwWSsVNPMzj7mUbBKBi/bx8xQcFeMjhNPGeolz TiCmOR7MWD4KmzOYvNHPywE46HcJml+8rYWRFnM82uIh6I5XIPr2SARrS+bkZpzwnE AxS+Bvs5K3vt39mGTJr1fnORY8ahCbkQD4IOnxE0= 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.19 23/34] drm/nouveau: fix dma_address check for CPU/GPU sync Date: Fri, 9 Jul 2021 15:20:39 +0200 Message-Id: <20210709131656.990599621@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709131644.969303901@linuxfoundation.org> References: <20210709131644.969303901@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 7214022dfb91..d230536e7086 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -512,7 +512,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 */ @@ -532,7 +532,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