[{"id":1769962,"web_url":"http://patchwork.ozlabs.org/comment/1769962/","msgid":"<20170918081824.iiebcj63wvnean57@flea.lan>","list_archive_url":null,"date":"2017-09-18T08:18:24","subject":"Re: [PATCH v2 07/10] dmaengine: sun6i: Retrieve channel count/max\n\trequest from devicetree","submitter":{"id":12916,"url":"http://patchwork.ozlabs.org/api/people/12916/","name":"Maxime Ripard","email":"maxime.ripard@free-electrons.com"},"content":"Hi,\n\nOn Sun, Sep 17, 2017 at 05:19:53AM +0200, Stefan Brüns wrote:\n> +\tret = of_property_read_u32(np, \"dma-channels\", &sdc->num_pchans);\n> +\tif (ret && !sdc->num_pchans) {\n> +\t\tdev_err(&pdev->dev, \"Can't get dma-channels.\\n\");\n> +\t\treturn ret;\n> +\t}\n> +\n> +\tif (sdc->num_pchans > DMA_MAX_CHANNELS) {\n> +\t\tdev_err(&pdev->dev, \"Number of dma-channels out of range.\\n\");\n> +\t\treturn -EINVAL;\n> +\t}\n> +\n> +\tret = of_property_read_u32(np, \"dma-requests\", &sdc->max_request);\n> +\tif (ret && !sdc->max_request) {\n> +\t\tdev_info(&pdev->dev, \"Missing dma-requests, using %u.\\n\",\n> +\t\t\t DMA_CHAN_MAX_DRQ);\n> +\t\tsdc->max_request = DMA_CHAN_MAX_DRQ;\n> +\t}\n> +\n> +\tif (sdc->max_request > DMA_CHAN_MAX_DRQ) {\n> +\t\tdev_err(&pdev->dev, \"Value of dma-requests out of range.\\n\");\n> +\t\treturn -EINVAL;\n> +\t}\n\nI'm not really convinced about these two checks. They don't catch all\nerrors (the range between the actual number of channels / DRQ and the\nmaximum allowed per the registers), they might increase in the future\ntoo, and if we want to make that check actually working, we would have\nto duplicate the number of requests and channels into the driver.\n\nWhich is kind of the opposite of what we're trying to do here :)\n\nOnce removed,\nAcked-by: Maxime Ripard <maxime.ripard@free-electrons.com>\n\nMaxime","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"H5LjeS/X\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xwf6c2Jtkz9s3w\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 18:19:04 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dtrGf-0003Xk-3Q; Mon, 18 Sep 2017 08:19:01 +0000","from mail.free-electrons.com ([62.4.15.54])\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dtrGa-0003RM-58 for linux-arm-kernel@lists.infradead.org;\n\tMon, 18 Sep 2017 08:18:58 +0000","by mail.free-electrons.com (Postfix, from userid 110)\n\tid E0E6720858; Mon, 18 Sep 2017 10:18:34 +0200 (CEST)","from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id B6D1B207EB;\n\tMon, 18 Sep 2017 10:18:24 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc:\n\tList-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:\n\tIn-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To:\n\tContent-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:\n\tResent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner;\n\tbh=fgEwct9J7YPR3L2HLpfwMHEPvUztKWDT8ZhOe3cCKgU=;\n\tb=H5LjeS/XRZxlA6TlcHOTf56ux\n\tHIppl3cxd2ZjEcmgXx4bhAwx2vg89irFP979iEHm8PPG3OeKYKXqpxloBcA/z9RUR4BTEYZNjuS2l\n\tG4O+yUGIe2t+Df0k3nNFFBkCu50ultt5LTlWFkO5wAP2Y4RiEZPkM+I6TIgIzit+Ki5CgfctW3cN/\n\teFay9MYcH0cGy4UUoNVWK1qI4/iiQN8mPHX1JYqjGcAMOqDLYMU5lIP7Ly2cfNfiFz/iL61/v6a6E\n\tMlHGNu3ukcrpnCLEK7cgLJzLJAygEJDk8DpwMsarOXKY7vWnSIGBPWf37rn4Hb+IIXCw/hzBv7Tg6\n\txc6mM7QbA==;","X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT\n\tshortcircuit=ham autolearn=disabled version=3.4.0","Date":"Mon, 18 Sep 2017 10:18:24 +0200","From":"Maxime Ripard <maxime.ripard@free-electrons.com>","To":"Stefan =?iso-8859-1?q?Br=FCns?= <stefan.bruens@rwth-aachen.de>","Subject":"Re: [PATCH v2 07/10] dmaengine: sun6i: Retrieve channel count/max\n\trequest from devicetree","Message-ID":"<20170918081824.iiebcj63wvnean57@flea.lan>","References":"<20170917031956.28010-1-stefan.bruens@rwth-aachen.de>\n\t<20170917031956.28010-8-stefan.bruens@rwth-aachen.de>","MIME-Version":"1.0","In-Reply-To":"<20170917031956.28010-8-stefan.bruens@rwth-aachen.de>","User-Agent":"NeoMutt/20170714 (1.8.3)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170918_011856_496189_B912ECD6 ","X-CRM114-Status":"GOOD (  13.09  )","X-Spam-Score":"-1.9 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"devicetree@vger.kernel.org, Vinod Koul <vinod.koul@intel.com>,\n\tAndre Przywara <andre.przywara@arm.com>, linux-kernel@vger.kernel.org,\n\tCode Kipper <codekipper@gmail.com>, linux-sunxi@googlegroups.com,\n\tRob Herring <robh+dt@kernel.org>, dmaengine@vger.kernel.org,\n\tChen-Yu Tsai <wens@csie.org>, linux-arm-kernel@lists.infradead.org","Content-Type":"multipart/mixed;\n\tboundary=\"===============0163174440166963423==\"","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}}]