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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D83D4C433F5 for ; Mon, 6 Dec 2021 02:36:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234502AbhLFCj3 (ORCPT ); Sun, 5 Dec 2021 21:39:29 -0500 Received: from smtp25.cstnet.cn ([159.226.251.25]:39304 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234394AbhLFCjZ (ORCPT ); Sun, 5 Dec 2021 21:39:25 -0500 Received: from localhost.localdomain (unknown [124.16.138.128]) by APP-05 (Coremail) with SMTP id zQCowAD320H2dq1hoZVpAQ--.36691S2; Mon, 06 Dec 2021 10:35:35 +0800 (CST) From: Jiasheng Jiang To: yuq825@gmail.com, airlied@linux.ie, daniel@ffwll.ch, p.zabel@pengutronix.de, lgirdwood@gmail.com, broonie@kernel.org Cc: dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] drm/lima: Handle dma_set_coherent_mask error codes Date: Mon, 6 Dec 2021 10:35:30 +0800 Message-Id: <20211206023530.1662840-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: zQCowAD320H2dq1hoZVpAQ--.36691S2 X-Coremail-Antispam: 1UD129KBjvdXoWrur4xCryrtF17ZF48Cw17Jrb_yoWfuFc_Kw 17ZFn7WrW8uFnYy3W3Ar43ur1UKrnF9FWkXr10ga93tr9rXryDX3y7Wr4ruryUWFyqyFWD K3WDAr4rJFs2gjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb3kFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_ Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr 1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E 8cxan2IY04v7MxkIecxEwVAFwVW8JwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbV WUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF 67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42 IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1U MIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIda VFxhVjvjDU0xZFpf9x0JUCg4hUUUUU= X-Originating-IP: [124.16.138.128] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The return value of dma_set_coherent_mask() is not always 0. To catch the exception in case that dma is not support the mask. Fixes: a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/lima/lima_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/lima/lima_device.c b/drivers/gpu/drm/lima/lima_device.c index 65fdca366e41..75e9a2060b47 100644 --- a/drivers/gpu/drm/lima/lima_device.c +++ b/drivers/gpu/drm/lima/lima_device.c @@ -356,7 +356,9 @@ int lima_device_init(struct lima_device *ldev) struct platform_device *pdev = to_platform_device(ldev->dev); int err, i; - dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32)); + err = dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32)); + if (err) + return err; err = lima_clk_init(ldev); if (err) -- 2.25.1