* [PATCH 4/6] selftests: Add futex tests to the top-level Makefile
From: Darren Hart @ 2015-05-13 4:07 UTC (permalink / raw)
To: Linux Kernel Mailing List
Cc: chrubis, Darren Hart, Shuah Khan, linux-api, Ingo Molnar,
Peter Zijlstra, Thomas Gleixner, Davidlohr Bueso, KOSAKI Motohiro
In-Reply-To: <cover.1431489408.git.dvhart@linux.intel.com>
Enable futex tests to be built and run with the make kselftest and
associated targets.
Most of the tests require escalated privileges. These return ERROR, and
run.sh continues.
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: linux-api@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
tools/testing/selftests/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 95abddc..ebac6b8 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -4,6 +4,7 @@ TARGETS += efivarfs
TARGETS += exec
TARGETS += firmware
TARGETS += ftrace
+TARGETS += futex
TARGETS += kcmp
TARGETS += memfd
TARGETS += memory-hotplug
--
2.1.4
^ permalink raw reply related
* [PATCH 5/6] kselftest: Add exit code defines
From: Darren Hart @ 2015-05-13 4:07 UTC (permalink / raw)
To: Linux Kernel Mailing List
Cc: chrubis, Darren Hart, Shuah Khan, linux-api, Ingo Molnar,
Peter Zijlstra, Thomas Gleixner, Davidlohr Bueso, KOSAKI Motohiro
In-Reply-To: <cover.1431489408.git.dvhart@linux.intel.com>
Define the exit codes with KSFT_PASS and similar so tests can use these
directly if they choose. Also enable harnesses and other tooling to use
the defines instead of hardcoding the return codes.
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: linux-api@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
tools/testing/selftests/kselftest.h | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index 572c888..ef1c80d 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -13,6 +13,13 @@
#include <stdlib.h>
#include <unistd.h>
+/* define kselftest exit codes */
+#define KSFT_PASS 0
+#define KSFT_FAIL 1
+#define KSFT_XFAIL 2
+#define KSFT_XPASS 3
+#define KSFT_SKIP 4
+
/* counters */
struct ksft_count {
unsigned int ksft_pass;
@@ -40,23 +47,23 @@ static inline void ksft_print_cnts(void)
static inline int ksft_exit_pass(void)
{
- exit(0);
+ exit(KSFT_PASS);
}
static inline int ksft_exit_fail(void)
{
- exit(1);
+ exit(KSFT_FAIL);
}
static inline int ksft_exit_xfail(void)
{
- exit(2);
+ exit(KSFT_XFAIL);
}
static inline int ksft_exit_xpass(void)
{
- exit(3);
+ exit(KSFT_XPASS);
}
static inline int ksft_exit_skip(void)
{
- exit(4);
+ exit(KSFT_SKIP);
}
#endif /* __KSELFTEST_H */
--
2.1.4
^ permalink raw reply related
* [PATCH 6/6] selftests/futex: Add .gitignore
From: Darren Hart @ 2015-05-13 4:07 UTC (permalink / raw)
To: Linux Kernel Mailing List
Cc: chrubis, Darren Hart, Shuah Khan, linux-api, Ingo Molnar,
Peter Zijlstra, Thomas Gleixner, Davidlohr Bueso, KOSAKI Motohiro
In-Reply-To: <cover.1431489408.git.dvhart@linux.intel.com>
Add the futex/functional targets to .gitignore.
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: linux-api@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
tools/testing/selftests/futex/functional/.gitignore | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 tools/testing/selftests/futex/functional/.gitignore
diff --git a/tools/testing/selftests/futex/functional/.gitignore b/tools/testing/selftests/futex/functional/.gitignore
new file mode 100644
index 0000000..a09f570
--- /dev/null
+++ b/tools/testing/selftests/futex/functional/.gitignore
@@ -0,0 +1,7 @@
+futex_requeue_pi
+futex_requeue_pi_mismatched_ops
+futex_requeue_pi_signal_restart
+futex_wait_private_mapped_file
+futex_wait_timeout
+futex_wait_uninitialized_heap
+futex_wait_wouldblock
--
2.1.4
^ permalink raw reply related
* Re: [PATCH 4/6] nohz: support PR_DATAPLANE_QUIESCE
From: Andy Lutomirski @ 2015-05-13 4:35 UTC (permalink / raw)
To: Ingo Molnar
Cc: Peter Zijlstra, Chris Metcalf, Gilad Ben Yossef, Steven Rostedt,
Ingo Molnar, Andrew Morton, Rik van Riel, Tejun Heo,
Thomas Gleixner, Frederic Weisbecker, Paul E. McKenney,
Christoph Lameter, Srivatsa S. Bhat, linux-doc@vger.kernel.org,
Linux API, linux-kernel@vger.kernel.org
In-Reply-To: <20150512125200.GB17244@gmail.com>
On Tue, May 12, 2015 at 5:52 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Peter Zijlstra <peterz@infradead.org> wrote:
>
>> > So if then a prctl() (or other system call) could be a shortcut
>> > to:
>> >
>> > - move the task to an isolated CPU
>> > - make sure there _is_ such an isolated domain available
>> >
>> > I.e. have some programmatic, kernel provided way for an
>> > application to be sure it's running in the right environment.
>> > Relying on random administration flags here and there won't cut
>> > it.
>>
>> No, we already have sched_setaffinity() and we should not duplicate
>> its ability to move tasks about.
>
> But sched_setaffinity() does not guarantee isolation - it's just a
> syscall to move a task to a set of CPUs, which might be isolated or
> not.
>
> What I suggested is that it might make sense to offer a system call,
> for example a sched_setparam() variant, that makes such guarantees.
>
> Say if user-space does:
>
> ret = sched_setscheduler(0, BIND_ISOLATED, &isolation_params);
>
> ... then we would get the task moved to an isolated domain and get a 0
> return code if the kernel is able to do all that and if the current
> uid/namespace/etc. has the required permissions and such.
>
> ( BIND_ISOLATED will not replace the current p->policy value, so it's
> still possible to use the regular policies as well on top of this. )
I think we shouldn't have magic selection of an isolated domain.
Anyone using this has already configured some isolated CPUs and
probably wants to choose the CPU and, especially, NUMA node
themselves. Also, maybe it should be a special type of realtime
class/priority -- doing this should require RT permission IMO.
--Andy
^ permalink raw reply
* [PATCH 0/5] The Beaglebone capemanager
From: Pantelis Antoniou @ 2015-05-13 7:59 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Matt Porter, Koen Kooi, Robert Nelson, Rob Herring, Grant Likely,
Jonathan Corbet, Srinivas Kandagatla, Guenter Roeck,
Geert Uytterhoeven, Benoît Cousso, linux-api, linux-doc,
devicetree, linux-kernel, Pantelis Antoniou, Pantelis Antoniou
This patchset introduces the beaglebone capemanager.
It allows seamless support for plugin boards for the beaglebone
family of boards via means of automatically loaded device tree
overlays.
For the EEPROM access it performs it is dependent on
Srinivas Kandagatla's EEPROM framework as posted in
https://lkml.org/lkml/2015/3/30/731.
The patch that adds the EEPROM framework interface to the at24
driver has been posted today and the subject line is:
"i2c: eeprom: at24: Provide an EEPROM framework interface"
The first patch contains the driver itself, while the rest
are just documentation entries and MAINTAINERS file updates.
Pantelis Antoniou (5):
misc: Beaglebone capemanager
doc: misc: Beaglebone capemanager documentation
doc: dt: beaglebone cape manager bindings.
doc: ABI: bone_capemgr sysfs API
MAINTAINERS: Beaglebone capemanager maintainer
.../testing/sysfs-devices-platform-bone_capemgr | 63 +
.../devicetree/bindings/misc/bone_capemgr.txt | 123 ++
Documentation/misc-devices/bone_capemgr.txt | 63 +
MAINTAINERS | 8 +
drivers/misc/Kconfig | 10 +
drivers/misc/Makefile | 1 +
drivers/misc/bone_capemgr.c | 1926 ++++++++++++++++++++
7 files changed, 2194 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
create mode 100644 Documentation/devicetree/bindings/misc/bone_capemgr.txt
create mode 100644 Documentation/misc-devices/bone_capemgr.txt
create mode 100644 drivers/misc/bone_capemgr.c
--
1.7.12
^ permalink raw reply
* [PATCH 1/5] misc: Beaglebone capemanager
From: Pantelis Antoniou @ 2015-05-13 7:59 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Matt Porter, Koen Kooi, Robert Nelson, Rob Herring, Grant Likely,
Jonathan Corbet, Srinivas Kandagatla, Guenter Roeck,
Geert Uytterhoeven, Benoît Cousso, linux-api, linux-doc,
devicetree, linux-kernel, Pantelis Antoniou, Pantelis Antoniou
In-Reply-To: <1431503985-31853-1-git-send-email-pantelis.antoniou@konsulko.com>
A cape loader based on DT overlays and DT objects.
This is the beaglebone cape manager which allows capes to be automatically
probed and instantiated via means of a device tree overlay deduced from
the part-number and version contained on the cape's EEPROM.
The reference manual contains information about the specification
and the contents of the EEPROM.
http://beagleboard.org/static/beaglebone/latest/Docs/Hardware/BONE_SRM.pdf
Documentation about the workings of the cape manager is located
in Documentation/misc-devices/bone_capemgr.txt
This driver is using the EEPROM framework interface to retrieve
the data stored on the baseboard and cape EEPROMs.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
---
drivers/misc/Kconfig | 10 +
drivers/misc/Makefile | 1 +
drivers/misc/bone_capemgr.c | 1926 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 1937 insertions(+)
create mode 100644 drivers/misc/bone_capemgr.c
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 006242c..f9e09e1 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -515,6 +515,16 @@ config VEXPRESS_SYSCFG
bus. System Configuration interface is one of the possible means
of generating transactions on this bus.
+config BONE_CAPEMGR
+ tristate "Beaglebone cape manager"
+ depends on ARCH_OMAP2PLUS && OF
+ select EEPROM
+ select OF_OVERLAY
+ default n
+ help
+ Say Y here to include support for automatic loading of
+ beaglebone capes.
+
source "drivers/misc/c2port/Kconfig"
source "drivers/misc/eeprom/Kconfig"
source "drivers/misc/cb710/Kconfig"
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 7d5c4cd..659b78b 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -56,3 +56,4 @@ obj-$(CONFIG_GENWQE) += genwqe/
obj-$(CONFIG_ECHO) += echo/
obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o
obj-$(CONFIG_CXL_BASE) += cxl/
+obj-$(CONFIG_BONE_CAPEMGR) += bone_capemgr.o
diff --git a/drivers/misc/bone_capemgr.c b/drivers/misc/bone_capemgr.c
new file mode 100644
index 0000000..423719c
--- /dev/null
+++ b/drivers/misc/bone_capemgr.c
@@ -0,0 +1,1926 @@
+/*
+ * TI Beaglebone cape manager
+ *
+ * Copyright (C) 2012 Texas Instruments Inc.
+ * Copyright (C) 2012-2015 Konsulko Group.
+ * Author: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/completion.h>
+#include <linux/platform_device.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/of_fdt.h>
+#include <linux/slab.h>
+#include <linux/pm_runtime.h>
+#include <linux/pinctrl/consumer.h>
+#include <linux/firmware.h>
+#include <linux/err.h>
+#include <linux/ctype.h>
+#include <linux/string.h>
+#include <linux/memory.h>
+#include <linux/kthread.h>
+#include <linux/wait.h>
+#include <linux/file.h>
+#include <linux/fs.h>
+#include <linux/eeprom-consumer.h>
+
+/* disabled capes */
+static char *disable_partno;
+module_param(disable_partno, charp, 0444);
+MODULE_PARM_DESC(disable_partno,
+ "Comma delimited list of PART-NUMBER[:REV] of disabled capes");
+
+/* enable capes */
+static char *enable_partno;
+module_param(enable_partno, charp, 0444);
+MODULE_PARM_DESC(enable_partno,
+ "Comma delimited list of PART-NUMBER[:REV] of enabled capes");
+
+/* delay to scan on boot until rootfs appears */
+static int boot_scan_period = 1000;
+module_param(boot_scan_period, int, 0444);
+MODULE_PARM_DESC(boot_scan_period,
+ "boot scan period until rootfs firmware is available");
+
+struct capemgr_info;
+
+struct slot_ee_attribute {
+ struct device_attribute devattr;
+ unsigned int field;
+ struct bone_cape_slot *slot; /* this is filled when instantiated */
+};
+#define to_slot_ee_attribute(x) \
+ container_of((x), struct slot_ee_attribute, devattr)
+
+struct bbrd_ee_attribute {
+ struct device_attribute devattr;
+ unsigned int field;
+};
+#define to_bbrd_ee_attribute(x) \
+ container_of((x), struct bbrd_ee_attribute, devattr)
+
+struct bone_cape_slot {
+ struct list_head node;
+ struct capemgr_info *info;
+ int slotno;
+ u32 eeprom_handle;
+ int eeprom_addr;
+ struct eeprom_cell *eeprom_cell;
+
+ char text_id[256];
+ char signature[256];
+ /* quick access */
+ char board_name[32+1];
+ char version[4+1];
+ char manufacturer[16+1];
+ char part_number[16+1];
+
+ /* attribute group */
+ char *ee_attr_name;
+ int ee_attrs_count;
+ struct slot_ee_attribute *ee_attrs;
+ struct attribute **ee_attrs_tab;
+ struct attribute_group attrgroup;
+
+ /* state flags */
+ unsigned int probed : 1;
+ unsigned int probe_failed : 1;
+ unsigned int override : 1;
+ unsigned int loading : 1;
+ unsigned int loaded : 1;
+ unsigned int retry_loading : 1;
+ unsigned int disabled : 1;
+
+ char *dtbo;
+ const struct firmware *fw;
+ struct device_node *overlay;
+ int overlay_id;
+
+ /* loader thread */
+ struct task_struct *loader_thread;
+
+ /* load priority */
+ int priority;
+};
+
+struct bone_baseboard {
+
+ /* from the matched boardmap node */
+ char *compatible_name;
+
+ /* filled in by reading the eeprom */
+ char signature[256];
+ char text_id[64+1];
+
+ /* quick access */
+ char board_name[8+1];
+ char revision[4+1];
+ char serial_number[12+1];
+
+ /* access to the eeprom */
+ u32 eeprom_handle;
+ int eeprom_addr;
+ struct eeprom_cell *eeprom_cell;
+};
+
+struct capemgr_info {
+ struct platform_device *pdev;
+
+ atomic_t next_slot_nr;
+ struct list_head slot_list;
+ struct mutex slots_list_mutex;
+
+ /* baseboard EEPROM data */
+ struct bone_baseboard baseboard;
+
+ /* wait queue for keeping the priorities straight */
+ wait_queue_head_t load_wq;
+};
+
+static int bone_slot_fill_override(struct bone_cape_slot *slot,
+ struct device_node *node,
+ const char *part_number, const char *version);
+static struct bone_cape_slot *capemgr_add_slot(
+ struct capemgr_info *info, struct device_node *node,
+ const char *part_number, const char *version, int prio);
+static int capemgr_remove_slot_no_lock(struct bone_cape_slot *slot);
+static int capemgr_remove_slot(struct bone_cape_slot *slot);
+static int capemgr_load_slot(struct bone_cape_slot *slot);
+static int capemgr_unload_slot(struct bone_cape_slot *slot);
+
+/* baseboard EEPROM field definition */
+#define BBRD_EE_FIELD_HEADER 0
+#define BBRD_EE_FIELD_BOARD_NAME 1
+#define BBRD_EE_FIELD_REVISION 2
+#define BBRD_EE_FIELD_SERIAL_NUMBER 3
+#define BBRD_EE_FIELD_CONFIG_OPTION 4
+#define BBRD_EE_FILED_RSVD1 5
+#define BBRD_EE_FILED_RSVD2 6
+#define BBRD_EE_FILED_RSVD3 7
+
+/* cape EEPROM field definitions */
+#define CAPE_EE_FIELD_HEADER 0
+#define CAPE_EE_FIELD_EEPROM_REV 1
+#define CAPE_EE_FIELD_BOARD_NAME 2
+#define CAPE_EE_FIELD_VERSION 3
+#define CAPE_EE_FIELD_MANUFACTURER 4
+#define CAPE_EE_FIELD_PART_NUMBER 5
+#define CAPE_EE_FIELD_NUMBER_OF_PINS 6
+#define CAPE_EE_FIELD_SERIAL_NUMBER 7
+#define CAPE_EE_FIELD_PIN_USAGE 8
+#define CAPE_EE_FIELD_VDD_3V3EXP 9
+#define CAPE_EE_FIELD_VDD_5V 10
+#define CAPE_EE_FIELD_SYS_5V 11
+#define CAPE_EE_FIELD_DC_SUPPLIED 12
+#define CAPE_EE_FIELD_FIELDS_NR 13
+
+#define EE_FIELD_MAKE_HEADER(p) \
+ ({ \
+ const u8 *_p = (p); \
+ (((u32)_p[0] << 24) | ((u32)_p[1] << 16) | \
+ ((u32)_p[2] << 8) | (u32)_p[3]); \
+ })
+
+#define EE_FIELD_HEADER_VALID 0xaa5533ee
+
+struct ee_field {
+ const char *name;
+ int start;
+ int size;
+ unsigned int ascii : 1;
+ unsigned int strip_trailing_dots : 1;
+ const char *override;
+};
+
+/* baseboard EEPROM definitions */
+static const struct ee_field bbrd_sig_fields[] = {
+ [BBRD_EE_FIELD_HEADER] = {
+ .name = "header",
+ .start = 0,
+ .size = 4,
+ .ascii = 0,
+ .override = "\xaa\x55\x33\xee", /* AA 55 33 EE */
+ },
+ [BBRD_EE_FIELD_BOARD_NAME] = {
+ .name = "board-name",
+ .start = 4,
+ .size = 8,
+ .ascii = 1,
+ .strip_trailing_dots = 1,
+ .override = "Board Name",
+ },
+ [BBRD_EE_FIELD_REVISION] = {
+ .name = "revision",
+ .start = 12,
+ .size = 4,
+ .ascii = 1,
+ .override = "00A0",
+ },
+ [BBRD_EE_FIELD_SERIAL_NUMBER] = {
+ .name = "serial-number",
+ .start = 16,
+ .size = 12,
+ .ascii = 1,
+ .override = "0000000000",
+ },
+ [BBRD_EE_FIELD_CONFIG_OPTION] = {
+ .name = "config-option",
+ .start = 28,
+ .size = 32,
+ },
+};
+
+/* cape EEPROM definitions */
+static const struct ee_field cape_sig_fields[] = {
+ [CAPE_EE_FIELD_HEADER] = {
+ .name = "header",
+ .start = 0,
+ .size = 4,
+ .ascii = 0,
+ .override = "\xaa\x55\x33\xee", /* AA 55 33 EE */
+ },
+ [CAPE_EE_FIELD_EEPROM_REV] = {
+ .name = "eeprom-format-revision",
+ .start = 4,
+ .size = 2,
+ .ascii = 1,
+ .override = "A0",
+ },
+ [CAPE_EE_FIELD_BOARD_NAME] = {
+ .name = "board-name",
+ .start = 6,
+ .size = 32,
+ .ascii = 1,
+ .strip_trailing_dots = 1,
+ .override = "Override Board Name",
+ },
+ [CAPE_EE_FIELD_VERSION] = {
+ .name = "version",
+ .start = 38,
+ .size = 4,
+ .ascii = 1,
+ .override = "00A0",
+ },
+ [CAPE_EE_FIELD_MANUFACTURER] = {
+ .name = "manufacturer",
+ .start = 42,
+ .size = 16,
+ .ascii = 1,
+ .strip_trailing_dots = 1,
+ .override = "Override Manuf",
+ },
+ [CAPE_EE_FIELD_PART_NUMBER] = {
+ .name = "part-number",
+ .start = 58,
+ .size = 16,
+ .ascii = 1,
+ .strip_trailing_dots = 1,
+ .override = "Override Part#",
+ },
+ [CAPE_EE_FIELD_NUMBER_OF_PINS] = {
+ .name = "number-of-pins",
+ .start = 74,
+ .size = 2,
+ .ascii = 0,
+ .override = NULL,
+ },
+ [CAPE_EE_FIELD_SERIAL_NUMBER] = {
+ .name = "serial-number",
+ .start = 76,
+ .size = 12,
+ .ascii = 1,
+ .override = "0000000000",
+ },
+ [CAPE_EE_FIELD_PIN_USAGE] = {
+ .name = "pin-usage",
+ .start = 88,
+ .size = 140,
+ .ascii = 0,
+ .override = NULL,
+ },
+ [CAPE_EE_FIELD_VDD_3V3EXP] = {
+ .name = "vdd-3v3exp",
+ .start = 228,
+ .size = 2,
+ .ascii = 0,
+ .override = NULL,
+ },
+ [CAPE_EE_FIELD_VDD_5V] = {
+ .name = "vdd-5v",
+ .start = 230,
+ .size = 2,
+ .ascii = 0,
+ .override = NULL,
+ },
+ [CAPE_EE_FIELD_SYS_5V] = {
+ .name = "sys-5v",
+ .start = 232,
+ .size = 2,
+ .ascii = 0,
+ .override = NULL,
+ },
+ [CAPE_EE_FIELD_DC_SUPPLIED] = {
+ .name = "dc-supplied",
+ .start = 234,
+ .size = 2,
+ .ascii = 0,
+ .override = NULL,
+ },
+};
+
+static char *ee_field_get(const struct ee_field *sig_field,
+ const void *data, int field, char *buf, int bufsz)
+{
+ int len;
+
+ /* enough space? */
+ if (bufsz < sig_field->size + sig_field->ascii)
+ return NULL;
+
+ memcpy(buf, (char *)data + sig_field->start, sig_field->size);
+
+ /* terminate ascii field */
+ if (sig_field->ascii)
+ buf[sig_field->size] = '\0';
+
+ if (sig_field->strip_trailing_dots) {
+ len = strlen(buf);
+ while (len > 1 && buf[len - 1] == '.')
+ buf[--len] = '\0';
+ }
+
+ return buf;
+}
+
+char *bbrd_ee_field_get(const void *data,
+ int field, char *buf, int bufsz)
+{
+ if ((unsigned int)field >= ARRAY_SIZE(bbrd_sig_fields))
+ return NULL;
+
+ return ee_field_get(&bbrd_sig_fields[field], data, field, buf, bufsz);
+}
+
+char *cape_ee_field_get(const void *data,
+ int field, char *buf, int bufsz)
+{
+ if ((unsigned int)field >= ARRAY_SIZE(cape_sig_fields))
+ return NULL;
+
+ return ee_field_get(&cape_sig_fields[field], data, field, buf, bufsz);
+}
+
+#ifdef CONFIG_OF
+static const struct of_device_id capemgr_of_match[] = {
+ {
+ .compatible = "ti,bone-capemgr",
+ },
+ { },
+};
+MODULE_DEVICE_TABLE(of, capemgr_of_match);
+
+#endif
+
+static int bone_baseboard_scan(struct bone_baseboard *bbrd)
+{
+ struct capemgr_info *info = container_of(bbrd,
+ struct capemgr_info, baseboard);
+ const u8 *p;
+ int ret;
+ size_t len;
+
+ p = eeprom_cell_read(bbrd->eeprom_cell, &len);
+ if (IS_ERR(p)) {
+ ret = PTR_ERR(p);
+ dev_err(&info->pdev->dev,
+ "Cannot read cell (ret=%d)\n", ret);
+ return ret;
+ }
+ if (len < sizeof(bbrd->signature)) {
+ dev_info(&info->pdev->dev,
+ "Short read %d (should be >= %d bytes)\n",
+ len, sizeof(bbrd->signature));
+ return -EINVAL;
+ }
+ memcpy(bbrd->signature, p, sizeof(bbrd->signature));
+
+ p = bbrd->signature;
+ if (EE_FIELD_MAKE_HEADER(p) != EE_FIELD_HEADER_VALID) {
+ dev_err(&info->pdev->dev, "Invalid board signature '%08x'\n",
+ EE_FIELD_MAKE_HEADER(p));
+ return -ENODEV;
+ }
+
+ bbrd_ee_field_get(bbrd->signature,
+ BBRD_EE_FIELD_BOARD_NAME,
+ bbrd->board_name, sizeof(bbrd->board_name));
+ bbrd_ee_field_get(bbrd->signature,
+ BBRD_EE_FIELD_REVISION,
+ bbrd->revision, sizeof(bbrd->revision));
+ bbrd_ee_field_get(bbrd->signature,
+ BBRD_EE_FIELD_SERIAL_NUMBER,
+ bbrd->serial_number, sizeof(bbrd->serial_number));
+
+ /* board_name,version,manufacturer,part_number */
+ snprintf(bbrd->text_id, sizeof(bbrd->text_id) - 1,
+ "%s,%s,%s", bbrd->board_name, bbrd->revision,
+ bbrd->serial_number);
+
+ /* terminate always */
+ bbrd->text_id[sizeof(bbrd->text_id) - 1] = '\0';
+
+ return 0;
+}
+
+static int bone_slot_scan(struct bone_cape_slot *slot)
+{
+ struct capemgr_info *info = slot->info;
+ const u8 *p;
+ int r;
+ ssize_t len;
+
+ /* need to read EEPROM? */
+ if (slot->probed)
+ goto slot_fail_check;
+
+ slot->probed = 1;
+
+ if (!slot->override) {
+
+ p = eeprom_cell_read(slot->eeprom_cell, &len);
+ if (IS_ERR(p)) {
+ r = PTR_ERR(p);
+ slot->probe_failed = 1;
+
+ /* timeout is normal when no cape is present */
+ if (r != -ETIMEDOUT)
+ dev_err(&info->pdev->dev,
+ "Cannot read cell (ret=%d)\n", r);
+ return r;
+ }
+ if (len < sizeof(slot->signature)) {
+ dev_info(&info->pdev->dev,
+ "Short read %d (should be >= %d bytes)\n",
+ len, sizeof(slot->signature));
+ return -EINVAL;
+ }
+ memcpy(slot->signature, p, sizeof(slot->signature));
+
+ } else
+ dev_info(&info->pdev->dev,
+ "Using override eeprom data at slot %d\n",
+ slot->slotno);
+
+ p = slot->signature;
+ if (EE_FIELD_MAKE_HEADER(p) != EE_FIELD_HEADER_VALID) {
+ dev_err(&info->pdev->dev,
+ "Invalid signature '%08x' at slot %d\n",
+ EE_FIELD_MAKE_HEADER(p), slot->slotno);
+ slot->probe_failed = 1;
+ return -ENODEV;
+ }
+
+ cape_ee_field_get(slot->signature,
+ CAPE_EE_FIELD_BOARD_NAME,
+ slot->board_name, sizeof(slot->board_name));
+ cape_ee_field_get(slot->signature,
+ CAPE_EE_FIELD_VERSION,
+ slot->version, sizeof(slot->version));
+ cape_ee_field_get(slot->signature,
+ CAPE_EE_FIELD_MANUFACTURER,
+ slot->manufacturer, sizeof(slot->manufacturer));
+ cape_ee_field_get(slot->signature,
+ CAPE_EE_FIELD_PART_NUMBER,
+ slot->part_number, sizeof(slot->part_number));
+
+ /* board_name,version,manufacturer,part_number */
+ snprintf(slot->text_id, sizeof(slot->text_id) - 1,
+ "%s,%s,%s,%s", slot->board_name, slot->version,
+ slot->manufacturer, slot->part_number);
+
+ /* terminate always */
+ slot->text_id[sizeof(slot->text_id) - 1] = '\0';
+
+slot_fail_check:
+ /* slot has failed and we don't support hotpluging */
+ if (slot->probe_failed)
+ return -ENODEV;
+
+ return 0;
+}
+
+/* return 0 if not matched,, 1 if matched */
+static int bone_match_cape(const char *match,
+ const char *part_number, const char *version)
+{
+ char *tmp_part_number, *tmp_version;
+ char *buf, *s, *e, *sn;
+ int found;
+
+ if (match == NULL || part_number == NULL)
+ return 0;
+
+ /* copy the argument to work on it */
+ buf = kstrdup(match, GFP_KERNEL);
+
+ /* no memory, too bad... */
+ if (buf == NULL)
+ return 0;
+
+ found = 0;
+ s = buf;
+ e = s + strlen(s);
+ while (s < e) {
+ /* find comma separator */
+ sn = strchr(s, ',');
+ if (sn != NULL)
+ *sn++ = '\0';
+ else
+ sn = e;
+ tmp_part_number = s;
+ tmp_version = strchr(tmp_part_number, ':');
+ if (tmp_version != NULL)
+ *tmp_version++ = '\0';
+ s = sn;
+
+ /* the part names must match */
+ if (strcmp(tmp_part_number, part_number) != 0)
+ continue;
+
+ /* if there's no version, match any */
+ if (version == NULL || tmp_version == NULL ||
+ strcmp(version, tmp_version) == 0) {
+ found = 1;
+ break;
+ }
+ }
+
+ kfree(buf);
+
+ return found;
+}
+
+/* helper method */
+static int of_multi_prop_cmp(const struct property *prop, const char *value)
+{
+ const char *cp;
+ int cplen, vlen, l;
+
+ /* check if it's directly compatible */
+ cp = prop->value;
+ cplen = prop->length;
+ vlen = strlen(value);
+
+ while (cplen > 0) {
+ /* compatible? */
+ if (of_compat_cmp(cp, value, vlen) == 0)
+ return 0;
+ l = strlen(cp) + 1;
+ cp += l;
+ cplen -= l;
+ }
+ return -1;
+}
+
+static ssize_t slot_ee_attr_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct slot_ee_attribute *ee_attr = to_slot_ee_attribute(attr);
+ struct bone_cape_slot *slot = ee_attr->slot;
+ const struct ee_field *sig_field;
+ int i, len;
+ char *p, *s;
+ u16 val;
+
+ /* add newline for ascii fields */
+ sig_field = &cape_sig_fields[ee_attr->field];
+
+ len = sig_field->size + sig_field->ascii;
+ p = kmalloc(len, GFP_KERNEL);
+ if (p == NULL)
+ return -ENOMEM;
+
+ s = cape_ee_field_get(slot->signature, ee_attr->field, p, len);
+ if (s == NULL)
+ return -EINVAL;
+
+ /* add newline for ascii fields and return */
+ if (sig_field->ascii) {
+ len = sprintf(buf, "%s\n", s);
+ goto out;
+ }
+
+ /* case by case handling */
+ switch (ee_attr->field) {
+ case CAPE_EE_FIELD_HEADER:
+ len = sprintf(buf, "%02x %02x %02x %02x\n",
+ s[0], s[1], s[2], s[3]);
+ break;
+
+ /* 2 bytes */
+ case CAPE_EE_FIELD_NUMBER_OF_PINS:
+ case CAPE_EE_FIELD_VDD_3V3EXP:
+ case CAPE_EE_FIELD_VDD_5V:
+ case CAPE_EE_FIELD_SYS_5V:
+ case CAPE_EE_FIELD_DC_SUPPLIED:
+ /* the bone is LE */
+ val = s[0] & (s[1] << 8);
+ len = sprintf(buf, "%u\n", (unsigned int)val & 0xffff);
+ break;
+
+ case CAPE_EE_FIELD_PIN_USAGE:
+
+ len = 0;
+ for (i = 0; i < sig_field->size / 2; i++) {
+ /* the bone is LE */
+ val = s[0] & (s[1] << 8);
+ sprintf(buf, "%04x\n", val);
+ buf += 5;
+ len += 5;
+ s += 2;
+ }
+
+ break;
+
+ default:
+ *buf = '\0';
+ len = 0;
+ break;
+ }
+
+out:
+ kfree(p);
+
+ return len;
+}
+
+#define SLOT_EE_ATTR(_name, _field) \
+ { \
+ .devattr = __ATTR(_name, S_IRUGO, slot_ee_attr_show, NULL), \
+ .field = CAPE_EE_FIELD_##_field, \
+ .slot = NULL, \
+ }
+
+static const struct slot_ee_attribute slot_ee_attrs[] = {
+ SLOT_EE_ATTR(header, HEADER),
+ SLOT_EE_ATTR(eeprom-format-revision, EEPROM_REV),
+ SLOT_EE_ATTR(board-name, BOARD_NAME),
+ SLOT_EE_ATTR(version, VERSION),
+ SLOT_EE_ATTR(manufacturer, MANUFACTURER),
+ SLOT_EE_ATTR(part-number, PART_NUMBER),
+ SLOT_EE_ATTR(number-of-pins, NUMBER_OF_PINS),
+ SLOT_EE_ATTR(serial-number, SERIAL_NUMBER),
+ SLOT_EE_ATTR(pin-usage, PIN_USAGE),
+ SLOT_EE_ATTR(vdd-3v3exp, VDD_3V3EXP),
+ SLOT_EE_ATTR(vdd-5v, VDD_5V),
+ SLOT_EE_ATTR(sys-5v, SYS_5V),
+ SLOT_EE_ATTR(dc-supplied, DC_SUPPLIED),
+};
+
+static int bone_cape_slot_sysfs_register(struct bone_cape_slot *slot)
+{
+ struct capemgr_info *info = slot->info;
+ struct device *dev = &info->pdev->dev;
+ struct slot_ee_attribute *ee_attr;
+ struct attribute_group *attrgroup;
+ int i, err, sz;
+
+ slot->ee_attr_name = kasprintf(GFP_KERNEL, "slot-%d", slot->slotno);
+ if (slot->ee_attr_name == NULL) {
+ dev_err(dev, "slot #%d: Failed to allocate ee_attr_name\n",
+ slot->slotno);
+ err = -ENOMEM;
+ goto err_fail_no_ee_attr_name;
+ }
+
+ slot->ee_attrs_count = ARRAY_SIZE(slot_ee_attrs);
+
+ sz = slot->ee_attrs_count * sizeof(*slot->ee_attrs);
+ slot->ee_attrs = kmalloc(sz, GFP_KERNEL);
+ if (slot->ee_attrs == NULL) {
+ dev_err(dev, "slot #%d: Failed to allocate ee_attrs\n",
+ slot->slotno);
+ err = -ENOMEM;
+ goto err_fail_no_ee_attrs;
+ }
+
+ attrgroup = &slot->attrgroup;
+ memset(attrgroup, 0, sizeof(*attrgroup));
+ attrgroup->name = slot->ee_attr_name;
+
+ sz = sizeof(*slot->ee_attrs_tab) * (slot->ee_attrs_count + 1);
+ attrgroup->attrs = kmalloc(sz, GFP_KERNEL);
+ if (attrgroup->attrs == NULL) {
+ dev_err(dev, "slot #%d: Failed to allocate ee_attrs_tab\n",
+ slot->slotno);
+ err = -ENOMEM;
+ goto err_fail_no_ee_attrs_tab;
+ }
+ /* copy everything over */
+ memcpy(slot->ee_attrs, slot_ee_attrs, sizeof(slot_ee_attrs));
+
+ /* bind this attr to the slot */
+ for (i = 0; i < slot->ee_attrs_count; i++) {
+ ee_attr = &slot->ee_attrs[i];
+ ee_attr->slot = slot;
+ attrgroup->attrs[i] = &ee_attr->devattr.attr;
+ }
+ attrgroup->attrs[i] = NULL;
+
+ /* make lockdep happy */
+ for (i = 0; i < slot->ee_attrs_count; i++) {
+ ee_attr = &slot->ee_attrs[i];
+ sysfs_attr_init(&ee_attr->devattr.attr);
+ }
+
+ err = sysfs_create_group(&dev->kobj, attrgroup);
+ if (err != 0) {
+ dev_err(dev, "slot #%d: Failed to allocate ee_attrs_tab\n",
+ slot->slotno);
+ err = -ENOMEM;
+ goto err_fail_no_ee_attrs_group;
+ }
+
+ return 0;
+
+err_fail_no_ee_attrs_group:
+ kfree(slot->ee_attrs_tab);
+err_fail_no_ee_attrs_tab:
+ kfree(slot->ee_attrs);
+err_fail_no_ee_attrs:
+ kfree(slot->ee_attr_name);
+err_fail_no_ee_attr_name:
+ return err;
+}
+
+static void bone_cape_slot_sysfs_unregister(struct bone_cape_slot *slot)
+{
+ struct capemgr_info *info = slot->info;
+ struct device *dev = &info->pdev->dev;
+
+ sysfs_remove_group(&dev->kobj, &slot->attrgroup);
+ kfree(slot->ee_attrs_tab);
+ kfree(slot->ee_attrs);
+ kfree(slot->ee_attr_name);
+}
+
+static ssize_t bbrd_ee_attr_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct bbrd_ee_attribute *ee_attr = to_bbrd_ee_attribute(attr);
+ struct platform_device *pdev = to_platform_device(dev);
+ struct capemgr_info *info = platform_get_drvdata(pdev);
+ struct bone_baseboard *bbrd = &info->baseboard;
+ const struct ee_field *sig_field;
+ u16 val;
+ int i, len;
+ char *p, *s;
+
+ /* add newline for ascii fields */
+ sig_field = &bbrd_sig_fields[ee_attr->field];
+
+ len = sig_field->size + sig_field->ascii;
+ p = kmalloc(len, GFP_KERNEL);
+ if (p == NULL)
+ return -ENOMEM;
+
+ s = bbrd_ee_field_get(bbrd->signature, ee_attr->field, p, len);
+ if (s == NULL)
+ return -EINVAL;
+
+ /* add newline for ascii fields and return */
+ if (sig_field->ascii) {
+ len = sprintf(buf, "%s\n", s);
+ goto out;
+ }
+
+ /* case by case handling */
+ switch (ee_attr->field) {
+ case BBRD_EE_FIELD_HEADER:
+ len = sprintf(buf, "%02x %02x %02x %02x\n",
+ s[0], s[1], s[2], s[3]);
+ break;
+
+ case BBRD_EE_FIELD_CONFIG_OPTION:
+ len = 0;
+ for (i = 0; i < sig_field->size / 2; i++) {
+ /* the bone is LE */
+ val = s[0] & (s[1] << 8);
+ sprintf(buf, "%04x\n", val);
+ buf += 5;
+ len += 5;
+ s += 2;
+ }
+ break;
+
+ default:
+ *buf = '\0';
+ len = 0;
+ break;
+ }
+
+out:
+ kfree(p);
+
+ return len;
+}
+
+#define BBRD_EE_ATTR(_name, _field) \
+ { \
+ .devattr = __ATTR(_name, 0440, bbrd_ee_attr_show, NULL), \
+ .field = BBRD_EE_FIELD_##_field, \
+ }
+
+static struct bbrd_ee_attribute bbrd_ee_attrs[] = {
+ BBRD_EE_ATTR(header, HEADER),
+ BBRD_EE_ATTR(board-name, BOARD_NAME),
+ BBRD_EE_ATTR(revision, REVISION),
+ BBRD_EE_ATTR(serial-number, SERIAL_NUMBER),
+ BBRD_EE_ATTR(config-option, CONFIG_OPTION),
+};
+
+static struct attribute *bbrd_attrs_flat[] = {
+ &bbrd_ee_attrs[BBRD_EE_FIELD_HEADER].devattr.attr,
+ &bbrd_ee_attrs[BBRD_EE_FIELD_BOARD_NAME].devattr.attr,
+ &bbrd_ee_attrs[BBRD_EE_FIELD_REVISION].devattr.attr,
+ &bbrd_ee_attrs[BBRD_EE_FIELD_SERIAL_NUMBER].devattr.attr,
+ &bbrd_ee_attrs[BBRD_EE_FIELD_CONFIG_OPTION].devattr.attr,
+ NULL,
+};
+
+static const struct attribute_group bbrd_attr_group = {
+ .name = "baseboard",
+ .attrs = bbrd_attrs_flat,
+};
+
+static ssize_t slots_show(struct device *dev, struct device_attribute *attr,
+ char *buf);
+static ssize_t slots_store(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count);
+
+static DEVICE_ATTR(slots, 0644, slots_show, slots_store);
+
+static struct attribute *root_attrs_flat[] = {
+ &dev_attr_slots.attr,
+ NULL,
+};
+
+static const struct attribute_group root_attr_group = {
+ .attrs = root_attrs_flat,
+};
+
+static const struct attribute_group *attr_groups[] = {
+ &root_attr_group,
+ &bbrd_attr_group,
+ NULL,
+};
+
+static ssize_t slots_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct capemgr_info *info = platform_get_drvdata(pdev);
+ struct bone_cape_slot *slot;
+ ssize_t len, sz;
+
+ mutex_lock(&info->slots_list_mutex);
+ sz = 0;
+ list_for_each_entry(slot, &info->slot_list, node) {
+
+ len = sprintf(buf, "%2d: %c%c%c%c%c%c %3d %s\n",
+ slot->slotno,
+ slot->probed ? 'P' : '-',
+ slot->probe_failed ? 'F' : '-',
+ slot->override ? 'O' : '-',
+ slot->loading ? 'l' : '-',
+ slot->loaded ? 'L' : '-',
+ slot->disabled ? 'D' : '-',
+ slot->overlay_id, slot->text_id);
+
+ buf += len;
+ sz += len;
+ }
+ mutex_unlock(&info->slots_list_mutex);
+
+ return sz;
+}
+
+static ssize_t slots_store(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct capemgr_info *info = platform_get_drvdata(pdev);
+ struct bone_cape_slot *slot;
+ struct device_node *pnode, *node, *slots_node;
+ char *s, *part_number, *version;
+ int ret;
+ int slotno;
+
+ /* check for remove slot */
+ if (strlen(buf) > 0 && buf[0] == '-') {
+ ret = kstrtoint(buf + 1, 10, &slotno);
+ if (ret != 0)
+ return ret;
+
+ /* now load each (take lock to be sure */
+ mutex_lock(&info->slots_list_mutex);
+ list_for_each_entry(slot, &info->slot_list, node) {
+ if (slotno == slot->slotno)
+ goto found;
+ }
+
+ mutex_unlock(&info->slots_list_mutex);
+ return -ENODEV;
+found:
+ /* the hardware slots just get unloaded */
+ if (!slot->override) {
+ ret = capemgr_unload_slot(slot);
+ if (ret == 0)
+ dev_info(&pdev->dev,
+ "Unloaded slot #%d\n", slotno);
+ else
+ dev_err(&pdev->dev,
+ "Failed to unload slot #%d\n", slotno);
+ } else {
+ ret = capemgr_remove_slot_no_lock(slot);
+ if (ret == 0)
+ dev_info(&pdev->dev,
+ "Removed slot #%d\n", slotno);
+ else
+ dev_err(&pdev->dev,
+ "Failed to remove slot #%d\n", slotno);
+ }
+ mutex_unlock(&info->slots_list_mutex);
+
+ return ret == 0 ? strlen(buf) : ret;
+ }
+
+ part_number = kstrdup(buf, GFP_KERNEL);
+ if (part_number == NULL)
+ return -ENOMEM;
+
+ /* remove trailing spaces dots and newlines */
+ s = part_number + strlen(part_number);
+ while (s > part_number &&
+ (isspace(s[-1]) || s[-1] == '\n' || s[-1] == '.'))
+ *--s = '\0';
+
+ version = strchr(part_number, ':');
+ if (version != NULL)
+ *version++ = '\0';
+
+ dev_info(&pdev->dev, "part_number '%s', version '%s'\n",
+ part_number, version ? version : "N/A");
+
+ pnode = pdev->dev.of_node;
+ node = NULL;
+ slot = NULL;
+ ret = 0;
+
+ /* no specific slot found, try immediate */
+ slot = capemgr_add_slot(info, NULL, part_number, version, 0);
+
+ if (IS_ERR_OR_NULL(slot)) {
+ dev_err(&pdev->dev, "Failed to add slot #%d\n",
+ atomic_read(&info->next_slot_nr) - 1);
+ ret = slot ? PTR_ERR(slot) : -ENODEV;
+ slot = NULL;
+ goto err_fail;
+ }
+
+ kfree(part_number);
+
+ ret = capemgr_load_slot(slot);
+ if (ret != 0)
+ capemgr_remove_slot(slot);
+
+ return ret == 0 ? strlen(buf) : ret;
+err_fail:
+ of_node_put(node);
+ of_node_put(slots_node);
+ kfree(part_number);
+ return ret;
+}
+
+/* verify the overlay */
+static int capemgr_verify_overlay(struct bone_cape_slot *slot)
+{
+ struct capemgr_info *info = slot->info;
+ struct device *dev = &info->pdev->dev;
+ struct bone_baseboard *bbrd = &info->baseboard;
+ struct device_node *node = slot->overlay;
+ struct property *prop;
+ struct bone_cape_slot *slotn;
+ int err, counta, countb, i, j;
+ const char *ra, *rb;
+
+ /* validate */
+ if (node == NULL) {
+ dev_err(dev, "slot #%d: No overlay for '%s'\n",
+ slot->slotno, slot->part_number);
+ return -EINVAL;
+ }
+
+ /* check if the slot is compatible with the board */
+ prop = of_find_property(node, "compatible", NULL);
+
+ /* no compatible property? */
+ if (prop == NULL) {
+ dev_err(dev, "slot #%d: No compatible property for '%s'\n",
+ slot->slotno, slot->part_number);
+ return -EINVAL;
+ }
+
+ /* verify that the cape is baseboard compatible */
+ if (of_multi_prop_cmp(prop, bbrd->compatible_name) != 0) {
+ dev_err(dev, "slot #%d: Incompatible with baseboard for '%s'\n",
+ slot->slotno, slot->part_number);
+ return -EINVAL;
+ }
+
+ /* count the strings */
+ counta = of_property_count_strings(node, "exclusive-use");
+ /* no valid property, or no resources; no matter, it's OK */
+ if (counta <= 0)
+ return 0;
+
+ /* and now check if there's a resource conflict */
+ err = 0;
+ mutex_lock(&info->slots_list_mutex);
+ for (i = 0; i < counta; i++) {
+
+ ra = NULL;
+ err = of_property_read_string_index(node, "exclusive-use",
+ i, &ra);
+ if (err != 0) {
+ dev_err(dev, "slot #%d: Could not read string #%d\n",
+ slot->slotno, i);
+ break;
+ }
+
+ list_for_each_entry(slotn, &info->slot_list, node) {
+
+ /* don't check against self */
+ if (slot == slotn)
+ continue;
+
+ /* only check against loaded or loading slots */
+ if (!slotn->loaded && !slotn->loading)
+ continue;
+
+ countb = of_property_count_strings(slotn->overlay,
+ "exclusive-use");
+ /* no valid property, or resources; it's OK */
+ if (countb <= 0)
+ continue;
+
+
+ for (j = 0; j < countb; j++) {
+
+ /* count the resources */
+ rb = NULL;
+ err = of_property_read_string_index(
+ slotn->overlay, "exclusive-use",
+ j, &rb);
+ if (err != 0) {
+ /* error, but we don't care */
+ err = 0;
+ break;
+ }
+
+ /* ignore case; just in case ;) */
+ if (strcasecmp(ra, rb) == 0) {
+
+ /* resource conflict */
+ err = -EEXIST;
+ dev_err(dev,
+ "slot #%d: %s conflict %s (#%d:%s)\n",
+ slot->slotno,
+ slot->part_number, ra,
+ slotn->slotno,
+ slotn->part_number);
+ goto out;
+ }
+ }
+ }
+ }
+out:
+ mutex_unlock(&info->slots_list_mutex);
+
+ return err;
+}
+
+static int capemgr_load_slot(struct bone_cape_slot *slot)
+{
+ struct capemgr_info *info = slot->info;
+ struct device *dev = &info->pdev->dev;
+ const char *dtbo;
+ int err;
+
+ if (slot->probe_failed) {
+ dev_err(dev, "slot #%d: probe failed for '%s'\n",
+ slot->slotno, slot->part_number);
+ return -ENODEV;
+ }
+
+ if (slot->loaded) {
+ dev_err(dev, "slot #%d: already loaded for '%s'\n",
+ slot->slotno, slot->part_number);
+ return -EAGAIN;
+ }
+
+ /* make sure we don't leak this on repeated calls */
+ kfree(slot->dtbo);
+ slot->dtbo = NULL;
+
+ dev_dbg(dev, "slot #%d: Requesting part number/version based '%s-%s.dtbo\n",
+ slot->slotno, slot->part_number, slot->version);
+
+ /* request the part number + .dtbo*/
+ slot->dtbo = kasprintf(GFP_KERNEL, "%s-%s.dtbo",
+ slot->part_number, slot->version);
+ if (slot->dtbo == NULL) {
+ dev_err(dev, "slot #%d: Failed to get dtbo '%s'\n",
+ slot->slotno, dtbo);
+ return -ENOMEM;
+ }
+
+ dev_dbg(dev, "slot #%d: Requesting firmware '%s' for board-name '%s', version '%s'%s\n",
+ slot->slotno,
+ slot->dtbo, slot->board_name, slot->version,
+ system_state == SYSTEM_BOOTING ? " - booting" : "");
+
+ err = request_firmware_direct(&slot->fw, slot->dtbo, dev);
+ if (err != 0) {
+ dev_dbg(dev, "failed to load firmware '%s'\n", slot->dtbo);
+ goto err_fail_no_fw;
+ }
+
+ dev_dbg(dev, "slot #%d: dtbo '%s' loaded; converting to live tree\n",
+ slot->slotno, slot->dtbo);
+
+ of_fdt_unflatten_tree((void *)slot->fw->data, &slot->overlay);
+ if (slot->overlay == NULL) {
+ dev_err(dev, "slot #%d: Failed to unflatten\n",
+ slot->slotno);
+ err = -EINVAL;
+ goto err_fail;
+ }
+
+ /* mark it as detached */
+ of_node_set_flag(slot->overlay, OF_DETACHED);
+
+ /* perform resolution */
+ err = of_resolve_phandles(slot->overlay);
+ if (err != 0) {
+ dev_err(dev, "slot #%d: Failed to resolve tree\n",
+ slot->slotno);
+ goto err_fail;
+ }
+
+ err = capemgr_verify_overlay(slot);
+ if (err != 0) {
+ dev_err(dev, "slot #%d: Failed verification\n",
+ slot->slotno);
+ goto err_fail;
+ }
+
+ err = of_overlay_create(slot->overlay);
+ if (err < 0) {
+ dev_err(dev, "slot #%d: Failed to create overlay\n",
+ slot->slotno);
+ goto err_fail;
+ }
+ slot->overlay_id = err;
+
+ slot->loading = 0;
+ slot->loaded = 1;
+
+ dev_info(dev, "slot #%d: dtbo '%s' loaded; overlay id #%d\n",
+ slot->slotno, slot->dtbo, slot->overlay_id);
+
+ return 0;
+
+err_fail:
+
+ /* TODO: free the overlay, we can't right now cause
+ * the unflatten method does not track it */
+ slot->overlay = NULL;
+
+ release_firmware(slot->fw);
+ slot->fw = NULL;
+
+err_fail_no_fw:
+ slot->loading = 0;
+ return err;
+}
+
+static int capemgr_unload_slot(struct bone_cape_slot *slot)
+{
+ if (!slot->loaded || slot->overlay_id == -1)
+ return -EINVAL;
+
+ of_overlay_destroy(slot->overlay_id);
+ slot->overlay_id = -1;
+
+ slot->loaded = 0;
+
+ return 0;
+
+}
+
+/* slots_list_mutex must be taken */
+static int capemgr_remove_slot_no_lock(struct bone_cape_slot *slot)
+{
+ struct capemgr_info *info = slot->info;
+ struct device *dev = &info->pdev->dev;
+ int ret;
+
+ if (slot == NULL)
+ return 0;
+
+ if (slot->loaded && slot->overlay_id >= 0) {
+ /* unload just in case */
+ ret = capemgr_unload_slot(slot);
+ if (ret != 0) {
+ dev_err(dev, "Unable to unload slot #%d\n",
+ slot->slotno);
+ return ret;
+ }
+ }
+
+ /* if probed OK, remove the sysfs nodes */
+ if (slot->probed && !slot->probe_failed)
+ bone_cape_slot_sysfs_unregister(slot);
+
+ /* remove it from the list */
+ list_del(&slot->node);
+
+ if (slot->eeprom_cell)
+ eeprom_cell_put(slot->eeprom_cell);
+ devm_kfree(dev, slot);
+ return 0;
+}
+
+static int capemgr_remove_slot(struct bone_cape_slot *slot)
+{
+ struct capemgr_info *info = slot->info;
+ int ret;
+
+ mutex_lock(&info->slots_list_mutex);
+ ret = capemgr_remove_slot_no_lock(slot);
+ mutex_unlock(&info->slots_list_mutex);
+
+ return ret;
+}
+
+static int bone_slot_fill_override(struct bone_cape_slot *slot,
+ struct device_node *node,
+ const char *part_number, const char *version)
+{
+ const struct ee_field *sig_field;
+ struct property *prop;
+ int i, len, has_part_number;
+ u32 val;
+ char *p;
+
+ slot->probe_failed = 0;
+ slot->probed = 0;
+
+ /* zero out signature */
+ memset(slot->signature, 0,
+ sizeof(slot->signature));
+
+ /* first, fill in all with override defaults */
+ for (i = 0; i < ARRAY_SIZE(cape_sig_fields); i++) {
+
+ sig_field = &cape_sig_fields[i];
+
+ /* point to the entry */
+ p = slot->signature + sig_field->start;
+
+ if (sig_field->override)
+ memcpy(p, sig_field->override,
+ sig_field->size);
+ else
+ memset(p, 0, sig_field->size);
+ }
+
+ /* and now, fill any override data from the node */
+ has_part_number = 0;
+ if (node != NULL) {
+ for (i = 0; i < ARRAY_SIZE(cape_sig_fields); i++) {
+
+ sig_field = &cape_sig_fields[i];
+
+ /* find property with the same name (if any) */
+ prop = of_find_property(node, sig_field->name, NULL);
+ if (prop == NULL)
+ continue;
+
+ /* point to the entry */
+ p = slot->signature + sig_field->start;
+
+ /* copy and zero out any remainder */
+ len = prop->length;
+ if (prop->length > sig_field->size)
+ len = sig_field->size;
+ memcpy(p, prop->value, len);
+ if (len < sig_field->size)
+ memset(p + len, 0, sig_field->size - len);
+
+ /* remember if we got a part number which is required */
+ if (i == CAPE_EE_FIELD_PART_NUMBER && len > 0)
+ has_part_number = 1;
+ }
+
+ if (of_property_read_u32(node, "priority", &val) != 0)
+ val = 0;
+ slot->priority = val;
+ }
+
+ /* if a part_number is supplied use it */
+ len = part_number ? strlen(part_number) : 0;
+ if (len > 0) {
+ sig_field = &cape_sig_fields[CAPE_EE_FIELD_PART_NUMBER];
+
+ /* point to the entry */
+ p = slot->signature + sig_field->start;
+
+ /* copy and zero out any remainder */
+ if (len > sig_field->size)
+ len = sig_field->size;
+ memcpy(p, part_number, len);
+ if (len < sig_field->size)
+ memset(p + len, 0, sig_field->size - len);
+
+ has_part_number = 1;
+ }
+
+ /* if a version is supplied use it */
+ len = version ? strlen(version) : 0;
+ if (len > 0) {
+ sig_field = &cape_sig_fields[CAPE_EE_FIELD_VERSION];
+
+ /* point to the entry */
+ p = slot->signature + sig_field->start;
+
+ /* copy and zero out any remainder */
+ if (len > sig_field->size)
+ len = sig_field->size;
+ memcpy(p, version, len);
+ if (len < sig_field->size)
+ memset(p + len, 0, sig_field->size - len);
+ }
+
+ /* we must have a part number */
+ if (!has_part_number)
+ return -EINVAL;
+
+ slot->override = 1;
+
+ return 0;
+}
+
+static struct bone_cape_slot *
+capemgr_add_slot(struct capemgr_info *info, struct device_node *node,
+ const char *part_number, const char *version, int prio)
+{
+ struct bone_cape_slot *slot;
+ struct device *dev = &info->pdev->dev;
+ int slotno;
+ int ret;
+
+ slotno = atomic_inc_return(&info->next_slot_nr) - 1;
+
+ slot = devm_kzalloc(dev, sizeof(*slot), GFP_KERNEL);
+ if (slot == NULL)
+ return ERR_PTR(-ENOMEM);
+
+ slot->info = info;
+ slot->slotno = slotno;
+ slot->priority = prio;
+ slot->overlay_id = -1;
+
+ if (node) {
+ slot->eeprom_cell = of_eeprom_cell_get(node, "eeprom");
+ if (IS_ERR(slot->eeprom_cell)) {
+ ret = PTR_ERR(slot->eeprom_cell);
+ if (ret != -EPROBE_DEFER)
+ dev_err(dev, "Failed to get slot eeprom cell\n");
+ slot->eeprom_cell = NULL;
+ goto err_out;
+ }
+ } else {
+ dev_info(dev, "slot #%d: override\n", slotno);
+
+ /* fill in everything with defaults first */
+ ret = bone_slot_fill_override(slot, node, part_number, version);
+ if (ret != 0) {
+ dev_err(dev, "slot #%d: override failed\n", slotno);
+ goto err_out;
+ }
+ }
+
+ ret = bone_slot_scan(slot);
+ if (ret != 0) {
+
+ if (!slot->probe_failed) {
+ dev_err(dev, "slot #%d: scan failed\n",
+ slotno);
+ goto err_out;
+ }
+
+ dev_err(dev, "slot #%d: No cape found\n", slotno);
+ /* but all is fine */
+ } else {
+
+ dev_info(dev, "slot #%d: '%s'\n",
+ slotno, slot->text_id);
+
+ ret = bone_cape_slot_sysfs_register(slot);
+ if (ret != 0) {
+ dev_err(dev, "slot #%d: sysfs register failed\n",
+ slotno);
+ goto err_out;
+ }
+
+ }
+
+ /* add to the slot list */
+ mutex_lock(&info->slots_list_mutex);
+ list_add_tail(&slot->node, &info->slot_list);
+ mutex_unlock(&info->slots_list_mutex);
+
+ return slot;
+
+err_out:
+ if (slot->eeprom_cell)
+ eeprom_cell_put(slot->eeprom_cell);
+ devm_kfree(dev, slot);
+ return ERR_PTR(ret);
+}
+
+/* return 1 if it makes sense to retry loading */
+static int retry_loading_condition(struct bone_cape_slot *slot)
+{
+ struct capemgr_info *info = slot->info;
+ struct device *dev = &info->pdev->dev;
+ struct bone_cape_slot *slotn;
+ int ret;
+
+ dev_dbg(dev, "loader: retry_loading slot-%d %s:%s (prio %d)\n",
+ slot->slotno, slot->part_number, slot->version,
+ slot->priority);
+
+ mutex_lock(&info->slots_list_mutex);
+ ret = 0;
+ list_for_each_entry(slotn, &info->slot_list, node) {
+ /* if same slot or not loading skip */
+ if (!slotn->loading || slotn->retry_loading)
+ continue;
+ /* at least one cape is still loading (without retrying) */
+ ret = 1;
+ }
+ mutex_unlock(&info->slots_list_mutex);
+ return ret;
+}
+
+/* return 1 if this slot is clear to try to load now */
+static int clear_to_load_condition(struct bone_cape_slot *slot)
+{
+ struct capemgr_info *info = slot->info;
+ int my_prio = slot->priority;
+ struct device *dev = &info->pdev->dev;
+ int ret;
+
+ dev_dbg(dev, "loader: check slot-%d %s:%s (prio %d)\n", slot->slotno,
+ slot->part_number, slot->version, slot->priority);
+
+ mutex_lock(&info->slots_list_mutex);
+ ret = 1;
+ list_for_each_entry(slot, &info->slot_list, node) {
+ /* if any slot is loading with lowest priority */
+ if (!slot->loading)
+ continue;
+ if (slot->priority < my_prio) {
+ ret = 0;
+ break;
+ }
+ }
+ mutex_unlock(&info->slots_list_mutex);
+ return ret;
+}
+
+static int capemgr_loader(void *data)
+{
+ struct bone_cape_slot *slot = data;
+ struct capemgr_info *info = slot->info;
+ struct device *dev = &info->pdev->dev;
+ int ret, done, other_loading, booting;
+
+ done = 0;
+
+ slot->retry_loading = 0;
+
+ dev_dbg(dev, "loader: before slot-%d %s:%s (prio %d)\n", slot->slotno,
+ slot->part_number, slot->version, slot->priority);
+
+ /*
+ * We have a basic priority based arbitration system
+ * Slots have priorities, so the lower priority ones
+ * should start loading first. So each time we end up
+ * here.
+ */
+ ret = wait_event_interruptible(info->load_wq,
+ clear_to_load_condition(slot));
+ if (ret < 0) {
+ dev_warn(dev, "loader, Signal pending\n");
+ return ret;
+ }
+
+ dev_dbg(dev, "loader: after slot-%d %s:%s (prio %d)\n", slot->slotno,
+ slot->part_number, slot->version, slot->priority);
+
+ /* using the return value */
+ ret = capemgr_load_slot(slot);
+
+ /* wake up all just in case */
+ wake_up_interruptible_all(&info->load_wq);
+
+ if (ret == 0)
+ goto done;
+
+ dev_dbg(dev, "loader: retrying slot-%d %s:%s (prio %d)\n", slot->slotno,
+ slot->part_number, slot->version, slot->priority);
+
+ /* first attempt has failed; now try each time there's any change */
+ slot->retry_loading = 1;
+
+ for (;;) {
+ booting = (system_state == SYSTEM_BOOTING);
+ other_loading = retry_loading_condition(slot);
+ if (!booting && !other_loading)
+ break;
+
+ /* simple wait for someone to kick us */
+ if (other_loading) {
+ DEFINE_WAIT(__wait);
+
+ prepare_to_wait(&info->load_wq, &__wait,
+ TASK_INTERRUPTIBLE);
+ finish_wait(&info->load_wq, &__wait);
+ } else {
+ /* always delay when booting */
+ msleep(boot_scan_period);
+ }
+
+ if (signal_pending(current)) {
+ dev_warn(dev, "loader, Signal pending\n");
+ ret = -ERESTARTSYS;
+ goto done;
+ }
+
+ /* using the return value */
+ ret = capemgr_load_slot(slot);
+ if (ret == 0)
+ goto done;
+
+ /* wake up all just in case */
+ wake_up_interruptible_all(&info->load_wq);
+ }
+
+done:
+ slot->loading = 0;
+ slot->retry_loading = 0;
+
+ if (ret == 0) {
+ dev_dbg(dev, "loader: done slot-%d %s:%s (prio %d)\n",
+ slot->slotno, slot->part_number, slot->version,
+ slot->priority);
+ } else {
+ dev_err(dev, "loader: failed to load slot-%d %s:%s (prio %d)\n",
+ slot->slotno, slot->part_number, slot->version,
+ slot->priority);
+
+ /* if it's a override slot remove it */
+ if (slot->override)
+ capemgr_remove_slot(slot);
+ }
+
+ return ret;
+}
+
+static int
+capemgr_probe(struct platform_device *pdev)
+{
+ struct capemgr_info *info;
+ struct bone_baseboard *bbrd;
+ struct bone_cape_slot *slot;
+ struct device_node *pnode = pdev->dev.of_node;
+ struct device_node *baseboardmaps_node;
+ struct device_node *slots_node, *node;
+ const char *part_number;
+ const char *version;
+ const char *board_name;
+ const char *compatible_name;
+ int ret, len, prio;
+ long val;
+ char *wbuf, *s, *p, *e;
+
+ /* we don't use platform_data at all; we require OF */
+ if (pnode == NULL)
+ return -ENOTSUPP;
+
+ info = devm_kzalloc(&pdev->dev,
+ sizeof(struct capemgr_info), GFP_KERNEL);
+ if (!info)
+ return -ENOMEM;
+
+ info->pdev = pdev;
+ platform_set_drvdata(pdev, info);
+
+ atomic_set(&info->next_slot_nr, 0);
+ INIT_LIST_HEAD(&info->slot_list);
+ mutex_init(&info->slots_list_mutex);
+
+ init_waitqueue_head(&info->load_wq);
+
+ baseboardmaps_node = NULL;
+
+ /* find the baseboard */
+ bbrd = &info->baseboard;
+
+ baseboardmaps_node = of_get_child_by_name(pnode, "baseboardmaps");
+ if (baseboardmaps_node == NULL) {
+ dev_err(&pdev->dev, "Failed to get baseboardmaps node");
+ ret = -ENODEV;
+ goto err_exit;
+ }
+
+ bbrd->eeprom_cell = of_eeprom_cell_get(pnode, "eeprom");
+ if (IS_ERR(bbrd->eeprom_cell)) {
+ ret = PTR_ERR(bbrd->eeprom_cell);
+ if (ret != -EPROBE_DEFER)
+ dev_err(&pdev->dev, "Failed to get baseboard eeprom cell\n");
+ bbrd->eeprom_cell = NULL;
+ goto err_exit;
+ }
+
+ ret = bone_baseboard_scan(bbrd);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "Failed to scan baseboard eeprom\n");
+ goto err_exit;
+ }
+
+ dev_info(&pdev->dev, "Baseboard: '%s'\n", bbrd->text_id);
+
+ board_name = NULL;
+ compatible_name = NULL;
+ for_each_child_of_node(baseboardmaps_node, node) {
+ /* there must be board-name */
+ if (of_property_read_string(node, "board-name",
+ &board_name) != 0 ||
+ of_property_read_string(node, "compatible-name",
+ &compatible_name) != 0)
+ continue;
+
+ if (strcmp(bbrd->board_name, board_name) == 0)
+ break;
+ }
+ of_node_put(baseboardmaps_node);
+ baseboardmaps_node = NULL;
+
+ if (node == NULL) {
+ dev_err(&pdev->dev, "Failed to find compatible map for %s\n",
+ bbrd->board_name);
+ ret = -ENODEV;
+ goto err_exit;
+ }
+ bbrd->compatible_name = kstrdup(compatible_name, GFP_KERNEL);
+ if (bbrd->compatible_name == NULL) {
+ ret = -ENOMEM;
+ goto err_exit;
+ }
+ of_node_put(node);
+
+ dev_info(&pdev->dev, "compatible-baseboard=%s\n",
+ bbrd->compatible_name);
+
+ /* iterate over any slots */
+ slots_node = of_get_child_by_name(pnode, "slots");
+ if (slots_node != NULL) {
+ for_each_child_of_node(slots_node, node) {
+
+ slot = capemgr_add_slot(info, node, NULL, NULL, 0);
+ if (IS_ERR(slot)) {
+ dev_err(&pdev->dev, "Failed to add slot #%d\n",
+ atomic_read(&info->next_slot_nr));
+ ret = PTR_ERR(slot);
+ goto err_exit;
+ }
+ /* note that slot may be NULL (means it was disabled) */
+ }
+ of_node_put(slots_node);
+ }
+ slots_node = NULL;
+
+ /* iterate over enable_partno (if there) */
+ if (enable_partno && strlen(enable_partno) > 0) {
+
+ /* allocate a temporary buffer */
+ wbuf = devm_kzalloc(&pdev->dev, PAGE_SIZE, GFP_KERNEL);
+ if (wbuf == NULL) {
+ ret = -ENOMEM;
+ goto err_exit;
+ }
+
+ /* add any enable_partno capes */
+ s = enable_partno;
+ while (*s) {
+ /* form is PART[:REV[:PRIO]],PART.. */
+ p = strchr(s, ',');
+ if (p == NULL)
+ e = s + strlen(s);
+ else
+ e = p;
+
+ /* copy to temp buffer */
+ len = e - s;
+ if (len >= PAGE_SIZE - 1)
+ len = PAGE_SIZE - 1;
+ memcpy(wbuf, s, len);
+ wbuf[len] = '\0';
+
+ /* move to the next */
+ s = *e ? e + 1 : e;
+
+ part_number = wbuf;
+
+ /* default version is NULL & prio is 0 */
+ version = NULL;
+ prio = 0;
+
+ /* now split the rev & prio part */
+ p = strchr(wbuf, ':');
+ if (p != NULL) {
+ *p++ = '\0';
+ if (*p != ':')
+ version = p;
+ p = strchr(p, ':');
+ if (p != NULL) {
+ *p++ = '\0';
+ ret = kstrtol(p, 10, &val);
+ if (ret == 0)
+ prio = val;
+ }
+ }
+
+ dev_info(&pdev->dev,
+ "enabled_partno PARTNO '%s' VER '%s' PR '%d'\n",
+ part_number,
+ version ? version : "N/A", prio);
+
+ /* only immediate slots are allowed here */
+ slot = capemgr_add_slot(info, NULL,
+ part_number, version, prio);
+
+ /* we continue even in case of an error */
+ if (IS_ERR_OR_NULL(slot)) {
+ dev_warn(&pdev->dev, "Failed to add slot #%d\n",
+ atomic_read(&info->next_slot_nr) - 1);
+ }
+ }
+
+ devm_kfree(&pdev->dev, wbuf);
+ }
+
+ pm_runtime_enable(&pdev->dev);
+ ret = pm_runtime_get_sync(&pdev->dev);
+ if (IS_ERR_VALUE(ret)) {
+ dev_err(&pdev->dev, "Failed to pm_runtime_get_sync()\n");
+ goto err_exit;
+ }
+
+ pm_runtime_put(&pdev->dev);
+
+ /* it is safe to create the attribute groups */
+ ret = sysfs_create_groups(&pdev->dev.kobj, attr_groups);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "Failed to create sysfs attributes\n");
+ goto err_exit;
+ }
+ /* automatically cleared by driver core now */
+ pdev->dev.groups = attr_groups;
+
+ /* now load each (take lock to be sure */
+ mutex_lock(&info->slots_list_mutex);
+
+ list_for_each_entry(slot, &info->slot_list, node) {
+
+ /* if matches the disabled ones skip */
+ if (bone_match_cape(disable_partno, slot->part_number,
+ slot->version)) {
+ dev_info(&pdev->dev,
+ "Skipping loading of disabled cape with part# %s\n",
+ slot->part_number);
+ slot->disabled = 1;
+ continue;
+ }
+
+ if (!slot->probe_failed && !slot->loaded)
+ slot->loading = 1;
+ }
+
+ /* now start the loader thread(s) (all at once) */
+ list_for_each_entry(slot, &info->slot_list, node) {
+
+ if (!slot->loading)
+ continue;
+
+ slot->loader_thread = kthread_run(capemgr_loader,
+ slot, "capemgr-loader-%d",
+ slot->slotno);
+ if (IS_ERR(slot->loader_thread)) {
+ dev_warn(&pdev->dev, "slot #%d: Failed to start loader\n",
+ slot->slotno);
+ slot->loader_thread = NULL;
+ }
+ }
+ mutex_unlock(&info->slots_list_mutex);
+
+ dev_info(&pdev->dev, "initialized OK.\n");
+
+ return 0;
+
+err_exit:
+ if (bbrd->eeprom_cell)
+ eeprom_cell_put(bbrd->eeprom_cell);
+ of_node_put(baseboardmaps_node);
+ platform_set_drvdata(pdev, NULL);
+ devm_kfree(&pdev->dev, info);
+
+ return ret;
+}
+
+static int capemgr_remove(struct platform_device *pdev)
+{
+ struct capemgr_info *info = platform_get_drvdata(pdev);
+ struct bone_baseboard *bbrd = &info->baseboard;
+ struct bone_cape_slot *slot, *slotn;
+ int ret;
+
+ mutex_lock(&info->slots_list_mutex);
+ list_for_each_entry_safe(slot, slotn, &info->slot_list, node)
+ capemgr_remove_slot_no_lock(slot);
+ mutex_unlock(&info->slots_list_mutex);
+
+ platform_set_drvdata(pdev, NULL);
+
+ ret = pm_runtime_get_sync(&pdev->dev);
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ pm_runtime_put(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+
+ if (bbrd->eeprom_cell)
+ eeprom_cell_put(bbrd->eeprom_cell);
+ devm_kfree(&pdev->dev, info);
+
+ return 0;
+}
+
+static struct platform_driver capemgr_driver = {
+ .probe = capemgr_probe,
+ .remove = capemgr_remove,
+ .driver = {
+ .name = "bone_capemgr",
+ .owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(capemgr_of_match),
+ },
+};
+
+module_platform_driver(capemgr_driver);
+
+MODULE_AUTHOR("Pantelis Antoniou");
+MODULE_DESCRIPTION("Beaglebone cape manager");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:bone_capemgr");
--
1.7.12
^ permalink raw reply related
* [PATCH 2/5] doc: misc: Beaglebone capemanager documentation
From: Pantelis Antoniou @ 2015-05-13 7:59 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Matt Porter, Koen Kooi, Robert Nelson, Rob Herring, Grant Likely,
Jonathan Corbet, Srinivas Kandagatla, Guenter Roeck,
Geert Uytterhoeven, Benoît Cousso, linux-api, linux-doc,
devicetree, linux-kernel, Pantelis Antoniou, Pantelis Antoniou
In-Reply-To: <1431503985-31853-1-git-send-email-pantelis.antoniou@konsulko.com>
Add beaglebone capemanager documentation entry.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
---
Documentation/misc-devices/bone_capemgr.txt | 63 +++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
create mode 100644 Documentation/misc-devices/bone_capemgr.txt
diff --git a/Documentation/misc-devices/bone_capemgr.txt b/Documentation/misc-devices/bone_capemgr.txt
new file mode 100644
index 0000000..2a8c766
--- /dev/null
+++ b/Documentation/misc-devices/bone_capemgr.txt
@@ -0,0 +1,63 @@
+---------------------------
+ Beaglebone Cape-Manager
+---------------------------
+
+The beaglebone cape manager driver allows the automatic use of external
+peripheral capes to be automatically supported by Linux without any manual
+setup required by the user.
+
+Each beaglebone cape should contain an EEPROM that describes
+it in a fixed I2C address on the i2c2 bus of the baseboard.
+The format of the EEPROM is defined in the beaglebone reference
+manual at:
+http://beagleboard.org/static/beaglebone/latest/Docs/Hardware/BONE_SRM.pdf
+
+Reading the part number and revision information the manager
+requests a firmware file formatted as a device tree overlay blob.
+
+Applying the overlay the devices are instantiated and the cape is
+ready to be used.
+
+For instance if the part-number is BB-BONE-SERL-03 and the version is 00A1
+the firmware file requested will be BB-BONE-SERL-03-00A1-00A1.dtbo
+It will be located by the in-kernel firmware
+loader in the usual place, i.e. /lib/firmware/`uname -r`, /lib/firmware etc.
+
+The driver supports the following parameters (either as part of the kernel
+command line or supplied at module insertion time).
+
+disable_partno: A comma delimited list of PART-NUMBER[:REV] of
+ disabled capes.
+enable_partno: A comma delimited list of PART-NUMBER[:REV[:PRIO]] of
+ enabled capes.
+boot_scan_period: The boot scan period in ms. When the cape manager is built-in
+ the kernel image, the firmware loader cannot find the files
+ before the rootfs is mounted. This parameter controls the
+ period with which the boot state is checked in that case.
+
+There's a sysfs control interface which is defined at the ABI documentation
+area.
+
+Theory of operation:
+--------------------
+
+On driver probe the I2C EEPROM of the baseboard is read and information about
+the current baseboard is retrieved. This information includes the mapping from
+baseboard board name to DT friendly compatible string. I.e. the "A335BONE" board
+name from EEPROM is mapped to the "ti,beaglebone" compatible string which should
+be present in the dtbo to be loaded.
+
+Afterwards the EEPROMs declared in each slot are probed, and the EEPROMs found
+are decoded keeping track the cape part-number and version data.
+
+Using the part-number and version a firmware file is requested (the firmware
+file requested is <part-number>-<version>.dtbo).
+
+The dtbo is unflattend and the resulting device tree is matched against a
+compatible baseboard, and in case of multiple parallel loading capes the
+priorities defined are honored. That means that when there are multiple capes
+being loaded in parallel the ones with the lowest priority number are loaded
+first.
+
+Applying the device tree overlay makes the cape operational, as if it was part
+of the kernel's booting device tree.
--
1.7.12
^ permalink raw reply related
* [PATCH 3/5] doc: dt: beaglebone cape manager bindings.
From: Pantelis Antoniou @ 2015-05-13 7:59 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Matt Porter, Koen Kooi, Robert Nelson, Rob Herring, Grant Likely,
Jonathan Corbet, Srinivas Kandagatla, Guenter Roeck,
Geert Uytterhoeven, Benoît Cousso, linux-api, linux-doc,
devicetree, linux-kernel, Pantelis Antoniou, Pantelis Antoniou
In-Reply-To: <1431503985-31853-1-git-send-email-pantelis.antoniou@konsulko.com>
Bindings document for the beaglebone cape manager.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
---
.../devicetree/bindings/misc/bone_capemgr.txt | 123 +++++++++++++++++++++
1 file changed, 123 insertions(+)
create mode 100644 Documentation/devicetree/bindings/misc/bone_capemgr.txt
diff --git a/Documentation/devicetree/bindings/misc/bone_capemgr.txt b/Documentation/devicetree/bindings/misc/bone_capemgr.txt
new file mode 100644
index 0000000..006f50c
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/bone_capemgr.txt
@@ -0,0 +1,123 @@
+* Beaglebone cape manager driver
+
+Required properties:
+- compatible: "ti,bone-capemgr"
+- eeprom: phandle to the EEPROM baseboard.
+ The EEPROM framework interface is use to obtain the data.
+
+Required children nodes:
+
+- baseboardmaps: Contains nodes, which each of the them defines a mapping from
+ the baseboard EEPROM board-name ID to a DT friendly compatible
+ string.
+
+ - board-name: The baseboard EEPROM board name, i.e. A335BONE for the original
+ beaglebone white.
+ - compatible-name: The DT friendly compatible string to be used for matching
+ compatible capes, i.e. "ti,beaglebone"
+
+
+ - slots: Defines the slots (I2C addresses) that capes are available.
+ - eeprom: phandle to the EEPROM cape.
+ The EEPROM framework interface is used to obtain the data.
+
+- Example of a beaglebone cape-manager:
+
+bone_capemgr {
+ compatible = "ti,bone-capemgr";
+ status = "okay";
+
+ eeprom = <&baseboard_eeprom>;
+
+ /* map board revisions to compatible definitions */
+ baseboardmaps {
+ baseboard_beaglebone: board@0 {
+ board-name = "A335BONE";
+ compatible-name = "ti,beaglebone";
+ };
+
+ baseboard_beaglebone_black: board@1 {
+ board-name = "A335BNLT";
+ compatible-name = "ti,beaglebone-black";
+ };
+ };
+
+ /* only 4 slots defined */
+ slots {
+ slot@0 {
+ eeprom = <&cape_eeprom0>;
+ };
+
+ slot@1 {
+ eeprom = <&cape_eeprom1>;
+ };
+
+ slot@2 {
+ eeprom = <&cape_eeprom2>;
+ };
+
+ slot@3 {
+ eeprom = <&cape_eeprom3>;
+ };
+ };
+};
+
+The format of the cape to be loaded is in a standard overlay format with
+the following root properties that are interpreted by the cape manager:
+
+Required properties:
+ - compatible: Should be compatible to the baseboard according to the
+ baseboard map value, i.e. "ti,beaglebone".
+ - part-numer: Should contain the part-number as stored in the EEPROM.
+ - version: Should contain a list of all the version that are supported
+ by the single cape dtbo, i.e. "00A1".
+
+Optional properties:
+ - exclusive-use: A string list which state the resources this cape requires.
+ No processing or matching to anything regarding the internal
+ kernel state is performed; it's purpose is to guard against
+ conflicts with other capes.
+ - priority: A priority to be assigned when loading a cape. A lower value
+ has higher priority. The purpose of the priority is to control
+ which cape is loaded first in case of a conflict.
+
+- Example of a serial cape:
+
+/dts-v1/;
+/plugin/;
+/ {
+ compatible = "ti,beaglebone", "ti,beaglebone-black";
+
+ /* identification */
+ part-number = "BB-BONE-SERL-03";
+ version = "00A1";
+
+ /* state the resources this cape uses */
+ exclusive-use =
+ /* the pin header uses */
+ "P9.21", /* uart2_txd */
+ "P9.22", /* uart2_rxd */
+ /* the hardware ip uses */
+ "uart2";
+
+ fragment@0 {
+ target = <&am33xx_pinmux>;
+ __overlay__ {
+ bb_uart2_pins: pinmux_bb_uart2_pins {
+ pinctrl-single,pins = <
+ 0x150 0x21 /* spi0_sclk.uart2_rxd | MODE1 */
+ 0x154 0x01 /* spi0_d0.uart2_txd | MODE1 */
+ >;
+ };
+ };
+ };
+
+ fragment@1 {
+ target = <&uart2>;
+ __overlay__ {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&bb_uart2_pins>;
+ };
+ };
+};
--
1.7.12
^ permalink raw reply related
* [PATCH 4/5] doc: ABI: bone_capemgr sysfs API
From: Pantelis Antoniou @ 2015-05-13 7:59 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Matt Porter, Koen Kooi, Robert Nelson, Rob Herring, Grant Likely,
Jonathan Corbet, Srinivas Kandagatla, Guenter Roeck,
Geert Uytterhoeven, Benoît Cousso, linux-api, linux-doc,
devicetree, linux-kernel, Pantelis Antoniou, Pantelis Antoniou
In-Reply-To: <1431503985-31853-1-git-send-email-pantelis.antoniou@konsulko.com>
Document the beaglebone's capemgr sysfs API
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
---
.../testing/sysfs-devices-platform-bone_capemgr | 63 ++++++++++++++++++++++
1 file changed, 63 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
diff --git a/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr b/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
new file mode 100644
index 0000000..e2df613
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
@@ -0,0 +1,63 @@
+What: /sys/devices/platform/bone_capemgr/slots
+Date: May 2015
+KernelVersion: 4.0
+Contact: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
+Description:
+ READ:
+ Describe the state of all the slots of the beaglebone capemgr.
+ Each line of the output describes a slot:
+ The slot format is as following:
+ <slot-id>: [P-][F-][O-][l-][L-][D-] \
+ <overlay-id> <board-name>,<version>,
+ <manufacturer>,<part-number>
+
+ Where the flags are:
+ P: Slot has been probed
+ F: Slot has failed probing (i.e. no EEPROM detected)
+ O: Slot has been overridden by the user
+ l: Slot is current loading
+ L: Slot has completed loading and is ready
+ D: Slot has been disabled
+
+ Example:
+ 0: P---L- -1 BeagleBone RS232 CAPE,00A1,Beagleboardtoys,BB-BONE-SERL-03
+ 1: PF---- -1
+ 2: PF---- -1
+ 3: PF---- -1
+
+ WRITE:
+ Writing a string of the form <part-number>[:version] issues a request to
+ load a firmware blob containing an overlay. The name of the firmware blob
+ is <part-number>-[version|00A0].dtbo. This act is defined as a slot override.
+
+ Writing a negative slot id removes the slot if it was an overridden one, or
+ unloads a slot that was probed.
+
+What: /sys/devices/platform/bone_capemgr/baseboard/<eeprom-field>
+Date: May 2015
+KernelVersion: 4.0
+Contact: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
+Description: Contains the probed base board EEPROM field; one of:
+ board-name - board-name as stored in cape EEPROM
+ dc-supplied - whether the cape draws or supplies DC
+ eeprom-format-revision - EEPROM format rev, only 00A0 supported
+ header - header; should be 'aa 55 33 ee'
+ manufacturer - manufacturer string
+ part-number - part-number of the cape
+ serial-number - serial number of the cape
+ version - version of the cape, i.e. 00A0
+ number-of-pins - displayed but ignored
+ pin-usage - displayed but ignored
+ sys-5v - displayed but ignored
+ vdd-3v3exp - displayed but ignored
+ vdd-5v - displayed but ignored
+What: /sys/devices/platform/bone_capemgr/slot-<n>/<eeprom-field>
+Date: May 2015
+KernelVersion: 4.0
+Contact: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
+Description: Contains the probed cape's EEPROM field; the field is one of:
+ board-name - baseboard name i.e. A335BNLT
+ header - header; should be 'aa 55 33 ee'
+ revision - baseboard revision
+ serial-number - baseboard serial number
+ config-option - displayed but ignored
--
1.7.12
^ permalink raw reply related
* [PATCH 5/5] MAINTAINERS: Beaglebone capemanager maintainer
From: Pantelis Antoniou @ 2015-05-13 7:59 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Matt Porter, Koen Kooi, Robert Nelson, Rob Herring, Grant Likely,
Jonathan Corbet, Srinivas Kandagatla, Guenter Roeck,
Geert Uytterhoeven, Benoît Cousso,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou,
Pantelis Antoniou
In-Reply-To: <1431503985-31853-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
Add me as the capemanager maintainer.
Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
---
MAINTAINERS | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index c97e090..87611c0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1964,6 +1964,14 @@ W: http://bcache.evilpiepirate.org
S: Maintained:
F: drivers/md/bcache/
+BEAGLEBONE CAPEMANAGER
+M: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
+S: Maintained
+F: drivers/misc/beaglebone-capemgr.c
+F: Documentation/misc-devices/bone_capemgr.txt
+F: Documentation/devicetree/bindings/misc/bone_capemgr.txt
+F: Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
+
BEFS FILE SYSTEM
S: Orphan
F: Documentation/filesystems/befs.txt
--
1.7.12
^ permalink raw reply related
* [RFC PATCH] Documentation/arch: Add Documentation/arch-TODO
From: Ingo Molnar @ 2015-05-13 8:34 UTC (permalink / raw)
To: Jonathan Corbet
Cc: Peter Zijlstra, Josh Triplett, Andy Lutomirski, Ingo Molnar,
H. Peter Anvin, Thomas Gleixner, Linus Torvalds,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, x86-DgEjT+Ai2ygdnm+yROfE0A,
linux-arch-u79uwXL29TY76Z2rM5mHXA, Andrew Morton, Borislav Petkov
In-Reply-To: <20150512144910.0b49c9a7a13336773449db33-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
* Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> wrote:
> On Tue, 12 May 2015 23:38:43 +0200 Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> wrote:
>
> > > with the expectation that other architectures will follow along,
> > > but this doesn't happen. The arch maintainers simply didn't
> > > know about it or nobody nags them. Nothing happens and
> > > inconsistencies hang around for years. eg,
> > > http://lkml.iu.edu/hypermail/linux/kernel/1504.2/04993.html
> > >
> > > I'm thinking we should find a way to do this better. One way
> > > might be to maintain a Documentation/arch-todo which identifies
> > > each item, has a little list of what-to-do instructions and
> > > perhaps a list of the not-yet-done architectures. Basically a
> > > way for everyone to communicate at the arch maintainers.
> >
> > If only there was a linux-arch list to which arch maintainers
> > should subscribe... oh wait :-)
>
> It was I who got linux-arch established, so I'm fairly familiar with
> it. (12 years ago, gad).
>
> I don't think it's been very successful, particularly for this
> purpose. A whole pile of randomly cc'ed lkml overflow which we're
> relying on each individual maintainer to sift through and pluck out
> particular action items then later remember to implement them. It's
> disorganized and has too many cracks for things to fall through.
Yes, a mailing list is indeed not a very good TODO list.
We need a persistent post-it, and Documentation/arch-TODO (note the
capital letters, we might as well shout?) sounds like a good place.
I'd suggest making it tabular, as per the patch below.
If it gets too large we can split it into multiple tables.
I'd like people to have a good look whether I messed up any entry, and
I'd be happy to add new items as well.
Thanks,
Ingo
=======================>
>From 33a487046b16971564d323079f66fb63aa870f4d Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Date: Wed, 13 May 2015 10:30:11 +0200
Subject: [PATCH] Documentation/arch: Add Documentation/arch-TODO
Add a TODO list for missing/incomplete architecture support
for generic kernel features.
Signed-off-by: Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
Documentation/arch-TODO | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/Documentation/arch-TODO b/Documentation/arch-TODO
new file mode 100644
index 000000000000..bfa289639b1c
--- /dev/null
+++ b/Documentation/arch-TODO
@@ -0,0 +1,47 @@
+
+For generic kernel features that need architecture support, this is
+the feature support matrix, for all upstream Linux architectures:
+
+ ELF-ASLR:----------------------------------------------------------.
+ clockevents:---------------------------------------------------. |
+modern-timekeeping:--------------------------------------------. | |
+ kgdb:-------------------------------------. | | |
+ context-tracking:------------------------------. | | | |
+ seccomp-filter:-----------------------. | | | | |
+ jump-labels:----------------. | | | | | |
+ stackprotector:---------. | | | | | | |
+ lockdep:--. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ arc | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ arm | ok | ok | ok | ok | ok | ok | TODO | ok | ok |
+ arm64 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ avr32 | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ blackfin | ok | TODO | TODO | TODO | TODO | ok | TODO | ok | TODO |
+ c6x | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ hexagon | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ ia64 | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO |
+ metag | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ microblaze | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ mips | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ nios2 | TODO | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ openrisc | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ parisc | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ powerpc | ok | TODO | ok | TODO | TODO | ok | ok | ok | ok |
+ s390 | ok | TODO | ok | ok | TODO | TODO | ok | ok | ok |
+ score | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ sh | ok | ok | TODO | TODO | TODO | ok | ok | ok | TODO |
+ sparc | ok | TODO | ok | TODO | ok | ok | ok | ok | TODO |
+ tile | ok | TODO | TODO | TODO | ok | ok | ok | ok | TODO |
+ um | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ unicore32 | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ x86 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+----------------------------------------------------------------------------------
+
^ permalink raw reply related
* [RFC PATCH v2] Documentation/arch: Add Documentation/arch-TODO
From: Ingo Molnar @ 2015-05-13 8:56 UTC (permalink / raw)
To: Andrew Morton, Jonathan Corbet
Cc: Peter Zijlstra, Josh Triplett, Andy Lutomirski, Ingo Molnar,
H. Peter Anvin, Thomas Gleixner, Linus Torvalds, linux-api,
linux-kernel, x86, linux-arch, Borislav Petkov
In-Reply-To: <20150513083441.GA17336@gmail.com>
Added a second table with more features listed.
Thanks,
Ingo
=======================>
>From 32acc8a058a166d177346cfe59b6bc930f9e6471 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@kernel.org>
Date: Wed, 13 May 2015 10:30:11 +0200
Subject: [PATCH] Documentation/arch: Add Documentation/arch-TODO
Add a TODO list for missing/incomplete architecture support
for generic kernel features.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
Documentation/arch-TODO | 89 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 89 insertions(+)
diff --git a/Documentation/arch-TODO b/Documentation/arch-TODO
new file mode 100644
index 000000000000..adf05e4c353f
--- /dev/null
+++ b/Documentation/arch-TODO
@@ -0,0 +1,89 @@
+
+For generic kernel features that need architecture support, this is
+the feature support matrix, for all upstream Linux architectures:
+
+ ELF-ASLR:---------------------------------------------------------.
+ clockevents:--------------------------------------------------. |
+ modern-timekeeping:-------------------------------------------. | |
+ kgdb:------------------------------------. | | |
+ context-tracking:-----------------------------. | | | |
+ seccomp-filter:----------------------. | | | | |
+ jump-labels:---------------. | | | | | |
+ stackprotector:--------. | | | | | | |
+ lockdep:-. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ arc | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ arm | ok | ok | ok | ok | ok | ok | TODO | ok | ok |
+ arm64 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ avr32 | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ blackfin | ok | TODO | TODO | TODO | TODO | ok | TODO | ok | TODO |
+ c6x | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ hexagon | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ ia64 | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO |
+ metag | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ microblaze | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ mips | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ nios2 | TODO | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ openrisc | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ parisc | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ powerpc | ok | TODO | ok | TODO | TODO | ok | ok | ok | ok |
+ s390 | ok | TODO | ok | ok | TODO | TODO | ok | ok | ok |
+ score | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ sh | ok | ok | TODO | TODO | TODO | ok | ok | ok | TODO |
+ sparc | ok | TODO | ok | TODO | ok | ok | ok | ok | TODO |
+ tile | ok | TODO | TODO | TODO | ok | ok | ok | ok | TODO |
+ um | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ unicore32 | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ x86 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+----------------------------------------------------------------------------------
+
+ tracehook:---------------------------------------------------------.
+ ioremap_prot():--------------------------------------------------. |
+ user-ret-profiler:-------------------------------------------. | |
+ kretprobes:------------------------------------. | | |
+ uprobes:-----------------------------. | | | |
+ kprobes-on-ftrace:----------------------. | | | | |
+ optprobes:---------------. | | | | | |
+ kprobes:--------. | | | | | | |
+arch-tick-broadcast:-. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ arc | TODO | ok | TODO | TODO | TODO | ok | TODO | ok | ok |
+ arm | ok | ok | ok | TODO | ok | ok | TODO | TODO | ok |
+ arm64 | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ avr32 | TODO | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ blackfin | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ c6x | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ hexagon | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ ia64 | TODO | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ metag | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ microblaze | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ mips | ok | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ nios2 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ openrisc | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ parisc | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ powerpc | ok | ok | TODO | TODO | ok | ok | TODO | ok | ok |
+ s390 | TODO | ok | TODO | TODO | ok | ok | TODO | TODO | ok |
+ score | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ sh | TODO | ok | TODO | TODO | TODO | ok | TODO | ok | ok |
+ sparc | TODO | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ tile | TODO | ok | ok | TODO | TODO | ok | ok | ok | ok |
+ um | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ unicore32 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ x86 | TODO | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+----------------------------------------------------------------------------------
^ permalink raw reply related
* [RFC PATCH v3] Documentation/arch: Add Documentation/arch-TODO
From: Ingo Molnar @ 2015-05-13 9:24 UTC (permalink / raw)
To: Andrew Morton, Jonathan Corbet
Cc: Peter Zijlstra, Josh Triplett, Andy Lutomirski, Ingo Molnar,
H. Peter Anvin, Thomas Gleixner, Linus Torvalds,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, x86-DgEjT+Ai2ygdnm+yROfE0A,
linux-arch-u79uwXL29TY76Z2rM5mHXA, Borislav Petkov
In-Reply-To: <20150513085636.GA11030-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
The feature support matrix now includes a third table as well.
Thanks,
Ingo
======================>
>From c6170954222f839b039f202bea46a85491b0c067 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Date: Wed, 13 May 2015 10:30:11 +0200
Subject: [PATCH] Documentation/arch: Add Documentation/arch-TODO
Add a TODO list for missing/incomplete architecture support
for generic kernel features.
Signed-off-by: Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
Documentation/arch-TODO | 134 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 134 insertions(+)
diff --git a/Documentation/arch-TODO b/Documentation/arch-TODO
new file mode 100644
index 000000000000..a577b185c293
--- /dev/null
+++ b/Documentation/arch-TODO
@@ -0,0 +1,134 @@
+
+For generic kernel features that need architecture support, this is
+the feature support matrix, for all upstream Linux architectures:
+
+ ELF-ASLR:---------------------------------------------------------.
+ clockevents:--------------------------------------------------. |
+ modern-timekeeping:-------------------------------------------. | |
+ kgdb:------------------------------------. | | |
+ context-tracking:-----------------------------. | | | |
+ seccomp-filter:----------------------. | | | | |
+ jump-labels:---------------. | | | | | |
+ stackprotector:--------. | | | | | | |
+ lockdep:-. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ arc | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ arm | ok | ok | ok | ok | ok | ok | TODO | ok | ok |
+ arm64 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ avr32 | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ blackfin | ok | TODO | TODO | TODO | TODO | ok | TODO | ok | TODO |
+ c6x | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ hexagon | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ ia64 | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO |
+ metag | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ microblaze | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ mips | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ nios2 | TODO | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ openrisc | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ parisc | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ powerpc | ok | TODO | ok | TODO | TODO | ok | ok | ok | ok |
+ s390 | ok | TODO | ok | ok | TODO | TODO | ok | ok | ok |
+ score | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ sh | ok | ok | TODO | TODO | TODO | ok | ok | ok | TODO |
+ sparc | ok | TODO | ok | TODO | ok | ok | ok | ok | TODO |
+ tile | ok | TODO | TODO | TODO | ok | ok | ok | ok | TODO |
+ um | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ unicore32 | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ x86 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+----------------------------------------------------------------------------------
+
+ tracehook:---------------------------------------------------------.
+ ioremap_prot():--------------------------------------------------. |
+ user-ret-profiler:-------------------------------------------. | |
+ kretprobes:------------------------------------. | | |
+ uprobes:-----------------------------. | | | |
+ kprobes-on-ftrace:----------------------. | | | | |
+ optprobes:---------------. | | | | | |
+ kprobes:--------. | | | | | | |
+arch-tick-broadcast:-. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ arc | TODO | ok | TODO | TODO | TODO | ok | TODO | ok | ok |
+ arm | ok | ok | ok | TODO | ok | ok | TODO | TODO | ok |
+ arm64 | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ avr32 | TODO | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ blackfin | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ c6x | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ hexagon | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ ia64 | TODO | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ metag | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ microblaze | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ mips | ok | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ nios2 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ openrisc | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ parisc | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ powerpc | ok | ok | TODO | TODO | ok | ok | TODO | ok | ok |
+ s390 | TODO | ok | TODO | TODO | ok | ok | TODO | TODO | ok |
+ score | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ sh | TODO | ok | TODO | TODO | TODO | ok | TODO | ok | ok |
+ sparc | TODO | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ tile | TODO | ok | ok | TODO | TODO | ok | ok | ok | ok |
+ um | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ unicore32 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ x86 | TODO | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+----------------------------------------------------------------------------------
+
+
+
+ virt-cpuacct:---------------------------------------------------------.
+ cmpxchg-local:--------------------------------------------------. |
+ perf-stackdump:-------------------------------------------. | |
+ perf-regs:------------------------------------. | | |
+ dma-api-debug:-----------------------------. | | | |
+ kprobes-event:----------------------. | | | | |
+ dma-contiguous:---------------. | | | | | |
+ dma_*map*_attrs():--------. | | | | | | |
+generic-idle-thread:-. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | ok | ok | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ arc | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ arm | ok | ok | ok | ok | ok | ok | ok | TODO | ok |
+ arm64 | ok | ok | ok | TODO | ok | ok | ok | TODO | ok |
+ avr32 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ blackfin | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ c6x | TODO | TODO | TODO | TODO | ok | TODO | TODO | TODO | TODO |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ hexagon | ok | ok | TODO | ok | TODO | TODO | TODO | TODO | TODO |
+ ia64 | ok | ok | TODO | TODO | ok | TODO | TODO | TODO | ok |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ metag | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ microblaze | TODO | ok | TODO | TODO | ok | TODO | TODO | TODO | TODO |
+ mips | ok | ok | ok | TODO | ok | TODO | TODO | TODO | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ nios2 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ openrisc | TODO | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ parisc | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ powerpc | ok | ok | TODO | ok | ok | TODO | TODO | TODO | ok |
+ s390 | ok | ok | TODO | ok | ok | TODO | TODO | ok | ok |
+ score | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ sh | ok | ok | TODO | ok | ok | TODO | TODO | TODO | TODO |
+ sparc | ok | ok | TODO | TODO | ok | TODO | TODO | TODO | ok |
+ tile | TODO | ok | TODO | ok | ok | TODO | TODO | TODO | ok |
+ um | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ unicore32 | TODO | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ x86 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+----------------------------------------------------------------------------------
^ permalink raw reply related
* Re: [RFC PATCH v3] Documentation/arch: Add Documentation/arch-TODO
From: Ingo Molnar @ 2015-05-13 9:46 UTC (permalink / raw)
To: Andrew Morton, Jonathan Corbet
Cc: Peter Zijlstra, Josh Triplett, Andy Lutomirski, Ingo Molnar,
H. Peter Anvin, Thomas Gleixner, Linus Torvalds, linux-api,
linux-kernel, x86, linux-arch, Borislav Petkov
In-Reply-To: <20150513092421.GB11030@gmail.com>
So this is the final version for now:
- add a fourth table
- fix errors in earlier tables, in particular I missed some PowerPC
Kconfigs
- introduce the '..' denotion (in the final table) to show features
that cannot be supported by an architecture due to hardware
dependencies:
gcov-profile-all:---------------.
THP:--------. |
irq-time-acct:-. | |
| | |
----------------------------------------
alpha | TODO | TODO | TODO |
arc | TODO | .. | TODO |
arm | ok | ok | ok |
arm64 | TODO | ok | ok |
avr32 | TODO | .. | TODO |
blackfin | TODO | .. | TODO |
c6x | TODO | .. | TODO |
so in the 'THP' column, if an architecture could in theory support
THP, it's listed as 'TODO', if it cannot, it's listed as '..'.
Please let me know about errors in these tables, and I can also add
more features/facilities as well if I missed any.
Thanks,
Ingo
==========================>
>From a44b9e91788a2628e1223d143024de4572a924c3 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@kernel.org>
Date: Wed, 13 May 2015 10:30:11 +0200
Subject: [PATCH] Documentation/arch: Add Documentation/arch-TODO
Add a TODO list for missing/incomplete architecture support
for generic kernel features.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
Documentation/arch-TODO | 169 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 169 insertions(+)
diff --git a/Documentation/arch-TODO b/Documentation/arch-TODO
new file mode 100644
index 000000000000..0880914e1eaf
--- /dev/null
+++ b/Documentation/arch-TODO
@@ -0,0 +1,169 @@
+
+For generic kernel features that need architecture support, this is
+the feature support matrix, for all upstream Linux architectures:
+
+ ELF-ASLR:---------------------------------------------------------.
+ clockevents:--------------------------------------------------. |
+ modern-timekeeping:-------------------------------------------. | |
+ kgdb:------------------------------------. | | |
+ context-tracking:-----------------------------. | | | |
+ seccomp-filter:----------------------. | | | | |
+ jump-labels:---------------. | | | | | |
+ stackprotector:--------. | | | | | | |
+ lockdep:-. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ arc | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ arm | ok | ok | ok | ok | ok | ok | TODO | ok | ok |
+ arm64 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ avr32 | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ blackfin | ok | TODO | TODO | TODO | TODO | ok | TODO | ok | TODO |
+ c6x | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ hexagon | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ ia64 | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO |
+ metag | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ microblaze | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ mips | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ nios2 | TODO | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ openrisc | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ parisc | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ powerpc | ok | TODO | ok | TODO | ok | ok | ok | ok | ok |
+ s390 | ok | TODO | ok | ok | TODO | TODO | ok | ok | ok |
+ score | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ sh | ok | ok | TODO | TODO | TODO | ok | ok | ok | TODO |
+ sparc | ok | TODO | ok | TODO | ok | ok | ok | ok | TODO |
+ tile | ok | TODO | TODO | TODO | ok | ok | ok | ok | TODO |
+ um | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ unicore32 | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ x86 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+----------------------------------------------------------------------------------
+
+ tracehook:---------------------------------------------------------.
+ ioremap_prot():--------------------------------------------------. |
+ user-ret-profiler:-------------------------------------------. | |
+ kretprobes:------------------------------------. | | |
+ uprobes:-----------------------------. | | | |
+ kprobes-on-ftrace:----------------------. | | | | |
+ optprobes:---------------. | | | | | |
+ kprobes:--------. | | | | | | |
+arch-tick-broadcast:-. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ arc | TODO | ok | TODO | TODO | TODO | ok | TODO | ok | ok |
+ arm | ok | ok | ok | TODO | ok | ok | TODO | TODO | ok |
+ arm64 | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ avr32 | TODO | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ blackfin | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ c6x | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ hexagon | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ ia64 | TODO | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ metag | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ microblaze | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ mips | ok | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ nios2 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ openrisc | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ parisc | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ powerpc | ok | ok | TODO | TODO | ok | ok | TODO | ok | ok |
+ s390 | TODO | ok | TODO | TODO | ok | ok | TODO | TODO | ok |
+ score | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ sh | TODO | ok | TODO | TODO | TODO | ok | TODO | ok | ok |
+ sparc | TODO | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ tile | TODO | ok | ok | TODO | TODO | ok | ok | ok | ok |
+ um | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ unicore32 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ x86 | TODO | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+----------------------------------------------------------------------------------
+
+ virt-cpuacct:---------------------------------------------------------.
+ cmpxchg-local:--------------------------------------------------. |
+ perf-stackdump:-------------------------------------------. | |
+ perf-regs:------------------------------------. | | |
+ dma-api-debug:-----------------------------. | | | |
+ kprobes-event:----------------------. | | | | |
+ dma-contiguous:---------------. | | | | | |
+ dma_*map*_attrs():--------. | | | | | | |
+generic-idle-thread:-. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | ok | ok | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ arc | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ arm | ok | ok | ok | ok | ok | ok | ok | TODO | ok |
+ arm64 | ok | ok | ok | TODO | ok | ok | ok | TODO | ok |
+ avr32 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ blackfin | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ c6x | TODO | TODO | TODO | TODO | ok | TODO | TODO | TODO | TODO |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ hexagon | ok | ok | TODO | ok | TODO | TODO | TODO | TODO | TODO |
+ ia64 | ok | ok | TODO | TODO | ok | TODO | TODO | TODO | ok |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ metag | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ microblaze | TODO | ok | TODO | TODO | ok | TODO | TODO | TODO | TODO |
+ mips | ok | ok | ok | TODO | ok | TODO | TODO | TODO | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ nios2 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ openrisc | TODO | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ parisc | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ powerpc | ok | ok | TODO | ok | ok | TODO | TODO | TODO | ok |
+ s390 | ok | ok | TODO | ok | ok | TODO | TODO | ok | ok |
+ score | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ sh | ok | ok | TODO | ok | ok | TODO | TODO | TODO | TODO |
+ sparc | ok | ok | TODO | TODO | ok | TODO | TODO | TODO | ok |
+ tile | TODO | ok | TODO | ok | ok | TODO | TODO | TODO | ok |
+ um | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ unicore32 | TODO | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ x86 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+----------------------------------------------------------------------------------
+
+ gcov-profile-all:---------------.
+ THP:--------. |
+ irq-time-acct:-. | |
+ | | |
+----------------------------------------
+ alpha | TODO | TODO | TODO |
+ arc | TODO | .. | TODO |
+ arm | ok | ok | ok |
+ arm64 | TODO | ok | ok |
+ avr32 | TODO | .. | TODO |
+ blackfin | TODO | .. | TODO |
+ c6x | TODO | .. | TODO |
+ cris | TODO | .. | TODO |
+ frv | TODO | .. | TODO |
+ hexagon | TODO | .. | TODO |
+ ia64 | TODO | TODO | TODO |
+ m32r | TODO | .. | TODO |
+ m68k | TODO | .. | TODO |
+ metag | TODO | .. | TODO |
+ microblaze | TODO | .. | ok |
+ mips | ok | ok | TODO |
+ mn10300 | TODO | .. | TODO |
+ nios2 | TODO | .. | TODO |
+ openrisc | TODO | .. | TODO |
+ parisc | TODO | TODO | TODO |
+ powerpc | TODO | ok | ok |
+ s390 | TODO | ok | ok |
+ score | TODO | .. | TODO |
+ sh | TODO | .. | ok |
+ sparc | TODO | ok | TODO |
+ tile | TODO | TODO | TODO |
+ um | TODO | .. | TODO |
+ unicore32 | TODO | .. | TODO |
+ x86 | ok | ok | ok |
+ xtensa | ok | .. | TODO |
+----------------------------------------
^ permalink raw reply related
* [RFC PATCH v5] Documentation/arch: Add Documentation/arch-TODO
From: Ingo Molnar @ 2015-05-13 9:47 UTC (permalink / raw)
To: Andrew Morton, Jonathan Corbet
Cc: Peter Zijlstra, Josh Triplett, Andy Lutomirski, Ingo Molnar,
H. Peter Anvin, Thomas Gleixner, Linus Torvalds,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, x86-DgEjT+Ai2ygdnm+yROfE0A,
linux-arch-u79uwXL29TY76Z2rM5mHXA, Borislav Petkov
In-Reply-To: <20150513094622.GC11030-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
(fixed the subject.)
So this is the final version for now:
- add a fourth table
- fix errors in earlier tables, in particular I missed some PowerPC
Kconfigs
- introduce the '..' denotion (in the final table) to show features
that cannot be supported by an architecture due to hardware
dependencies:
gcov-profile-all:---------------.
THP:--------. |
irq-time-acct:-. | |
| | |
----------------------------------------
alpha | TODO | TODO | TODO |
arc | TODO | .. | TODO |
arm | ok | ok | ok |
arm64 | TODO | ok | ok |
avr32 | TODO | .. | TODO |
blackfin | TODO | .. | TODO |
c6x | TODO | .. | TODO |
so in the 'THP' column, if an architecture could in theory support
THP, it's listed as 'TODO', if it cannot, it's listed as '..'.
Please let me know about errors in these tables, and I can also add
more features/facilities as well if I missed any.
Thanks,
Ingo
==========================>
>From a44b9e91788a2628e1223d143024de4572a924c3 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Date: Wed, 13 May 2015 10:30:11 +0200
Subject: [PATCH] Documentation/arch: Add Documentation/arch-TODO
Add a TODO list for missing/incomplete architecture support
for generic kernel features.
Signed-off-by: Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
Documentation/arch-TODO | 169 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 169 insertions(+)
diff --git a/Documentation/arch-TODO b/Documentation/arch-TODO
new file mode 100644
index 000000000000..0880914e1eaf
--- /dev/null
+++ b/Documentation/arch-TODO
@@ -0,0 +1,169 @@
+
+For generic kernel features that need architecture support, this is
+the feature support matrix, for all upstream Linux architectures:
+
+ ELF-ASLR:---------------------------------------------------------.
+ clockevents:--------------------------------------------------. |
+ modern-timekeeping:-------------------------------------------. | |
+ kgdb:------------------------------------. | | |
+ context-tracking:-----------------------------. | | | |
+ seccomp-filter:----------------------. | | | | |
+ jump-labels:---------------. | | | | | |
+ stackprotector:--------. | | | | | | |
+ lockdep:-. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ arc | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ arm | ok | ok | ok | ok | ok | ok | TODO | ok | ok |
+ arm64 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ avr32 | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ blackfin | ok | TODO | TODO | TODO | TODO | ok | TODO | ok | TODO |
+ c6x | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ hexagon | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ ia64 | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO |
+ metag | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ microblaze | ok | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ mips | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ nios2 | TODO | TODO | TODO | TODO | TODO | ok | ok | ok | TODO |
+ openrisc | TODO | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ parisc | TODO | TODO | TODO | TODO | TODO | TODO | ok | TODO | TODO |
+ powerpc | ok | TODO | ok | TODO | ok | ok | ok | ok | ok |
+ s390 | ok | TODO | ok | ok | TODO | TODO | ok | ok | ok |
+ score | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ sh | ok | ok | TODO | TODO | TODO | ok | ok | ok | TODO |
+ sparc | ok | TODO | ok | TODO | ok | ok | ok | ok | TODO |
+ tile | ok | TODO | TODO | TODO | ok | ok | ok | ok | TODO |
+ um | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ unicore32 | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+ x86 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | ok | TODO | TODO | TODO | TODO | TODO | ok | ok | TODO |
+----------------------------------------------------------------------------------
+
+ tracehook:---------------------------------------------------------.
+ ioremap_prot():--------------------------------------------------. |
+ user-ret-profiler:-------------------------------------------. | |
+ kretprobes:------------------------------------. | | |
+ uprobes:-----------------------------. | | | |
+ kprobes-on-ftrace:----------------------. | | | | |
+ optprobes:---------------. | | | | | |
+ kprobes:--------. | | | | | | |
+arch-tick-broadcast:-. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ arc | TODO | ok | TODO | TODO | TODO | ok | TODO | ok | ok |
+ arm | ok | ok | ok | TODO | ok | ok | TODO | TODO | ok |
+ arm64 | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ avr32 | TODO | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ blackfin | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ c6x | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ hexagon | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ ia64 | TODO | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ metag | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ microblaze | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ mips | ok | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ nios2 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ openrisc | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ parisc | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ powerpc | ok | ok | TODO | TODO | ok | ok | TODO | ok | ok |
+ s390 | TODO | ok | TODO | TODO | ok | ok | TODO | TODO | ok |
+ score | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ sh | TODO | ok | TODO | TODO | TODO | ok | TODO | ok | ok |
+ sparc | TODO | ok | TODO | TODO | TODO | ok | TODO | TODO | ok |
+ tile | TODO | ok | ok | TODO | TODO | ok | ok | ok | ok |
+ um | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ unicore32 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ x86 | TODO | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+----------------------------------------------------------------------------------
+
+ virt-cpuacct:---------------------------------------------------------.
+ cmpxchg-local:--------------------------------------------------. |
+ perf-stackdump:-------------------------------------------. | |
+ perf-regs:------------------------------------. | | |
+ dma-api-debug:-----------------------------. | | | |
+ kprobes-event:----------------------. | | | | |
+ dma-contiguous:---------------. | | | | | |
+ dma_*map*_attrs():--------. | | | | | | |
+generic-idle-thread:-. | | | | | | | |
+ | | | | | | | | |
+----------------------------------------------------------------------------------
+ alpha | ok | ok | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ arc | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ arm | ok | ok | ok | ok | ok | ok | ok | TODO | ok |
+ arm64 | ok | ok | ok | TODO | ok | ok | ok | TODO | ok |
+ avr32 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ blackfin | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ c6x | TODO | TODO | TODO | TODO | ok | TODO | TODO | TODO | TODO |
+ cris | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ frv | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ hexagon | ok | ok | TODO | ok | TODO | TODO | TODO | TODO | TODO |
+ ia64 | ok | ok | TODO | TODO | ok | TODO | TODO | TODO | ok |
+ m32r | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ m68k | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ metag | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ microblaze | TODO | ok | TODO | TODO | ok | TODO | TODO | TODO | TODO |
+ mips | ok | ok | ok | TODO | ok | TODO | TODO | TODO | ok |
+ mn10300 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ nios2 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ openrisc | TODO | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ parisc | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | ok |
+ powerpc | ok | ok | TODO | ok | ok | TODO | TODO | TODO | ok |
+ s390 | ok | ok | TODO | ok | ok | TODO | TODO | ok | ok |
+ score | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ sh | ok | ok | TODO | ok | ok | TODO | TODO | TODO | TODO |
+ sparc | ok | ok | TODO | TODO | ok | TODO | TODO | TODO | ok |
+ tile | TODO | ok | TODO | ok | ok | TODO | TODO | TODO | ok |
+ um | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ unicore32 | TODO | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+ x86 | ok | ok | ok | ok | ok | ok | ok | ok | ok |
+ xtensa | ok | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
+----------------------------------------------------------------------------------
+
+ gcov-profile-all:---------------.
+ THP:--------. |
+ irq-time-acct:-. | |
+ | | |
+----------------------------------------
+ alpha | TODO | TODO | TODO |
+ arc | TODO | .. | TODO |
+ arm | ok | ok | ok |
+ arm64 | TODO | ok | ok |
+ avr32 | TODO | .. | TODO |
+ blackfin | TODO | .. | TODO |
+ c6x | TODO | .. | TODO |
+ cris | TODO | .. | TODO |
+ frv | TODO | .. | TODO |
+ hexagon | TODO | .. | TODO |
+ ia64 | TODO | TODO | TODO |
+ m32r | TODO | .. | TODO |
+ m68k | TODO | .. | TODO |
+ metag | TODO | .. | TODO |
+ microblaze | TODO | .. | ok |
+ mips | ok | ok | TODO |
+ mn10300 | TODO | .. | TODO |
+ nios2 | TODO | .. | TODO |
+ openrisc | TODO | .. | TODO |
+ parisc | TODO | TODO | TODO |
+ powerpc | TODO | ok | ok |
+ s390 | TODO | ok | ok |
+ score | TODO | .. | TODO |
+ sh | TODO | .. | ok |
+ sparc | TODO | ok | TODO |
+ tile | TODO | TODO | TODO |
+ um | TODO | .. | TODO |
+ unicore32 | TODO | .. | TODO |
+ x86 | ok | ok | ok |
+ xtensa | ok | .. | TODO |
+----------------------------------------
^ permalink raw reply related
* Re: [PATCH v2 1/3] pagemap: add mmap-exclusive bit for marking pages mapped only here
From: Konstantin Khlebnikov @ 2015-05-13 10:51 UTC (permalink / raw)
To: Mark Williamson
Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Naoya Horiguchi, kernel list,
Andrew Morton, Pavel Emelyanov, Linux API, Andy Lutomirski,
Vlastimil Babka, Pavel Machek, Mark Seaborn, Kirill A. Shutemov,
Linus Torvalds, Daniel James, Finn Grimwood
In-Reply-To: <CAEVpBaLm9eicuFPmyRLa7GddLwtBJh3XzHT=fxj-h0YwwmXQOg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 12.05.2015 15:05, Mark Williamson wrote:
> Hi Konstantin,
>
> I hope you won't mind me thinking out loud here on the idea of adding
> a flag to the v2 pagemap fields... From a kernel PoV, I agree that
> this seems like the cleanest approach. However, with my application
> developer hat on:
>
> 1. I was hoping we'd be able to backport a compatible fix to older
> kernels that might adopt the pagemap permissions change. Using the V2
> format flags rules out doing this for kernels that are too old to have
> soft-dirty, I think.
>
> 2. From our software's PoV, I feel it's worth noting that it doesn't
> strictly fix ABI compatibility, though I realise that's probably not
> your primary concern here. We'll need to modify our code to write the
> clear_refs file but that change is OK for us if it's the preferred
> solution.
>
> In the patches I've been playing with, I was considering putting the
> Exclusive flag in the now-unused PFN field of the pagemap entries.
> Since we're specifically trying to work around for the lack of PFN
> information, would there be any appetite for mirroring this flag
> unconditionally into the now-empty PFN field (i.e. whether using v1 or
> v2 flags) when accessed by an unprivileged process?
>
> I realise it's ugly from a kernel PoV and I feel a little bad for
> suggesting it - but it would address points 1 and 2 for us (our
> existing code just looks for changes in the pagemap entry, so sticking
> the flag in there would cause it to do the right thing).
>
> I'm sorry to raise application-specific issues at this point; I
> appreciate that your primary concern is to improve the kernel and
> technically I like the approach that you've taken! I'll try and
> provide more code-oriented feedback once I've tried out the changes.
I prefer to backport v2 format (except soft-dirty bit and clear_refs)
into older kernels. Page-shift bits are barely used so nobody will see
the difference.
--
Konstantin
^ permalink raw reply
* Re: [PATCH v2 1/3] pagemap: add mmap-exclusive bit for marking pages mapped only here
From: Konstantin Khlebnikov @ 2015-05-13 10:59 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: linux-mm, Naoya Horiguchi, linux-kernel, Andrew Morton,
Mark Williamson, Pavel Emelyanov, linux-api, Andy Lutomirski,
Vlastimil Babka, Pavel Machek, Mark Seaborn, Linus Torvalds,
Daniel James, Finn Grimwood
In-Reply-To: <20150512104055.GB18365@node.dhcp.inet.fi>
On 12.05.2015 13:40, Kirill A. Shutemov wrote:
> On Tue, May 12, 2015 at 12:43:03PM +0300, Konstantin Khlebnikov wrote:
>> This patch sets bit 56 in pagemap if this page is mapped only once.
>> It allows to detect exclusively used pages without exposing PFN:
>>
>> present file exclusive state
>> 0 0 0 non-present
>> 1 1 0 file page mapped somewhere else
>> 1 1 1 file page mapped only here
>> 1 0 0 anon non-CoWed page (shared with parent/child)
>> 1 0 1 anon CoWed page (or never forked)
>
> Probably, worth noting that file-private pages are anon in this context.
>
You mean there's another kind of CoW pages? Yep, but from the kernel
point of view these pages are the same. Anyway Userspace could look
into /proc/*/maps and see is there any file beyond anon vma.
--
Konstantin
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v2 3/3] pagemap: switch to the new format and do some cleanup
From: Konstantin Khlebnikov @ 2015-05-13 11:39 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: linux-mm, Naoya Horiguchi, linux-kernel, Andrew Morton,
Mark Williamson, Pavel Emelyanov, linux-api, Andy Lutomirski,
Vlastimil Babka, Pavel Machek, Mark Seaborn, Linus Torvalds,
Daniel James, Finn Grimwood
In-Reply-To: <20150512105431.GD18365@node.dhcp.inet.fi>
On 12.05.2015 13:54, Kirill A. Shutemov wrote:
> On Tue, May 12, 2015 at 12:43:06PM +0300, Konstantin Khlebnikov wrote:
>> This patch removes page-shift bits (scheduled to remove since 3.11) and
>> completes migration to the new bit layout. Also it cleans messy macro.
>>
>> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
>> ---
>> fs/proc/task_mmu.c | 152 ++++++++++++++++---------------------------------
>> tools/vm/page-types.c | 29 +++------
>> 2 files changed, 58 insertions(+), 123 deletions(-)
>>
>> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
>> index 0b7a8ffec95f..66bc7207ce90 100644
>> --- a/fs/proc/task_mmu.c
>> +++ b/fs/proc/task_mmu.c
>> @@ -710,23 +710,6 @@ const struct file_operations proc_tid_smaps_operations = {
>> .release = proc_map_release,
>> };
>>
>> -/*
>> - * We do not want to have constant page-shift bits sitting in
>> - * pagemap entries and are about to reuse them some time soon.
>> - *
>> - * Here's the "migration strategy":
>> - * 1. when the system boots these bits remain what they are,
>> - * but a warning about future change is printed in log;
>> - * 2. once anyone clears soft-dirty bits via clear_refs file,
>> - * these flag is set to denote, that user is aware of the
>> - * new API and those page-shift bits change their meaning.
>> - * The respective warning is printed in dmesg;
>> - * 3. In a couple of releases we will remove all the mentions
>> - * of page-shift in pagemap entries.
>> - */
>
> Wouldn't it be better to just have v2=1 by default for couple releases to
> see if anything breaks? This way we can revert easily if regression reported.
> I guess someone could miss this change coming if he didn't touch clear_refs.
>
I don't believe that constant PAGE_SHIFT bits are used by anybody.
Recent change of permissions was much more destructive and there is just
one report about that. Kernel prints message at first pagemap open for
ten releases. I think that's enough.
--
Konstantin
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v8 14/16] ARM: dts: Introduce STM32F429 MCU
From: Maxime Coquelin @ 2015-05-13 11:45 UTC (permalink / raw)
To: Arnd Bergmann, Daniel Thompson
Cc: Uwe Kleine-König, Andreas Färber, Geert Uytterhoeven,
Rob Herring, Philipp Zabel, Linus Walleij, Stefan Agner,
Peter Meerwald, Paul Bolle, Peter Hurley, Andy Shevchenko,
Chanwoo Choi, Russell King, Daniel Lezcano, Joe Perches,
Vladimir Zapolskiy, Lee Jones, Jonathan Corbet, Pawel Moll,
Mark Rutland, Ian Campbell
In-Reply-To: <2789447.8FUTAOJOHR@wuerfel>
2015-05-12 23:21 GMT+02:00 Arnd Bergmann <arnd@arndb.de>:
> On Saturday 09 May 2015 09:53:56 Maxime Coquelin wrote:
>> +#include <dt-bindings/mfd/stm32f4-rcc.h>
>> +
>>
>
> Can you find a way to avoid this dependency?
>
> Maybe you can change the bindings so that the numbers you pass as
> arguments to the reset and clock specifiers reflect the numbers that
> the hardware use?
If I understand correctly, you prefer the way I did in v7 [0]?
I don't have a strong opinion on this. Either way is fine to me.
I changed the bindings in the v8 after discussions with Daniel
Thompson, who is implementing the clock driver part of the RCC IP.
He proposed we used common defines, because each peripheral has a
reset line and a clock gate.
Both reset and clock are represented as a single bit, with only the
base offset differing between clock and reset.
You can have a look at chapter 6 of the reference manual [1] if you
find some time.
Having common defines between clocks and reset make sense to me, but I
also understand your point of avoiding dependencies.
Maybe I can revert back to v7 bindings for now, and then we can
reconsider using common defines when Daniel will send the clock
patches.
Note that doing that won't break the DT binary compatibility, as the
raw reset values, or the ones from defines are the same.
Daniel, could you share an example of the bindings you would use for the clocks?
Kind regards,
Maxime
>
> Arnd
[0]: http://lkml.iu.edu/hypermail/linux/kernel/1504.3/04523.html
[1]: http://www.st.com/web/en/resource/technical/document/reference_manual/DM00031020.pdf
^ permalink raw reply
* Re: [PATCH 4/5] doc: ABI: bone_capemgr sysfs API
From: Greg Kroah-Hartman @ 2015-05-13 11:52 UTC (permalink / raw)
To: Pantelis Antoniou
Cc: Matt Porter, Koen Kooi, Robert Nelson, Rob Herring, Grant Likely,
Jonathan Corbet, Srinivas Kandagatla, Guenter Roeck,
Geert Uytterhoeven, Benoît Cousso,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pantelis Antoniou
In-Reply-To: <1431503985-31853-5-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
On Wed, May 13, 2015 at 10:59:44AM +0300, Pantelis Antoniou wrote:
> Document the beaglebone's capemgr sysfs API
>
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> ---
> .../testing/sysfs-devices-platform-bone_capemgr | 63 ++++++++++++++++++++++
> 1 file changed, 63 insertions(+)
> create mode 100644 Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
>
> diff --git a/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr b/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
> new file mode 100644
> index 0000000..e2df613
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
> @@ -0,0 +1,63 @@
> +What: /sys/devices/platform/bone_capemgr/slots
> +Date: May 2015
> +KernelVersion: 4.0
I don't think that version is correct :)
> +Contact: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> +Description:
> + READ:
> + Describe the state of all the slots of the beaglebone capemgr.
> + Each line of the output describes a slot:
sysfs files are "one value per file", so a sysfs file that displays
multiple lines like this is not allowed at all, sorry.
Please either make it a debugfs file (if this is only for debugging, or
split it out into individual files, one per slot (hint, one per slot is
probably best.)
> + The slot format is as following:
> + <slot-id>: [P-][F-][O-][l-][L-][D-] \
> + <overlay-id> <board-name>,<version>,
> + <manufacturer>,<part-number>
> +
> + Where the flags are:
> + P: Slot has been probed
> + F: Slot has failed probing (i.e. no EEPROM detected)
> + O: Slot has been overridden by the user
> + l: Slot is current loading
> + L: Slot has completed loading and is ready
> + D: Slot has been disabled
> +
> + Example:
> + 0: P---L- -1 BeagleBone RS232 CAPE,00A1,Beagleboardtoys,BB-BONE-SERL-03
> + 1: PF---- -1
> + 2: PF---- -1
> + 3: PF---- -1
> +
> + WRITE:
> + Writing a string of the form <part-number>[:version] issues a request to
> + load a firmware blob containing an overlay. The name of the firmware blob
> + is <part-number>-[version|00A0].dtbo. This act is defined as a slot override.
> +
> + Writing a negative slot id removes the slot if it was an overridden one, or
> + unloads a slot that was probed.
> +
> +What: /sys/devices/platform/bone_capemgr/baseboard/<eeprom-field>
> +Date: May 2015
> +KernelVersion: 4.0
> +Contact: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> +Description: Contains the probed base board EEPROM field; one of:
> + board-name - board-name as stored in cape EEPROM
> + dc-supplied - whether the cape draws or supplies DC
> + eeprom-format-revision - EEPROM format rev, only 00A0 supported
> + header - header; should be 'aa 55 33 ee'
If it's always this value, why have the file?
> + manufacturer - manufacturer string
> + part-number - part-number of the cape
> + serial-number - serial number of the cape
> + version - version of the cape, i.e. 00A0
> + number-of-pins - displayed but ignored
> + pin-usage - displayed but ignored
> + sys-5v - displayed but ignored
> + vdd-3v3exp - displayed but ignored
> + vdd-5v - displayed but ignored
Are these all individual different files?
> +What: /sys/devices/platform/bone_capemgr/slot-<n>/<eeprom-field>
No blank line?
> +Date: May 2015
> +KernelVersion: 4.0
> +Contact: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> +Description: Contains the probed cape's EEPROM field; the field is one of:
> + board-name - baseboard name i.e. A335BNLT
> + header - header; should be 'aa 55 33 ee'
> + revision - baseboard revision
> + serial-number - baseboard serial number
> + config-option - displayed but ignored
Same here, are these all individual files?
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH 1/5] misc: Beaglebone capemanager
From: Greg Kroah-Hartman @ 2015-05-13 11:55 UTC (permalink / raw)
To: Pantelis Antoniou
Cc: Matt Porter, Koen Kooi, Robert Nelson, Rob Herring, Grant Likely,
Jonathan Corbet, Srinivas Kandagatla, Guenter Roeck,
Geert Uytterhoeven, Benoît Cousso, linux-api, linux-doc,
devicetree, linux-kernel, Pantelis Antoniou
In-Reply-To: <1431503985-31853-2-git-send-email-pantelis.antoniou@konsulko.com>
On Wed, May 13, 2015 at 10:59:41AM +0300, Pantelis Antoniou wrote:
> A cape loader based on DT overlays and DT objects.
>
> This is the beaglebone cape manager which allows capes to be automatically
> probed and instantiated via means of a device tree overlay deduced from
> the part-number and version contained on the cape's EEPROM.
>
> The reference manual contains information about the specification
> and the contents of the EEPROM.
>
> http://beagleboard.org/static/beaglebone/latest/Docs/Hardware/BONE_SRM.pdf
>
> Documentation about the workings of the cape manager is located
> in Documentation/misc-devices/bone_capemgr.txt
>
> This driver is using the EEPROM framework interface to retrieve
> the data stored on the baseboard and cape EEPROMs.
>
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> ---
> drivers/misc/Kconfig | 10 +
> drivers/misc/Makefile | 1 +
> drivers/misc/bone_capemgr.c | 1926 +++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 1937 insertions(+)
> create mode 100644 drivers/misc/bone_capemgr.c
>
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 006242c..f9e09e1 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -515,6 +515,16 @@ config VEXPRESS_SYSCFG
> bus. System Configuration interface is one of the possible means
> of generating transactions on this bus.
>
> +config BONE_CAPEMGR
> + tristate "Beaglebone cape manager"
> + depends on ARCH_OMAP2PLUS && OF
> + select EEPROM
> + select OF_OVERLAY
> + default n
N is always the default, please remove.
> + help
> + Say Y here to include support for automatic loading of
> + beaglebone capes.
> +
What about if it's a module?
> source "drivers/misc/c2port/Kconfig"
> source "drivers/misc/eeprom/Kconfig"
> source "drivers/misc/cb710/Kconfig"
> diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
> index 7d5c4cd..659b78b 100644
> --- a/drivers/misc/Makefile
> +++ b/drivers/misc/Makefile
> @@ -56,3 +56,4 @@ obj-$(CONFIG_GENWQE) += genwqe/
> obj-$(CONFIG_ECHO) += echo/
> obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o
> obj-$(CONFIG_CXL_BASE) += cxl/
> +obj-$(CONFIG_BONE_CAPEMGR) += bone_capemgr.o
> diff --git a/drivers/misc/bone_capemgr.c b/drivers/misc/bone_capemgr.c
> new file mode 100644
> index 0000000..423719c
> --- /dev/null
> +++ b/drivers/misc/bone_capemgr.c
> @@ -0,0 +1,1926 @@
> +/*
> + * TI Beaglebone cape manager
> + *
> + * Copyright (C) 2012 Texas Instruments Inc.
> + * Copyright (C) 2012-2015 Konsulko Group.
> + * Author: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
I have to ask, do you really mean, "or any later version"?
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/delay.h>
> +#include <linux/err.h>
> +#include <linux/interrupt.h>
> +#include <linux/completion.h>
> +#include <linux/platform_device.h>
> +#include <linux/clk.h>
> +#include <linux/io.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
> +#include <linux/of_fdt.h>
> +#include <linux/slab.h>
> +#include <linux/pm_runtime.h>
> +#include <linux/pinctrl/consumer.h>
> +#include <linux/firmware.h>
> +#include <linux/err.h>
> +#include <linux/ctype.h>
> +#include <linux/string.h>
> +#include <linux/memory.h>
> +#include <linux/kthread.h>
> +#include <linux/wait.h>
> +#include <linux/file.h>
> +#include <linux/fs.h>
> +#include <linux/eeprom-consumer.h>
> +
> +/* disabled capes */
> +static char *disable_partno;
> +module_param(disable_partno, charp, 0444);
> +MODULE_PARM_DESC(disable_partno,
> + "Comma delimited list of PART-NUMBER[:REV] of disabled capes");
> +
> +/* enable capes */
> +static char *enable_partno;
> +module_param(enable_partno, charp, 0444);
> +MODULE_PARM_DESC(enable_partno,
> + "Comma delimited list of PART-NUMBER[:REV] of enabled capes");
> +
> +/* delay to scan on boot until rootfs appears */
> +static int boot_scan_period = 1000;
> +module_param(boot_scan_period, int, 0444);
> +MODULE_PARM_DESC(boot_scan_period,
> + "boot scan period until rootfs firmware is available");
Ick, no module parameters please, can't we drop these?
And we have a rootfs delay option already for the whole system, this
module shouldn't need a special one.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH 4/5] doc: ABI: bone_capemgr sysfs API
From: Pantelis Antoniou @ 2015-05-13 11:56 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Matt Porter, Koen Kooi, Robert Nelson, Rob Herring, Grant Likely,
Jonathan Corbet, Srinivas Kandagatla, Guenter Roeck,
Geert Uytterhoeven, Benoît Cousso,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA, devicetree,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20150513115259.GA1021-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
Hi Greg,
> On May 13, 2015, at 14:52 , Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
> On Wed, May 13, 2015 at 10:59:44AM +0300, Pantelis Antoniou wrote:
>> Document the beaglebone's capemgr sysfs API
>>
>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
>> ---
>> .../testing/sysfs-devices-platform-bone_capemgr | 63 ++++++++++++++++++++++
>> 1 file changed, 63 insertions(+)
>> create mode 100644 Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
>>
>> diff --git a/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr b/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
>> new file mode 100644
>> index 0000000..e2df613
>> --- /dev/null
>> +++ b/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
>> @@ -0,0 +1,63 @@
>> +What: /sys/devices/platform/bone_capemgr/slots
>> +Date: May 2015
>> +KernelVersion: 4.0
>
> I don't think that version is correct :)
>
Bah, ++
>> +Contact: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
>> +Description:
>> + READ:
>> + Describe the state of all the slots of the beaglebone capemgr.
>> + Each line of the output describes a slot:
>
> sysfs files are "one value per file", so a sysfs file that displays
> multiple lines like this is not allowed at all, sorry.
>
> Please either make it a debugfs file (if this is only for debugging, or
> split it out into individual files, one per slot (hint, one per slot is
> probably best.)
>
Well, it’s a status file. And it’s been used as is for a couple of years
so it was worth a shot for backward compatibility.
>> + The slot format is as following:
>> + <slot-id>: [P-][F-][O-][l-][L-][D-] \
>> + <overlay-id> <board-name>,<version>,
>> + <manufacturer>,<part-number>
>> +
>> + Where the flags are:
>> + P: Slot has been probed
>> + F: Slot has failed probing (i.e. no EEPROM detected)
>> + O: Slot has been overridden by the user
>> + l: Slot is current loading
>> + L: Slot has completed loading and is ready
>> + D: Slot has been disabled
>> +
>> + Example:
>> + 0: P---L- -1 BeagleBone RS232 CAPE,00A1,Beagleboardtoys,BB-BONE-SERL-03
>> + 1: PF---- -1
>> + 2: PF---- -1
>> + 3: PF---- -1
>> +
>> + WRITE:
>> + Writing a string of the form <part-number>[:version] issues a request to
>> + load a firmware blob containing an overlay. The name of the firmware blob
>> + is <part-number>-[version|00A0].dtbo. This act is defined as a slot override.
>> +
>> + Writing a negative slot id removes the slot if it was an overridden one, or
>> + unloads a slot that was probed.
>> +
>> +What: /sys/devices/platform/bone_capemgr/baseboard/<eeprom-field>
>> +Date: May 2015
>> +KernelVersion: 4.0
>> +Contact: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
>> +Description: Contains the probed base board EEPROM field; one of:
>> + board-name - board-name as stored in cape EEPROM
>> + dc-supplied - whether the cape draws or supplies DC
>> + eeprom-format-revision - EEPROM format rev, only 00A0 supported
>> + header - header; should be 'aa 55 33 ee'
>
> If it's always this value, why have the file?
>
These are the contents of the EEPROM. If the format of the EEPROM changes then the
header information will change.
>> + manufacturer - manufacturer string
>> + part-number - part-number of the cape
>> + serial-number - serial number of the cape
>> + version - version of the cape, i.e. 00A0
>> + number-of-pins - displayed but ignored
>> + pin-usage - displayed but ignored
>> + sys-5v - displayed but ignored
>> + vdd-3v3exp - displayed but ignored
>> + vdd-5v - displayed but ignored
>
> Are these all individual different files?
>
Yes
>> +What: /sys/devices/platform/bone_capemgr/slot-<n>/<eeprom-field>
>
> No blank line?
>
OK
>> +Date: May 2015
>> +KernelVersion: 4.0
>> +Contact: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
>> +Description: Contains the probed cape's EEPROM field; the field is one of:
>> + board-name - baseboard name i.e. A335BNLT
>> + header - header; should be 'aa 55 33 ee'
>> + revision - baseboard revision
>> + serial-number - baseboard serial number
>> + config-option - displayed but ignored
>
> Same here, are these all individual files?
>
Yes.
> thanks,
>
> greg k-h
Regards
— Pantelis
^ permalink raw reply
* Re: [PATCH 4/5] doc: ABI: bone_capemgr sysfs API
From: Greg Kroah-Hartman @ 2015-05-13 12:08 UTC (permalink / raw)
To: Pantelis Antoniou
Cc: Matt Porter, Koen Kooi, Robert Nelson, Rob Herring, Grant Likely,
Jonathan Corbet, Srinivas Kandagatla, Guenter Roeck,
Geert Uytterhoeven, Benoît Cousso,
linux-api-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA, devicetree,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <28C3D47C-8D31-4DD9-8751-F72A7F09DF6F-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
On Wed, May 13, 2015 at 02:56:49PM +0300, Pantelis Antoniou wrote:
> Hi Greg,
>
> > On May 13, 2015, at 14:52 , Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> >
> > On Wed, May 13, 2015 at 10:59:44AM +0300, Pantelis Antoniou wrote:
> >> Document the beaglebone's capemgr sysfs API
> >>
> >> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> >> ---
> >> .../testing/sysfs-devices-platform-bone_capemgr | 63 ++++++++++++++++++++++
> >> 1 file changed, 63 insertions(+)
> >> create mode 100644 Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
> >>
> >> diff --git a/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr b/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
> >> new file mode 100644
> >> index 0000000..e2df613
> >> --- /dev/null
> >> +++ b/Documentation/ABI/testing/sysfs-devices-platform-bone_capemgr
> >> @@ -0,0 +1,63 @@
> >> +What: /sys/devices/platform/bone_capemgr/slots
> >> +Date: May 2015
> >> +KernelVersion: 4.0
> >
> > I don't think that version is correct :)
> >
>
> Bah, ++
>
> >> +Contact: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> >> +Description:
> >> + READ:
> >> + Describe the state of all the slots of the beaglebone capemgr.
> >> + Each line of the output describes a slot:
> >
> > sysfs files are "one value per file", so a sysfs file that displays
> > multiple lines like this is not allowed at all, sorry.
> >
> > Please either make it a debugfs file (if this is only for debugging, or
> > split it out into individual files, one per slot (hint, one per slot is
> > probably best.)
> >
>
> Well, it’s a status file. And it’s been used as is for a couple of years
> so it was worth a shot for backward compatibility.
There is not "backwards compatiblity" for when you do things wrong in
the first place, you can't claim that here, sorry.
And don't "try" to introduce things you know is wrong, that just makes
maintainers _very_ suspicious of everything else you are doing here...
> >> + The slot format is as following:
> >> + <slot-id>: [P-][F-][O-][l-][L-][D-] \
> >> + <overlay-id> <board-name>,<version>,
> >> + <manufacturer>,<part-number>
> >> +
> >> + Where the flags are:
> >> + P: Slot has been probed
> >> + F: Slot has failed probing (i.e. no EEPROM detected)
> >> + O: Slot has been overridden by the user
> >> + l: Slot is current loading
> >> + L: Slot has completed loading and is ready
> >> + D: Slot has been disabled
> >> +
> >> + Example:
> >> + 0: P---L- -1 BeagleBone RS232 CAPE,00A1,Beagleboardtoys,BB-BONE-SERL-03
> >> + 1: PF---- -1
> >> + 2: PF---- -1
> >> + 3: PF---- -1
> >> +
> >> + WRITE:
> >> + Writing a string of the form <part-number>[:version] issues a request to
> >> + load a firmware blob containing an overlay. The name of the firmware blob
> >> + is <part-number>-[version|00A0].dtbo. This act is defined as a slot override.
> >> +
> >> + Writing a negative slot id removes the slot if it was an overridden one, or
> >> + unloads a slot that was probed.
> >> +
> >> +What: /sys/devices/platform/bone_capemgr/baseboard/<eeprom-field>
> >> +Date: May 2015
> >> +KernelVersion: 4.0
> >> +Contact: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> >> +Description: Contains the probed base board EEPROM field; one of:
> >> + board-name - board-name as stored in cape EEPROM
> >> + dc-supplied - whether the cape draws or supplies DC
> >> + eeprom-format-revision - EEPROM format rev, only 00A0 supported
> >> + header - header; should be 'aa 55 33 ee'
> >
> > If it's always this value, why have the file?
> >
>
> These are the contents of the EEPROM. If the format of the EEPROM changes then the
> header information will change.
Then don't say "should be", because what happens in the future if it is
not.
> >> + manufacturer - manufacturer string
> >> + part-number - part-number of the cape
> >> + serial-number - serial number of the cape
> >> + version - version of the cape, i.e. 00A0
> >> + number-of-pins - displayed but ignored
> >> + pin-usage - displayed but ignored
> >> + sys-5v - displayed but ignored
> >> + vdd-3v3exp - displayed but ignored
> >> + vdd-5v - displayed but ignored
> >
> > Are these all individual different files?
> >
>
> Yes
Then write out the individual files please as different entries.
Also, the "displayed but ignored" doesn't make sense, please fix that
up.
greg k-h
^ permalink raw reply
* Re: [PATCH 1/5] misc: Beaglebone capemanager
From: Pantelis Antoniou @ 2015-05-13 12:10 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Matt Porter, Koen Kooi, Robert Nelson, Rob Herring, Grant Likely,
Jonathan Corbet, Srinivas Kandagatla, Guenter Roeck,
Geert Uytterhoeven, Benoît Cousso, linux-api, linux-doc,
devicetree, linux-kernel
In-Reply-To: <20150513115514.GB1021@kroah.com>
Hi Greg,
> On May 13, 2015, at 14:55 , Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
> On Wed, May 13, 2015 at 10:59:41AM +0300, Pantelis Antoniou wrote:
>> A cape loader based on DT overlays and DT objects.
>>
>> This is the beaglebone cape manager which allows capes to be automatically
>> probed and instantiated via means of a device tree overlay deduced from
>> the part-number and version contained on the cape's EEPROM.
>>
>> The reference manual contains information about the specification
>> and the contents of the EEPROM.
>>
>> http://beagleboard.org/static/beaglebone/latest/Docs/Hardware/BONE_SRM.pdf
>>
>> Documentation about the workings of the cape manager is located
>> in Documentation/misc-devices/bone_capemgr.txt
>>
>> This driver is using the EEPROM framework interface to retrieve
>> the data stored on the baseboard and cape EEPROMs.
>>
>> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
>> ---
>> drivers/misc/Kconfig | 10 +
>> drivers/misc/Makefile | 1 +
>> drivers/misc/bone_capemgr.c | 1926 +++++++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 1937 insertions(+)
>> create mode 100644 drivers/misc/bone_capemgr.c
>>
>> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
>> index 006242c..f9e09e1 100644
>> --- a/drivers/misc/Kconfig
>> +++ b/drivers/misc/Kconfig
>> @@ -515,6 +515,16 @@ config VEXPRESS_SYSCFG
>> bus. System Configuration interface is one of the possible means
>> of generating transactions on this bus.
>>
>> +config BONE_CAPEMGR
>> + tristate "Beaglebone cape manager"
>> + depends on ARCH_OMAP2PLUS && OF
>> + select EEPROM
>> + select OF_OVERLAY
>> + default n
>
> N is always the default, please remove.
>
OK
>> + help
>> + Say Y here to include support for automatic loading of
>> + beaglebone capes.
>> +
>
> What about if it's a module?
>
>
It should work but it’s going to be weird (i.e. no-one has used it as such).
I’ll update the blurb.
>> source "drivers/misc/c2port/Kconfig"
>> source "drivers/misc/eeprom/Kconfig"
>> source "drivers/misc/cb710/Kconfig"
>> diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
>> index 7d5c4cd..659b78b 100644
>> --- a/drivers/misc/Makefile
>> +++ b/drivers/misc/Makefile
>> @@ -56,3 +56,4 @@ obj-$(CONFIG_GENWQE) += genwqe/
>> obj-$(CONFIG_ECHO) += echo/
>> obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o
>> obj-$(CONFIG_CXL_BASE) += cxl/
>> +obj-$(CONFIG_BONE_CAPEMGR) += bone_capemgr.o
>> diff --git a/drivers/misc/bone_capemgr.c b/drivers/misc/bone_capemgr.c
>> new file mode 100644
>> index 0000000..423719c
>> --- /dev/null
>> +++ b/drivers/misc/bone_capemgr.c
>> @@ -0,0 +1,1926 @@
>> +/*
>> + * TI Beaglebone cape manager
>> + *
>> + * Copyright (C) 2012 Texas Instruments Inc.
>> + * Copyright (C) 2012-2015 Konsulko Group.
>> + * Author: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>
> I have to ask, do you really mean, "or any later version”?
>
Yes, this is purely a community thing. No evil vendor at play at all.
>
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> + * GNU General Public License for more details.
>> + */
>> +
>> +#include <linux/module.h>
>> +#include <linux/delay.h>
>> +#include <linux/err.h>
>> +#include <linux/interrupt.h>
>> +#include <linux/completion.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/clk.h>
>> +#include <linux/io.h>
>> +#include <linux/of.h>
>> +#include <linux/of_device.h>
>> +#include <linux/of_fdt.h>
>> +#include <linux/slab.h>
>> +#include <linux/pm_runtime.h>
>> +#include <linux/pinctrl/consumer.h>
>> +#include <linux/firmware.h>
>> +#include <linux/err.h>
>> +#include <linux/ctype.h>
>> +#include <linux/string.h>
>> +#include <linux/memory.h>
>> +#include <linux/kthread.h>
>> +#include <linux/wait.h>
>> +#include <linux/file.h>
>> +#include <linux/fs.h>
>> +#include <linux/eeprom-consumer.h>
>> +
>> +/* disabled capes */
>> +static char *disable_partno;
>> +module_param(disable_partno, charp, 0444);
>> +MODULE_PARM_DESC(disable_partno,
>> + "Comma delimited list of PART-NUMBER[:REV] of disabled capes");
>> +
>> +/* enable capes */
>> +static char *enable_partno;
>> +module_param(enable_partno, charp, 0444);
>> +MODULE_PARM_DESC(enable_partno,
>> + "Comma delimited list of PART-NUMBER[:REV] of enabled capes");
>> +
>> +/* delay to scan on boot until rootfs appears */
>> +static int boot_scan_period = 1000;
>> +module_param(boot_scan_period, int, 0444);
>> +MODULE_PARM_DESC(boot_scan_period,
>> + "boot scan period until rootfs firmware is available");
>
> Ick, no module parameters please, can't we drop these?
>
In a nutshell, no :)
These has to be way to control whether a cape is disabled (if found) and enabled (if the manufacturer in it’s infinite wisdom removed the EEPROM to save $0.01 per cape).
The easiest way to achieve this is with the kernel command line.
> And we have a rootfs delay option already for the whole system, this
> module shouldn't need a special one.
>
No, that won’t work.
You see the problem is as follows.
The capemanager is not built as a module, it is builtin.
By the time the probe method is called the rootfs has no been mounted yet.
This is actually what we want for the cases where the rootfs resides on a cape and
the cape’s dtbo firmware file is built-in the kernel image.
This does not work when the firmware file is located in the rootfs filesystem, since
the call to request_firmware will fail at that time.
That option controls the polling delay until the system boot state indicates that the
rootfs is available and the call will succeed.
There are lots of warts in our firmware loader.
> thanks,
>
> greg k-h
Regards
— Pantelis
^ permalink raw reply
* Re: [PATCH RFC] vfs: add a O_NOMTIME flag
From: Jan Kara @ 2015-05-13 12:32 UTC (permalink / raw)
To: Sage Weil
Cc: Theodore Ts'o, Trond Myklebust, Dave Chinner, Zach Brown,
Alexander Viro, Linux FS-devel Mailing List,
Linux Kernel Mailing List, Linux API Mailing List
In-Reply-To: <alpine.DEB.2.00.1505110920520.28239-vIokxiIdD2AQNTJnQDzGJqxOck334EZe@public.gmane.org>
On Mon 11-05-15 09:24:09, Sage Weil wrote:
> On Mon, 11 May 2015, Theodore Ts'o wrote:
> > On Sun, May 10, 2015 at 07:13:24PM -0400, Trond Myklebust wrote:
> > > That makes it completely non-generic though. By putting this in the
> > > VFS, you are giving applications a loaded gun that is pointed straight
> > > at the application user's head.
> >
> > Let me re-ask the question that I asked last week (and was apparently
> > ignored). Why not trying to use the lazytime feature instead of
> > pointing a head straight at the application's --- and system
> > administrators' --- heads?
>
> Sorry Ted, I thought I responded already.
>
> The goal is to avoid inode writeout entirely when we can, and
> as I understand it lazytime will still force writeout before the inode
> is dropped from the cache. In systems like Ceph in particular, the
> IOs can be spread across lots of files, so simply deferring writeout
> doesn't always help.
Can we get some numbers on this? Before we go on and implement new mount
options, persistent inode flags, open flags, or whatever other crap
(neither of which looks particularly appealing to me) I'd like to know how
big is the performance difference between lazytime + fdatasync and not
updating mtime at all for Ceph...
Honza
--
Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
SUSE Labs, CR
^ permalink raw reply
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