From patchwork Sat Aug 20 05:51:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 9291589 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 5B963608A1 for ; Sat, 20 Aug 2016 05:51:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B579291FB for ; Sat, 20 Aug 2016 05:51:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F35A2944D; Sat, 20 Aug 2016 05:51:53 +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 DA10D293C6 for ; Sat, 20 Aug 2016 05:51:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753735AbcHTFvv (ORCPT ); Sat, 20 Aug 2016 01:51:51 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:33549 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753003AbcHTFvp (ORCPT ); Sat, 20 Aug 2016 01:51:45 -0400 Received: by mail-oi0-f52.google.com with SMTP id c15so90417027oig.0 for ; Fri, 19 Aug 2016 22:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iyTeWSUsoE6qc8uKM2B8rhN9l3pBg+geZteVr2wpyEc=; b=O3XWLtRi8HrCUpBBnuZpfl5t6VM69Y9VTqCswbhuZVOtA8VCll5uzmRL3iooJzxTab h+buox0VpiHoIBDIIJ2MxY5VjpuUwAPO2So2mus1iU/1sNHBo1ePfWQHe82pUcEa/wUf unkhSyn6aUVOffIu9Sg7XCh4oYXnCAy54BPeY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iyTeWSUsoE6qc8uKM2B8rhN9l3pBg+geZteVr2wpyEc=; b=SU9VjGNuge8Wa3qNOtmPnDnMAwfc6MzRhCxGR8jnp9u4w6OF/wrZfLjdAf+ugruhyw rvxlfcl+yngzwMRL9oIK+ZivaduWTjNZOhQTIWMnT1Z4f8sOoWsB+xGy6CMuB1mcVfIn FEwBQfRjq2LcfhCNMFnCxlRrw2G5tX6cWBdVRbIfRMur4+ZD6xVH8K1zc4g2fGJOJsrN MMStMfoW0P4gIZTyrmksO1zzmNf7BGYffOXWT3YQBY+zrSerxsvyejTvqx8peP5751BD gMVnS9k+F12vXlEm9Ve/W4RG7zaAsmdMu77GjuQf0NxK4dX7q1y8ICZkyuvK5Dz5MNwz 8LTA== X-Gm-Message-State: AEkoousgjH1Iw0CkKVIAZmN9EvwSbbH+1n//fVVrhxCF0wnWnoYe7450iXOremxCifLP9biy X-Received: by 10.202.5.4 with SMTP id 4mr7018661oif.31.1471672304938; Fri, 19 Aug 2016 22:51:44 -0700 (PDT) Received: from localhost ([2602:306:3406:6500:b409:62b0:b7f7:75f0]) by smtp.gmail.com with ESMTPSA id x2sm5800494otd.39.2016.08.19.22.51.44 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 19 Aug 2016 22:51:44 -0700 (PDT) From: Andy Gross To: linux-arm-kernel@lists.infradead.org Cc: linux-arm-msm@vger.kernel.org, Will Deacon , Catalin Marinas , Srinivas Kandagatla , Stephen Boyd , stanimir.varbanov@linaro.org, linux-kernel@vger.kernel.org, patches@linaro.org, Bjorn Andersson , Andy Gross Subject: [PATCH 2/2] firmware: qcom: scm: Fix interrupted SCM calls Date: Sat, 20 Aug 2016 00:51:14 -0500 Message-Id: <1471672274-19317-3-git-send-email-andy.gross@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471672274-19317-1-git-send-email-andy.gross@linaro.org> References: <1471672274-19317-1-git-send-email-andy.gross@linaro.org> 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 This patch fixes an issue with the SCM64 calls. Sometimes SCM calls can be interrupted and return early. When this happens, the contents of register 6 will contain a session ID that is required when resuming the SCM call. Signed-off-by: Andy Gross --- drivers/firmware/qcom_scm-64.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c index 4a0f5ea..1851294 100644 --- a/drivers/firmware/qcom_scm-64.c +++ b/drivers/firmware/qcom_scm-64.c @@ -131,10 +131,12 @@ static int qcom_scm_call(struct device *dev, u32 svc_id, u32 cmd_id, qcom_smccc_convention, ARM_SMCCC_OWNER_SIP, fn_id); + res->a6 = 0; + do { arm_smccc_smc(cmd, desc->arginfo, desc->args[0], - desc->args[1], desc->args[2], x5, 0, 0, - res); + desc->args[1], desc->args[2], x5, res->a6, + 0, res); } while (res->a0 == QCOM_SCM_INTERRUPTED); mutex_unlock(&qcom_scm_lock);