Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5977622pxb; Mon, 14 Feb 2022 12:10:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlMWVo3cNrBI6kdaTZGTTLTPdxTyeFXhkdab9Hd1mWw/t8lAOq581/hakTyC2sHJHWLD8h X-Received: by 2002:a65:6e43:: with SMTP id be3mr631637pgb.110.1644869406584; Mon, 14 Feb 2022 12:10:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644869406; cv=none; d=google.com; s=arc-20160816; b=lHWoA3clAjs+r7Kv6KgfTRXHGgU/jscYXXyRmxi6syICIK3dlEERVD7aPOxgwS5r7l rbUMw7U0P/9BD2Mf29rtCwyJ4CVPh8GMW2GtpJ0VID6525Gf1nNkz4gW4NkCKj8E+zxd QhTAt8y8c6gczGNZNjbbmA+ULcoFU+J78PP9YXuXQBQsijlUN5uwEbwhbu2cXyEkF0Bc hziDCIQWprrPRQxjw5A6TqM+Td5PKR8SIOjkni9qKojxaj8tQpHIO/sfXC08zb8QpR61 sckIk0mSE2iLlWIkmq3KyWyjsRGAq+P/PyxSAFmYxyrZLhTLyFRXJxf1+jIaWMP4C+ze gcBQ== 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=LlUOLmFy9gM1KbFVyk3l4WHuupQWRd5cTVTdoaM+6m8=; b=Y89MFFfwH7U3e2J6voNFboYcPcazLDjK9WHI71Iskc0CiCCIp/38aTcD+N7jTYPOSC vutFHHdwh2yQ0nbgEjn7mwhCMdSnmdLuIrm28ZB9aFGt1rfdzln4IWKo7gm2mOxDYDih j1OSF1TNkPnS/kdCupwr487tCA6hv40kttElzI7KBwlnbgX3ZaRC71Z0kd6DHvTodecG mKq4INpUm1FcsW1wWou7eKMW8g3MyvPpTAh7DIVHMu90lhMV39p0l0AgghupC9plTQI4 LBhMmMJ4hcNDK3LYVb+47Qjhi4i9j/nvWUSDO3Jmjndoa5qZ53XqzEUzY2Gvhh6YKSG2 IU8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oej72s+G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f185si556609pgc.744.2022.02.14.12.10.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 12:10:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oej72s+G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 99F6415AF1E; Mon, 14 Feb 2022 11:47:15 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245233AbiBNJtc (ORCPT + 99 others); Mon, 14 Feb 2022 04:49:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344110AbiBNJqm (ORCPT ); Mon, 14 Feb 2022 04:46:42 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FEDA66612; Mon, 14 Feb 2022 01:40:12 -0800 (PST) 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 50B1FB80DC1; Mon, 14 Feb 2022 09:40:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 747D9C340E9; Mon, 14 Feb 2022 09:40:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831607; bh=GmHD2H6wXTPw4OsDfCiRyEE9zZtwRyeGAsCLUx/cKAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oej72s+GXo2oMVdqEe3uk2nmnRXyqBJNZN2B2GNqBsuOTmy0YmK6ZatZv0nvxDl4C aBDfch+pURsfBalC1ujUzrGh5EMCnvM1dCP9tJLohG2h53Otp5Ks3xQLG++eWfIEpA 9qJVzP9SvsNMpMIKHbF9yvJ6N4w7783j73oRunyg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Adrian Hunter , Ulf Hansson Subject: [PATCH 5.10 005/116] mmc: sdhci-of-esdhc: Check for error num after setting mask Date: Mon, 14 Feb 2022 10:25:04 +0100 Message-Id: <20220214092458.864552120@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092458.668376521@linuxfoundation.org> References: <20220214092458.668376521@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 commit 40c67c291a93f8846c4a972c9ef1b7ba4544c8d0 upstream. 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. And since the sdhci_setup_host() has already checked the return value of the enable_dma, we need not check it in sdhci_resume_host() again. Fixes: 5552d7ad596c ("mmc: sdhci-of-esdhc: set proper dma mask for ls104x chips") Signed-off-by: Jiasheng Jiang Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220112083156.1124782-1-jiasheng@iscas.ac.cn Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-of-esdhc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -524,12 +524,16 @@ static void esdhc_of_adma_workaround(str static int esdhc_of_enable_dma(struct sdhci_host *host) { + int ret; u32 value; struct device *dev = mmc_dev(host->mmc); if (of_device_is_compatible(dev->of_node, "fsl,ls1043a-esdhc") || - of_device_is_compatible(dev->of_node, "fsl,ls1046a-esdhc")) - dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40)); + of_device_is_compatible(dev->of_node, "fsl,ls1046a-esdhc")) { + ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40)); + if (ret) + return ret; + } value = sdhci_readl(host, ESDHC_DMA_SYSCTL);