Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2656887pxa; Mon, 17 Aug 2020 15:42:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU0n+jdwKvFoQN99dzP9RZLch8NVMkgn3+3uEmDmYXWuxGaQ/vZo3uZksynszJLhTwEQ09 X-Received: by 2002:a17:906:a182:: with SMTP id s2mr16838322ejy.526.1597704147590; Mon, 17 Aug 2020 15:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704147; cv=none; d=google.com; s=arc-20160816; b=AlaupMVQnBvDMkRkliKdqmYTpkxere8S3nRd5IxAjTZCz47jHTJRV13STdatIk3nOl gp3pw+H6pPus5KK+38SjKiV3nwHiJk7mljNGfSt9y+EnZLVARl/wXwfX6g+81VwIW6wA OLntIXZl4qAJc1WyqOO7oHG99ST2zP0AOgs66DF2QM4eJ4n1UyoXL4OWoNSlV5LV8U0S qifluJnXb3IfkFkk8U930q74l/tIvEvWNZUKHQ4i7H94yyv5ZjaYb8ovS7/Q8XwkPCav FCmxjTZnHxEFU/cMlfKmEJbp8etk488VeGZvIB0Ow6yOiaucQmvJ/Te61Ynqrm3sW98y d93Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mELwc7+lpxa1yxqGSpDkIfHEhZBseczILCTGsVTyVhU=; b=vjkLCQ0SU4ANDnRmPRuKAKkyLBT0+0kJk2bl8DZuPkW3SwjBltVKz0Wo8We2kaO90+ 687GnR1HVDBkd3eqoWvC3s8wMEH+HQXsgzFNjL2dFPAL8U+i9gHcWI7B0XROmOl6u8N9 Zf2/hlXXzrxEA5sApMIqk+xdvWdY2i3+4s7Cre2klZA/G/6B1a1MWRNrROtBbl/ieceI 46ChnzeYotUAaeailu40GqZW0Td0RqwonTpEfY/5zxvbFVUkdYtuOU2N6bU17Q7sl3y1 zVABELeCjONacFjlR9g8+9WcRvtXy5wUMNW29vtUCHmhWbTOCmLmBobVQLSH4G0XoAsQ pVgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KQ1vlvNA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m24si11922943edr.211.2020.08.17.15.42.04; Mon, 17 Aug 2020 15:42:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KQ1vlvNA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390986AbgHQSia (ORCPT + 99 others); Mon, 17 Aug 2020 14:38:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:45962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388141AbgHQP6i (ORCPT ); Mon, 17 Aug 2020 11:58:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D93A1206FA; Mon, 17 Aug 2020 15:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679917; bh=tUyQ7JpyxQCiTaMfaKNXuEnfPYLvnXB2tbmFxJwSzBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQ1vlvNAL2oaPjog8Qt+YZpkUr4NWVo/xJBv7L4ECShxbvQyBKhJSnHMTBErbk/jU nz4gHM1zd6n+H1hTiXpwf02ZiA6/SPo8pdxdaolV2ip9aVcH0a5GPNFjzk/TZUVHSh NsIwVHswPW+EQE+O7ms/qf39X14ErBCQ8h2NzsNU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Elliot Berman , Jonathan McDowell , Bjorn Andersson Subject: [PATCH 5.7 378/393] firmware: qcom_scm: Fix legacy convention SCM accessors Date: Mon, 17 Aug 2020 17:17:08 +0200 Message-Id: <20200817143837.944460925@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan McDowell commit b88c28280c3f7097546db93824686db1e7dceee1 upstream. The move to a combined driver for the QCOM SCM hardware changed the io_writel and io_readl helpers to use non-atomic calls, despite the commit message saying that atomic was a better option. This breaks these helpers on hardware that uses the old legacy convention (access fails with a -95 return code). Switch back to using the atomic calls. Observed as a failure routing GPIO interrupts to the Apps processor on an IPQ8064; fix is confirmed as correctly allowing the interrupts to be routed and observed. Reviewed-by: Elliot Berman Fixes: 57d3b816718c ("firmware: qcom_scm: Remove thin wrappers") Cc: stable@vger.kernel.org Signed-off-by: Jonathan McDowell Link: https://lore.kernel.org/r/20200704172334.GA759@earth.li Signed-off-by: Bjorn Andersson Signed-off-by: Greg Kroah-Hartman --- drivers/firmware/qcom_scm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -391,7 +391,7 @@ static int __qcom_scm_set_dload_mode(str desc.args[1] = enable ? QCOM_SCM_BOOT_SET_DLOAD_MODE : 0; - return qcom_scm_call(__scm->dev, &desc, NULL); + return qcom_scm_call_atomic(__scm->dev, &desc, NULL); } static void qcom_scm_set_download_mode(bool enable) @@ -650,7 +650,7 @@ int qcom_scm_io_readl(phys_addr_t addr, int ret; - ret = qcom_scm_call(__scm->dev, &desc, &res); + ret = qcom_scm_call_atomic(__scm->dev, &desc, &res); if (ret >= 0) *val = res.result[0]; @@ -669,8 +669,7 @@ int qcom_scm_io_writel(phys_addr_t addr, .owner = ARM_SMCCC_OWNER_SIP, }; - - return qcom_scm_call(__scm->dev, &desc, NULL); + return qcom_scm_call_atomic(__scm->dev, &desc, NULL); } EXPORT_SYMBOL(qcom_scm_io_writel);