From patchwork Mon Mar 19 16:06:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132064 Delivered-To: patch@linaro.org Received: by 10.80.152.129 with SMTP id j1csp3069600edb; Mon, 19 Mar 2018 10:24:49 -0700 (PDT) X-Google-Smtp-Source: AG47ELu9nBC+zdoNCbuX1lRw6MSxAukW2nU2I3MPBwt63V0LCsMmeh3HhvhlpwrdVhVqbXzmqh3T X-Received: by 2002:a17:902:5328:: with SMTP id b37-v6mr13532033pli.332.1521480289810; Mon, 19 Mar 2018 10:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521480289; cv=none; d=google.com; s=arc-20160816; b=pQLo7AfXbz6yYJCrlyv4PEpoKk25XFQggbN+dHWJupT1Os2XMyG+6/fz6fvvDKTlEp G+isP+VNX26LzofTC5nTDuDRjY9itbRPymj+/J8q4CvQjaK61+HaXWr1R1f11TKXVN98 re18tl55H+5ZpHSk1qbePgLqGnSYhRSL3KjbqlsW84YyAEW8h3sVaa0sw4geCfJVRc/B sOREqhgUk5UnqXBOXKSSbz5GRCJiJn5yPaEt83rwojDTsuVZZ8umjWsPgGHHZ5XS9oPt IJ3S+ZTa3krW2sdEVBQu3eswYdbYVoIhfcEHyIUnp2Wel93R/+rFw0Cvt7XW8v6sCtrb nEig== 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=Kjpzc9ffYBr2qQJcuWfbKWXUcNhcRVB6zvK0Gq3DqG8=; b=whYqgmi5DVIrL9InVRSTguOrCQCyhWmdYG9R3M17syhQoOZB3944NiNJfYtmxtDf6j CwEv0sVhF8GPm23NfXCq4PFawYSxGHKMzQ/tmT+zxBIVYcdNC1Isp9ZA1/nBkMXx3QgO Jgq71z/LKS4QaIER0eWPVA9b9SKtjbY4xDq6/4+2tYQLHkohVOg0ctt46qldNpCtEBUa CGWWHqRe6kZr1in1TjoflxNnHGPKfXSUmlioUIWsZIX1dzTQanYhjR8xRW5uXH/Ct+ub Q6YGLt3Ke2JU+kae9wxivWQrgh1zJTO8zYIq0tkc0vw9fFzMmeFOL/Ta/Re9VScDTzcg p70Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=id7ycGpI; 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 i2si263452pgn.226.2018.03.19.10.24.49; Mon, 19 Mar 2018 10:24:49 -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=id7ycGpI; 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 S967977AbeCSRYp (ORCPT + 28 others); Mon, 19 Mar 2018 13:24:45 -0400 Received: from mail-dm3nam03on0096.outbound.protection.outlook.com ([104.47.41.96]:30671 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966306AbeCSQIc (ORCPT ); Mon, 19 Mar 2018 12:08:32 -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=Kjpzc9ffYBr2qQJcuWfbKWXUcNhcRVB6zvK0Gq3DqG8=; b=id7ycGpI8g/UiFomwc3NY88CTd8CiYB0dZcMP6+FCvvgMgC7cL7U38nOKG3mIrrz35prGExuTJ77Z/Y56G1WYYv8D/Pk1Mt2RXf+X9YpgilyL9oXsXDiVA4VBlbRPst39/DRc+rRqnQwYPKPw8jVKWV9uc8lVKDempYXlJM5UPk= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0805.namprd21.prod.outlook.com (10.167.105.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.2; Mon, 19 Mar 2018 16:08:23 +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:08:23 +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.4 060/167] ARM: davinci: da8xx: Create DSP device only when assigned memory Thread-Topic: [PATCH AUTOSEL for 4.4 060/167] ARM: davinci: da8xx: Create DSP device only when assigned memory Thread-Index: AQHTv5xBTvQEAGhTv0SX3KhfeUG7bg== Date: Mon, 19 Mar 2018 16:06:36 +0000 Message-ID: <20180319160513.16384-60-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-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; DM5PR2101MB0805; 7:lOtiBPOSPOR+3f/DtdCwIL0u6kQeN4qqRBiGl+jizkBUGM1H7YpKvoe4yctjqdrGrX+VQk6QRNxe6noLcZNTB7tyP//duaZH9dzRIQa+HSfMow4hM0k4HOK1FwtaYEPuGBsd9BVdp6SeLghu/dU4QYQoRWDSWwKFg0+ERKHXYDRQZA1FIYqEH0EktkIWqTkLQiE/CjyXC4frrkno4RuKlhxcfJTiljYkXe/mxT797swNsDMl0ELE9PydJzRCP/m5; 20:B+iYnCC48HMUSB8D6yCK6U9sXXVHX2gkudqQ0L7wAw+wjsjnlHLfimenKWKSnIRkVy7Cote9tQlAf4AJan1OLk3k9MSjNucB05W57CH2GeNFWKL4roi1dO31ZOz4kUQyOVCzgAfZsOOtKcmfWqs1IeXomAQJ5x9nK3pI7jpyx7U= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 90012802-5629-4ece-9ac9-08d58db3a462 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB0805; x-ms-traffictypediagnostic: DM5PR2101MB0805: 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:DM5PR2101MB0805; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0805; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39380400002)(376002)(346002)(366004)(396003)(39860400002)(199004)(189003)(2950100002)(305945005)(186003)(86362001)(6506007)(3660700001)(6666003)(5660300001)(6116002)(8936002)(3846002)(1076002)(26005)(7736002)(6486002)(2900100001)(6436002)(2906002)(86612001)(68736007)(81166006)(81156014)(10090500001)(102836004)(8676002)(14454004)(105586002)(107886003)(25786009)(478600001)(2501003)(5250100002)(53936002)(3280700002)(316002)(54906003)(4326008)(6512007)(72206003)(66066001)(22452003)(10290500003)(99286004)(76176011)(36756003)(97736004)(106356001)(110136005)(22906009)(32563001)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0805; 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: llyp7qLht/S7P2vrikKZsxqSUBXgA14hd/8kj19f9LsbgmOQw+ftMPQrVVQY/1mf2qA0/b35Zo6S1SLUqNsBykmGcSTtuz0AK8uVNZK6J5PkStT+OwOySjVMVrNelgDyg+ElGUwKf3xtYp9DDtttQ/PyOQ0IZ2dBcpahMRInPRD1BQjizVxFFoSSbVww6MS47oLGskxRQwFA4mM4bGhVDsjIW0UVv8X/ZFHc0XwO/5oXn48nk4CrdA6Vn4lIhz07xflZH5b9Bc0ZpXGCWastdVhO7LJi07Kz6eZyNKGfYYgtlHA7yirfLFz5ChV1Py+s4JqTN9dWi9t1EUomQXVyEQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90012802-5629-4ece-9ac9-08d58db3a462 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:06:36.1477 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0805 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 28c90bc372bd..78d325f3245a 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -795,6 +795,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; @@ -833,6 +835,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 @@ -847,6 +851,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); From patchwork Mon Mar 19 16:07:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132053 Delivered-To: patch@linaro.org Received: by 10.80.152.129 with SMTP id j1csp2993819edb; Mon, 19 Mar 2018 09:12:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELt4ZxgSlB2WIBXdCbkihrVXtgQPkco3Wgb7jycfTCWUrxoGltOZcEUbiG3FgPIrCAjXsbDd X-Received: by 10.99.117.92 with SMTP id f28mr9666585pgn.421.1521475937567; Mon, 19 Mar 2018 09:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521475937; cv=none; d=google.com; s=arc-20160816; b=bSnQJZJUz/xT7OfDjbTWFg2e9t0Y7H2Q5C/p/UTFEThjGmhbdXXC9IiqOf639450C7 obp+NPNlBsUHAb98rn/jaxq0yYQzag6eOtefg+gF7/B5xs3mJFwnwCGbCOGIIJI5IaUu 22Y3blunqpO8gYEDExlYQovfImTXd2szcQTnR5wKDEeNd4dZWasrxB/YD2kW5QhpM6D5 LZMlyK3bnoCJ5N2DpRfhbRYSTKR/ISFBQkuMW4oYAfcbko5xBYj38IvuUVhsxb/weRBL MHd20FWlFLHQg9eVKjAuYmdavWm070NaZDu+gQjdsTwaGaS5SpcXJuIUv8vuXFeEin3Z qrzA== 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=jjYKrduvgm1I+kEMxFAd1I3ROjx172A9yBaABBRQB0k=; b=Tg/Qy1TjBe3F+c45FB7OSuMGKA9CRPLUWNiou3kNAuFQm9d2XOYZJmQLW/sdhef5pt SMCIUoccTBClORBArejo3ITJzbPAl/dSPtTyTZ0TkYSF3arJvCe5HjOOEAzV7DnyXJJO d00FLIL3L0g7h3qlLiXcBj1Yyn+ZGY8GCqSogu0SIymMNfY5v1VCD1m4nRobMOJ+t9rL kDDW2NtCOQ98H7oKjm3oLEXHj+TZgmCpdfgqVxS37TE+j33JgGeAvHTa8zs5B6RB/Fy0 rViNr5I5jIdD2WuuRm7In23wofClaZz6hP9c4spqzmvUfPRH1GwkLVwIixnz4l27szeI BkJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=M/etLcZB; 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 s36-v6si224022pld.556.2018.03.19.09.12.17; Mon, 19 Mar 2018 09:12:17 -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=M/etLcZB; 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 S966597AbeCSQMO (ORCPT + 28 others); Mon, 19 Mar 2018 12:12:14 -0400 Received: from mail-by2nam03on0106.outbound.protection.outlook.com ([104.47.42.106]:22396 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966565AbeCSQKH (ORCPT ); Mon, 19 Mar 2018 12:10:07 -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=jjYKrduvgm1I+kEMxFAd1I3ROjx172A9yBaABBRQB0k=; b=M/etLcZBY1YT2gA+u0iy1I3BKZjY3DFkio86+dOBjyYWYoJRiRGkcSiE4F4DkUbz01s1klX345Bb4W9VRoL4gvmzAgegYgTIME2w2hWZLWmPw20TP08Lakr8wT19q6a6d/S1OpmXkvvDelrxCkwOb2m0NQKNTnbb1FgPTmrAWrg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0919.namprd21.prod.outlook.com (52.132.132.164) 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:09:59 +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:09:59 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Sudeep Holla , Michael Turquette , Stephen Boyd , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 111/167] clk: scpi: fix return type of __scpi_dvfs_round_rate Thread-Topic: [PATCH AUTOSEL for 4.4 111/167] clk: scpi: fix return type of __scpi_dvfs_round_rate Thread-Index: AQHTv5xol0X3xA81fE+pnP6PZStv5Q== Date: Mon, 19 Mar 2018 16:07:41 +0000 Message-ID: <20180319160513.16384-111-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-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; DM5PR2101MB0919; 7:Xkn1g46ScLPiGLCw2bc1IrjwlgznroBjbvmDEDwJo+j+/7yXcMCigJG4vKrDwmeb9ZsEl5AYN8r72C3XZcgGB1GLq6MSfSxmYKjRMAV3ne92lNOrq0YG6R5nEx5ocVX0TD3y88mjFuPOjtlIus4IV0G1Q3/hfu53m19G6ajXm+MRlxunDocwOH34PH5KtzvE119ZLpsOCcgOeb6Fvtr0P0SxAHagCVrRcSgNpye/hNu3ywrP90AyCPI0rjMVfabk; 20:OeQE4N3exn7hj51/biGodfPag6sWTDGjB7zXN+mE3LEPH3qupfigVchUoXbyR9Y+uIe1+yqvrSqu1ZEULDUwIkYjkrYFQipYAUjz3uRXlmYU18WNHjnHAfzOKaxNpJflvoYxy/cnX1w5DXoON3AmZDnLYW8+Fb2Lq5VEJKcI/bM= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5084075a-4bcc-4a45-4ea7-08d58db3dd1c x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB0919; x-ms-traffictypediagnostic: DM5PR2101MB0919: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(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:DM5PR2101MB0919; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0919; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39380400002)(396003)(39860400002)(376002)(366004)(199004)(189003)(66066001)(575784001)(2906002)(86362001)(10290500003)(105586002)(8676002)(305945005)(110136005)(478600001)(4326008)(7736002)(81166006)(3280700002)(6506007)(97736004)(107886003)(5660300001)(36756003)(8936002)(53936002)(86612001)(14454004)(1076002)(2501003)(6116002)(10090500001)(76176011)(186003)(3846002)(5250100002)(6512007)(99286004)(102836004)(106356001)(72206003)(81156014)(2950100002)(6666003)(54906003)(3660700001)(22452003)(68736007)(6486002)(25786009)(26005)(316002)(2900100001)(6436002)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0919; 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: xoxGdWSalLDPzpmMIIyDf4hq6QQXdn2kZm/pBdtbmtyudI8qqd1mRZS+DRJIKBBuvBlf6lk78l/A9650CR4mt2iNcEbfgjYi8eNpC2oallZ/VEsBCyBLaWrSesXAncM4NNY2Fc4alm5bVDVTB6kQ2ENCE05GSoqRrj+fpf3LZwmeTPgrLIIU0SCDK7wjS4jgFyoOISBIY/FlwqTdi+1TSQ7065Khwn0BAOzvjdTDYJ0dOiFbkemGc5tPuxgUka3isrjntxHK1rOhjXN5jLPkdXdfTiVC9fGAdAfg4UxIXtpGeCA8po1s2MobTXguS8f558gislM0vWhG0HHhkTh9gw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5084075a-4bcc-4a45-4ea7-08d58db3dd1c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:07:41.2238 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0919 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sudeep Holla [ Upstream commit 7374aec95636ca39409545eba4ef5ff3125c2346 ] The frequencies above the maximum value of signed integer(i.e. 2^31 -1) will overflow with the current code. This patch fixes the return type of __scpi_dvfs_round_rate from 'int' to 'unsigned long'. Fixes: cd52c2a4b5c4 ("clk: add support for clocks provided by SCP(System Control Processor)") Cc: Michael Turquette Cc: Stephen Boyd Signed-off-by: Sudeep Holla Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/clk-scpi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.14.1 diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c index cd0f2726f5e0..c40445488d3a 100644 --- a/drivers/clk/clk-scpi.c +++ b/drivers/clk/clk-scpi.c @@ -71,15 +71,15 @@ static const struct clk_ops scpi_clk_ops = { }; /* find closest match to given frequency in OPP table */ -static int __scpi_dvfs_round_rate(struct scpi_clk *clk, unsigned long rate) +static long __scpi_dvfs_round_rate(struct scpi_clk *clk, unsigned long rate) { int idx; - u32 fmin = 0, fmax = ~0, ftmp; + unsigned long fmin = 0, fmax = ~0, ftmp; const struct scpi_opp *opp = clk->info->opps; for (idx = 0; idx < clk->info->count; idx++, opp++) { ftmp = opp->freq; - if (ftmp >= (u32)rate) { + if (ftmp >= rate) { if (ftmp <= fmax) fmax = ftmp; break; From patchwork Mon Mar 19 16:07:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132054 Delivered-To: patch@linaro.org Received: by 10.80.152.129 with SMTP id j1csp2994083edb; Mon, 19 Mar 2018 09:12:30 -0700 (PDT) X-Google-Smtp-Source: AG47ELviP686cvSDeiPJWT4ZTreu/K4vQJ7/wQEx0bWSR0Z5bufx59lfF0/QvP2fcpi7wjx1sQdi X-Received: by 10.101.100.9 with SMTP id a9mr9559948pgv.209.1521475949892; Mon, 19 Mar 2018 09:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521475949; cv=none; d=google.com; s=arc-20160816; b=gbsKNHB4t/HbgN8vqt2DOVHaZWG91J5HSBJ8znWuzeSCsqMZW80Nl6+nMhrKn8hPBz CaMzbIwLotpaxGPBc7RJp453FRPG7yGHEXG2mB6h4gpncRdCxs3PUB5cZbNJ1SJwnAYK weAtw8ZPb5X4vnhM3a+ldYr4ooC5o3yQqGYaxUw+ADbhk7Pkd+JUAS5JDk78uYRh80h9 NYYFxdvixI6aNBRn9IeZdMCITB8+4FlKPakh5sKxtSfEHPymq9hYFc4uWf35R/clsDWc m7ngVQpKNu3NIj1icTFAz2Gz8ECxj/xI2Qb6CAP2J3236x6UmU12Xj69lVhcyAvfzd6T NQJg== 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=oshU/ZBNAr62zPlQEwfyDSLZNnylp+dmK1mfeVe4FP8=; b=mRcb1pwz9t4j9o5Y9lPGTjEn7VcHVlB6gIIFjqcO8rB/h19e0XdD2AK+21oiijlqCx uBXVqvJbr8TJmmcR98UF1oHXly/01XO/GJnyGgjQtwF2WabUzqaASeGnrFdgQTKw8Svv 8PAV5qpXXqqG4BIf2BUjm4PJ7DDWVuO+TYDh4NGfWBwT6aSOIienbh+jb++bLctXzhEQ KN/dq+4Gnmx1X2RLuFIea5RV20C1MErNi18pFvHNLbvJAwnq1/OkitX+fT9ywazYFye0 031a8z25uonTUSRFTmhSg0LUZqONSGrgLTAMsj+ni2wymfHGHSzWd39wT888LaFk+ltl Kz7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=fSuhcQ6z; 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 l8si192466pff.237.2018.03.19.09.12.29; Mon, 19 Mar 2018 09:12:29 -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=fSuhcQ6z; 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 S966819AbeCSQM0 (ORCPT + 28 others); Mon, 19 Mar 2018 12:12:26 -0400 Received: from mail-by2nam03on0106.outbound.protection.outlook.com ([104.47.42.106]:22396 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966304AbeCSQKO (ORCPT ); Mon, 19 Mar 2018 12:10:14 -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=oshU/ZBNAr62zPlQEwfyDSLZNnylp+dmK1mfeVe4FP8=; b=fSuhcQ6zJlDIqNTW6e1qgU4j0tasfQZNH9rOU3x6acVkEwCUghZnG6CSLuOzyln8tKhdM2USR6OLhH4sw7TsE32qYm0Mvm/OwRoSrLwsFxBzN2cUVnBwcxBJCpVrabJMwajOChq2Zwf3DIQ2JT8iYfhlUE52ql9Ot1tdC5pvqTg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0919.namprd21.prod.outlook.com (52.132.132.164) 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:10:02 +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:10:01 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Tomi Valkeinen , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 117/167] drm/omap: fix tiled buffer stride calculations Thread-Topic: [PATCH AUTOSEL for 4.4 117/167] drm/omap: fix tiled buffer stride calculations Thread-Index: AQHTv5xtYxJk6vhfiUmmJtN/42PLRA== Date: Mon, 19 Mar 2018 16:07:48 +0000 Message-ID: <20180319160513.16384-117-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-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; DM5PR2101MB0919; 7:xIQIZBru/+D+Acfqmi/wZXJu6Nr4aUIuM1Ot6oEy07WM1KuuFuYgVMsEosxzXPetabcw2kUNI4b4QO6uO+qAnwx60tms81eaVht9mHMl0T7NUT9pJZbB58s6UO54nU5ix4L6A9QyVhEkBh3kOo8y3c0wjCWSO5hvQnf0mCAM19LB3n2GEsSryp8G6jrYAsZm4/IMa20eWeq4gYNS7xWzLhowHSryp7gea9rUV6OM1zUJagRiKM+cezaOBWkIpzRK; 20:s1rcsVvDY+FnfJy1comBu+nCPMopuCe3TiNH95uhJ1m3L7E2EXKLoVDiB4y9sUBbBJp4KJ/p3WE0/UoAcTOXjAMn2EuUdOcErBCXXnJkm2LsqBuyynqAHwDswLGWc/4TCCAv9OVSRzMk/ZdvyDN1w+Xhzrv9qKypf01XsGrl920= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8dd46385-99e8-4bdf-00c3-08d58db3ded3 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB0919; x-ms-traffictypediagnostic: DM5PR2101MB0919: 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:DM5PR2101MB0919; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0919; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39380400002)(396003)(39860400002)(376002)(366004)(199004)(189003)(66066001)(2906002)(86362001)(10290500003)(105586002)(8676002)(305945005)(110136005)(478600001)(4326008)(7736002)(81166006)(3280700002)(6506007)(97736004)(107886003)(5660300001)(36756003)(8936002)(53936002)(86612001)(14454004)(59450400001)(1076002)(2501003)(6116002)(10090500001)(76176011)(186003)(3846002)(5250100002)(6512007)(99286004)(102836004)(106356001)(72206003)(81156014)(2950100002)(6666003)(54906003)(3660700001)(22452003)(68736007)(6486002)(25786009)(26005)(316002)(2900100001)(6436002)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0919; 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: b9+p35v00jHgPCS/S1VjfM1KnXfU58AGCTatSKBYZ9CCiTXNlHnBKPpTDkrP055Bd1fZsEWTJIvS7ZDLjvgbMAaQws9p8h3WFi1wT/Q/eCm5RbotnuqJgeIdxk5wAUi0loBkJCae/LyXaJwsntenTWbzkP8uz6fSlhOEapdUzZPodlQUEwLmMv1aXiem5C40EkQ3AWl0nWZf52nKeex3oeQIXm2jAzBv/+YwzICjMoe5FbFx0lMuFFrV3AZa5f6y8P+0znhiR59kZvKqdJ0qZMpLLfAZKUuTLsPmQGLk/4zPXe1NymSEu+VZCsaMFxfTVR1vbCNgastxXjLwEY9Tjw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8dd46385-99e8-4bdf-00c3-08d58db3ded3 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:07:48.9843 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0919 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tomi Valkeinen [ Upstream commit cc8dd7661ccc2d8dc88921da8e6cc7c2fcdb0341 ] omap_gem uses page alignment for buffer stride. The related calculations are a bit off, though, as byte stride of 4096 gets aligned to 8192, instead of 4096. This patch changes the code to use DIV_ROUND_UP(), which fixes those calculations and makes them more readable. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Sasha Levin --- drivers/gpu/drm/omapdrm/omap_gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.14.1 diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 7ed08fdc4c42..393e5335e33b 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -158,7 +158,7 @@ static void evict_entry(struct drm_gem_object *obj, size_t size = PAGE_SIZE * n; loff_t off = mmap_offset(obj) + (entry->obj_pgoff << PAGE_SHIFT); - const int m = 1 + ((omap_obj->width << fmt) / PAGE_SIZE); + const int m = DIV_ROUND_UP(omap_obj->width << fmt, PAGE_SIZE); if (m > 1) { int i; @@ -415,7 +415,7 @@ static int fault_2d(struct drm_gem_object *obj, * into account in some of the math, so figure out virtual stride * in pages */ - const int m = 1 + ((omap_obj->width << fmt) / PAGE_SIZE); + const int m = DIV_ROUND_UP(omap_obj->width << fmt, PAGE_SIZE); /* We don't use vmf->pgoff since that has the fake offset: */ pgoff = ((unsigned long)vmf->virtual_address -