Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1018753pxb; Wed, 6 Apr 2022 06:52:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEZkVhSp0lOZWwPfyNWIWFDappYsyGbq1ar9oX9/qlTiCReY/LmV585DYGLfMdu+otYPU+ X-Received: by 2002:a17:90b:3650:b0:1ca:a667:b17c with SMTP id nh16-20020a17090b365000b001caa667b17cmr10055251pjb.180.1649253140705; Wed, 06 Apr 2022 06:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649253140; cv=none; d=google.com; s=arc-20160816; b=EaKFx7BbMkqbGV2QTSnaKhEnRBjQCCzBge/xGFzCTaoB6WOQ2XzxZkCw3xLzEJul/w yHDgH+lQZ8lVLpN2WYDHB1SN7MEEy1cR5xjkO6ZB4t5BWFLlfv90XSsdOngM0f32n9Ax hNhMH3B9dqEZmeAy9ea36puVPp2jHW8oq1PVNcmKb3vFci4AMz6h/VAbpmmzK3ZZ96ln ytaWQuz4BhXRmGPrYCNq6ggE/Vlm2EAqGipxfvzy25qcWtMdIZUR4IoeskDUhO+tmTOO CAnKRBxp3OrNyj1YVA9FDhXt5gMaI6uMVWA4GCTy/YTjpHtPCLJRA6LtAuq4r6sec4cn Q5pg== 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=Zvsqanjg3qQyHPOco/831Z6uovIATXNvtHeLYD8k9rIRdYVbQ8bV5G+OlnwsKec+Dd sJruoKmRjxgJAm402LXSB494HVAORPR6GL89I+Ea1+vWc2SHKSBwFVhJiZ7FqkJXEVWb 3KOx9/Map+2cTx0rD/RYcoT/zfqcmGQjqjrt/eWgc/H89C+Rx+5HjBsTIW+JNBRkJmzB jv5ybtj4idPvhO1w9wNKE4iDGYWSd6nD1XT4hSrkp/SawoEJG1nMJ2WNYP4dz2rrFGGq 31Z7glCsI7JN4NGmCKgDnaCbiYAYIvriJdl38JxGr6NpcTWL5bDkTLQI/7LjkkUHvekk 51Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NyBmURC0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q10-20020a170902daca00b00156c7cceca6si6127152plx.112.2022.04.06.06.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:52:20 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NyBmURC0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BED8B4AF7B9; Wed, 6 Apr 2022 04:46:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1846477AbiDFCET (ORCPT + 99 others); Tue, 5 Apr 2022 22:04:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348807AbiDEJsh (ORCPT ); Tue, 5 Apr 2022 05:48:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35C729024F; Tue, 5 Apr 2022 02:35:52 -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 ams.source.kernel.org (Postfix) with ESMTPS id D9360B81C8B; Tue, 5 Apr 2022 09:35:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29E2BC385A2; Tue, 5 Apr 2022 09:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151349; bh=+vB/c5TYSJXJNmD9pjNpxLmLtUsmHAcZ/hjWBUHuL58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NyBmURC0NBKIYO678poXmdxgFmYCysBq9pzY/sS19WxfI9gbrcxNuVjdmn0oMEfMw BKZ/AZNuac4CB8i0ZjtsLHhg+S5eSSq0Ke/EZ3duyzEa1syK3MtOy57bwFwq07AMaV FExo+LVGG9FAoEOp9rdQADwyQJCcJ4zZGKdjGHWQ= 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.15 384/913] drm/panfrost: Check for error num after setting mask Date: Tue, 5 Apr 2022 09:24:06 +0200 Message-Id: <20220405070351.357429769@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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