diff mbox

[RFC] ARM: tango4: Fix build issues

Message ID 567DBA04.4060709@free.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Mason Dec. 25, 2015, 9:49 p.m. UTC
From: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>

Move SMP setup to platsmp.c
Specify the CPU type to the assembler, and only for smc.S

Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
---
 arch/arm/mach-tango/Makefile  |  3 ++-
 arch/arm/mach-tango/platsmp.c | 16 ++++++++++++++++
 arch/arm/mach-tango/setup.c   | 14 --------------
 3 files changed, 18 insertions(+), 15 deletions(-)
 create mode 100644 arch/arm/mach-tango/platsmp.c

Comments

Mason Dec. 29, 2015, 8:48 p.m. UTC | #1
On 25/12/2015 22:49, Mason wrote:

> Move SMP setup to platsmp.c
> Specify the CPU type to the assembler, and only for smc.S
> 
> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
> ---
>  arch/arm/mach-tango/Makefile  |  3 ++-
>  arch/arm/mach-tango/platsmp.c | 16 ++++++++++++++++
>  arch/arm/mach-tango/setup.c   | 14 --------------
>  3 files changed, 18 insertions(+), 15 deletions(-)
>  create mode 100644 arch/arm/mach-tango/platsmp.c

I have a question. When the original commit hasn't been pushed to
Linus' tree yet, is the original commit simply amended?
(fixup option in rebase -i)

Or are they handled as regular commits on top of the previous commits?

Regards.
Joshua Clayton Dec. 30, 2015, 2:10 a.m. UTC | #2
Hi Marc,
On Tuesday, December 29, 2015 09:48:47 PM Mason wrote:
> On 25/12/2015 22:49, Mason wrote:
> 
> > Move SMP setup to platsmp.c
> > Specify the CPU type to the assembler, and only for smc.S
> > 
> > Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
> > ---
> >  arch/arm/mach-tango/Makefile  |  3 ++-
> >  arch/arm/mach-tango/platsmp.c | 16 ++++++++++++++++
> >  arch/arm/mach-tango/setup.c   | 14 --------------
> >  3 files changed, 18 insertions(+), 15 deletions(-)
> >  create mode 100644 arch/arm/mach-tango/platsmp.c
> 
> I have a question. When the original commit hasn't been pushed to
> Linus' tree yet, is the original commit simply amended?
> (fixup option in rebase -i)
> 
> Or are they handled as regular commits on top of the previous commits?
> 

 Unless you are asked to revise and resubmit a patch, so that the 
original is never accepted, all follow on patches end up a separate commits.

> Regards.
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kerne

Merry Christmas & Happy New Year,

Joshua
Olof Johansson Dec. 31, 2015, 1:20 p.m. UTC | #3
On Tue, Dec 29, 2015 at 09:48:47PM +0100, Mason wrote:
> On 25/12/2015 22:49, Mason wrote:
> 
> > Move SMP setup to platsmp.c
> > Specify the CPU type to the assembler, and only for smc.S
> > 
> > Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
> > ---
> >  arch/arm/mach-tango/Makefile  |  3 ++-
> >  arch/arm/mach-tango/platsmp.c | 16 ++++++++++++++++
> >  arch/arm/mach-tango/setup.c   | 14 --------------
> >  3 files changed, 18 insertions(+), 15 deletions(-)
> >  create mode 100644 arch/arm/mach-tango/platsmp.c
> 
> I have a question. When the original commit hasn't been pushed to
> Linus' tree yet, is the original commit simply amended?
> (fixup option in rebase -i)
> 
> Or are they handled as regular commits on top of the previous commits?

In general, even if our branch is not yet in Linus' tree, we prefer to not
rebuild and rewind/rebase our branches. So yes, in this case it should be
an incremental patch like this is.


-Olof
Olof Johansson Dec. 31, 2015, 1:21 p.m. UTC | #4
On Fri, Dec 25, 2015 at 10:49:56PM +0100, Mason wrote:
> From: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
> 
> Move SMP setup to platsmp.c
> Specify the CPU type to the assembler, and only for smc.S
> 
> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
> ---

Applied, thanks.


-Olof
Olof Johansson Dec. 31, 2015, 4:31 p.m. UTC | #5
On Thu, Dec 31, 2015 at 2:21 PM, Olof Johansson <olof@lixom.net> wrote:
> On Fri, Dec 25, 2015 at 10:49:56PM +0100, Mason wrote:
>> From: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>>
>> Move SMP setup to platsmp.c
>> Specify the CPU type to the assembler, and only for smc.S
>>
>> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>> ---
>
> Applied, thanks.

Actually, I just noticed that the smc.c Makefile part isn't done as it
should, so I'll drop this again.


-Olof
Mason Jan. 1, 2016, 10:52 a.m. UTC | #6
On 31/12/2015 17:31, Olof Johansson wrote:
> On Thu, Dec 31, 2015 at 2:21 PM, Olof Johansson <olof@lixom.net> wrote:
>> On Fri, Dec 25, 2015 at 10:49:56PM +0100, Mason wrote:
>>> From: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>>>
>>> Move SMP setup to platsmp.c
>>> Specify the CPU type to the assembler, and only for smc.S
>>>
>>> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>>> ---
>>
>> Applied, thanks.
> 
> Actually, I just noticed that the smc.c Makefile part isn't done as it
> should, so I'll drop this again.

<grumble>

This is probably a bike-shed issue that I should let slide...

But can someone explain to me: in what circumstances

plus_sec := $(call as-instr,.arch_extension sec,+sec)
AFLAGS_smc.o :=-Wa,-march=armv7-a$(plus_sec)

is preferable over

AFLAGS_smc.o := -Wa,-mcpu=cortex-a9

in a machine-specific Makefile?


Arnd mentioned consistency with other machines; ISTM that
simplicity and obviousness are also desirable characteristics.

Regards.
Mason Jan. 1, 2016, 12:03 p.m. UTC | #7
On 01/01/2016 11:52, Mason wrote:
> On 31/12/2015 17:31, Olof Johansson wrote:
>> On Thu, Dec 31, 2015 at 2:21 PM, Olof Johansson <olof@lixom.net> wrote:
>>> On Fri, Dec 25, 2015 at 10:49:56PM +0100, Mason wrote:
>>>> From: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>>>>
>>>> Move SMP setup to platsmp.c
>>>> Specify the CPU type to the assembler, and only for smc.S
>>>>
>>>> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>>>> ---
>>>
>>> Applied, thanks.
>>
>> Actually, I just noticed that the smc.c Makefile part isn't done as it
>> should, so I'll drop this again.
> 
> <grumble>
> 
> This is probably a bike-shed issue that I should let slide...
> 
> But can someone explain to me: in what circumstances
> 
> plus_sec := $(call as-instr,.arch_extension sec,+sec)
> AFLAGS_smc.o :=-Wa,-march=armv7-a$(plus_sec)
> 
> is preferable over
> 
> AFLAGS_smc.o := -Wa,-mcpu=cortex-a9
> 
> in a machine-specific Makefile?
> 
> 
> Arnd mentioned consistency with other machines; ISTM that
> simplicity and obviousness are also desirable characteristics.

For the sake of completeness, the +sec shenanigans are required
because of this 2010 binutils patch:

https://sourceware.org/ml/binutils/2010-09/msg00412.html

Specifying the CPU instead of an ISA (plus extensions) leaves
the instruction set selection up to the assembler, so the same
flag works for both old and new binutils.

Regards.
diff mbox

Patch

diff --git a/arch/arm/mach-tango/Makefile b/arch/arm/mach-tango/Makefile
index 0d7e2b5976e3..d33eab2941cb 100644
--- a/arch/arm/mach-tango/Makefile
+++ b/arch/arm/mach-tango/Makefile
@@ -1,2 +1,3 @@ 
-asflags-y += -mcpu=cortex-a9
 obj-y += setup.o smc.o
+obj-$(CONFIG_SMP) += platsmp.o
+AFLAGS_smc.o := -Wa,-mcpu=cortex-a9
diff --git a/arch/arm/mach-tango/platsmp.c b/arch/arm/mach-tango/platsmp.c
new file mode 100644
index 000000000000..a18d5a34e2f5
--- /dev/null
+++ b/arch/arm/mach-tango/platsmp.c
@@ -0,0 +1,16 @@ 
+#include <linux/init.h>
+#include <linux/smp.h>
+#include "smc.h"
+
+static int tango_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+	tango_set_aux_boot_addr(virt_to_phys(secondary_startup));
+	tango_start_aux_core(cpu);
+	return 0;
+}
+
+static struct smp_operations tango_smp_ops __initdata = {
+	.smp_boot_secondary	= tango_boot_secondary,
+};
+
+CPU_METHOD_OF_DECLARE(tango4_smp, "sigma,tango4-smp", &tango_smp_ops);
diff --git a/arch/arm/mach-tango/setup.c b/arch/arm/mach-tango/setup.c
index d86900550e63..f14b6c7d255b 100644
--- a/arch/arm/mach-tango/setup.c
+++ b/arch/arm/mach-tango/setup.c
@@ -1,21 +1,7 @@ 
-#include <linux/smp.h>
 #include <asm/mach/arch.h>
 #include <asm/hardware/cache-l2x0.h>
 #include "smc.h"
 
-static int tango4_boot_secondary(unsigned int cpu, struct task_struct *idle)
-{
-	tango_set_aux_boot_addr(virt_to_phys(secondary_startup));
-	tango_start_aux_core(cpu);
-	return 0;
-}
-
-static struct smp_operations tango4_smp_ops __initdata = {
-	.smp_boot_secondary	= tango4_boot_secondary,
-};
-
-CPU_METHOD_OF_DECLARE(tango4_smp, "sigma,tango4-smp", &tango4_smp_ops);
-
 static void tango_l2c_write(unsigned long val, unsigned int reg)
 {
 	if (reg == L2X0_CTRL)