Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4162410imu; Tue, 18 Dec 2018 10:01:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/UnzCh0j5u4JWXCm91sR6CQHwFaKlVphrgT3ywsJy0IM0H68qTl31aaCH81kNQhh4XYXRT7 X-Received: by 2002:a65:5c4b:: with SMTP id v11mr16519855pgr.333.1545156102774; Tue, 18 Dec 2018 10:01:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545156102; cv=none; d=google.com; s=arc-20160816; b=coTnXJnPm0xJz2lOEmXG1b2M/wL6gDwTbFe5XxGIU+6iJcrWLAprlj7RHewoaWKt2b WjR/jFTpdXwS7KeFAsYpSvo6CrKWtHLhjD8hyI5n8ecCKC/4WVxa1DI5DVqbqpmhZhhM CjJe1ym5t0LRqs+tH16pjllDrL/zs+YPZ6ET2dajKnjx50s7CnR7NPe120hzZ0HFudLe MJvbZipMyUSiT12Wofw9a/epjCAe6mHm4rJIah7n/4Uckccp20eikupx4R7+8aKoNANq FkQtZItrjD/Fcy2oNDrqqL+2QI/gxkA1W2uuBD5nrSwSwruQCuyJbV/7oGwxKft9B3qs 4e9w== 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=aqA+v6egKE2zr3kEaCCzQyyXvmZr7nEYpnXr90FycJI=; b=hjLDT/2smPXzj1RSE7fUShzVXBxQLq+1SfDvBd24KC3o/4XoQU4MPAMGkRJiUqeRb/ zCgFPoR5vyfJsLQBPDRnC3Gm36Qe6gai4Q+rDrKTmWLB09pajTfEw/FqWU6xz1LsBJWU SXhm+S3/DxJnuqcPSBDanaY55nLaCZ+1IRpwgBeu0iMF0WpIgU7/VsNxMiTP7xq0IXBc Mh6TifylP5fQMmuaJo4wKqq61la9rhKhMmmfuyl+oIDlBgW6hoVwJwUjTNXCi10kZOm1 Yujwrj+57tu11zKB1V+KRfmeZhZES1x+VQK435vgtORU6bzKcscXcdi5dB8eHkB93sCs vQRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fLycP6EK; 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 y1si2721867plt.356.2018.12.18.10.01.26; Tue, 18 Dec 2018 10:01:42 -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=fLycP6EK; 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 S1727334AbeLRQkm (ORCPT + 99 others); Tue, 18 Dec 2018 11:40:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:37808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726639AbeLRQkk (ORCPT ); Tue, 18 Dec 2018 11:40:40 -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 1749521873; Tue, 18 Dec 2018 16:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545151239; bh=8JEP9quJHhWVWjmIM36WrOZN1IpHVr8yKc2APP89WH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fLycP6EK4wFv0fdY5wJ1cBXnoyR8KehppwVmmkRHLRqSDcnrvnT0yhkR1kMApI/3B L8WBq5a3sLl4/oCQqe2S23sruTAdbLAT/wzt5mzXuNqxTOJBzL01yEQ6l5OzfvRLuY c+TGltghaOGc26+T91/1K+lKnOt4ga76r7z9sr+w= 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.19 22/44] ARM: mmp/mmp2: fix cpu_is_mmp2() on mmp2-dt Date: Tue, 18 Dec 2018 17:39:34 +0100 Message-Id: <20181218163930.124621780@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181218163927.119623235@linuxfoundation.org> References: <20181218163927.119623235@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.19-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)