From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81EF1C4345F for ; Mon, 29 Apr 2024 04:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eG87ChQasqAVss2/uvnqbh2H1I5169WouLyvTFYPR4A=; b=myRxEu7BNQjbQA 6ObgULlC3WYaeOP5EVJrcYhMLx8DyfBPiPUWVBd4QgXWFO3sI2hUrDuLhdVP14oUA/bT61rI6b5MR ozjVTJk53Q+GTvjVdGmsVy6Ndfx5J7fY5TxhiCL7W/DfaY25uOSnZapZYS51o7HLtPEpc9CecVG8o rDl7YifIuqwbGb3dKWXFI5wvZa5x/xHleznc+2ZF8Gpso3ZHh1GCTuiIZ62G/vTT2pYwLcXYDreA4 LAYX7jlfHEM3A+tDEN8qdoczadzEd8vRcmEwCMNl4ayZlAgQj9R41iNM5ScArwzTjNY8z4rHcpPTR smFwaenzkn08xSNDl5mA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1Ikl-00000001QXg-2jVW; Mon, 29 Apr 2024 04:36:35 +0000 Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1Iki-00000001QX3-1fYF; Mon, 29 Apr 2024 04:36:32 +0000 Date: Sun, 28 Apr 2024 21:36:32 -0700 From: Christoph Hellwig To: Chen Ni Cc: inki.dae@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, airlied@gmail.com, daniel@ffwll.ch, krzk@kernel.org, alim.akhtar@samsung.com, m.szyprowski@samsung.com, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/exynos: Add check for dma_set_max_seg_size Message-ID: References: <20240429023833.1869154-1-nichen@iscas.ac.cn> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240429023833.1869154-1-nichen@iscas.ac.cn> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 29, 2024 at 10:38:33AM +0800, Chen Ni wrote: > Add check for the return value of dma_set_max_seg_size() and return > the error if it fails in order to catch the error. > > Fixes: ddfd4ab6bb08 ("drm/exynos: Fix dma_parms allocation") > Signed-off-by: Chen Ni With my dma-mapping hat maintainer on I think we should remove the return value from it. It can only return -EIO or 0, and the first only if the bus has not set up a dma_params structure for the device. I'd much rather WARN_ON() on that, as it is is a grave error to either call dma_set_max_seg_size on a device that is on a bus that doesn't support DMA at all, or for the bus maintainer to accidentlaly drop it. Feel free to add the patch if exynos has a strict error checking policy, but it's rather pointless and I'll add removing the return value to my ever growing TODO list. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel