From patchwork Mon Mar 19 15:59:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132088 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp67735ljb; Mon, 19 Mar 2018 14:24:04 -0700 (PDT) X-Google-Smtp-Source: AG47ELuLtQh+nfzcuNAfAhd4mw8rRTDHcwKTeQ9DASay4clWo3MdMcyoiU1UZzkflTKv997pH8Mu X-Received: by 2002:a17:902:bd46:: with SMTP id b6-v6mr13699466plx.38.1521494644739; Mon, 19 Mar 2018 14:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521494644; cv=none; d=google.com; s=arc-20160816; b=ObARK7Pg8mTvzqrNtrLYDzKrZLhnk2TegXIjJ0w6tzBFxHS1St0eD14k73z1pmNJNy XRgSFJh7pQ6xckzRmRJZz6EPOYlTiqO+bxFL34vO/osQgU5UTG3KPzjPQHXY0LPv3ugK m1H2i/GUXPtcg75fAl7TCv7qF6J6uRo1ZaVsTPaBhANdz5MnPArcvNYkA8ZIhuLFBMrY ia4hTjHce7wtbJgNZE1ghSVJZTtCmzFNISnjBicqbRRA6zuFUNo4llmv/arvPmWxvEDK B+SI02nfUhd/9h42ffwDFpjXso8RVsNBOwORFNmlYumjvCgVe2Vu5m4n2KejydxdqNsU j60Q== 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=N5d25f0oKnulkQWva1uP8wQDxssyF+OXLu4kzs9yxRY=; b=BTVDIWch6Eeh3HtYZnspp5YPvS6JMNIoXejT3bOfb3TqnsE//K9gulM7Cmof4Tc02a s5jnFyg7LSwESi1OuwPBJwKNgu8Ev9a680qkBax0KP32vtdMNXTEH3KAdYL/bxzGmEow 4PdhF73lhqJoKdp99/v1pPpLpL/VhonFUwJlCz3yzTi/kLzi3us/C/sKqnxJVVDq00b2 fSQNDxSpcZJfPFvQNxVuPaH34wBtxEL1Gs+yWvYbeIUKFGk/EJCDiyVFysUDzyX4NfHl clm+Z0YuGd7sKt5uLajlrJff+WTIQo9b+Zoj7EMgNdz0yD217iBXk87045JHy/O3w91o l9fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=oC/nqZQU; 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; 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 k17si94315pgf.534.2018.03.19.14.24.04; Mon, 19 Mar 2018 14:24:04 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=oC/nqZQU; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031138AbeCSVYB (ORCPT + 28 others); Mon, 19 Mar 2018 17:24:01 -0400 Received: from mail-sn1nam02on0102.outbound.protection.outlook.com ([104.47.36.102]:56553 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934840AbeCSQAX (ORCPT ); Mon, 19 Mar 2018 12:00:23 -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=N5d25f0oKnulkQWva1uP8wQDxssyF+OXLu4kzs9yxRY=; b=oC/nqZQUXBbdRBvnK30UepFiwmMOMKZnv1xk2unqQnxEK70e2cx95k+axn3rHKxinYiGyQK6mIrNkzt2o+FOC63+P2JnQhggcNOsIKbW51WmPKjaOGaKmG2SrAjsgjtrCJ4QUGaVRTn7S68R36uFS0g2rF46LDyVyCxfDFCJxqg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0984.namprd21.prod.outlook.com (52.132.133.30) 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:00:08 +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:00:08 +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 4.9 089/281] ARM: davinci: da8xx: Create DSP device only when assigned memory Thread-Topic: [PATCH AUTOSEL for 4.9 089/281] ARM: davinci: da8xx: Create DSP device only when assigned memory Thread-Index: AQHTv5tHdCckqqxJB0yNatoZ5wTJeQ== Date: Mon, 19 Mar 2018 15:59:37 +0000 Message-ID: <20180319155742.13731-89-alexander.levin@microsoft.com> References: <20180319155742.13731-1-alexander.levin@microsoft.com> In-Reply-To: <20180319155742.13731-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; DM5PR2101MB0984; 7:yd6D6UlYHMVDndWkCnYWL2r1QBYTLIppo9Vsl5NH0r9vAtfdugOqw19CmSjAOJBABnE6QUMUyb73UQF/4e5rz5vGQwWNT9F2PuILcX8l6snrdyabGTv7SuAAfnOif9YOmzgXnArDgU+GyvWjGnhMNtVgzOiWhIOFll9hICeYIYUgrUDtQn3fSyglFjd1p4ZqvKMrog7RhOycNvNzyAfnUACzHWCM0DvfYON+VqdL1E+XcX5B4PVEnGQxY2rc/yZE; 20:STrakXJMFvCPIrhY2ADobqXWFgqqPoEvNDaup6IVDtmFxXP/p9GSsh9y9enFEnibBR5A17llFFSeLLbEehgvqj9s/A+Dv/jo6LE72q/4T8l4RMjnAQ1nIFCoCS0pQYcvYnxDrAOciSbxxYDa03E33znZTkHx8M0VffAf6OxbrYc= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 7a08e85d-e6fb-4671-c59b-08d58db27d20 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB0984; x-ms-traffictypediagnostic: DM5PR2101MB0984: 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)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR2101MB0984; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0984; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(376002)(366004)(39860400002)(39380400002)(396003)(189003)(199004)(6116002)(25786009)(6486002)(97736004)(1076002)(4326008)(2950100002)(6666003)(66066001)(3846002)(36756003)(81166006)(8676002)(6436002)(106356001)(8936002)(81156014)(2900100001)(105586002)(5250100002)(2501003)(305945005)(7736002)(10090500001)(5660300001)(14454004)(54906003)(68736007)(99286004)(26005)(186003)(6506007)(3280700002)(478600001)(3660700001)(86362001)(107886003)(10290500003)(6512007)(86612001)(72206003)(53936002)(76176011)(316002)(22452003)(102836004)(110136005)(2906002)(22906009)(32563001)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0984; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: mORejoKZJq06BQ0qNPSAgB28mrYA3uqvC9a+dFkslpdGY/B1TKcyzPKCPScGc+q1AOh2TFbg5hzMysGNtutL4ln5FlImhWWKTWlaAuu2DTJJWs7UKPpoR4B8K7m3H33HxtLAriGRI0s3GNV0RWDkSfUARNrt+RdqbRDR9ZXYFsipMNe1A70CVRBMC7pvNeRM0TiJI6K++6WsmhjviyFOcbO/NV1Yu/ajMtYmPexu85rzv3ukxQ3VSjL1Zsfjp2y4qdziWVDbjQ7kWcFRmw3+vpmMWfX0IubHsX7q0IqJ0iYTRQmeqfJSfOBjKlixo4Lk8B+mHfTVUc8Q4DUicGNSdw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a08e85d-e6fb-4671-c59b-08d58db27d20 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:59:37.1130 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0984 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 add3771d38f6..9a22d40602aa 100644 --- 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);