Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp714042imj; Wed, 13 Feb 2019 16:20:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IZlWbkV6NxSLhL03oHVLWZkB3amBzJu99LSgq5YmGDqKDQlxsDo05cYYKMZzZRBxhnI0lSL X-Received: by 2002:a17:902:bf44:: with SMTP id u4mr998210pls.5.1550103625229; Wed, 13 Feb 2019 16:20:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550103625; cv=none; d=google.com; s=arc-20160816; b=hNaBqiG1NW3yOaI3wdMpPeLZXY0RbrSis7Tnd8FtxjJXCtiph36ig+au2u1/oiX1zF uFrOCGAQRe8qW3KtoQnur4NXICdPNdPIcjAEvOi/lII8s3y/jnL26bE5tlE7X0z1t8og M9LhJf4g/FhjeKQ2NanOCcSJNzRNpoJqFF559Rnand3LlW+/o1pg4qYmXQBcWiZQwJ+1 Zc7E0KFx/yHS+xBWmpotYo/7S152pgnE2qW27aOLgpj6VuC/r/1GHJcNNLEDcWfMgqbW 9eFMkrVzX1hdPkfNjZIXNrxwBJk2nUEWAHP4RU4e/nGrpxFpq3LUGaj46UfxcEp9ibjH QN7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aZYjVMd7Fs1BD1YCBoRp1hgJDYwFADhpd9v3vix4K1o=; b=d1SuatGx/wmRd1WqFufkEU4aranVFdABRCsfK3mY0JM1JKaizKEWq/v7G1V1YYfugu ynr10Qmy8Xw9YrFPfXrY8AUi9i0ync00m3CNQuDMauiUfqcDiQ4Br0WQRNTnhJm3J76F jlpxwHSYvW84tXsqxYF2DhM4QgeiB8GppRxr9HSYJZLveBaURoVkaUEXpAnsdXr3UTix 5MB2t+BObVJi3daI70YsV1l7AI8bFISknD4h0NIYWUMGoIvzVmNkAR0qha5jwIV5PCH9 cP5KEfAwkQiSC6V0u5ZVbnTsNzBjFn0gRP6H7i0X6YdpSuSr9VALbsFrnrHo5Gfib31g 8v1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yTtMCAXh; 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 91si787627ply.214.2019.02.13.16.20.10; Wed, 13 Feb 2019 16:20:25 -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=pass header.i=@kernel.org header.s=default header.b=yTtMCAXh; 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 S2406479AbfBMSqg (ORCPT + 99 others); Wed, 13 Feb 2019 13:46:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:45002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406447AbfBMSq0 (ORCPT ); Wed, 13 Feb 2019 13:46:26 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 344B420811; Wed, 13 Feb 2019 18:46:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550083585; bh=iA8SS992hJGM0eC5O1O1E76tS9Vhhhz4wcqKoUiMn7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yTtMCAXhR+KRBwPrPdsgbT84TjLaiEK0VVDWgdOiXvkwSzN3ff/Bo0kQjenEahSRt bpAO4RCAFG64F3SAkHDaCRqkk4b2p8X6MIm8d76M8GOwmLtxCQzqcz0q1x+4KKw1HQ zFuabIxip9HC9QlFXb/7gOEs+Y2jbuM38Eu7iZsw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Hellstrom , Deepak Rawat Subject: [PATCH 4.20 41/50] drm/vmwgfx: Fix setting of dma masks Date: Wed, 13 Feb 2019 19:38:46 +0100 Message-Id: <20190213183658.915887855@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190213183655.747168774@linuxfoundation.org> References: <20190213183655.747168774@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Hellstrom commit 4cbfa1e6c09e98450aab3240e5119b0ab2c9795b upstream. Previously we set only the dma mask and not the coherent mask. Fix that. Also, for clarity, make sure both are initially set to 64 bits. Cc: Fixes: 0d00c488f3de: ("drm/vmwgfx: Fix the driver for large dma addresses") Signed-off-by: Thomas Hellstrom Reviewed-by: Deepak Rawat Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -629,13 +629,16 @@ out_fixup: static int vmw_dma_masks(struct vmw_private *dev_priv) { struct drm_device *dev = dev_priv->dev; + int ret = 0; - if (intel_iommu_enabled && + ret = dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(64)); + if (dev_priv->map_mode != vmw_dma_phys && (sizeof(unsigned long) == 4 || vmw_restrict_dma_mask)) { DRM_INFO("Restricting DMA addresses to 44 bits.\n"); - return dma_set_mask(dev->dev, DMA_BIT_MASK(44)); + return dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(44)); } - return 0; + + return ret; } #else static int vmw_dma_masks(struct vmw_private *dev_priv)