Received: by 10.192.165.156 with SMTP id m28csp1135707imm; Wed, 11 Apr 2018 13:06:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/G99N53RSMFuM+tUDCWTho/iNmzhiVa32IsdKjdbNgfJGgP87hdtcGQlMciPiF1LSjMq1G X-Received: by 10.98.178.20 with SMTP id x20mr5264599pfe.32.1523477175011; Wed, 11 Apr 2018 13:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523477174; cv=none; d=google.com; s=arc-20160816; b=igQBVLwlhOsykcKakgbeSR9WRVHBobTci/w5nHHUeOEmEtOxutGPpvlhjvleyYyGoC tGRQzHzxmzK2sXuo0An8TNVnox9nEMPzn0zLuissacxLMVS/ySXRerNJ3ivvIq6+t5GV 9H1J+psD6ZN7CcJVpuiJupxe3ebz36WcBp8A9KVVtbUeAd4MdlFsLmggRoqfGKTzpMvq oG2zNIUwU0KiUx2QgDKdy+IdPbSDrhyVDp2hBaIhTmnG53m7XZXgOd4n0Fa+8pCMStbc 6BCOuHKAS4vAofntrAuJz5DwjL5a+EzIznIUNPijyb4MfW9HioE/4ceI91NJMPong55F UYbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=IhG23R68S+TAW+7pRTVb/u752CFFJ0QlXnIF+pBjAN0=; b=ERR+M5GBQV3PXDgQO4znV4AKSFC7+gLGPRFDXkkn6yRnghfKeQvKs/MqM/CjhvkaTT SV4efGFbzSHT1VY4vsv3xdZFkZr99LuI+VeRYwWDCFhV7mmOVcDCpjvNBUo/rJeFhExA NowyMg6w5ebgsYWcAnJfKuRzTvEMUlchZuZGYZrgVQjBl1nG3Q33wzn3exYhRlz3o0wY 71o4tAdiT3HB+DFN4Neu3zZd3CrLPHgvNguscFmGoccFs6TjnL7AafcNmRqMyCoh5oIt SNMCsX9t153ZvPTPYEtvuRLwecRvG5OvC6C3GZuRLDYIx8qXmlPk3DZfrCT5VAxTO04M jlJA== ARC-Authentication-Results: i=1; mx.google.com; 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 j3si1197534pgn.447.2018.04.11.13.05.37; Wed, 11 Apr 2018 13:06:14 -0700 (PDT) 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; 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 S1756676AbeDKUBT (ORCPT + 99 others); Wed, 11 Apr 2018 16:01:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35792 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933882AbeDKS41 (ORCPT ); Wed, 11 Apr 2018 14:56:27 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 404F9C03; Wed, 11 Apr 2018 18:56:26 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Suman Anna , Sekhar Nori , Sasha Levin Subject: [PATCH 4.9 088/310] ARM: davinci: da8xx: Create DSP device only when assigned memory Date: Wed, 11 Apr 2018 20:33:47 +0200 Message-Id: <20180411183626.046206223@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Suman Anna [ Upstream commit f97f03578b997a8ec2b9bc4928f958a865137268 ] The DSP device on Davinci platforms does not have an MMU and requires specific DDR memory to boot. This memory is reserved using the rproc_mem kernel boot parameter and is assigned to the device on non-DT boots. The remoteproc core uses the DMA API and so will fall back to assigning random memory if this memory is not assigned to the device, but the DSP remote processor boot will not be successful in such cases. So, check that memory has been reserved and assigned to the device specifically before even creating the DSP device. Signed-off-by: Suman Anna Signed-off-by: Sekhar Nori Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-davinci/devices-da8xx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -821,6 +821,8 @@ static struct platform_device da8xx_dsp .resource = da8xx_rproc_resources, }; +static bool rproc_mem_inited __initdata; + #if IS_ENABLED(CONFIG_DA8XX_REMOTEPROC) static phys_addr_t rproc_base __initdata; @@ -859,6 +861,8 @@ void __init da8xx_rproc_reserve_cma(void ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0); if (ret) pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret); + else + rproc_mem_inited = true; } #else @@ -873,6 +877,12 @@ int __init da8xx_register_rproc(void) { int ret; + if (!rproc_mem_inited) { + pr_warn("%s: memory not reserved for DSP, not registering DSP device\n", + __func__); + return -ENOMEM; + } + ret = platform_device_register(&da8xx_dsp); if (ret) pr_err("%s: can't register DSP device: %d\n", __func__, ret);