Received: by 10.192.165.156 with SMTP id m28csp1552555imm; Tue, 17 Apr 2018 00:59:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/BE7eXqDB667kcjC0A8OQRVYNBhbkwu+VO0bC6ixYcOY9Ny6yJ+8+4MOoyCb0HjTum3n6y X-Received: by 2002:a17:902:a506:: with SMTP id s6-v6mr1109628plq.191.1523951945317; Tue, 17 Apr 2018 00:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523951945; cv=none; d=google.com; s=arc-20160816; b=sU6IcEaNdUh7aH/YwEazg6UNWCB84E6h/7Ev9Qr+X7xoA0/P0GUv1n4HhDfDAqtpQ7 Oww7dSIq46pfML2ayddSm4vFm3LSJjL38y6+lo4KI58XVr/UzndN2DsjvYBltgWILpJG tErF4rrrlVr/ZGdZa4IFDOmhnZB4rH+rnlxqjK1EIRKN3wv7C/WOsTDxpm5srj8G8j2T W3s3xvm68Mu4y7gZltU8LjdXPbYn88XiBlAqnCJojpCHlzpO4/8OmSG7v/Ca3j1pZ1J3 l+2Lz1/ytpqpcQua0uS6HmpsvgIamPtbv+uZ9mXbPpvbXQ07gB086ILdgZgnaLSQ+nk+ iDxg== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :arc-authentication-results; bh=OhM9dC/EDFFAoqqLqbUIoiPM4hnnCmkJkwqhkZe+Hkw=; b=U+Wj8Nx0J3vDrf/zyfiNB2ckgD57qFeWdDWa72/9Fbl3Qsv1wUeDUowV3BQNtePobs TNM8Dwt5bBwtSkH9dSKhpjWgX1WlHBONZx2uvXnyaC2gcEXLbVKO/FYCLLpjTmVnMNyY KXLtJ+yXOPql73q3dt9x6v59kw44CQ7NrBFQpkjT6yZ6qmlWNg5t4w7f47NBSouD2bPg d1FYo4RTs+22iJblQQMlExvh1hZOvnOo1TZXUjpYp5OtaFLEfR6JG7QVyKyNWyEdJrF5 Wh6F20+DdoOhQ0r9OV+Gjjwv2vefsWm58h1M/xwLID5r6LfTf2oOYXvt+dOtcCoTDYZh pNjA== ARC-Authentication-Results: i=1; mx.google.com; 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 b186si11106585pgc.569.2018.04.17.00.58.50; Tue, 17 Apr 2018 00:59:05 -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; 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 S1752204AbeDQH5d convert rfc822-to-8bit (ORCPT + 99 others); Tue, 17 Apr 2018 03:57:33 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:38265 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbeDQH5b (ORCPT ); Tue, 17 Apr 2018 03:57:31 -0400 Received: by mail-wr0-f193.google.com with SMTP id h3so20092085wrh.5; Tue, 17 Apr 2018 00:57:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qL/Fz+mGbcar46w8cBGGbubK9CqXM5kfJfwIlKdpRW8=; b=plwcKOXzHsipAClJN5g+oe7T+OlVqsdkSXOgieQ90iYqrs4TvveQeNCTcmUUPH6SpJ 00LcxW4WvbAKel8RwpWTgPOVzUqFonWdfUWyWobXbNBVc/HYWDFW2tuy+AtDq4DkCmzr JeCx6rEVcOiWRvEwxGsbxEQvd9ymWdvYrncCmH/FgPnwXzvZadxIChESmILQ5aLB2kaB ZXDBTs8nHc26NZZCNEkmMxoHk0snZ2tSZF01PUGY/HlCbhEg4ozZ49UItL68o+A6NMXB 8mqF44ERSFEPdBIa36SVpTjVEzbsxfeL8PC7V471pobMf/bbUQN2Hg7NDBCooB9oIJym lkkQ== X-Gm-Message-State: ALQs6tDJtaa2md9jHf8g+GSQ5pLJdZ7ZNR7SRN/VDO0UC+DizSbNmm+b ARXcD8K7kOLPx2CqJZKK1wbLOW7Y X-Received: by 10.80.170.214 with SMTP id r22mr1783514edc.309.1523951849382; Tue, 17 Apr 2018 00:57:29 -0700 (PDT) Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com. [209.85.128.178]) by smtp.gmail.com with ESMTPSA id o16sm8853276edc.33.2018.04.17.00.57.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Apr 2018 00:57:27 -0700 (PDT) Received: by mail-wr0-f178.google.com with SMTP id u4so1327159wrg.10; Tue, 17 Apr 2018 00:57:27 -0700 (PDT) X-Received: by 10.223.196.182 with SMTP id m51mr812043wrf.126.1523951847587; Tue, 17 Apr 2018 00:57:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.142.19 with HTTP; Tue, 17 Apr 2018 00:57:07 -0700 (PDT) In-Reply-To: <20180417075233.f2z6wxcazwqheoib@flea> References: <20180416215032.5023-1-mylene.josserand@bootlin.com> <20180416215032.5023-9-mylene.josserand@bootlin.com> <20180417075233.f2z6wxcazwqheoib@flea> From: Chen-Yu Tsai Date: Tue, 17 Apr 2018 15:57:07 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 08/11] ARM: sun9i: smp: Add is_sun8i field To: Maxime Ripard Cc: =?UTF-8?Q?Myl=C3=A8ne_Josserand?= , Russell King , Marc Zyngier , Mark Rutland , Rob Herring , Simon , Geert Uytterhoeven , Magnus Damm , "open list:ARM/SHMOBILE ARM..." , devicetree , LABBE Corentin , Quentin Schulz , Thomas Petazzoni , linux-arm-kernel , linux-kernel 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 On Tue, Apr 17, 2018 at 3:52 PM, Maxime Ripard wrote: > Hi, > > On Mon, Apr 16, 2018 at 11:50:29PM +0200, Mylène Josserand wrote: >> To prepare the support of sun8i-a83t, add a field in the smp_data >> structure to know if we are on sun9i-a80 or sun8i-a83t. >> >> Add also a global variable to retrieve which architecture we are >> having. >> >> Signed-off-by: Mylène Josserand >> --- >> arch/arm/mach-sunxi/mc_smp.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/arch/arm/mach-sunxi/mc_smp.c b/arch/arm/mach-sunxi/mc_smp.c >> index 03f021d0c73e..9d57ea27dacc 100644 >> --- a/arch/arm/mach-sunxi/mc_smp.c >> +++ b/arch/arm/mach-sunxi/mc_smp.c >> @@ -74,6 +74,7 @@ static void __iomem *sram_b_smp_base; >> >> extern void sunxi_mc_smp_secondary_startup(void); >> extern void sunxi_mc_smp_resume(void); >> +static int is_sun8i; >> >> static bool sunxi_core_is_cortex_a15(unsigned int core, unsigned int cluster) >> { >> @@ -624,6 +625,7 @@ struct sunxi_mc_smp_nodes { >> struct sunxi_mc_smp_data { >> const char *enable_method; >> int (*get_smp_nodes)(struct sunxi_mc_smp_nodes *nodes); >> + int is_sun8i; >> }; >> >> static void __init sunxi_mc_smp_put_nodes(struct sunxi_mc_smp_nodes *nodes) >> @@ -664,6 +666,7 @@ static const struct sunxi_mc_smp_data sunxi_mc_smp_data[] __initconst = { >> { >> .enable_method = "allwinner,sun9i-a80-smp", >> .get_smp_nodes = sun9i_a80_get_smp_nodes, >> + .is_sun8i = false, > > I'm still not convinced about the name of that flag. sun8i doesn't > mean anything, really. What you want to discriminate against it what > you're writing in your commit log: if it is an A80 or an A83t. The > A33, H3, A23, you name it are also part of the sun8i family, yet they > are completely irrelevant to this file. > > Also, false is the default value, you can leave it out. > >> }, >> }; >> >> @@ -697,6 +700,8 @@ static int __init sunxi_mc_smp_init(void) >> break; >> } >> >> + is_sun8i = sunxi_mc_smp_data[i].is_sun8i; >> + > > Do we really need to cache it? Can't we just have a pointer to the SMP > data structure and use that instead? I recommended that. We don't need any of the other fields in the SMP data structure once we're past the init phase. This saves a dereference or two. ChenYu