Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp847970imu; Thu, 20 Dec 2018 06:20:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/X2uSAQGzATyL821EPZXTNk0bN32YBSw4AugerQFSEiPrqPd1RjYVH68IhcWtA4bOU61ut/ X-Received: by 2002:a62:4181:: with SMTP id g1mr24394999pfd.45.1545315629496; Thu, 20 Dec 2018 06:20:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545315629; cv=none; d=google.com; s=arc-20160816; b=GXvyXKmJbEILFjwFRrZsZ9pIeJOpTojC71dN8jTPJFujmsLb0CvnSqthFEkoKU+6Xo eLG6FX0ZoXgd2v15HDsc/nM14ocvNM4fnuB6JvdSuAFFyOOsLexSFOZ/8AR/D6iN+biR 4iSlcRzzfzcYndnGvYs4fQt9pNIK2+HAlalNp8eSQ36IZliAIO3s+cMIcvGuKGHzrCRl eohJbwextvJqhy01MI8rt7/LV+9WKN3u88MxpW6XoydcGv6XMpTLP911Im6FLiu1EJgp y9SsRhR6DJP+U1cyWAgAytn9E2o4Zn4oHaPa/gQ73M48Rj8oBHi0uEK58iBghIQTLNjf pH/g== 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=HY5DCLOdaR6wtuWgYblDYN8sbKirAnN2kQVjyU6lHSg=; b=dqO466d9IFAPZ1n1kHNucfZyTx0OC/1O7ktTM5anGWUd8SRn/Efchj5SQdJcFhuZJ0 HNKc0ngQt+IrmEeOQW82DHqlk0Gf9bEfilO4OwKJ4gt9jrnTYG9F/QrPp3dvDdASPgxj K4oeIWVbhcpjBaeoujOgwovPtbGNj+1SSOMVBm97jBPKsJkFKIRfU+JcYRIekwjKE+V5 6fP+HaF1FMJBc1OhBgtHTmOw7H+3IW+AsPUx7aOn6DZavYz3aOrGKIqXJ6AP39Kkab3E OBnotBMqA7UTP63Vtqgc2wgwnG56XgktNlsrZKksYM0n3u2F+Ja+IKFgKtKbrvQ6yI+Q f9qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vLraOK3Q; 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 92si15860799pli.220.2018.12.20.06.20.11; Thu, 20 Dec 2018 06:20:29 -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=vLraOK3Q; 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 S1732477AbeLTJh7 (ORCPT + 99 others); Thu, 20 Dec 2018 04:37:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:56538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731603AbeLTJ0g (ORCPT ); Thu, 20 Dec 2018 04:26:36 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 B7865217D9; Thu, 20 Dec 2018 09:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545297996; bh=qfW965Hbj8tUYVolObvIuS8N4e2ex8/K68vIxcZivvw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vLraOK3Q0yXNBM8Ona7JMYiF0cjc9U1gYUYUoksG4BSq0G9VD7mmo/SPsXQxTcjJl LIMc9shUajq9uT8wfCuFlOAhUFGCVugTI0z9J/GQGmyBoE73jyvglb0O+IDo0Z0NkH I1qXpMenGFdDicRayiUtx1fojyrG07fVQQwkE9kQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lubomir Rintel , Arnd Bergmann , Olof Johansson Subject: [PATCH 4.14 09/72] ARM: mmp/mmp2: fix cpu_is_mmp2() on mmp2-dt Date: Thu, 20 Dec 2018 10:18:08 +0100 Message-Id: <20181220085922.704995661@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181220085922.332225035@linuxfoundation.org> References: <20181220085922.332225035@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lubomir Rintel commit 76f4e2c3b6a560cdd7a75b87df543e04d05a9e5f upstream. cpu_is_mmp2() was equivalent to cpu_is_pj4(), wouldn't be correct for multiplatform kernels. Fix it by also considering mmp_chip_id, as is done for cpu_is_pxa168() and cpu_is_pxa910() above. Moreover, it is only available with CONFIG_CPU_MMP2 and thus doesn't work on DT-based MMP2 machines. Enable it on CONFIG_MACH_MMP2_DT too. Note: CONFIG_CPU_MMP2 is only used for machines that use board files instead of DT. It should perhaps be renamed. I'm not doing it now, because I don't have a better idea. Signed-off-by: Lubomir Rintel Acked-by: Arnd Bergmann Cc: stable@vger.kernel.org Signed-off-by: Olof Johansson Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-mmp/cputype.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/arch/arm/mach-mmp/cputype.h +++ b/arch/arm/mach-mmp/cputype.h @@ -44,10 +44,12 @@ static inline int cpu_is_pxa910(void) #define cpu_is_pxa910() (0) #endif -#ifdef CONFIG_CPU_MMP2 +#if defined(CONFIG_CPU_MMP2) || defined(CONFIG_MACH_MMP2_DT) static inline int cpu_is_mmp2(void) { - return (((read_cpuid_id() >> 8) & 0xff) == 0x58); + return (((read_cpuid_id() >> 8) & 0xff) == 0x58) && + (((mmp_chip_id & 0xfff) == 0x410) || + ((mmp_chip_id & 0xfff) == 0x610)); } #else #define cpu_is_mmp2() (0)