* [PATCH v2 4/11] Update firmware_has_feature() to check architecture bits
From: Nathan Fontenot @ 2013-03-25 18:54 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <51509AE8.8070803@linux.vnet.ibm.com>
The firmware_has_feature() function makes it easy to check for supported
features of the hypervisor. This patch extends the capability of the
firmware_has_feature() function to include checking for specified bits
in vector 5 of the architecture vector as is reported in the device tree.
As part of this the #defines used for the architecture vector are
moved to prom.h and re-defined such that the vector 5 options have the vector
index and the feature bits encoded into them. This makes for a much
simpler design to add bits from the architecture vector to be added to
the checking done in firmware_has_feature().
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/firmware.h | 4 +
arch/powerpc/include/asm/prom.h | 45 +++++++++-----------
arch/powerpc/kernel/prom_init.c | 23 +++++++---
arch/powerpc/platforms/pseries/firmware.c | 67 ++++++++++++++++++++++++++----
arch/powerpc/platforms/pseries/pseries.h | 5 +-
arch/powerpc/platforms/pseries/setup.c | 40 ++++++++++++-----
6 files changed, 131 insertions(+), 53 deletions(-)
Index: powerpc/arch/powerpc/include/asm/prom.h
===================================================================
--- powerpc.orig/arch/powerpc/include/asm/prom.h 2013-03-25 10:47:54.000000000 -0500
+++ powerpc/arch/powerpc/include/asm/prom.h 2013-03-25 11:07:56.000000000 -0500
@@ -111,31 +111,27 @@
/* Option vector 4: IBM PAPR implementation */
#define OV4_MIN_ENT_CAP 0x01 /* minimum VP entitled capacity */
-/* Option vector 5: PAPR/OF options supported */
-#define OV5_LPAR 0x80 /* logical partitioning supported */
-#define OV5_SPLPAR 0x40 /* shared-processor LPAR supported */
+/* Option vector 5: PAPR/OF options supported
+ * Thses bits are also used for the platform_has_feature() call so
+ * we encode the vector index in the define and use the OV5_FEAT()
+ * and OV5_INDX() macros to extract the desired information.
+ */
+#define OV5_FEAT(x) ((x) & 0xff)
+#define OV5_INDX(x) ((x) >> 8)
+#define OV5_LPAR 0x0280 /* logical partitioning supported */
+#define OV5_SPLPAR 0x0240 /* shared-processor LPAR supported */
/* ibm,dynamic-reconfiguration-memory property supported */
-#define OV5_DRCONF_MEMORY 0x20
-#define OV5_LARGE_PAGES 0x10 /* large pages supported */
-#define OV5_DONATE_DEDICATE_CPU 0x02 /* donate dedicated CPU support */
-/* PCIe/MSI support. Without MSI full PCIe is not supported */
-#ifdef CONFIG_PCI_MSI
-#define OV5_MSI 0x01 /* PCIe/MSI support */
-#else
-#define OV5_MSI 0x00
-#endif /* CONFIG_PCI_MSI */
-#ifdef CONFIG_PPC_SMLPAR
-#define OV5_CMO 0x80 /* Cooperative Memory Overcommitment */
-#define OV5_XCMO 0x40 /* Page Coalescing */
-#else
-#define OV5_CMO 0x00
-#define OV5_XCMO 0x00
-#endif
-#define OV5_TYPE1_AFFINITY 0x80 /* Type 1 NUMA affinity */
-#define OV5_PFO_HW_RNG 0x80 /* PFO Random Number Generator */
-#define OV5_PFO_HW_842 0x40 /* PFO Compression Accelerator */
-#define OV5_PFO_HW_ENCR 0x20 /* PFO Encryption Accelerator */
-#define OV5_SUB_PROCESSORS 0x01 /* 1,2,or 4 Sub-Processors supported */
+#define OV5_DRCONF_MEMORY 0x0220
+#define OV5_LARGE_PAGES 0x0210 /* large pages supported */
+#define OV5_DONATE_DEDICATE_CPU 0x0202 /* donate dedicated CPU support */
+#define OV5_MSI 0x0201 /* PCIe/MSI support */
+#define OV5_CMO 0x0480 /* Cooperative Memory Overcommitment */
+#define OV5_XCMO 0x0440 /* Page Coalescing */
+#define OV5_TYPE1_AFFINITY 0x0580 /* Type 1 NUMA affinity */
+#define OV5_PFO_HW_RNG 0x0E80 /* PFO Random Number Generator */
+#define OV5_PFO_HW_842 0x0E40 /* PFO Compression Accelerator */
+#define OV5_PFO_HW_ENCR 0x0E20 /* PFO Encryption Accelerator */
+#define OV5_SUB_PROCESSORS 0x0F01 /* 1,2,or 4 Sub-Processors supported */
/* Option Vector 6: IBM PAPR hints */
#define OV6_LINUX 0x02 /* Linux is our OS */
@@ -145,6 +141,7 @@
* followed by # option vectors - 1, followed by the option vectors.
*/
extern unsigned char ibm_architecture_vec[];
+bool platform_has_feature(unsigned int);
#endif
/* These includes are put at the bottom because they may contain things
Index: powerpc/arch/powerpc/kernel/prom_init.c
===================================================================
--- powerpc.orig/arch/powerpc/kernel/prom_init.c 2013-03-25 10:47:54.000000000 -0500
+++ powerpc/arch/powerpc/kernel/prom_init.c 2013-03-25 11:07:56.000000000 -0500
@@ -684,11 +684,21 @@
/* option vector 5: PAPR/OF options */
19 - 2, /* length */
0, /* don't ignore, don't halt */
- OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY |
- OV5_DONATE_DEDICATE_CPU | OV5_MSI,
+ OV5_FEAT(OV5_LPAR) | OV5_FEAT(OV5_SPLPAR) | OV5_FEAT(OV5_LARGE_PAGES) |
+ OV5_FEAT(OV5_DRCONF_MEMORY) | OV5_FEAT(OV5_DONATE_DEDICATE_CPU) |
+#ifdef CONFIG_PCI_MSI
+ /* PCIe/MSI support. Without MSI full PCIe is not supported */
+ OV5_FEAT(OV5_MSI),
+#else
+ 0,
+#endif
+ 0,
+#ifdef CONFIG_PPC_SMLPAR
+ OV5_FEAT(OV5_CMO) | OV5_FEAT(OV5_XCMO),
+#else
0,
- OV5_CMO | OV5_XCMO,
- OV5_TYPE1_AFFINITY,
+#endif
+ OV5_FEAT(OV5_TYPE1_AFFINITY),
0,
0,
0,
@@ -702,8 +712,9 @@
0,
0,
0,
- OV5_PFO_HW_RNG | OV5_PFO_HW_ENCR | OV5_PFO_HW_842,
- OV5_SUB_PROCESSORS,
+ OV5_FEAT(OV5_PFO_HW_RNG) | OV5_FEAT(OV5_PFO_HW_ENCR) |
+ OV5_FEAT(OV5_PFO_HW_842),
+ OV5_FEAT(OV5_SUB_PROCESSORS),
/* option vector 6: IBM PAPR hints */
4 - 2, /* length */
0,
Index: powerpc/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- powerpc.orig/arch/powerpc/platforms/pseries/setup.c 2013-03-25 10:22:22.000000000 -0500
+++ powerpc/arch/powerpc/platforms/pseries/setup.c 2013-03-25 11:09:45.000000000 -0500
@@ -628,25 +628,39 @@
* Called very early, MMU is off, device-tree isn't unflattened
*/
-static int __init pSeries_probe_hypertas(unsigned long node,
- const char *uname, int depth,
- void *data)
+static int __init pseries_probe_fw_features(unsigned long node,
+ const char *uname, int depth,
+ void *data)
{
- const char *hypertas;
+ const char *prop;
unsigned long len;
+ static int hypertas_found;
+ static int vec5_found;
- if (depth != 1 ||
- (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0))
+ if (depth != 1)
return 0;
- hypertas = of_get_flat_dt_prop(node, "ibm,hypertas-functions", &len);
- if (!hypertas)
- return 1;
+ if (!strcmp(uname, "rtas") || !strcmp(uname, "rtas@0")) {
+ prop = of_get_flat_dt_prop(node, "ibm,hypertas-functions",
+ &len);
+ if (prop) {
+ powerpc_firmware_features |= FW_FEATURE_LPAR;
+ fw_hypertas_feature_init(prop, len);
+ }
+
+ hypertas_found = 1;
+ }
+
+ if (!strcmp(uname, "chosen")) {
+ prop = of_get_flat_dt_prop(node, "ibm,architecture-vec-5",
+ &len);
+ if (prop)
+ fw_vec5_feature_init(prop, len);
- powerpc_firmware_features |= FW_FEATURE_LPAR;
- fw_feature_init(hypertas, len);
+ vec5_found = 1;
+ }
- return 1;
+ return hypertas_found && vec5_found;
}
static int __init pSeries_probe(void)
@@ -669,7 +683,7 @@
pr_debug("pSeries detected, looking for LPAR capability...\n");
/* Now try to figure out if we are running on LPAR */
- of_scan_flat_dt(pSeries_probe_hypertas, NULL);
+ of_scan_flat_dt(pseries_probe_fw_features, NULL);
if (firmware_has_feature(FW_FEATURE_LPAR))
hpte_init_lpar();
Index: powerpc/arch/powerpc/platforms/pseries/firmware.c
===================================================================
--- powerpc.orig/arch/powerpc/platforms/pseries/firmware.c 2013-03-25 10:22:22.000000000 -0500
+++ powerpc/arch/powerpc/platforms/pseries/firmware.c 2013-03-25 11:11:27.000000000 -0500
@@ -31,15 +31,15 @@
typedef struct {
unsigned long val;
char * name;
-} firmware_feature_t;
+} hypertas_fw_feature_t;
/*
* The names in this table match names in rtas/ibm,hypertas-functions. If the
* entry ends in a '*', only upto the '*' is matched. Otherwise the entire
* string must match.
*/
-static __initdata firmware_feature_t
-firmware_features_table[FIRMWARE_MAX_FEATURES] = {
+static __initdata hypertas_fw_feature_t
+hypertas_fw_features_table[FIRMWARE_MAX_FEATURES] = {
{FW_FEATURE_PFT, "hcall-pft"},
{FW_FEATURE_TCE, "hcall-tce"},
{FW_FEATURE_SPRG0, "hcall-sprg0"},
@@ -69,16 +69,16 @@
* device-tree/ibm,hypertas-functions. Ultimately this functionality may
* be moved into prom.c prom_init().
*/
-void __init fw_feature_init(const char *hypertas, unsigned long len)
+void __init fw_hypertas_feature_init(const char *hypertas, unsigned long len)
{
const char *s;
int i;
- pr_debug(" -> fw_feature_init()\n");
+ pr_debug(" -> fw_hypertas_feature_init()\n");
for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) {
for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) {
- const char *name = firmware_features_table[i].name;
+ const char *name = hypertas_fw_features_table[i].name;
size_t size;
/* check value against table of strings */
if (!name)
@@ -96,10 +96,61 @@
/* we have a match */
powerpc_firmware_features |=
- firmware_features_table[i].val;
+ hypertas_fw_features_table[i].val;
break;
}
}
- pr_debug(" <- fw_feature_init()\n");
+ pr_debug(" <- fw_hypertas_feature_init()\n");
+}
+
+struct vec5_fw_feature {
+ unsigned long val;
+ unsigned int feature;
+
+};
+
+static __initdata struct vec5_fw_feature
+vec5_fw_features_table[FIRMWARE_MAX_FEATURES] = {
+ {FW_FEATURE_TYPE1_AFFINITY, OV5_TYPE1_AFFINITY},
+};
+
+void __init fw_vec5_feature_init(const char *vec5, unsigned long len)
+{
+ const char *s;
+ int index;
+ int i, j;
+
+ pr_debug(" -> fw_vec5_feature_init()\n");
+
+ /* vec5[0] is the length, no need to check */
+ for (s = &vec5[1], index = 1; s < vec5 + len; s++, index++) {
+ if (*s == 0)
+ continue;
+
+ /* Check each bit for a possible match */
+ for (i = 0; i < 8; i++) {
+ unsigned int feat = (index << 8) | (1 << i);
+
+ if ((*s & OV5_FEAT(feat)) == 0)
+ continue;
+
+ /* Look for a match */
+ for (j = 0; j < FIRMWARE_MAX_FEATURES; j++) {
+ if (vec5_fw_features_table[j].val == 0)
+ continue;
+
+ if (vec5_fw_features_table[j].feature != feat)
+ continue;
+
+ /* we have a match */
+ powerpc_firmware_features |=
+ vec5_fw_features_table[j].val;
+
+ break;
+ }
+ }
+ }
+
+ pr_debug(" <- fw_vec5_feature_init()\n");
}
Index: powerpc/arch/powerpc/include/asm/firmware.h
===================================================================
--- powerpc.orig/arch/powerpc/include/asm/firmware.h 2013-03-25 10:22:22.000000000 -0500
+++ powerpc/arch/powerpc/include/asm/firmware.h 2013-03-25 11:07:56.000000000 -0500
@@ -51,6 +51,7 @@
#define FW_FEATURE_OPALv2 ASM_CONST(0x0000000020000000)
#define FW_FEATURE_SET_MODE ASM_CONST(0x0000000040000000)
#define FW_FEATURE_BEST_ENERGY ASM_CONST(0x0000000080000000)
+#define FW_FEATURE_TYPE1_AFFINITY ASM_CONST(0x0000000100000000)
#ifndef __ASSEMBLY__
@@ -65,7 +66,8 @@
FW_FEATURE_BULK_REMOVE | FW_FEATURE_XDABR |
FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR |
FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO |
- FW_FEATURE_SET_MODE | FW_FEATURE_BEST_ENERGY,
+ FW_FEATURE_SET_MODE | FW_FEATURE_BEST_ENERGY |
+ FW_FEATURE_TYPE1_AFFINITY,
FW_FEATURE_PSERIES_ALWAYS = 0,
FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2,
FW_FEATURE_POWERNV_ALWAYS = 0,
Index: powerpc/arch/powerpc/platforms/pseries/pseries.h
===================================================================
--- powerpc.orig/arch/powerpc/platforms/pseries/pseries.h 2013-03-25 10:22:22.000000000 -0500
+++ powerpc/arch/powerpc/platforms/pseries/pseries.h 2013-03-25 11:07:56.000000000 -0500
@@ -19,7 +19,10 @@
#include <linux/of.h>
-extern void __init fw_feature_init(const char *hypertas, unsigned long len);
+extern void __init fw_hypertas_feature_init(const char *hypertas,
+ unsigned long len);
+extern void __init fw_vec5_feature_init(const char *hypertas,
+ unsigned long len);
struct pt_regs;
^ permalink raw reply
* [PATCH v2 3/11] Move architecture vector definitions to prom.h
From: Nathan Fontenot @ 2013-03-25 18:53 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <51509AE8.8070803@linux.vnet.ibm.com>
As part of handling of hndling PRRN events we will need to check the
vector 5 portion of the architectire bits reported in the device tree
to ensure that PRRN event handling is enabled. In order to do this a
new platform_has_feature call is introduced (in a subsequent patch) to
make this check. To avoid having to re-define bits in the architecture
vector the bits are moved to prom.h.
This patch is the first step in implementing the platform_has_feature
call by simply moving the bit definitions from prom_init.c to asm/prom.h.
There are no functional.
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/prom.h | 73 ++++++++++++++++++++++++++++++++++++++
arch/powerpc/kernel/prom_init.c | 75 +++-------------------------------------
2 files changed, 79 insertions(+), 69 deletions(-)
Index: powerpc/arch/powerpc/include/asm/prom.h
===================================================================
--- powerpc.orig/arch/powerpc/include/asm/prom.h 2013-03-20 08:24:13.000000000 -0500
+++ powerpc/arch/powerpc/include/asm/prom.h 2013-03-20 08:52:59.000000000 -0500
@@ -74,6 +74,79 @@
#define DRCONF_MEM_AI_INVALID 0x00000040
#define DRCONF_MEM_RESERVED 0x00000080
+#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)
+/*
+ * There are two methods for telling firmware what our capabilities are.
+ * Newer machines have an "ibm,client-architecture-support" method on the
+ * root node. For older machines, we have to call the "process-elf-header"
+ * method in the /packages/elf-loader node, passing it a fake 32-bit
+ * ELF header containing a couple of PT_NOTE sections that contain
+ * structures that contain various information.
+ */
+
+/* New method - extensible architecture description vector. */
+
+/* Option vector bits - generic bits in byte 1 */
+#define OV_IGNORE 0x80 /* ignore this vector */
+#define OV_CESSATION_POLICY 0x40 /* halt if unsupported option present*/
+
+/* Option vector 1: processor architectures supported */
+#define OV1_PPC_2_00 0x80 /* set if we support PowerPC 2.00 */
+#define OV1_PPC_2_01 0x40 /* set if we support PowerPC 2.01 */
+#define OV1_PPC_2_02 0x20 /* set if we support PowerPC 2.02 */
+#define OV1_PPC_2_03 0x10 /* set if we support PowerPC 2.03 */
+#define OV1_PPC_2_04 0x08 /* set if we support PowerPC 2.04 */
+#define OV1_PPC_2_05 0x04 /* set if we support PowerPC 2.05 */
+#define OV1_PPC_2_06 0x02 /* set if we support PowerPC 2.06 */
+#define OV1_PPC_2_07 0x01 /* set if we support PowerPC 2.07 */
+
+/* Option vector 2: Open Firmware options supported */
+#define OV2_REAL_MODE 0x20 /* set if we want OF in real mode */
+
+/* Option vector 3: processor options supported */
+#define OV3_FP 0x80 /* floating point */
+#define OV3_VMX 0x40 /* VMX/Altivec */
+#define OV3_DFP 0x20 /* decimal FP */
+
+/* Option vector 4: IBM PAPR implementation */
+#define OV4_MIN_ENT_CAP 0x01 /* minimum VP entitled capacity */
+
+/* Option vector 5: PAPR/OF options supported */
+#define OV5_LPAR 0x80 /* logical partitioning supported */
+#define OV5_SPLPAR 0x40 /* shared-processor LPAR supported */
+/* ibm,dynamic-reconfiguration-memory property supported */
+#define OV5_DRCONF_MEMORY 0x20
+#define OV5_LARGE_PAGES 0x10 /* large pages supported */
+#define OV5_DONATE_DEDICATE_CPU 0x02 /* donate dedicated CPU support */
+/* PCIe/MSI support. Without MSI full PCIe is not supported */
+#ifdef CONFIG_PCI_MSI
+#define OV5_MSI 0x01 /* PCIe/MSI support */
+#else
+#define OV5_MSI 0x00
+#endif /* CONFIG_PCI_MSI */
+#ifdef CONFIG_PPC_SMLPAR
+#define OV5_CMO 0x80 /* Cooperative Memory Overcommitment */
+#define OV5_XCMO 0x40 /* Page Coalescing */
+#else
+#define OV5_CMO 0x00
+#define OV5_XCMO 0x00
+#endif
+#define OV5_TYPE1_AFFINITY 0x80 /* Type 1 NUMA affinity */
+#define OV5_PFO_HW_RNG 0x80 /* PFO Random Number Generator */
+#define OV5_PFO_HW_842 0x40 /* PFO Compression Accelerator */
+#define OV5_PFO_HW_ENCR 0x20 /* PFO Encryption Accelerator */
+#define OV5_SUB_PROCESSORS 0x01 /* 1,2,or 4 Sub-Processors supported */
+
+/* Option Vector 6: IBM PAPR hints */
+#define OV6_LINUX 0x02 /* Linux is our OS */
+
+/*
+ * The architecture vector has an array of PVR mask/value pairs,
+ * followed by # option vectors - 1, followed by the option vectors.
+ */
+extern unsigned char ibm_architecture_vec[];
+#endif
+
/* These includes are put at the bottom because they may contain things
* that are overridden by this file. Ideally they shouldn't be included
* by this file, but there are a bunch of .c files that currently depend
Index: powerpc/arch/powerpc/kernel/prom_init.c
===================================================================
--- powerpc.orig/arch/powerpc/kernel/prom_init.c 2013-03-20 08:24:13.000000000 -0500
+++ powerpc/arch/powerpc/kernel/prom_init.c 2013-03-20 08:52:59.000000000 -0500
@@ -627,16 +627,11 @@
#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)
/*
- * There are two methods for telling firmware what our capabilities are.
- * Newer machines have an "ibm,client-architecture-support" method on the
- * root node. For older machines, we have to call the "process-elf-header"
- * method in the /packages/elf-loader node, passing it a fake 32-bit
- * ELF header containing a couple of PT_NOTE sections that contain
- * structures that contain various information.
- */
-
-/*
- * New method - extensible architecture description vector.
+ * The architecture vector has an array of PVR mask/value pairs,
+ * followed by # option vectors - 1, followed by the option vectors.
+ *
+ * See prom.h for the definition of the bits specified in the
+ * achitecture vector.
*
* Because the description vector contains a mix of byte and word
* values, we declare it as an unsigned char array, and use this
@@ -645,65 +640,7 @@
#define W(x) ((x) >> 24) & 0xff, ((x) >> 16) & 0xff, \
((x) >> 8) & 0xff, (x) & 0xff
-/* Option vector bits - generic bits in byte 1 */
-#define OV_IGNORE 0x80 /* ignore this vector */
-#define OV_CESSATION_POLICY 0x40 /* halt if unsupported option present*/
-
-/* Option vector 1: processor architectures supported */
-#define OV1_PPC_2_00 0x80 /* set if we support PowerPC 2.00 */
-#define OV1_PPC_2_01 0x40 /* set if we support PowerPC 2.01 */
-#define OV1_PPC_2_02 0x20 /* set if we support PowerPC 2.02 */
-#define OV1_PPC_2_03 0x10 /* set if we support PowerPC 2.03 */
-#define OV1_PPC_2_04 0x08 /* set if we support PowerPC 2.04 */
-#define OV1_PPC_2_05 0x04 /* set if we support PowerPC 2.05 */
-#define OV1_PPC_2_06 0x02 /* set if we support PowerPC 2.06 */
-#define OV1_PPC_2_07 0x01 /* set if we support PowerPC 2.07 */
-
-/* Option vector 2: Open Firmware options supported */
-#define OV2_REAL_MODE 0x20 /* set if we want OF in real mode */
-
-/* Option vector 3: processor options supported */
-#define OV3_FP 0x80 /* floating point */
-#define OV3_VMX 0x40 /* VMX/Altivec */
-#define OV3_DFP 0x20 /* decimal FP */
-
-/* Option vector 4: IBM PAPR implementation */
-#define OV4_MIN_ENT_CAP 0x01 /* minimum VP entitled capacity */
-
-/* Option vector 5: PAPR/OF options supported */
-#define OV5_LPAR 0x80 /* logical partitioning supported */
-#define OV5_SPLPAR 0x40 /* shared-processor LPAR supported */
-/* ibm,dynamic-reconfiguration-memory property supported */
-#define OV5_DRCONF_MEMORY 0x20
-#define OV5_LARGE_PAGES 0x10 /* large pages supported */
-#define OV5_DONATE_DEDICATE_CPU 0x02 /* donate dedicated CPU support */
-/* PCIe/MSI support. Without MSI full PCIe is not supported */
-#ifdef CONFIG_PCI_MSI
-#define OV5_MSI 0x01 /* PCIe/MSI support */
-#else
-#define OV5_MSI 0x00
-#endif /* CONFIG_PCI_MSI */
-#ifdef CONFIG_PPC_SMLPAR
-#define OV5_CMO 0x80 /* Cooperative Memory Overcommitment */
-#define OV5_XCMO 0x40 /* Page Coalescing */
-#else
-#define OV5_CMO 0x00
-#define OV5_XCMO 0x00
-#endif
-#define OV5_TYPE1_AFFINITY 0x80 /* Type 1 NUMA affinity */
-#define OV5_PFO_HW_RNG 0x80 /* PFO Random Number Generator */
-#define OV5_PFO_HW_842 0x40 /* PFO Compression Accelerator */
-#define OV5_PFO_HW_ENCR 0x20 /* PFO Encryption Accelerator */
-#define OV5_SUB_PROCESSORS 0x01 /* 1,2,or 4 Sub-Processors supported */
-
-/* Option Vector 6: IBM PAPR hints */
-#define OV6_LINUX 0x02 /* Linux is our OS */
-
-/*
- * The architecture vector has an array of PVR mask/value pairs,
- * followed by # option vectors - 1, followed by the option vectors.
- */
-static unsigned char ibm_architecture_vec[] = {
+unsigned char ibm_architecture_vec[] = {
W(0xfffe0000), W(0x003a0000), /* POWER5/POWER5+ */
W(0xffff0000), W(0x003e0000), /* POWER6 */
W(0xffff0000), W(0x003f0000), /* POWER7 */
^ permalink raw reply
* [PATCH v2 2/11] Add PRRN Event Handler
From: Nathan Fontenot @ 2013-03-25 18:52 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <51509AE8.8070803@linux.vnet.ibm.com>
From: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
A PRRN event is signaled via the RTAS event-scan mechanism, which
returns a Hot Plug Event message "fixed part" indicating "Platform
Resource Reassignment". In response to the Hot Plug Event message,
we must call ibm,update-nodes to determine which resources were
reassigned and then ibm,update-properties to obtain the new affinity
information about those resources.
The PRRN event-scan RTAS message contains only the "fixed part" with
the "Type" field set to the value 160 and no Extended Event Log. The
four-byte Extended Event Log Length field is repurposed (since no
Extended Event Log message is included) to pass the "scope" parameter
that causes the ibm,update-nodes to return the nodes affected by the
specific resource reassignment.
This patch adds a handler in rtasd for PRRN RTAS events. The function
pseries_devicetree_update() (from mobility.c) is used to make the
ibm,update-nodes/ibm,update-properties RTAS calls. Updating the NUMA maps
(handled by a subsequent patch) will require significant processing,
so pseries_devicetree_update() is called from an asynchronous workqueue
to allow rtasd to continue processing events. Since we flush all work
on the queue before handling any new work there should only be one event
in flight of being handled at a time.
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/rtas.h | 2 ++
arch/powerpc/kernel/rtasd.c | 35 ++++++++++++++++++++++++++++++++++-
2 files changed, 36 insertions(+), 1 deletion(-)
Index: powerpc/arch/powerpc/include/asm/rtas.h
===================================================================
--- powerpc.orig/arch/powerpc/include/asm/rtas.h 2013-03-20 08:51:59.000000000 -0500
+++ powerpc/arch/powerpc/include/asm/rtas.h 2013-03-20 08:52:08.000000000 -0500
@@ -143,6 +143,8 @@
#define RTAS_TYPE_PMGM_TIME_ALARM 0x6f
#define RTAS_TYPE_PMGM_CONFIG_CHANGE 0x70
#define RTAS_TYPE_PMGM_SERVICE_PROC 0x71
+/* Platform Resource Reassignment Notification */
+#define RTAS_TYPE_PRRN 0xA0
/* RTAS check-exception vector offset */
#define RTAS_VECTOR_EXTERNAL_INTERRUPT 0x500
Index: powerpc/arch/powerpc/kernel/rtasd.c
===================================================================
--- powerpc.orig/arch/powerpc/kernel/rtasd.c 2013-03-20 08:24:14.000000000 -0500
+++ powerpc/arch/powerpc/kernel/rtasd.c 2013-03-20 08:52:08.000000000 -0500
@@ -87,6 +87,8 @@
return "Resource Deallocation Event";
case RTAS_TYPE_DUMP:
return "Dump Notification Event";
+ case RTAS_TYPE_PRRN:
+ return "Platform Resource Reassignment Event";
}
return rtas_type[0];
@@ -265,7 +267,38 @@
spin_unlock_irqrestore(&rtasd_log_lock, s);
return;
}
+}
+
+static s32 update_scope;
+
+static void prrn_work_fn(struct work_struct *work)
+{
+ /*
+ * For PRRN, we must pass the negative of the scope value in
+ * the RTAS event.
+ */
+ pseries_devicetree_update(-update_scope);
+}
+static DECLARE_WORK(prrn_work, prrn_work_fn);
+
+void prrn_schedule_update(u32 scope)
+{
+ flush_work(&prrn_work);
+ update_scope = scope;
+ schedule_work(&prrn_work);
+}
+
+static void pseries_handle_event(const struct rtas_error_log *log)
+{
+ pSeries_log_error((char *)log, ERR_TYPE_RTAS_LOG, 0);
+
+ if (log->type == RTAS_TYPE_PRRN)
+ /* For PRRN Events the extended log length is used to denote
+ * the scope for calling rtas update-nodes.
+ */
+ prrn_schedule_update(log->extended_log_length);
+ return;
}
static int rtas_log_open(struct inode * inode, struct file * file)
@@ -389,7 +422,7 @@
}
if (error == 0)
- pSeries_log_error(logdata, ERR_TYPE_RTAS_LOG, 0);
+ pseries_handle_event((struct rtas_error_log *)logdata);
} while(error == 0);
}
^ permalink raw reply
* [PATCH v2 1/11] Expose pseries devicetree_update()
From: Nathan Fontenot @ 2013-03-25 18:51 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <51509AE8.8070803@linux.vnet.ibm.com>
From: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
Newer firmware on Power systems can transparently reassign platform resources
(CPU and Memory) in use. For instance, if a processor or memory unit is
predicted to fail, the platform may transparently move the processing to an
equivalent unused processor or the memory state to an equivalent unused
memory unit. However, reassigning resources across NUMA boundaries may alter
the performance of the partition. When such reassignment is necessary, the
Platform Resource Reassignment Notification (PRRN) option provides a
mechanism to inform the Linux kernel of changes to the NUMA affinity of
its platform resources.
When rtasd receives a PRRN event, it needs to make a series of RTAS
calls (ibm,update-nodes and ibm,update-properties) to retrieve the
updated device tree information. These calls are already handled in the
pseries_devtree_update() routine used in partition migration.
This patch simply exposes pseries_devicetree_update() so it can be
called by rtasd. pseries_devicetree_update() and supporting functions
are also modified to take a 32-bit 'scope' parameter. This parameter is
required by the ibm,update-nodes/ibm,update-properties RTAS calls, and
the appropriate value is contained within the RTAS event for PRRN
notifications. In pseries_devicetree_update() it was previously
hard-coded to 1, the scope value for partition migration.
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/rtas.h | 1 +
arch/powerpc/platforms/pseries/mobility.c | 21 ++++++++++++---------
2 files changed, 13 insertions(+), 9 deletions(-)
Index: powerpc/arch/powerpc/include/asm/rtas.h
===================================================================
--- powerpc.orig/arch/powerpc/include/asm/rtas.h 2013-03-20 08:24:15.000000000 -0500
+++ powerpc/arch/powerpc/include/asm/rtas.h 2013-03-20 08:51:59.000000000 -0500
@@ -276,6 +276,7 @@
const char *uname, int depth, void *data);
extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
+extern int pseries_devicetree_update(s32 scope);
#ifdef CONFIG_PPC_RTAS_DAEMON
extern void rtas_cancel_event_scan(void);
Index: powerpc/arch/powerpc/platforms/pseries/mobility.c
===================================================================
--- powerpc.orig/arch/powerpc/platforms/pseries/mobility.c 2013-03-20 08:24:15.000000000 -0500
+++ powerpc/arch/powerpc/platforms/pseries/mobility.c 2013-03-20 08:51:59.000000000 -0500
@@ -37,14 +37,16 @@
#define UPDATE_DT_NODE 0x02000000
#define ADD_DT_NODE 0x03000000
-static int mobility_rtas_call(int token, char *buf)
+#define MIGRATION_SCOPE (1)
+
+static int mobility_rtas_call(int token, char *buf, s32 scope)
{
int rc;
spin_lock(&rtas_data_buf_lock);
memcpy(rtas_data_buf, buf, RTAS_DATA_BUF_SIZE);
- rc = rtas_call(token, 2, 1, NULL, rtas_data_buf, 1);
+ rc = rtas_call(token, 2, 1, NULL, rtas_data_buf, scope);
memcpy(buf, rtas_data_buf, RTAS_DATA_BUF_SIZE);
spin_unlock(&rtas_data_buf_lock);
@@ -123,7 +125,7 @@
return 0;
}
-static int update_dt_node(u32 phandle)
+static int update_dt_node(u32 phandle, s32 scope)
{
struct update_props_workarea *upwa;
struct device_node *dn;
@@ -151,7 +153,8 @@
upwa->phandle = phandle;
do {
- rc = mobility_rtas_call(update_properties_token, rtas_buf);
+ rc = mobility_rtas_call(update_properties_token, rtas_buf,
+ scope);
if (rc < 0)
break;
@@ -219,7 +222,7 @@
return rc;
}
-static int pseries_devicetree_update(void)
+int pseries_devicetree_update(s32 scope)
{
char *rtas_buf;
u32 *data;
@@ -235,7 +238,7 @@
return -ENOMEM;
do {
- rc = mobility_rtas_call(update_nodes_token, rtas_buf);
+ rc = mobility_rtas_call(update_nodes_token, rtas_buf, scope);
if (rc && rc != 1)
break;
@@ -256,7 +259,7 @@
delete_dt_node(phandle);
break;
case UPDATE_DT_NODE:
- update_dt_node(phandle);
+ update_dt_node(phandle, scope);
break;
case ADD_DT_NODE:
drc_index = *data++;
@@ -276,7 +279,7 @@
int rc;
int activate_fw_token;
- rc = pseries_devicetree_update();
+ rc = pseries_devicetree_update(MIGRATION_SCOPE);
if (rc) {
printk(KERN_ERR "Initial post-mobility device tree update "
"failed: %d\n", rc);
@@ -292,7 +295,7 @@
rc = rtas_call(activate_fw_token, 0, 1, NULL);
if (!rc) {
- rc = pseries_devicetree_update();
+ rc = pseries_devicetree_update(MIGRATION_SCOPE);
if (rc)
printk(KERN_ERR "Secondary post-mobility device tree "
"update failed: %d\n", rc);
^ permalink raw reply
* [PATCH v2 0/11] NUMA CPU Reconfiguration using PRRN
From: Nathan Fontenot @ 2013-03-25 18:43 UTC (permalink / raw)
To: linuxppc-dev
Newer firmware on Power systems can transparently reassign platform resources
(CPU and Memory) in use. For instance, if a processor or memory unit is
predicted to fail, the platform may transparently move the processing to an
equivalent unused processor or the memory state to an equivalent unused
memory unit. However, reassigning resources across NUMA boundaries may alter
the performance of the partition. When such reassignment is necessary, the
Platform Resource Reassignment Notification (PRRN) option provides a
mechanism to inform the Linux kernel of changes to the NUMA affinity of
its platform resources.
PRRN Events are RTAS events sent up through the event-scan mechanism on
Power. When these events are received the system needs can get the updated
device tree affinity information for the affected CPUs/memory via the
rtas update-nodes and update-properties calls. This information is then
used to update the NUMA affinity of the CPUs/Memory in the kernel.
This patch set adds the ability to recognize PRRN events, update the device
tree and kernel information for CPUs (memory will be handled in a later
patch), and add an interface to enable/disable toplogy updates from /proc.
Additionally, these updates solve an exisitng problem with the VPHN (Virtual
Processor Home Node) capability and allow us to re-enable this feature.
Nathan Fontenot
Updates for Version 2 of this patchset
- Merged the functionality of platform_has_feature into the existing
firmware_has_feature routine.
- Corrected the new way certain bits in the architecture vector are
defined based on config options.
---
arch/powerpc/include/asm/firmware.h | 3
arch/powerpc/include/asm/prom.h | 46 ++---
arch/powerpc/include/asm/rtas.h | 2
arch/powerpc/kernel/prom_init.c | 98 ++---------
arch/powerpc/kernel/rtasd.c | 35 ++++
arch/powerpc/mm/numa.c | 183 ++++++++++++++--------
arch/powerpc/platforms/pseries/firmware.c | 1
powerpc/arch/powerpc/include/asm/firmware.h | 4
powerpc/arch/powerpc/include/asm/prom.h | 73 ++++++++
powerpc/arch/powerpc/include/asm/rtas.h | 1
powerpc/arch/powerpc/include/asm/topology.h | 5
powerpc/arch/powerpc/kernel/prom_init.c | 2
powerpc/arch/powerpc/kernel/rtasd.c | 6
powerpc/arch/powerpc/mm/numa.c | 62 +++++++
powerpc/arch/powerpc/platforms/pseries/firmware.c | 67 +++++++-
powerpc/arch/powerpc/platforms/pseries/mobility.c | 21 +-
powerpc/arch/powerpc/platforms/pseries/pseries.h | 5
powerpc/arch/powerpc/platforms/pseries/setup.c | 40 +++-
18 files changed, 455 insertions(+), 199 deletions(-)
^ permalink raw reply
* [PATCH 9/9] powerpc: cpufreq: move cpufreq driver to drivers/cpufreq
From: Viresh Kumar @ 2013-03-25 16:54 UTC (permalink / raw)
To: rjw
Cc: robin.randhawa, linux-pm, Viresh Kumar, Liviu.Dudau, linux-kernel,
cpufreq, Steve.Bannister, Paul Mackerras, Olof Johansson,
arnd.bergmann, arvind.chauhan, linuxppc-dev, linaro-kernel,
charles.garcia-tobin
In-Reply-To: <cover.1364229828.git.viresh.kumar@linaro.org>
This patch moves cpufreq driver of powerpc platform to drivers/cpufreq.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Olof Johansson <olof@lixom.net>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
arch/powerpc/platforms/Kconfig | 31 ----------------------
arch/powerpc/platforms/pasemi/Makefile | 1 -
arch/powerpc/platforms/powermac/Makefile | 2 --
drivers/cpufreq/Kconfig.powerpc | 26 ++++++++++++++++++
drivers/cpufreq/Makefile | 3 +++
.../cpufreq.c => drivers/cpufreq/pasemi-cpufreq.c | 0
.../cpufreq/pmac32-cpufreq.c | 0
.../cpufreq/pmac64-cpufreq.c | 0
8 files changed, 29 insertions(+), 34 deletions(-)
rename arch/powerpc/platforms/pasemi/cpufreq.c => drivers/cpufreq/pasemi-cpufreq.c (100%)
rename arch/powerpc/platforms/powermac/cpufreq_32.c => drivers/cpufreq/pmac32-cpufreq.c (100%)
rename arch/powerpc/platforms/powermac/cpufreq_64.c => drivers/cpufreq/pmac64-cpufreq.c (100%)
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 52de8bc..46a223f 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -194,37 +194,6 @@ config PPC_IO_WORKAROUNDS
source "drivers/cpufreq/Kconfig"
-menu "CPU Frequency drivers"
- depends on CPU_FREQ
-
-config CPU_FREQ_PMAC
- bool "Support for Apple PowerBooks"
- depends on ADB_PMU && PPC32
- select CPU_FREQ_TABLE
- help
- This adds support for frequency switching on Apple PowerBooks,
- this currently includes some models of iBook & Titanium
- PowerBook.
-
-config CPU_FREQ_PMAC64
- bool "Support for some Apple G5s"
- depends on PPC_PMAC && PPC64
- select CPU_FREQ_TABLE
- help
- This adds support for frequency switching on Apple iMac G5,
- and some of the more recent desktop G5 machines as well.
-
-config PPC_PASEMI_CPUFREQ
- bool "Support for PA Semi PWRficient"
- depends on PPC_PASEMI
- default y
- select CPU_FREQ_TABLE
- help
- This adds the support for frequency switching on PA Semi
- PWRficient processors.
-
-endmenu
-
menu "CPUIdle driver"
source "drivers/cpuidle/Kconfig"
diff --git a/arch/powerpc/platforms/pasemi/Makefile b/arch/powerpc/platforms/pasemi/Makefile
index ce6d789..8e8d4ca 100644
--- a/arch/powerpc/platforms/pasemi/Makefile
+++ b/arch/powerpc/platforms/pasemi/Makefile
@@ -1,3 +1,2 @@
obj-y += setup.o pci.o time.o idle.o powersave.o iommu.o dma_lib.o misc.o
obj-$(CONFIG_PPC_PASEMI_MDIO) += gpio_mdio.o
-obj-$(CONFIG_PPC_PASEMI_CPUFREQ) += cpufreq.o
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile
index ea47df6..52c6ce1 100644
--- a/arch/powerpc/platforms/powermac/Makefile
+++ b/arch/powerpc/platforms/powermac/Makefile
@@ -9,8 +9,6 @@ obj-y += pic.o setup.o time.o feature.o pci.o \
sleep.o low_i2c.o cache.o pfunc_core.o \
pfunc_base.o udbg_scc.o udbg_adb.o
obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o
-obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq_32.o
-obj-$(CONFIG_CPU_FREQ_PMAC64) += cpufreq_64.o
# CONFIG_NVRAM is an arch. independent tristate symbol, for pmac32 we really
# need this to be a bool. Cheat here and pretend CONFIG_NVRAM=m is really
# CONFIG_NVRAM=y
diff --git a/drivers/cpufreq/Kconfig.powerpc b/drivers/cpufreq/Kconfig.powerpc
index e76992f..2e5a007 100644
--- a/drivers/cpufreq/Kconfig.powerpc
+++ b/drivers/cpufreq/Kconfig.powerpc
@@ -5,3 +5,29 @@ config CPU_FREQ_MAPLE
help
This adds support for frequency switching on Maple 970FX
Evaluation Board and compatible boards (IBM JS2x blades).
+
+config CPU_FREQ_PMAC
+ bool "Support for Apple PowerBooks"
+ depends on ADB_PMU && PPC32
+ select CPU_FREQ_TABLE
+ help
+ This adds support for frequency switching on Apple PowerBooks,
+ this currently includes some models of iBook & Titanium
+ PowerBook.
+
+config CPU_FREQ_PMAC64
+ bool "Support for some Apple G5s"
+ depends on PPC_PMAC && PPC64
+ select CPU_FREQ_TABLE
+ help
+ This adds support for frequency switching on Apple iMac G5,
+ and some of the more recent desktop G5 machines as well.
+
+config PPC_PASEMI_CPUFREQ
+ bool "Support for PA Semi PWRficient"
+ depends on PPC_PASEMI
+ select CPU_FREQ_TABLE
+ default y
+ help
+ This adds the support for frequency switching on PA Semi
+ PWRficient processors.
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index 0203a06..fa4b5f2 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -75,6 +75,9 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra-cpufreq.o
##################################################################################
# PowerPC platform drivers
obj-$(CONFIG_CPU_FREQ_MAPLE) += maple-cpufreq.o
+obj-$(CONFIG_CPU_FREQ_PMAC) += pmac32-cpufreq.o
+obj-$(CONFIG_CPU_FREQ_PMAC64) += pmac64-cpufreq.o
+obj-$(CONFIG_PPC_PASEMI_CPUFREQ) += pasemi-cpufreq.o
##################################################################################
# Other platform drivers
diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/drivers/cpufreq/pasemi-cpufreq.c
similarity index 100%
rename from arch/powerpc/platforms/pasemi/cpufreq.c
rename to drivers/cpufreq/pasemi-cpufreq.c
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/drivers/cpufreq/pmac32-cpufreq.c
similarity index 100%
rename from arch/powerpc/platforms/powermac/cpufreq_32.c
rename to drivers/cpufreq/pmac32-cpufreq.c
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/drivers/cpufreq/pmac64-cpufreq.c
similarity index 100%
rename from arch/powerpc/platforms/powermac/cpufreq_64.c
rename to drivers/cpufreq/pmac64-cpufreq.c
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply related
* Re: [PATCH 1/2] cpufreq: Notify all policy->cpus in cpufreq_notify_transition()
From: Viresh Kumar @ 2013-03-25 16:50 UTC (permalink / raw)
To: Stephen Warren
Cc: linux-mips, linux-ia64, linux-sh, Sekhar Nori, sparclinux,
linaro-kernel, Guan Xuetao, arvind.chauhan,
Hans-Christian Egtvedt, Jesper Nilsson, robin.randhawa, cpufreq,
Haavard Skinnemoen, cbe-oss-dev, Fenghua Yu, Steve.Bannister,
Mike Frysinger, Arnd Bergmann, linux-pm, Liviu.Dudau,
Haojian Zhuang, Mikael Starvik, Kukjin Kim, Borislav Petkov,
Ben Dooks, Thomas Renninger, linux-arm-kernel, rjw, Tony Luck,
Eric Miao, linux-cris-kernel, linux-kernel, Ralf Baechle,
Paul Mundt, Sascha Hauer, charles.garcia-tobin, linuxppc-dev,
David S. Miller
In-Reply-To: <51507FEA.8040306@wwwdotorg.org>
On 25 March 2013 22:18, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 03/24/2013 11:19 PM, Viresh Kumar wrote:
>> On 24 March 2013 19:18, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>>> policy->cpus contains all online cpus that have single shared clock line. And
>>> their frequencies are always updated together.
>>>
>>> Many SMP system's cpufreq drivers take care of this in individual drivers but
>>> the best place for this code is in cpufreq core.
>>>
>>> This patch modifies cpufreq_notify_transition() to notify frequency change for
>>> all cpus in policy->cpus and hence updates all users of this API.
>>
>> Another fixup for tegra:
>
> This series including this patch (although I had a devil of a time
> applying this fixup since all the TABs got converted to spaces when it
> was pasted into email)
So sorry for that, I keep pushing them here:
http://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/cpufreq-fix-notify
^ permalink raw reply
* Re: [PATCH 1/2] cpufreq: Notify all policy->cpus in cpufreq_notify_transition()
From: Stephen Warren @ 2013-03-25 16:48 UTC (permalink / raw)
To: Viresh Kumar
Cc: linux-mips, linux-ia64, linux-sh, Sekhar Nori, sparclinux,
linaro-kernel, Guan Xuetao, arvind.chauhan,
Hans-Christian Egtvedt, Jesper Nilsson, robin.randhawa, cpufreq,
Haavard Skinnemoen, cbe-oss-dev, Fenghua Yu, Steve.Bannister,
Mike Frysinger, Arnd Bergmann, linux-pm, Liviu.Dudau,
Haojian Zhuang, Mikael Starvik, Kukjin Kim, Borislav Petkov,
Ben Dooks, Thomas Renninger, linux-arm-kernel, rjw, Tony Luck,
Eric Miao, linux-cris-kernel, linux-kernel, Ralf Baechle,
Paul Mundt, Sascha Hauer, charles.garcia-tobin, linuxppc-dev,
David S. Miller
In-Reply-To: <CAKohpo=JuyVmSRFs1wpqvvmouRpL+d8ms-o4UC74OJqAgFv7Vw@mail.gmail.com>
On 03/24/2013 11:19 PM, Viresh Kumar wrote:
> On 24 March 2013 19:18, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>> policy->cpus contains all online cpus that have single shared clock line. And
>> their frequencies are always updated together.
>>
>> Many SMP system's cpufreq drivers take care of this in individual drivers but
>> the best place for this code is in cpufreq core.
>>
>> This patch modifies cpufreq_notify_transition() to notify frequency change for
>> all cpus in policy->cpus and hence updates all users of this API.
>
> Another fixup for tegra:
This series including this patch (although I had a devil of a time
applying this fixup since all the TABs got converted to spaces when it
was pasted into email)
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
^ permalink raw reply
* [PATCH] powerpc: remove two lines of dead code
From: Paul Bolle @ 2013-03-25 10:32 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras; +Cc: linuxppc-dev, linux-kernel
Commit c1fb6816fb1b78dd94b673b0fdaa9a7a16e97bd1 ("powerpc: Add
relocation on exception vector handlers") added two lines of code that
depend on the macro CONFIG_HVC_SCOM. That macro doesn't exist. Perhaps
it was intended to use CONFIG_PPC_SCOM here. But since
"maintence_interrupt" is a typo and there's nothing in arch/powerpc that
looks like maintenance_interrupt it seems best to just delete these
lines.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
Untested, but low risk anyway.
arch/powerpc/kernel/exceptions-64s.S | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 200afa5..9181353 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -870,10 +870,6 @@ tm_unavailable_relon_pSeries_1:
. = 0x5500
b denorm_exception_hv
#endif
-#ifdef CONFIG_HVC_SCOM
- STD_RELON_EXCEPTION_HV(0x5600, 0x1600, maintence_interrupt)
- KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0x1600)
-#endif /* CONFIG_HVC_SCOM */
STD_RELON_EXCEPTION_PSERIES(0x5700, 0x1700, altivec_assist)
/* Other future vectors */
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH] PowerPC:kernel: make additional room in exception vector area
From: Stephen Rothwell @ 2013-03-25 6:20 UTC (permalink / raw)
To: Michael Neuling
Cc: matt, Chen Gang, linux-kernel@vger.kernel.org, paulus@samba.org,
imunsie, linuxppc-dev
In-Reply-To: <5944.1364191637@ale.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 344 bytes --]
Hi Mikey,
On Mon, 25 Mar 2013 17:07:17 +1100 Michael Neuling <mikey@neuling.org> wrote:
>
> FYI you're gonna need this one also to make allmodconfig work.
>
> http://patchwork.ozlabs.org/patch/230244/
Thanks for that, I will add it to linux-next tomorrow.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH] PowerPC:kernel: make additional room in exception vector area
From: Michael Neuling @ 2013-03-25 6:07 UTC (permalink / raw)
To: Stephen Rothwell
Cc: matt, Chen Gang, linux-kernel@vger.kernel.org, paulus@samba.org,
imunsie, linuxppc-dev
In-Reply-To: <20130325161435.ffff94805826bc7cad2c7de4@canb.auug.org.au>
Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> On Mon, 25 Mar 2013 09:31:31 +0800 Chen Gang <gang.chen@asianux.com> wrote:
> >
> > The FWNMI region is fixed at 0x7000 and the vector are now overflowing
> > that with allmodconfig. Fix that by moving slb_miss_realmode code out
> > of that region as it doesn't need to be that close to the call sites
> > (it is a _GLOBAL function)
> >
> > Signed-off-by: Chen Gang <gang.chen@asianux.com>
> > ---
> > arch/powerpc/kernel/exceptions-64s.S | 144 +++++++++++++++++-----------------
> > 1 files changed, 72 insertions(+), 72 deletions(-)
>
> Thanks, Chen,
>
> I have applied this to linux-next today and pending the builds overnight,
> will send it to Linus tomorrow or Wednesday.
sfr,
FYI you're gonna need this one also to make allmodconfig work.
http://patchwork.ozlabs.org/patch/230244/
Mikey
^ permalink raw reply
* Re: [PATCH] PowerPC:kernel: make additional room in exception vector area
From: Chen Gang @ 2013-03-25 5:38 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Michael Neuling, matt, linux-kernel@vger.kernel.org,
paulus@samba.org, imunsie, linuxppc-dev
In-Reply-To: <20130325161435.ffff94805826bc7cad2c7de4@canb.auug.org.au>
On 2013年03月25日 13:14, Stephen Rothwell wrote:
> Hi all,
>
> On Mon, 25 Mar 2013 09:31:31 +0800 Chen Gang <gang.chen@asianux.com> wrote:
>> >
>> > The FWNMI region is fixed at 0x7000 and the vector are now overflowing
>> > that with allmodconfig. Fix that by moving slb_miss_realmode code out
>> > of that region as it doesn't need to be that close to the call sites
>> > (it is a _GLOBAL function)
>> >
>> > Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> > ---
>> > arch/powerpc/kernel/exceptions-64s.S | 144 +++++++++++++++++-----------------
>> > 1 files changed, 72 insertions(+), 72 deletions(-)
> Thanks, Chen,
>
> I have applied this to linux-next today and pending the builds overnight,
> will send it to Linus tomorrow or Wednesday.
thanks.
:-)
--
Chen Gang
Asianux Corporation
^ permalink raw reply
* Re: [PATCH 1/2] cpufreq: Notify all policy->cpus in cpufreq_notify_transition()
From: Viresh Kumar @ 2013-03-25 5:19 UTC (permalink / raw)
To: rjw
Cc: linux-mips, linux-ia64, linux-sh, Viresh Kumar, Liviu.Dudau,
sparclinux, linaro-kernel, Guan Xuetao, arvind.chauhan,
Hans-Christian Egtvedt, Jesper Nilsson, robin.randhawa,
Stephen Warren, cpufreq, Haavard Skinnemoen, cbe-oss-dev,
Fenghua Yu, Steve.Bannister, Mike Frysinger, Arnd Bergmann,
linux-pm, Sekhar Nori, Haojian Zhuang, Mikael Starvik, Kukjin Kim,
Borislav Petkov, Ben Dooks, Thomas Renninger, linux-arm-kernel,
Tony Luck, Eric Miao, linux-cris-kernel, linux-kernel,
Ralf Baechle, Paul Mundt, Sascha Hauer, charles.garcia-tobin,
linuxppc-dev, David S. Miller
In-Reply-To: <981c23bd4b2a14c346820685e1203ab7054378f8.1364132845.git.viresh.kumar@linaro.org>
On 24 March 2013 19:18, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> policy->cpus contains all online cpus that have single shared clock line. And
> their frequencies are always updated together.
>
> Many SMP system's cpufreq drivers take care of this in individual drivers but
> the best place for this code is in cpufreq core.
>
> This patch modifies cpufreq_notify_transition() to notify frequency change for
> all cpus in policy->cpus and hence updates all users of this API.
Another fixup for tegra:
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index 3b441d6..11ca730 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -106,7 +106,8 @@ out:
return ret;
}
-static int tegra_update_cpu_speed(unsigned long rate)
+static int tegra_update_cpu_speed(struct cpufreq_policy *policy,
+ unsigned long rate)
{
int ret = 0;
struct cpufreq_freqs freqs;
@@ -179,7 +180,7 @@ static int tegra_target(struct cpufreq_policy *policy,
target_cpu_speed[policy->cpu] = freq;
- ret = tegra_update_cpu_speed(tegra_cpu_highest_speed());
+ ret = tegra_update_cpu_speed(policy, tegra_cpu_highest_speed());
out:
mutex_unlock(&tegra_cpu_lock);
@@ -191,10 +192,12 @@ static int tegra_pm_notify(struct notifier_block
*nb, unsigned long event,
{
mutex_lock(&tegra_cpu_lock);
if (event == PM_SUSPEND_PREPARE) {
+ struct cpufreq_policy *policy = cpufreq_cpu_get(0);
is_suspended = true;
pr_info("Tegra cpufreq suspend: setting frequency to %d kHz\n",
freq_table[0].frequency);
- tegra_update_cpu_speed(freq_table[0].frequency);
+ tegra_update_cpu_speed(policy, freq_table[0].frequency);
+ cpufreq_cpu_put(policy);
} else if (event == PM_POST_SUSPEND) {
is_suspended = false;
}
^ permalink raw reply related
* Re: [PATCH] PowerPC:kernel: make additional room in exception vector area
From: Stephen Rothwell @ 2013-03-25 5:14 UTC (permalink / raw)
To: Chen Gang
Cc: Michael Neuling, matt, linux-kernel@vger.kernel.org,
paulus@samba.org, imunsie, linuxppc-dev
In-Reply-To: <514FA8F3.1030102@asianux.com>
[-- Attachment #1: Type: text/plain, Size: 763 bytes --]
Hi all,
On Mon, 25 Mar 2013 09:31:31 +0800 Chen Gang <gang.chen@asianux.com> wrote:
>
> The FWNMI region is fixed at 0x7000 and the vector are now overflowing
> that with allmodconfig. Fix that by moving slb_miss_realmode code out
> of that region as it doesn't need to be that close to the call sites
> (it is a _GLOBAL function)
>
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
> arch/powerpc/kernel/exceptions-64s.S | 144 +++++++++++++++++-----------------
> 1 files changed, 72 insertions(+), 72 deletions(-)
Thanks, Chen,
I have applied this to linux-next today and pending the builds overnight,
will send it to Linus tomorrow or Wednesday.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH] arch/powerpc/kernel: using %12.12s instead of %12s for avoiding memory overflow.
From: Chen Gang @ 2013-03-25 4:30 UTC (permalink / raw)
To: benh, paulus, Michael Neuling, sfr@canb.auug.org.au
Cc: linuxppc-dev, linux-kernel@vger.kernel.org
In-Reply-To: <512055D0.7050100@asianux.com>
Hello Maintainers:
could you help check this patch whether is ok ?
thanks.
On 2013年02月17日 12:00, Chen Gang wrote:
> Hello relative members:
>
> please give a glance to this patch, when you have time.
>
> thanks.
>
> :-)
>
> gchen.
>
>
> 于 2013年01月24日 12:14, Chen Gang 写道:
>>
>> for tmp_part->header.name:
>> it is "Terminating null required only for names < 12 chars".
>> so need to limit the %.12s for it in printk
>>
>> additional info:
>>
>> %12s limit the width, not for the original string output length
>> if name length is more than 12, it still can be fully displayed.
>> if name length is less than 12, the ' ' will be filled before name.
>>
>> %.12s truly limit the original string output length (precision)
>>
>>
>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> ---
>> arch/powerpc/kernel/nvram_64.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
>> index bec1e93..57bf6d2 100644
>> --- a/arch/powerpc/kernel/nvram_64.c
>> +++ b/arch/powerpc/kernel/nvram_64.c
>> @@ -202,7 +202,7 @@ static void __init nvram_print_partitions(char * label)
>> printk(KERN_WARNING "--------%s---------\n", label);
>> printk(KERN_WARNING "indx\t\tsig\tchks\tlen\tname\n");
>> list_for_each_entry(tmp_part, &nvram_partitions, partition) {
>> - printk(KERN_WARNING "%4d \t%02x\t%02x\t%d\t%12s\n",
>> + printk(KERN_WARNING "%4d \t%02x\t%02x\t%d\t%12.12s\n",
>> tmp_part->index, tmp_part->header.signature,
>> tmp_part->header.checksum, tmp_part->header.length,
>> tmp_part->header.name);
>>
>
>
--
Chen Gang
Asianux Corporation
^ permalink raw reply
* Re: [PATCH] PowerPC:kernel: section mismatch from smp_release_cpus to __initdata spinning_secondaries
From: Chen Gang @ 2013-03-25 4:28 UTC (permalink / raw)
To: Benjamin Herrenschmidt, paulus@samba.org, michael, dhowells,
geoff, sfr@canb.auug.org.au, Michael Neuling
Cc: linuxppc-dev,
linux-kernel@vger.kernel.org >> "linux-kernel@vger.kernel.org"
In-Reply-To: <51495774.9080809@asianux.com>
Hello Maintainers:
could you help check this patch whether is ok ?
thanks.
On 2013年03月20日 14:30, Chen Gang wrote:
>
> the smp_release_cpus is a normal funciton and called in normal environments,
> but it calls the __initdata spinning_secondaries.
> need modify spinning_secondaries to match smp_release_cpus.
>
> the related warning:
> (the linker report boot_paca.33377, but it should be spinning_secondaries)
>
> -----------------------------------------------------------------------------
>
> WARNING: arch/powerpc/kernel/built-in.o(.text+0x23176): Section mismatch in reference from the function .smp_release_cpus() to the variable .init.data:boot_paca.33377
> The function .smp_release_cpus() references
> the variable __initdata boot_paca.33377.
> This is often because .smp_release_cpus lacks a __initdata
> annotation or the annotation of boot_paca.33377 is wrong.
>
> WARNING: arch/powerpc/kernel/built-in.o(.text+0x231fe): Section mismatch in reference from the function .smp_release_cpus() to the variable .init.data:boot_paca.33377
> The function .smp_release_cpus() references
> the variable __initdata boot_paca.33377.
> This is often because .smp_release_cpus lacks a __initdata
> annotation or the annotation of boot_paca.33377 is wrong.
>
> -----------------------------------------------------------------------------
>
>
>
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
> arch/powerpc/kernel/setup_64.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
> index 75fbaceb..e8a2f2e 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -76,7 +76,7 @@
> #endif
>
> int boot_cpuid = 0;
> -int __initdata spinning_secondaries;
> +int spinning_secondaries;
> u64 ppc64_pft_size;
>
> /* Pick defaults since we might want to patch instructions
>
--
Chen Gang
Asianux Corporation
^ permalink raw reply
* [PATCH v2] powerpc/dts: Fix the dts for p1025rdb 36bit
From: Zhicheng Fan @ 2013-03-25 1:23 UTC (permalink / raw)
To: galak, linuxppc-dev; +Cc: Zhicheng Fan
fix the following errors:
Error: arch/powerpc/boot/dts/p1025rdb.dtsi:326.2-3 label or path, 'qe', not found
Error: arch/powerpc/boot/dts/fsl/p1021si-post.dtsi:242.2-3 label or path, 'qe', not found
FATAL ERROR: Syntax error parsing input tree
Signed-off-by: Zhicheng Fan <B32736@freescale.com>
---
arch/powerpc/boot/dts/p1025rdb_36b.dts | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/boot/dts/p1025rdb_36b.dts b/arch/powerpc/boot/dts/p1025rdb_36b.dts
index 4ce4bfa..06deb6f 100644
--- a/arch/powerpc/boot/dts/p1025rdb_36b.dts
+++ b/arch/powerpc/boot/dts/p1025rdb_36b.dts
@@ -82,6 +82,11 @@
0x0 0x100000>;
};
};
+
+ qe: qe@fffe80000 {
+ status = "disabled"; /* no firmware loaded */
+ };
+
};
/include/ "p1025rdb.dtsi"
--
1.7.0.4
^ permalink raw reply related
* [PATCH] PowerPC:kernel: make additional room in exception vector area
From: Chen Gang @ 2013-03-25 1:31 UTC (permalink / raw)
To: Michael Neuling
Cc: sfr, matt, linux-kernel@vger.kernel.org, paulus@samba.org,
imunsie, linuxppc-dev
In-Reply-To: <29457.1364169818@ale.ozlabs.ibm.com>
The FWNMI region is fixed at 0x7000 and the vector are now overflowing
that with allmodconfig. Fix that by moving slb_miss_realmode code out
of that region as it doesn't need to be that close to the call sites
(it is a _GLOBAL function)
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
arch/powerpc/kernel/exceptions-64s.S | 144 +++++++++++++++++-----------------
1 files changed, 72 insertions(+), 72 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 200afa5..56bd923 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1066,78 +1066,6 @@ unrecov_user_slb:
#endif /* __DISABLED__ */
-/*
- * r13 points to the PACA, r9 contains the saved CR,
- * r12 contain the saved SRR1, SRR0 is still ready for return
- * r3 has the faulting address
- * r9 - r13 are saved in paca->exslb.
- * r3 is saved in paca->slb_r3
- * We assume we aren't going to take any exceptions during this procedure.
- */
-_GLOBAL(slb_miss_realmode)
- mflr r10
-#ifdef CONFIG_RELOCATABLE
- mtctr r11
-#endif
-
- stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
- std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
-
- bl .slb_allocate_realmode
-
- /* All done -- return from exception. */
-
- ld r10,PACA_EXSLB+EX_LR(r13)
- ld r3,PACA_EXSLB+EX_R3(r13)
- lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
-
- mtlr r10
-
- andi. r10,r12,MSR_RI /* check for unrecoverable exception */
- beq- 2f
-
-.machine push
-.machine "power4"
- mtcrf 0x80,r9
- mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
-.machine pop
-
- RESTORE_PPR_PACA(PACA_EXSLB, r9)
- ld r9,PACA_EXSLB+EX_R9(r13)
- ld r10,PACA_EXSLB+EX_R10(r13)
- ld r11,PACA_EXSLB+EX_R11(r13)
- ld r12,PACA_EXSLB+EX_R12(r13)
- ld r13,PACA_EXSLB+EX_R13(r13)
- rfid
- b . /* prevent speculative execution */
-
-2: mfspr r11,SPRN_SRR0
- ld r10,PACAKBASE(r13)
- LOAD_HANDLER(r10,unrecov_slb)
- mtspr SPRN_SRR0,r10
- ld r10,PACAKMSR(r13)
- mtspr SPRN_SRR1,r10
- rfid
- b .
-
-unrecov_slb:
- EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
- DISABLE_INTS
- bl .save_nvgprs
-1: addi r3,r1,STACK_FRAME_OVERHEAD
- bl .unrecoverable_exception
- b 1b
-
-
-#ifdef CONFIG_PPC_970_NAP
-power4_fixup_nap:
- andc r9,r9,r10
- std r9,TI_LOCAL_FLAGS(r11)
- ld r10,_LINK(r1) /* make idle task do the */
- std r10,_NIP(r1) /* equivalent of a blr */
- blr
-#endif
-
.align 7
.globl alignment_common
alignment_common:
@@ -1336,6 +1264,78 @@ _GLOBAL(opal_mc_secondary_handler)
/*
+ * r13 points to the PACA, r9 contains the saved CR,
+ * r12 contain the saved SRR1, SRR0 is still ready for return
+ * r3 has the faulting address
+ * r9 - r13 are saved in paca->exslb.
+ * r3 is saved in paca->slb_r3
+ * We assume we aren't going to take any exceptions during this procedure.
+ */
+_GLOBAL(slb_miss_realmode)
+ mflr r10
+#ifdef CONFIG_RELOCATABLE
+ mtctr r11
+#endif
+
+ stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
+ std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
+
+ bl .slb_allocate_realmode
+
+ /* All done -- return from exception. */
+
+ ld r10,PACA_EXSLB+EX_LR(r13)
+ ld r3,PACA_EXSLB+EX_R3(r13)
+ lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
+
+ mtlr r10
+
+ andi. r10,r12,MSR_RI /* check for unrecoverable exception */
+ beq- 2f
+
+.machine push
+.machine "power4"
+ mtcrf 0x80,r9
+ mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
+.machine pop
+
+ RESTORE_PPR_PACA(PACA_EXSLB, r9)
+ ld r9,PACA_EXSLB+EX_R9(r13)
+ ld r10,PACA_EXSLB+EX_R10(r13)
+ ld r11,PACA_EXSLB+EX_R11(r13)
+ ld r12,PACA_EXSLB+EX_R12(r13)
+ ld r13,PACA_EXSLB+EX_R13(r13)
+ rfid
+ b . /* prevent speculative execution */
+
+2: mfspr r11,SPRN_SRR0
+ ld r10,PACAKBASE(r13)
+ LOAD_HANDLER(r10,unrecov_slb)
+ mtspr SPRN_SRR0,r10
+ ld r10,PACAKMSR(r13)
+ mtspr SPRN_SRR1,r10
+ rfid
+ b .
+
+unrecov_slb:
+ EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
+ DISABLE_INTS
+ bl .save_nvgprs
+1: addi r3,r1,STACK_FRAME_OVERHEAD
+ bl .unrecoverable_exception
+ b 1b
+
+
+#ifdef CONFIG_PPC_970_NAP
+power4_fixup_nap:
+ andc r9,r9,r10
+ std r9,TI_LOCAL_FLAGS(r11)
+ ld r10,_LINK(r1) /* make idle task do the */
+ std r10,_NIP(r1) /* equivalent of a blr */
+ blr
+#endif
+
+/*
* Hash table stuff
*/
.align 7
--
1.7.7.6
^ permalink raw reply related
* Re: [Suggestion] PowerPC: kernel: cross compiling issue with allmodconfig
From: Chen Gang @ 2013-03-25 1:07 UTC (permalink / raw)
To: Michael Neuling
Cc: sfr, matt, linux-kernel@vger.kernel.org, paulus@samba.org,
imunsie, linuxppc-dev
In-Reply-To: <29457.1364169818@ale.ozlabs.ibm.com>
On 2013年03月25日 08:03, Michael Neuling wrote:
>
> benh asked paulus or sfr to send in while he was away.
>
> So please send your signed off by now (if you can), or someone is going
> to rewrite it, sent it upstream bypassing you.
>
> Mikey
>
>
thanks, I will send patch now.
:-)
--
Chen Gang
Asianux Corporation
^ permalink raw reply
* Re: [PATCH] PPC: define the conditions where the ePAPR idle hcall can be supported
From: Michael Neuling @ 2013-03-25 0:34 UTC (permalink / raw)
To: Stuart Yoder
Cc: sfr, matt, gang.chen, linux-kernel, paulus, imunsie,
chen.gang.flying.transformer, linuxppc-dev
In-Reply-To: <1363979533-24485-1-git-send-email-stuart.yoder@freescale.com>
Stuart Yoder <stuart.yoder@freescale.com> wrote:
> From: Stuart Yoder <stuart.yoder@freescale.com>
>
> For 32-bit, CONFIG_EPAPR_PARAVIRT pulls in both epapr_paravirt.c
> and epapr_hcalls.c which contains the 32-bit paravirt idle loop.
>
> For 64-bit, the paravirt idle loop is in idle_book3e.S and that
> source file is included only if CONFIG_PPC_BOOK3E_64 defined.
>
> This patch makes that dependency for 64-bit explicit.
>
> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
It works for me. Thanks.
> ---
> arch/powerpc/kernel/epapr_paravirt.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c
> index f3eab85..d44a571 100644
> --- a/arch/powerpc/kernel/epapr_paravirt.c
> +++ b/arch/powerpc/kernel/epapr_paravirt.c
> @@ -23,8 +23,10 @@
> #include <asm/code-patching.h>
> #include <asm/machdep.h>
>
> +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
> extern void epapr_ev_idle(void);
> extern u32 epapr_ev_idle_start[];
> +#endif
You don't need this #ifdef
>
> bool epapr_paravirt_enabled;
>
> @@ -47,11 +49,15 @@ static int __init epapr_paravirt_init(void)
>
> for (i = 0; i < (len / 4); i++) {
> patch_instruction(epapr_hypercall_start + i, insts[i]);
> +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
> patch_instruction(epapr_ev_idle_start + i, insts[i]);
> +#endif
> }
>
> +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
> if (of_get_property(hyper_node, "has-idle", NULL))
> ppc_md.power_save = epapr_ev_idle;
> +#endif
>
> epapr_paravirt_enabled = true;
>
> --
> 1.7.9.7
>
>
^ permalink raw reply
* Re: [Suggestion] PowerPC: kernel: cross compiling issue with allmodconfig
From: Michael Neuling @ 2013-03-25 0:03 UTC (permalink / raw)
To: Chen Gang
Cc: sfr, matt, linux-kernel@vger.kernel.org, paulus@samba.org,
imunsie, linuxppc-dev
In-Reply-To: <514C0061.8080004@asianux.com>
Chen Gang <gang.chen@asianux.com> wrote:
> On 2013=E5=B9=B403=E6=9C=8822=E6=97=A5 06:54, Michael Neuling wrote:
> > This is great, thanks a lot.=20=20
> >=20
> > If you want this to be picked up by the maintainer, you'll need to add
> > your signed-off-by.
> >=20
> > The signed-off-by is to indicate that your happy for it to be included
> > and that you're legally allowed to do so. See
> > http://gerrit.googlecode.com/svn/documentation/2.0/user-signedoffby.html
> > for more info.
> >=20
> > Mikey
>=20
> thanks, too.
> I prefer Benjamin to have a closer look for my fixing.
> if pass his checking, I will send a patch.
> (he is on vacation, now, and he will check it when he is back).
benh asked paulus or sfr to send in while he was away.
So please send your signed off by now (if you can), or someone is going
to rewrite it, sent it upstream bypassing you.
Mikey
^ permalink raw reply
* Re: [PATCH 0/2] Fix for mv643xx_eth built as module
From: David Miller @ 2013-03-24 21:07 UTC (permalink / raw)
To: florian
Cc: thomas.petazzoni, andrew, gmbnomis, netdev, linuxppc-dev,
linux-arm-kernel, jason
In-Reply-To: <201303242148.33842.florian@openwrt.org>
From: Florian Fainelli <florian@openwrt.org>
Date: Sun, 24 Mar 2013 21:48:33 +0100
> Hello Simon,
> =
> Le dimanche 24 mars 2013 21:33:58, Simon Baatz a =E9crit :
>> Recently [1], mv643xx_eth was changed to make use of mvmdio. However=
,
>> this change introduces two problems when mvmdio and mv643xx_eth are
>> built as modules:
>> =
>> - mvmdio is not loaded automatically by udev
>> - mv643xx_eth oopses when it can't find its PHY, i.e. when mvmdio is=
>> not yet loaded
>> =
>> The first problem can be fixed easily by adding a module alias for t=
he
>> respective platform device. The proposed fix for the second problem=
>> uses EPROBE_DEFER as suggested by Thomas Petazzoni when the driver
>> can't find its PHY.
>> =
>> These patches apply on top of Florian Fainelli's patchset. They have=
>> been tested on Marvel Kirkwood non-DT.
> =
> Both fixes look good to me, thanks for fixing this!
> =
> Acked-by: Florian Fainelli <florian@openwrt.org>
All applied, thanks.
^ permalink raw reply
* Re: [PATCH 0/2] Fix for mv643xx_eth built as module
From: Florian Fainelli @ 2013-03-24 20:48 UTC (permalink / raw)
To: Simon Baatz
Cc: thomas.petazzoni, andrew, jason, netdev, linuxppc-dev, davem,
linux-arm-kernel
In-Reply-To: <1364157240-28883-1-git-send-email-gmbnomis@gmail.com>
Hello Simon,
Le dimanche 24 mars 2013 21:33:58, Simon Baatz a =C3=A9crit :
> Recently [1], mv643xx_eth was changed to make use of mvmdio. However,
> this change introduces two problems when mvmdio and mv643xx_eth are
> built as modules:
>=20
> - mvmdio is not loaded automatically by udev
> - mv643xx_eth oopses when it can't find its PHY, i.e. when mvmdio is
> not yet loaded
>=20
> The first problem can be fixed easily by adding a module alias for the
> respective platform device. The proposed fix for the second problem
> uses EPROBE_DEFER as suggested by Thomas Petazzoni when the driver
> can't find its PHY.
>=20
> These patches apply on top of Florian Fainelli's patchset. They have
> been tested on Marvel Kirkwood non-DT.
Both fixes look good to me, thanks for fixing this!
Acked-by: Florian Fainelli <florian@openwrt.org>
=2D-=20
=46lorian
^ permalink raw reply
* [PATCH 1/2] net: mvmdio: define module alias for platform device
From: Simon Baatz @ 2013-03-24 20:33 UTC (permalink / raw)
To: linux-arm-kernel, netdev, linuxppc-dev, florian, thomas.petazzoni
Cc: Simon Baatz, andrew, jason, davem
In-Reply-To: <1364157240-28883-1-git-send-email-gmbnomis@gmail.com>
The mvmdio driver can be instantiated using device tree or as a classic
platform device. In order to load the driver automatically by udev in
the latter case, the driver needs to define a module alias for the
platform device.
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
drivers/net/ethernet/marvell/mvmdio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c
index 3472574..7b5158f 100644
--- a/drivers/net/ethernet/marvell/mvmdio.c
+++ b/drivers/net/ethernet/marvell/mvmdio.c
@@ -295,3 +295,4 @@ module_platform_driver(orion_mdio_driver);
MODULE_DESCRIPTION("Marvell MDIO interface driver");
MODULE_AUTHOR("Thomas Petazzoni <thomas.petazzoni@free-electrons.com>");
MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:orion-mdio");
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/2] mv643xx_eth: defer probing if Marvell Orion MDIO driver not loaded
From: Simon Baatz @ 2013-03-24 20:34 UTC (permalink / raw)
To: linux-arm-kernel, netdev, linuxppc-dev, florian, thomas.petazzoni
Cc: Simon Baatz, andrew, jason, davem
In-Reply-To: <1364157240-28883-1-git-send-email-gmbnomis@gmail.com>
When both the Marvell MV643XX ethernet driver and the Orion MDIO driver
are compiled as modules, the ethernet driver may be probed before the
MDIO driver. Let mv643xx_eth_probe() return EPROBE_DEFER in this case,
i.e. when it cannot find the PHY.
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
drivers/net/ethernet/marvell/mv643xx_eth.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index a65a92e..aedbd82 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2681,7 +2681,7 @@ static struct phy_device *phy_scan(struct mv643xx_eth_private *mp,
}
/* Attempt to connect to the PHY using orion-mdio */
- phydev = NULL;
+ phydev = ERR_PTR(-ENODEV);
for (i = 0; i < num; i++) {
int addr = (start + i) & 0x1f;
@@ -2812,11 +2812,17 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
netif_set_real_num_tx_queues(dev, mp->txq_count);
netif_set_real_num_rx_queues(dev, mp->rxq_count);
- if (pd->phy_addr != MV643XX_ETH_PHY_NONE)
+ if (pd->phy_addr != MV643XX_ETH_PHY_NONE) {
mp->phy = phy_scan(mp, pd->phy_addr);
- if (mp->phy != NULL)
+ if (IS_ERR(mp->phy)) {
+ err = PTR_ERR(mp->phy);
+ if (err == -ENODEV)
+ err = -EPROBE_DEFER;
+ goto out;
+ }
phy_init(mp, pd->speed, pd->duplex);
+ }
SET_ETHTOOL_OPS(dev, &mv643xx_eth_ethtool_ops);
--
1.7.9.5
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox