Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp684574pxb; Tue, 5 Apr 2022 18:42:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysyFMPRgOJnci6RON6y/H+pzHutYJOLbPFFY7ikYEVM+pVoQNF1lOIjOcew+675eTCfMAG X-Received: by 2002:a50:9d0f:0:b0:416:95a3:1611 with SMTP id v15-20020a509d0f000000b0041695a31611mr6373777ede.77.1649209323686; Tue, 05 Apr 2022 18:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649209323; cv=none; d=google.com; s=arc-20160816; b=ZvFsUdnAjJZKcQd9keQC5yNfYA0HZ9rIorUJm4MPiHrfJFa0h9PtRiPn8978fhyHwe CgtHGkHIgc1nnUBoB96pIfC6q7N34bFkhIBynK8bMD2hmNGxpji98mOKjuPv9GcrWrET LRecfcLF3U3SnwSwBKqv0j0isT1v4ztDjRK/n16LYANGfcOd3B3WThHVeYey6AtS44jD Ha5K0rM0498/EBmQYC7CXD0IF4+IkSXlq/ZQiggIvCscaoAM+6uq1D63sfub+dhM0Gg/ Fm7ihG6o+149qg1muEQsK+LuIUBceimcNc5m8eHkoRHDl7a5tgPCxR4VUX0wIZNnzICE D7hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=29xdJTwdttsJzC5U4eFwagc2WDZSRmPOUndB1/tm2jM=; b=aHsHznLiygK3lbXhZeKo1LMAEF2eSw0dneChvFKLpltsCC1bcUF2YdBdyxZyIcBII4 07zs1KbKsNftP1y6WDSUFC09B+Xdx1ic8yiBjf7KYv+8aJBMko+f4I+/AaTy4zm35Yxu /bJlhihfsxFE0u0IalD5XFLxsnmnhkhWhxsXhdIlJvNRt8ev/1fK8NBIKBimqOnZiKqx F8KWsOY4dsXtMoKFSiTkf7rqhvM6ZtFR6hVhZlcu13FaCsa7ewIM9asnS2QgIupQeJKV Xprw/99tN62EnK+3tQ7zTbK9YXMa94XGWg7G2M+WU5Gw/H8G6w4z4g2xnv5n2fJ8rmL8 yghQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZpCaPxj9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a170906c18e00b006df76385c4dsi7060438ejz.237.2022.04.05.18.41.39; Tue, 05 Apr 2022 18:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZpCaPxj9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236474AbiDEI1v (ORCPT + 99 others); Tue, 5 Apr 2022 04:27:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235853AbiDEIAe (ORCPT ); Tue, 5 Apr 2022 04:00:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E8111EACB; Tue, 5 Apr 2022 00:58:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D532F6173E; Tue, 5 Apr 2022 07:58:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2511C3410F; Tue, 5 Apr 2022 07:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145515; bh=+vB/c5TYSJXJNmD9pjNpxLmLtUsmHAcZ/hjWBUHuL58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZpCaPxj9Q9DTsI4tU2y1fajozQF5k9nKcOOt6A+N2XjmlTo2vxO9Er9lm1dWcAj74 NtlqSpibzOLO0i+ZC+PpqIC6erROPWfkCs2THDDjLyOIgjpwM+VmSUjBN7dwmDeWJg T5bLkHmPYvjaoS1bJlJjVFhxwntRYiyHsoIUUSe0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Steven Price , Sasha Levin Subject: [PATCH 5.17 0434/1126] drm/panfrost: Check for error num after setting mask Date: Tue, 5 Apr 2022 09:19:41 +0200 Message-Id: <20220405070420.363666105@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiasheng Jiang [ Upstream commit 44ab30b056149bd59dd7989a593dd25ead6007fd ] Because of the possible failure of the dma_supported(), the dma_set_mask_and_coherent() may return error num. Therefore, it should be better to check it and return the error if fails. Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver") Signed-off-by: Jiasheng Jiang [Steve: fix Fixes: line] Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20220106030326.2620942-1-jiasheng@iscas.ac.cn Signed-off-by: Sasha Levin --- drivers/gpu/drm/panfrost/panfrost_gpu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index bbe628b306ee..f8355de6e335 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -360,8 +360,11 @@ int panfrost_gpu_init(struct panfrost_device *pfdev) panfrost_gpu_init_features(pfdev); - dma_set_mask_and_coherent(pfdev->dev, + err = dma_set_mask_and_coherent(pfdev->dev, DMA_BIT_MASK(FIELD_GET(0xff00, pfdev->features.mmu_features))); + if (err) + return err; + dma_set_max_seg_size(pfdev->dev, UINT_MAX); irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "gpu"); -- 2.34.1