[RESEND PATCH v1 10/11] perf: hisi: Support for Hisilicon DDRC PMU.

2016-11-02 Thread Anurup M
1. Add support for counting Hisilicon DDRC
   statistics events in perf.
2. Support a total of 13 statistics events.
3. Events listed in /sys/devices//

Signed-off-by: Anurup M 
Signed-off-by: Shaokun Zhang 
---
 drivers/perf/hisilicon/Makefile   |   2 +-
 drivers/perf/hisilicon/hisi_uncore_ddrc.c | 444 ++
 drivers/perf/hisilicon/hisi_uncore_ddrc.h |  73 +
 3 files changed, 518 insertions(+), 1 deletion(-)
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_ddrc.c
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_ddrc.h

diff --git a/drivers/perf/hisilicon/Makefile b/drivers/perf/hisilicon/Makefile
index 8975104..8e9df2e 100644
--- a/drivers/perf/hisilicon/Makefile
+++ b/drivers/perf/hisilicon/Makefile
@@ -1 +1 @@
-obj-$(CONFIG_HISI_PMU) += hisi_uncore_pmu.o hisi_uncore_l3c.o hisi_uncore_mn.o
+obj-$(CONFIG_HISI_PMU) += hisi_uncore_pmu.o hisi_uncore_l3c.o hisi_uncore_mn.o 
hisi_uncore_ddrc.o
diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc.c 
b/drivers/perf/hisilicon/hisi_uncore_ddrc.c
new file mode 100644
index 000..b89a72e
--- /dev/null
+++ b/drivers/perf/hisilicon/hisi_uncore_ddrc.c
@@ -0,0 +1,444 @@
+/*
+ * HiSilicon SoC DDRC Hardware event counters support
+ *
+ * Copyright (C) 2016 Huawei Technologies Limited
+ * Author: Anurup M 
+ *
+ * This code is based on the uncore PMU's like arm-cci and
+ * arm-ccn.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see .
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "hisi_uncore_ddrc.h"
+
+static inline int hisi_ddrc_counter_valid(int idx, struct hisi_pmu *ddrc_pmu)
+{
+   return (idx >= 0 && idx < ddrc_pmu->num_counters);
+}
+
+static u32 hisi_ddrc_read32_relaxed(void __iomem *regs_base, u32 off)
+{
+   void __iomem *reg_addr = regs_base + off;
+
+   return readl_relaxed(reg_addr);
+}
+
+static void hisi_ddrc_write32(void __iomem *regs_base, u32 off, u32 val)
+{
+   void __iomem *reg_addr = regs_base + off;
+
+   writel(val, reg_addr);
+}
+
+static u32 hisi_read_ddrc_counter(struct hisi_ddrc_data *ddrc_hwmod_data,
+   unsigned long event_code, int idx)
+{
+   u32 value;
+   u32 reg_off;
+
+   reg_off = HISI_DDRC_FLUX_WR_REG_OFF + (event_code * 4);
+
+   value = hisi_ddrc_read32_relaxed(ddrc_hwmod_data->regs_base,
+   reg_off);
+   return value;
+}
+
+static u64 hisi_ddrc_event_update(struct perf_event *event,
+   struct hw_perf_event *hwc, int idx)
+{
+   struct hisi_pmu *ddrc_pmu = to_hisi_pmu(event->pmu);
+   struct hisi_ddrc_data *ddrc_hwmod_data;
+   u64 delta, prev_raw_count, new_raw_count = 0;
+
+   if (!hisi_ddrc_counter_valid(idx, ddrc_pmu)) {
+   dev_err(ddrc_pmu->dev,
+   "%s: Unsupported event index:%d!\n", __func__, idx);
+   return 0;
+   }
+
+   ddrc_hwmod_data = ddrc_pmu->hwmod_data;
+
+   /* Check if the DDRC data is initialized for this SCCL */
+   if (!ddrc_hwmod_data->regs_base) {
+   dev_err(ddrc_pmu->dev, "DDRC registers not mapped!\n");
+   return 0;
+   }
+
+   do {
+   prev_raw_count = local64_read(>prev_count);
+   new_raw_count =
+   hisi_read_ddrc_counter(ddrc_hwmod_data,
+   hwc->config_base, idx);
+   delta = (new_raw_count - prev_raw_count) &
+   HISI_MAX_PERIOD;
+
+   local64_add(delta, >count);
+   } while (local64_cmpxchg(
+   >prev_count, prev_raw_count, new_raw_count) !=
+   prev_raw_count);
+
+   return new_raw_count;
+}
+
+static u32 hisi_write_ddrc_counter(struct hisi_pmu *ddrc_pmu,
+   struct hw_perf_event *hwc, u32 value)
+{
+   struct hisi_ddrc_data *ddrc_hwmod_data = ddrc_pmu->hwmod_data;
+   u32 reg_off;
+   u32 event_code = hwc->config_base;
+
+   if (!(event_code >= HISI_HWEVENT_DDRC_FLUX_WR &&
+   event_code < HISI_HWEVENT_DDRC_MAX_EVENT)) {
+   dev_err(ddrc_pmu->dev, "Unknown DDR evevnt!");
+   return 0;
+   }
+
+ 

[RESEND PATCH v1 08/11] perf: hisi: Add sysfs attributes for L3 cache(L3C) PMU

2016-11-02 Thread Anurup M
1. Add L3 caches events to /sys/devices/hisi_l3c2/events/
  The events can be selected as shown in perf list
  e.g.: For L3C_READ_ALLOCATE event for Super CPU cluster 2 the
  event format is
-e "hisi_l3c2/read_allocate/"
2. Add cpu_mask attribute group for showing the available CPU
   for counting.

Signed-off-by: Anurup M 
Signed-off-by: Shaokun Zhang 
---
 drivers/perf/hisilicon/hisi_uncore_l3c.c | 57 
 drivers/perf/hisilicon/hisi_uncore_pmu.c | 40 ++
 drivers/perf/hisilicon/hisi_uncore_pmu.h | 22 
 3 files changed, 119 insertions(+)

diff --git a/drivers/perf/hisilicon/hisi_uncore_l3c.c 
b/drivers/perf/hisilicon/hisi_uncore_l3c.c
index f78f7b2..428fba0 100644
--- a/drivers/perf/hisilicon/hisi_uncore_l3c.c
+++ b/drivers/perf/hisilicon/hisi_uncore_l3c.c
@@ -436,6 +436,62 @@ static int init_hisi_l3c_data(struct device *dev,
return ret;
 }
 
+static struct attribute *hisi_l3c_format_attr[] = {
+   HISI_PMU_FORMAT_ATTR(event, "config:0-11"),
+   NULL,
+};
+
+static struct attribute_group hisi_l3c_format_group = {
+   .name = "format",
+   .attrs = hisi_l3c_format_attr,
+};
+
+static struct attribute *hisi_l3c_events_attr[] = {
+   HISI_PMU_EVENT_ATTR_STR(read_allocate,
+   "event=0x0"),
+   HISI_PMU_EVENT_ATTR_STR(write_allocate,
+   "event=0x01"),
+   HISI_PMU_EVENT_ATTR_STR(read_noallocate,
+   "event=0x02"),
+   HISI_PMU_EVENT_ATTR_STR(write_noallocate,
+   "event=0x03"),
+   HISI_PMU_EVENT_ATTR_STR(read_hit, "event=0x04"),
+   HISI_PMU_EVENT_ATTR_STR(write_hit, "event=0x05"),
+   NULL,
+};
+
+static struct attribute_group hisi_l3c_events_group = {
+   .name = "events",
+   .attrs = hisi_l3c_events_attr,
+};
+
+static struct attribute *hisi_l3c_attrs[] = {
+   NULL,
+};
+
+struct attribute_group hisi_l3c_attr_group = {
+   .attrs = hisi_l3c_attrs,
+};
+
+static DEVICE_ATTR(cpumask, 0444, hisi_cpumask_sysfs_show, NULL);
+
+static struct attribute *hisi_l3c_cpumask_attrs[] = {
+   _attr_cpumask.attr,
+   NULL,
+};
+
+static const struct attribute_group hisi_l3c_cpumask_attr_group = {
+   .attrs = hisi_l3c_cpumask_attrs,
+};
+
+static const struct attribute_group *hisi_l3c_pmu_attr_groups[] = {
+   _l3c_attr_group,
+   _l3c_format_group,
+   _l3c_events_group,
+   _l3c_cpumask_attr_group,
+   NULL,
+};
+
 static struct hisi_uncore_ops hisi_uncore_l3c_ops = {
.set_evtype = hisi_set_l3c_evtype,
.set_event_period = hisi_pmu_set_event_period,
@@ -496,6 +552,7 @@ static int hisi_pmu_l3c_dev_probe(struct hisi_djtag_client 
*client)
.start = hisi_uncore_pmu_start,
.stop = hisi_uncore_pmu_stop,
.read = hisi_uncore_pmu_read,
+   .attr_groups = hisi_l3c_pmu_attr_groups,
};
 
ret = hisi_uncore_pmu_setup(pl3c_pmu, pl3c_pmu->name);
diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c 
b/drivers/perf/hisilicon/hisi_uncore_pmu.c
index 8d29fcc..d0a911a 100644
--- a/drivers/perf/hisilicon/hisi_uncore_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c
@@ -26,6 +26,46 @@
 #include 
 #include "hisi_uncore_pmu.h"
 
+/*
+ * PMU format attributes
+ */
+ssize_t hisi_format_sysfs_show(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   struct dev_ext_attribute *eattr;
+
+   eattr = container_of(attr, struct dev_ext_attribute,
+attr);
+   return sprintf(buf, "%s\n", (char *) eattr->var);
+}
+
+/*
+ * PMU event attributes
+ */
+ssize_t hisi_event_sysfs_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+   struct perf_pmu_events_attr *pmu_attr =
+   container_of(attr, struct perf_pmu_events_attr, attr);
+
+   if (pmu_attr->event_str)
+   return sprintf(buf, "%s", pmu_attr->event_str);
+
+   return 0;
+}
+
+/*
+ * sysfs cpumask attributes
+ */
+ssize_t hisi_cpumask_sysfs_show(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   struct pmu *pmu = dev_get_drvdata(dev);
+   struct hisi_pmu *hisi_pmu = to_hisi_pmu(pmu);
+
+   return cpumap_print_to_pagebuf(true, buf, _pmu->cpu);
+}
+
 /* djtag read interface - Call djtag driver to access SoC registers */
 int hisi_djtag_readreg(int module_id, int bank, u32 offset,
struct hisi_djtag_client *client, u32 *pvalue)
diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h 
b/drivers/perf/hisilicon/hisi_uncore_pmu.h
index b6b16df..a948752 100644
--- a/drivers/perf/hisilicon/hisi_uncore_pmu.h
+++ 

[RESEND PATCH v1 11/11] dts: arm64: hip06: Add Hisilicon SoC PMU support

2016-11-02 Thread Anurup M
1. Add nodes for hip06 L3 cache to support uncore events.
2. Add nodes for hip06 MN to support uncore events.
3. Add nodes for hip06 DDRC to support uncore events.

Signed-off-by: Anurup M 
Signed-off-by: Shaokun Zhang 
Signed-off-by: John Garry 
---
 arch/arm64/boot/dts/hisilicon/hip06.dtsi | 116 +++
 1 file changed, 116 insertions(+)

diff --git a/arch/arm64/boot/dts/hisilicon/hip06.dtsi 
b/arch/arm64/boot/dts/hisilicon/hip06.dtsi
index cb9e018..9ff3afe 100644
--- a/arch/arm64/boot/dts/hisilicon/hip06.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hip06.dtsi
@@ -980,6 +980,122 @@
status = "disabled";
};
 
+   djtag0: djtag@6001 {
+   compatible = "hisilicon,hip06-cpu-djtag-v1";
+   reg = <0x0 0x6001 0x0 0x1>;
+
+   /* L3 cache for socket0 CPU die scl#2 */
+   pmul3c0 {
+   compatible = "hisilicon,hisi-pmu-l3c-v1";
+   scl-id = <0x02>;
+   num-events = <0x16>;
+   num-counters = <0x08>;
+   module-id = <0x04 0x04 0x04 0x04>;
+   num-banks = <0x04>;
+   cfgen-map = <0x02 0x04 0x01 0x08>;
+   counter-reg = <0x170>;
+   evctrl-reg = <0x04>;
+   event-en = <0x100>;
+   evtype-reg = <0x140>;
+   };
+
+   /* Miscellaneous node for socket0
+* CPU die scl#2
+*/
+   pmumn0 {
+   compatible = "hisilicon,hisi-pmu-mn-v1";
+   scl-id = <0x02>;
+   num-events = <0x09>;
+   num-counters = <0x04>;
+   module-id = <0x0b>;
+   cfgen-map = <0x01>;
+   counter-reg = <0x30>;
+   evctrl-reg = <0x40>;
+   event-en = <0x01>;
+   evtype-reg = <0x48>;
+   };
+   };
+
+   djtag1: djtag@4001 {
+   compatible = "hisilicon,hip06-cpu-djtag-v1";
+   reg = <0x0 0x4001 0x0 0x1>;
+
+   /* L3 cache for socket0 CPU die scl#1 */
+   pmul3c1 {
+   compatible = "hisilicon,hisi-pmu-l3c-v1";
+   scl-id = <0x01>;
+   num-events = <0x16>;
+   num-counters = <0x08>;
+   module-id = <0x04 0x04 0x04 0x04>;
+   num-banks = <0x04>;
+   cfgen-map = <0x02 0x04 0x01 0x08>;
+   counter-reg = <0x170>;
+   evctrl-reg = <0x04>;
+   event-en = <0x100>;
+   evtype-reg = <0x140>;
+   };
+
+   /* Miscellaneous node for socket0
+* CPU die scl#1
+*/
+   pmumn1 {
+   compatible = "hisilicon,hisi-pmu-mn-v1";
+   scl-id = <0x01>;
+   num-events = <0x09>;
+   num-counters = <0x04>;
+   module-id = <0x0b>;
+   cfgen-map = <0x01>;
+   counter-reg = <0x30>;
+   evctrl-reg = <0x40>;
+   event-en = <0x01>;
+   evtype-reg = <0x48>;
+   };
+   };
+
+   /* DDRC for CPU die scl #1 Channel #0 */
+   pmu_sccl0_ddrc0: pmu_ddrc0@40348000 {
+   compatible = "hisilicon,hisi-pmu-ddrc-v1";
+   scl-id = <0x01>;
+   ch-id = <0x0>;
+   num-events = <0x0d>;
+   num-counters = <0x04>;
+   reg = <0x0 0x40348000 0x0 0x1>; /* TOTEMA DDRC0 */
+   status = "okay";
+   };
+
+   /* DDRC for CPU die scl #1 Channel #1 */
+   pmu_sccl0_ddrc1: pmu_ddrc1@40358000 {
+   compatible = "hisilicon,hisi-pmu-ddrc-v1";
+   scl-id = <0x01>;
+   ch-id = <0x01>;
+   num-events = <0x0d>;
+   num-counters = <0x04>;
+   

[RESEND PATCH v1 09/11] perf: hisi: Miscellanous node(MN) event counting in perf

2016-11-02 Thread Anurup M
From: Shaokun Zhang 

1. Add support to count MN hardware events.
2. Mn events are listed in sysfs at /sys/devices/hisi_mn2/events/
   The events can be selected as shown in perf list
   e.g.: For MN_READ_REQUEST event for Super CPU cluster 2 the
event format is
-e "hisi_mn2/read_req/"

Signed-off-by: Shaokun Zhang 
Signed-off-by: Anurup M 
---
 drivers/perf/hisilicon/Makefile |   2 +-
 drivers/perf/hisilicon/hisi_uncore_mn.c | 571 
 drivers/perf/hisilicon/hisi_uncore_mn.h |  68 
 3 files changed, 640 insertions(+), 1 deletion(-)
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_mn.c
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_mn.h

diff --git a/drivers/perf/hisilicon/Makefile b/drivers/perf/hisilicon/Makefile
index e1766cf..8975104 100644
--- a/drivers/perf/hisilicon/Makefile
+++ b/drivers/perf/hisilicon/Makefile
@@ -1 +1 @@
-obj-$(CONFIG_HISI_PMU) += hisi_uncore_pmu.o hisi_uncore_l3c.o
+obj-$(CONFIG_HISI_PMU) += hisi_uncore_pmu.o hisi_uncore_l3c.o hisi_uncore_mn.o
diff --git a/drivers/perf/hisilicon/hisi_uncore_mn.c 
b/drivers/perf/hisilicon/hisi_uncore_mn.c
new file mode 100644
index 000..920e346
--- /dev/null
+++ b/drivers/perf/hisilicon/hisi_uncore_mn.c
@@ -0,0 +1,571 @@
+/*
+ * HiSilicon SoC MN Hardware event counters support
+ *
+ * Copyright (C) 2016 Huawei Technologies Limited
+ * Author: Shaokun Zhang 
+ *
+ * This code is based on the uncore PMU's like arm-cci and
+ * arm-ccn.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see .
+ */
+#include 
+#include 
+#include 
+#include 
+#include "hisi_uncore_mn.h"
+
+static inline int hisi_mn_counter_valid(int idx)
+{
+   return (idx >= HISI_IDX_MN_COUNTER0 &&
+   idx <= HISI_IDX_MN_COUNTER_MAX);
+}
+
+static u32 hisi_read_mn_counter(struct hisi_mn_data *mn_hwmod_data,
+   int idx)
+{
+   u32 module_id = mn_hwmod_data->mn_hwcfg.module_id;
+   struct hisi_djtag_client *client = mn_hwmod_data->client;
+   u32 cfg_en, reg_offset, value;
+
+   cfg_en = mn_hwmod_data->mn_hwcfg.bank_cfgen;
+   reg_offset = mn_hwmod_data->mn_hwcfg.counter_reg0_off + (idx * 4);
+
+   hisi_djtag_readreg(module_id,
+   cfg_en,
+   reg_offset,
+   client, );
+
+   return value;
+}
+
+static u64 hisi_mn_event_update(struct perf_event *event,
+   struct hw_perf_event *hwc, int idx)
+{
+   struct hisi_pmu *pmn_pmu = to_hisi_pmu(event->pmu);
+   struct hisi_mn_data *mn_hwmod_data;
+   u64 delta, prev_raw_count, new_raw_count = 0;
+   u32 cfg_en;
+
+   if (!hisi_mn_counter_valid(idx)) {
+   dev_err(pmn_pmu->dev,
+   "Unsupported event index:%d!\n", idx);
+   return 0;
+   }
+
+   mn_hwmod_data = pmn_pmu->hwmod_data;
+
+   /* Check if the MN data is initialized for this SCCL */
+   if (!mn_hwmod_data->client) {
+   dev_err(pmn_pmu->dev,
+   "SCL=%d not initialized!\n", pmn_pmu->scl_id);
+   return 0;
+   }
+
+   cfg_en = mn_hwmod_data->mn_hwcfg.bank_cfgen;
+
+   do {
+   prev_raw_count = local64_read(>prev_count);
+   new_raw_count =
+   hisi_read_mn_counter(mn_hwmod_data, idx);
+   delta = (new_raw_count - prev_raw_count) &
+   HISI_MAX_PERIOD;
+
+   local64_add(delta, >count);
+   } while (local64_cmpxchg(
+   >prev_count, prev_raw_count, new_raw_count) !=
+   prev_raw_count);
+
+   return new_raw_count;
+}
+
+static void hisi_set_mn_evtype(struct hisi_pmu *pmn_pmu, int idx, u32 val)
+{
+   struct hisi_djtag_client *client;
+   struct hisi_mn_data *mn_hwmod_data = pmn_pmu->hwmod_data;
+   u32 reg_offset = mn_hwmod_data->mn_hwcfg.evtype_reg0_off;
+   u32 module_id = mn_hwmod_data->mn_hwcfg.module_id;
+   u32 cfg_en, event_value, value = 0;
+
+   event_value = (val -
+   HISI_HWEVENT_MN_EO_BARR_REQ);
+
+   /* Value to write to 

[RESEND PATCH v1 03/11] drivers: soc: hisi: Add support for Hisilicon Djtag driver

2016-11-02 Thread Anurup M
From: Tan Xiaojun 

The Hisilicon Djtag is an independent component which connects
with some other components in the SoC by Debug Bus. This driver
can be configured to access the registers of connecting components
(like L3 cache) during real time debugging.

Signed-off-by: Tan Xiaojun 
Signed-off-by: John Garry 
Signed-off-by: Anurup M 
---
 drivers/soc/Kconfig |   1 +
 drivers/soc/Makefile|   1 +
 drivers/soc/hisilicon/Kconfig   |  12 +
 drivers/soc/hisilicon/Makefile  |   1 +
 drivers/soc/hisilicon/djtag.c   | 639 
 include/linux/soc/hisilicon/djtag.h |  38 +++
 6 files changed, 692 insertions(+)
 create mode 100644 drivers/soc/hisilicon/Kconfig
 create mode 100644 drivers/soc/hisilicon/Makefile
 create mode 100644 drivers/soc/hisilicon/djtag.c
 create mode 100644 include/linux/soc/hisilicon/djtag.h

diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
index e6e90e8..89ecd42 100644
--- a/drivers/soc/Kconfig
+++ b/drivers/soc/Kconfig
@@ -3,6 +3,7 @@ menu "SOC (System On Chip) specific Drivers"
 source "drivers/soc/bcm/Kconfig"
 source "drivers/soc/fsl/qbman/Kconfig"
 source "drivers/soc/fsl/qe/Kconfig"
+source "drivers/soc/hisilicon/Kconfig"
 source "drivers/soc/mediatek/Kconfig"
 source "drivers/soc/qcom/Kconfig"
 source "drivers/soc/rockchip/Kconfig"
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
index 50c23d0..ce2beb5 100644
--- a/drivers/soc/Makefile
+++ b/drivers/soc/Makefile
@@ -6,6 +6,7 @@ obj-y   += bcm/
 obj-$(CONFIG_ARCH_DOVE)+= dove/
 obj-$(CONFIG_MACH_DOVE)+= dove/
 obj-y  += fsl/
+obj-$(CONFIG_ARCH_HISI)+= hisilicon/
 obj-$(CONFIG_ARCH_MEDIATEK)+= mediatek/
 obj-$(CONFIG_ARCH_QCOM)+= qcom/
 obj-$(CONFIG_ARCH_RENESAS) += renesas/
diff --git a/drivers/soc/hisilicon/Kconfig b/drivers/soc/hisilicon/Kconfig
new file mode 100644
index 000..6dd4ba0
--- /dev/null
+++ b/drivers/soc/hisilicon/Kconfig
@@ -0,0 +1,12 @@
+#
+# Hisilicon SoC drivers
+#
+config HISI_DJTAG
+   bool "Hisilicon Djtag Support"
+   depends on ARCH_HISI || COMPILE_TEST
+   help
+ Say y here to enable the Hisilicon Djtag support. It is
+ an independent component which connects with some other
+ components in the SoC by Debug Bus. This driver can be
+ configured to access the registers of connecting
+ components during real time debugging.
diff --git a/drivers/soc/hisilicon/Makefile b/drivers/soc/hisilicon/Makefile
new file mode 100644
index 000..35a7b4b
--- /dev/null
+++ b/drivers/soc/hisilicon/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_HISI_DJTAG)   += djtag.o
diff --git a/drivers/soc/hisilicon/djtag.c b/drivers/soc/hisilicon/djtag.c
new file mode 100644
index 000..a87c8b6
--- /dev/null
+++ b/drivers/soc/hisilicon/djtag.c
@@ -0,0 +1,639 @@
+/*
+ * Driver for Hisilicon Djtag r/w via System Controller.
+ *
+ * Copyright (C) 2016 Hisilicon Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define SC_DJTAG_TIMEOUT   10  /* 100ms */
+
+/* for djtag v1 */
+#define SC_DJTAG_MSTR_EN   0x6800
+#define DJTAG_NOR_CFG  BIT(1)  /* accelerate R,W */
+#define DJTAG_MSTR_EN  BIT(0)
+#define SC_DJTAG_MSTR_START_EN 0x6804
+#define DJTAG_MSTR_START_EN0x1
+#define SC_DJTAG_DEBUG_MODULE_SEL  0x680c
+#define SC_DJTAG_MSTR_WR   0x6810
+#define DJTAG_MSTR_W   0x1
+#define DJTAG_MSTR_R   0x0
+#define SC_DJTAG_CHAIN_UNIT_CFG_EN 0x6814
+#define CHAIN_UNIT_CFG_EN  0x
+#define SC_DJTAG_MSTR_ADDR 0x6818
+#define SC_DJTAG_MSTR_DATA 0x681c
+#define SC_DJTAG_RD_DATA_BASE  0xe800
+
+/* for djtag v2 */
+#define SC_DJTAG_SEC_ACC_EN_EX 0xd800
+#define DJTAG_SEC_ACC_EN_EX0x1
+#define SC_DJTAG_MSTR_CFG_EX   0xd818
+#define DJTAG_MSTR_RW_SHIFT_EX 29
+#define DJTAG_MSTR_RD_EX   (0x0 << DJTAG_MSTR_RW_SHIFT_EX)
+#define DJTAG_MSTR_WR_EX   (0x1 << DJTAG_MSTR_RW_SHIFT_EX)
+#define DEBUG_MODULE_SEL_SHIFT_EX  16
+#define CHAIN_UNIT_CFG_EN_EX   0x
+#define SC_DJTAG_MSTR_ADDR_EX  0xd810
+#define SC_DJTAG_MSTR_DATA_EX  0xd814
+#define SC_DJTAG_MSTR_START_EN_EX  0xd81c
+#define DJTAG_MSTR_START_EN_EX 0x1
+#define SC_DJTAG_RD_DATA_BASE_EX   0xe800
+#define SC_DJTAG_OP_ST_EX  0xe828
+#define DJTAG_OP_DONE_EX 

[RESEND PATCH v1 04/11] Documentation: perf: hisi: Documentation for HIP05/06/07 PMU event counting.

2016-11-02 Thread Anurup M
Documentation for perf usage and Hisilicon SoC PMU uncore events.
The Hisilicon SOC has event counters for hardware modules like
L3 cache, Miscellaneous node, DDR cntroller etc. These events are
all uncore.

Signed-off-by: Anurup M 
Signed-off-by: Shaokun Zhang 
---
 Documentation/perf/hisi-pmu.txt | 80 +
 1 file changed, 80 insertions(+)
 create mode 100644 Documentation/perf/hisi-pmu.txt

diff --git a/Documentation/perf/hisi-pmu.txt b/Documentation/perf/hisi-pmu.txt
new file mode 100644
index 000..670a9df
--- /dev/null
+++ b/Documentation/perf/hisi-pmu.txt
@@ -0,0 +1,80 @@
+Hisilicon SoC PMU (Performance Monitoring Unit)
+
+The Hisilicon SoC hip05/06/07 chips consist of varous independent system
+device PMU's such as L3 cache(L3C), Miscellaneous Nodes(MN) and DDR
+controllers. These PMU devices are independent and have hardware logic to
+gather statistics and performance information.
+
+Hip0x chips are encapsulated by multiple CPU and IO die's. The CPU die is
+called as Super CPU cluster (SCCL) which includes 16 cpu-cores. Every SCCL
+is further grouped as CPU clusters (CCL) which includes 4 cpu-cores each.
+Each SCCL has 1 L3 cache and 1 MN units.
+
+The L3 cache is shared by all CPU cores in a CPU die. The L3C has four banks
+(or instances). Each bank or instance of L3C has Eight 32-bit counter
+registers. The hip05/06 chip L3 cache has 22 statistics events. The hip07
+chip has 66 statistics events. These events are very useful for debugging.
+
+The MN module is also shared by all CPU cores in a CPU die. It receives
+barriers and DVM(Distributed Virtual Memory) messages from cpu or smmu, and
+perform the required actions and return response messages. These events are
+very useful for debugging. The MN has total 9 statistics events and support
+four 32-bit counter registers in hip05/06/07 chips.
+
+The DDR conroller supports various statistics events. Every SCCL has fot 2
+DDR channels and hence 2 DDR controllers. The Hip05/06/07 has support for a
+total of 13 statistics events.
+
+There is no memory mapping for L3 cache and MN registers. It can be accessed
+by using the Hisilicon djtag interface. The Djtag in a SCCL is an independent
+module which connects with some modules in the SoC by Debug Bus.
+
+Hisilicon SoC (hip05/06/07) PMU driver
+--
+The hip0x PMU driver shall register perf PMU drivers like L3 cache, MN, DDRC
+etc.
+Separate PMU shall be registered for L3 cache and MN for each Super CPU
+cluster.
+For DRR controller separate PMU shall be registered for each channel in a
+Super CPU cluster.
+
+The available events and configuration options shall be described in the sysfs.
+The "perf list" shall list the available events from sysfs.
+eg. hisi_l3c2/read_allocate/ [kernel PMU event]
+
+The Super Cluster ID will be the number suffix to PMU name
+e.g. hisi_l3c2. Here Super cluster ID is 2 and so hisi_l3c2/read_allocate
+is the event for read_allocate of SCCL #2.
+
+For DDRC the channel number will be suffix at the end.
+eg: hisi_ddrc2_0/flux_read/. Here Super cluster ID is 2 and the channel number
+is 0 for the event flux_read.
+
+The event code is represented by 12 bits.
+   i) event 0-11
+   The event code will be represented using the LSB 12 bits.
+
+The driver also provides a "cpumask" sysfs attribute, which shows the CPU core
+ID used to count the uncore PMU event.
+
+Example usage of perf:
+$# perf list
+hisi_l3c2/read_hit/ [kernel PMU event]
+hisi_l3c2/write_hit/ [kernel PMU event]
+--
+hisi_l3c1/read_hit/ [kernel PMU event]
+hisi_l3c1/write_hit/ [kernel PMU event]
+--
+hisi_mn2/read_req/ [kernel PMU event]
+hisi_mn2/write_req/ [kernel PMU event]
+--
+hisi_ddrc2_0/flux_read/ [kernel PMU event]
+--
+
+$# perf stat -a -e hisi_l3c2/read_allocate/ sleep 5
+
+The current driver doesnot support sampling. so "perf record" is unsupported.
+Also attach to a task is unsupported as the events are all uncore.
+
+Note: Please contact the maintainer for a complete list of events supported for
+the PMU devices in the SoC and its information if needed.
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RESEND PATCH v1 07/11] perf: hisi: Add support for Hisilicon SoC event counters

2016-11-02 Thread Anurup M
1. Hip05/06/07 uncore PMU to support different hardware
   event counters.
2. Hisilicon PMU shall use the DJTAG hardware interface
   to access hardware event counters and configuration
   register.
3. Routines to initialize and setup PMU.
4. Routines to enable/disable/add/del/start/stop hardware
   event counting.
5. Add support to count L3 cache hardware events.

Signed-off-by: Anurup M 
Signed-off-by: Shaokun Zhang 
Signed-off-by: John Garry 
---
 drivers/perf/Makefile|   1 +
 drivers/perf/hisilicon/Makefile  |   1 +
 drivers/perf/hisilicon/hisi_uncore_l3c.c | 571 +++
 drivers/perf/hisilicon/hisi_uncore_l3c.h |  67 
 drivers/perf/hisilicon/hisi_uncore_pmu.c | 331 ++
 drivers/perf/hisilicon/hisi_uncore_pmu.h | 108 ++
 6 files changed, 1079 insertions(+)
 create mode 100644 drivers/perf/hisilicon/Makefile
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_l3c.c
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_l3c.h
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_pmu.c
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_pmu.h

diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile
index b116e98..061f229 100644
--- a/drivers/perf/Makefile
+++ b/drivers/perf/Makefile
@@ -1,2 +1,3 @@
 obj-$(CONFIG_ARM_PMU) += arm_pmu.o
 obj-$(CONFIG_XGENE_PMU) += xgene_pmu.o
+obj-$(CONFIG_HISI_PMU) += hisilicon/
diff --git a/drivers/perf/hisilicon/Makefile b/drivers/perf/hisilicon/Makefile
new file mode 100644
index 000..e1766cf
--- /dev/null
+++ b/drivers/perf/hisilicon/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_HISI_PMU) += hisi_uncore_pmu.o hisi_uncore_l3c.o
diff --git a/drivers/perf/hisilicon/hisi_uncore_l3c.c 
b/drivers/perf/hisilicon/hisi_uncore_l3c.c
new file mode 100644
index 000..f78f7b2
--- /dev/null
+++ b/drivers/perf/hisilicon/hisi_uncore_l3c.c
@@ -0,0 +1,571 @@
+/*
+ * HiSilicon SoC L3C Hardware event counters support
+ *
+ * Copyright (C) 2016 Huawei Technologies Limited
+ * Author: Anurup M 
+ *
+ * This code is based on the uncore PMU's like arm-cci and
+ * arm-ccn.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see .
+ */
+#include 
+#include 
+#include 
+#include 
+#include "hisi_uncore_l3c.h"
+
+static inline int hisi_l3c_counter_valid(int idx)
+{
+   return (idx >= HISI_IDX_L3C_COUNTER0 &&
+   idx <= HISI_IDX_L3C_COUNTER_MAX);
+}
+
+static u32 hisi_read_l3c_counter(struct hisi_l3c_data *l3c_hwmod_data,
+   int cntr_idx, int bank_idx)
+{
+   struct hisi_djtag_client *client = l3c_hwmod_data->client;
+   u32 module_id = l3c_hwmod_data->l3c_hwcfg.module_id[bank_idx];
+   u32 cfg_en = l3c_hwmod_data->l3c_hwcfg.bank_cfgen[bank_idx];
+   u32 reg_offset, value;
+
+   reg_offset = l3c_hwmod_data->l3c_hwcfg.counter_reg0_off +
+   (cntr_idx * 4);
+
+   hisi_djtag_readreg(module_id, cfg_en, reg_offset, client, );
+
+   return value;
+}
+
+static u64 hisi_l3c_event_update(struct perf_event *event,
+   struct hw_perf_event *hwc, int idx)
+{
+   struct hisi_pmu *pl3c_pmu = to_hisi_pmu(event->pmu);
+   struct hisi_l3c_data *l3c_hwmod_data = pl3c_pmu->hwmod_data;
+   u64 delta, prev_raw_count, total_raw_count = 0, avg_raw_count = 0;
+   u32 num_banks = l3c_hwmod_data->l3c_hwcfg.num_banks;
+   int i;
+
+   if (!hisi_l3c_counter_valid(idx)) {
+   dev_err(pl3c_pmu->dev, "Unsupported event index:%d!\n", idx);
+   return 0;
+   }
+
+   /* Check if the L3C data is initialized for this SCCL */
+   if (!l3c_hwmod_data->client) {
+   dev_err(pl3c_pmu->dev, "SCL=%d not initialized!\n",
+   pl3c_pmu->scl_id);
+   return 0;
+   }
+
+   do {
+   /* Get count from individual L3C banks and sum them up */
+   for (i = 0; i < num_banks; i++) {
+   total_raw_count += hisi_read_l3c_counter(l3c_hwmod_data,
+   idx, i);
+   }
+   prev_raw_count = local64_read(>prev_count);
+
+   /*
+  

[RESEND PATCH v1 05/11] dt-bindings: perf: hisi: Add Devicetree bindings for Hisilicon SoC PMU

2016-11-02 Thread Anurup M
1) Device tree bindings for Hisilicon SoC PMU.
2) Add example for Hisilicon L3 cache, MN and DDRC PMU.

Signed-off-by: Anurup M 
Signed-off-by: Shaokun Zhang 
---
 .../devicetree/bindings/arm/hisilicon/pmu.txt  | 127 +
 1 file changed, 127 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/hisilicon/pmu.txt

diff --git a/Documentation/devicetree/bindings/arm/hisilicon/pmu.txt 
b/Documentation/devicetree/bindings/arm/hisilicon/pmu.txt
new file mode 100644
index 000..e7b35e0
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/hisilicon/pmu.txt
@@ -0,0 +1,127 @@
+Hisilicon SoC hip05/06/07 ARMv8 PMU
+===
+
+The Hisilicon SoC chips like hip05/06/07 etc. consist of varous independent
+system device PMU's such as L3 cache (L3C), Miscellaneous Nodes(MN) and DDR
+comtroller. These PMU devices are independent and have hardware logic to
+gather statistics and performance information.
+
+HiSilicon SoC chip is encapsulated by multiple CPU and IO die's. The CPU die
+is called as Super CPU cluster (SCCL) which includes 16 cpu-cores. Every SCCL
+is further grouped as CPU clusters (CCL) which includes 4 cpu-cores each.
+e.g. In the case of hip05/06/07, each SCCL has 1 L3 cache and 1 MN PMU device.
+
+The Hisilicon SoC PMU DT node bindigs for uncore PMU devices are as below.
+For PMU devices like L3 cache. MN etc. which are accessed using the djtag,
+the parent node will be the djtag node of the corresponding CPU die(SCCL).
+
+For uncore PMU devices there are some common required properties as detailed
+below.
+
+Required properties:
+   - compatible : This field contain two values. The first value is
+   always "hisilicon" and second value is the Module type as shown
+   in below examples:
+   (a) "hisilicon,hisi-pmu-l3c-v1" for Hisilicon SoC L3C PMU
+   device (Version 1)
+   (b) "hisilicon,hisi-pmu-mn-v1" for Hisilicon SoC MN PMU
+   device (Version 1)
+   (c) "hisilicon,hisi-pmu-ddrc-v1" for Hisilicon SoC DDRC PMU
+   device (Version 1)
+   The hip05/06/07 chips have v1 hardware for L3C, MN and DDRC.
+
+   - scl-id : The Super Cluster ID. This can be the ID of the CPU die
+  or IO die in the chip.
+
+   - num-events : No of events supported by this PMU device.
+
+   - num-counters : No of hardware counters available for counting.
+
+L3 cache
+
+The L3 cache is dedicated for each SCCL and hence there are separate DT nodes
+for L3 cache for each SCCL. For L3 cache PMU the additional required properties
+are
+   - counter-reg : Counter register offset.
+
+   - evtype-reg : Event select register offset.
+
+   - evctrl-reg : Event counting control(LAUCTRL) register offset.
+
+   - event-en : Event enable value.
+
+   - module-id : Module ID to input for djtag. This property is an array of
+ module_id for each L3 cache banks.
+
+   - num-banks : Number of banks or instances of the device.
+
+   - cfgen-map : Config enable array to select the bank.
+
+Miscellaneous Node
+---
+The MN is dedicated for each SCCL and hence there are separate DT nodes for MN
+for each SCCL. For MN PMU the additional required properties are
+   - counter-reg : Counter register offset.
+
+   - evtype-reg : Event select register offset.
+
+   - evctrl-reg : Event counting control register offset.
+
+   - module-id : Module ID to input for djtag. As MN doesnot have multiple 
banks
+ this property is a single value.
+
+   - cfgen-map : Config enable to select the bank. For MN it is a single 
value
+
+   - event-en : Event enable value.
+
+Example:
+
+   djtag0: djtag@0 {
+   compatible = "hisilicon,hip05-cpu-djtag-v1";
+   pmul3c0 {
+   compatible = "hisilicon,hisi-pmu-l3c-v1";
+   scl-id = <0x02>;
+   num-events = <0x16>;
+   num-counters = <0x08>;
+   module-id = <0x04 0x04 0x04 0x04>;
+   num-banks = <0x04>;
+   cfgen-map = <0x02 0x04 0x01 0x08>;
+   counter-reg = <0x170>;
+   evctrl-reg = <0x04>;
+   event-en = <0x100>;
+   evtype-reg = <0x140>;
+   };
+
+   pmumn0 {
+   compatible = "hisilicon,hisi-pmu-mn-v1";
+   scl-id = <0x02>;
+   num-events = <0x09>;
+   num-counters = <0x04>;
+   module-id = <0x0b>;
+   cfgen-map = <0x01>;
+   counter-reg = <0x30>;
+   evctrl-reg = <0x40>;
+ 

[RESEND PATCH v1 02/11] dt-bindings: hisi: Add Hisilicon HiP05/06/07 Sysctrl and Djtag dts bindings

2016-11-02 Thread Anurup M
From: Tan Xiaojun 

1) Add Hisilicon HiP05/06/07 CPU and ALGSUB system controller dts
   bindings.
2) Add Hisilicon Djtag dts binding.

Signed-off-by: Tan Xiaojun 
Signed-off-by: Anurup M 
---
 .../bindings/arm/hisilicon/hisilicon.txt   | 82 ++
 1 file changed, 82 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt 
b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
index 7df79a7..341cbb9 100644
--- a/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
+++ b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
@@ -270,3 +270,85 @@ Required Properties:
   [1]: bootwrapper size
   [2]: relocation physical address
   [3]: relocation size
+
+---
+The Hisilicon Djtag in CPU die is an independent component which connects with
+some other components in the SoC by Debug Bus. This driver can be configured
+to access the registers of connecting components (like L3 cache, l3 cache PMU
+ etc.) during real time debugging by sysctrl. These components appear as child
+nodes of djtag.
+
+The Hip05/06/07 CPU system controller(sysctrl) support to manage some important
+components (such as clock, reset, soft reset, secure debugger, etc.).
+The CPU sysctrl registers in hip05/06/07 doesnot use syscon but will be mapped
+by djtag driver for use by connecting components.
+
+Hisilicon HiP05 CPU system controller
+Required properties:
+  - compatible : "hisilicon,hip05-cpu-djtag-v1"
+  - reg : Register address and size
+
+Hisilicon HiP06 djtag for CPU sysctrl
+Required properties:
+- compatible : "hisilicon,hip06-sysctrl", "syscon", "simple-mfd";
+- reg : Register address and size
+- djtag :
+  - compatible : "hisilicon,hip06-cpu-djtag-v1"
+  - reg : Register address and size
+
+Hisilicon HiP07 djtag for CPU sysctrl
+Required properties:
+  - compatible : "hisilicon,hip07-cpu-djtag-v2"
+  - reg : Register address and size
+
+Example:
+   /* for Hisilicon HiP05 djtag for CPU sysctrl */
+   djtag0: djtag@8001 {
+   compatible = "hisilicon,hip05-cpu-djtag-v1";
+   reg = <0x0 0x8001 0x0 0x1>;
+
+   /* For L3 cache PMU */
+   pmul3c0 {
+   compatible = "hisilicon,hisi-pmu-l3c-v1";
+   scl-id = <0x02>;
+   num-events = <0x16>;
+   num-counters = <0x08>;
+   module-id = <0x04>;
+   num-banks = <0x04>;
+   cfgen-map = <0x02 0x04 0x01 0x08>;
+   counter-reg = <0x170>;
+   evctrl-reg = <0x04>;
+   event-en = <0x100>;
+   evtype-reg = <0x140>;
+   };
+   };
+
+---
+The Hisilicon HiP05/06/07 ALGSUB system controller(sysctrl) is in IO die
+of SoC. It has a similar function as the Hisilicon HiP05/06/07 CPU system
+controller in CPU die and it manage different components, like RSA, etc.
+The Hisilicon Djtag in IO die has a similar function as in CPU die and maps
+the sysctrl registers for use by connecting components.
+All connecting components shall appear as child nodes of djtag.
+
+Hisilicon HiP05 djtag for ALGSUB sysctrl
+Required properties:
+  - compatible : "hisilicon,hip05-io-djtag-v1"
+  - reg : Register address and size
+
+Hisilicon HiP06 djtag for ALGSUB sysctrl
+Required properties:
+  - compatible : "hisilicon,hip06-io-djtag-v2"
+  - reg : Register address and size
+
+Hisilicon HiP07 djtag for ALGSUB sysctrl
+Required properties:
+  - compatible : "hisilicon,hip07-io-djtag-v2"
+  - reg : Register address and size
+
+Example:
+   /* for Hisilicon HiP05 djtag for alg sysctrl */
+   djtag0: djtag@d000 {
+  compatible = "hisilicon,hip05-io-djtag-v1";
+   reg = <0x0 0xd000 0x0 0x1>;
+   };
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RESEND PATCH v1 06/11] perf: hisi: Update Kconfig for Hisilicon PMU support

2016-11-02 Thread Anurup M
1. Update Kconfig for Hip05/06/07 PMU support.

Signed-off-by: Anurup M 
Signed-off-by: Shaokun Zhang 
Signed-off-by: John Garry 
---
 drivers/perf/Kconfig | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig
index 4d5c5f9..da8dd97 100644
--- a/drivers/perf/Kconfig
+++ b/drivers/perf/Kconfig
@@ -19,4 +19,13 @@ config XGENE_PMU
 help
   Say y if you want to use APM X-Gene SoC performance monitors.
 
+config HISI_PMU
+   bool "Enable hardware event counter support for HiSilicon SoC"
+   depends on HW_PERF_EVENTS && ARM64
+   depends on HISI_DJTAG
+   help
+ Enable hardware event counter support for hardware event counters
+ in Hisilicon hip05/06/07 SoC. The hardware modules like L3C, MN and
+ DDRC have hardware events and counters.
+
 endmenu
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RESEND PATCH v1 01/11] arm64: MAINTAINERS: hisi: Add hisilicon SoC PMU support

2016-11-02 Thread Anurup M
Add support for Hisilicon SoC hardware event counters
for HIP05/06/07 chip versions.

Signed-off-by: Anurup M 
---
 MAINTAINERS | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index b224caa..839abc8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5725,6 +5725,16 @@ S:   Maintained
 F: drivers/net/ethernet/hisilicon/
 F: Documentation/devicetree/bindings/net/hisilicon*.txt
 
+HISILICON SOC PMU
+M: Anurup M 
+W: http://www.hisilicon.com
+S: Supported
+F: drivers/perf/hisilicon/*
+F: drivers/soc/hisilicon/djtag.c
+F: include/linux/soc/hisilicon/djtag.h
+F: Documentation/perf/hisi-pmu.txt
+F: Documentation/devicetree/bindings/arm/hisilicon/pmu.txt
+
 HISILICON ROCE DRIVER
 M: Lijun Ou 
 M: Wei Hu(Xavier) 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RESEND PATCH v1 00/11] perf: arm64: Support for Hisilicon SoC Hardware event counters

2016-11-02 Thread Anurup M
[Resending after adding maintainers in --to]

Provide Support for Hisilicon SoC(Hip05/06/07) Hardware event counters.
The Hisilicon SoC Hip0x series has many uncore or non-CPU performance
events and counters units.

This initial patch series is implemented refering to arm-cci, Intel/AMD uncore 
and
also the cavium thunderX and xgene uncore pmu patches.

Support for Hisilicon L3 cache(L3C), MN and DDR hardware events and
counters are added in this implementation.

The Hisilicon uncore PMUs can be found under /sys/bus/event_source/devices.
The counters are exported via sysfs in the corresponding events files
under the PMU directory so the perf tool can list the event names.

ToDo:
1) The counter overflow handling is currently unsupported in this
   patch series.
2) ACPI support.

Anurup M (8):
  arm64: MAINTAINERS: hisi: Add hisilicon SoC PMU support
  Documentation: perf: hisi: Documentation for HIP05/06/07 PMU event
counting.
  dt-bindings: perf: hisi: Add Devicetree bindings for Hisilicon SoC PMU
  perf: hisi: Update Kconfig for Hisilicon PMU support
  perf: hisi: Add support for Hisilicon SoC event counters
  perf: hisi: Add sysfs attributes for L3 cache(L3C) PMU
  perf: hisi: Support for Hisilicon DDRC PMU.
  dts: arm64: hip06: Add Hisilicon SoC PMU support

Shaokun Zhang (1):
  perf: hisi: Miscellanous node(MN) event counting in perf

Tan Xiaojun (2):
  dt-bindings: hisi: Add Hisilicon HiP05/06/07 Sysctrl and Djtag dts
bindings
  drivers: soc: hisi: Add support for Hisilicon Djtag driver

 .../bindings/arm/hisilicon/hisilicon.txt   |  82 +++
 .../devicetree/bindings/arm/hisilicon/pmu.txt  | 127 
 Documentation/perf/hisi-pmu.txt|  80 +++
 MAINTAINERS|  10 +
 arch/arm64/boot/dts/hisilicon/hip06.dtsi   | 116 
 drivers/perf/Kconfig   |   9 +
 drivers/perf/Makefile  |   1 +
 drivers/perf/hisilicon/Makefile|   1 +
 drivers/perf/hisilicon/hisi_uncore_ddrc.c  | 444 ++
 drivers/perf/hisilicon/hisi_uncore_ddrc.h  |  73 +++
 drivers/perf/hisilicon/hisi_uncore_l3c.c   | 628 
 drivers/perf/hisilicon/hisi_uncore_l3c.h   |  67 +++
 drivers/perf/hisilicon/hisi_uncore_mn.c| 571 ++
 drivers/perf/hisilicon/hisi_uncore_mn.h|  68 +++
 drivers/perf/hisilicon/hisi_uncore_pmu.c   | 371 
 drivers/perf/hisilicon/hisi_uncore_pmu.h   | 130 +
 drivers/soc/Kconfig|   1 +
 drivers/soc/Makefile   |   1 +
 drivers/soc/hisilicon/Kconfig  |  12 +
 drivers/soc/hisilicon/Makefile |   1 +
 drivers/soc/hisilicon/djtag.c  | 639 +
 include/linux/soc/hisilicon/djtag.h|  38 ++
 22 files changed, 3470 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/hisilicon/pmu.txt
 create mode 100644 Documentation/perf/hisi-pmu.txt
 create mode 100644 drivers/perf/hisilicon/Makefile
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_ddrc.c
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_ddrc.h
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_l3c.c
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_l3c.h
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_mn.c
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_mn.h
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_pmu.c
 create mode 100644 drivers/perf/hisilicon/hisi_uncore_pmu.h
 create mode 100644 drivers/soc/hisilicon/Kconfig
 create mode 100644 drivers/soc/hisilicon/Makefile
 create mode 100644 drivers/soc/hisilicon/djtag.c
 create mode 100644 include/linux/soc/hisilicon/djtag.h

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC 0/4] Fix PDF build errors

2016-11-02 Thread Fengguang Wu

On Wed, Nov 02, 2016 at 03:27:50PM +0200, Jani Nikula wrote:

On Wed, 02 Nov 2016, Mauro Carvalho Chehab  wrote:

Em Wed, 02 Nov 2016 13:14:47 +0200
Jani Nikula  escreveu:


On Wed, 02 Nov 2016, Mauro Carvalho Chehab  wrote:
> This series address a series of errors during PDF generation from
> media documentation.
>
> Please notice that patch 2 carries on a PDF conversion from a PNG
> image, because Sphinx is not smart enough to do the convertion.
>
> This is a temporary solution (That's why I'm marking this series
> as RFC).

This seems to work on top of docs-next.


Yes.


...but it'll break again if we include the missing admin-guide in the
build. :(


LaTeX/PDF output is ugly... for each new stuff, we need to re-validate its
output :-(


Once we have this working, I think the only way to keep it working is to
have continuous testing of the pdf build. That won't keep the output
pretty, but it'll help ensure passing build.

Perhaps 0day could eventually start running 'make DOCBOOKS="" pdfdocs'
after the htmldocs target? Cc: Fengguang and kbuild-all.


OK. We'll add the 'pdfdocs' test right after 'htmldocs'.
Thank you for the tip.

Regards,
Fengguang
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] Documentation/HOWTO: Use a more recent gcc + binutils

2016-11-02 Thread Borislav Petkov
On Wed, Nov 02, 2016 at 06:20:57PM +0100, Sebastian Andrzej Siewior wrote:
> Etch (with gcc v4.1.2) gets to compile the kernel without plenty of
> warnings and it also chokes on Wno-override-init but that one could be
> easily fixed if we want to keep v4.1 as the minimum.
> So I think raising the bar to gcc v4.1 isn't that bad given that the
> last release of gcc 4.1 was on February 13, 2007.

You'd need to adjust

#if GCC_VERSION < 30200

in include/linux/compiler-gcc.h.

> 
> Cc: Jonathan Corbet 
> Cc: linux-doc@vger.kernel.org
> Cc: Andrew Morton 
> Signed-off-by: Sebastian Andrzej Siewior 
> ---
>  Documentation/Changes | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/Changes b/Documentation/Changes
> index 22797a15dc24..14e65b445707 100644
> --- a/Documentation/Changes
> +++ b/Documentation/Changes
> @@ -29,9 +29,9 @@ you probably needn't concern yourself with isdn4k-utils.
>  == ===  
> 
>  ProgramMinimal version   Command to check the version
>  == ===  
> 
> -GNU C  3.2  gcc --version
> +GNU C  4.1  gcc --version
>  GNU make   3.80 make --version
> -binutils   2.12 ld -v
> +binutils   2.17 ld -v

That probably would be a good thing as 2.16 is the Binutils Version from
Hell.

-- 
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] Documentation/HOWTO: Use a more recent gcc + binutils

2016-11-02 Thread Sven Joachim
On 2016-11-02 18:20 +0100, Sebastian Andrzej Siewior wrote:

> Debian Woody is pre-gcc3.2 and Sarge ships 3.3 gcc. I tried to compile
> v4.8.6 on Sarge failed due to binutils:
> |arch/x86/entry/entry_32.S: Assembler messages:
> |arch/x86/entry/entry_32.S:379: Error: invalid character '"' in operand 1
> |arch/x86/entry/entry_32.S:454: Error: too many positional arguments
> |arch/x86/entry/entry_32.S:580: Error: too many positional arguments
> |arch/x86/boot/bioscall.S:68: Error: `68(%esp)' is not a valid 16 bit 
> base/index expression
>
> among other errors. Sarge comes with GNU ld version 2.15 with is not
> recent enough. I don't see those errors on Etch which ships version 2.17
> and therefore I raise the limit to 2.17.

I can confirm that binutils 2.16 is not recent enough either, while 2.17
works.

> gcc is a different story. 3.3 It throws a lot of warnings
> |include/linux/irq.h:402: warning: parameter has incomplete type
> |include/linux/irq.h:403: warning: parameter has incomplete type
> |drivers/gpu/drm/i915/i915_gem_gtt.h:312: warning: parameter has incomplete 
> type
>
> during the compile and fails then with
> | cc1: error: unrecognized option `-Wno-override-init'
>
> or later with
>
> |lib/lzo/lzo1x_compress.c: In function `lzo1x_1_do_compress':
> |lib/lzo/lzo1x_compress.c:132: error: implicit declaration of function 
> `__builtin_ctz'
>
> Etch (with gcc v4.1.2) gets to compile the kernel without plenty of
> warnings and it also chokes on Wno-override-init but that one could be
> easily fixed if we want to keep v4.1 as the minimum.
> So I think raising the bar to gcc v4.1 isn't that bad given that the
> last release of gcc 4.1 was on February 13, 2007.

For the record, the -Wno-override-init problem has already been fixed in
4.9-rc3 by commit a2209b742e6 ("x86/build: Fix build with older GCC
versions").

Cheers,
   Sven

> diff --git a/Documentation/Changes b/Documentation/Changes
> index 22797a15dc24..14e65b445707 100644
> --- a/Documentation/Changes
> +++ b/Documentation/Changes
> @@ -29,9 +29,9 @@ you probably needn't concern yourself with isdn4k-utils.
>  == ===  
> 
>  ProgramMinimal version   Command to check the version
>  == ===  
> 
> -GNU C  3.2  gcc --version
> +GNU C  4.1  gcc --version
>  GNU make   3.80 make --version
> -binutils   2.12 ld -v
> +binutils   2.17 ld -v
>  util-linux 2.10ofdformat --version
>  module-init-tools  0.9.10   depmod -V
>  e2fsprogs  1.41.4   e2fsck -V
> -- 
> 2.10.2
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] tpm: transition tpm_vtpm_proxy documentation to the Sphinx

2016-11-02 Thread Jarkko Sakkinen
Transitioned the tpm_vtpm_proxy documentation to the Sphinx
infrastructure and removed parts from the documentation that are easier
to pull from the sources. Restructured vtpm_proxy.h and tpm_vtpm_proxy.c
to be compatible with this approach and wrote associated documentation
comments.

Signed-off-by: Jarkko Sakkinen 
---
 Documentation/index.rst|  1 +
 Documentation/tpm/index.rst|  7 +++
 .../tpm/{tpm_vtpm_proxy.txt => tpm_vtpm_proxy.rst} | 53 +---
 drivers/char/tpm/tpm_vtpm_proxy.c  | 72 ++
 include/uapi/linux/vtpm_proxy.h| 23 +--
 5 files changed, 89 insertions(+), 67 deletions(-)
 create mode 100644 Documentation/tpm/index.rst
 rename Documentation/tpm/{tpm_vtpm_proxy.txt => tpm_vtpm_proxy.rst} (56%)

diff --git a/Documentation/index.rst b/Documentation/index.rst
index e0fc729..0058b65 100644
--- a/Documentation/index.rst
+++ b/Documentation/index.rst
@@ -19,6 +19,7 @@ Contents:
media/dvb-drivers/index
media/v4l-drivers/index
gpu/index
+   tpm/index
 
 Indices and tables
 ==
diff --git a/Documentation/tpm/index.rst b/Documentation/tpm/index.rst
new file mode 100644
index 000..316cdbb
--- /dev/null
+++ b/Documentation/tpm/index.rst
@@ -0,0 +1,7 @@
+=
+TPM documentation
+=
+
+.. toctree::
+
+   tpm_vtpm_proxy
diff --git a/Documentation/tpm/tpm_vtpm_proxy.txt 
b/Documentation/tpm/tpm_vtpm_proxy.rst
similarity index 56%
rename from Documentation/tpm/tpm_vtpm_proxy.txt
rename to Documentation/tpm/tpm_vtpm_proxy.rst
index 30d1902..f991aff 100644
--- a/Documentation/tpm/tpm_vtpm_proxy.txt
+++ b/Documentation/tpm/tpm_vtpm_proxy.rst
@@ -1,71 +1,50 @@
+=
 Virtual TPM Proxy Driver for Linux Containers
+=
 
-Authors: Stefan Berger (IBM)
+| Authors:
+| Stefan Berger 
 
 This document describes the virtual Trusted Platform Module (vTPM)
 proxy device driver for Linux containers.
 
-INTRODUCTION
-
+Introduction
+
 
 The goal of this work is to provide TPM functionality to each Linux
 container. This allows programs to interact with a TPM in a container
 the same way they interact with a TPM on the physical system. Each
 container gets its own unique, emulated, software TPM.
 
-
-DESIGN
---
+Design
+==
 
 To make an emulated software TPM available to each container, the container
 management stack needs to create a device pair consisting of a client TPM
-character device /dev/tpmX (with X=0,1,2...) and a 'server side' file
+character device ``/dev/tpmX`` (with X=0,1,2...) and a 'server side' file
 descriptor. The former is moved into the container by creating a character
 device with the appropriate major and minor numbers while the file descriptor
 is passed to the TPM emulator. Software inside the container can then send
 TPM commands using the character device and the emulator will receive the
 commands via the file descriptor and use it for sending back responses.
 
-To support this, the virtual TPM proxy driver provides a device /dev/vtpmx
+To support this, the virtual TPM proxy driver provides a device ``/dev/vtpmx``
 that is used to create device pairs using an ioctl. The ioctl takes as
 an input flags for configuring the device. The flags  for example indicate
 whether TPM 1.2 or TPM 2 functionality is supported by the TPM emulator.
 The result of the ioctl are the file descriptor for the 'server side'
 as well as the major and minor numbers of the character device that was 
created.
 Besides that the number of the TPM character device is return. If for
-example /dev/tpm10 was created, the number (dev_num) 10 is returned.
-
-The following is the data structure of the TPM_PROXY_IOC_NEW_DEV ioctl:
-
-struct vtpm_proxy_new_dev {
-   __u32 flags; /* input */
-   __u32 tpm_num;   /* output */
-   __u32 fd;/* output */
-   __u32 major; /* output */
-   __u32 minor; /* output */
-};
-
-Note that if unsupported flags are passed to the device driver, the ioctl will
-fail and errno will be set to EOPNOTSUPP. Similarly, if an unsupported ioctl is
-called on the device driver, the ioctl will fail and errno will be set to
-ENOTTY.
-
-See /usr/include/linux/vtpm_proxy.h for definitions related to the public 
interface
-of this vTPM device driver.
+example ``/dev/tpm10`` was created, the number (``dev_num``) 10 is returned.
 
 Once the device has been created, the driver will immediately try to talk
 to the TPM. All commands from the driver can be read from the file descriptor
 returned by the ioctl. The commands should be responded to immediately.
 
-Depending on the version of TPM the following commands will be sent by the
-driver:
+UAPI
+
 
-- TPM 1.2:
-  - the driver will send a TPM_Startup 

Re: Proposing help for documentation

2016-11-02 Thread Luis de Bethencourt
On 02/11/16 17:01, Mauro Carvalho Chehab wrote:
> Em Wed, 02 Nov 2016 16:05:13 +
> Luis de Bethencourt  escreveu:
> 
>> On 02/11/16 10:41, Jani Nikula wrote:
>>> On Wed, 02 Nov 2016, Luis de Bethencourt  wrote:  
 I also offer my help, let me know if you see anything I can do.  
>>>
>>> Luis, Patrice, anyone else out there willing to help: here's a list of
>>> stuff to do, off the top of my head. I'm sure Jon will amend this.
>>>
>>> 0) Some basics first
>>>
>>> Subscribe to linux-doc. Read it.  
>>
>> Subscribed for a while. Reading it more close now.
>>
>>>
>>> Read https://lwn.net/Articles/692705/ and
>>> https://lwn.net/Articles/704613/ if you haven't already.
>>>   
>>
>> Done.
> 
> I also wrote a series of articles at:
>   https://blogs.s-osg.org/new-improved-linux-kernel-media-documentation/
> 
> I intend to write also some articles there about PDF, with seems really 
> tricky to get it right on Sphinx.
> 

Great series of articles. Thanks Mauro!

Please write more about PDF.

>>
>>> Figure out how to build the documentation. Read the part about writing
>>> kernel documentation. Also at
>>> http://static.lwn.net/kerneldoc/kernel-documentation.html.
>>>
>>> For most things under Documentation, you'll want to use the docs-next
>>> branch of git://git.lwn.net/linux.git. That has the latest stuff. If you
>>> use Linus' master, you'll be working on old stuff.
>>>
>>> For fixing kernel-doc source code comments, you'll need to use the
>>> appropriate subsystem tree, see MAINTAINERS.
>>>
>>> In any case, most changes need to be sent to both linux-doc and the
>>> relevant subsystem/driver mailing list. See MAINTAINERS and
>>> scripts/get_maintainer.pl.
>>>
>>> Whatever you do, don't spend forever polishing it privately. Otherwise
>>> someone might beat you to it, and effort will be wasted. Read the list,
>>> maybe someone's already posted patches that just haven't been merged
>>> yet.  
>>
>> Great summary of the development process.
>>
>>>
>>> 1) Build documentation. Look at errors during build, fix them.
>>>
>>> Some of the issues come from source code comments via the kernel-doc
>>> extension; those changes need to go through the appropriate subsystem,
>>> not via the documentation tree. Watch out, some of the things may have
>>> been fixed in the subsystem repo already.
>>>
>>> 2) Build documentation. Read the output, fix issues, improve the
>>> language, improve the presentation. Ditto about source code comments.
>>>
>>> Personally, I think this is both very important and unfortunately
>>> laborous, because this is mostly stuff that Sphinx won't warn about.
>>>   
> 
> I'd complement that you should test the output also for PDF... There are
> some special tags and, sometimes  some spells to make it work.
> 

I see in the patches sent to this mailing list that there are some build
problems with PDF.

>> It is also more rewarding because newcomers get to learn by reading the
>> docs, while also contributing. Win win.
>>
>>> 3) Look at documentation patches on linux-doc, review them, test them,
>>> give feedback.
>>>   
>>
>> I sent this yesterday, mind reviewing it?
>> http://www.spinics.net/lists/linux-doc/msg41297.html
> 
> Nothing wrong with the above patch, but, IMHO, it would be better to 
> only fix such typos on files already converted to ReST, as otherwise
> it could conflict with a patch with someone else would be doing such
> conversion. Just my 2 cents.
> 
> In time: I'm not touching at Documentation/usb.tmpl, or on any other
> DocBook document.
> 

That's a good point. Will keep fixes to the rst files.

>>> 4) Convert DocBook templates under Documentation/DocBook to Sphinx.
>>>
>>> The conversion is actually the easy part; figuring out whether the
>>> documentation is still relevant and where to stick it in the Sphinx
>>> build is harder. Jon may have some vision on this, but personally I'd
>>> like to obliterate DocBook first, and then figure out what to do with
>>> the resulting converted rst documents.
> 
> Markus has a script with helps with such conversion. I guess he actually
> has conversion for everything, but you'll need to dig into the kernel-doc
> markups, as some will break after the conversion.
> 
>>>  
>>
>> Will wait in case Jon wants to add his opinion on this.
>>  
>>> 5) Convert .txt files under Documentation to .rst.
>>>
>>> There are caveats here. Not everything needs to be converted. Some of
>>> the stuff is obsolete, and converting might be wasted effort. Just
>>> converting without updating to reflect current kernels is hazardous,
>>> because the obsolete information will then be more accessible with the
>>> converted documentation on the web.
>>>
>>> People like plain text, don't go overboard with rst markup. Use
>>> discretion.
>>>
>>>
>>> For both 4) and 5) I'd really like the seasoned kernel devs to actively
>>> hand out stuff to willing new hands.
>>>   
>>
>> This is a great point. Greg and others worry 

[PATCH 1/2] Documentation/HOWTO: Use a more recent gcc + binutils

2016-11-02 Thread Sebastian Andrzej Siewior
Debian Woody is pre-gcc3.2 and Sarge ships 3.3 gcc. I tried to compile
v4.8.6 on Sarge failed due to binutils:
|arch/x86/entry/entry_32.S: Assembler messages:
|arch/x86/entry/entry_32.S:379: Error: invalid character '"' in operand 1
|arch/x86/entry/entry_32.S:454: Error: too many positional arguments
|arch/x86/entry/entry_32.S:580: Error: too many positional arguments
|arch/x86/boot/bioscall.S:68: Error: `68(%esp)' is not a valid 16 bit 
base/index expression

among other errors. Sarge comes with GNU ld version 2.15 with is not
recent enough. I don't see those errors on Etch which ships version 2.17
and therefore I raise the limit to 2.17.
gcc is a different story. 3.3 It throws a lot of warnings
|include/linux/irq.h:402: warning: parameter has incomplete type
|include/linux/irq.h:403: warning: parameter has incomplete type
|drivers/gpu/drm/i915/i915_gem_gtt.h:312: warning: parameter has incomplete type

during the compile and fails then with
| cc1: error: unrecognized option `-Wno-override-init'

or later with

|lib/lzo/lzo1x_compress.c: In function `lzo1x_1_do_compress':
|lib/lzo/lzo1x_compress.c:132: error: implicit declaration of function 
`__builtin_ctz'

Etch (with gcc v4.1.2) gets to compile the kernel without plenty of
warnings and it also chokes on Wno-override-init but that one could be
easily fixed if we want to keep v4.1 as the minimum.
So I think raising the bar to gcc v4.1 isn't that bad given that the
last release of gcc 4.1 was on February 13, 2007.

Cc: Jonathan Corbet 
Cc: linux-doc@vger.kernel.org
Cc: Andrew Morton 
Signed-off-by: Sebastian Andrzej Siewior 
---
 Documentation/Changes | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/Changes b/Documentation/Changes
index 22797a15dc24..14e65b445707 100644
--- a/Documentation/Changes
+++ b/Documentation/Changes
@@ -29,9 +29,9 @@ you probably needn't concern yourself with isdn4k-utils.
 == ===  

 ProgramMinimal version   Command to check the version
 == ===  

-GNU C  3.2  gcc --version
+GNU C  4.1  gcc --version
 GNU make   3.80 make --version
-binutils   2.12 ld -v
+binutils   2.17 ld -v
 util-linux 2.10ofdformat --version
 module-init-tools  0.9.10   depmod -V
 e2fsprogs  1.41.4   e2fsck -V
-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Proposing help for documentation

2016-11-02 Thread Markus Heiser

Am 02.11.2016 um 11:41 schrieb Jani Nikula :

> On Wed, 02 Nov 2016, Luis de Bethencourt  wrote:
>> I also offer my help, let me know if you see anything I can do.
> 
> Luis, Patrice, anyone else out there willing to help: here's a list of
> stuff to do, off the top of my head. I'm sure Jon will amend this.
> 
> 4) Convert DocBook templates under Documentation/DocBook to Sphinx.
> 
> The conversion is actually the easy part; figuring out whether the
> documentation is still relevant and where to stick it in the Sphinx
> build is harder. Jon may have some vision on this, but personally I'd
> like to obliterate DocBook first, and then figure out what to do with
> the resulting converted rst documents.

Fore those how are interested in converting DocBook, there
is a *automatic* conversion available, which might be a good
starting point:

https://github.com/return42/sphkerneldoc/tree/master/Documentation/books_migrated

If you need something newer / special contact me.

--Markus
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Documentation/sphinx: make it possible to build latexdocs without pdflatex

2016-11-02 Thread Markus Heiser

Am 02.11.2016 um 10:40 schrieb Jani Nikula :

> Building latexdocs doesn't actually require $(PDFLATEX). Move the checks
> for it to the pdfdocs target which does require it, and specifically
> outside of the target in order to not depend on latexdocs when we can't
> build pdfdocs anyway.

Tested-by: Markus Heiser 

--Markus --

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/3] Documentation/sphinx: change pdflatex interaction mode to batchmode

2016-11-02 Thread Markus Heiser

Am 02.11.2016 um 12:41 schrieb Jani Nikula :

> Radically reduce the noise on stdout. The full build logs will still be
> available under Documentatio/output/latex/*.log.

Tested-by: Markus Heiser 

Thanks!

-- Markus --
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC 0/4] Fix PDF build errors

2016-11-02 Thread Markus Heiser

Am 02.11.2016 um 17:47 schrieb Mauro Carvalho Chehab :

> Em Wed, 2 Nov 2016 17:08:08 +0100
> Markus Heiser  escreveu:
> 
>> Am 02.11.2016 um 12:14 schrieb Jani Nikula :
>> 
>>> On Wed, 02 Nov 2016, Mauro Carvalho Chehab  wrote: 
>>>  
 This series address a series of errors during PDF generation from
 media documentation.
 
 Please notice that patch 2 carries on a PDF conversion from a PNG
 image, because Sphinx is not smart enough to do the convertion.
 
 This is a temporary solution (That's why I'm marking this series
 as RFC).  
>>> 
>>> This seems to work on top of docs-next.
>>> 
>>> ...but it'll break again if we include the missing admin-guide in the
>>> build. :(
>>> Sadly, this breaks the pdf build with:
>>> 
>>> ! TeX capacity exceeded, sorry [main memory size=500].
>>> \FV@Space ...ionary {\copy \sphinxvisiblespacebox
>>> }{\sphinxafterbreak } {\ke...
>>> l.3711 ...\PYG{n}{be} \PYG{n}{used} \PYG{n+nb}{to}
>>> or 2  
>> 
>> 
>> This is the verbatim block of the kernel parameters with more
>> than 4300 lines in.
>> 
>> IMO, Verbatim exceeded, because in sphinx.sty is a redefinition
>> of the LaTeX Verbatim command which might be sloppy / see 
>> sphinx.sty::
>> 
>> \renewcommand{\Verbatim}[1][1]{%
>>   
> 
> Argh! I really hate those ugly hacks that Sphinx do for LaTeX output...
> 
> Btw, I remember I had to touch on a TeXLive style in order to workaround
> the memory size when testing LaTeX output for some book, but it ended by
> causing some other issues.
> 
>> 
>> The renew-Verbatim has been removed later:
>> 
>> https://github.com/sphinx-doc/sphinx/commit/f9880bfcc8b19a7d197badeb6ab412abfca19891
>> 
>> I my POC I use such a modified sphinx.sty
>> 
>> https://github.com/return42/sphkerneldoc/blob/master/_tex/sphinx.sty
>> 
>> with it, the PDF is build:
>> 
>> https://h2626237.stratoserver.net/kernel/books/admin-guide/pdf/linux-user.pdf
>> 
>> Using modified sphinx.sty has the drawback, that it is not
>> up- or downward compatible to the installed Sphinx version.
>> 
>> So in short, I think it is the best to come back to the reasons
>> and just split kernel parameters in several blocks and using the 
>> 'none' option to prevent rendering as C .. E.g:
>> 
>> .. code-block:: none
> 
> I'm staring to think that we should just redefine the default for ::
> to be "none", and use the "C" handling **only** when explicitly
> requested.
> 
> I remember that Jon did such suggestion sometime ago.

*shrug* ... I think about kernel-doc comments in the sources,
mostly you will have small examples and won't those verbose 
".. code-block::" markup / using "::" keeps the comment compact.

> 
> If we change it to "none", it will still spend lots of memory for
> verbatim?

Yes .. we need to split kernel parameter's into smaller verbatime
blocks.




--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] Documentation/sphinx: let the user specify PDFLATEX and LATEXOPTS

2016-11-02 Thread Markus Heiser

Am 02.11.2016 um 10:40 schrieb Jani Nikula :

> Refer to xelatex and latex options via variables. This allows the user
> to override the pdflatex and latex options to use on the make command
> line for experimenting. As a side effect, this makes the makefile a bit
> tidier.
> 
> Signed-off-by: Jani Nikula 
> ---
> Documentation/Makefile.sphinx | 9 ++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
> index 92deea30b183..1314e3ee31c4 100644
> --- a/Documentation/Makefile.sphinx
> +++ b/Documentation/Makefile.sphinx
> @@ -10,6 +10,8 @@ _SPHINXDIRS   = $(patsubst 
> $(srctree)/Documentation/%/conf.py,%,$(wildcard $(src
> SPHINX_CONF   = conf.py
> PAPER =
> BUILDDIR  = $(obj)/output
> +PDFLATEX  = xelatex

IMO, this is not a good idea since it could awakening expectations
we can not fulfill, even not for "experimenting" with 'latex'.

(pdf)latex and xelatex differ in many ways, e.g. pdflatex needs inputenc
and uses babel, while xelatex has utf-8 support and uses polyglossia.

 
http://tex.stackexchange.com/questions/2984/frequently-loaded-packages-differences-between-pdflatex-and-xelatex

Thats why Mauros adds:

+# Don't mangle with UTF-8 chars
+'inputenc': '',
+'utf8extra': '',
+

to the conf.py 

 https://www.mail-archive.com/linux-doc@vger.kernel.org/msg05182.html

Further IMO this way to use xelatex is just a "ugly hack", sphinx
itself has no xelatex support. E.g. the sphinx team added 
polyglossia only now:

 
https://github.com/sphinx-doc/sphinx/commit/5af1713d604f54b1aaf9e35f9c0fb4433b0f6e7a
 

The problem here is, that the sphinx team tries to extend a latex-writer
with some "xelatex" features, where a xelatex-writer is needed.
Another problem is, that Sphinx's TeX approach has no theming, this means
everything is placed in the sphinx.sty and there is no API for
a theming which is version compatible. Combined with the fact that we 
want support from Sphinx 1.2, we have also no chance to ship our
own sphinx.sty.

I'am working on such a xelatex-writer, addressing those aspects, but there is
a lot of work to do (will take months of my spare-time).

In short: Sphinx's TeX support is ugly, we should not try to support 
more variants than xelatex which was introduced by the patch from Mauro.

-- Markus --



For those of us who are german readers, here is a good answer about
in what ways pdflatex and xelatex differ (sorry only in german):

 
http://texwelt.de/wissen/fragen/5868/was-ist-der-unterschied-zwischen-latex-pdflatex-lualatex-und-xelatex
 


--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Proposing help for documentation

2016-11-02 Thread Mauro Carvalho Chehab
Em Wed, 02 Nov 2016 16:05:13 +
Luis de Bethencourt  escreveu:

> On 02/11/16 10:41, Jani Nikula wrote:
> > On Wed, 02 Nov 2016, Luis de Bethencourt  wrote:  
> >> I also offer my help, let me know if you see anything I can do.  
> > 
> > Luis, Patrice, anyone else out there willing to help: here's a list of
> > stuff to do, off the top of my head. I'm sure Jon will amend this.
> > 
> > 0) Some basics first
> > 
> > Subscribe to linux-doc. Read it.  
> 
> Subscribed for a while. Reading it more close now.
> 
> > 
> > Read https://lwn.net/Articles/692705/ and
> > https://lwn.net/Articles/704613/ if you haven't already.
> >   
> 
> Done.

I also wrote a series of articles at:
https://blogs.s-osg.org/new-improved-linux-kernel-media-documentation/

I intend to write also some articles there about PDF, with seems really 
tricky to get it right on Sphinx.

> 
> > Figure out how to build the documentation. Read the part about writing
> > kernel documentation. Also at
> > http://static.lwn.net/kerneldoc/kernel-documentation.html.
> > 
> > For most things under Documentation, you'll want to use the docs-next
> > branch of git://git.lwn.net/linux.git. That has the latest stuff. If you
> > use Linus' master, you'll be working on old stuff.
> > 
> > For fixing kernel-doc source code comments, you'll need to use the
> > appropriate subsystem tree, see MAINTAINERS.
> > 
> > In any case, most changes need to be sent to both linux-doc and the
> > relevant subsystem/driver mailing list. See MAINTAINERS and
> > scripts/get_maintainer.pl.
> > 
> > Whatever you do, don't spend forever polishing it privately. Otherwise
> > someone might beat you to it, and effort will be wasted. Read the list,
> > maybe someone's already posted patches that just haven't been merged
> > yet.  
> 
> Great summary of the development process.
> 
> > 
> > 1) Build documentation. Look at errors during build, fix them.
> > 
> > Some of the issues come from source code comments via the kernel-doc
> > extension; those changes need to go through the appropriate subsystem,
> > not via the documentation tree. Watch out, some of the things may have
> > been fixed in the subsystem repo already.
> > 
> > 2) Build documentation. Read the output, fix issues, improve the
> > language, improve the presentation. Ditto about source code comments.
> > 
> > Personally, I think this is both very important and unfortunately
> > laborous, because this is mostly stuff that Sphinx won't warn about.
> >   

I'd complement that you should test the output also for PDF... There are
some special tags and, sometimes  some spells to make it work.

> It is also more rewarding because newcomers get to learn by reading the
> docs, while also contributing. Win win.
> 
> > 3) Look at documentation patches on linux-doc, review them, test them,
> > give feedback.
> >   
> 
> I sent this yesterday, mind reviewing it?
> http://www.spinics.net/lists/linux-doc/msg41297.html

Nothing wrong with the above patch, but, IMHO, it would be better to 
only fix such typos on files already converted to ReST, as otherwise
it could conflict with a patch with someone else would be doing such
conversion. Just my 2 cents.

In time: I'm not touching at Documentation/usb.tmpl, or on any other
DocBook document.

> > 4) Convert DocBook templates under Documentation/DocBook to Sphinx.
> > 
> > The conversion is actually the easy part; figuring out whether the
> > documentation is still relevant and where to stick it in the Sphinx
> > build is harder. Jon may have some vision on this, but personally I'd
> > like to obliterate DocBook first, and then figure out what to do with
> > the resulting converted rst documents.

Markus has a script with helps with such conversion. I guess he actually
has conversion for everything, but you'll need to dig into the kernel-doc
markups, as some will break after the conversion.

> >  
> 
> Will wait in case Jon wants to add his opinion on this.
>  
> > 5) Convert .txt files under Documentation to .rst.
> > 
> > There are caveats here. Not everything needs to be converted. Some of
> > the stuff is obsolete, and converting might be wasted effort. Just
> > converting without updating to reflect current kernels is hazardous,
> > because the obsolete information will then be more accessible with the
> > converted documentation on the web.
> > 
> > People like plain text, don't go overboard with rst markup. Use
> > discretion.
> > 
> > 
> > For both 4) and 5) I'd really like the seasoned kernel devs to actively
> > hand out stuff to willing new hands.
> >   
> 
> This is a great point. Greg and others worry about the rising barrier of
> entry to contribute to the kernel. This would be a great thing to hand out
> to newcomers. I am personally interested if any seasoned maintainers are
> reading this.
> 
> > 
> > HTH,
> > Jani.
> >   
> 
> Thank you so much for the thorough list Jani. Much appreciated.
> 
> Luis
> --
> To 

Re: [PATCH RFC 0/4] Fix PDF build errors

2016-11-02 Thread Mauro Carvalho Chehab
Em Wed, 2 Nov 2016 17:08:08 +0100
Markus Heiser  escreveu:

> Am 02.11.2016 um 12:14 schrieb Jani Nikula :
> 
> > On Wed, 02 Nov 2016, Mauro Carvalho Chehab  wrote: 
> >  
> >> This series address a series of errors during PDF generation from
> >> media documentation.
> >> 
> >> Please notice that patch 2 carries on a PDF conversion from a PNG
> >> image, because Sphinx is not smart enough to do the convertion.
> >> 
> >> This is a temporary solution (That's why I'm marking this series
> >> as RFC).  
> > 
> > This seems to work on top of docs-next.
> > 
> > ...but it'll break again if we include the missing admin-guide in the
> > build. :(
> > Sadly, this breaks the pdf build with:
> > 
> > ! TeX capacity exceeded, sorry [main memory size=500].
> > \FV@Space ...ionary {\copy \sphinxvisiblespacebox
> > }{\sphinxafterbreak } {\ke...
> > l.3711 ...\PYG{n}{be} \PYG{n}{used} \PYG{n+nb}{to}
> > or 2  
> 
> 
> This is the verbatim block of the kernel parameters with more
> than 4300 lines in.
> 
> IMO, Verbatim exceeded, because in sphinx.sty is a redefinition
> of the LaTeX Verbatim command which might be sloppy / see 
> sphinx.sty::
> 
>  \renewcommand{\Verbatim}[1][1]{%
>

Argh! I really hate those ugly hacks that Sphinx do for LaTeX output...

Btw, I remember I had to touch on a TeXLive style in order to workaround
the memory size when testing LaTeX output for some book, but it ended by
causing some other issues.
 
> 
> The renew-Verbatim has been removed later:
> 
>  
> https://github.com/sphinx-doc/sphinx/commit/f9880bfcc8b19a7d197badeb6ab412abfca19891
> 
> I my POC I use such a modified sphinx.sty
> 
>  https://github.com/return42/sphkerneldoc/blob/master/_tex/sphinx.sty
> 
> with it, the PDF is build:
> 
> https://h2626237.stratoserver.net/kernel/books/admin-guide/pdf/linux-user.pdf
> 
> Using modified sphinx.sty has the drawback, that it is not
> up- or downward compatible to the installed Sphinx version.
> 
> So in short, I think it is the best to come back to the reasons
> and just split kernel parameters in several blocks and using the 
> 'none' option to prevent rendering as C .. E.g:
> 
> .. code-block:: none

I'm staring to think that we should just redefine the default for ::
to be "none", and use the "C" handling **only** when explicitly
requested.

I remember that Jon did such suggestion sometime ago.

If we change it to "none", it will still spend lots of memory for
verbatim?


Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC 0/4] Fix PDF build errors

2016-11-02 Thread Mauro Carvalho Chehab
Em Wed, 02 Nov 2016 15:27:50 +0200
Jani Nikula  escreveu:

> On Wed, 02 Nov 2016, Mauro Carvalho Chehab  wrote:
> > Em Wed, 02 Nov 2016 13:14:47 +0200
> > Jani Nikula  escreveu:
> >  
> >> On Wed, 02 Nov 2016, Mauro Carvalho Chehab  
> >> wrote:  
> >> > This series address a series of errors during PDF generation from
> >> > media documentation.
> >> >
> >> > Please notice that patch 2 carries on a PDF conversion from a PNG
> >> > image, because Sphinx is not smart enough to do the convertion.
> >> >
> >> > This is a temporary solution (That's why I'm marking this series
> >> > as RFC).
> >> 
> >> This seems to work on top of docs-next.  
> >
> > Yes.
> >  
> >> ...but it'll break again if we include the missing admin-guide in the
> >> build. :(  
> >
> > LaTeX/PDF output is ugly... for each new stuff, we need to re-validate its
> > output :-(  
> 
> Once we have this working, I think the only way to keep it working is to
> have continuous testing of the pdf build. That won't keep the output
> pretty, but it'll help ensure passing build.

Yes.

> Perhaps 0day could eventually start running 'make DOCBOOKS="" pdfdocs'
> after the htmldocs target? Cc: Fengguang and kbuild-all.

Good idea! it will be really helpful if Fengguang could automate the
testing process once we fix it.

Regards,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC 0/4] Fix PDF build errors

2016-11-02 Thread Markus Heiser

Am 02.11.2016 um 12:14 schrieb Jani Nikula :

> On Wed, 02 Nov 2016, Mauro Carvalho Chehab  wrote:
>> This series address a series of errors during PDF generation from
>> media documentation.
>> 
>> Please notice that patch 2 carries on a PDF conversion from a PNG
>> image, because Sphinx is not smart enough to do the convertion.
>> 
>> This is a temporary solution (That's why I'm marking this series
>> as RFC).
> 
> This seems to work on top of docs-next.
> 
> ...but it'll break again if we include the missing admin-guide in the
> build. :(
> Sadly, this breaks the pdf build with:
> 
> ! TeX capacity exceeded, sorry [main memory size=500].
> \FV@Space ...ionary {\copy \sphinxvisiblespacebox
> }{\sphinxafterbreak } {\ke...
> l.3711 ...\PYG{n}{be} \PYG{n}{used} \PYG{n+nb}{to}
> or 2


This is the verbatim block of the kernel parameters with more
than 4300 lines in.

IMO, Verbatim exceeded, because in sphinx.sty is a redefinition
of the LaTeX Verbatim command which might be sloppy / see 
sphinx.sty::

 \renewcommand{\Verbatim}[1][1]{%
   

The renew-Verbatim has been removed later:

 
https://github.com/sphinx-doc/sphinx/commit/f9880bfcc8b19a7d197badeb6ab412abfca19891

I my POC I use such a modified sphinx.sty

 https://github.com/return42/sphkerneldoc/blob/master/_tex/sphinx.sty

with it, the PDF is build:

https://h2626237.stratoserver.net/kernel/books/admin-guide/pdf/linux-user.pdf

Using modified sphinx.sty has the drawback, that it is not
up- or downward compatible to the installed Sphinx version.

So in short, I think it is the best to come back to the reasons
and just split kernel parameters in several blocks and using the 
'none' option to prevent rendering as C .. E.g:

.. code-block:: none

acpi=   [HW,ACPI,X86,ARM64]
Advanced Configuration and Power Interface
Format: { force | on | off | strict | noirq | rsdt |
  copy_dsdt }

-- Markus --

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Proposing help for documentation

2016-11-02 Thread Luis de Bethencourt
On 02/11/16 10:41, Jani Nikula wrote:
> On Wed, 02 Nov 2016, Luis de Bethencourt  wrote:
>> I also offer my help, let me know if you see anything I can do.
> 
> Luis, Patrice, anyone else out there willing to help: here's a list of
> stuff to do, off the top of my head. I'm sure Jon will amend this.
> 
> 0) Some basics first
> 
> Subscribe to linux-doc. Read it.

Subscribed for a while. Reading it more close now.

> 
> Read https://lwn.net/Articles/692705/ and
> https://lwn.net/Articles/704613/ if you haven't already.
> 

Done.

> Figure out how to build the documentation. Read the part about writing
> kernel documentation. Also at
> http://static.lwn.net/kerneldoc/kernel-documentation.html.
> 
> For most things under Documentation, you'll want to use the docs-next
> branch of git://git.lwn.net/linux.git. That has the latest stuff. If you
> use Linus' master, you'll be working on old stuff.
> 
> For fixing kernel-doc source code comments, you'll need to use the
> appropriate subsystem tree, see MAINTAINERS.
> 
> In any case, most changes need to be sent to both linux-doc and the
> relevant subsystem/driver mailing list. See MAINTAINERS and
> scripts/get_maintainer.pl.
> 
> Whatever you do, don't spend forever polishing it privately. Otherwise
> someone might beat you to it, and effort will be wasted. Read the list,
> maybe someone's already posted patches that just haven't been merged
> yet.

Great summary of the development process.

> 
> 1) Build documentation. Look at errors during build, fix them.
> 
> Some of the issues come from source code comments via the kernel-doc
> extension; those changes need to go through the appropriate subsystem,
> not via the documentation tree. Watch out, some of the things may have
> been fixed in the subsystem repo already.
> 
> 2) Build documentation. Read the output, fix issues, improve the
> language, improve the presentation. Ditto about source code comments.
> 
> Personally, I think this is both very important and unfortunately
> laborous, because this is mostly stuff that Sphinx won't warn about.
> 

It is also more rewarding because newcomers get to learn by reading the
docs, while also contributing. Win win.

> 3) Look at documentation patches on linux-doc, review them, test them,
> give feedback.
> 

I sent this yesterday, mind reviewing it?
http://www.spinics.net/lists/linux-doc/msg41297.html

> 4) Convert DocBook templates under Documentation/DocBook to Sphinx.
> 
> The conversion is actually the easy part; figuring out whether the
> documentation is still relevant and where to stick it in the Sphinx
> build is harder. Jon may have some vision on this, but personally I'd
> like to obliterate DocBook first, and then figure out what to do with
> the resulting converted rst documents.
>

Will wait in case Jon wants to add his opinion on this.
 
> 5) Convert .txt files under Documentation to .rst.
> 
> There are caveats here. Not everything needs to be converted. Some of
> the stuff is obsolete, and converting might be wasted effort. Just
> converting without updating to reflect current kernels is hazardous,
> because the obsolete information will then be more accessible with the
> converted documentation on the web.
> 
> People like plain text, don't go overboard with rst markup. Use
> discretion.
> 
> 
> For both 4) and 5) I'd really like the seasoned kernel devs to actively
> hand out stuff to willing new hands.
> 

This is a great point. Greg and others worry about the rising barrier of
entry to contribute to the kernel. This would be a great thing to hand out
to newcomers. I am personally interested if any seasoned maintainers are
reading this.

> 
> HTH,
> Jani.
> 

Thank you so much for the thorough list Jani. Much appreciated.

Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC 1/4] docs-rst: fix PDF build errors

2016-11-02 Thread Markus Heiser

Am 01.11.2016 um 23:44 schrieb Mauro Carvalho Chehab :

> PDF build on Kernel 4.9-rc? returns an error. This is
> because we're re-defining a command too late. Move
> such redefinition to LaTeX preamble.
> 
> Tested by building the documentation on interactive mode:
>   make PDFLATEX=xelatex -C Documentation/output/./latex
> 
> Fixes: e61a39baf74d ("[media] index.rst: Fix LaTeX error in interactive mode 
> on Sphinx 1.4.x")
> 
> Signed-off-by: Mauro Carvalho Chehab 
> ---
> Documentation/conf.py | 4 
> Documentation/media/index.rst | 5 -
> 2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index d9bad21dd427..814c336e5f5e 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -332,6 +332,10 @@ latex_elements = {
> '''
> }
> 
> +# Fix reference escape troubles with Sphinx 1.4.x
> +if minor > 3:
> +latex_elements['preamble']  += '\\renewcommand*{\\DUrole}[2]{ #2 }'

Sorry forget to mention: when adding content to the preamble I recommend
to add a leading and trailing new-line.

-- Markus --

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/3] Documentation/sphinx: fix make SPHINXDIRS="dirs" pdfdocs for more than one dir

2016-11-02 Thread Markus Heiser

Am 02.11.2016 um 15:45 schrieb Jani Nikula :

> From: Markus Heiser 
> 
> Add missing semicolon to fix pdf build with more than one SPHINXDIRS
> directory specified. For example make SPHINXDIRS="gpu media" pdfdocs.
> 
> Fixes: cd21379b1698 ("doc-rst: generic way to build PDF of sub-folders")
> Signed-off-by: Markus Heiser 
> Signed-off-by: Jani Nikula 

Confirmed / Thanks!

--Markus--

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: make pdfdocs fails with v4.9-rc3

2016-11-02 Thread Markus Heiser

Am 01.11.2016 um 23:11 schrieb Jim Davis :

> On Mon, Oct 31, 2016 at 3:41 PM, Mauro Carvalho Chehab
>  wrote:
>> Em Mon, 31 Oct 2016 16:40:02 -0600
>> Mauro Carvalho Chehab  escreveu:
>> 
>>> Em Mon, 31 Oct 2016 15:04:42 -0700
>>> Jim Davis  escreveu:
> 
> I've no idea where's it's going astray, though there are a number of errors:
> 
> jim@krebstar:~$ grep '^!' /tmp/make-pdfdocs.txt | sort -u
> ! Argument of \LT@max@sel has an extra }.
> ! Extra alignment tab has been changed to \cr.
> ! Extra \endcsname.
> ! Extra \endgroup.
> ! Illegal unit of measure (pt inserted).
> ! Improper alphabetic constant.
> ! LaTeX Error: \begin{document} ended by \end{adjustbox}.
> ! LaTeX Error: \begin{document} ended by \end{longtable}.
> ! LaTeX Error: Something's wrong--perhaps a missing \item.
> ! LaTeX Error: There's no line here to end.
> ! Misplaced \noalign.
> ! Missing \endcsname inserted.
> ! Missing \endgroup inserted.
> ! Missing { inserted.
> ! Missing } inserted.
> ! Missing # inserted in alignment preamble.
> ! Missing number, treated as zero.
> ! Paragraph ended before \LT@entry was complete.
> ! Paragraph ended before \LT@max@sel was complete.
> ! Paragraph ended before \multicolumn was complete.
> ! Undefined control sequence.
> ! You can't use `\hrule' here except wi
> 

FYI: as far as I know those "!LaTeX Error" messages cause TeX 
to end with an error code which stops the make build. 

Since we are not in an interactive mode, xelatex continues
after each "!LaTeX Error" messages and builds the pdf to
its end (even if the content might be broken).. and then,
it ends with exit status !=0.

In those cases (make build stops), we have to study the log file. 

BTW: I prefer Jani's solution, using the "batchmode" [1] and
if a pdf build fails, I have to read the *.log file in the 
latex output folder searching for those "!LaTeX Error". 

[1] https://www.mail-archive.com/linux-doc@vger.kernel.org/msg07462.html

--Markus
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC 0/4] Fix PDF build errors

2016-11-02 Thread Jani Nikula
On Wed, 02 Nov 2016, Mauro Carvalho Chehab  wrote:
> Em Wed, 02 Nov 2016 13:14:47 +0200
> Jani Nikula  escreveu:
>
>> On Wed, 02 Nov 2016, Mauro Carvalho Chehab  wrote:
>> > This series address a series of errors during PDF generation from
>> > media documentation.
>> >
>> > Please notice that patch 2 carries on a PDF conversion from a PNG
>> > image, because Sphinx is not smart enough to do the convertion.
>> >
>> > This is a temporary solution (That's why I'm marking this series
>> > as RFC).  
>> 
>> This seems to work on top of docs-next.
>
> Yes.
>
>> ...but it'll break again if we include the missing admin-guide in the
>> build. :(
>
> LaTeX/PDF output is ugly... for each new stuff, we need to re-validate its
> output :-(

Once we have this working, I think the only way to keep it working is to
have continuous testing of the pdf build. That won't keep the output
pretty, but it'll help ensure passing build.

Perhaps 0day could eventually start running 'make DOCBOOKS="" pdfdocs'
after the htmldocs target? Cc: Fengguang and kbuild-all.

BR,
Jani.



>
>
>
>> 
>> BR,
>> Jani.
>> 
>> 
>> From c296287c65f4b6ad6272171456dcf8508c92ae2f Mon Sep 17 00:00:00 2001
>> From: Jani Nikula 
>> Date: Wed, 2 Nov 2016 13:05:59 +0200
>> Subject: [PATCH] Documentation/sphinx: include admin-guide in the latex/pdf
>>  build
>> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
>> Cc: Jani Nikula 
>> 
>> Fix the warning:
>> 
>> WARNING: "latex_documents" config value references unknown document
>> user/index
>> 
>> Signed-off-by: Jani Nikula 
>> 
>> ---
>> 
>> Sadly, this breaks the pdf build with:
>> 
>> ! TeX capacity exceeded, sorry [main memory size=500].
>> \FV@Space ...ionary {\copy \sphinxvisiblespacebox
>>  }{\sphinxafterbreak } {\ke...
>>  l.3711 ...\PYG{n}{be} \PYG{n}{used} \PYG{n+nb}{to}
>> 
>> Output written on linux-user.pdf (15 pages).
>> Transcript written on linux-user.log.
>> Makefile:66: recipe for target 'linux-user.pdf' failed
>> make[2]: *** [linux-user.pdf] Error 1
>> Documentation/Makefile.sphinx:83: recipe for target 'pdfdocs' failed
>> make[1]: *** [pdfdocs] Error 2
>> Makefile:1442: recipe for target 'pdfdocs' failed
>> make: *** [pdfdocs] Error 2
>> ---
>>  Documentation/conf.py | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/Documentation/conf.py b/Documentation/conf.py
>> index 814c336e5f5e..0c758a4f61f1 100644
>> --- a/Documentation/conf.py
>> +++ b/Documentation/conf.py
>> @@ -340,7 +340,7 @@ if minor > 3:
>>  # (source start file, target name, title,
>>  #  author, documentclass [howto, manual, or own class]).
>>  latex_documents = [
>> -('user/index', 'linux-user.tex', 'Linux Kernel User Documentation',
>> +('admin-guide/index', 'linux-user.tex', 'Linux Kernel User 
>> Documentation',
>
> Oh! It seems I forgot to rename the guide name here :(
>
> Your patch looks OK!
>
> Reviewed-by: Mauro Carvalho Chehab 
>
>>   'The kernel development community', 'manual'),
>>  ('kernel-documentation', 'kernel-documentation.tex', 'The Linux Kernel 
>> Documentation',
>>   'The kernel development community', 'manual'),
>
>
>
>
> Cheers,
> Mauro

-- 
Jani Nikula, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[hverkuil-media:cec 9/11] htmldocs: Documentation Makefile scripts source No rule to make target 'include/linux/cec.h', needed by 'Documentation/output/cec.h.rst'.

2016-11-02 Thread kbuild test robot
tree:   git://linuxtv.org/hverkuil/media_tree.git cec
head:   b0a453e5585d000bdeee4242f9c43b99ab1835d6
commit: 3f626673dfff318f1aea1e443f5151b9616484c8 [9/11] cec: move the CEC 
framework out of staging and to media
reproduce: make htmldocs

All errors (new ones prefixed by >>):

   warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
>> Documentation Makefile scripts source No rule to make target 
>> 'include/linux/cec.h', needed by 'Documentation/output/cec.h.rst'.
   Target 'all' not remade because of errors.
   include/linux/init.h:1: warning: no structured comments found
   include/linux/workqueue.h:392: warning: No description found for parameter 
'...'
   include/linux/workqueue.h:392: warning: Excess function parameter 'args' 
description in 'alloc_workqueue'
   include/linux/workqueue.h:413: warning: No description found for parameter 
'...'
   include/linux/workqueue.h:413: warning: Excess function parameter 'args' 
description in 'alloc_ordered_workqueue'
   include/linux/kthread.h:26: warning: No description found for parameter '...'
   kernel/sys.c:1: warning: no structured comments found
   drivers/dma-buf/seqno-fence.c:1: warning: no structured comments found
   include/linux/fence-array.h:61: warning: No description found for parameter 
'fence'
   include/sound/core.h:324: warning: No description found for parameter '...'
   include/sound/core.h:335: warning: No description found for parameter '...'
   include/sound/core.h:388: warning: No description found for parameter '...'
   include/media/media-entity.h:1054: warning: No description found for 
parameter '...'

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: [PATCH RFC 0/4] Fix PDF build errors

2016-11-02 Thread Mauro Carvalho Chehab
Em Wed, 02 Nov 2016 13:14:47 +0200
Jani Nikula  escreveu:

> On Wed, 02 Nov 2016, Mauro Carvalho Chehab  wrote:
> > This series address a series of errors during PDF generation from
> > media documentation.
> >
> > Please notice that patch 2 carries on a PDF conversion from a PNG
> > image, because Sphinx is not smart enough to do the convertion.
> >
> > This is a temporary solution (That's why I'm marking this series
> > as RFC).  
> 
> This seems to work on top of docs-next.

Yes.

> ...but it'll break again if we include the missing admin-guide in the
> build. :(

LaTeX/PDF output is ugly... for each new stuff, we need to re-validate its
output :-(



> 
> BR,
> Jani.
> 
> 
> From c296287c65f4b6ad6272171456dcf8508c92ae2f Mon Sep 17 00:00:00 2001
> From: Jani Nikula 
> Date: Wed, 2 Nov 2016 13:05:59 +0200
> Subject: [PATCH] Documentation/sphinx: include admin-guide in the latex/pdf
>  build
> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
> Cc: Jani Nikula 
> 
> Fix the warning:
> 
> WARNING: "latex_documents" config value references unknown document
> user/index
> 
> Signed-off-by: Jani Nikula 
> 
> ---
> 
> Sadly, this breaks the pdf build with:
> 
> ! TeX capacity exceeded, sorry [main memory size=500].
> \FV@Space ...ionary {\copy \sphinxvisiblespacebox
>  }{\sphinxafterbreak } {\ke...
>  l.3711 ...\PYG{n}{be} \PYG{n}{used} \PYG{n+nb}{to}
> 
> Output written on linux-user.pdf (15 pages).
> Transcript written on linux-user.log.
> Makefile:66: recipe for target 'linux-user.pdf' failed
> make[2]: *** [linux-user.pdf] Error 1
> Documentation/Makefile.sphinx:83: recipe for target 'pdfdocs' failed
> make[1]: *** [pdfdocs] Error 2
> Makefile:1442: recipe for target 'pdfdocs' failed
> make: *** [pdfdocs] Error 2
> ---
>  Documentation/conf.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index 814c336e5f5e..0c758a4f61f1 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -340,7 +340,7 @@ if minor > 3:
>  # (source start file, target name, title,
>  #  author, documentclass [howto, manual, or own class]).
>  latex_documents = [
> -('user/index', 'linux-user.tex', 'Linux Kernel User Documentation',
> +('admin-guide/index', 'linux-user.tex', 'Linux Kernel User 
> Documentation',

Oh! It seems I forgot to rename the guide name here :(

Your patch looks OK!

Reviewed-by: Mauro Carvalho Chehab 

>   'The kernel development community', 'manual'),
>  ('kernel-documentation', 'kernel-documentation.tex', 'The Linux Kernel 
> Documentation',
>   'The kernel development community', 'manual'),




Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] Documentation/sphinx: let the user specify PDFLATEX and LATEXOPTS

2016-11-02 Thread Mauro Carvalho Chehab
Hi Jani,

Em Wed,  2 Nov 2016 11:40:11 +0200
Jani Nikula  escreveu:

> Refer to xelatex and latex options via variables. This allows the user
> to override the pdflatex and latex options to use on the make command
> line for experimenting. As a side effect, this makes the makefile a bit
> tidier.

For all the patches in this series:

Reviewed-by: Mauro Carvalho Chehab 

I was actually thinking on doing something close to what you've done :-)

> 
> Signed-off-by: Jani Nikula 
> ---
>  Documentation/Makefile.sphinx | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
> index 92deea30b183..1314e3ee31c4 100644
> --- a/Documentation/Makefile.sphinx
> +++ b/Documentation/Makefile.sphinx
> @@ -10,6 +10,8 @@ _SPHINXDIRS   = $(patsubst 
> $(srctree)/Documentation/%/conf.py,%,$(wildcard $(src
>  SPHINX_CONF   = conf.py
>  PAPER =
>  BUILDDIR  = $(obj)/output
> +PDFLATEX  = xelatex
> +LATEXOPTS = -interaction=nonstopmode
>  
>  # User-friendly check for sphinx-build
>  HAVE_SPHINX := $(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; 
> else echo 0; fi)
> @@ -29,7 +31,7 @@ else ifneq ($(DOCBOOKS),)
>  else # HAVE_SPHINX
>  
>  # User-friendly check for pdflatex
> -HAVE_PDFLATEX := $(shell if which xelatex >/dev/null 2>&1; then echo 1; else 
> echo 0; fi)
> +HAVE_PDFLATEX := $(shell if which $(PDFLATEX) >/dev/null 2>&1; then echo 1; 
> else echo 0; fi)
>  
>  # Internal variables.
>  PAPEROPT_a4 = -D latex_paper_size=a4
> @@ -68,7 +70,7 @@ htmldocs:
>  
>  latexdocs:
>  ifeq ($(HAVE_PDFLATEX),0)
> - $(warning The 'xelatex' command was not found. Make sure you have it 
> installed and in PATH to produce PDF output.)
> + $(warning The '$(PDFLATEX)' command was not found. Make sure you have 
> it installed and in PATH to produce PDF output.)
>   @echo "  SKIPSphinx $@ target."
>  else # HAVE_PDFLATEX
>   @$(foreach var,$(SPHINXDIRS),$(call 
> loop_cmd,sphinx,latex,$(var),latex,$(var)))
> @@ -76,7 +78,8 @@ endif # HAVE_PDFLATEX
>  
>  pdfdocs: latexdocs
>  ifneq ($(HAVE_PDFLATEX),0)
> - $(foreach var,$(SPHINXDIRS), $(MAKE) PDFLATEX=xelatex 
> LATEXOPTS="-interaction=nonstopmode" -C $(BUILDDIR)/$(var)/latex)
> + $(foreach var,$(SPHINXDIRS), $(MAKE) PDFLATEX=$(PDFLATEX) 
> LATEXOPTS="$(LATEXOPTS)" -C $(BUILDDIR)/$(var)/latex)
> +
>  endif # HAVE_PDFLATEX
>  
>  epubdocs:




Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/3] Documentation/sphinx: change pdflatex interaction mode to batchmode

2016-11-02 Thread Jani Nikula
Radically reduce the noise on stdout. The full build logs will still be
available under Documentatio/output/latex/*.log.

Cc: Mauro Carvalho Chehab 
Signed-off-by: Jani Nikula 
---
 Documentation/Makefile.sphinx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 4d3ff4b7a2a5..d58d776d8d00 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -11,7 +11,7 @@ SPHINX_CONF   = conf.py
 PAPER =
 BUILDDIR  = $(obj)/output
 PDFLATEX  = xelatex
-LATEXOPTS = -interaction=nonstopmode
+LATEXOPTS = -interaction=batchmode
 
 # User-friendly check for sphinx-build
 HAVE_SPHINX := $(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; 
else echo 0; fi)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC 0/4] Fix PDF build errors

2016-11-02 Thread Jani Nikula
On Wed, 02 Nov 2016, Mauro Carvalho Chehab  wrote:
> This series address a series of errors during PDF generation from
> media documentation.
>
> Please notice that patch 2 carries on a PDF conversion from a PNG
> image, because Sphinx is not smart enough to do the convertion.
>
> This is a temporary solution (That's why I'm marking this series
> as RFC).

This seems to work on top of docs-next.

...but it'll break again if we include the missing admin-guide in the
build. :(

BR,
Jani.


>From c296287c65f4b6ad6272171456dcf8508c92ae2f Mon Sep 17 00:00:00 2001
From: Jani Nikula 
Date: Wed, 2 Nov 2016 13:05:59 +0200
Subject: [PATCH] Documentation/sphinx: include admin-guide in the latex/pdf
 build
Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Cc: Jani Nikula 

Fix the warning:

WARNING: "latex_documents" config value references unknown document
user/index

Signed-off-by: Jani Nikula 

---

Sadly, this breaks the pdf build with:

! TeX capacity exceeded, sorry [main memory size=500].
\FV@Space ...ionary {\copy \sphinxvisiblespacebox
 }{\sphinxafterbreak } {\ke...
 l.3711 ...\PYG{n}{be} \PYG{n}{used} \PYG{n+nb}{to}

Output written on linux-user.pdf (15 pages).
Transcript written on linux-user.log.
Makefile:66: recipe for target 'linux-user.pdf' failed
make[2]: *** [linux-user.pdf] Error 1
Documentation/Makefile.sphinx:83: recipe for target 'pdfdocs' failed
make[1]: *** [pdfdocs] Error 2
Makefile:1442: recipe for target 'pdfdocs' failed
make: *** [pdfdocs] Error 2
---
 Documentation/conf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 814c336e5f5e..0c758a4f61f1 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -340,7 +340,7 @@ if minor > 3:
 # (source start file, target name, title,
 #  author, documentclass [howto, manual, or own class]).
 latex_documents = [
-('user/index', 'linux-user.tex', 'Linux Kernel User Documentation',
+('admin-guide/index', 'linux-user.tex', 'Linux Kernel User Documentation',
  'The kernel development community', 'manual'),
 ('kernel-documentation', 'kernel-documentation.tex', 'The Linux Kernel 
Documentation',
  'The kernel development community', 'manual'),
-- 
2.1.4




-- 
Jani Nikula, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 00/19] Put the EDAC documentation at the Sphinx books

2016-11-02 Thread Borislav Petkov
On Sat, Oct 29, 2016 at 04:33:58PM -0200, Mauro Carvalho Chehab wrote:
> 
> This patch series convert the Documentation/edac.txt book to ReST and
> add an EDAC documentation to the driver-api book.
> 
> The first 2 patches on this series are just cleanups to the headers,
> removing two unused stuff and using -EINVAL instead of -1 on
> one of the functions.
> 
> The next 6 patches convert Documentation/edac.txt to ReST, improve
> it and rename to ras.rst, moving  it to the admin-guide.
> 
> The remaining patches move existing documentation to edac_mc.h,
> edac_device.h and edac_pci.h, improving the documentation provided
> on them in order to be properly parsed by kernel-doc script.
> 
> Regards,
> Mauro
> 
> - version 2:
>   - don't change the return code for edac_mc_find_csrow_by_page();
>   - split edac_core.h into 3 headers, one per each EDAC API
> (memory controller, PCI and device);
>   - add linux/include/edac.h at the driver-api book.

Looks ok to me at a quick glance.

Thanks.

-- 
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] Documentation/sphinx: remove superfluous trailing ; from quiet_cmd_sphinx

2016-11-02 Thread Jani Nikula
With the unnecessary ; removed, the terminal URL detection also works
better.

Signed-off-by: Jani Nikula 
---
 Documentation/Makefile.sphinx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 4819638f7e21..4d3ff4b7a2a5 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -53,7 +53,7 @@ loop_cmd = $(echo-cmd) $(cmd_$(1))
 # $5 reST source folder relative to $(srctree)/$(src),
 #e.g. "media" for the linux-tv book-set at ./Documentation/media
 
-quiet_cmd_sphinx = SPHINX  $@ --> file://$(abspath $(BUILDDIR)/$3/$4);
+quiet_cmd_sphinx = SPHINX  $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
   cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) 
$(build)=Documentation/media all;\
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath 
$(srctree)/$(src)/$5/$(SPHINX_CONF)) \
$(SPHINXBUILD) \
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] Documentation/sphinx: make it possible to build latexdocs without pdflatex

2016-11-02 Thread Jani Nikula
Building latexdocs doesn't actually require $(PDFLATEX). Move the checks
for it to the pdfdocs target which does require it, and specifically
outside of the target in order to not depend on latexdocs when we can't
build pdfdocs anyway.

Signed-off-by: Jani Nikula 
---
 Documentation/Makefile.sphinx | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 1314e3ee31c4..4819638f7e21 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -69,15 +69,17 @@ htmldocs:
@$(foreach var,$(SPHINXDIRS),$(call 
loop_cmd,sphinx,html,$(var),,$(var)))
 
 latexdocs:
+   @$(foreach var,$(SPHINXDIRS),$(call 
loop_cmd,sphinx,latex,$(var),latex,$(var)))
+
 ifeq ($(HAVE_PDFLATEX),0)
+
+pdfdocs:
$(warning The '$(PDFLATEX)' command was not found. Make sure you have 
it installed and in PATH to produce PDF output.)
@echo "  SKIPSphinx $@ target."
+
 else # HAVE_PDFLATEX
-   @$(foreach var,$(SPHINXDIRS),$(call 
loop_cmd,sphinx,latex,$(var),latex,$(var)))
-endif # HAVE_PDFLATEX
 
 pdfdocs: latexdocs
-ifneq ($(HAVE_PDFLATEX),0)
$(foreach var,$(SPHINXDIRS), $(MAKE) PDFLATEX=$(PDFLATEX) 
LATEXOPTS="$(LATEXOPTS)" -C $(BUILDDIR)/$(var)/latex)
 
 endif # HAVE_PDFLATEX
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] Documentation/sphinx: let the user specify PDFLATEX and LATEXOPTS

2016-11-02 Thread Jani Nikula
Refer to xelatex and latex options via variables. This allows the user
to override the pdflatex and latex options to use on the make command
line for experimenting. As a side effect, this makes the makefile a bit
tidier.

Signed-off-by: Jani Nikula 
---
 Documentation/Makefile.sphinx | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 92deea30b183..1314e3ee31c4 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -10,6 +10,8 @@ _SPHINXDIRS   = $(patsubst 
$(srctree)/Documentation/%/conf.py,%,$(wildcard $(src
 SPHINX_CONF   = conf.py
 PAPER =
 BUILDDIR  = $(obj)/output
+PDFLATEX  = xelatex
+LATEXOPTS = -interaction=nonstopmode
 
 # User-friendly check for sphinx-build
 HAVE_SPHINX := $(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; 
else echo 0; fi)
@@ -29,7 +31,7 @@ else ifneq ($(DOCBOOKS),)
 else # HAVE_SPHINX
 
 # User-friendly check for pdflatex
-HAVE_PDFLATEX := $(shell if which xelatex >/dev/null 2>&1; then echo 1; else 
echo 0; fi)
+HAVE_PDFLATEX := $(shell if which $(PDFLATEX) >/dev/null 2>&1; then echo 1; 
else echo 0; fi)
 
 # Internal variables.
 PAPEROPT_a4 = -D latex_paper_size=a4
@@ -68,7 +70,7 @@ htmldocs:
 
 latexdocs:
 ifeq ($(HAVE_PDFLATEX),0)
-   $(warning The 'xelatex' command was not found. Make sure you have it 
installed and in PATH to produce PDF output.)
+   $(warning The '$(PDFLATEX)' command was not found. Make sure you have 
it installed and in PATH to produce PDF output.)
@echo "  SKIPSphinx $@ target."
 else # HAVE_PDFLATEX
@$(foreach var,$(SPHINXDIRS),$(call 
loop_cmd,sphinx,latex,$(var),latex,$(var)))
@@ -76,7 +78,8 @@ endif # HAVE_PDFLATEX
 
 pdfdocs: latexdocs
 ifneq ($(HAVE_PDFLATEX),0)
-   $(foreach var,$(SPHINXDIRS), $(MAKE) PDFLATEX=xelatex 
LATEXOPTS="-interaction=nonstopmode" -C $(BUILDDIR)/$(var)/latex)
+   $(foreach var,$(SPHINXDIRS), $(MAKE) PDFLATEX=$(PDFLATEX) 
LATEXOPTS="$(LATEXOPTS)" -C $(BUILDDIR)/$(var)/latex)
+
 endif # HAVE_PDFLATEX
 
 epubdocs:
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Documentation/Makefile.sphinx improvements

2016-11-02 Thread Jani Nikula
A few tweaks to improve Makefile.sphinx.

BR,
Jani.


--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html