Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp746803imm; Wed, 1 Aug 2018 04:45:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeMWd4j69GP5r+9rSzEDle7MAqdF7oBsc0KlxBk6JIpGnsUoul7kPNiNvZUDX+D/weqV1Yi X-Received: by 2002:a17:902:142:: with SMTP id 60-v6mr24768918plb.330.1533123959231; Wed, 01 Aug 2018 04:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533123959; cv=none; d=google.com; s=arc-20160816; b=W+3DBCsxpH/zU+/9rnbqw+LOGXrztAYrX+Hh1NKFbj+LO6UtiQ+T+3onzKl57rabYt mQxt1g66/yrsbhocI/mW9M8JRbMu6NP/OijSxCQuh9/qx64RfSYQj675cWdmRNrjFkCv ibQFjkIWQwAt4J7VvImWe0uROMPPyBRZDcWCwM0O1vrBrPjajwtz+fx2xRT4zyU8exxd a8ekW3qzHITlFLtuEzCSvLC/8YiodUKRIth/uC8IMSI/+j8VfmgXMfjhMRBJU/eKuyOs MvANVr3BddgbyLUuWdsy1YzmkXS9xkv9Xg9c5NgLUMdIGhYy5CaAerprIUtlBygoTHZ4 4rSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=YXf50igpmZ3Und0zC2FUpgOLYWlGtvwnAjZoXcq9WEM=; b=rt9RjA2osmi1AF8OC4sLj0XdOoVA9IbPjP44vyi1Ha0J3n2YJFEqrAxrIC+QyRH3xF kxig4YgvSXqYbNNgvBT7krTSWtIQa35hAlOQGTb+B51I9Xs0sYGQMHC4fsFAQaUiUGZh YmlBDTxUOMLnG+sMx0wjxSwPCNPtT/J0LW7clUSHDU5PYb5QEnUSwiT3zT1xTYqv6Lx9 GnH0+QcyMvQPbQG8QvRu5yeWibLW59w47DuG6ul3J25yLiSFDsGoNHmnnVcw69IywJmT Rhz/FviquPHl7dECJrF9ROdVEP20yv4R/ymVqbQzVSsfsZ/shMusOmW/aUlSMADXAb2D 8JXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=sBbVzqBq; 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 g87-v6si17629571pfg.225.2018.08.01.04.45.44; Wed, 01 Aug 2018 04:45:59 -0700 (PDT) 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=@agner.ch header.s=dkim header.b=sBbVzqBq; 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 S2388843AbeHANaU (ORCPT + 99 others); Wed, 1 Aug 2018 09:30:20 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:38620 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387799AbeHANaU (ORCPT ); Wed, 1 Aug 2018 09:30:20 -0400 Received: from trochilidae.toradex.int (unknown [IPv6:2a02:169:34b6::e71]) by mail.kmu-office.ch (Postfix) with ESMTPSA id AD12B5C03BB; Wed, 1 Aug 2018 13:44:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1533123894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:content-type:content-transfer-encoding: in-reply-to:references; bh=YXf50igpmZ3Und0zC2FUpgOLYWlGtvwnAjZoXcq9WEM=; b=sBbVzqBqF1BfoSwS0w+3NB61SaeGxyaHuFgLoO4nl61/gRdX9QqecLaxvOfdLnLZ8ngSv5 j1+WZ2neFdpC8ElztK4zT1Eh5ymDZRowEQ9Mr0cqQXhXFWUUW8nXi21GPbIF/c1+rtAn/B JF3fZECtJrIR26UzwjX6z00Dw/kWQ0o= From: Stefan Agner To: fugang.duan@nxp.com, davem@davemloft.net Cc: krzk@kernel.org, robin.murphy@arm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Agner Subject: [PATCH] net: fec: check DMA addressing limitations Date: Wed, 1 Aug 2018 13:44:49 +0200 Message-Id: <20180801114449.21208-1-stefan@agner.ch> X-Mailer: git-send-email 2.18.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check DMA addressing limitations as suggested by the DMA API how-to. This does not fix a particular issue seen but is considered good style. Signed-off-by: Stefan Agner --- drivers/net/ethernet/freescale/fec_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index c729665107f5..af0fb200e936 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3146,6 +3146,12 @@ static int fec_enet_init(struct net_device *ndev) fep->tx_align = 0x3; #endif + /* Check mask of the streaming and coherent API */ + if (dma_set_mask_and_coherent(&fep->pdev->dev, DMA_BIT_MASK(32))) { + dev_warn(&fep->pdev->dev, "No suitable DMA available\n"); + return -ENODEV; + } + fec_enet_alloc_queue(ndev); bd_size = (fep->total_tx_ring_size + fep->total_rx_ring_size) * dsize; -- 2.18.0