From patchwork Wed Sep 28 10:42:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan Ramabadhran X-Patchwork-Id: 9353735 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AD53060757 for ; Wed, 28 Sep 2016 10:43:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E148294C4 for ; Wed, 28 Sep 2016 10:43:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91661294D9; Wed, 28 Sep 2016 10:43:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 451F3294C4 for ; Wed, 28 Sep 2016 10:43:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932179AbcI1Kmw (ORCPT ); Wed, 28 Sep 2016 06:42:52 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43999 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932176AbcI1Kmu (ORCPT ); Wed, 28 Sep 2016 06:42:50 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C6F9361817; Wed, 28 Sep 2016 10:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1475059368; bh=RlaxDE04ATDvbcGYOclYoSeqEwU9jhDbHNOaQ5OqUTo=; h=From:To:Cc:Subject:Date:From; b=WqfenAQqWaD4cY4HcHelBR3PaqwD4o4o5JkjpCSJ5d3YFCtj5JlgvZuLj0iniWnPE tIV+iLq4Dx1XkEwqa8K1+cHV1DEQxtZGIN78TN/NPw7fAppcQn0l5wuXS1jPif3HWI IO8sPUGgk0FrKY7X95/a1GAlccxYvcr2ky2sxRG0= Received: from blr-ubuntu-32.ap.qualcomm.com (unknown [202.46.23.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sricharan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E25A46174D; Wed, 28 Sep 2016 10:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1475059366; bh=RlaxDE04ATDvbcGYOclYoSeqEwU9jhDbHNOaQ5OqUTo=; h=From:To:Cc:Subject:Date:From; b=ZTx5dWsg72Gban3CnOwk2nYN6iXS4OtGrtJ/Tg4HS0gIQz7vqSX0r+QhnjGoBBym+ awUpRFVvDLUB4+myvlMH+BN9D+2l0Vv6u3jJ2klg4xUvk/5eZaTmSIN3R/x5U7JkX9 rrXj0UVRP0/8aizaa2wRe+UbN05iiwDWdMhbPUxo= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org E25A46174D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=sricharan@codeaurora.org From: Sricharan R To: patches@linaro.org, linux-arm-msm@vger.kernel.org, will.deacon@arm.com, stanimir.varbanov@linaro.org, linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, catalin.marinas@arm.com, andy.gross@linaro.org, bjorn.andersson@linaro.org, sboyd@codeaurora.org Cc: sricharan@codeaurora.org Subject: [PATCH] firmware: qcom: scm: Fix interrupted SCM calls fully Date: Wed, 28 Sep 2016 16:12:28 +0530 Message-Id: <1475059348-30510-1-git-send-email-sricharan@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Patch [1] fixes the issues with interrupted SCM64 calls by returning the register r6 (Session ID) on the next try, but register r0 also needs to be preserved for the retry. r0 contains the result of the previous try. Without this i see that the SCM calls hang when retried. [1] https://patchwork.kernel.org/patch/9291589/ Signed-off-by: Sricharan R Tested-by: Bjorn Andersson --- drivers/firmware/qcom_scm-64.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c index 7ecd0e7..28b604e 100755 --- a/drivers/firmware/qcom_scm-64.c +++ b/drivers/firmware/qcom_scm-64.c @@ -134,6 +134,9 @@ static int qcom_scm_call(struct device *dev, u32 svc_id, u32 cmd_id, res->a6 = 0; do { + if (res->a0 == QCOM_SCM_INTERRUPTED) + cmd = res->a0; + arm_smccc_smc(cmd, desc->arginfo, desc->args[0], desc->args[1], desc->args[2], x5, res->a6, 0, res);