From patchwork Mon Mar 19 16:12:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132055 Delivered-To: patch@linaro.org Received: by 10.80.152.129 with SMTP id j1csp2994695edb; Mon, 19 Mar 2018 09:12:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELsG9iHLn2iMZhquoSQcN+jsu/A8sG+9LOsBq5/hIwVyo5F7THABQXZNAnV0zsG0l59QWo66 X-Received: by 2002:a17:902:2468:: with SMTP id m37-v6mr12783720plg.388.1521475978790; Mon, 19 Mar 2018 09:12:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521475978; cv=none; d=google.com; s=arc-20160816; b=xBPmL/aJ73WpXjcSfDfzVGnct06lkd3+y8m0QV0LIZ8WMQayvKC2TnT4QyIAupP26v lCTjHuxHqPLxw3Oo16XKDr+VJQFiJUtTeHCDyr3TWpCyg5Z0z8I6IEi4JXobyLp73Vo9 A0HG0k1k95omimdCxqLWNzfo4FS+Gq6Qh8+Bm29ICt4a9YQptJ9D/wP/iRIO1ndZLJFE tppom4WWvu0IyLNMSzBpb4wjgGkpkYm4IV9N+mK6pgtsVHtiCRC9aXYLOxglq4Jb8q7x Rsvu8fcncku6rQ4mTjAFZ0gYBSrqmSNzOe7L2lz88V+PqZxo/p4v4xcbdRnlAjJ9CcNH oZsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ugclcwzuy6hx1YMIxMGm1L9m0xnoxEvuvxxngJcZT94=; b=L4wseFg0QbPsGrvDo8PD+Is8N/ozybaPLZNbVAqwbYbAqagFwQLSk4Phf1cXUKsMnP Vfoo/TvVDCGxgCl6mToIDSntY6JIYFd00wQbgW+HFS8ISWR2igsaFArtuOWxWNhDmqAt HZ8OdfiWnuPpMEB3pnnWQUcBdXCTrnFlsAdJyQjcRl4aYnNenjE3KlVhOQmDS1SgGGYJ ra1iTuBjDnKdq8kZ1+sbooyUKDQ5udmPWxsgrwQjWkaBpVh+4aTw9arne3Xj9xRFdO4p sAGf9d4LLna2o+cvxVF8OYw9ApNHJYe+5UX1mCMQqNElIg2GqXE8Usyb2FACaTYWSru1 wW2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Ybv8Hvxv; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si239185plh.296.2018.03.19.09.12.58; Mon, 19 Mar 2018 09:12:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@microsoft.com header.s=selector1 header.b=Ybv8Hvxv; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966834AbeCSQMy (ORCPT + 10 others); Mon, 19 Mar 2018 12:12:54 -0400 Received: from mail-co1nam03on0094.outbound.protection.outlook.com ([104.47.40.94]:52832 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935246AbeCSQMv (ORCPT ); Mon, 19 Mar 2018 12:12:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ugclcwzuy6hx1YMIxMGm1L9m0xnoxEvuvxxngJcZT94=; b=Ybv8Hvxvcepgo65K0JQ4O9415LOvlj1v7E0EFrFVOMgbdllTNTrosDnn7QTRVPPjHHgIlsohlihN7i/a90l8E7e51RSkkRxLQbg3U3A1HvTyXEY1UbA8unE9u9dRF7L/HIAWXk1H+vUqM20YMjjHG6dWZCWLrju0NYjJ9BmJkLE= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1014.namprd21.prod.outlook.com (52.132.133.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 16:12:49 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 16:12:49 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Suman Anna , Sekhar Nori , Sasha Levin Subject: [PATCH AUTOSEL for 3.18 037/102] ARM: davinci: da8xx: Create DSP device only when assigned memory Thread-Topic: [PATCH AUTOSEL for 3.18 037/102] ARM: davinci: da8xx: Create DSP device only when assigned memory Thread-Index: AQHTv50OFZMmuBkY9ECUNoUh0zqzsw== Date: Mon, 19 Mar 2018 16:12:19 +0000 Message-ID: <20180319161117.17833-37-alexander.levin@microsoft.com> References: <20180319161117.17833-1-alexander.levin@microsoft.com> In-Reply-To: <20180319161117.17833-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1014; 7:Exv0L4VlBascF67xWrupmuGX4FhTseJFm4mCsF/g0BU4765XqQQPpgwTnIt847PqMLdCSNtkPdIjlO9Rc1rCrH8dx1n8rdt8Lvaz2KO0rGdv7FJDLfDAMGTElIBbVdeCskod/i98ifn/BsSh6er7I8YE/JQYQzxfOQNmNhxp2hadASe3+aqwrAX3RumumVJDzHTVYw3hjAxNXDM9JAntxN6O6I7uI7Zm1gLarBthI77tc3Ob/9JCLMliGCXFDNII; 20:t0irFSemJ00BRqya68wJP37+e3wEtdc5ptC0pSDIKfcjQg08lemabtCc3va06nDq4Sxl++6ZrdRojTUJWKPXn3vrnIgNfOvhAH5euIphEOzKV4HsipFLp5XNK46L7Q/VymD+Cw7nUbHCA2YJPCppQdkGRkIC0r76p1d/1oq77ME= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b1a74e33-4c73-4638-f095-08d58db4429d x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1014; x-ms-traffictypediagnostic: DM5PR2101MB1014: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(31051911155226)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231221)(944501300)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:DM5PR2101MB1014; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1014; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(396003)(39380400002)(346002)(366004)(376002)(199004)(189003)(2501003)(6486002)(478600001)(5250100002)(102836004)(86612001)(1076002)(97736004)(86362001)(99286004)(72206003)(2906002)(6436002)(107886003)(66066001)(6116002)(81156014)(10090500001)(81166006)(305945005)(8676002)(7736002)(68736007)(3846002)(110136005)(54906003)(26005)(3280700002)(105586002)(316002)(186003)(53936002)(8936002)(76176011)(2900100001)(6506007)(10290500003)(22452003)(2950100002)(36756003)(25786009)(5660300001)(106356001)(3660700001)(4326008)(14454004)(6512007)(6666003)(22906009)(32563001)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1014; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: KWdDD3I1ZHpGjfMUoqk1akC+HEkgWw1tJhPYjDLJDIj9YGV9xCtYCX8fzU6yryMNpaNtg6/2yfKhZOqrbdqGTXNl9TNgrjVSX0SCNDtgQJOBjwpjwI1grhn0e/9dPtA79x7Z5TX34IIp0jmm+DyJ8jglHZW3dlvkGiCjfSXACunyh/gSWU901y+cwhSP717UDtRb8csYN8glF5dusfZ3KVYFiCGezIsopaei0XaHthogK/0APRgGQIw8L9JIi1L9YsG78zDCMOBmXO8vgB0zAK7ewUWfyXwru/Y/OHZdY4fw/kbfGmzaUwfvtnRUUlTZTqs41jzrxb65TRxsSAi2Gg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1a74e33-4c73-4638-f095-08d58db4429d X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:12:19.2707 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1014 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 --- arch/arm/mach-davinci/devices-da8xx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.14.1 diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index b85b781b05fd..e83874ba6e6d 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -761,6 +761,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; @@ -799,6 +801,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 @@ -813,6 +817,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);