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: 74352 Delivered-To: patches@linaro.org Received: by 10.140.29.52 with SMTP id a49csp627193qga; Fri, 19 Aug 2016 22:51:45 -0700 (PDT) X-Received: by 10.157.0.8 with SMTP id 8mr7215124ota.20.1471672305162; Fri, 19 Aug 2016 22:51:45 -0700 (PDT) Return-Path: Received: from mail-oi0-x22b.google.com (mail-oi0-x22b.google.com. [2607:f8b0:4003:c06::22b]) by mx.google.com with ESMTPS id p21si5736977otp.228.2016.08.19.22.51.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Aug 2016 22:51:45 -0700 (PDT) Received-SPF: pass (google.com: domain of andy.gross@linaro.org designates 2607:f8b0:4003:c06::22b as permitted sender) client-ip=2607:f8b0:4003:c06::22b; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of andy.gross@linaro.org designates 2607:f8b0:4003:c06::22b as permitted sender) smtp.mailfrom=andy.gross@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-oi0-x22b.google.com with SMTP id 4so90443581oih.2 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=HM2cabTiQiaKhxBd1WVqONFkmhyyS5nW90YN5Sjqx77ZIEV1vy8SmFLYokUmnTKsOE PmewuMuha4jSzGNNpx6Q/nzWjwh/7E9cIY+YbO1IvkTGo1vdGIrPuS936IMMmfNCKMC7 9ajstIdB7Ixrg66vnwcmxnmf05VtqV/nvxH18GzeecUsKSNhilEkRmnS+jgMpvjwmUaB +P+pwrZiCV/XkL5plpvauVlSNo/S7tdZI1B6M62uRAa/YLtx+XqjGnHjIhcX2PCxqqB6 6crZVK8CHxJzUktN/DoR6XI1J1xEg4odqDpW08EbF4ZkqYa0VzJdJU0kN0FH+CxlO3++ Qedw== X-Gm-Message-State: AEkoouu9ArS0YHe2CZjQKZD1bqVs4N8xZg5z8aW87MUdVoF1QSEQfxo67BNOVy58ITCWBqLrDy0= X-Received: by 10.202.5.4 with SMTP id 4mr7018661oif.31.1471672304938; Fri, 19 Aug 2016 22:51:44 -0700 (PDT) Return-Path: 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> 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(-) -- 1.9.1 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);