Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2726636ybx; Sun, 3 Nov 2019 02:36:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwk+AzZjKB8Sxk9pYhLMqUYRUIgTYcd1oE0Zu9/CXv3QyEr2n2+A9glI4B0aKEEmakfRMsD X-Received: by 2002:a17:906:3e91:: with SMTP id a17mr18159316ejj.218.1572777394670; Sun, 03 Nov 2019 02:36:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572777394; cv=none; d=google.com; s=arc-20160816; b=0ksXMVJWoGLri0U01dfmH/+g67oW9svx0k9MVbnMAjQ3wXU+VHXDcWqoHaHquS/MC2 k9kColsw2G0nwqHCN7IV5T41ydoIQx9edSjwUA3zFbaxMQMHOr10yug32nsWPa9ig34l /kM5B9SwPn3lTQo0dI3oAT+TSS4EIZGHvygQOXCLDQNwHcA/apNtvY1OQDyf3Hq5IMis UIK4vD7yJ3m3tezZKzLUDZhZYIUVItQuS2sn6xsSFXEJFzmsxtCWG/xnywGSj60C1RwJ nRCVSPoUqcq9noJREvOl/aP64voFIrNgD4aDt1jzuezpgH/m6pA1fvN0WKZEj0ll+IoU /K8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=WqcQqDW9sQpDvWmaARtHdVJAbT2q91wH8ibpdjlDvx8=; b=hn33hQTnbNguG74wS0A0KtbKi+/O+o6XqDjEAMv8TQqiX9u3Ay9lrDChRW950xsf/Z mPnUnPVvjcl8RpbmLlRTJvBEkvmIkeZEMxOQC2MsxAZH3DR7GRW4pCZgkpHTTum+B8ah VDdHuHqc5/d6Wx9ahGHcm8J4NfvYIW+BJAPLYEYR9NF2Ee/JGC+70Ut85bra96Ql+vKP kwHF8wRICofoVLIy8bbA/03BW4yDmeQxtpN30bLVUkF+gT8swAYGRmrHM8oDoLbXudd3 anANqAHXUcrUzDG8uoetGC76mg0cOTZMmhhOfpUQyr+c2HHb9t254CY/x3Lz6c4Q0X/r 5oBw== ARC-Authentication-Results: i=1; mx.google.com; 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 w25si9240265ejn.391.2019.11.03.02.36.11; Sun, 03 Nov 2019 02:36:34 -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; 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 S1727554AbfKCKfG (ORCPT + 99 others); Sun, 3 Nov 2019 05:35:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:56870 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727379AbfKCKfG (ORCPT ); Sun, 3 Nov 2019 05:35:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 64572B16C; Sun, 3 Nov 2019 10:35:04 +0000 (UTC) From: Thomas Bogendoerfer To: Ralf Baechle , "David S. Miller" , linux-mips@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christoph Hellwig Subject: [net v2 3/4] net: sgi: ioc3-eth: simplify setting the DMA mask Date: Sun, 3 Nov 2019 11:34:32 +0100 Message-Id: <20191103103433.26826-3-tbogendoerfer@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191103103433.26826-1-tbogendoerfer@suse.de> References: <20191103103433.26826-1-tbogendoerfer@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Hellwig There is no need to fall back to a lower mask these days, the DMA mask just communictes the hardware supported features. Signed-off-by: Christoph Hellwig --- drivers/net/ethernet/sgi/ioc3-eth.c | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c index d1546f04d1fd..83abc8a13508 100644 --- a/drivers/net/ethernet/sgi/ioc3-eth.c +++ b/drivers/net/ethernet/sgi/ioc3-eth.c @@ -1174,26 +1174,14 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct ioc3 *ioc3; unsigned long ioc3_base, ioc3_size; u32 vendor, model, rev; - int err, pci_using_dac; + int err; /* Configure DMA attributes. */ - err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64)); - if (!err) { - pci_using_dac = 1; - err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); - if (err < 0) { - pr_err("%s: Unable to obtain 64 bit DMA for consistent allocations\n", - pci_name(pdev)); - goto out; - } - } else { - err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); - if (err) { - pr_err("%s: No usable DMA configuration, aborting.\n", - pci_name(pdev)); - goto out; - } - pci_using_dac = 0; + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); + if (err) { + pr_err("%s: No usable DMA configuration, aborting.\n", + pci_name(pdev)); + goto out; } if (pci_enable_device(pdev)) @@ -1205,8 +1193,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto out_disable; } - if (pci_using_dac) - dev->features |= NETIF_F_HIGHDMA; + dev->features |= NETIF_F_HIGHDMA; err = pci_request_regions(pdev, "ioc3"); if (err) -- 2.16.4