From patchwork Sat Oct 3 15:19:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 7321631 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 429A99F6CD for ; Sat, 3 Oct 2015 15:26:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75C77207CE for ; Sat, 3 Oct 2015 15:26:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7CFD3207DB for ; Sat, 3 Oct 2015 15:26:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753144AbbJCPYG (ORCPT ); Sat, 3 Oct 2015 11:24:06 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:51300 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753143AbbJCPYE (ORCPT ); Sat, 3 Oct 2015 11:24:04 -0400 Received: from [83.175.99.196] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZiOf8-0004Tl-SJ; Sat, 03 Oct 2015 15:23:51 +0000 From: Christoph Hellwig To: Andrew Morton , Don Fry , Oliver Neukum Cc: linux-net-drivers@solarflare.com, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, netdev@vger.kernel.org, linux-parisc@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/15] nouveau: don't call pci_dma_supported Date: Sat, 3 Oct 2015 17:19:34 +0200 Message-Id: <1443885579-7094-11-git-send-email-hch@lst.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443885579-7094-1-git-send-email-hch@lst.de> References: <1443885579-7094-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just try to set a 64-bit DMA mask first and retry with the smaller dma_mask if dma_set_mask failed. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index 3f0fb55..bb030e6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -350,11 +350,14 @@ nouveau_ttm_init(struct nouveau_drm *drm) bits = nvxx_mmu(&drm->device)->dma_bits; if (nvxx_device(&drm->device)->func->pci) { - if (drm->agp.bridge || - !pci_dma_supported(dev->pdev, DMA_BIT_MASK(bits))) + if (drm->agp.bridge) bits = 32; ret = pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(bits)); + if (ret && bits != 32) { + bits = 32; + ret = pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(bits)); + } if (ret) return ret;