Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3468910imu; Sun, 11 Nov 2018 15:49:03 -0800 (PST) X-Google-Smtp-Source: AJdET5dOX1Z2jTL89646bzAoaZMzYyO7BRCSTraKhPWPc518cCiUxmG/McpQNxwDQHWJHxV2cd0e X-Received: by 2002:a63:ff62:: with SMTP id s34mr15537693pgk.325.1541980143812; Sun, 11 Nov 2018 15:49:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980143; cv=none; d=google.com; s=arc-20160816; b=BoZUwrnJd5sa5NjIzhOif7p/IAo+Kl4U6/qRurVRHEyAu5tb5drSwL6MgRohN/4xx2 D8gUbocH1R0L58/ehFv0x3BakOXF23R0K8JNpv2cA55AW3ooF+PXlHF5cgB25gRhtegd 7ETnRkq1woSRu5MhLNj++5wil0EMYuJD6IrSR07Q/Rdbq1VKCN/Y9RwIKPa+jpD/oTeK 8TsHymhIJHKYlYrBlQo/eZTZlnlJnEzm2xIi3eFE4pTunLXG8tSRuCSRv9lKTV/fWIMI CcKhRpwxh8vU6WKi7ehotC06HICwoso5SWvmfwtBjFyRIymya2SvSnvENk0kgweop2dq 7N4w== 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=fi8R52sgnS/W/Xr0+NTcOeLLcxfqsQS4aRM1CMomsLI=; b=dI7wNjVEexb/DMGRAOxCABvhIHJz4paa/xAqNL6ZnbBJ31V4nA2O3I7TVkBzNke06K 0rQowqW8TJPYJ7LwklZCUy95zsaIDIn1yjp6VHCO2xMAb4jt31Gb+8hY29mv84RPLLt+ XD8HZhuiQLNEsSgxD1ghIkZmIOfg5RkUuhgXHp8hgcidaymD/j+tEp05An6QAvt1iubd tVbOs7rTLr6Vkph6giqpNkutFTF494LpsSutALPuDkwVGIVD7t5sBC5ppdfDTZN5UJ0m rgAOJ1ax29ccxBSPvXSZcreP++V9fmMghvdYlzgVJ+J+9FpJMDvyQD6q6XpsfXf8y0oU 9PBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZX1RDayp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m26-v6si16132800pfe.80.2018.11.11.15.48.48; Sun, 11 Nov 2018 15:49:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZX1RDayp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387508AbeKLJhh (ORCPT + 99 others); Mon, 12 Nov 2018 04:37:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:39252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733161AbeKLISs (ORCPT ); Mon, 12 Nov 2018 03:18:48 -0500 Received: from localhost (unknown [206.108.79.134]) (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 9192C21780; Sun, 11 Nov 2018 22:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975332; bh=QMRfcFLPkojpwkaj+58X/PIDME6X3u4urRE5qTdJWWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZX1RDayp/DI2divOktMw5ZZXexAoWkpkIJ6Cuq9NQikFJZp/KSOXxlgp+yLEZJ2yU whXpOV4iCjER7S4EBhvUMzkzN6nrbM1mxhyxZHkHleyespu62tz+wBhMTMc24vOErG zrkB48X2Z773ATnD6+4VTUkqYltKarKpuDy1NkE0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Andy Gross Subject: [PATCH 4.19 321/361] soc: qcom: rmtfs-mem: Validate that scm is available Date: Sun, 11 Nov 2018 14:21:08 -0800 Message-Id: <20181111221659.103707839@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bjorn Andersson commit 137dc5843faeacabf48fc22a8dc58c4e0b4f0927 upstream. The scm device must be present in order for the rmtfs driver to configure memory permissions for the rmtfs memory region, so check that it is probed before continuing. Cc: stable@vger.kernel.org Fixes: fa65f8045137 ("soc: qcom: rmtfs-mem: Add support for assigning memory to remote") Signed-off-by: Bjorn Andersson Signed-off-by: Andy Gross Signed-off-by: Greg Kroah-Hartman --- drivers/soc/qcom/rmtfs_mem.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/soc/qcom/rmtfs_mem.c +++ b/drivers/soc/qcom/rmtfs_mem.c @@ -212,6 +212,11 @@ static int qcom_rmtfs_mem_probe(struct p dev_err(&pdev->dev, "failed to parse qcom,vmid\n"); goto remove_cdev; } else if (!ret) { + if (!qcom_scm_is_available()) { + ret = -EPROBE_DEFER; + goto remove_cdev; + } + perms[0].vmid = QCOM_SCM_VMID_HLOS; perms[0].perm = QCOM_SCM_PERM_RW; perms[1].vmid = vmid;