Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation

2016-09-23 Thread H. Nikolaus Schaller
Hi,

> Am 24.09.2016 um 02:31 schrieb Sebastian Reichel :
> 
> On Fri, Sep 23, 2016 at 05:47:26PM -0500, Rob Herring wrote:
>> On Fri, Sep 23, 2016 at 02:41:09PM +0200, H. Nikolaus Schaller wrote:
>>> commit b98abe52fa8e ("Input: add common DT binding for touchscreens")
>>> introduced common DT bindings for touchscreens [1] and a helper function to
>>> parse the DT.
>>> 
>>> commit ed7c9870c9bc ("Input: of_touchscreen - add support for inverted / 
>>> swapped axes")
>>> added another helper for parsing axis inversion and swapping
>>> and applying them to x and y coordinates.
>>> 
>>> Both helpers have been integrated to accommodate any orientation of the
>>> touch panel in relation to the LCD.
>>> 
>>> A new feature is to introduce scaling the min/max ADC values to the screen
>>> size.
>>> 
>>> This makes it possible to pre-calibrate the touch so that is (almost)
>>> exactly matches the LCD pixel coordinates it is glued onto. This allows to
>>> well enough operate the touch before a user space calibration step can
>>> improve the precision.
>>> 
>>> Finally, calculate_pressure has been renamed to calculate_resistance
>>> because that is what it is doing.
>> 
>> Seems like you are breaking compatibility with old DTs. I can't tell for
>> sure though.
>> 
>>> 
>>> [1]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
>>> 
>>> Signed-off-by: H. Nikolaus Schaller 
>>> ---
>>> .../bindings/input/touchscreen/tsc2007.txt |  20 ++--
>>> drivers/input/touchscreen/tsc2007.c| 126 
>>> +
>>> include/linux/i2c/tsc2007.h|   8 ++
>>> 3 files changed, 123 insertions(+), 31 deletions(-)
>>> 
>>> diff --git 
>>> a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt 
>>> b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>>> index ec365e1..6e9fd55 100644
>>> --- a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>>> +++ b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>>> @@ -6,6 +6,7 @@ Required properties:
>>> - ti,x-plate-ohms: X-plate resistance in ohms.
>>> 
>>> Optional properties:
>>> +- generic touch screen properties: see touchscreen binding [2].
>>> - gpios: the interrupt gpio the chip is connected to (trough the penirq 
>>> pin).
>>>   The penirq pin goes to low when the panel is touched.
>>>   (see GPIO binding[1] for more details).
>>> @@ -13,17 +14,20 @@ Optional properties:
>>>   (see interrupt binding[0]).
>>> - interrupts: (gpio) interrupt to which the chip is connected
>>>   (see interrupt binding[0]).
>>> -- ti,max-rt: maximum pressure.
>>> -- ti,fuzzx: specifies the absolute input fuzz x value.
>>> -  If set, it will permit noise in the data up to +- the value given to the 
>>> fuzz
>>> -  parameter, that is used to filter noise from the event stream.
>>> -- ti,fuzzy: specifies the absolute input fuzz y value.
>>> -- ti,fuzzz: specifies the absolute input fuzz z value.
>>> +- ti,max-rt: maximum pressure resistance above which samples are ignored
>>> +  (default: 4095).
>>> +- ti,report-resistance: report resistance (no pressure = max_rt) instead
>>> +  of pressure (no pressure = 0).
>>> +- ti,min-x: minimum value reported by X axis ADC (default 0).
>>> +- ti,max-x: maximum value reported by X axis ADC (default 4095).
>>> +- ti,min-y: minimum value reported by Y axis ADC (default 0).
>>> +- ti,max-y: maximum value reported by Y axis ADC (default 4095).
>> 
>> Seems like these could be common too. They make more sense than giving x
>> and y sizes in pixel units which really should come from the panel.
> 
> The generic touchscreen properties are described "(in pixels)" in
> the DT, but they are used in the same way.
> 
> So ti,max-[xy] is basically the same as touchscreen-size-[xy],

No it is not the same and should be kept separate.

> except, that the generic bindings don't support min-[xy] != 0.

What would be the purpose of this? Every user-space I know
about (X11, Replicant) expects coordinates in some range
0..max so setting min in device tree makes no sense to me.

> 
> So maybe change the generic bindings like this:
> 
> touchscreen-min-x: minimum value reported by X axis ADC (default 0)
> touchscreen-max-x: maximum value reported by Y axis ADC
> touchscreen-min-y: minimum value reported by Y axis ADC (default 0)
> touchscreen-max-y: maximum value reported by Y axis ADC
> touchscreen-size-x: deprecated alias for touchscreen-max-x
> touchscreen-size-y: deprecated alias for touchscreen-max-y
> 

Initially I had thought about this but it does not solve the problems
with touch pre-calibration. Since it mixes raw coordinates with
system coordinates.

To achieve the goal of having a roughly precalibrated touch which
should provide (0,0) at the lower left corner and 
(touchscreen-size-x,touchscreen-size-y)
in pixel coordinates of the panel. Hence it roughly works without
a calibration matrix in user space (e.g. xorg.conf or 

Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation

2016-09-23 Thread H. Nikolaus Schaller
Hi,

> Am 24.09.2016 um 02:31 schrieb Sebastian Reichel :
> 
> On Fri, Sep 23, 2016 at 05:47:26PM -0500, Rob Herring wrote:
>> On Fri, Sep 23, 2016 at 02:41:09PM +0200, H. Nikolaus Schaller wrote:
>>> commit b98abe52fa8e ("Input: add common DT binding for touchscreens")
>>> introduced common DT bindings for touchscreens [1] and a helper function to
>>> parse the DT.
>>> 
>>> commit ed7c9870c9bc ("Input: of_touchscreen - add support for inverted / 
>>> swapped axes")
>>> added another helper for parsing axis inversion and swapping
>>> and applying them to x and y coordinates.
>>> 
>>> Both helpers have been integrated to accommodate any orientation of the
>>> touch panel in relation to the LCD.
>>> 
>>> A new feature is to introduce scaling the min/max ADC values to the screen
>>> size.
>>> 
>>> This makes it possible to pre-calibrate the touch so that is (almost)
>>> exactly matches the LCD pixel coordinates it is glued onto. This allows to
>>> well enough operate the touch before a user space calibration step can
>>> improve the precision.
>>> 
>>> Finally, calculate_pressure has been renamed to calculate_resistance
>>> because that is what it is doing.
>> 
>> Seems like you are breaking compatibility with old DTs. I can't tell for
>> sure though.
>> 
>>> 
>>> [1]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
>>> 
>>> Signed-off-by: H. Nikolaus Schaller 
>>> ---
>>> .../bindings/input/touchscreen/tsc2007.txt |  20 ++--
>>> drivers/input/touchscreen/tsc2007.c| 126 
>>> +
>>> include/linux/i2c/tsc2007.h|   8 ++
>>> 3 files changed, 123 insertions(+), 31 deletions(-)
>>> 
>>> diff --git 
>>> a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt 
>>> b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>>> index ec365e1..6e9fd55 100644
>>> --- a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>>> +++ b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>>> @@ -6,6 +6,7 @@ Required properties:
>>> - ti,x-plate-ohms: X-plate resistance in ohms.
>>> 
>>> Optional properties:
>>> +- generic touch screen properties: see touchscreen binding [2].
>>> - gpios: the interrupt gpio the chip is connected to (trough the penirq 
>>> pin).
>>>   The penirq pin goes to low when the panel is touched.
>>>   (see GPIO binding[1] for more details).
>>> @@ -13,17 +14,20 @@ Optional properties:
>>>   (see interrupt binding[0]).
>>> - interrupts: (gpio) interrupt to which the chip is connected
>>>   (see interrupt binding[0]).
>>> -- ti,max-rt: maximum pressure.
>>> -- ti,fuzzx: specifies the absolute input fuzz x value.
>>> -  If set, it will permit noise in the data up to +- the value given to the 
>>> fuzz
>>> -  parameter, that is used to filter noise from the event stream.
>>> -- ti,fuzzy: specifies the absolute input fuzz y value.
>>> -- ti,fuzzz: specifies the absolute input fuzz z value.
>>> +- ti,max-rt: maximum pressure resistance above which samples are ignored
>>> +  (default: 4095).
>>> +- ti,report-resistance: report resistance (no pressure = max_rt) instead
>>> +  of pressure (no pressure = 0).
>>> +- ti,min-x: minimum value reported by X axis ADC (default 0).
>>> +- ti,max-x: maximum value reported by X axis ADC (default 4095).
>>> +- ti,min-y: minimum value reported by Y axis ADC (default 0).
>>> +- ti,max-y: maximum value reported by Y axis ADC (default 4095).
>> 
>> Seems like these could be common too. They make more sense than giving x
>> and y sizes in pixel units which really should come from the panel.
> 
> The generic touchscreen properties are described "(in pixels)" in
> the DT, but they are used in the same way.
> 
> So ti,max-[xy] is basically the same as touchscreen-size-[xy],

No it is not the same and should be kept separate.

> except, that the generic bindings don't support min-[xy] != 0.

What would be the purpose of this? Every user-space I know
about (X11, Replicant) expects coordinates in some range
0..max so setting min in device tree makes no sense to me.

> 
> So maybe change the generic bindings like this:
> 
> touchscreen-min-x: minimum value reported by X axis ADC (default 0)
> touchscreen-max-x: maximum value reported by Y axis ADC
> touchscreen-min-y: minimum value reported by Y axis ADC (default 0)
> touchscreen-max-y: maximum value reported by Y axis ADC
> touchscreen-size-x: deprecated alias for touchscreen-max-x
> touchscreen-size-y: deprecated alias for touchscreen-max-y
> 

Initially I had thought about this but it does not solve the problems
with touch pre-calibration. Since it mixes raw coordinates with
system coordinates.

To achieve the goal of having a roughly precalibrated touch which
should provide (0,0) at the lower left corner and 
(touchscreen-size-x,touchscreen-size-y)
in pixel coordinates of the panel. Hence it roughly works without
a calibration matrix in user space (e.g. xorg.conf or Replicant).

Why do we need 

[PATCH 2/2] mfd: ab8500-debugfs: remove unused function

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/mfd/ab8500-debugfs.c:1395:6: warning: no previous prototype for 
'ab8500_dump_all_banks_to_mem' [-Wmissing-prototypes]

In fact, this function is called by no one and not exported,
so this patch removes it.

Signed-off-by: Baoyou Xie 
---
 drivers/mfd/ab8500-debugfs.c | 54 
 1 file changed, 54 deletions(-)

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 0aecd7b..9f04a25 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -1382,60 +1382,6 @@ void ab8500_dump_all_banks(struct device *dev)
}
 }
 
-/* Space for 500 registers. */
-#define DUMP_MAX_REGS 700
-static struct ab8500_register_dump
-{
-   u8 bank;
-   u8 reg;
-   u8 value;
-} ab8500_complete_register_dump[DUMP_MAX_REGS];
-
-/* This shall only be called upon kernel panic! */
-void ab8500_dump_all_banks_to_mem(void)
-{
-   int i, r = 0;
-   u8 bank;
-   int err = 0;
-
-   pr_info("Saving all ABB registers for crash analysis.\n");
-
-   for (bank = 0; bank < AB8500_NUM_BANKS; bank++) {
-   for (i = 0; i < debug_ranges[bank].num_ranges; i++) {
-   u8 reg;
-
-   for (reg = debug_ranges[bank].range[i].first;
-reg <= debug_ranges[bank].range[i].last;
-reg++) {
-   u8 value;
-
-   err = prcmu_abb_read(bank, reg, , 1);
-
-   if (err < 0)
-   goto out;
-
-   ab8500_complete_register_dump[r].bank = bank;
-   ab8500_complete_register_dump[r].reg = reg;
-   ab8500_complete_register_dump[r].value = value;
-
-   r++;
-
-   if (r >= DUMP_MAX_REGS) {
-   pr_err("%s: too many register to 
dump!\n",
-   __func__);
-   err = -EINVAL;
-   goto out;
-   }
-   }
-   }
-   }
-out:
-   if (err >= 0)
-   pr_info("Saved all ABB registers.\n");
-   else
-   pr_info("Failed to save all ABB registers.\n");
-}
-
 static int ab8500_all_banks_open(struct inode *inode, struct file *file)
 {
struct seq_file *s;
-- 
2.7.4



[PATCH 2/2] mfd: ab8500-debugfs: remove unused function

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/mfd/ab8500-debugfs.c:1395:6: warning: no previous prototype for 
'ab8500_dump_all_banks_to_mem' [-Wmissing-prototypes]

In fact, this function is called by no one and not exported,
so this patch removes it.

Signed-off-by: Baoyou Xie 
---
 drivers/mfd/ab8500-debugfs.c | 54 
 1 file changed, 54 deletions(-)

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 0aecd7b..9f04a25 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -1382,60 +1382,6 @@ void ab8500_dump_all_banks(struct device *dev)
}
 }
 
-/* Space for 500 registers. */
-#define DUMP_MAX_REGS 700
-static struct ab8500_register_dump
-{
-   u8 bank;
-   u8 reg;
-   u8 value;
-} ab8500_complete_register_dump[DUMP_MAX_REGS];
-
-/* This shall only be called upon kernel panic! */
-void ab8500_dump_all_banks_to_mem(void)
-{
-   int i, r = 0;
-   u8 bank;
-   int err = 0;
-
-   pr_info("Saving all ABB registers for crash analysis.\n");
-
-   for (bank = 0; bank < AB8500_NUM_BANKS; bank++) {
-   for (i = 0; i < debug_ranges[bank].num_ranges; i++) {
-   u8 reg;
-
-   for (reg = debug_ranges[bank].range[i].first;
-reg <= debug_ranges[bank].range[i].last;
-reg++) {
-   u8 value;
-
-   err = prcmu_abb_read(bank, reg, , 1);
-
-   if (err < 0)
-   goto out;
-
-   ab8500_complete_register_dump[r].bank = bank;
-   ab8500_complete_register_dump[r].reg = reg;
-   ab8500_complete_register_dump[r].value = value;
-
-   r++;
-
-   if (r >= DUMP_MAX_REGS) {
-   pr_err("%s: too many register to 
dump!\n",
-   __func__);
-   err = -EINVAL;
-   goto out;
-   }
-   }
-   }
-   }
-out:
-   if (err >= 0)
-   pr_info("Saved all ABB registers.\n");
-   else
-   pr_info("Failed to save all ABB registers.\n");
-}
-
 static int ab8500_all_banks_open(struct inode *inode, struct file *file)
 {
struct seq_file *s;
-- 
2.7.4



[PATCH 1/2] mfd: ab8500-debugfs: add function declaration

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/mfd/ab8500-debugfs.c:1587:28: warning: no previous prototype for 
'suspend_test_wake_cause_interrupt_is_mine' [-Wmissing-prototypes]

In fact, this function need be declared in a header files.

So this patch adds function declaration in
include/linux/mfd/abx500/ab8500.h.

Signed-off-by: Baoyou Xie 
---
 include/linux/mfd/abx500/ab8500.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/mfd/abx500/ab8500.h 
b/include/linux/mfd/abx500/ab8500.h
index 9475fee..a496120 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -508,6 +508,7 @@ void ab8500_override_turn_on_stat(u8 mask, u8 set);
 extern int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
 void ab8500_dump_all_banks(struct device *dev);
 void ab8500_debug_register_interrupt(int line);
+bool suspend_test_wake_cause_interrupt_is_mine(u32 my_int);
 #else
 static inline void ab8500_dump_all_banks(struct device *dev) {}
 static inline void ab8500_debug_register_interrupt(int line) {}
-- 
2.7.4



[PATCH 1/2] mfd: ab8500-debugfs: add function declaration

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/mfd/ab8500-debugfs.c:1587:28: warning: no previous prototype for 
'suspend_test_wake_cause_interrupt_is_mine' [-Wmissing-prototypes]

In fact, this function need be declared in a header files.

So this patch adds function declaration in
include/linux/mfd/abx500/ab8500.h.

Signed-off-by: Baoyou Xie 
---
 include/linux/mfd/abx500/ab8500.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/mfd/abx500/ab8500.h 
b/include/linux/mfd/abx500/ab8500.h
index 9475fee..a496120 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -508,6 +508,7 @@ void ab8500_override_turn_on_stat(u8 mask, u8 set);
 extern int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
 void ab8500_dump_all_banks(struct device *dev);
 void ab8500_debug_register_interrupt(int line);
+bool suspend_test_wake_cause_interrupt_is_mine(u32 my_int);
 #else
 static inline void ab8500_dump_all_banks(struct device *dev) {}
 static inline void ab8500_debug_register_interrupt(int line) {}
-- 
2.7.4



[PATCH] memstick: r592: add function declaration

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/memstick/host/r592.c:50:13: warning: no previous prototype for 
'memstick_debug_get_tpc_name' [-Wmissing-prototypes]

In fact, this function need be declared in a header files.

So this patch adds function declaration in
drivers/memstick/host/r592.h.

Signed-off-by: Baoyou Xie 
---
 drivers/memstick/host/r592.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/memstick/host/r592.h b/drivers/memstick/host/r592.h
index c5726c1..c5d91cd 100644
--- a/drivers/memstick/host/r592.h
+++ b/drivers/memstick/host/r592.h
@@ -172,4 +172,6 @@ struct r592_device {
 #define dbg_verbose(format, ...)   __dbg(2, format, ## __VA_ARGS__)
 #define dbg_reg(format, ...)   __dbg(3, format, ## __VA_ARGS__)
 
+const char *memstick_debug_get_tpc_name(int tpc);
+
 #endif
-- 
2.7.4



[PATCH] memstick: r592: add function declaration

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/memstick/host/r592.c:50:13: warning: no previous prototype for 
'memstick_debug_get_tpc_name' [-Wmissing-prototypes]

In fact, this function need be declared in a header files.

So this patch adds function declaration in
drivers/memstick/host/r592.h.

Signed-off-by: Baoyou Xie 
---
 drivers/memstick/host/r592.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/memstick/host/r592.h b/drivers/memstick/host/r592.h
index c5726c1..c5d91cd 100644
--- a/drivers/memstick/host/r592.h
+++ b/drivers/memstick/host/r592.h
@@ -172,4 +172,6 @@ struct r592_device {
 #define dbg_verbose(format, ...)   __dbg(2, format, ## __VA_ARGS__)
 #define dbg_reg(format, ...)   __dbg(3, format, ## __VA_ARGS__)
 
+const char *memstick_debug_get_tpc_name(int tpc);
+
 #endif
-- 
2.7.4



[PATCH] [media] coda: add missing header dependencies

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/media/platform/coda/coda-h264.c:21:5: warning: no previous prototype 
for 'coda_h264_padding' [-Wmissing-prototypes]

In fact, this function is declared in drivers/media/platform/coda/coda.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/media/platform/coda/coda-h264.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/coda/coda-h264.c 
b/drivers/media/platform/coda/coda-h264.c
index 456773a..6d6f555 100644
--- a/drivers/media/platform/coda/coda-h264.c
+++ b/drivers/media/platform/coda/coda-h264.c
@@ -13,6 +13,7 @@
 
 #include 
 #include 
+#include "coda.h"
 
 static const u8 coda_filler_nal[14] = { 0x00, 0x00, 0x00, 0x01, 0x0c, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80 };
-- 
2.7.4



[PATCH] [media] coda: add missing header dependencies

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/media/platform/coda/coda-h264.c:21:5: warning: no previous prototype 
for 'coda_h264_padding' [-Wmissing-prototypes]

In fact, this function is declared in drivers/media/platform/coda/coda.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/media/platform/coda/coda-h264.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/coda/coda-h264.c 
b/drivers/media/platform/coda/coda-h264.c
index 456773a..6d6f555 100644
--- a/drivers/media/platform/coda/coda-h264.c
+++ b/drivers/media/platform/coda/coda-h264.c
@@ -13,6 +13,7 @@
 
 #include 
 #include 
+#include "coda.h"
 
 static const u8 coda_filler_nal[14] = { 0x00, 0x00, 0x00, 0x01, 0x0c, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80 };
-- 
2.7.4



Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation

2016-09-23 Thread H. Nikolaus Schaller
Hi,

> Am 24.09.2016 um 00:47 schrieb Rob Herring :
> 
> On Fri, Sep 23, 2016 at 02:41:09PM +0200, H. Nikolaus Schaller wrote:
>> commit b98abe52fa8e ("Input: add common DT binding for touchscreens")
>> introduced common DT bindings for touchscreens [1] and a helper function to
>> parse the DT.
>> 
>> commit ed7c9870c9bc ("Input: of_touchscreen - add support for inverted / 
>> swapped axes")
>> added another helper for parsing axis inversion and swapping
>> and applying them to x and y coordinates.
>> 
>> Both helpers have been integrated to accommodate any orientation of the
>> touch panel in relation to the LCD.
>> 
>> A new feature is to introduce scaling the min/max ADC values to the screen
>> size.
>> 
>> This makes it possible to pre-calibrate the touch so that is (almost)
>> exactly matches the LCD pixel coordinates it is glued onto. This allows to
>> well enough operate the touch before a user space calibration step can
>> improve the precision.
>> 
>> Finally, calculate_pressure has been renamed to calculate_resistance
>> because that is what it is doing.
> 
> Seems like you are breaking compatibility with old DTs. I can't tell for 
> sure though.

There is code to take missing values as 0 or maximum. So this will scale 1:1
and should not break old DTs.

> 
>> 
>> [1]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
>> 
>> Signed-off-by: H. Nikolaus Schaller 
>> ---
>> .../bindings/input/touchscreen/tsc2007.txt |  20 ++--
>> drivers/input/touchscreen/tsc2007.c| 126 
>> +
>> include/linux/i2c/tsc2007.h|   8 ++
>> 3 files changed, 123 insertions(+), 31 deletions(-)
>> 
>> diff --git a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt 
>> b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>> index ec365e1..6e9fd55 100644
>> --- a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>> +++ b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>> @@ -6,6 +6,7 @@ Required properties:
>> - ti,x-plate-ohms: X-plate resistance in ohms.
>> 
>> Optional properties:
>> +- generic touch screen properties: see touchscreen binding [2].
>> - gpios: the interrupt gpio the chip is connected to (trough the penirq pin).
>>   The penirq pin goes to low when the panel is touched.
>>   (see GPIO binding[1] for more details).
>> @@ -13,17 +14,20 @@ Optional properties:
>>   (see interrupt binding[0]).
>> - interrupts: (gpio) interrupt to which the chip is connected
>>   (see interrupt binding[0]).
>> -- ti,max-rt: maximum pressure.
>> -- ti,fuzzx: specifies the absolute input fuzz x value.
>> -  If set, it will permit noise in the data up to +- the value given to the 
>> fuzz
>> -  parameter, that is used to filter noise from the event stream.
>> -- ti,fuzzy: specifies the absolute input fuzz y value.
>> -- ti,fuzzz: specifies the absolute input fuzz z value.
>> +- ti,max-rt: maximum pressure resistance above which samples are ignored
>> +  (default: 4095).
>> +- ti,report-resistance: report resistance (no pressure = max_rt) instead
>> +  of pressure (no pressure = 0).
>> +- ti,min-x: minimum value reported by X axis ADC (default 0).
>> +- ti,max-x: maximum value reported by X axis ADC (default 4095).
>> +- ti,min-y: minimum value reported by Y axis ADC (default 0).
>> +- ti,max-y: maximum value reported by Y axis ADC (default 4095).
> 
> Seems like these could be common too. They make more sense than giving x 
> and y sizes in pixel units which really should come from the panel.

No. They have a different purpose!

You need to scale values like this:

ti,min-x   ->   0
x  ->   some value between 0 and touchscreen-size-x
ti,max-x   ->   touchscreen-size-x

So the ti, values describe the ADC raw values while the common bindings
describe the size in input-event coordinates.

So we need both specified: raw values and pixel values.

> 
>> - ti,poll-period: how much time to wait (in milliseconds) before reading 
>> again the
>> -  values from the tsc2007.
>> +  values from the tsc2007 (default 1).
>> 
>> [0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
>> [1]: Documentation/devicetree/bindings/gpio/gpio.txt
>> +[2]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
>> 
>> Example:
>>   {
>> @@ -35,6 +39,8 @@ Example:
>>  interrupts = <0x0 0x8>;
>>  gpios = < 0 0>;
>>  ti,x-plate-ohms = <180>;
>> +touchscreen-size-x = <640>;
>> +touchscreen-size-y = <480>;
>>  };
>> 
>>  /* ... */

BR,
Nikolaus



Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation

2016-09-23 Thread H. Nikolaus Schaller
Hi,

> Am 24.09.2016 um 00:47 schrieb Rob Herring :
> 
> On Fri, Sep 23, 2016 at 02:41:09PM +0200, H. Nikolaus Schaller wrote:
>> commit b98abe52fa8e ("Input: add common DT binding for touchscreens")
>> introduced common DT bindings for touchscreens [1] and a helper function to
>> parse the DT.
>> 
>> commit ed7c9870c9bc ("Input: of_touchscreen - add support for inverted / 
>> swapped axes")
>> added another helper for parsing axis inversion and swapping
>> and applying them to x and y coordinates.
>> 
>> Both helpers have been integrated to accommodate any orientation of the
>> touch panel in relation to the LCD.
>> 
>> A new feature is to introduce scaling the min/max ADC values to the screen
>> size.
>> 
>> This makes it possible to pre-calibrate the touch so that is (almost)
>> exactly matches the LCD pixel coordinates it is glued onto. This allows to
>> well enough operate the touch before a user space calibration step can
>> improve the precision.
>> 
>> Finally, calculate_pressure has been renamed to calculate_resistance
>> because that is what it is doing.
> 
> Seems like you are breaking compatibility with old DTs. I can't tell for 
> sure though.

There is code to take missing values as 0 or maximum. So this will scale 1:1
and should not break old DTs.

> 
>> 
>> [1]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
>> 
>> Signed-off-by: H. Nikolaus Schaller 
>> ---
>> .../bindings/input/touchscreen/tsc2007.txt |  20 ++--
>> drivers/input/touchscreen/tsc2007.c| 126 
>> +
>> include/linux/i2c/tsc2007.h|   8 ++
>> 3 files changed, 123 insertions(+), 31 deletions(-)
>> 
>> diff --git a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt 
>> b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>> index ec365e1..6e9fd55 100644
>> --- a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>> +++ b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
>> @@ -6,6 +6,7 @@ Required properties:
>> - ti,x-plate-ohms: X-plate resistance in ohms.
>> 
>> Optional properties:
>> +- generic touch screen properties: see touchscreen binding [2].
>> - gpios: the interrupt gpio the chip is connected to (trough the penirq pin).
>>   The penirq pin goes to low when the panel is touched.
>>   (see GPIO binding[1] for more details).
>> @@ -13,17 +14,20 @@ Optional properties:
>>   (see interrupt binding[0]).
>> - interrupts: (gpio) interrupt to which the chip is connected
>>   (see interrupt binding[0]).
>> -- ti,max-rt: maximum pressure.
>> -- ti,fuzzx: specifies the absolute input fuzz x value.
>> -  If set, it will permit noise in the data up to +- the value given to the 
>> fuzz
>> -  parameter, that is used to filter noise from the event stream.
>> -- ti,fuzzy: specifies the absolute input fuzz y value.
>> -- ti,fuzzz: specifies the absolute input fuzz z value.
>> +- ti,max-rt: maximum pressure resistance above which samples are ignored
>> +  (default: 4095).
>> +- ti,report-resistance: report resistance (no pressure = max_rt) instead
>> +  of pressure (no pressure = 0).
>> +- ti,min-x: minimum value reported by X axis ADC (default 0).
>> +- ti,max-x: maximum value reported by X axis ADC (default 4095).
>> +- ti,min-y: minimum value reported by Y axis ADC (default 0).
>> +- ti,max-y: maximum value reported by Y axis ADC (default 4095).
> 
> Seems like these could be common too. They make more sense than giving x 
> and y sizes in pixel units which really should come from the panel.

No. They have a different purpose!

You need to scale values like this:

ti,min-x   ->   0
x  ->   some value between 0 and touchscreen-size-x
ti,max-x   ->   touchscreen-size-x

So the ti, values describe the ADC raw values while the common bindings
describe the size in input-event coordinates.

So we need both specified: raw values and pixel values.

> 
>> - ti,poll-period: how much time to wait (in milliseconds) before reading 
>> again the
>> -  values from the tsc2007.
>> +  values from the tsc2007 (default 1).
>> 
>> [0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
>> [1]: Documentation/devicetree/bindings/gpio/gpio.txt
>> +[2]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
>> 
>> Example:
>>   {
>> @@ -35,6 +39,8 @@ Example:
>>  interrupts = <0x0 0x8>;
>>  gpios = < 0 0>;
>>  ti,x-plate-ohms = <180>;
>> +touchscreen-size-x = <640>;
>> +touchscreen-size-y = <480>;
>>  };
>> 
>>  /* ... */

BR,
Nikolaus



[PATCH 6/6] mISDN: remove unused function

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/isdn/mISDN/layer2.c:463:1: warning: no previous declaration for 'IsRR' 
[-Wmissing-declarations]

In fact, this function is called by no one and not exported,
so this patch removes it.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/mISDN/layer2.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c
index f6ab6027..2519510 100644
--- a/drivers/isdn/mISDN/layer2.c
+++ b/drivers/isdn/mISDN/layer2.c
@@ -459,15 +459,6 @@ IsDISC(u_char *data)
return (data[0] & 0xef) == DISC;
 }
 
-inline int
-IsRR(u_char *data, struct layer2 *l2)
-{
-   if (test_bit(FLG_MOD128, >flag))
-   return data[0] == RR;
-   else
-   return (data[0] & 0xf) == 1;
-}
-
 static inline int
 IsSFrame(u_char *data, struct layer2 *l2)
 {
-- 
2.7.4



[PATCH 6/6] mISDN: remove unused function

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/isdn/mISDN/layer2.c:463:1: warning: no previous declaration for 'IsRR' 
[-Wmissing-declarations]

In fact, this function is called by no one and not exported,
so this patch removes it.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/mISDN/layer2.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c
index f6ab6027..2519510 100644
--- a/drivers/isdn/mISDN/layer2.c
+++ b/drivers/isdn/mISDN/layer2.c
@@ -459,15 +459,6 @@ IsDISC(u_char *data)
return (data[0] & 0xef) == DISC;
 }
 
-inline int
-IsRR(u_char *data, struct layer2 *l2)
-{
-   if (test_bit(FLG_MOD128, >flag))
-   return data[0] == RR;
-   else
-   return (data[0] & 0xf) == 1;
-}
-
 static inline int
 IsSFrame(u_char *data, struct layer2 *l2)
 {
-- 
2.7.4



[PATCH 5/6] mISDN: mark symbols static where possible

2016-09-23 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/isdn/mISDN/layer2.c:120:1: warning: no previous declaration for 
'l2headersize' [-Wmissing-declarations]
drivers/isdn/mISDN/layer2.c:127:1: warning: no previous declaration for 
'l2addrsize' [-Wmissing-declarations]
drivers/isdn/mISDN/layer2.c:379:1: warning: no previous declaration for 
'cansend' [-Wmissing-declarations]
drivers/isdn/mISDN/layer2.c:679:1: warning: no previous declaration for 
'stop_t200' [-Wmissing-declarations]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/mISDN/layer2.c | 44 ++--
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c
index 5eb380a..f6ab6027 100644
--- a/drivers/isdn/mISDN/layer2.c
+++ b/drivers/isdn/mISDN/layer2.c
@@ -116,14 +116,14 @@ l2m_debug(struct FsmInst *fi, char *fmt, ...)
va_end(va);
 }
 
-inline u_int
+static inline u_int
 l2headersize(struct layer2 *l2, int ui)
 {
return ((test_bit(FLG_MOD128, >flag) && (!ui)) ? 2 : 1) +
(test_bit(FLG_LAPD, >flag) ? 2 : 1);
 }
 
-inline u_int
+static inline u_int
 l2addrsize(struct layer2 *l2)
 {
return test_bit(FLG_LAPD, >flag) ? 2 : 1;
@@ -375,7 +375,7 @@ ReleaseWin(struct layer2 *l2)
   "isdnl2 freed %d skbuffs in release\n", cnt);
 }
 
-inline unsigned int
+static inline unsigned int
 cansend(struct layer2 *l2)
 {
unsigned int p1;
@@ -387,7 +387,7 @@ cansend(struct layer2 *l2)
return (p1 < l2->window) && !test_bit(FLG_PEER_BUSY, >flag);
 }
 
-inline void
+static inline void
 clear_exception(struct layer2 *l2)
 {
test_and_clear_bit(FLG_ACK_PEND, >flag);
@@ -435,25 +435,25 @@ enqueue_ui(struct layer2 *l2, struct sk_buff *skb)
dev_kfree_skb(skb);
 }
 
-inline int
+static inline int
 IsUI(u_char *data)
 {
return (data[0] & 0xef) == UI;
 }
 
-inline int
+static inline int
 IsUA(u_char *data)
 {
return (data[0] & 0xef) == UA;
 }
 
-inline int
+static inline int
 IsDM(u_char *data)
 {
return (data[0] & 0xef) == DM;
 }
 
-inline int
+static inline int
 IsDISC(u_char *data)
 {
return (data[0] & 0xef) == DISC;
@@ -468,7 +468,7 @@ IsRR(u_char *data, struct layer2 *l2)
return (data[0] & 0xf) == 1;
 }
 
-inline int
+static inline int
 IsSFrame(u_char *data, struct layer2 *l2)
 {
register u_char d = *data;
@@ -478,7 +478,7 @@ IsSFrame(u_char *data, struct layer2 *l2)
return ((d & 0xf3) == 1) && ((d & 0x0c) != 0x0c);
 }
 
-inline int
+static inline int
 IsSABME(u_char *data, struct layer2 *l2)
 {
u_char d = data[0] & ~0x10;
@@ -486,20 +486,20 @@ IsSABME(u_char *data, struct layer2 *l2)
return test_bit(FLG_MOD128, >flag) ? d == SABME : d == SABM;
 }
 
-inline int
+static inline int
 IsREJ(u_char *data, struct layer2 *l2)
 {
return test_bit(FLG_MOD128, >flag) ?
data[0] == REJ : (data[0] & 0xf) == REJ;
 }
 
-inline int
+static inline int
 IsFRMR(u_char *data)
 {
return (data[0] & 0xef) == FRMR;
 }
 
-inline int
+static inline int
 IsRNR(u_char *data, struct layer2 *l2)
 {
return test_bit(FLG_MOD128, >flag) ?
@@ -645,13 +645,13 @@ send_uframe(struct layer2 *l2, struct sk_buff *skb, 
u_char cmd, u_char cr)
 }
 
 
-inline u_char
+static inline u_char
 get_PollFlag(struct layer2 *l2, struct sk_buff *skb)
 {
return skb->data[l2addrsize(l2)] & 0x10;
 }
 
-inline u_char
+static inline u_char
 get_PollFlagFree(struct layer2 *l2, struct sk_buff *skb)
 {
u_char PF;
@@ -661,28 +661,28 @@ get_PollFlagFree(struct layer2 *l2, struct sk_buff *skb)
return PF;
 }
 
-inline void
+static inline void
 start_t200(struct layer2 *l2, int i)
 {
mISDN_FsmAddTimer(>t200, l2->T200, EV_L2_T200, NULL, i);
test_and_set_bit(FLG_T200_RUN, >flag);
 }
 
-inline void
+static inline void
 restart_t200(struct layer2 *l2, int i)
 {
mISDN_FsmRestartTimer(>t200, l2->T200, EV_L2_T200, NULL, i);
test_and_set_bit(FLG_T200_RUN, >flag);
 }
 
-inline void
+static inline void
 stop_t200(struct layer2 *l2, int i)
 {
if (test_and_clear_bit(FLG_T200_RUN, >flag))
mISDN_FsmDelTimer(>t200, i);
 }
 
-inline void
+static inline void
 st5_dl_release_l2l3(struct layer2 *l2)
 {
int pr;
@@ -694,7 +694,7 @@ st5_dl_release_l2l3(struct layer2 *l2)
l2up_create(l2, pr, 0, NULL);
 }
 
-inline void
+static inline void
 lapb_dl_release_l2l3(struct layer2 *l2, int f)
 {
if (test_bit(FLG_LAPB, >flag))
@@ -1129,7 +1129,7 @@ enquiry_cr(struct layer2 *l2, u_char typ, u_char cr, 
u_char pf)
enqueue_super(l2, skb);
 }
 
-inline void
+static inline void
 enquiry_response(struct layer2 *l2)
 {
if 

[PATCH 5/6] mISDN: mark symbols static where possible

2016-09-23 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/isdn/mISDN/layer2.c:120:1: warning: no previous declaration for 
'l2headersize' [-Wmissing-declarations]
drivers/isdn/mISDN/layer2.c:127:1: warning: no previous declaration for 
'l2addrsize' [-Wmissing-declarations]
drivers/isdn/mISDN/layer2.c:379:1: warning: no previous declaration for 
'cansend' [-Wmissing-declarations]
drivers/isdn/mISDN/layer2.c:679:1: warning: no previous declaration for 
'stop_t200' [-Wmissing-declarations]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/mISDN/layer2.c | 44 ++--
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c
index 5eb380a..f6ab6027 100644
--- a/drivers/isdn/mISDN/layer2.c
+++ b/drivers/isdn/mISDN/layer2.c
@@ -116,14 +116,14 @@ l2m_debug(struct FsmInst *fi, char *fmt, ...)
va_end(va);
 }
 
-inline u_int
+static inline u_int
 l2headersize(struct layer2 *l2, int ui)
 {
return ((test_bit(FLG_MOD128, >flag) && (!ui)) ? 2 : 1) +
(test_bit(FLG_LAPD, >flag) ? 2 : 1);
 }
 
-inline u_int
+static inline u_int
 l2addrsize(struct layer2 *l2)
 {
return test_bit(FLG_LAPD, >flag) ? 2 : 1;
@@ -375,7 +375,7 @@ ReleaseWin(struct layer2 *l2)
   "isdnl2 freed %d skbuffs in release\n", cnt);
 }
 
-inline unsigned int
+static inline unsigned int
 cansend(struct layer2 *l2)
 {
unsigned int p1;
@@ -387,7 +387,7 @@ cansend(struct layer2 *l2)
return (p1 < l2->window) && !test_bit(FLG_PEER_BUSY, >flag);
 }
 
-inline void
+static inline void
 clear_exception(struct layer2 *l2)
 {
test_and_clear_bit(FLG_ACK_PEND, >flag);
@@ -435,25 +435,25 @@ enqueue_ui(struct layer2 *l2, struct sk_buff *skb)
dev_kfree_skb(skb);
 }
 
-inline int
+static inline int
 IsUI(u_char *data)
 {
return (data[0] & 0xef) == UI;
 }
 
-inline int
+static inline int
 IsUA(u_char *data)
 {
return (data[0] & 0xef) == UA;
 }
 
-inline int
+static inline int
 IsDM(u_char *data)
 {
return (data[0] & 0xef) == DM;
 }
 
-inline int
+static inline int
 IsDISC(u_char *data)
 {
return (data[0] & 0xef) == DISC;
@@ -468,7 +468,7 @@ IsRR(u_char *data, struct layer2 *l2)
return (data[0] & 0xf) == 1;
 }
 
-inline int
+static inline int
 IsSFrame(u_char *data, struct layer2 *l2)
 {
register u_char d = *data;
@@ -478,7 +478,7 @@ IsSFrame(u_char *data, struct layer2 *l2)
return ((d & 0xf3) == 1) && ((d & 0x0c) != 0x0c);
 }
 
-inline int
+static inline int
 IsSABME(u_char *data, struct layer2 *l2)
 {
u_char d = data[0] & ~0x10;
@@ -486,20 +486,20 @@ IsSABME(u_char *data, struct layer2 *l2)
return test_bit(FLG_MOD128, >flag) ? d == SABME : d == SABM;
 }
 
-inline int
+static inline int
 IsREJ(u_char *data, struct layer2 *l2)
 {
return test_bit(FLG_MOD128, >flag) ?
data[0] == REJ : (data[0] & 0xf) == REJ;
 }
 
-inline int
+static inline int
 IsFRMR(u_char *data)
 {
return (data[0] & 0xef) == FRMR;
 }
 
-inline int
+static inline int
 IsRNR(u_char *data, struct layer2 *l2)
 {
return test_bit(FLG_MOD128, >flag) ?
@@ -645,13 +645,13 @@ send_uframe(struct layer2 *l2, struct sk_buff *skb, 
u_char cmd, u_char cr)
 }
 
 
-inline u_char
+static inline u_char
 get_PollFlag(struct layer2 *l2, struct sk_buff *skb)
 {
return skb->data[l2addrsize(l2)] & 0x10;
 }
 
-inline u_char
+static inline u_char
 get_PollFlagFree(struct layer2 *l2, struct sk_buff *skb)
 {
u_char PF;
@@ -661,28 +661,28 @@ get_PollFlagFree(struct layer2 *l2, struct sk_buff *skb)
return PF;
 }
 
-inline void
+static inline void
 start_t200(struct layer2 *l2, int i)
 {
mISDN_FsmAddTimer(>t200, l2->T200, EV_L2_T200, NULL, i);
test_and_set_bit(FLG_T200_RUN, >flag);
 }
 
-inline void
+static inline void
 restart_t200(struct layer2 *l2, int i)
 {
mISDN_FsmRestartTimer(>t200, l2->T200, EV_L2_T200, NULL, i);
test_and_set_bit(FLG_T200_RUN, >flag);
 }
 
-inline void
+static inline void
 stop_t200(struct layer2 *l2, int i)
 {
if (test_and_clear_bit(FLG_T200_RUN, >flag))
mISDN_FsmDelTimer(>t200, i);
 }
 
-inline void
+static inline void
 st5_dl_release_l2l3(struct layer2 *l2)
 {
int pr;
@@ -694,7 +694,7 @@ st5_dl_release_l2l3(struct layer2 *l2)
l2up_create(l2, pr, 0, NULL);
 }
 
-inline void
+static inline void
 lapb_dl_release_l2l3(struct layer2 *l2, int f)
 {
if (test_bit(FLG_LAPB, >flag))
@@ -1129,7 +1129,7 @@ enquiry_cr(struct layer2 *l2, u_char typ, u_char cr, 
u_char pf)
enqueue_super(l2, skb);
 }
 
-inline void
+static inline void
 enquiry_response(struct layer2 *l2)
 {
if (test_bit(FLG_OWN_BUSY, >flag))

[PATCH 4/6] isdn/hisax: clean function declaration in hscx.c up

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/isdn/hisax/hscx.c:175:1: warning: no previous prototype for 
'open_hscxstate' [-Wmissing-prototypes]

In fact, this function is declared in
drivers/isdn/hisax/elsa_ser.c, but should be
declard in a header file, thus can be recognized in other file.

So this patch moves the declaration into drivers/isdn/hisax/hscx.h.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/hisax/elsa_ser.c | 2 +-
 drivers/isdn/hisax/hscx.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c
index a2a358c..34ccc18 100644
--- a/drivers/isdn/hisax/elsa_ser.c
+++ b/drivers/isdn/hisax/elsa_ser.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include "hscx.h"
 
 #define MAX_MODEM_BUF  256
 #define WAKEUP_CHARS   (MAX_MODEM_BUF / 2)
@@ -419,7 +420,6 @@ static void rs_interrupt_elsa(struct IsdnCardState *cs)
 #endif
 }
 
-extern int open_hscxstate(struct IsdnCardState *cs, struct BCState *bcs);
 extern void modehscx(struct BCState *bcs, int mode, int bc);
 extern void hscx_l2l1(struct PStack *st, int pr, void *arg);
 
diff --git a/drivers/isdn/hisax/hscx.h b/drivers/isdn/hisax/hscx.h
index 1148b4b..fa7bf16 100644
--- a/drivers/isdn/hisax/hscx.h
+++ b/drivers/isdn/hisax/hscx.h
@@ -39,3 +39,4 @@ extern void modehscx(struct BCState *bcs, int mode, int bc);
 extern void clear_pending_hscx_ints(struct IsdnCardState *cs);
 extern void inithscx(struct IsdnCardState *cs);
 extern void inithscxisac(struct IsdnCardState *cs, int part);
+int open_hscxstate(struct IsdnCardState *cs, struct BCState *bcs);
-- 
2.7.4



[PATCH 4/6] isdn/hisax: clean function declaration in hscx.c up

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/isdn/hisax/hscx.c:175:1: warning: no previous prototype for 
'open_hscxstate' [-Wmissing-prototypes]

In fact, this function is declared in
drivers/isdn/hisax/elsa_ser.c, but should be
declard in a header file, thus can be recognized in other file.

So this patch moves the declaration into drivers/isdn/hisax/hscx.h.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/hisax/elsa_ser.c | 2 +-
 drivers/isdn/hisax/hscx.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c
index a2a358c..34ccc18 100644
--- a/drivers/isdn/hisax/elsa_ser.c
+++ b/drivers/isdn/hisax/elsa_ser.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include "hscx.h"
 
 #define MAX_MODEM_BUF  256
 #define WAKEUP_CHARS   (MAX_MODEM_BUF / 2)
@@ -419,7 +420,6 @@ static void rs_interrupt_elsa(struct IsdnCardState *cs)
 #endif
 }
 
-extern int open_hscxstate(struct IsdnCardState *cs, struct BCState *bcs);
 extern void modehscx(struct BCState *bcs, int mode, int bc);
 extern void hscx_l2l1(struct PStack *st, int pr, void *arg);
 
diff --git a/drivers/isdn/hisax/hscx.h b/drivers/isdn/hisax/hscx.h
index 1148b4b..fa7bf16 100644
--- a/drivers/isdn/hisax/hscx.h
+++ b/drivers/isdn/hisax/hscx.h
@@ -39,3 +39,4 @@ extern void modehscx(struct BCState *bcs, int mode, int bc);
 extern void clear_pending_hscx_ints(struct IsdnCardState *cs);
 extern void inithscx(struct IsdnCardState *cs);
 extern void inithscxisac(struct IsdnCardState *cs, int part);
+int open_hscxstate(struct IsdnCardState *cs, struct BCState *bcs);
-- 
2.7.4



[PATCH 3/6] isdn/hisax: add function declarations

2016-09-23 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/isdn/hisax/teles3.c:273:5: warning: no previous prototype for 
'setup_teles3' [-Wmissing-prototypes]
drivers/isdn/hisax/s0box.c:213:5: warning: no previous prototype for 
'setup_s0box' [-Wmissing-prototypes]
drivers/isdn/hisax/bkm_a4t.c:325:5: warning: no previous prototype for 
'setup_bkm_a4t' [-Wmissing-prototypes]
drivers/isdn/hisax/w6692.c:996:5: warning: no previous prototype for 
'setup_w6692' [-Wmissing-prototypes]


In fact, these functions need be declared in some header files.

So this patch adds function declarations in drivers/isdn/hisax/hisax.h.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/hisax/config.c | 60 -
 drivers/isdn/hisax/hisax.h  | 60 +
 2 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index bf04d2a..5335c8b 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -460,42 +460,14 @@ __setup("hisax=", HiSax_setup);
 extern int setup_teles0(struct IsdnCard *card);
 #endif
 
-#if CARD_TELES3
-extern int setup_teles3(struct IsdnCard *card);
-#endif
-
-#if CARD_S0BOX
-extern int setup_s0box(struct IsdnCard *card);
-#endif
-
-#if CARD_TELESPCI
-extern int setup_telespci(struct IsdnCard *card);
-#endif
-
 #if CARD_AVM_A1
 extern int setup_avm_a1(struct IsdnCard *card);
 #endif
 
-#if CARD_AVM_A1_PCMCIA
-extern int setup_avm_a1_pcmcia(struct IsdnCard *card);
-#endif
-
-#if CARD_FRITZPCI
-extern int setup_avm_pcipnp(struct IsdnCard *card);
-#endif
-
-#if CARD_ELSA
-extern int setup_elsa(struct IsdnCard *card);
-#endif
-
 #if CARD_IX1MICROR2
 extern int setup_ix1micro(struct IsdnCard *card);
 #endif
 
-#if CARD_DIEHLDIVA
-extern int setup_diva(struct IsdnCard *card);
-#endif
-
 #if CARD_ASUSCOM
 extern int setup_asuscom(struct IsdnCard *card);
 #endif
@@ -504,10 +476,6 @@ extern int setup_asuscom(struct IsdnCard *card);
 extern int setup_TeleInt(struct IsdnCard *card);
 #endif
 
-#if CARD_SEDLBAUER
-extern int setup_sedlbauer(struct IsdnCard *card);
-#endif
-
 #if CARD_SPORTSTER
 extern int setup_sportster(struct IsdnCard *card);
 #endif
@@ -524,18 +492,6 @@ extern int setup_netjet_s(struct IsdnCard *card);
 extern int setup_hfcs(struct IsdnCard *card);
 #endif
 
-#if CARD_HFC_PCI
-extern int setup_hfcpci(struct IsdnCard *card);
-#endif
-
-#if CARD_HFC_SX
-extern int setup_hfcsx(struct IsdnCard *card);
-#endif
-
-#if CARD_NICCY
-extern int setup_niccy(struct IsdnCard *card);
-#endif
-
 #if CARD_ISURF
 extern int setup_isurf(struct IsdnCard *card);
 #endif
@@ -544,22 +500,6 @@ extern int setup_isurf(struct IsdnCard *card);
 extern int setup_saphir(struct IsdnCard *card);
 #endif
 
-#if CARD_BKM_A4T
-extern int setup_bkm_a4t(struct IsdnCard *card);
-#endif
-
-#if CARD_SCT_QUADRO
-extern int setup_sct_quadro(struct IsdnCard *card);
-#endif
-
-#if CARD_GAZEL
-extern int setup_gazel(struct IsdnCard *card);
-#endif
-
-#if CARD_W6692
-extern int setup_w6692(struct IsdnCard *card);
-#endif
-
 #if CARD_NETJET_U
 extern int setup_netjet_u(struct IsdnCard *card);
 #endif
diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h
index 6ead6314..7e1d2a6 100644
--- a/drivers/isdn/hisax/hisax.h
+++ b/drivers/isdn/hisax/hisax.h
@@ -1350,3 +1350,63 @@ static inline struct pci_dev 
*hisax_find_pci_device(unsigned int vendor,
 }
 
 #endif
+
+#if CARD_TELES3
+int setup_teles3(struct IsdnCard *card);
+#endif
+
+#if CARD_TELESPCI
+int setup_telespci(struct IsdnCard *card);
+#endif
+
+#if CARD_S0BOX
+int setup_s0box(struct IsdnCard *card);
+#endif
+
+#if CARD_AVM_A1_PCMCIA
+int setup_avm_a1_pcmcia(struct IsdnCard *card);
+#endif
+
+#if CARD_FRITZPCI
+int setup_avm_pcipnp(struct IsdnCard *card);
+#endif
+
+#if CARD_ELSA
+int setup_elsa(struct IsdnCard *card);
+#endif
+
+#if CARD_DIEHLDIVA
+int setup_diva(struct IsdnCard *card);
+#endif
+
+#if CARD_SEDLBAUER
+int setup_sedlbauer(struct IsdnCard *card);
+#endif
+
+#if CARD_HFC_PCI
+int setup_hfcpci(struct IsdnCard *card);
+#endif
+
+#if CARD_HFC_SX
+int setup_hfcsx(struct IsdnCard *card);
+#endif
+
+#if CARD_NICCY
+int setup_niccy(struct IsdnCard *card);
+#endif
+
+#if CARD_BKM_A4T
+int setup_bkm_a4t(struct IsdnCard *card);
+#endif
+
+#if CARD_SCT_QUADRO
+int setup_sct_quadro(struct IsdnCard *card);
+#endif
+
+#if CARD_GAZEL
+int setup_gazel(struct IsdnCard *card);
+#endif
+
+#if CARD_W6692
+int setup_w6692(struct IsdnCard *card);
+#endif
-- 
2.7.4



[PATCH 3/6] isdn/hisax: add function declarations

2016-09-23 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/isdn/hisax/teles3.c:273:5: warning: no previous prototype for 
'setup_teles3' [-Wmissing-prototypes]
drivers/isdn/hisax/s0box.c:213:5: warning: no previous prototype for 
'setup_s0box' [-Wmissing-prototypes]
drivers/isdn/hisax/bkm_a4t.c:325:5: warning: no previous prototype for 
'setup_bkm_a4t' [-Wmissing-prototypes]
drivers/isdn/hisax/w6692.c:996:5: warning: no previous prototype for 
'setup_w6692' [-Wmissing-prototypes]


In fact, these functions need be declared in some header files.

So this patch adds function declarations in drivers/isdn/hisax/hisax.h.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/hisax/config.c | 60 -
 drivers/isdn/hisax/hisax.h  | 60 +
 2 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index bf04d2a..5335c8b 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -460,42 +460,14 @@ __setup("hisax=", HiSax_setup);
 extern int setup_teles0(struct IsdnCard *card);
 #endif
 
-#if CARD_TELES3
-extern int setup_teles3(struct IsdnCard *card);
-#endif
-
-#if CARD_S0BOX
-extern int setup_s0box(struct IsdnCard *card);
-#endif
-
-#if CARD_TELESPCI
-extern int setup_telespci(struct IsdnCard *card);
-#endif
-
 #if CARD_AVM_A1
 extern int setup_avm_a1(struct IsdnCard *card);
 #endif
 
-#if CARD_AVM_A1_PCMCIA
-extern int setup_avm_a1_pcmcia(struct IsdnCard *card);
-#endif
-
-#if CARD_FRITZPCI
-extern int setup_avm_pcipnp(struct IsdnCard *card);
-#endif
-
-#if CARD_ELSA
-extern int setup_elsa(struct IsdnCard *card);
-#endif
-
 #if CARD_IX1MICROR2
 extern int setup_ix1micro(struct IsdnCard *card);
 #endif
 
-#if CARD_DIEHLDIVA
-extern int setup_diva(struct IsdnCard *card);
-#endif
-
 #if CARD_ASUSCOM
 extern int setup_asuscom(struct IsdnCard *card);
 #endif
@@ -504,10 +476,6 @@ extern int setup_asuscom(struct IsdnCard *card);
 extern int setup_TeleInt(struct IsdnCard *card);
 #endif
 
-#if CARD_SEDLBAUER
-extern int setup_sedlbauer(struct IsdnCard *card);
-#endif
-
 #if CARD_SPORTSTER
 extern int setup_sportster(struct IsdnCard *card);
 #endif
@@ -524,18 +492,6 @@ extern int setup_netjet_s(struct IsdnCard *card);
 extern int setup_hfcs(struct IsdnCard *card);
 #endif
 
-#if CARD_HFC_PCI
-extern int setup_hfcpci(struct IsdnCard *card);
-#endif
-
-#if CARD_HFC_SX
-extern int setup_hfcsx(struct IsdnCard *card);
-#endif
-
-#if CARD_NICCY
-extern int setup_niccy(struct IsdnCard *card);
-#endif
-
 #if CARD_ISURF
 extern int setup_isurf(struct IsdnCard *card);
 #endif
@@ -544,22 +500,6 @@ extern int setup_isurf(struct IsdnCard *card);
 extern int setup_saphir(struct IsdnCard *card);
 #endif
 
-#if CARD_BKM_A4T
-extern int setup_bkm_a4t(struct IsdnCard *card);
-#endif
-
-#if CARD_SCT_QUADRO
-extern int setup_sct_quadro(struct IsdnCard *card);
-#endif
-
-#if CARD_GAZEL
-extern int setup_gazel(struct IsdnCard *card);
-#endif
-
-#if CARD_W6692
-extern int setup_w6692(struct IsdnCard *card);
-#endif
-
 #if CARD_NETJET_U
 extern int setup_netjet_u(struct IsdnCard *card);
 #endif
diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h
index 6ead6314..7e1d2a6 100644
--- a/drivers/isdn/hisax/hisax.h
+++ b/drivers/isdn/hisax/hisax.h
@@ -1350,3 +1350,63 @@ static inline struct pci_dev 
*hisax_find_pci_device(unsigned int vendor,
 }
 
 #endif
+
+#if CARD_TELES3
+int setup_teles3(struct IsdnCard *card);
+#endif
+
+#if CARD_TELESPCI
+int setup_telespci(struct IsdnCard *card);
+#endif
+
+#if CARD_S0BOX
+int setup_s0box(struct IsdnCard *card);
+#endif
+
+#if CARD_AVM_A1_PCMCIA
+int setup_avm_a1_pcmcia(struct IsdnCard *card);
+#endif
+
+#if CARD_FRITZPCI
+int setup_avm_pcipnp(struct IsdnCard *card);
+#endif
+
+#if CARD_ELSA
+int setup_elsa(struct IsdnCard *card);
+#endif
+
+#if CARD_DIEHLDIVA
+int setup_diva(struct IsdnCard *card);
+#endif
+
+#if CARD_SEDLBAUER
+int setup_sedlbauer(struct IsdnCard *card);
+#endif
+
+#if CARD_HFC_PCI
+int setup_hfcpci(struct IsdnCard *card);
+#endif
+
+#if CARD_HFC_SX
+int setup_hfcsx(struct IsdnCard *card);
+#endif
+
+#if CARD_NICCY
+int setup_niccy(struct IsdnCard *card);
+#endif
+
+#if CARD_BKM_A4T
+int setup_bkm_a4t(struct IsdnCard *card);
+#endif
+
+#if CARD_SCT_QUADRO
+int setup_sct_quadro(struct IsdnCard *card);
+#endif
+
+#if CARD_GAZEL
+int setup_gazel(struct IsdnCard *card);
+#endif
+
+#if CARD_W6692
+int setup_w6692(struct IsdnCard *card);
+#endif
-- 
2.7.4



[PATCH 2/6] isdn/hardware/eicon: add missing header dependencies

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/isdn/hardware/eicon/diva.c:655:6: warning: no previous prototype for 
'xdiFreeFile' [-Wmissing-prototypes]

In fact, this function is declared in
drivers/isdn/hardware/eicon/helpers.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/hardware/eicon/diva.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/isdn/hardware/eicon/diva.c 
b/drivers/isdn/hardware/eicon/diva.c
index 9693add..ad32552 100644
--- a/drivers/isdn/hardware/eicon/diva.c
+++ b/drivers/isdn/hardware/eicon/diva.c
@@ -17,6 +17,7 @@
 #include "xdi_adapter.h"
 #include "diva_pci.h"
 #include "diva.h"
+#include "helpers.h"
 
 #ifdef CONFIG_ISDN_DIVAS_PRIPCI
 #include "os_pri.h"
-- 
2.7.4



[PATCH 2/6] isdn/hardware/eicon: add missing header dependencies

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/isdn/hardware/eicon/diva.c:655:6: warning: no previous prototype for 
'xdiFreeFile' [-Wmissing-prototypes]

In fact, this function is declared in
drivers/isdn/hardware/eicon/helpers.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/hardware/eicon/diva.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/isdn/hardware/eicon/diva.c 
b/drivers/isdn/hardware/eicon/diva.c
index 9693add..ad32552 100644
--- a/drivers/isdn/hardware/eicon/diva.c
+++ b/drivers/isdn/hardware/eicon/diva.c
@@ -17,6 +17,7 @@
 #include "xdi_adapter.h"
 #include "diva_pci.h"
 #include "diva.h"
+#include "helpers.h"
 
 #ifdef CONFIG_ISDN_DIVAS_PRIPCI
 #include "os_pri.h"
-- 
2.7.4



[PATCH 1/6] isdn/eicon: add function declarations

2016-09-23 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/isdn/hardware/eicon/diddfunc.c:95:12: warning: no previous prototype 
for 'diddfunc_init' [-Wmissing-prototypes]
drivers/isdn/hardware/eicon/s_4bri.c:128:6: warning: no previous prototype for 
'start_qBri_hardware' [-Wmissing-prototypes]
drivers/isdn/hardware/eicon/idifunc.c:243:12: warning: no previous prototype 
for 'idifunc_init' [-Wmissing-prototypes]
drivers/isdn/hardware/eicon/capifunc.c:217:6: warning: no previous prototype 
for 'api_remove_complete' [-Wmissing-prototypes]


In fact, these functions need be declare in some header files.

So this patch adds function declarations in
drivers/isdn/hardware/eicon/di_defs.h,
drivers/isdn/hardware/eicon/capifunc.h,
drivers/isdn/hardware/eicon/xdi_adapter.h.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/hardware/eicon/capifunc.c|  3 --
 drivers/isdn/hardware/eicon/capifunc.h|  1 +
 drivers/isdn/hardware/eicon/di_defs.h | 46 +++
 drivers/isdn/hardware/eicon/diva.c|  2 --
 drivers/isdn/hardware/eicon/diva_didd.c   |  5 
 drivers/isdn/hardware/eicon/divacapi.h|  6 
 drivers/isdn/hardware/eicon/divamnt.c |  4 ---
 drivers/isdn/hardware/eicon/divasi.c  |  3 --
 drivers/isdn/hardware/eicon/divasmain.c   |  5 
 drivers/isdn/hardware/eicon/divasproc.c   |  2 --
 drivers/isdn/hardware/eicon/idifunc.c |  2 --
 drivers/isdn/hardware/eicon/message.c | 11 
 drivers/isdn/hardware/eicon/mntfunc.c |  5 
 drivers/isdn/hardware/eicon/os_4bri.c | 13 -
 drivers/isdn/hardware/eicon/os_bri.c  |  7 -
 drivers/isdn/hardware/eicon/os_pri.c  |  6 
 drivers/isdn/hardware/eicon/um_idi.c  |  5 
 drivers/isdn/hardware/eicon/xdi_adapter.h |  6 
 18 files changed, 59 insertions(+), 73 deletions(-)

diff --git a/drivers/isdn/hardware/eicon/capifunc.c 
b/drivers/isdn/hardware/eicon/capifunc.c
index 7a0bdbd..869b98e 100644
--- a/drivers/isdn/hardware/eicon/capifunc.c
+++ b/drivers/isdn/hardware/eicon/capifunc.c
@@ -55,9 +55,6 @@ static void diva_release_appl(struct capi_ctr *, __u16);
 static char *diva_procinfo(struct capi_ctr *);
 static u16 diva_send_message(struct capi_ctr *,
 diva_os_message_buffer_s *);
-extern void diva_os_set_controller_struct(struct capi_ctr *);
-
-extern void DIVA_DIDD_Read(DESCRIPTOR *, int);
 
 /*
  * debug
diff --git a/drivers/isdn/hardware/eicon/capifunc.h 
b/drivers/isdn/hardware/eicon/capifunc.h
index e96c45b..4bd0f20 100644
--- a/drivers/isdn/hardware/eicon/capifunc.h
+++ b/drivers/isdn/hardware/eicon/capifunc.h
@@ -36,5 +36,6 @@ typedef struct _diva_card {
  */
 int init_capifunc(void);
 void finit_capifunc(void);
+void diva_os_set_controller_struct(struct capi_ctr *);
 
 #endif /* __CAPIFUNC_H__ */
diff --git a/drivers/isdn/hardware/eicon/di_defs.h 
b/drivers/isdn/hardware/eicon/di_defs.h
index a5094d2..ed744aa 100644
--- a/drivers/isdn/hardware/eicon/di_defs.h
+++ b/drivers/isdn/hardware/eicon/di_defs.h
@@ -179,3 +179,49 @@ typedef void (IDI_CALL_LINK_T 
*didd_adapter_change_callback_t)(void IDI_CALL_ENT
 #define DI_VOICE_OVER_IP  0x0800 /* Voice over IP support */
 typedef void (IDI_CALL_LINK_T *_IDI_CALL)(void *, ENTITY *);
 #endif
+
+int diddfunc_init(void);
+void diddfunc_finit(void);
+
+void DIVA_DIDD_Read(void *, int);
+
+int divasfunc_init(int dbgmask);
+void divasfunc_exit(void);
+irqreturn_t diva_os_irq_wrapper(int irq, void *context);
+void diva_xdi_display_adapter_features(int card);
+int create_divas_proc(void);
+void remove_divas_proc(void);
+void prepare_maestra_functions(PISDN_ADAPTER IoAdapter);
+void start_qBri_hardware(PISDN_ADAPTER IoAdapter);
+int qBri_FPGA_download(PISDN_ADAPTER IoAdapter);
+void prepare_qBri_functions(PISDN_ADAPTER IoAdapter);
+void prepare_qBri2_functions(PISDN_ADAPTER IoAdapter);
+
+void prepare_pri_functions(PISDN_ADAPTER IoAdapter);
+void prepare_pri2_functions(PISDN_ADAPTER IoAdapter);
+
+int diva_os_copy_to_user(void *os_handle, void __user *dst,
+const void *src, int length);
+int diva_os_copy_from_user(void *os_handle, void *dst,
+  const void __user *src, int length);
+
+int mntfunc_init(int *, void **, unsigned long);
+void mntfunc_finit(void);
+int maint_read_write(void __user *buf, int count);
+
+void diva_os_wakeup_read(void *os_context);
+void diva_os_wakeup_close(void *os_context);
+
+int idifunc_init(void);
+void idifunc_finit(void);
+
+void diva_user_mode_idi_remove_adapter(int);
+int diva_user_mode_idi_create_adapter(const DESCRIPTOR *, int);
+
+void divas_get_version(char *);
+void diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf);
+
+byte MapController(byte);
+
+int fax_head_line_time(char *buffer);
+void api_remove_complete(void);
diff --git a/drivers/isdn/hardware/eicon/diva.c 
b/drivers/isdn/hardware/eicon/diva.c
index d91dd58..9693add 100644
--- a/drivers/isdn/hardware/eicon/diva.c
+++ 

[PATCH 1/6] isdn/eicon: add function declarations

2016-09-23 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/isdn/hardware/eicon/diddfunc.c:95:12: warning: no previous prototype 
for 'diddfunc_init' [-Wmissing-prototypes]
drivers/isdn/hardware/eicon/s_4bri.c:128:6: warning: no previous prototype for 
'start_qBri_hardware' [-Wmissing-prototypes]
drivers/isdn/hardware/eicon/idifunc.c:243:12: warning: no previous prototype 
for 'idifunc_init' [-Wmissing-prototypes]
drivers/isdn/hardware/eicon/capifunc.c:217:6: warning: no previous prototype 
for 'api_remove_complete' [-Wmissing-prototypes]


In fact, these functions need be declare in some header files.

So this patch adds function declarations in
drivers/isdn/hardware/eicon/di_defs.h,
drivers/isdn/hardware/eicon/capifunc.h,
drivers/isdn/hardware/eicon/xdi_adapter.h.

Signed-off-by: Baoyou Xie 
---
 drivers/isdn/hardware/eicon/capifunc.c|  3 --
 drivers/isdn/hardware/eicon/capifunc.h|  1 +
 drivers/isdn/hardware/eicon/di_defs.h | 46 +++
 drivers/isdn/hardware/eicon/diva.c|  2 --
 drivers/isdn/hardware/eicon/diva_didd.c   |  5 
 drivers/isdn/hardware/eicon/divacapi.h|  6 
 drivers/isdn/hardware/eicon/divamnt.c |  4 ---
 drivers/isdn/hardware/eicon/divasi.c  |  3 --
 drivers/isdn/hardware/eicon/divasmain.c   |  5 
 drivers/isdn/hardware/eicon/divasproc.c   |  2 --
 drivers/isdn/hardware/eicon/idifunc.c |  2 --
 drivers/isdn/hardware/eicon/message.c | 11 
 drivers/isdn/hardware/eicon/mntfunc.c |  5 
 drivers/isdn/hardware/eicon/os_4bri.c | 13 -
 drivers/isdn/hardware/eicon/os_bri.c  |  7 -
 drivers/isdn/hardware/eicon/os_pri.c  |  6 
 drivers/isdn/hardware/eicon/um_idi.c  |  5 
 drivers/isdn/hardware/eicon/xdi_adapter.h |  6 
 18 files changed, 59 insertions(+), 73 deletions(-)

diff --git a/drivers/isdn/hardware/eicon/capifunc.c 
b/drivers/isdn/hardware/eicon/capifunc.c
index 7a0bdbd..869b98e 100644
--- a/drivers/isdn/hardware/eicon/capifunc.c
+++ b/drivers/isdn/hardware/eicon/capifunc.c
@@ -55,9 +55,6 @@ static void diva_release_appl(struct capi_ctr *, __u16);
 static char *diva_procinfo(struct capi_ctr *);
 static u16 diva_send_message(struct capi_ctr *,
 diva_os_message_buffer_s *);
-extern void diva_os_set_controller_struct(struct capi_ctr *);
-
-extern void DIVA_DIDD_Read(DESCRIPTOR *, int);
 
 /*
  * debug
diff --git a/drivers/isdn/hardware/eicon/capifunc.h 
b/drivers/isdn/hardware/eicon/capifunc.h
index e96c45b..4bd0f20 100644
--- a/drivers/isdn/hardware/eicon/capifunc.h
+++ b/drivers/isdn/hardware/eicon/capifunc.h
@@ -36,5 +36,6 @@ typedef struct _diva_card {
  */
 int init_capifunc(void);
 void finit_capifunc(void);
+void diva_os_set_controller_struct(struct capi_ctr *);
 
 #endif /* __CAPIFUNC_H__ */
diff --git a/drivers/isdn/hardware/eicon/di_defs.h 
b/drivers/isdn/hardware/eicon/di_defs.h
index a5094d2..ed744aa 100644
--- a/drivers/isdn/hardware/eicon/di_defs.h
+++ b/drivers/isdn/hardware/eicon/di_defs.h
@@ -179,3 +179,49 @@ typedef void (IDI_CALL_LINK_T 
*didd_adapter_change_callback_t)(void IDI_CALL_ENT
 #define DI_VOICE_OVER_IP  0x0800 /* Voice over IP support */
 typedef void (IDI_CALL_LINK_T *_IDI_CALL)(void *, ENTITY *);
 #endif
+
+int diddfunc_init(void);
+void diddfunc_finit(void);
+
+void DIVA_DIDD_Read(void *, int);
+
+int divasfunc_init(int dbgmask);
+void divasfunc_exit(void);
+irqreturn_t diva_os_irq_wrapper(int irq, void *context);
+void diva_xdi_display_adapter_features(int card);
+int create_divas_proc(void);
+void remove_divas_proc(void);
+void prepare_maestra_functions(PISDN_ADAPTER IoAdapter);
+void start_qBri_hardware(PISDN_ADAPTER IoAdapter);
+int qBri_FPGA_download(PISDN_ADAPTER IoAdapter);
+void prepare_qBri_functions(PISDN_ADAPTER IoAdapter);
+void prepare_qBri2_functions(PISDN_ADAPTER IoAdapter);
+
+void prepare_pri_functions(PISDN_ADAPTER IoAdapter);
+void prepare_pri2_functions(PISDN_ADAPTER IoAdapter);
+
+int diva_os_copy_to_user(void *os_handle, void __user *dst,
+const void *src, int length);
+int diva_os_copy_from_user(void *os_handle, void *dst,
+  const void __user *src, int length);
+
+int mntfunc_init(int *, void **, unsigned long);
+void mntfunc_finit(void);
+int maint_read_write(void __user *buf, int count);
+
+void diva_os_wakeup_read(void *os_context);
+void diva_os_wakeup_close(void *os_context);
+
+int idifunc_init(void);
+void idifunc_finit(void);
+
+void diva_user_mode_idi_remove_adapter(int);
+int diva_user_mode_idi_create_adapter(const DESCRIPTOR *, int);
+
+void divas_get_version(char *);
+void diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf);
+
+byte MapController(byte);
+
+int fax_head_line_time(char *buffer);
+void api_remove_complete(void);
diff --git a/drivers/isdn/hardware/eicon/diva.c 
b/drivers/isdn/hardware/eicon/diva.c
index d91dd58..9693add 100644
--- a/drivers/isdn/hardware/eicon/diva.c
+++ 

[PATCH] HSI: omap_ssi_core: move function declaration to header file

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/hsi/controllers/omap_ssi_core.c:181:6: warning: no previous prototype 
for 'ssi_waketest' [-Wmissing-prototypes]

In fact, this function is declared in
drivers/hsi/clients/ssi_protocol.c, but should be declared
in a header file. So this patch moves the function declaration
to include/linux/hsi/hsi.h.

Signed-off-by: Baoyou Xie 
---
 drivers/hsi/clients/ssi_protocol.c | 2 --
 include/linux/hsi/hsi.h| 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hsi/clients/ssi_protocol.c 
b/drivers/hsi/clients/ssi_protocol.c
index 6031cd1..fe86444 100644
--- a/drivers/hsi/clients/ssi_protocol.c
+++ b/drivers/hsi/clients/ssi_protocol.c
@@ -45,8 +45,6 @@
 #include 
 #include 
 
-void ssi_waketest(struct hsi_client *cl, unsigned int enable);
-
 #define SSIP_TXQUEUE_LEN   100
 #define SSIP_MAX_MTU   65535
 #define SSIP_DEFAULT_MTU   4000
diff --git a/include/linux/hsi/hsi.h b/include/linux/hsi/hsi.h
index 5740254..676a656 100644
--- a/include/linux/hsi/hsi.h
+++ b/include/linux/hsi/hsi.h
@@ -161,6 +161,7 @@ static inline void *hsi_client_drvdata(struct hsi_client 
*cl)
 int hsi_register_port_event(struct hsi_client *cl,
void (*handler)(struct hsi_client *, unsigned long));
 int hsi_unregister_port_event(struct hsi_client *cl);
+void ssi_waketest(struct hsi_client *cl, unsigned int enable);
 
 /**
  * struct hsi_client_driver - Driver associated to an HSI client
-- 
2.7.4



[PATCH] HSI: omap_ssi_core: move function declaration to header file

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/hsi/controllers/omap_ssi_core.c:181:6: warning: no previous prototype 
for 'ssi_waketest' [-Wmissing-prototypes]

In fact, this function is declared in
drivers/hsi/clients/ssi_protocol.c, but should be declared
in a header file. So this patch moves the function declaration
to include/linux/hsi/hsi.h.

Signed-off-by: Baoyou Xie 
---
 drivers/hsi/clients/ssi_protocol.c | 2 --
 include/linux/hsi/hsi.h| 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hsi/clients/ssi_protocol.c 
b/drivers/hsi/clients/ssi_protocol.c
index 6031cd1..fe86444 100644
--- a/drivers/hsi/clients/ssi_protocol.c
+++ b/drivers/hsi/clients/ssi_protocol.c
@@ -45,8 +45,6 @@
 #include 
 #include 
 
-void ssi_waketest(struct hsi_client *cl, unsigned int enable);
-
 #define SSIP_TXQUEUE_LEN   100
 #define SSIP_MAX_MTU   65535
 #define SSIP_DEFAULT_MTU   4000
diff --git a/include/linux/hsi/hsi.h b/include/linux/hsi/hsi.h
index 5740254..676a656 100644
--- a/include/linux/hsi/hsi.h
+++ b/include/linux/hsi/hsi.h
@@ -161,6 +161,7 @@ static inline void *hsi_client_drvdata(struct hsi_client 
*cl)
 int hsi_register_port_event(struct hsi_client *cl,
void (*handler)(struct hsi_client *, unsigned long));
 int hsi_unregister_port_event(struct hsi_client *cl);
+void ssi_waketest(struct hsi_client *cl, unsigned int enable);
 
 /**
  * struct hsi_client_driver - Driver associated to an HSI client
-- 
2.7.4



[PATCH v7 2/2] clocksource: add J-Core timer/clocksource driver

2016-09-23 Thread Rich Felker
At the hardware level, the J-Core PIT is integrated with the interrupt
controller, but it is represented as its own device and has an
independent programming interface. It provides a 12-bit countdown
timer, which is not presently used, and a periodic timer. The interval
length for the latter is programmable via a 32-bit throttle register
whose units are determined by a bus-period register. The periodic
timer is used to implement both periodic and oneshot clock event
modes; in oneshot mode the interrupt handler simply disables the timer
as soon as it fires.

Despite its device tree node representing an interrupt for the PIT,
the actual irq generated is programmable, not hard-wired. The driver
is responsible for programming the PIT to generate the hardware irq
number that the DT assigns to it.

On SMP configurations, J-Core provides cpu-local instances of the PIT;
no broadcast timer is needed. This driver supports the creation of the
necessary per-cpu clock_event_device instances.

A nanosecond-resolution clocksource is provided using the J-Core "RTC"
registers, which give a 64-bit seconds count and 32-bit nanoseconds
that wrap every second. The driver converts these to a full-range
32-bit nanoseconds count.

Signed-off-by: Rich Felker 
---
 drivers/clocksource/Kconfig |  10 ++
 drivers/clocksource/Makefile|   1 +
 drivers/clocksource/jcore-pit.c | 240 
 include/linux/cpuhotplug.h  |   1 +
 4 files changed, 252 insertions(+)
 create mode 100644 drivers/clocksource/jcore-pit.c

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 5677886..95dd78b 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -407,6 +407,16 @@ config SYS_SUPPORTS_SH_TMU
 config SYS_SUPPORTS_EM_STI
 bool
 
+config CLKSRC_JCORE_PIT
+   bool "J-Core PIT timer driver"
+   depends on OF && (SUPERH || COMPILE_TEST)
+   depends on GENERIC_CLOCKEVENTS
+   depends on HAS_IOMEM
+   select CLKSRC_MMIO
+   help
+ This enables build of clocksource and clockevent driver for
+ the integrated PIT in the J-Core synthesizable, open source SoC.
+
 config SH_TIMER_CMT
bool "Renesas CMT timer driver" if COMPILE_TEST
depends on GENERIC_CLOCKEVENTS
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index fd9d6df..cf87f40 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_ATMEL_TCB_CLKSRC)  += tcb_clksrc.o
 obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o
 obj-$(CONFIG_SCx200HR_TIMER)   += scx200_hrt.o
 obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC)   += cs5535-clockevt.o
+obj-$(CONFIG_CLKSRC_JCORE_PIT) += jcore-pit.o
 obj-$(CONFIG_SH_TIMER_CMT) += sh_cmt.o
 obj-$(CONFIG_SH_TIMER_MTU2)+= sh_mtu2.o
 obj-$(CONFIG_SH_TIMER_TMU) += sh_tmu.o
diff --git a/drivers/clocksource/jcore-pit.c b/drivers/clocksource/jcore-pit.c
new file mode 100644
index 000..4c512d7
--- /dev/null
+++ b/drivers/clocksource/jcore-pit.c
@@ -0,0 +1,240 @@
+/*
+ * J-Core SoC PIT/clocksource driver
+ *
+ * Copyright (C) 2015-2016 Smart Energy Instruments, Inc.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define PIT_IRQ_SHIFT  12
+#define PIT_PRIO_SHIFT 20
+#define PIT_ENABLE_SHIFT   26
+#define PIT_IRQ_MASK   0x3f
+#define PIT_PRIO_MASK  0xf
+
+#define REG_PITEN  0x00
+#define REG_THROT  0x10
+#define REG_COUNT  0x14
+#define REG_BUSPD  0x18
+#define REG_SECHI  0x20
+#define REG_SECLO  0x24
+#define REG_NSEC   0x28
+
+struct jcore_pit {
+   struct clock_event_device   ced;
+   __iomem void*base;
+   unsigned long   periodic_delta;
+   unsignedcpu;
+   u32 enable_val;
+};
+
+static __iomem void*jcore_pit_base;
+struct jcore_pit __percpu  *jcore_pit_percpu;
+
+static notrace u64 jcore_sched_clock_read(void)
+{
+   u32 seclo, nsec, seclo0;
+   __iomem void *base = jcore_pit_base;
+
+   seclo = readl(base + REG_SECLO);
+   do {
+   seclo0 = seclo;
+   nsec  = readl(base + REG_NSEC);
+   seclo = readl(base + REG_SECLO);
+   } while (seclo0 != seclo);
+
+   return seclo * NSEC_PER_SEC + nsec;
+}
+
+static cycle_t jcore_clocksource_read(struct clocksource *cs)
+{
+   return jcore_sched_clock_read();
+}
+
+static int jcore_pit_disable(struct jcore_pit *pit)
+{
+   writel(0, pit->base + REG_PITEN);
+   return 0;
+}
+
+static int jcore_pit_set(unsigned long delta, struct 

[PATCH v7 2/2] clocksource: add J-Core timer/clocksource driver

2016-09-23 Thread Rich Felker
At the hardware level, the J-Core PIT is integrated with the interrupt
controller, but it is represented as its own device and has an
independent programming interface. It provides a 12-bit countdown
timer, which is not presently used, and a periodic timer. The interval
length for the latter is programmable via a 32-bit throttle register
whose units are determined by a bus-period register. The periodic
timer is used to implement both periodic and oneshot clock event
modes; in oneshot mode the interrupt handler simply disables the timer
as soon as it fires.

Despite its device tree node representing an interrupt for the PIT,
the actual irq generated is programmable, not hard-wired. The driver
is responsible for programming the PIT to generate the hardware irq
number that the DT assigns to it.

On SMP configurations, J-Core provides cpu-local instances of the PIT;
no broadcast timer is needed. This driver supports the creation of the
necessary per-cpu clock_event_device instances.

A nanosecond-resolution clocksource is provided using the J-Core "RTC"
registers, which give a 64-bit seconds count and 32-bit nanoseconds
that wrap every second. The driver converts these to a full-range
32-bit nanoseconds count.

Signed-off-by: Rich Felker 
---
 drivers/clocksource/Kconfig |  10 ++
 drivers/clocksource/Makefile|   1 +
 drivers/clocksource/jcore-pit.c | 240 
 include/linux/cpuhotplug.h  |   1 +
 4 files changed, 252 insertions(+)
 create mode 100644 drivers/clocksource/jcore-pit.c

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 5677886..95dd78b 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -407,6 +407,16 @@ config SYS_SUPPORTS_SH_TMU
 config SYS_SUPPORTS_EM_STI
 bool
 
+config CLKSRC_JCORE_PIT
+   bool "J-Core PIT timer driver"
+   depends on OF && (SUPERH || COMPILE_TEST)
+   depends on GENERIC_CLOCKEVENTS
+   depends on HAS_IOMEM
+   select CLKSRC_MMIO
+   help
+ This enables build of clocksource and clockevent driver for
+ the integrated PIT in the J-Core synthesizable, open source SoC.
+
 config SH_TIMER_CMT
bool "Renesas CMT timer driver" if COMPILE_TEST
depends on GENERIC_CLOCKEVENTS
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index fd9d6df..cf87f40 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_ATMEL_TCB_CLKSRC)  += tcb_clksrc.o
 obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o
 obj-$(CONFIG_SCx200HR_TIMER)   += scx200_hrt.o
 obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC)   += cs5535-clockevt.o
+obj-$(CONFIG_CLKSRC_JCORE_PIT) += jcore-pit.o
 obj-$(CONFIG_SH_TIMER_CMT) += sh_cmt.o
 obj-$(CONFIG_SH_TIMER_MTU2)+= sh_mtu2.o
 obj-$(CONFIG_SH_TIMER_TMU) += sh_tmu.o
diff --git a/drivers/clocksource/jcore-pit.c b/drivers/clocksource/jcore-pit.c
new file mode 100644
index 000..4c512d7
--- /dev/null
+++ b/drivers/clocksource/jcore-pit.c
@@ -0,0 +1,240 @@
+/*
+ * J-Core SoC PIT/clocksource driver
+ *
+ * Copyright (C) 2015-2016 Smart Energy Instruments, Inc.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define PIT_IRQ_SHIFT  12
+#define PIT_PRIO_SHIFT 20
+#define PIT_ENABLE_SHIFT   26
+#define PIT_IRQ_MASK   0x3f
+#define PIT_PRIO_MASK  0xf
+
+#define REG_PITEN  0x00
+#define REG_THROT  0x10
+#define REG_COUNT  0x14
+#define REG_BUSPD  0x18
+#define REG_SECHI  0x20
+#define REG_SECLO  0x24
+#define REG_NSEC   0x28
+
+struct jcore_pit {
+   struct clock_event_device   ced;
+   __iomem void*base;
+   unsigned long   periodic_delta;
+   unsignedcpu;
+   u32 enable_val;
+};
+
+static __iomem void*jcore_pit_base;
+struct jcore_pit __percpu  *jcore_pit_percpu;
+
+static notrace u64 jcore_sched_clock_read(void)
+{
+   u32 seclo, nsec, seclo0;
+   __iomem void *base = jcore_pit_base;
+
+   seclo = readl(base + REG_SECLO);
+   do {
+   seclo0 = seclo;
+   nsec  = readl(base + REG_NSEC);
+   seclo = readl(base + REG_SECLO);
+   } while (seclo0 != seclo);
+
+   return seclo * NSEC_PER_SEC + nsec;
+}
+
+static cycle_t jcore_clocksource_read(struct clocksource *cs)
+{
+   return jcore_sched_clock_read();
+}
+
+static int jcore_pit_disable(struct jcore_pit *pit)
+{
+   writel(0, pit->base + REG_PITEN);
+   return 0;
+}
+
+static int jcore_pit_set(unsigned long delta, struct jcore_pit *pit)
+{
+   

[PATCH v7 1/2] of: add J-Core timer bindings

2016-09-23 Thread Rich Felker
Signed-off-by: Rich Felker 
Acked-by: Rob Herring 
---
 .../devicetree/bindings/timer/jcore,pit.txt| 24 ++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/jcore,pit.txt

diff --git a/Documentation/devicetree/bindings/timer/jcore,pit.txt 
b/Documentation/devicetree/bindings/timer/jcore,pit.txt
new file mode 100644
index 000..af5dd35
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/jcore,pit.txt
@@ -0,0 +1,24 @@
+J-Core Programmable Interval Timer and Clocksource
+
+Required properties:
+
+- compatible: Must be "jcore,pit".
+
+- reg: Memory region(s) for timer/clocksource registers. For SMP,
+  there should be one region per cpu, indexed by the sequential,
+  zero-based hardware cpu number.
+
+- interrupts: An interrupt to assign for the timer. The actual pit
+  core is integrated with the aic and allows the timer interrupt
+  assignment to be programmed by software, but this property is
+  required in order to reserve an interrupt number that doesn't
+  conflict with other devices.
+
+
+Example:
+
+timer@200 {
+   compatible = "jcore,pit";
+   reg = < 0x200 0x30 0x500 0x30 >;
+   interrupts = < 0x48 >;
+};
-- 
2.10.0




[PATCH v7 0/2] J-Core timer support

2016-09-23 Thread Rich Felker
This version has been updated to include specific changes requested in
the last round of review, and to work around a problem discussed with
Paul McKenney (See thread "rcu_sched stalls in idle task introduced in
pre-4.8?" for details).

Rich Felker (2):
  of: add J-Core timer bindings
  clocksource: add J-Core timer/clocksource driver

 .../devicetree/bindings/timer/jcore,pit.txt|  24 +++
 drivers/clocksource/Kconfig|  10 +
 drivers/clocksource/Makefile   |   1 +
 drivers/clocksource/jcore-pit.c| 240 +
 include/linux/cpuhotplug.h |   1 +
 5 files changed, 276 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/jcore,pit.txt
 create mode 100644 drivers/clocksource/jcore-pit.c

-- 
2.10.0



[PATCH v7 1/2] of: add J-Core timer bindings

2016-09-23 Thread Rich Felker
Signed-off-by: Rich Felker 
Acked-by: Rob Herring 
---
 .../devicetree/bindings/timer/jcore,pit.txt| 24 ++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/jcore,pit.txt

diff --git a/Documentation/devicetree/bindings/timer/jcore,pit.txt 
b/Documentation/devicetree/bindings/timer/jcore,pit.txt
new file mode 100644
index 000..af5dd35
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/jcore,pit.txt
@@ -0,0 +1,24 @@
+J-Core Programmable Interval Timer and Clocksource
+
+Required properties:
+
+- compatible: Must be "jcore,pit".
+
+- reg: Memory region(s) for timer/clocksource registers. For SMP,
+  there should be one region per cpu, indexed by the sequential,
+  zero-based hardware cpu number.
+
+- interrupts: An interrupt to assign for the timer. The actual pit
+  core is integrated with the aic and allows the timer interrupt
+  assignment to be programmed by software, but this property is
+  required in order to reserve an interrupt number that doesn't
+  conflict with other devices.
+
+
+Example:
+
+timer@200 {
+   compatible = "jcore,pit";
+   reg = < 0x200 0x30 0x500 0x30 >;
+   interrupts = < 0x48 >;
+};
-- 
2.10.0




[PATCH v7 0/2] J-Core timer support

2016-09-23 Thread Rich Felker
This version has been updated to include specific changes requested in
the last round of review, and to work around a problem discussed with
Paul McKenney (See thread "rcu_sched stalls in idle task introduced in
pre-4.8?" for details).

Rich Felker (2):
  of: add J-Core timer bindings
  clocksource: add J-Core timer/clocksource driver

 .../devicetree/bindings/timer/jcore,pit.txt|  24 +++
 drivers/clocksource/Kconfig|  10 +
 drivers/clocksource/Makefile   |   1 +
 drivers/clocksource/jcore-pit.c| 240 +
 include/linux/cpuhotplug.h |   1 +
 5 files changed, 276 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/jcore,pit.txt
 create mode 100644 drivers/clocksource/jcore-pit.c

-- 
2.10.0



[PATCH] firmware/broadcom: add missing header dependencies

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/firmware/broadcom/bcm47xx_sprom.c:717:5: warning: no previous prototype 
for 'bcm47xx_sprom_register_fallbacks' [-Wmissing-prototypes]

In fact, this function is declared in include/linux/bcm47xx_sprom.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/firmware/broadcom/bcm47xx_sprom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/broadcom/bcm47xx_sprom.c 
b/drivers/firmware/broadcom/bcm47xx_sprom.c
index 62aa3cf..3471b86 100644
--- a/drivers/firmware/broadcom/bcm47xx_sprom.c
+++ b/drivers/firmware/broadcom/bcm47xx_sprom.c
@@ -27,6 +27,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.7.4



[PATCH] firmware/broadcom: add missing header dependencies

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/firmware/broadcom/bcm47xx_sprom.c:717:5: warning: no previous prototype 
for 'bcm47xx_sprom_register_fallbacks' [-Wmissing-prototypes]

In fact, this function is declared in include/linux/bcm47xx_sprom.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/firmware/broadcom/bcm47xx_sprom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/broadcom/bcm47xx_sprom.c 
b/drivers/firmware/broadcom/bcm47xx_sprom.c
index 62aa3cf..3471b86 100644
--- a/drivers/firmware/broadcom/bcm47xx_sprom.c
+++ b/drivers/firmware/broadcom/bcm47xx_sprom.c
@@ -27,6 +27,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.7.4



[PATCH 3/3] dmaengine: imx-sdma: remove unused function

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/dma/imx-sdma.c:673:13: warning: 'sdma_handle_channel_loop' defined but 
not used [-Wunused-function]

In fact, this function is called by no one and not exported,
so this patch removes it.

Signed-off-by: Baoyou Xie 
---
 drivers/dma/imx-sdma.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 695f160..7fb55dd 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -670,11 +670,6 @@ static void sdma_event_disable(struct sdma_channel *sdmac, 
unsigned int event)
writel_relaxed(val, sdma->regs + chnenbl);
 }
 
-static void sdma_handle_channel_loop(struct sdma_channel *sdmac)
-{
-   dmaengine_desc_get_callback_invoke(>desc, NULL);
-}
-
 static void sdma_update_channel_loop(struct sdma_channel *sdmac)
 {
struct sdma_buffer_descriptor *bd;
-- 
2.7.4



[PATCH 3/3] dmaengine: imx-sdma: remove unused function

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/dma/imx-sdma.c:673:13: warning: 'sdma_handle_channel_loop' defined but 
not used [-Wunused-function]

In fact, this function is called by no one and not exported,
so this patch removes it.

Signed-off-by: Baoyou Xie 
---
 drivers/dma/imx-sdma.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 695f160..7fb55dd 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -670,11 +670,6 @@ static void sdma_event_disable(struct sdma_channel *sdmac, 
unsigned int event)
writel_relaxed(val, sdma->regs + chnenbl);
 }
 
-static void sdma_handle_channel_loop(struct sdma_channel *sdmac)
-{
-   dmaengine_desc_get_callback_invoke(>desc, NULL);
-}
-
 static void sdma_update_channel_loop(struct sdma_channel *sdmac)
 {
struct sdma_buffer_descriptor *bd;
-- 
2.7.4



[PATCH 2/3] dmaengine: pxa_dma: add function declaration

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/dma/pxa_dma.c:1525:5: warning: no previous prototype for 
'pxad_toggle_reserved_channel' [-Wmissing-prototypes]

In fact, this function is undeclared in any header files.

So this patch adds function declaration in include/linux/dma/pxa-dma.h.

Signed-off-by: Baoyou Xie 
---
 include/linux/dma/pxa-dma.h | 1 ++
 1 file changed, 1 insertions(+)

diff --git a/include/linux/dma/pxa-dma.h b/include/linux/dma/pxa-dma.h
index 3edc992..1823257 100644
--- a/include/linux/dma/pxa-dma.h
+++ b/include/linux/dma/pxa-dma.h
@@ -17,6 +17,7 @@ struct dma_chan;
 
 #ifdef CONFIG_PXA_DMA
 bool pxad_filter_fn(struct dma_chan *chan, void *param);
+int pxad_toggle_reserved_channel(int legacy_channel);
 #else
 static inline bool pxad_filter_fn(struct dma_chan *chan, void *param)
 {
-- 
2.7.4



[PATCH 2/3] dmaengine: pxa_dma: add function declaration

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/dma/pxa_dma.c:1525:5: warning: no previous prototype for 
'pxad_toggle_reserved_channel' [-Wmissing-prototypes]

In fact, this function is undeclared in any header files.

So this patch adds function declaration in include/linux/dma/pxa-dma.h.

Signed-off-by: Baoyou Xie 
---
 include/linux/dma/pxa-dma.h | 1 ++
 1 file changed, 1 insertions(+)

diff --git a/include/linux/dma/pxa-dma.h b/include/linux/dma/pxa-dma.h
index 3edc992..1823257 100644
--- a/include/linux/dma/pxa-dma.h
+++ b/include/linux/dma/pxa-dma.h
@@ -17,6 +17,7 @@ struct dma_chan;
 
 #ifdef CONFIG_PXA_DMA
 bool pxad_filter_fn(struct dma_chan *chan, void *param);
+int pxad_toggle_reserved_channel(int legacy_channel);
 #else
 static inline bool pxad_filter_fn(struct dma_chan *chan, void *param)
 {
-- 
2.7.4



UBSAN: Undefined behaviour in ./arch/arm/include/asm/bitops.h

2016-09-23 Thread Seung-Woo Kim
With the patch "arm: ubsan: select ARCH_HAS_UBSAN_SANITIZE_ALL", I got
following UBSAN warning on Exynos5422 SoC board.



UBSAN: Undefined behaviour in ./arch/arm/include/asm/bitops.h:296:17
negation of -2147483648 cannot be represented in type 'int':
CPU: 2 PID: 5637 Comm: fsck.ext4 Tainted: GW
4.8.0-rc7-00173-g142932f #25
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[] (unwind_backtrace) from [] (show_stack+0x20/0x24)
[] (show_stack) from [] (dump_stack+0x84/0xa0)
[] (dump_stack) from [] (ubsan_epilogue+0x14/0x50)
[] (ubsan_epilogue) from []
(__ubsan_handle_negate_overflow+0x68/0x6c)
[] (__ubsan_handle_negate_overflow) from []
(radix_tree_next_chunk+0x4e8/0x5ac)
[] (radix_tree_next_chunk) from []
(find_get_pages_tag+0x1b0/0x390)
[] (find_get_pages_tag) from []
(pagevec_lookup_tag+0x38/0x68)
[] (pagevec_lookup_tag) from []
(write_cache_pages+0x134/0x85c)
[] (write_cache_pages) from []
(generic_writepages+0x5c/0x9c)
[] (generic_writepages) from []
(blkdev_writepages+0x18/0x1c)
[] (blkdev_writepages) from [] (do_writepages+0x58/0xa4)
[] (do_writepages) from []
(__filemap_fdatawrite_range+0xac/0x10c)
[] (__filemap_fdatawrite_range) from []
(filemap_write_and_wait_range+0x54/0xb8)
[] (filemap_write_and_wait_range) from []
(blkdev_fsync+0x40/0xa4)
[] (blkdev_fsync) from [] (vfs_fsync_range+0x70/0x160)
[] (vfs_fsync_range) from [] (do_fsync+0x4c/0x74)
[] (do_fsync) from [] (SyS_fsync+0x1c/0x20)
[] (SyS_fsync) from [] (ret_fast_syscall+0x0/0x3c)



UBSAN: Undefined behaviour in ./arch/arm/include/asm/bitops.h:296:17
negation of -2147483648 cannot be represented in type 'int':
CPU: 3 PID: 6313 Comm: enlightenment Tainted: GW
4.8.0-rc7-00173-g142932f #25
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[] (unwind_backtrace) from [] (show_stack+0x20/0x24)
[] (show_stack) from [] (dump_stack+0x84/0xa0)
[] (dump_stack) from [] (ubsan_epilogue+0x14/0x50)
[] (ubsan_epilogue) from []
(__ubsan_handle_negate_overflow+0x68/0x6c)
[] (__ubsan_handle_negate_overflow) from []
(next_signal+0x114/0x16c)
[] (next_signal) from [] (dequeue_signal+0x30/0x30c)
[] (dequeue_signal) from [] (get_signal+0x120/0xe84)
[] (get_signal) from [] (do_signal+0x37c/0x550)
[] (do_signal) from [] (do_work_pending+0xd0/0x134)
[] (do_work_pending) from []
(slow_work_pending+0xc/0x20)


Regards,
- Seung-Woo Kim

-- 
Seung-Woo Kim
Samsung Software R Center
--



UBSAN: Undefined behaviour in ./arch/arm/include/asm/bitops.h

2016-09-23 Thread Seung-Woo Kim
With the patch "arm: ubsan: select ARCH_HAS_UBSAN_SANITIZE_ALL", I got
following UBSAN warning on Exynos5422 SoC board.



UBSAN: Undefined behaviour in ./arch/arm/include/asm/bitops.h:296:17
negation of -2147483648 cannot be represented in type 'int':
CPU: 2 PID: 5637 Comm: fsck.ext4 Tainted: GW
4.8.0-rc7-00173-g142932f #25
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[] (unwind_backtrace) from [] (show_stack+0x20/0x24)
[] (show_stack) from [] (dump_stack+0x84/0xa0)
[] (dump_stack) from [] (ubsan_epilogue+0x14/0x50)
[] (ubsan_epilogue) from []
(__ubsan_handle_negate_overflow+0x68/0x6c)
[] (__ubsan_handle_negate_overflow) from []
(radix_tree_next_chunk+0x4e8/0x5ac)
[] (radix_tree_next_chunk) from []
(find_get_pages_tag+0x1b0/0x390)
[] (find_get_pages_tag) from []
(pagevec_lookup_tag+0x38/0x68)
[] (pagevec_lookup_tag) from []
(write_cache_pages+0x134/0x85c)
[] (write_cache_pages) from []
(generic_writepages+0x5c/0x9c)
[] (generic_writepages) from []
(blkdev_writepages+0x18/0x1c)
[] (blkdev_writepages) from [] (do_writepages+0x58/0xa4)
[] (do_writepages) from []
(__filemap_fdatawrite_range+0xac/0x10c)
[] (__filemap_fdatawrite_range) from []
(filemap_write_and_wait_range+0x54/0xb8)
[] (filemap_write_and_wait_range) from []
(blkdev_fsync+0x40/0xa4)
[] (blkdev_fsync) from [] (vfs_fsync_range+0x70/0x160)
[] (vfs_fsync_range) from [] (do_fsync+0x4c/0x74)
[] (do_fsync) from [] (SyS_fsync+0x1c/0x20)
[] (SyS_fsync) from [] (ret_fast_syscall+0x0/0x3c)



UBSAN: Undefined behaviour in ./arch/arm/include/asm/bitops.h:296:17
negation of -2147483648 cannot be represented in type 'int':
CPU: 3 PID: 6313 Comm: enlightenment Tainted: GW
4.8.0-rc7-00173-g142932f #25
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[] (unwind_backtrace) from [] (show_stack+0x20/0x24)
[] (show_stack) from [] (dump_stack+0x84/0xa0)
[] (dump_stack) from [] (ubsan_epilogue+0x14/0x50)
[] (ubsan_epilogue) from []
(__ubsan_handle_negate_overflow+0x68/0x6c)
[] (__ubsan_handle_negate_overflow) from []
(next_signal+0x114/0x16c)
[] (next_signal) from [] (dequeue_signal+0x30/0x30c)
[] (dequeue_signal) from [] (get_signal+0x120/0xe84)
[] (get_signal) from [] (do_signal+0x37c/0x550)
[] (do_signal) from [] (do_work_pending+0xd0/0x134)
[] (do_work_pending) from []
(slow_work_pending+0xc/0x20)


Regards,
- Seung-Woo Kim

-- 
Seung-Woo Kim
Samsung Software R Center
--



[PATCH 1/3] dmaengine: virt-dma: move function declarations

2016-09-23 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/dma/virt-dma.c:22:14: warning: no previous prototype for 
'vchan_tx_submit' [-Wmissing-prototypes]
drivers/dma/virt-dma.c:52:5: warning: no previous prototype for 
'vchan_tx_desc_free' [-Wmissing-prototypes]

In fact, these two functions are incorrectly declared in a function.

So this patch moves function declarations out of this function.

Signed-off-by: Baoyou Xie 
---
 drivers/dma/virt-dma.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/virt-dma.h b/drivers/dma/virt-dma.h
index a030ae7..3f776a4 100644
--- a/drivers/dma/virt-dma.h
+++ b/drivers/dma/virt-dma.h
@@ -45,6 +45,8 @@ static inline struct virt_dma_chan *to_virt_chan(struct 
dma_chan *chan)
 void vchan_dma_desc_free_list(struct virt_dma_chan *vc, struct list_head 
*head);
 void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev);
 struct virt_dma_desc *vchan_find_desc(struct virt_dma_chan *, dma_cookie_t);
+extern dma_cookie_t vchan_tx_submit(struct dma_async_tx_descriptor *);
+extern int vchan_tx_desc_free(struct dma_async_tx_descriptor *);
 
 /**
  * vchan_tx_prep - prepare a descriptor
@@ -55,8 +57,6 @@ struct virt_dma_desc *vchan_find_desc(struct virt_dma_chan *, 
dma_cookie_t);
 static inline struct dma_async_tx_descriptor *vchan_tx_prep(struct 
virt_dma_chan *vc,
struct virt_dma_desc *vd, unsigned long tx_flags)
 {
-   extern dma_cookie_t vchan_tx_submit(struct dma_async_tx_descriptor *);
-   extern int vchan_tx_desc_free(struct dma_async_tx_descriptor *);
unsigned long flags;
 
dma_async_tx_descriptor_init(>tx, >chan);
-- 
2.7.4



[PATCH 1/3] dmaengine: virt-dma: move function declarations

2016-09-23 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/dma/virt-dma.c:22:14: warning: no previous prototype for 
'vchan_tx_submit' [-Wmissing-prototypes]
drivers/dma/virt-dma.c:52:5: warning: no previous prototype for 
'vchan_tx_desc_free' [-Wmissing-prototypes]

In fact, these two functions are incorrectly declared in a function.

So this patch moves function declarations out of this function.

Signed-off-by: Baoyou Xie 
---
 drivers/dma/virt-dma.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/virt-dma.h b/drivers/dma/virt-dma.h
index a030ae7..3f776a4 100644
--- a/drivers/dma/virt-dma.h
+++ b/drivers/dma/virt-dma.h
@@ -45,6 +45,8 @@ static inline struct virt_dma_chan *to_virt_chan(struct 
dma_chan *chan)
 void vchan_dma_desc_free_list(struct virt_dma_chan *vc, struct list_head 
*head);
 void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev);
 struct virt_dma_desc *vchan_find_desc(struct virt_dma_chan *, dma_cookie_t);
+extern dma_cookie_t vchan_tx_submit(struct dma_async_tx_descriptor *);
+extern int vchan_tx_desc_free(struct dma_async_tx_descriptor *);
 
 /**
  * vchan_tx_prep - prepare a descriptor
@@ -55,8 +57,6 @@ struct virt_dma_desc *vchan_find_desc(struct virt_dma_chan *, 
dma_cookie_t);
 static inline struct dma_async_tx_descriptor *vchan_tx_prep(struct 
virt_dma_chan *vc,
struct virt_dma_desc *vd, unsigned long tx_flags)
 {
-   extern dma_cookie_t vchan_tx_submit(struct dma_async_tx_descriptor *);
-   extern int vchan_tx_desc_free(struct dma_async_tx_descriptor *);
unsigned long flags;
 
dma_async_tx_descriptor_init(>tx, >chan);
-- 
2.7.4



[PATCH] dma-buf/sw_sync: mark sync_timeline_create() static

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/dma-buf/sw_sync.c:87:23: warning: no previous prototype for 
'sync_timeline_create' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/dma-buf/sw_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index 62e8e6d..6f16c85 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -84,7 +84,7 @@ static inline struct sync_pt *fence_to_sync_pt(struct fence 
*fence)
  * Creates a new sync_timeline. Returns the sync_timeline object or NULL in
  * case of error.
  */
-struct sync_timeline *sync_timeline_create(const char *name)
+static struct sync_timeline *sync_timeline_create(const char *name)
 {
struct sync_timeline *obj;
 
-- 
2.7.4



[PATCH] dma-buf/sw_sync: mark sync_timeline_create() static

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/dma-buf/sw_sync.c:87:23: warning: no previous prototype for 
'sync_timeline_create' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/dma-buf/sw_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index 62e8e6d..6f16c85 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -84,7 +84,7 @@ static inline struct sync_pt *fence_to_sync_pt(struct fence 
*fence)
  * Creates a new sync_timeline. Returns the sync_timeline object or NULL in
  * case of error.
  */
-struct sync_timeline *sync_timeline_create(const char *name)
+static struct sync_timeline *sync_timeline_create(const char *name)
 {
struct sync_timeline *obj;
 
-- 
2.7.4



[PATCH] clk: versatile: add missing header dependencies

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/clk/versatile/clk-realview.c:54:13: warning: no previous prototype for 
'realview_clk_init' [-Wmissing-prototypes]

In fact, this function is declared in
include/linux/platform_data/clk-realview.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/clk/versatile/clk-realview.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/versatile/clk-realview.c 
b/drivers/clk/versatile/clk-realview.c
index c56efc7..f662fd1 100644
--- a/drivers/clk/versatile/clk-realview.c
+++ b/drivers/clk/versatile/clk-realview.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "clk-icst.h"
 
-- 
2.7.4



[PATCH] clk: versatile: add missing header dependencies

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/clk/versatile/clk-realview.c:54:13: warning: no previous prototype for 
'realview_clk_init' [-Wmissing-prototypes]

In fact, this function is declared in
include/linux/platform_data/clk-realview.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/clk/versatile/clk-realview.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/versatile/clk-realview.c 
b/drivers/clk/versatile/clk-realview.c
index c56efc7..f662fd1 100644
--- a/drivers/clk/versatile/clk-realview.c
+++ b/drivers/clk/versatile/clk-realview.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "clk-icst.h"
 
-- 
2.7.4



[PATCH] crypto: sunxi-ss: mark sun4i_hash() static

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/crypto/sunxi-ss/sun4i-ss-hash.c:168:5: warning: no previous prototype 
for 'sun4i_hash' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c 
b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
index 1afeb8e..0de2f62 100644
--- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
@@ -165,7 +165,7 @@ int sun4i_hash_import_sha1(struct ahash_request *areq, 
const void *in)
  * write remaining data in op->buf
  * final state op->len=56
  */
-int sun4i_hash(struct ahash_request *areq)
+static int sun4i_hash(struct ahash_request *areq)
 {
u32 v, ivmode = 0;
unsigned int i = 0;
-- 
2.7.4



[PATCH] crypto: sunxi-ss: mark sun4i_hash() static

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/crypto/sunxi-ss/sun4i-ss-hash.c:168:5: warning: no previous prototype 
for 'sun4i_hash' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c 
b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
index 1afeb8e..0de2f62 100644
--- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
@@ -165,7 +165,7 @@ int sun4i_hash_import_sha1(struct ahash_request *areq, 
const void *in)
  * write remaining data in op->buf
  * final state op->len=56
  */
-int sun4i_hash(struct ahash_request *areq)
+static int sun4i_hash(struct ahash_request *areq)
 {
u32 v, ivmode = 0;
unsigned int i = 0;
-- 
2.7.4



[PATCH] random: add missing header dependencies

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/char/random.c:2140:6: warning: no previous prototype for 
'add_hwgenerator_randomness' [-Wmissing-prototypes]

In fact, this function is declared in include/linux/hw_random.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/char/random.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index d6876d5..aa0950a 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -262,6 +262,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
-- 
2.7.4



[PATCH] random: add missing header dependencies

2016-09-23 Thread Baoyou Xie
We get 1 warning when building kernel with W=1:
drivers/char/random.c:2140:6: warning: no previous prototype for 
'add_hwgenerator_randomness' [-Wmissing-prototypes]

In fact, this function is declared in include/linux/hw_random.h,
so this patch adds missing header dependencies.

Signed-off-by: Baoyou Xie 
---
 drivers/char/random.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index d6876d5..aa0950a 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -262,6 +262,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
-- 
2.7.4



Re: [PATCH cgroup/for-4.8-fixes] cgroup: fix invalid controller enable rejections with cgroup namespace

2016-09-23 Thread Serge E. Hallyn
On Fri, Sep 23, 2016 at 05:00:03PM -0400, Tejun Heo wrote:
> >From 9157056da8f8c4a6305f15619e269f164b63a6de Mon Sep 17 00:00:00 2001
> From: Tejun Heo 
> Date: Fri, 23 Sep 2016 16:55:49 -0400
> 
> On the v2 hierarchy, "cgroup.subtree_control" rejects controller
> enables if the cgroup has processes in it.  The enforcement of this
> logic assumes that the cgroup wouldn't have any css_sets associated
> with it if there are no tasks in the cgroup, which is no longer true
> since a79a908fd2b0 ("cgroup: introduce cgroup namespaces").
> 
> When a cgroup namespace is created, it pins the css_set of the
> creating task to use it as the root css_set of the namespace.  This
> extra reference stays as long as the namespace is around and makes
> "cgroup.subtree_control" think that the namespace root cgroup is not
> empty even when it is and thus reject controller enables.
> 
> Fix it by making cgroup_subtree_control() walk and test emptiness of
> each css_set instead of testing whether the list_head is empty.
> 
> While at it, update the comment of cgroup_task_count() to indicate
> that the returned value may be higher than the number of tasks, which
> has always been true due to temporary references and doesn't break
> anything.
> 
> Signed-off-by: Tejun Heo 
> Reported-by: Evgeny Vereshchagin 
> Cc: Serge E. Hallyn 

Acked-by: Serge Hallyn 

thanks!

-serge

> Cc: Aditya Kali 
> Cc: Eric W. Biederman 
> Cc: sta...@vger.kernel.org # v4.6+
> Fixes: a79a908fd2b0 ("cgroup: introduce cgroup namespaces")
> Link: https://github.com/systemd/systemd/pull/3589#issuecomment-249089541
> ---
> Hello,
> 
> I applied this patch to cgroup/for-4.8-fixes as I wanted it to get
> exposure ASAP as it's pretty late in the devel cycle.  If I messed up
> something, please let me know.
> 
> Thanks.
> 
>  kernel/cgroup.c | 29 +
>  1 file changed, 25 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index d1c51b7..0d4ee1e 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -3446,9 +3446,28 @@ static ssize_t cgroup_subtree_control_write(struct 
> kernfs_open_file *of,
>* Except for the root, subtree_control must be zero for a cgroup
>* with tasks so that child cgroups don't compete against tasks.
>*/
> - if (enable && cgroup_parent(cgrp) && !list_empty(>cset_links)) {
> - ret = -EBUSY;
> - goto out_unlock;
> + if (enable && cgroup_parent(cgrp)) {
> + struct cgrp_cset_link *link;
> +
> + /*
> +  * Because namespaces pin csets too, @cgrp->cset_links
> +  * might not be empty even when @cgrp is empty.  Walk and
> +  * verify each cset.
> +  */
> + spin_lock_irq(_set_lock);
> +
> + ret = 0;
> + list_for_each_entry(link, >cset_links, cset_link) {
> + if (css_set_populated(link->cset)) {
> + ret = -EBUSY;
> + break;
> + }
> + }
> +
> + spin_unlock_irq(_set_lock);
> +
> + if (ret)
> + goto out_unlock;
>   }
>  
>   /* save and update control masks and prepare csses */
> @@ -3899,7 +3918,9 @@ void cgroup_file_notify(struct cgroup_file *cfile)
>   * cgroup_task_count - count the number of tasks in a cgroup.
>   * @cgrp: the cgroup in question
>   *
> - * Return the number of tasks in the cgroup.
> + * Return the number of tasks in the cgroup.  The returned number can be
> + * higher than the actual number of tasks due to css_set references from
> + * namespace roots and temporary usages.
>   */
>  static int cgroup_task_count(const struct cgroup *cgrp)
>  {
> -- 
> 2.7.4


[PATCH] drbd: mark symbols static where possible

2016-09-23 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/block/drbd/drbd_worker.c:197:6: warning: no previous prototype for 
'drbd_panic_after_delayed_completion_of_aborted_request' [-Wmissing-prototypes]
drivers/block/drbd/drbd_receiver.c:1224:6: warning: no previous prototype for 
'one_flush_endio' [-Wmissing-prototypes]
drivers/block/drbd/drbd_req.c:1450:6: warning: no previous prototype for 
'send_and_submit_pending' [-Wmissing-prototypes]
drivers/block/drbd/drbd_main.c:924:6: warning: no previous prototype for 
'assign_p_sizes_qlim' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/block/drbd/drbd_main.c | 3 ++-
 drivers/block/drbd/drbd_receiver.c | 2 +-
 drivers/block/drbd/drbd_req.c  | 3 ++-
 drivers/block/drbd/drbd_worker.c   | 3 ++-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 100be55..c3133c5 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -921,7 +921,8 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device 
*peer_device)
 }
 
 /* communicated if (agreed_features & DRBD_FF_WSAME) */
-void assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p, struct 
request_queue *q)
+static void assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
+   struct request_queue *q)
 {
if (q) {
p->qlim->physical_block_size = 
cpu_to_be32(queue_physical_block_size(q));
diff --git a/drivers/block/drbd/drbd_receiver.c 
b/drivers/block/drbd/drbd_receiver.c
index 942384f..432f39a 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1221,7 +1221,7 @@ struct one_flush_context {
struct issue_flush_context *ctx;
 };
 
-void one_flush_endio(struct bio *bio)
+static void one_flush_endio(struct bio *bio)
 {
struct one_flush_context *octx = bio->bi_private;
struct drbd_device *device = octx->device;
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index de279fe..c725bf5 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -1447,7 +1447,8 @@ static bool prepare_al_transaction_nonblock(struct 
drbd_device *device,
return !list_empty(pending);
 }
 
-void send_and_submit_pending(struct drbd_device *device, struct list_head 
*pending)
+static void
+send_and_submit_pending(struct drbd_device *device, struct list_head *pending)
 {
struct drbd_request *req, *tmp;
 
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index c6755c9..70f2706 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -194,7 +194,8 @@ void drbd_peer_request_endio(struct bio *bio)
}
 }
 
-void drbd_panic_after_delayed_completion_of_aborted_request(struct drbd_device 
*device)
+static void
+drbd_panic_after_delayed_completion_of_aborted_request(struct drbd_device 
*device)
 {
panic("drbd%u %s/%u potential random memory corruption caused by 
delayed completion of aborted local request\n",
device->minor, device->resource->name, device->vnr);
-- 
2.7.4



Re: [PATCH cgroup/for-4.8-fixes] cgroup: fix invalid controller enable rejections with cgroup namespace

2016-09-23 Thread Serge E. Hallyn
On Fri, Sep 23, 2016 at 05:00:03PM -0400, Tejun Heo wrote:
> >From 9157056da8f8c4a6305f15619e269f164b63a6de Mon Sep 17 00:00:00 2001
> From: Tejun Heo 
> Date: Fri, 23 Sep 2016 16:55:49 -0400
> 
> On the v2 hierarchy, "cgroup.subtree_control" rejects controller
> enables if the cgroup has processes in it.  The enforcement of this
> logic assumes that the cgroup wouldn't have any css_sets associated
> with it if there are no tasks in the cgroup, which is no longer true
> since a79a908fd2b0 ("cgroup: introduce cgroup namespaces").
> 
> When a cgroup namespace is created, it pins the css_set of the
> creating task to use it as the root css_set of the namespace.  This
> extra reference stays as long as the namespace is around and makes
> "cgroup.subtree_control" think that the namespace root cgroup is not
> empty even when it is and thus reject controller enables.
> 
> Fix it by making cgroup_subtree_control() walk and test emptiness of
> each css_set instead of testing whether the list_head is empty.
> 
> While at it, update the comment of cgroup_task_count() to indicate
> that the returned value may be higher than the number of tasks, which
> has always been true due to temporary references and doesn't break
> anything.
> 
> Signed-off-by: Tejun Heo 
> Reported-by: Evgeny Vereshchagin 
> Cc: Serge E. Hallyn 

Acked-by: Serge Hallyn 

thanks!

-serge

> Cc: Aditya Kali 
> Cc: Eric W. Biederman 
> Cc: sta...@vger.kernel.org # v4.6+
> Fixes: a79a908fd2b0 ("cgroup: introduce cgroup namespaces")
> Link: https://github.com/systemd/systemd/pull/3589#issuecomment-249089541
> ---
> Hello,
> 
> I applied this patch to cgroup/for-4.8-fixes as I wanted it to get
> exposure ASAP as it's pretty late in the devel cycle.  If I messed up
> something, please let me know.
> 
> Thanks.
> 
>  kernel/cgroup.c | 29 +
>  1 file changed, 25 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index d1c51b7..0d4ee1e 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -3446,9 +3446,28 @@ static ssize_t cgroup_subtree_control_write(struct 
> kernfs_open_file *of,
>* Except for the root, subtree_control must be zero for a cgroup
>* with tasks so that child cgroups don't compete against tasks.
>*/
> - if (enable && cgroup_parent(cgrp) && !list_empty(>cset_links)) {
> - ret = -EBUSY;
> - goto out_unlock;
> + if (enable && cgroup_parent(cgrp)) {
> + struct cgrp_cset_link *link;
> +
> + /*
> +  * Because namespaces pin csets too, @cgrp->cset_links
> +  * might not be empty even when @cgrp is empty.  Walk and
> +  * verify each cset.
> +  */
> + spin_lock_irq(_set_lock);
> +
> + ret = 0;
> + list_for_each_entry(link, >cset_links, cset_link) {
> + if (css_set_populated(link->cset)) {
> + ret = -EBUSY;
> + break;
> + }
> + }
> +
> + spin_unlock_irq(_set_lock);
> +
> + if (ret)
> + goto out_unlock;
>   }
>  
>   /* save and update control masks and prepare csses */
> @@ -3899,7 +3918,9 @@ void cgroup_file_notify(struct cgroup_file *cfile)
>   * cgroup_task_count - count the number of tasks in a cgroup.
>   * @cgrp: the cgroup in question
>   *
> - * Return the number of tasks in the cgroup.
> + * Return the number of tasks in the cgroup.  The returned number can be
> + * higher than the actual number of tasks due to css_set references from
> + * namespace roots and temporary usages.
>   */
>  static int cgroup_task_count(const struct cgroup *cgrp)
>  {
> -- 
> 2.7.4


[PATCH] drbd: mark symbols static where possible

2016-09-23 Thread Baoyou Xie
We get 4 warnings when building kernel with W=1:
drivers/block/drbd/drbd_worker.c:197:6: warning: no previous prototype for 
'drbd_panic_after_delayed_completion_of_aborted_request' [-Wmissing-prototypes]
drivers/block/drbd/drbd_receiver.c:1224:6: warning: no previous prototype for 
'one_flush_endio' [-Wmissing-prototypes]
drivers/block/drbd/drbd_req.c:1450:6: warning: no previous prototype for 
'send_and_submit_pending' [-Wmissing-prototypes]
drivers/block/drbd/drbd_main.c:924:6: warning: no previous prototype for 
'assign_p_sizes_qlim' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/block/drbd/drbd_main.c | 3 ++-
 drivers/block/drbd/drbd_receiver.c | 2 +-
 drivers/block/drbd/drbd_req.c  | 3 ++-
 drivers/block/drbd/drbd_worker.c   | 3 ++-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 100be55..c3133c5 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -921,7 +921,8 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device 
*peer_device)
 }
 
 /* communicated if (agreed_features & DRBD_FF_WSAME) */
-void assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p, struct 
request_queue *q)
+static void assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
+   struct request_queue *q)
 {
if (q) {
p->qlim->physical_block_size = 
cpu_to_be32(queue_physical_block_size(q));
diff --git a/drivers/block/drbd/drbd_receiver.c 
b/drivers/block/drbd/drbd_receiver.c
index 942384f..432f39a 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1221,7 +1221,7 @@ struct one_flush_context {
struct issue_flush_context *ctx;
 };
 
-void one_flush_endio(struct bio *bio)
+static void one_flush_endio(struct bio *bio)
 {
struct one_flush_context *octx = bio->bi_private;
struct drbd_device *device = octx->device;
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index de279fe..c725bf5 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -1447,7 +1447,8 @@ static bool prepare_al_transaction_nonblock(struct 
drbd_device *device,
return !list_empty(pending);
 }
 
-void send_and_submit_pending(struct drbd_device *device, struct list_head 
*pending)
+static void
+send_and_submit_pending(struct drbd_device *device, struct list_head *pending)
 {
struct drbd_request *req, *tmp;
 
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index c6755c9..70f2706 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -194,7 +194,8 @@ void drbd_peer_request_endio(struct bio *bio)
}
 }
 
-void drbd_panic_after_delayed_completion_of_aborted_request(struct drbd_device 
*device)
+static void
+drbd_panic_after_delayed_completion_of_aborted_request(struct drbd_device 
*device)
 {
panic("drbd%u %s/%u potential random memory corruption caused by 
delayed completion of aborted local request\n",
device->minor, device->resource->name, device->vnr);
-- 
2.7.4



hi

2016-09-23 Thread Will C
Salutations 



http://flatcreekcrossingranch.com/mile.php?missing=1pubc8052vea


Will C


hi

2016-09-23 Thread Will C
Salutations 



http://flatcreekcrossingranch.com/mile.php?missing=1pubc8052vea


Will C


Re: [PATCH] samples: move blackfin gptimers-example from Documentation

2016-09-23 Thread Shuah Khan
On 09/23/2016 05:45 PM, Shuah Khan wrote:
> Move blackfin gptimers-example to samples and remove the Documentation
> Makefile. Update samples Kconfig and Makefile to build gptimers-example.
> 
> Signed-off-by: Shuah Khan 

This patch isn't complete. CONFIG_BUILD_DOCSRC=1 make fails without
updating the Makefile and lib/Kconfig.debug

I am going to send v2 that is complete.

thanks,
-- Shuah

> ---
>  Documentation/Makefile|  1 -
>  Documentation/blackfin/00-INDEX   |  4 --
>  Documentation/blackfin/Makefile   |  5 --
>  Documentation/blackfin/gptimers-example.c | 91 
> ---
>  samples/Kconfig   |  6 ++
>  samples/Makefile  |  2 +-
>  samples/blackfin/Makefile |  1 +
>  samples/blackfin/gptimers-example.c   | 91 
> +++
>  8 files changed, 99 insertions(+), 102 deletions(-)
>  delete mode 100644 Documentation/Makefile
>  delete mode 100644 Documentation/blackfin/Makefile
>  delete mode 100644 Documentation/blackfin/gptimers-example.c
>  create mode 100644 samples/blackfin/Makefile
>  create mode 100644 samples/blackfin/gptimers-example.c
> 
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> deleted file mode 100644
> index 8435965..000
> --- a/Documentation/Makefile
> +++ /dev/null
> @@ -1 +0,0 @@
> -subdir-y := blackfin
> diff --git a/Documentation/blackfin/00-INDEX b/Documentation/blackfin/00-INDEX
> index c54fcdd..265a1ef 100644
> --- a/Documentation/blackfin/00-INDEX
> +++ b/Documentation/blackfin/00-INDEX
> @@ -1,10 +1,6 @@
>  00-INDEX
>   - This file
> -Makefile
> - - Makefile for gptimers example file.
>  bfin-gpio-notes.txt
>   - Notes in developing/using bfin-gpio driver.
>  bfin-spi-notes.txt
>   - Notes for using bfin spi bus driver.
> -gptimers-example.c
> - - gptimers example
> diff --git a/Documentation/blackfin/Makefile b/Documentation/blackfin/Makefile
> deleted file mode 100644
> index 6782c58..000
> --- a/Documentation/blackfin/Makefile
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -ifneq ($(CONFIG_BLACKFIN),)
> -ifneq ($(CONFIG_BFIN_GPTIMERS),)
> -obj-m := gptimers-example.o
> -endif
> -endif
> diff --git a/Documentation/blackfin/gptimers-example.c 
> b/Documentation/blackfin/gptimers-example.c
> deleted file mode 100644
> index 283eba9..000
> --- a/Documentation/blackfin/gptimers-example.c
> +++ /dev/null
> @@ -1,91 +0,0 @@
> -/*
> - * Simple gptimers example
> - *   
> http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gptimers
> - *
> - * Copyright 2007-2009 Analog Devices Inc.
> - *
> - * Licensed under the GPL-2 or later.
> - */
> -
> -#include 
> -#include 
> -
> -#include 
> -#include 
> -
> -/* ... random driver includes ... */
> -
> -#define DRIVER_NAME "gptimer_example"
> -
> -#ifdef IRQ_TIMER5
> -#define SAMPLE_IRQ_TIMER IRQ_TIMER5
> -#else
> -#define SAMPLE_IRQ_TIMER IRQ_TIMER2
> -#endif
> -
> -struct gptimer_data {
> - uint32_t period, width;
> -};
> -static struct gptimer_data data;
> -
> -/* ... random driver state ... */
> -
> -static irqreturn_t gptimer_example_irq(int irq, void *dev_id)
> -{
> - struct gptimer_data *data = dev_id;
> -
> - /* make sure it was our timer which caused the interrupt */
> - if (!get_gptimer_intr(TIMER5_id))
> - return IRQ_NONE;
> -
> - /* read the width/period values that were captured for the waveform */
> - data->width = get_gptimer_pwidth(TIMER5_id);
> - data->period = get_gptimer_period(TIMER5_id);
> -
> - /* acknowledge the interrupt */
> - clear_gptimer_intr(TIMER5_id);
> -
> - /* tell the upper layers we took care of things */
> - return IRQ_HANDLED;
> -}
> -
> -/* ... random driver code ... */
> -
> -static int __init gptimer_example_init(void)
> -{
> - int ret;
> -
> - /* grab the peripheral pins */
> - ret = peripheral_request(P_TMR5, DRIVER_NAME);
> - if (ret) {
> - printk(KERN_NOTICE DRIVER_NAME ": peripheral request failed\n");
> - return ret;
> - }
> -
> - /* grab the IRQ for the timer */
> - ret = request_irq(SAMPLE_IRQ_TIMER, gptimer_example_irq,
> - IRQF_SHARED, DRIVER_NAME, );
> - if (ret) {
> - printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n");
> - peripheral_free(P_TMR5);
> - return ret;
> - }
> -
> - /* setup the timer and enable it */
> - set_gptimer_config(TIMER5_id,
> - WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA);
> - enable_gptimers(TIMER5bit);
> -
> - return 0;
> -}
> -module_init(gptimer_example_init);
> -
> -static void __exit gptimer_example_exit(void)
> -{
> - disable_gptimers(TIMER5bit);
> - free_irq(SAMPLE_IRQ_TIMER, );
> - peripheral_free(P_TMR5);
> -}
> -module_exit(gptimer_example_exit);
> -
> -MODULE_LICENSE("BSD");
> diff --git a/samples/Kconfig 

Re: [PATCH] samples: move blackfin gptimers-example from Documentation

2016-09-23 Thread Shuah Khan
On 09/23/2016 05:45 PM, Shuah Khan wrote:
> Move blackfin gptimers-example to samples and remove the Documentation
> Makefile. Update samples Kconfig and Makefile to build gptimers-example.
> 
> Signed-off-by: Shuah Khan 

This patch isn't complete. CONFIG_BUILD_DOCSRC=1 make fails without
updating the Makefile and lib/Kconfig.debug

I am going to send v2 that is complete.

thanks,
-- Shuah

> ---
>  Documentation/Makefile|  1 -
>  Documentation/blackfin/00-INDEX   |  4 --
>  Documentation/blackfin/Makefile   |  5 --
>  Documentation/blackfin/gptimers-example.c | 91 
> ---
>  samples/Kconfig   |  6 ++
>  samples/Makefile  |  2 +-
>  samples/blackfin/Makefile |  1 +
>  samples/blackfin/gptimers-example.c   | 91 
> +++
>  8 files changed, 99 insertions(+), 102 deletions(-)
>  delete mode 100644 Documentation/Makefile
>  delete mode 100644 Documentation/blackfin/Makefile
>  delete mode 100644 Documentation/blackfin/gptimers-example.c
>  create mode 100644 samples/blackfin/Makefile
>  create mode 100644 samples/blackfin/gptimers-example.c
> 
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> deleted file mode 100644
> index 8435965..000
> --- a/Documentation/Makefile
> +++ /dev/null
> @@ -1 +0,0 @@
> -subdir-y := blackfin
> diff --git a/Documentation/blackfin/00-INDEX b/Documentation/blackfin/00-INDEX
> index c54fcdd..265a1ef 100644
> --- a/Documentation/blackfin/00-INDEX
> +++ b/Documentation/blackfin/00-INDEX
> @@ -1,10 +1,6 @@
>  00-INDEX
>   - This file
> -Makefile
> - - Makefile for gptimers example file.
>  bfin-gpio-notes.txt
>   - Notes in developing/using bfin-gpio driver.
>  bfin-spi-notes.txt
>   - Notes for using bfin spi bus driver.
> -gptimers-example.c
> - - gptimers example
> diff --git a/Documentation/blackfin/Makefile b/Documentation/blackfin/Makefile
> deleted file mode 100644
> index 6782c58..000
> --- a/Documentation/blackfin/Makefile
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -ifneq ($(CONFIG_BLACKFIN),)
> -ifneq ($(CONFIG_BFIN_GPTIMERS),)
> -obj-m := gptimers-example.o
> -endif
> -endif
> diff --git a/Documentation/blackfin/gptimers-example.c 
> b/Documentation/blackfin/gptimers-example.c
> deleted file mode 100644
> index 283eba9..000
> --- a/Documentation/blackfin/gptimers-example.c
> +++ /dev/null
> @@ -1,91 +0,0 @@
> -/*
> - * Simple gptimers example
> - *   
> http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gptimers
> - *
> - * Copyright 2007-2009 Analog Devices Inc.
> - *
> - * Licensed under the GPL-2 or later.
> - */
> -
> -#include 
> -#include 
> -
> -#include 
> -#include 
> -
> -/* ... random driver includes ... */
> -
> -#define DRIVER_NAME "gptimer_example"
> -
> -#ifdef IRQ_TIMER5
> -#define SAMPLE_IRQ_TIMER IRQ_TIMER5
> -#else
> -#define SAMPLE_IRQ_TIMER IRQ_TIMER2
> -#endif
> -
> -struct gptimer_data {
> - uint32_t period, width;
> -};
> -static struct gptimer_data data;
> -
> -/* ... random driver state ... */
> -
> -static irqreturn_t gptimer_example_irq(int irq, void *dev_id)
> -{
> - struct gptimer_data *data = dev_id;
> -
> - /* make sure it was our timer which caused the interrupt */
> - if (!get_gptimer_intr(TIMER5_id))
> - return IRQ_NONE;
> -
> - /* read the width/period values that were captured for the waveform */
> - data->width = get_gptimer_pwidth(TIMER5_id);
> - data->period = get_gptimer_period(TIMER5_id);
> -
> - /* acknowledge the interrupt */
> - clear_gptimer_intr(TIMER5_id);
> -
> - /* tell the upper layers we took care of things */
> - return IRQ_HANDLED;
> -}
> -
> -/* ... random driver code ... */
> -
> -static int __init gptimer_example_init(void)
> -{
> - int ret;
> -
> - /* grab the peripheral pins */
> - ret = peripheral_request(P_TMR5, DRIVER_NAME);
> - if (ret) {
> - printk(KERN_NOTICE DRIVER_NAME ": peripheral request failed\n");
> - return ret;
> - }
> -
> - /* grab the IRQ for the timer */
> - ret = request_irq(SAMPLE_IRQ_TIMER, gptimer_example_irq,
> - IRQF_SHARED, DRIVER_NAME, );
> - if (ret) {
> - printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n");
> - peripheral_free(P_TMR5);
> - return ret;
> - }
> -
> - /* setup the timer and enable it */
> - set_gptimer_config(TIMER5_id,
> - WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA);
> - enable_gptimers(TIMER5bit);
> -
> - return 0;
> -}
> -module_init(gptimer_example_init);
> -
> -static void __exit gptimer_example_exit(void)
> -{
> - disable_gptimers(TIMER5bit);
> - free_irq(SAMPLE_IRQ_TIMER, );
> - peripheral_free(P_TMR5);
> -}
> -module_exit(gptimer_example_exit);
> -
> -MODULE_LICENSE("BSD");
> diff --git a/samples/Kconfig b/samples/Kconfig
> index 

Re: [PATCH 2/3] f2fs: support checkpoint error injection

2016-09-23 Thread Chao Yu
On 2016/9/24 8:52, Jaegeuk Kim wrote:
> On Sat, Sep 24, 2016 at 08:46:54AM +0800, Chao Yu wrote:
>> Hi Jaegeuk,
>>
>> On 2016/9/24 7:53, Jaegeuk Kim wrote:
>>> Hi Chao,
>>>
>>> The basic rule is to stop every operations once CP_ERROR_FLAG is set.
>>> But, this patch simply breaks the rule.
>>> For example, f2fs_write_data_page() currently exits with 
>>> mapping_set_error().
>>> So this patch incurs missing dentry blocks in a valid checkpoint.
>>
>> Yes, that's right.
>>
>> How about triggering checkpoint error in f2fs_stop_checkpoint?
> 
> Let's just use src/godown in xfstests, since we don't need to trigger this
> multiple times in runtime.

After we inject checkpoint error into f2fs at first time, all write IOs will be
refused to be writebacked to storage, meanwhile read IOs can continuously go
through f2fs, so with checkpoint error injection being supported, we can support
to trigger random analogously power off by f2fs itself, instead of using tools.
It means it doesn't needs specified test cases where we must use godown ioctl,
but with normal testcases in xfstest/fsstress/lkp, in CP error injection enabled
f2fs, we can test power off cases.

Thanks,



Re: [PATCH 2/3] f2fs: support checkpoint error injection

2016-09-23 Thread Chao Yu
On 2016/9/24 8:52, Jaegeuk Kim wrote:
> On Sat, Sep 24, 2016 at 08:46:54AM +0800, Chao Yu wrote:
>> Hi Jaegeuk,
>>
>> On 2016/9/24 7:53, Jaegeuk Kim wrote:
>>> Hi Chao,
>>>
>>> The basic rule is to stop every operations once CP_ERROR_FLAG is set.
>>> But, this patch simply breaks the rule.
>>> For example, f2fs_write_data_page() currently exits with 
>>> mapping_set_error().
>>> So this patch incurs missing dentry blocks in a valid checkpoint.
>>
>> Yes, that's right.
>>
>> How about triggering checkpoint error in f2fs_stop_checkpoint?
> 
> Let's just use src/godown in xfstests, since we don't need to trigger this
> multiple times in runtime.

After we inject checkpoint error into f2fs at first time, all write IOs will be
refused to be writebacked to storage, meanwhile read IOs can continuously go
through f2fs, so with checkpoint error injection being supported, we can support
to trigger random analogously power off by f2fs itself, instead of using tools.
It means it doesn't needs specified test cases where we must use godown ioctl,
but with normal testcases in xfstest/fsstress/lkp, in CP error injection enabled
f2fs, we can test power off cases.

Thanks,



[PATCH 3/3] mm: delete unnecessary and unsafe init_tlb_ubc()

2016-09-23 Thread Hugh Dickins
init_tlb_ubc() looked unnecessary to me: tlb_ubc is statically initialized
with zeroes in the init_task, and copied from parent to child while it is
quiescent in arch_dup_task_struct(); so I went to delete it.

But inserted temporary debug WARN_ONs in place of init_tlb_ubc() to check
that it was always empty at that point, and found them firing: because
memcg reclaim can recurse into global reclaim (when allocating biosets
for swapout in my case), and arrive back at the init_tlb_ubc() in
shrink_node_memcg().

Resetting tlb_ubc.flush_required at that point is wrong: if the upper
level needs a deferred TLB flush, but the lower level turns out not to,
we miss a TLB flush.  But fortunately, that's the only part of the
protocol that does not nest: with the initialization removed, cpumask 
collects bits from upper and lower levels, and flushes TLB when needed.

Fixes: 72b252aed506 ("mm: send one IPI per CPU to TLB flush all entries after 
unmapping pages")
Signed-off-by: Hugh Dickins 
Acked-by: Mel Gorman 
Cc: sta...@vger.kernel.org # 4.3+
---

 mm/vmscan.c |   19 ---
 1 file changed, 19 deletions(-)

--- 4.8-rc7/mm/vmscan.c 2016-09-05 16:42:52.496692429 -0700
+++ linux/mm/vmscan.c   2016-09-22 09:32:37.900894833 -0700
@@ -2303,23 +2303,6 @@ out:
}
 }
 
-#ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
-static void init_tlb_ubc(void)
-{
-   /*
-* This deliberately does not clear the cpumask as it's expensive
-* and unnecessary. If there happens to be data in there then the
-* first SWAP_CLUSTER_MAX pages will send an unnecessary IPI and
-* then will be cleared.
-*/
-   current->tlb_ubc.flush_required = false;
-}
-#else
-static inline void init_tlb_ubc(void)
-{
-}
-#endif /* CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH */
-
 /*
  * This is a basic per-node page freer.  Used by both kswapd and direct 
reclaim.
  */
@@ -2355,8 +2338,6 @@ static void shrink_node_memcg(struct pgl
scan_adjusted = (global_reclaim(sc) && !current_is_kswapd() &&
 sc->priority == DEF_PRIORITY);
 
-   init_tlb_ubc();
-
blk_start_plug();
while (nr[LRU_INACTIVE_ANON] || nr[LRU_ACTIVE_FILE] ||
nr[LRU_INACTIVE_FILE]) {


[PATCH 3/3] mm: delete unnecessary and unsafe init_tlb_ubc()

2016-09-23 Thread Hugh Dickins
init_tlb_ubc() looked unnecessary to me: tlb_ubc is statically initialized
with zeroes in the init_task, and copied from parent to child while it is
quiescent in arch_dup_task_struct(); so I went to delete it.

But inserted temporary debug WARN_ONs in place of init_tlb_ubc() to check
that it was always empty at that point, and found them firing: because
memcg reclaim can recurse into global reclaim (when allocating biosets
for swapout in my case), and arrive back at the init_tlb_ubc() in
shrink_node_memcg().

Resetting tlb_ubc.flush_required at that point is wrong: if the upper
level needs a deferred TLB flush, but the lower level turns out not to,
we miss a TLB flush.  But fortunately, that's the only part of the
protocol that does not nest: with the initialization removed, cpumask 
collects bits from upper and lower levels, and flushes TLB when needed.

Fixes: 72b252aed506 ("mm: send one IPI per CPU to TLB flush all entries after 
unmapping pages")
Signed-off-by: Hugh Dickins 
Acked-by: Mel Gorman 
Cc: sta...@vger.kernel.org # 4.3+
---

 mm/vmscan.c |   19 ---
 1 file changed, 19 deletions(-)

--- 4.8-rc7/mm/vmscan.c 2016-09-05 16:42:52.496692429 -0700
+++ linux/mm/vmscan.c   2016-09-22 09:32:37.900894833 -0700
@@ -2303,23 +2303,6 @@ out:
}
 }
 
-#ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
-static void init_tlb_ubc(void)
-{
-   /*
-* This deliberately does not clear the cpumask as it's expensive
-* and unnecessary. If there happens to be data in there then the
-* first SWAP_CLUSTER_MAX pages will send an unnecessary IPI and
-* then will be cleared.
-*/
-   current->tlb_ubc.flush_required = false;
-}
-#else
-static inline void init_tlb_ubc(void)
-{
-}
-#endif /* CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH */
-
 /*
  * This is a basic per-node page freer.  Used by both kswapd and direct 
reclaim.
  */
@@ -2355,8 +2338,6 @@ static void shrink_node_memcg(struct pgl
scan_adjusted = (global_reclaim(sc) && !current_is_kswapd() &&
 sc->priority == DEF_PRIORITY);
 
-   init_tlb_ubc();
-
blk_start_plug();
while (nr[LRU_INACTIVE_ANON] || nr[LRU_ACTIVE_FILE] ||
nr[LRU_INACTIVE_FILE]) {


[PATCH 2/3] huge tmpfs: fix Committed_AS leak

2016-09-23 Thread Hugh Dickins
Under swapping load on huge tmpfs, /proc/meminfo's Committed_AS grows
bigger and bigger: just a cosmetic issue for most users, but disabling
for those who run without overcommit (/proc/sys/vm/overcommit_memory 2).

shmem_uncharge() was forgetting to unaccount __vm_enough_memory's charge,
and shmem_charge() was forgetting it on the filesystem-full error path.

Fixes: 800d8c63b2e9 ("shmem: add huge pages support")
Signed-off-by: Hugh Dickins 
Acked-by: Kirill A. Shutemov 
---

 mm/shmem.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- 4.8-rc7/mm/shmem.c  2016-08-14 20:17:02.388843463 -0700
+++ linux/mm/shmem.c2016-09-22 09:29:15.462690346 -0700
@@ -270,7 +270,7 @@ bool shmem_charge(struct inode *inode, l
info->alloced -= pages;
shmem_recalc_inode(inode);
spin_unlock_irqrestore(>lock, flags);
-
+   shmem_unacct_blocks(info->flags, pages);
return false;
}
percpu_counter_add(>used_blocks, pages);
@@ -291,6 +291,7 @@ void shmem_uncharge(struct inode *inode,
 
if (sbinfo->max_blocks)
percpu_counter_sub(>used_blocks, pages);
+   shmem_unacct_blocks(info->flags, pages);
 }
 
 /*


[PATCH 2/3] huge tmpfs: fix Committed_AS leak

2016-09-23 Thread Hugh Dickins
Under swapping load on huge tmpfs, /proc/meminfo's Committed_AS grows
bigger and bigger: just a cosmetic issue for most users, but disabling
for those who run without overcommit (/proc/sys/vm/overcommit_memory 2).

shmem_uncharge() was forgetting to unaccount __vm_enough_memory's charge,
and shmem_charge() was forgetting it on the filesystem-full error path.

Fixes: 800d8c63b2e9 ("shmem: add huge pages support")
Signed-off-by: Hugh Dickins 
Acked-by: Kirill A. Shutemov 
---

 mm/shmem.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- 4.8-rc7/mm/shmem.c  2016-08-14 20:17:02.388843463 -0700
+++ linux/mm/shmem.c2016-09-22 09:29:15.462690346 -0700
@@ -270,7 +270,7 @@ bool shmem_charge(struct inode *inode, l
info->alloced -= pages;
shmem_recalc_inode(inode);
spin_unlock_irqrestore(>lock, flags);
-
+   shmem_unacct_blocks(info->flags, pages);
return false;
}
percpu_counter_add(>used_blocks, pages);
@@ -291,6 +291,7 @@ void shmem_uncharge(struct inode *inode,
 
if (sbinfo->max_blocks)
percpu_counter_sub(>used_blocks, pages);
+   shmem_unacct_blocks(info->flags, pages);
 }
 
 /*


[PATCH 1/3] shmem: fix tmpfs to handle the huge= option properly

2016-09-23 Thread Hugh Dickins
From: Toshi Kani 

shmem_get_unmapped_area() checks SHMEM_SB(sb)->huge incorrectly,
which leads to a reversed effect of "huge=" mount option.

Fix the check in shmem_get_unmapped_area().

Note, the default value of SHMEM_SB(sb)->huge remains as
SHMEM_HUGE_NEVER.  User will need to specify "huge=" option to
enable huge page mappings.

Reported-by: Hillf Danton 
Signed-off-by: Toshi Kani 
Acked-by: Kirill A. Shutemov 
Reviewed-by: Aneesh Kumar K.V 
Signed-off-by: Hugh Dickins 
---

 mm/shmem.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 4.8-rc7/mm/shmem.c  2016-08-14 20:17:02.388843463 -0700
+++ linux/mm/shmem.c2016-09-22 19:41:29.057848626 -0700
@@ -1980,7 +1980,7 @@ unsigned long shmem_get_unmapped_area(st
return addr;
sb = shm_mnt->mnt_sb;
}
-   if (SHMEM_SB(sb)->huge != SHMEM_HUGE_NEVER)
+   if (SHMEM_SB(sb)->huge == SHMEM_HUGE_NEVER)
return addr;
}
 


[PATCH 1/3] shmem: fix tmpfs to handle the huge= option properly

2016-09-23 Thread Hugh Dickins
From: Toshi Kani 

shmem_get_unmapped_area() checks SHMEM_SB(sb)->huge incorrectly,
which leads to a reversed effect of "huge=" mount option.

Fix the check in shmem_get_unmapped_area().

Note, the default value of SHMEM_SB(sb)->huge remains as
SHMEM_HUGE_NEVER.  User will need to specify "huge=" option to
enable huge page mappings.

Reported-by: Hillf Danton 
Signed-off-by: Toshi Kani 
Acked-by: Kirill A. Shutemov 
Reviewed-by: Aneesh Kumar K.V 
Signed-off-by: Hugh Dickins 
---

 mm/shmem.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 4.8-rc7/mm/shmem.c  2016-08-14 20:17:02.388843463 -0700
+++ linux/mm/shmem.c2016-09-22 19:41:29.057848626 -0700
@@ -1980,7 +1980,7 @@ unsigned long shmem_get_unmapped_area(st
return addr;
sb = shm_mnt->mnt_sb;
}
-   if (SHMEM_SB(sb)->huge != SHMEM_HUGE_NEVER)
+   if (SHMEM_SB(sb)->huge == SHMEM_HUGE_NEVER)
return addr;
}
 


drivers/gpu/drm/i915/i915_gem_gtt.c:2367: error: 'gtt_entry' may be used uninitialized in this function

2016-09-23 Thread kbuild test robot
Hi Dave,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   bd5dbcb4be37ce97b115bf9e8d48ae75f0d8a9a2
commit: 85d1225ec066b2ef46fbd0ed1bae78ae1f3e6c91 drm/i915: Introduce & use new 
lightweight SGL iterators
date:   4 months ago
config: x86_64-randconfig-s1-09240927 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
git checkout 85d1225ec066b2ef46fbd0ed1bae78ae1f3e6c91
# save the attached .config to linux build tree
make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All errors (new ones prefixed by >>):

   cc1: warnings being treated as errors
   drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen8_ggtt_insert_entries':
>> drivers/gpu/drm/i915/i915_gem_gtt.c:2367: error: 'gtt_entry' may be used 
>> uninitialized in this function
   drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen6_ggtt_insert_entries':
   drivers/gpu/drm/i915/i915_gem_gtt.c:2442: error: 'gtt_entry' may be used 
uninitialized in this function

vim +/gtt_entry +2367 drivers/gpu/drm/i915/i915_gem_gtt.c

  2361   enum i915_cache_level level, u32 
unused)
  2362  {
  2363  struct drm_i915_private *dev_priv = to_i915(vm->dev);
  2364  struct i915_ggtt *ggtt = i915_vm_to_ggtt(vm);
  2365  struct sgt_iter sgt_iter;
  2366  gen8_pte_t __iomem *gtt_entries;
> 2367  gen8_pte_t gtt_entry;
  2368  dma_addr_t addr;
  2369  int rpm_atomic_seq;
  2370  int i = 0;

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


.config.gz
Description: application/gzip


drivers/gpu/drm/i915/i915_gem_gtt.c:2367: error: 'gtt_entry' may be used uninitialized in this function

2016-09-23 Thread kbuild test robot
Hi Dave,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   bd5dbcb4be37ce97b115bf9e8d48ae75f0d8a9a2
commit: 85d1225ec066b2ef46fbd0ed1bae78ae1f3e6c91 drm/i915: Introduce & use new 
lightweight SGL iterators
date:   4 months ago
config: x86_64-randconfig-s1-09240927 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
git checkout 85d1225ec066b2ef46fbd0ed1bae78ae1f3e6c91
# save the attached .config to linux build tree
make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All errors (new ones prefixed by >>):

   cc1: warnings being treated as errors
   drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen8_ggtt_insert_entries':
>> drivers/gpu/drm/i915/i915_gem_gtt.c:2367: error: 'gtt_entry' may be used 
>> uninitialized in this function
   drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen6_ggtt_insert_entries':
   drivers/gpu/drm/i915/i915_gem_gtt.c:2442: error: 'gtt_entry' may be used 
uninitialized in this function

vim +/gtt_entry +2367 drivers/gpu/drm/i915/i915_gem_gtt.c

  2361   enum i915_cache_level level, u32 
unused)
  2362  {
  2363  struct drm_i915_private *dev_priv = to_i915(vm->dev);
  2364  struct i915_ggtt *ggtt = i915_vm_to_ggtt(vm);
  2365  struct sgt_iter sgt_iter;
  2366  gen8_pte_t __iomem *gtt_entries;
> 2367  gen8_pte_t gtt_entry;
  2368  dma_addr_t addr;
  2369  int rpm_atomic_seq;
  2370  int i = 0;

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


.config.gz
Description: application/gzip


Re: [PATCH] mm: warn about allocations which stall for too long

2016-09-23 Thread Tetsuo Handa
Michal Hocko wrote:
> On Fri 23-09-16 23:36:22, Tetsuo Handa wrote:
> > Michal Hocko wrote:
> > > @@ -3659,6 +3661,15 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned 
> > > int order,
> > >   else
> > >   no_progress_loops++;
> > >  
> > > + /* Make sure we know about allocations which stall for too long */
> > > + if (!(gfp_mask & __GFP_NOWARN) && time_after(jiffies, alloc_start + 
> > > stall_timeout)) {
> > 
> > Should we check !__GFP_NOWARN ? I think __GFP_NOWARN is likely used with
> > __GFP_NORETRY, and __GFP_NORETRY is already checked by now.
> > 
> > I think printing warning regardless of __GFP_NOWARN is better because
> > this check is similar to hungtask warning.
> 
> Well, if the user said to not warn we should really obey that. Why would
> that matter?

__GFP_NOWARN is defined as "Do not print failure messages when memory
allocation failed". It is not defined as "Do not print OOM killer messages
when OOM killer is invoked". It is undefined that "Do not print stall
messages when memory allocation is stalling".

If memory allocating threads were blocked on locks instead of doing direct
reclaim, hungtask will be able to find stalling memory allocations without
this change. Since direct reclaim prevents allocating threads from sleeping
for long enough to be warned by hungtask, it is important that this change
shall find allocating threads which cannot be warned by hungtask. That is,
not printing warning messages for __GFP_NOWARN allocation requests looses
the value of this change.

>  
> > > + pr_warn("%s: page alloction stalls for %ums: order:%u 
> > > mode:%#x(%pGg)\n",
> > > + current->comm, 
> > > jiffies_to_msecs(jiffies-alloc_start),
> > > + order, gfp_mask, _mask);
> > > + stall_timeout += 10 * HZ;
> > > + dump_stack();
> > 
> > Can we move this pr_warn() + dump_stack() to a separate function like
> > 
> > static void __warn_memalloc_stall(unsigned int order, gfp_t gfp_mask, 
> > unsigned long alloc_start)
> > {
> > pr_warn("%s: page alloction stalls for %ums: order:%u mode:%#x(%pGg)\n",
> > current->comm, jiffies_to_msecs(jiffies-alloc_start),
> > order, gfp_mask, _mask);
> > dump_stack();
> > }
> > 
> > in order to allow SystemTap scripts to perform additional actions by name 
> > (e.g.
> > 
> > # stap -g -e 'probe kernel.function("__warn_memalloc_stall").return { 
> > panic(); }
> 
> I find this reasoning and the use case really _absurd_, seriously! Pulling
> the warning into a separate function might be reasonable regardless,
> though. It matches warn_alloc_failed. Also if we find out we need some
> rate limitting or more checks it might just turn out being easier to
> follow rather than in the middle of an already complicated allocation
> slow path. I just do not like that the stall_timeout would have to stay
> in the original place or have it an in/out parameter.

SystemTap script shown above is just an example. What is nice is that
we can do whatever actions for examining what is going on by using a
function as if an interrupt handler. For example, when I was working at
support center, there was a support case where the customer's system always
reboots for unknown reason whenever specific action is taken. I inserted
SystemTap script shown above into a function which is called when a system
reboots, and I identified that the reason was SysRq-b which was triggered by
HA manager daemon due to misconfiguration. I used a reboot function as an
interrupt handler for examining why that handler was called. Likewise, we
can use __warn_memalloc_stall() as an interrupt handler for examining what
is going on. I think that there will be situations where existing printk()
does not provide enough information and thus examining a memory snapshot is
needed. Allowing tracing tools like SystemTap to insert a hook by function
name (instead of line number) is helpful anyway.

Going back to !(gfp_mask & __GFP_NOWARN) check, if you don't want to
print stall messages, you can move that check to inside
__warn_memalloc_stall(). Then, I can insert a SystemTap hook to print
stall messages for !(gfp_mask & __GFP_NOWARN) case. Even more, if you
are not sure what is best threshold, you can call a hook function every
second. The SystemTap script can check threshold and print warning if
necessary information are passed to that hook function. This resembles
LSM hooks. In the past, LSM hook was calling an empty function with
necessary information when LSM hook user (e.g. SELinux) is not registered.

> 
> > ) rather than by line number, and surround __warn_memalloc_stall() call with
> > mutex in order to serialize warning messages because it is possible that
> > multiple allocation requests are stalling?
> 
> we do not use any lock in warn_alloc_failed so why this should be any
> different?

warn_alloc_failed() is called for both __GFP_DIRECT_RECLAIM and
!__GFP_DIRECT_RECLAIM allocation requests, and it is 

Re: [PATCH] mm: warn about allocations which stall for too long

2016-09-23 Thread Tetsuo Handa
Michal Hocko wrote:
> On Fri 23-09-16 23:36:22, Tetsuo Handa wrote:
> > Michal Hocko wrote:
> > > @@ -3659,6 +3661,15 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned 
> > > int order,
> > >   else
> > >   no_progress_loops++;
> > >  
> > > + /* Make sure we know about allocations which stall for too long */
> > > + if (!(gfp_mask & __GFP_NOWARN) && time_after(jiffies, alloc_start + 
> > > stall_timeout)) {
> > 
> > Should we check !__GFP_NOWARN ? I think __GFP_NOWARN is likely used with
> > __GFP_NORETRY, and __GFP_NORETRY is already checked by now.
> > 
> > I think printing warning regardless of __GFP_NOWARN is better because
> > this check is similar to hungtask warning.
> 
> Well, if the user said to not warn we should really obey that. Why would
> that matter?

__GFP_NOWARN is defined as "Do not print failure messages when memory
allocation failed". It is not defined as "Do not print OOM killer messages
when OOM killer is invoked". It is undefined that "Do not print stall
messages when memory allocation is stalling".

If memory allocating threads were blocked on locks instead of doing direct
reclaim, hungtask will be able to find stalling memory allocations without
this change. Since direct reclaim prevents allocating threads from sleeping
for long enough to be warned by hungtask, it is important that this change
shall find allocating threads which cannot be warned by hungtask. That is,
not printing warning messages for __GFP_NOWARN allocation requests looses
the value of this change.

>  
> > > + pr_warn("%s: page alloction stalls for %ums: order:%u 
> > > mode:%#x(%pGg)\n",
> > > + current->comm, 
> > > jiffies_to_msecs(jiffies-alloc_start),
> > > + order, gfp_mask, _mask);
> > > + stall_timeout += 10 * HZ;
> > > + dump_stack();
> > 
> > Can we move this pr_warn() + dump_stack() to a separate function like
> > 
> > static void __warn_memalloc_stall(unsigned int order, gfp_t gfp_mask, 
> > unsigned long alloc_start)
> > {
> > pr_warn("%s: page alloction stalls for %ums: order:%u mode:%#x(%pGg)\n",
> > current->comm, jiffies_to_msecs(jiffies-alloc_start),
> > order, gfp_mask, _mask);
> > dump_stack();
> > }
> > 
> > in order to allow SystemTap scripts to perform additional actions by name 
> > (e.g.
> > 
> > # stap -g -e 'probe kernel.function("__warn_memalloc_stall").return { 
> > panic(); }
> 
> I find this reasoning and the use case really _absurd_, seriously! Pulling
> the warning into a separate function might be reasonable regardless,
> though. It matches warn_alloc_failed. Also if we find out we need some
> rate limitting or more checks it might just turn out being easier to
> follow rather than in the middle of an already complicated allocation
> slow path. I just do not like that the stall_timeout would have to stay
> in the original place or have it an in/out parameter.

SystemTap script shown above is just an example. What is nice is that
we can do whatever actions for examining what is going on by using a
function as if an interrupt handler. For example, when I was working at
support center, there was a support case where the customer's system always
reboots for unknown reason whenever specific action is taken. I inserted
SystemTap script shown above into a function which is called when a system
reboots, and I identified that the reason was SysRq-b which was triggered by
HA manager daemon due to misconfiguration. I used a reboot function as an
interrupt handler for examining why that handler was called. Likewise, we
can use __warn_memalloc_stall() as an interrupt handler for examining what
is going on. I think that there will be situations where existing printk()
does not provide enough information and thus examining a memory snapshot is
needed. Allowing tracing tools like SystemTap to insert a hook by function
name (instead of line number) is helpful anyway.

Going back to !(gfp_mask & __GFP_NOWARN) check, if you don't want to
print stall messages, you can move that check to inside
__warn_memalloc_stall(). Then, I can insert a SystemTap hook to print
stall messages for !(gfp_mask & __GFP_NOWARN) case. Even more, if you
are not sure what is best threshold, you can call a hook function every
second. The SystemTap script can check threshold and print warning if
necessary information are passed to that hook function. This resembles
LSM hooks. In the past, LSM hook was calling an empty function with
necessary information when LSM hook user (e.g. SELinux) is not registered.

> 
> > ) rather than by line number, and surround __warn_memalloc_stall() call with
> > mutex in order to serialize warning messages because it is possible that
> > multiple allocation requests are stalling?
> 
> we do not use any lock in warn_alloc_failed so why this should be any
> different?

warn_alloc_failed() is called for both __GFP_DIRECT_RECLAIM and
!__GFP_DIRECT_RECLAIM allocation requests, and it is 

Re: [RFC] remove unnecessary condition in remove_inode_hugepages

2016-09-23 Thread zhong jiang
On 2016/9/24 1:19, Mike Kravetz wrote:
> On 09/22/2016 06:53 PM, zhong jiang wrote:
>> At present, we need to call hugetlb_fix_reserve_count when 
>> hugetlb_unrserve_pages fails,
>> and PagePrivate will decide hugetlb reserves counts.
>>
>> we obtain the page from page cache. and use page both lock_page and 
>> mutex_lock.
>> alloc_huge_page add page to page chace always hold lock page, then bail out 
>> clearpageprivate
>> before unlock page. 
>>
>> but I' m not sure  it is right  or I miss the points.
> Let me try to explain the code you suggest is unnecessary.
>
> The PagePrivate flag is used in huge page allocation/deallocation to
> indicate that the page was globally reserved.  For example, in
> dequeue_huge_page_vma() there is this code:
>
> if (page) {
> if (avoid_reserve)
> break;
> if (!vma_has_reserves(vma, chg))
> break;
>
> SetPagePrivate(page);
> h->resv_huge_pages--;
> break;
> }
>
> and in free_huge_page():
>
> restore_reserve = PagePrivate(page);
> ClearPagePrivate(page);
>   .
>   
>   .
> if (restore_reserve)
> h->resv_huge_pages++;
>
> This helps maintains the global huge page reserve count.
>
> In addition to the global reserve count, there are per VMA reservation
> structures.  Unfortunately, these structures have different meanings
> depending on the context in which they are used.
>
> If there is a VMA reservation entry for a page, and the page has not
> been instantiated in the VMA this indicates there is a huge page reserved
> and the global resv_huge_pages count reflects that reservation.  Even
> if a page was not reserved, a VMA reservation entry is added when a page
> is instantiated in the VMA.
>
> With that background, let's look at the existing code/proposed changes.
 Clearly. 
>> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
>> index 4ea71eb..010723b 100644
>> --- a/fs/hugetlbfs/inode.c
>> +++ b/fs/hugetlbfs/inode.c
>> @@ -462,14 +462,12 @@ static void remove_inode_hugepages(struct inode 
>> *inode, loff_t lstart,
>>  * the page, note PagePrivate which is used in case
>>  * of error.
>>  */
>> -   rsv_on_error = !PagePrivate(page);
> This rsv_on_error flag indicates that when the huge page was allocated,
   yes
> it was NOT counted against the global reserve count.  So, when
> remove_huge_page eventually calls free_huge_page(), the global count
> resv_huge_pages is not incremented.  So far, no problem.
 but the page comes from the page cache.  if it is.  it should implement
 ClearPageprivate(page) when lock page.   This condition always true.

  The key point is why it need still check the PagePrivate(page) when page from
  page cache and hold lock.

  Thanks you
 zhongjiang
>> remove_huge_page(page);
>> freed++;
>> if (!truncate_op) {
>> if (unlikely(hugetlb_unreserve_pages(inode,
>> next, next + 1, 1)))
> We now have this VERY unlikely situation that hugetlb_unreserve_pages fails.
> This means that the VMA reservation entry for the page was not removed.
> So, we are in a bit of a mess.  The page has already been removed, but the
> VMA reservation entry can not.  This LOOKS like there is a reservation for
> the page in the VMA reservation structure.  But, the global count
> resv_huge_pages does not reflect this reservation.
>
> If we do nothing, when the VMA is eventually removed the VMA reservation
> structure will be completely removed and the global count resv_huge_pages
> will be decremented for each entry in the structure.  Since, there is a
> VMA reservation entry without a corresponding global count, the global
> count will be one less than it should (will eventually go to -1).
>
> To 'fix' this, hugetlb_fix_reserve_counts is called.  In this case, it will
> increment the global count so that it is consistent with the entries in
> the VMA reservation structure.
>
> This is all quite confusing and really unlikely to happen.  I tried to
> explain in code comments:
>
> Before removing the page:
> /*
>  * We must free the huge page and remove from page
>  * cache (remove_huge_page) BEFORE removing the
>  * region/reserve map (hugetlb_unreserve_pages).  In
>  * rare out of memory conditions, removal of the
>  * region/reserve map could fail.  Before free'ing
>  * the page, note PagePrivate which is used in case
>  

Re: [RFC] remove unnecessary condition in remove_inode_hugepages

2016-09-23 Thread zhong jiang
On 2016/9/24 1:19, Mike Kravetz wrote:
> On 09/22/2016 06:53 PM, zhong jiang wrote:
>> At present, we need to call hugetlb_fix_reserve_count when 
>> hugetlb_unrserve_pages fails,
>> and PagePrivate will decide hugetlb reserves counts.
>>
>> we obtain the page from page cache. and use page both lock_page and 
>> mutex_lock.
>> alloc_huge_page add page to page chace always hold lock page, then bail out 
>> clearpageprivate
>> before unlock page. 
>>
>> but I' m not sure  it is right  or I miss the points.
> Let me try to explain the code you suggest is unnecessary.
>
> The PagePrivate flag is used in huge page allocation/deallocation to
> indicate that the page was globally reserved.  For example, in
> dequeue_huge_page_vma() there is this code:
>
> if (page) {
> if (avoid_reserve)
> break;
> if (!vma_has_reserves(vma, chg))
> break;
>
> SetPagePrivate(page);
> h->resv_huge_pages--;
> break;
> }
>
> and in free_huge_page():
>
> restore_reserve = PagePrivate(page);
> ClearPagePrivate(page);
>   .
>   
>   .
> if (restore_reserve)
> h->resv_huge_pages++;
>
> This helps maintains the global huge page reserve count.
>
> In addition to the global reserve count, there are per VMA reservation
> structures.  Unfortunately, these structures have different meanings
> depending on the context in which they are used.
>
> If there is a VMA reservation entry for a page, and the page has not
> been instantiated in the VMA this indicates there is a huge page reserved
> and the global resv_huge_pages count reflects that reservation.  Even
> if a page was not reserved, a VMA reservation entry is added when a page
> is instantiated in the VMA.
>
> With that background, let's look at the existing code/proposed changes.
 Clearly. 
>> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
>> index 4ea71eb..010723b 100644
>> --- a/fs/hugetlbfs/inode.c
>> +++ b/fs/hugetlbfs/inode.c
>> @@ -462,14 +462,12 @@ static void remove_inode_hugepages(struct inode 
>> *inode, loff_t lstart,
>>  * the page, note PagePrivate which is used in case
>>  * of error.
>>  */
>> -   rsv_on_error = !PagePrivate(page);
> This rsv_on_error flag indicates that when the huge page was allocated,
   yes
> it was NOT counted against the global reserve count.  So, when
> remove_huge_page eventually calls free_huge_page(), the global count
> resv_huge_pages is not incremented.  So far, no problem.
 but the page comes from the page cache.  if it is.  it should implement
 ClearPageprivate(page) when lock page.   This condition always true.

  The key point is why it need still check the PagePrivate(page) when page from
  page cache and hold lock.

  Thanks you
 zhongjiang
>> remove_huge_page(page);
>> freed++;
>> if (!truncate_op) {
>> if (unlikely(hugetlb_unreserve_pages(inode,
>> next, next + 1, 1)))
> We now have this VERY unlikely situation that hugetlb_unreserve_pages fails.
> This means that the VMA reservation entry for the page was not removed.
> So, we are in a bit of a mess.  The page has already been removed, but the
> VMA reservation entry can not.  This LOOKS like there is a reservation for
> the page in the VMA reservation structure.  But, the global count
> resv_huge_pages does not reflect this reservation.
>
> If we do nothing, when the VMA is eventually removed the VMA reservation
> structure will be completely removed and the global count resv_huge_pages
> will be decremented for each entry in the structure.  Since, there is a
> VMA reservation entry without a corresponding global count, the global
> count will be one less than it should (will eventually go to -1).
>
> To 'fix' this, hugetlb_fix_reserve_counts is called.  In this case, it will
> increment the global count so that it is consistent with the entries in
> the VMA reservation structure.
>
> This is all quite confusing and really unlikely to happen.  I tried to
> explain in code comments:
>
> Before removing the page:
> /*
>  * We must free the huge page and remove from page
>  * cache (remove_huge_page) BEFORE removing the
>  * region/reserve map (hugetlb_unreserve_pages).  In
>  * rare out of memory conditions, removal of the
>  * region/reserve map could fail.  Before free'ing
>  * the page, note PagePrivate which is used in case
>  

Re: [RFC] fs: add userspace critical mounts event support

2016-09-23 Thread Herbert, Marc
On 06/09/2016 16:04, Luis R. Rodriguez wrote:
> They claim that without it there is the race between /lib/firmware
> being ready and driver asking for the firmware.

Hope it's understood by now.

> I was told there were quite a bit of out-of-tree hacks to address
> this without using the usermode helper,

There are:
https://chromium-review.googlesource.com/#/c/354089/
 wait until SYSTEM_RUNNING before loading DMC firmware.

> the goal of this patch was to create the discussion needed to a
> proper resolution to this.

Sincere thanks.

>>> On Tue 06 Sep 11:32 PDT 2016, Linus Torvalds wrote:
>>>
 On Tue, Sep 6, 2016 at 10:46 AM, Bjorn Andersson
 Nobody has actually answered the "why don't we just tie the
 firmware and module together" question.
>>>
>>> The answer to this depends on the details of the suggestion; but
>>> generally there's a much stronger bond between the kernel and the
>>> driver than between the driver and the firmware in my cases.

Indeed.

The i915 DMC firmware is an interesting example. First of all it’s
_optional_!  It’s critical for battery-powered systems but the i915
driver works without it.

Dan wrote:
> Plus all gpu drivers which need firmware. And yes we must load them
> at probe because people are generally pissed when they boot their
> machine and the screen goes black. On top of that a lot of people
> want their gpu drivers to be built-in, but can't ship the firmware
> blobs in the kernel image because gpl. Yep, there's a bit a
> contradiction there ...

Eppur si muove:
1) As Dan just wrote, users expect the screen to light up as soon as they
press the power button so the i915 driver is built-in
2) ... yet they’ll never notice the nanojoules of battery loss caused
by the DMC firmware being on a filesystem and loaded a tiny bit later.

SoCs and platforms have become some new kind of distributed systems
where other processors run their own, specific software/OS/firmware.
>From this perspective the kernel plays a role similar to a boot server;
and choke point. Granted: booting various and heterogeneous
distributed systems doesn’t look like a simple problem to solve
generically. Yet at the moment the kernel  doesn’t help by not
even supporting something as basic as being told when the files it’s
(unfortunately) in charge to deploy to other nodes become available and
ready to deploy.

It can’t be assumed that the driver and the firmware are two parts of
the same software piece whereas they actually run on two different
processors, are most likely developed and validated by completely
different teams and released on different lifecycles. Especially in
the Linux case.

I hope this distributed systems analogy captures the essence of the
examples and rationales detailed elsewhere in this thread.



Re: [RFC] fs: add userspace critical mounts event support

2016-09-23 Thread Herbert, Marc
On 06/09/2016 16:04, Luis R. Rodriguez wrote:
> They claim that without it there is the race between /lib/firmware
> being ready and driver asking for the firmware.

Hope it's understood by now.

> I was told there were quite a bit of out-of-tree hacks to address
> this without using the usermode helper,

There are:
https://chromium-review.googlesource.com/#/c/354089/
 wait until SYSTEM_RUNNING before loading DMC firmware.

> the goal of this patch was to create the discussion needed to a
> proper resolution to this.

Sincere thanks.

>>> On Tue 06 Sep 11:32 PDT 2016, Linus Torvalds wrote:
>>>
 On Tue, Sep 6, 2016 at 10:46 AM, Bjorn Andersson
 Nobody has actually answered the "why don't we just tie the
 firmware and module together" question.
>>>
>>> The answer to this depends on the details of the suggestion; but
>>> generally there's a much stronger bond between the kernel and the
>>> driver than between the driver and the firmware in my cases.

Indeed.

The i915 DMC firmware is an interesting example. First of all it’s
_optional_!  It’s critical for battery-powered systems but the i915
driver works without it.

Dan wrote:
> Plus all gpu drivers which need firmware. And yes we must load them
> at probe because people are generally pissed when they boot their
> machine and the screen goes black. On top of that a lot of people
> want their gpu drivers to be built-in, but can't ship the firmware
> blobs in the kernel image because gpl. Yep, there's a bit a
> contradiction there ...

Eppur si muove:
1) As Dan just wrote, users expect the screen to light up as soon as they
press the power button so the i915 driver is built-in
2) ... yet they’ll never notice the nanojoules of battery loss caused
by the DMC firmware being on a filesystem and loaded a tiny bit later.

SoCs and platforms have become some new kind of distributed systems
where other processors run their own, specific software/OS/firmware.
>From this perspective the kernel plays a role similar to a boot server;
and choke point. Granted: booting various and heterogeneous
distributed systems doesn’t look like a simple problem to solve
generically. Yet at the moment the kernel  doesn’t help by not
even supporting something as basic as being told when the files it’s
(unfortunately) in charge to deploy to other nodes become available and
ready to deploy.

It can’t be assumed that the driver and the firmware are two parts of
the same software piece whereas they actually run on two different
processors, are most likely developed and validated by completely
different teams and released on different lifecycles. Especially in
the Linux case.

I hope this distributed systems analogy captures the essence of the
examples and rationales detailed elsewhere in this thread.



Re: Regression in 4.8 - CPU speed set very low

2016-09-23 Thread Larry Finger

On 09/18/2016 09:54 PM, Larry Finger wrote:

On 09/14/2016 11:00 AM, Larry Finger wrote:

On 09/09/2016 12:39 PM, Larry Finger wrote:

I have found a regression in kernel 4.8-rc2 that causes the speed of my laptop
with an Intel(R) Core(TM) i7-4600M CPU @ 2.90GHz to suddenly have a maximum cpu
frequency of ~400 MHz. Unfortunately, I do not know how to trigger this problem,
thus a bisection is not possible. It usually happens under heavy load, such as a
kernel build or the RPM build of VirtualBox, but it does not always fail with
these loads. In my most recent failure, 'hwinfo --cpu' reports cpu MHz of
396.130 for #3. The bogomips value is 5787.73, and the cpu clock before the
fault is 3437 MHz. Nothing is logged when this happens.

If I were to get a patch that would show a backtrace when the maximum CPU
frequency is changed, perhaps it would be possible to track this bug.


I have not yet found the bad commit, but I have reduced the range of commits a
bit. This bug has been difficult to trigger. So far, it has not taken over 1/2
day to appear in bad kernels, thus I am allowing three days before deciding that
a given trial is good. I never saw the problem with 4.7 kernels, but I did in
4.8-rc1. I also know that it appeared before commit 581e0cd. Commit 1b05cf6 did
not show the bug.

Testing continues.


And still does. My bisection seemed to be trending toward an improbable set of
commits, and I needed to do some other work with the machine, thus I started
running 4.8-rc6. It failed nearly 48 hours after the reboot, which indicated
that using 3 days to indicate a "good" trial was likely too short. I am
currently testing the first of the trial and will run it for at least a week. It
is unlikely that these tests will be complete before 4,8 is released, even if
-rc8 is needed. I will keep attempting to find the faulty commit.


My debugging continues. After 7 days of beating on commit f7816ad, I have 
concluded that it is likely good. Thus I think the bug lies between commit 
581e0cd (bad) and f7816ad (good). I will need to do a long test on commit 
1b05cf6, which did not fail with a shorter run.


Larry




Re: Regression in 4.8 - CPU speed set very low

2016-09-23 Thread Larry Finger

On 09/18/2016 09:54 PM, Larry Finger wrote:

On 09/14/2016 11:00 AM, Larry Finger wrote:

On 09/09/2016 12:39 PM, Larry Finger wrote:

I have found a regression in kernel 4.8-rc2 that causes the speed of my laptop
with an Intel(R) Core(TM) i7-4600M CPU @ 2.90GHz to suddenly have a maximum cpu
frequency of ~400 MHz. Unfortunately, I do not know how to trigger this problem,
thus a bisection is not possible. It usually happens under heavy load, such as a
kernel build or the RPM build of VirtualBox, but it does not always fail with
these loads. In my most recent failure, 'hwinfo --cpu' reports cpu MHz of
396.130 for #3. The bogomips value is 5787.73, and the cpu clock before the
fault is 3437 MHz. Nothing is logged when this happens.

If I were to get a patch that would show a backtrace when the maximum CPU
frequency is changed, perhaps it would be possible to track this bug.


I have not yet found the bad commit, but I have reduced the range of commits a
bit. This bug has been difficult to trigger. So far, it has not taken over 1/2
day to appear in bad kernels, thus I am allowing three days before deciding that
a given trial is good. I never saw the problem with 4.7 kernels, but I did in
4.8-rc1. I also know that it appeared before commit 581e0cd. Commit 1b05cf6 did
not show the bug.

Testing continues.


And still does. My bisection seemed to be trending toward an improbable set of
commits, and I needed to do some other work with the machine, thus I started
running 4.8-rc6. It failed nearly 48 hours after the reboot, which indicated
that using 3 days to indicate a "good" trial was likely too short. I am
currently testing the first of the trial and will run it for at least a week. It
is unlikely that these tests will be complete before 4,8 is released, even if
-rc8 is needed. I will keep attempting to find the faulty commit.


My debugging continues. After 7 days of beating on commit f7816ad, I have 
concluded that it is likely good. Thus I think the bug lies between commit 
581e0cd (bad) and f7816ad (good). I will need to do a long test on commit 
1b05cf6, which did not fail with a shorter run.


Larry




drivers/gpio/gpiolib.c:3215: undefined reference to `of_get_named_gpiod_flags'

2016-09-23 Thread kbuild test robot
Hi Linus,

It's probably a bug fix that unveils the link errors.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   78bbf153fa96e5e40234b7b05567602535645460
commit: 2527ecc9195e9c66252af24c4689e8a67cd4ccb9 gpio: Fix OF build problem on 
UM
date:   5 weeks ago
config: um-allyesconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout 2527ecc9195e9c66252af24c4689e8a67cd4ccb9
# save the attached .config to linux build tree
make ARCH=um 

All errors (new ones prefixed by >>):

   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xc7d1): warning: Using 'getgrnam' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xc61c): warning: Using 'getpwuid' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xc935): warning: Using 'getaddrinfo' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoaddr':
   (.text+0x1d3c5): warning: Using 'gethostbyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametonetaddr':
   (.text+0x1d465): warning: Using 'getnetbyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoproto':
   (.text+0x1d685): warning: Using 'getprotobyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoport':
   (.text+0x1d4b7): warning: Using 'getservbyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   drivers/built-in.o: In function `fwnode_get_named_gpiod':
>> drivers/gpio/gpiolib.c:3215: undefined reference to 
>> `of_get_named_gpiod_flags'
   drivers/built-in.o: In function `gpiod_get_index':
   drivers/gpio/gpiolib.c:3140: undefined reference to 
`of_get_named_gpiod_flags'
   drivers/built-in.o: In function `bgpio_map':
>> drivers/gpio/gpio-mmio.c:571: undefined reference to `devm_ioremap_resource'
   drivers/built-in.o: In function `dwapb_gpio_probe':
>> drivers/gpio/gpio-dwapb.c:554: undefined reference to `devm_ioremap_resource'
   drivers/built-in.o: In function `zx_gpio_probe':
>> drivers/gpio/gpio-zx.c:229: undefined reference to `devm_ioremap_resource'
   drivers/built-in.o: In function `lp872x_probe':
>> drivers/regulator/lp872x.c:773: undefined reference to 
>> `devm_gpio_request_one'
   drivers/regulator/lp872x.c:746: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `max8952_pmic_probe':
>> drivers/regulator/max8952.c:249: undefined reference to 
>> `devm_gpio_request_one'
   drivers/built-in.o: In function `max8973_probe':
>> drivers/regulator/max8973-regulator.c:715: undefined reference to 
>> `devm_gpio_request_one'
   drivers/regulator/max8973-regulator.c:770: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `pwm_regulator_probe':
>> drivers/regulator/pwm-regulator.c:387: undefined reference to 
>> `devm_gpiod_get_optional'
   drivers/built-in.o: In function `tps62360_probe':
>> drivers/regulator/tps62360-regulator.c:433: undefined reference to 
>> `devm_gpio_request_one'
   drivers/regulator/tps62360-regulator.c:444: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `fdp_nci_i2c_probe':
>> drivers/nfc/fdp/i2c.c:326: undefined reference to `devm_gpiod_get'
   drivers/built-in.o: In function `nfcmrvl_nci_unregister_dev':
>> drivers/nfc/nfcmrvl/main.c:198: undefined reference to `devm_gpio_free'
   drivers/built-in.o: In function `nfcmrvl_nci_register_dev':
>> drivers/nfc/nfcmrvl/main.c:127: undefined reference to 
>> `devm_gpio_request_one'
   drivers/built-in.o: In function `st21nfca_hci_i2c_probe':
>> drivers/nfc/st21nfca/i2c.c:597: undefined reference to 
>> `devm_gpio_request_one'
   drivers/built-in.o: In function `st_nci_i2c_probe':
>> drivers/nfc/st-nci/i2c.c:300: undefined reference to `devm_gpio_request_one'
   drivers/built-in.o: In function `nxp_nci_i2c_probe':
>> drivers/nfc/nxp-nci/i2c.c:361: undefined reference to `devm_gpio_request_one'
   drivers/built-in.o: In function `mdio_gpio_probe':
>> drivers/net/phy/mdio-gpio.c:177: undefined reference to `devm_gpio_request'
   drivers/built-in.o: In function `at803x_probe':
>> drivers/net/phy/at803x.c:283: undefined reference to 
>> `devm_gpiod_get_optional'
   drivers/built-in.o: In 

drivers/gpio/gpiolib.c:3215: undefined reference to `of_get_named_gpiod_flags'

2016-09-23 Thread kbuild test robot
Hi Linus,

It's probably a bug fix that unveils the link errors.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   78bbf153fa96e5e40234b7b05567602535645460
commit: 2527ecc9195e9c66252af24c4689e8a67cd4ccb9 gpio: Fix OF build problem on 
UM
date:   5 weeks ago
config: um-allyesconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout 2527ecc9195e9c66252af24c4689e8a67cd4ccb9
# save the attached .config to linux build tree
make ARCH=um 

All errors (new ones prefixed by >>):

   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xc7d1): warning: Using 'getgrnam' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xc61c): warning: Using 'getpwuid' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xc935): warning: Using 'getaddrinfo' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoaddr':
   (.text+0x1d3c5): warning: Using 'gethostbyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametonetaddr':
   (.text+0x1d465): warning: Using 'getnetbyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoproto':
   (.text+0x1d685): warning: Using 'getprotobyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoport':
   (.text+0x1d4b7): warning: Using 'getservbyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   drivers/built-in.o: In function `fwnode_get_named_gpiod':
>> drivers/gpio/gpiolib.c:3215: undefined reference to 
>> `of_get_named_gpiod_flags'
   drivers/built-in.o: In function `gpiod_get_index':
   drivers/gpio/gpiolib.c:3140: undefined reference to 
`of_get_named_gpiod_flags'
   drivers/built-in.o: In function `bgpio_map':
>> drivers/gpio/gpio-mmio.c:571: undefined reference to `devm_ioremap_resource'
   drivers/built-in.o: In function `dwapb_gpio_probe':
>> drivers/gpio/gpio-dwapb.c:554: undefined reference to `devm_ioremap_resource'
   drivers/built-in.o: In function `zx_gpio_probe':
>> drivers/gpio/gpio-zx.c:229: undefined reference to `devm_ioremap_resource'
   drivers/built-in.o: In function `lp872x_probe':
>> drivers/regulator/lp872x.c:773: undefined reference to 
>> `devm_gpio_request_one'
   drivers/regulator/lp872x.c:746: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `max8952_pmic_probe':
>> drivers/regulator/max8952.c:249: undefined reference to 
>> `devm_gpio_request_one'
   drivers/built-in.o: In function `max8973_probe':
>> drivers/regulator/max8973-regulator.c:715: undefined reference to 
>> `devm_gpio_request_one'
   drivers/regulator/max8973-regulator.c:770: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `pwm_regulator_probe':
>> drivers/regulator/pwm-regulator.c:387: undefined reference to 
>> `devm_gpiod_get_optional'
   drivers/built-in.o: In function `tps62360_probe':
>> drivers/regulator/tps62360-regulator.c:433: undefined reference to 
>> `devm_gpio_request_one'
   drivers/regulator/tps62360-regulator.c:444: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `fdp_nci_i2c_probe':
>> drivers/nfc/fdp/i2c.c:326: undefined reference to `devm_gpiod_get'
   drivers/built-in.o: In function `nfcmrvl_nci_unregister_dev':
>> drivers/nfc/nfcmrvl/main.c:198: undefined reference to `devm_gpio_free'
   drivers/built-in.o: In function `nfcmrvl_nci_register_dev':
>> drivers/nfc/nfcmrvl/main.c:127: undefined reference to 
>> `devm_gpio_request_one'
   drivers/built-in.o: In function `st21nfca_hci_i2c_probe':
>> drivers/nfc/st21nfca/i2c.c:597: undefined reference to 
>> `devm_gpio_request_one'
   drivers/built-in.o: In function `st_nci_i2c_probe':
>> drivers/nfc/st-nci/i2c.c:300: undefined reference to `devm_gpio_request_one'
   drivers/built-in.o: In function `nxp_nci_i2c_probe':
>> drivers/nfc/nxp-nci/i2c.c:361: undefined reference to `devm_gpio_request_one'
   drivers/built-in.o: In function `mdio_gpio_probe':
>> drivers/net/phy/mdio-gpio.c:177: undefined reference to `devm_gpio_request'
   drivers/built-in.o: In function `at803x_probe':
>> drivers/net/phy/at803x.c:283: undefined reference to 
>> `devm_gpiod_get_optional'
   drivers/built-in.o: In 

Re: [RFC] fs: add userspace critical mounts event support

2016-09-23 Thread Herbert, Marc
On 03/09/2016 11:10, Dmitry Torokhov wrote:
> I was thinking if we kernel could post
> "conditions" (maybe simple stings) that it waits for, and userspace
> could unlock these "conditions". One of them might be "firmware
> available".

On idea offered by Josh Triplett that seems to overlap with this one
is to have something similar to the (deprecated) userhelper with
*per-blob* requests and notifications except for one major difference:
userspace would not anymore be in charge of *providing* the blob but
would instead only *signal* when a given blob becomes available and is
either found or found missing. Then the kernel loads the blob _by
itself_; unlike the userhelper. No new “critical filesystem” concept
and a *per-blob basis*, allowing any variation of blob locations
across any number of initramfs and filesystems.

Could this one fly?




Re: [RFC] fs: add userspace critical mounts event support

2016-09-23 Thread Herbert, Marc
On 03/09/2016 11:10, Dmitry Torokhov wrote:
> I was thinking if we kernel could post
> "conditions" (maybe simple stings) that it waits for, and userspace
> could unlock these "conditions". One of them might be "firmware
> available".

On idea offered by Josh Triplett that seems to overlap with this one
is to have something similar to the (deprecated) userhelper with
*per-blob* requests and notifications except for one major difference:
userspace would not anymore be in charge of *providing* the blob but
would instead only *signal* when a given blob becomes available and is
either found or found missing. Then the kernel loads the blob _by
itself_; unlike the userhelper. No new “critical filesystem” concept
and a *per-blob basis*, allowing any variation of blob locations
across any number of initramfs and filesystems.

Could this one fly?




Re: [PATCH v2] clk: hisilicon: add CRG driver for Hi3798CV200 SoC

2016-09-23 Thread Jiancheng Xue
在 2016/9/24 1:47, Rob Herring 写道:
> On Sun, Sep 18, 2016 at 03:30:21PM +0800, Jiancheng Xue wrote:
>> Add CRG driver for Hi3798CV200 SoC. CRG(Clock and Reset
>> Generator) module generates clock and reset signals used
>> by other module blocks on SoC.
>>
>> Signed-off-by: Jiancheng Xue 
>> ---
>> change log
>> v2:
>> - Fixed compiling error when compiled as a module.
>> - Fixed issues pointed by Stephen Boyd.
>> - Added prefix HISTB for clock index macro definitions.
>>
>>  .../clock/{hi3519-crg.txt => hisi-crg.txt} |  11 +-
>>  drivers/clk/hisilicon/Kconfig  |   8 +
>>  drivers/clk/hisilicon/Makefile |   1 +
>>  drivers/clk/hisilicon/crg-hi3798cv200.c| 305 
>> +
>>  drivers/clk/hisilicon/crg.h|  34 +++
>>  include/dt-bindings/clock/histb-clock.h|  64 +
>>  6 files changed, 419 insertions(+), 4 deletions(-)
>>  rename Documentation/devicetree/bindings/clock/{hi3519-crg.txt => 
>> hisi-crg.txt} (82%)
>>  create mode 100644 drivers/clk/hisilicon/crg-hi3798cv200.c
>>  create mode 100644 drivers/clk/hisilicon/crg.h
>>  create mode 100644 include/dt-bindings/clock/histb-clock.h
>>
>> diff --git a/Documentation/devicetree/bindings/clock/hi3519-crg.txt 
>> b/Documentation/devicetree/bindings/clock/hisi-crg.txt
>> similarity index 82%
>> rename from Documentation/devicetree/bindings/clock/hi3519-crg.txt
>> rename to Documentation/devicetree/bindings/clock/hisi-crg.txt
>> index acd1f23..e3919b6 100644
>> --- a/Documentation/devicetree/bindings/clock/hi3519-crg.txt
>> +++ b/Documentation/devicetree/bindings/clock/hisi-crg.txt
>> @@ -1,7 +1,7 @@
>> -* Hisilicon Hi3519 Clock and Reset Generator(CRG)
>> +* HiSilicon Clock and Reset Generator(CRG)
>>  
>> -The Hi3519 CRG module provides clock and reset signals to various
>> -controllers within the SoC.
>> +The CRG module provides clock and reset signals to various
>> +modules within the SoC.
>>  
>>  This binding uses the following bindings:
>>  Documentation/devicetree/bindings/clock/clock-bindings.txt
>> @@ -10,7 +10,10 @@ This binding uses the following bindings:
>>  Required Properties:
>>  
>>  - compatible: should be one of the following.
>> -  - "hisilicon,hi3519-crg" - controller compatible with Hi3519 SoC.
>> +  - "hisilicon,hi3516cv300-crg"
>> +  - "hisilicon,hi3519-crg"
>> +  - "hisilicon,hi3798cv200-crg"
>> +  - "hisilicon,hi3798cv200-sysctrl"
> 
> Why crg and sysctrl?
> 
Hi Rob,

In Hi3798cv200 SoC, the system controller (sysctrl) is another clock
provider which provides clocks for some modules such as timer0, uart0,
ir, led etc. These modules won't be power down when the system enters
into the stand-by mode. Besides providing above clocks, sysctrl also
contains registers used to control the whole system and some peripherals.

Thanks,
Jiancheng

>>  
>>  - reg: physical base address of the controller and length of memory mapped
>>region.
> 
> .
> 



Re: [PATCH v2] clk: hisilicon: add CRG driver for Hi3798CV200 SoC

2016-09-23 Thread Jiancheng Xue
在 2016/9/24 1:47, Rob Herring 写道:
> On Sun, Sep 18, 2016 at 03:30:21PM +0800, Jiancheng Xue wrote:
>> Add CRG driver for Hi3798CV200 SoC. CRG(Clock and Reset
>> Generator) module generates clock and reset signals used
>> by other module blocks on SoC.
>>
>> Signed-off-by: Jiancheng Xue 
>> ---
>> change log
>> v2:
>> - Fixed compiling error when compiled as a module.
>> - Fixed issues pointed by Stephen Boyd.
>> - Added prefix HISTB for clock index macro definitions.
>>
>>  .../clock/{hi3519-crg.txt => hisi-crg.txt} |  11 +-
>>  drivers/clk/hisilicon/Kconfig  |   8 +
>>  drivers/clk/hisilicon/Makefile |   1 +
>>  drivers/clk/hisilicon/crg-hi3798cv200.c| 305 
>> +
>>  drivers/clk/hisilicon/crg.h|  34 +++
>>  include/dt-bindings/clock/histb-clock.h|  64 +
>>  6 files changed, 419 insertions(+), 4 deletions(-)
>>  rename Documentation/devicetree/bindings/clock/{hi3519-crg.txt => 
>> hisi-crg.txt} (82%)
>>  create mode 100644 drivers/clk/hisilicon/crg-hi3798cv200.c
>>  create mode 100644 drivers/clk/hisilicon/crg.h
>>  create mode 100644 include/dt-bindings/clock/histb-clock.h
>>
>> diff --git a/Documentation/devicetree/bindings/clock/hi3519-crg.txt 
>> b/Documentation/devicetree/bindings/clock/hisi-crg.txt
>> similarity index 82%
>> rename from Documentation/devicetree/bindings/clock/hi3519-crg.txt
>> rename to Documentation/devicetree/bindings/clock/hisi-crg.txt
>> index acd1f23..e3919b6 100644
>> --- a/Documentation/devicetree/bindings/clock/hi3519-crg.txt
>> +++ b/Documentation/devicetree/bindings/clock/hisi-crg.txt
>> @@ -1,7 +1,7 @@
>> -* Hisilicon Hi3519 Clock and Reset Generator(CRG)
>> +* HiSilicon Clock and Reset Generator(CRG)
>>  
>> -The Hi3519 CRG module provides clock and reset signals to various
>> -controllers within the SoC.
>> +The CRG module provides clock and reset signals to various
>> +modules within the SoC.
>>  
>>  This binding uses the following bindings:
>>  Documentation/devicetree/bindings/clock/clock-bindings.txt
>> @@ -10,7 +10,10 @@ This binding uses the following bindings:
>>  Required Properties:
>>  
>>  - compatible: should be one of the following.
>> -  - "hisilicon,hi3519-crg" - controller compatible with Hi3519 SoC.
>> +  - "hisilicon,hi3516cv300-crg"
>> +  - "hisilicon,hi3519-crg"
>> +  - "hisilicon,hi3798cv200-crg"
>> +  - "hisilicon,hi3798cv200-sysctrl"
> 
> Why crg and sysctrl?
> 
Hi Rob,

In Hi3798cv200 SoC, the system controller (sysctrl) is another clock
provider which provides clocks for some modules such as timer0, uart0,
ir, led etc. These modules won't be power down when the system enters
into the stand-by mode. Besides providing above clocks, sysctrl also
contains registers used to control the whole system and some peripherals.

Thanks,
Jiancheng

>>  
>>  - reg: physical base address of the controller and length of memory mapped
>>region.
> 
> .
> 



[PATCH -tip] locking/rtmutex: Reduce top-waiter blocking on a lock

2016-09-23 Thread Davidlohr Bueso

By applying well known spin-on-lock-owner techniques, we can avoid the
blocking overhead during the process of when the task is trying to take
the rtmutex. The idea is that as long as the owner is running, there is a
fair chance it'll release the lock soon, and thus a task trying to acquire
the rtmutex will better off spinning instead of blocking immediately after
the fastpath. This is similar to what we use for other locks, borrowed
from -rt. The main difference (due to the obvious real-time constraints)
is that top-waiter spinning must account for any new higher priority waiter,
and therefore cannot steal the lock and avoid any pi-dance. As such there
will be at most only one spinner waiter upon contended lock.

Conditions to stop spinning and block are simple:

(1) Upon need_resched()
(2) Current lock owner blocks

The unlock side remains unchanged as wake_up_process() can safely deal with
calls where the task is not actually blocked (TASK_NORMAL). The biggest
concern would perhaps be if we relied on any implicit barriers (in that the
wake_up_process call would not imply it anymore since nothing was awoken),
but this is not the case. As such, there is only unnecessary overhead dealing
with the wake_q, but this allows us not to miss any wakeups between the spinning
step and the unlocking side.

Measuring the amount of priority inversions of the pi_stress program, there is
some improvement in throughput during a 30 second window. On a 32-core box, with
increasing thread-group count:

pistress
4.4.3 4.4.3
  vanilla   rtmutex-topspinner
Hmean1   2321586.73 (  0.00%)  2339847.23 (  0.79%)
Hmean4   8209026.49 (  0.00%)  8597809.55 (  4.74%)
Hmean7  12655322.45 (  0.00%) 13194896.45 (  4.26%)
Hmean12  4210477.03 (  0.00%)  4348643.08 (  3.28%)
Hmean21  2996823.05 (  0.00%)  3104513.47 (  3.59%)
Hmean30  2463107.53 (  0.00%)  2584275.71 (  4.91%)
Hmean48  2656668.46 (  0.00%)  2719324.53 (  2.36%)
Hmean64  2397253.65 (  0.00%)  2471628.92 (  3.10%)
Stddev   1653473.88 (  0.00%)   527076.59 (-19.34%)
Stddev   4664995.50 (  0.00%)   359487.15 (-45.94%)
Stddev   7248476.88 (  0.00%)   278307.31 ( 12.01%)
Stddev   1274537.42 (  0.00%)54305.86 (-27.14%)
Stddev   2172143.80 (  0.00%)40371.42 (-44.04%)
Stddev   3031981.43 (  0.00%)42306.07 ( 32.28%)
Stddev   4821317.95 (  0.00%)42608.50 ( 99.87%)
Stddev   6423433.99 (  0.00%)21502.56 ( -8.24%)

Signed-off-by: Davidlohr Bueso 
---

Hi, so I've rebased the patch against -tip, and has survived about a full day
of pistress pounding. That said, I don't have any interesting boxes available 
for performance tests, so I'm keeping the results I obtained originally; which

should obviously not matter. The other difference from the previous post was 
that
I've sprinkled READ/WRITE_ONCE around lock->owner, as now we're playing with it
without the wait_lock.

kernel/Kconfig.locks|  4 ++
kernel/locking/rtmutex.c| 83 ++---
kernel/locking/rtmutex_common.h |  2 +-
3 files changed, 75 insertions(+), 14 deletions(-)

diff --git a/kernel/Kconfig.locks b/kernel/Kconfig.locks
index ebdb0043203a..e20790cdc446 100644
--- a/kernel/Kconfig.locks
+++ b/kernel/Kconfig.locks
@@ -227,6 +227,10 @@ config MUTEX_SPIN_ON_OWNER
def_bool y
depends on SMP && !DEBUG_MUTEXES && ARCH_SUPPORTS_ATOMIC_RMW

+config RT_MUTEX_SPIN_ON_OWNER
+   def_bool y
+   depends on SMP && RT_MUTEXES && !DEBUG_RT_MUTEXES && 
ARCH_SUPPORTS_ATOMIC_RMW
+
config RWSEM_SPIN_ON_OWNER
   def_bool y
   depends on SMP && RWSEM_XCHGADD_ALGORITHM && ARCH_SUPPORTS_ATOMIC_RMW
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index 1ec0f48962b3..282a773d1563 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -54,13 +54,13 @@ rt_mutex_set_owner(struct rt_mutex *lock, struct 
task_struct *owner)
if (rt_mutex_has_waiters(lock))
val |= RT_MUTEX_HAS_WAITERS;

-   lock->owner = (struct task_struct *)val;
+   WRITE_ONCE(lock->owner, (struct task_struct *)val);
}

static inline void clear_rt_mutex_waiters(struct rt_mutex *lock)
{
-   lock->owner = (struct task_struct *)
-   ((unsigned long)lock->owner & ~RT_MUTEX_HAS_WAITERS);
+   WRITE_ONCE(lock->owner, (struct task_struct *)
+  ((unsigned long)lock->owner & ~RT_MUTEX_HAS_WAITERS));
}

static void fixup_rt_mutex_waiters(struct rt_mutex *lock)
@@ -989,14 +989,17 @@ static void mark_wakeup_next_waiter(struct wake_q_head 
*wake_q,
rt_mutex_dequeue_pi(current, waiter);

/*
-* As we are waking up the top waiter, and the waiter stays
-* queued on the lock until it gets the lock, this lock
-* obviously has waiters. Just set the bit here and this has
-* the added benefit of forcing all 

[PATCH -tip] locking/rtmutex: Reduce top-waiter blocking on a lock

2016-09-23 Thread Davidlohr Bueso

By applying well known spin-on-lock-owner techniques, we can avoid the
blocking overhead during the process of when the task is trying to take
the rtmutex. The idea is that as long as the owner is running, there is a
fair chance it'll release the lock soon, and thus a task trying to acquire
the rtmutex will better off spinning instead of blocking immediately after
the fastpath. This is similar to what we use for other locks, borrowed
from -rt. The main difference (due to the obvious real-time constraints)
is that top-waiter spinning must account for any new higher priority waiter,
and therefore cannot steal the lock and avoid any pi-dance. As such there
will be at most only one spinner waiter upon contended lock.

Conditions to stop spinning and block are simple:

(1) Upon need_resched()
(2) Current lock owner blocks

The unlock side remains unchanged as wake_up_process() can safely deal with
calls where the task is not actually blocked (TASK_NORMAL). The biggest
concern would perhaps be if we relied on any implicit barriers (in that the
wake_up_process call would not imply it anymore since nothing was awoken),
but this is not the case. As such, there is only unnecessary overhead dealing
with the wake_q, but this allows us not to miss any wakeups between the spinning
step and the unlocking side.

Measuring the amount of priority inversions of the pi_stress program, there is
some improvement in throughput during a 30 second window. On a 32-core box, with
increasing thread-group count:

pistress
4.4.3 4.4.3
  vanilla   rtmutex-topspinner
Hmean1   2321586.73 (  0.00%)  2339847.23 (  0.79%)
Hmean4   8209026.49 (  0.00%)  8597809.55 (  4.74%)
Hmean7  12655322.45 (  0.00%) 13194896.45 (  4.26%)
Hmean12  4210477.03 (  0.00%)  4348643.08 (  3.28%)
Hmean21  2996823.05 (  0.00%)  3104513.47 (  3.59%)
Hmean30  2463107.53 (  0.00%)  2584275.71 (  4.91%)
Hmean48  2656668.46 (  0.00%)  2719324.53 (  2.36%)
Hmean64  2397253.65 (  0.00%)  2471628.92 (  3.10%)
Stddev   1653473.88 (  0.00%)   527076.59 (-19.34%)
Stddev   4664995.50 (  0.00%)   359487.15 (-45.94%)
Stddev   7248476.88 (  0.00%)   278307.31 ( 12.01%)
Stddev   1274537.42 (  0.00%)54305.86 (-27.14%)
Stddev   2172143.80 (  0.00%)40371.42 (-44.04%)
Stddev   3031981.43 (  0.00%)42306.07 ( 32.28%)
Stddev   4821317.95 (  0.00%)42608.50 ( 99.87%)
Stddev   6423433.99 (  0.00%)21502.56 ( -8.24%)

Signed-off-by: Davidlohr Bueso 
---

Hi, so I've rebased the patch against -tip, and has survived about a full day
of pistress pounding. That said, I don't have any interesting boxes available 
for performance tests, so I'm keeping the results I obtained originally; which

should obviously not matter. The other difference from the previous post was 
that
I've sprinkled READ/WRITE_ONCE around lock->owner, as now we're playing with it
without the wait_lock.

kernel/Kconfig.locks|  4 ++
kernel/locking/rtmutex.c| 83 ++---
kernel/locking/rtmutex_common.h |  2 +-
3 files changed, 75 insertions(+), 14 deletions(-)

diff --git a/kernel/Kconfig.locks b/kernel/Kconfig.locks
index ebdb0043203a..e20790cdc446 100644
--- a/kernel/Kconfig.locks
+++ b/kernel/Kconfig.locks
@@ -227,6 +227,10 @@ config MUTEX_SPIN_ON_OWNER
def_bool y
depends on SMP && !DEBUG_MUTEXES && ARCH_SUPPORTS_ATOMIC_RMW

+config RT_MUTEX_SPIN_ON_OWNER
+   def_bool y
+   depends on SMP && RT_MUTEXES && !DEBUG_RT_MUTEXES && 
ARCH_SUPPORTS_ATOMIC_RMW
+
config RWSEM_SPIN_ON_OWNER
   def_bool y
   depends on SMP && RWSEM_XCHGADD_ALGORITHM && ARCH_SUPPORTS_ATOMIC_RMW
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index 1ec0f48962b3..282a773d1563 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -54,13 +54,13 @@ rt_mutex_set_owner(struct rt_mutex *lock, struct 
task_struct *owner)
if (rt_mutex_has_waiters(lock))
val |= RT_MUTEX_HAS_WAITERS;

-   lock->owner = (struct task_struct *)val;
+   WRITE_ONCE(lock->owner, (struct task_struct *)val);
}

static inline void clear_rt_mutex_waiters(struct rt_mutex *lock)
{
-   lock->owner = (struct task_struct *)
-   ((unsigned long)lock->owner & ~RT_MUTEX_HAS_WAITERS);
+   WRITE_ONCE(lock->owner, (struct task_struct *)
+  ((unsigned long)lock->owner & ~RT_MUTEX_HAS_WAITERS));
}

static void fixup_rt_mutex_waiters(struct rt_mutex *lock)
@@ -989,14 +989,17 @@ static void mark_wakeup_next_waiter(struct wake_q_head 
*wake_q,
rt_mutex_dequeue_pi(current, waiter);

/*
-* As we are waking up the top waiter, and the waiter stays
-* queued on the lock until it gets the lock, this lock
-* obviously has waiters. Just set the bit here and this has
-* the added benefit of forcing all new tasks into 

Re: [PATCH v3 0/2] Exynos IOMMU: proper runtime PM support (use device dependencies)

2016-09-23 Thread Rafael J. Wysocki
On Friday, September 23, 2016 03:50:02 PM Lukas Wunner wrote:
> On Fri, Sep 23, 2016 at 02:49:20PM +0200, Rafael J. Wysocki wrote:
> > On Tuesday, September 20, 2016 10:51:13 AM Marek Szyprowski wrote:
> > > On 2016-09-19 23:45, Tobias Jakobi wrote:
> > > > I did some tests with the new version today. Sadly the reboot/shutdown
> > > > issues are still present.
> > > 
> > > Thanks for the report. I've managed to reproduce this issue and it is 
> > > again
> > > caused by modifying device on devices_kset list before it will be finally
> > > added by device_add(). I thought that the new patchset allows creating
> > > links to a device, which has not been yet added to system device list.
> 
> Hm, Marek, why isn't it possible to set up the links from the consumer's
> ->probe hook in this case?
> 
> 
> > > Should it be allowed to create a link to device, which
> > > has not yet been added to system device list by device_add()?
> > 
> > While it would be easy to require both the consumer and producer devices to
> > be registered for creating a link between them, that would just make it
> > harder to use links in the first place.
> > 
> > So ideally, it should be possible to create links between devices before
> > registering them, but since I didn't take that into account in the current
> > patch series, some quite substantial changes are needed to cover that.
> > 
> > Additional link states come to mind, but then the "stateless" links are
> > affected by this problem too.
> 
> device_link_add() could be changed to call device_reorder_to_tail()
> only if device_is_registered(consumer) returns true.
> 
> That's an inline function defined in  which returns
> dev->kobj.state_in_sysfs, a flag which is set in kobject_add().

I know what that function is, but using it alone is not sufficient,
because dev->kobj.state_in_sysfs is set before the device is added to
dpm_list.

> Then device_add() would have to check if any links are already
> set up and reorder the consumer behind the suppliers.
> 
> Doesn't seem to be *that* complex, but probably I'm missing something,
> this is just off the cuff...

There are some cases to consider and some races to avoid AFAICS.

It all gets a lot simpler if device_link_add() is allowed to return NULL when
the supplier device passed to it has not been registered yet.  That looks like
a reasonable thing to do to me, but I wonder if someone has a use case in which
it would be a substantial limitation.

Thanks,
Rafael



Re: [PATCH v3 0/2] Exynos IOMMU: proper runtime PM support (use device dependencies)

2016-09-23 Thread Rafael J. Wysocki
On Friday, September 23, 2016 03:50:02 PM Lukas Wunner wrote:
> On Fri, Sep 23, 2016 at 02:49:20PM +0200, Rafael J. Wysocki wrote:
> > On Tuesday, September 20, 2016 10:51:13 AM Marek Szyprowski wrote:
> > > On 2016-09-19 23:45, Tobias Jakobi wrote:
> > > > I did some tests with the new version today. Sadly the reboot/shutdown
> > > > issues are still present.
> > > 
> > > Thanks for the report. I've managed to reproduce this issue and it is 
> > > again
> > > caused by modifying device on devices_kset list before it will be finally
> > > added by device_add(). I thought that the new patchset allows creating
> > > links to a device, which has not been yet added to system device list.
> 
> Hm, Marek, why isn't it possible to set up the links from the consumer's
> ->probe hook in this case?
> 
> 
> > > Should it be allowed to create a link to device, which
> > > has not yet been added to system device list by device_add()?
> > 
> > While it would be easy to require both the consumer and producer devices to
> > be registered for creating a link between them, that would just make it
> > harder to use links in the first place.
> > 
> > So ideally, it should be possible to create links between devices before
> > registering them, but since I didn't take that into account in the current
> > patch series, some quite substantial changes are needed to cover that.
> > 
> > Additional link states come to mind, but then the "stateless" links are
> > affected by this problem too.
> 
> device_link_add() could be changed to call device_reorder_to_tail()
> only if device_is_registered(consumer) returns true.
> 
> That's an inline function defined in  which returns
> dev->kobj.state_in_sysfs, a flag which is set in kobject_add().

I know what that function is, but using it alone is not sufficient,
because dev->kobj.state_in_sysfs is set before the device is added to
dpm_list.

> Then device_add() would have to check if any links are already
> set up and reorder the consumer behind the suppliers.
> 
> Doesn't seem to be *that* complex, but probably I'm missing something,
> this is just off the cuff...

There are some cases to consider and some races to avoid AFAICS.

It all gets a lot simpler if device_link_add() is allowed to return NULL when
the supplier device passed to it has not been registered yet.  That looks like
a reasonable thing to do to me, but I wonder if someone has a use case in which
it would be a substantial limitation.

Thanks,
Rafael



Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame)

2016-09-23 Thread Daniel Mentz
On Fri, Sep 23, 2016 at 3:38 AM, Alexey Brodkin
 wrote:
> On Thu, 2016-09-22 at 15:37 -0700, Daniel Mentz wrote:
>> Sorry, that was a misunderstanding. Buildroot routinely runs the strip
>> command on .ko files before installing them on the target. I was only
>> looking at the .ko files *after* running the strip command. No, the
>> interim patch was not in my tree.
>
> Well are you sure buildroot really touches modules in Linux kernel build 
> folder?
> Buildroot just runs a simple "make" command in "output/build/linux-x.y".

Sorry, that was phrased badly. Buildroot does not touch the modules in
the Linux kernel build folder. Modules are stripped in the target
directory as you described.

> And only on installation step Buildroot strips binaries in "output/target" 
> folder.
> Moreover starting from that commit
> https://git.buildroot.net/buildroot/commit/?id=10c4d27aef4dca01572cfc8146cbfd194a1a85e4
> even on Linux installation step Buildroot reuses kernel's module stripping 
> infrastructure
> but again that happens only on target.


Re: modules still have .debug_* (was Re: [PATCH 0/3] ARC unwinder switch to .eh_frame)

2016-09-23 Thread Daniel Mentz
On Fri, Sep 23, 2016 at 3:38 AM, Alexey Brodkin
 wrote:
> On Thu, 2016-09-22 at 15:37 -0700, Daniel Mentz wrote:
>> Sorry, that was a misunderstanding. Buildroot routinely runs the strip
>> command on .ko files before installing them on the target. I was only
>> looking at the .ko files *after* running the strip command. No, the
>> interim patch was not in my tree.
>
> Well are you sure buildroot really touches modules in Linux kernel build 
> folder?
> Buildroot just runs a simple "make" command in "output/build/linux-x.y".

Sorry, that was phrased badly. Buildroot does not touch the modules in
the Linux kernel build folder. Modules are stripped in the target
directory as you described.

> And only on installation step Buildroot strips binaries in "output/target" 
> folder.
> Moreover starting from that commit
> https://git.buildroot.net/buildroot/commit/?id=10c4d27aef4dca01572cfc8146cbfd194a1a85e4
> even on Linux installation step Buildroot reuses kernel's module stripping 
> infrastructure
> but again that happens only on target.


Re: [PATCH] f2fs: remove dirty inode pages in error path

2016-09-23 Thread Chao Yu
On 2016/9/24 5:11, Jaegeuk Kim wrote:
> When getting EIO while handling orphan inodes, we can get some dirty node
> pages. Then, f2fs_write_node_pages() called by iput(node_inode) will try
> to flush node pages. But in this case, we should prevent to do that, since
> we will try again from the start.

We are protected since we set SBI_POR_DOING flag in sb, so we are safe now?

Thanks,



Re: [PATCH] f2fs: remove dirty inode pages in error path

2016-09-23 Thread Chao Yu
On 2016/9/24 5:11, Jaegeuk Kim wrote:
> When getting EIO while handling orphan inodes, we can get some dirty node
> pages. Then, f2fs_write_node_pages() called by iput(node_inode) will try
> to flush node pages. But in this case, we should prevent to do that, since
> we will try again from the start.

We are protected since we set SBI_POR_DOING flag in sb, so we are safe now?

Thanks,



Re: [PATCH 2/3] f2fs: support checkpoint error injection

2016-09-23 Thread Jaegeuk Kim
On Sat, Sep 24, 2016 at 08:46:54AM +0800, Chao Yu wrote:
> Hi Jaegeuk,
> 
> On 2016/9/24 7:53, Jaegeuk Kim wrote:
> > Hi Chao,
> > 
> > The basic rule is to stop every operations once CP_ERROR_FLAG is set.
> > But, this patch simply breaks the rule.
> > For example, f2fs_write_data_page() currently exits with 
> > mapping_set_error().
> > So this patch incurs missing dentry blocks in a valid checkpoint.
> 
> Yes, that's right.
>
> How about triggering checkpoint error in f2fs_stop_checkpoint?

Let's just use src/godown in xfstests, since we don't need to trigger this
multiple times in runtime.

> 
> >From 7bedfe9a0e97c4deead1c7cdbfc24187f5080268 Mon Sep 17 00:00:00 2001
> From: Chao Yu 
> Date: Fri, 23 Sep 2016 06:59:04 +0800
> Subject: [PATCH] f2fs: support checkpoint error injection
> 
> This patch adds to support checkpoint error injection in f2fs for testing
> fatal error tolerance.
> 
> Signed-off-by: Chao Yu 
> ---
>  fs/f2fs/checkpoint.c | 14 +++---
>  fs/f2fs/data.c   |  7 ---
>  fs/f2fs/f2fs.h   |  5 -
>  fs/f2fs/file.c   |  8 
>  fs/f2fs/inode.c  |  7 +--
>  fs/f2fs/super.c  |  1 +
>  6 files changed, 29 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index d1560bb..834c8ec 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -26,8 +26,17 @@
>  static struct kmem_cache *ino_entry_slab;
>  struct kmem_cache *inode_entry_slab;
> 
> -void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
> +void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi,
> + bool end_io, bool need_stop)
>  {
> +#ifdef CONFIG_F2FS_FAULT_INJECTION
> + if (time_to_inject(FAULT_CHECKPOINT))
> + need_stop = true;
> +#endif
> +
> + if (!need_stop)
> + return;
> +
>   set_ckpt_flags(sbi, CP_ERROR_FLAG);
>   sbi->sb->s_flags |= MS_RDONLY;
>   if (!end_io)
> @@ -100,8 +109,7 @@ repeat:
>* readonly and make sure do not write checkpoint with non-uptodate
>* meta page.
>*/
> - if (unlikely(!PageUptodate(page)))
> - f2fs_stop_checkpoint(sbi, false);
> + f2fs_stop_checkpoint(sbi, false, !PageUptodate(page));
>  out:
>   return page;
>  }
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index a9f7436..1b00d3d 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -74,10 +74,11 @@ static void f2fs_write_end_io(struct bio *bio)
> 
>   fscrypt_pullback_bio_page(, true);
> 
> - if (unlikely(bio->bi_error)) {
> + f2fs_stop_checkpoint(sbi, true, bio->bi_error);
> +
> + if (unlikely(bio->bi_error))
>   set_bit(AS_EIO, >mapping->flags);
> - f2fs_stop_checkpoint(sbi, true);
> - }
> +
>   end_page_writeback(page);
>   }
>   if (atomic_dec_and_test(>nr_wb_bios) &&
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index e216bc0..7bc1802 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -47,6 +47,7 @@ enum {
>   FAULT_DIR_DEPTH,
>   FAULT_EVICT_INODE,
>   FAULT_IO,
> + FAULT_CHECKPOINT,
>   FAULT_MAX,
>  };
> 
> @@ -80,6 +81,8 @@ static inline bool time_to_inject(int type)
>   return false;
>   else if (type == FAULT_IO && !IS_FAULT_SET(type))
>   return false;
> + else if (type == FAULT_CHECKPOINT && !IS_FAULT_SET(type))
> + return false;
> 
>   atomic_inc(_fault.inject_ops);
>   if (atomic_read(_fault.inject_ops) >= f2fs_fault.inject_rate) {
> @@ -2115,7 +2118,7 @@ void destroy_segment_manager_caches(void);
>  /*
>   * checkpoint.c
>   */
> -void f2fs_stop_checkpoint(struct f2fs_sb_info *, bool);
> +void f2fs_stop_checkpoint(struct f2fs_sb_info *, bool, bool);
>  struct page *grab_meta_page(struct f2fs_sb_info *, pgoff_t);
>  struct page *get_meta_page(struct f2fs_sb_info *, pgoff_t);
>  struct page *get_tmp_page(struct f2fs_sb_info *, pgoff_t);
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index d341a0e..57c7a64 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -1720,21 +1720,21 @@ static int f2fs_ioc_shutdown(struct file *filp, 
> unsigned long arg)
>   case F2FS_GOING_DOWN_FULLSYNC:
>   sb = freeze_bdev(sb->s_bdev);
>   if (sb && !IS_ERR(sb)) {
> - f2fs_stop_checkpoint(sbi, false);
> + f2fs_stop_checkpoint(sbi, false, true);
>   thaw_bdev(sb->s_bdev, sb);
>   }
>   break;
>   case F2FS_GOING_DOWN_METASYNC:
>   /* do checkpoint only */
>   f2fs_sync_fs(sb, 1);
> - f2fs_stop_checkpoint(sbi, false);
> + f2fs_stop_checkpoint(sbi, false, true);
>   break;
>   case F2FS_GOING_DOWN_NOSYNC:
> - f2fs_stop_checkpoint(sbi, false);
> + f2fs_stop_checkpoint(sbi, false, 

Re: [PATCH 2/3] f2fs: support checkpoint error injection

2016-09-23 Thread Jaegeuk Kim
On Sat, Sep 24, 2016 at 08:46:54AM +0800, Chao Yu wrote:
> Hi Jaegeuk,
> 
> On 2016/9/24 7:53, Jaegeuk Kim wrote:
> > Hi Chao,
> > 
> > The basic rule is to stop every operations once CP_ERROR_FLAG is set.
> > But, this patch simply breaks the rule.
> > For example, f2fs_write_data_page() currently exits with 
> > mapping_set_error().
> > So this patch incurs missing dentry blocks in a valid checkpoint.
> 
> Yes, that's right.
>
> How about triggering checkpoint error in f2fs_stop_checkpoint?

Let's just use src/godown in xfstests, since we don't need to trigger this
multiple times in runtime.

> 
> >From 7bedfe9a0e97c4deead1c7cdbfc24187f5080268 Mon Sep 17 00:00:00 2001
> From: Chao Yu 
> Date: Fri, 23 Sep 2016 06:59:04 +0800
> Subject: [PATCH] f2fs: support checkpoint error injection
> 
> This patch adds to support checkpoint error injection in f2fs for testing
> fatal error tolerance.
> 
> Signed-off-by: Chao Yu 
> ---
>  fs/f2fs/checkpoint.c | 14 +++---
>  fs/f2fs/data.c   |  7 ---
>  fs/f2fs/f2fs.h   |  5 -
>  fs/f2fs/file.c   |  8 
>  fs/f2fs/inode.c  |  7 +--
>  fs/f2fs/super.c  |  1 +
>  6 files changed, 29 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index d1560bb..834c8ec 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -26,8 +26,17 @@
>  static struct kmem_cache *ino_entry_slab;
>  struct kmem_cache *inode_entry_slab;
> 
> -void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
> +void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi,
> + bool end_io, bool need_stop)
>  {
> +#ifdef CONFIG_F2FS_FAULT_INJECTION
> + if (time_to_inject(FAULT_CHECKPOINT))
> + need_stop = true;
> +#endif
> +
> + if (!need_stop)
> + return;
> +
>   set_ckpt_flags(sbi, CP_ERROR_FLAG);
>   sbi->sb->s_flags |= MS_RDONLY;
>   if (!end_io)
> @@ -100,8 +109,7 @@ repeat:
>* readonly and make sure do not write checkpoint with non-uptodate
>* meta page.
>*/
> - if (unlikely(!PageUptodate(page)))
> - f2fs_stop_checkpoint(sbi, false);
> + f2fs_stop_checkpoint(sbi, false, !PageUptodate(page));
>  out:
>   return page;
>  }
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index a9f7436..1b00d3d 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -74,10 +74,11 @@ static void f2fs_write_end_io(struct bio *bio)
> 
>   fscrypt_pullback_bio_page(, true);
> 
> - if (unlikely(bio->bi_error)) {
> + f2fs_stop_checkpoint(sbi, true, bio->bi_error);
> +
> + if (unlikely(bio->bi_error))
>   set_bit(AS_EIO, >mapping->flags);
> - f2fs_stop_checkpoint(sbi, true);
> - }
> +
>   end_page_writeback(page);
>   }
>   if (atomic_dec_and_test(>nr_wb_bios) &&
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index e216bc0..7bc1802 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -47,6 +47,7 @@ enum {
>   FAULT_DIR_DEPTH,
>   FAULT_EVICT_INODE,
>   FAULT_IO,
> + FAULT_CHECKPOINT,
>   FAULT_MAX,
>  };
> 
> @@ -80,6 +81,8 @@ static inline bool time_to_inject(int type)
>   return false;
>   else if (type == FAULT_IO && !IS_FAULT_SET(type))
>   return false;
> + else if (type == FAULT_CHECKPOINT && !IS_FAULT_SET(type))
> + return false;
> 
>   atomic_inc(_fault.inject_ops);
>   if (atomic_read(_fault.inject_ops) >= f2fs_fault.inject_rate) {
> @@ -2115,7 +2118,7 @@ void destroy_segment_manager_caches(void);
>  /*
>   * checkpoint.c
>   */
> -void f2fs_stop_checkpoint(struct f2fs_sb_info *, bool);
> +void f2fs_stop_checkpoint(struct f2fs_sb_info *, bool, bool);
>  struct page *grab_meta_page(struct f2fs_sb_info *, pgoff_t);
>  struct page *get_meta_page(struct f2fs_sb_info *, pgoff_t);
>  struct page *get_tmp_page(struct f2fs_sb_info *, pgoff_t);
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index d341a0e..57c7a64 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -1720,21 +1720,21 @@ static int f2fs_ioc_shutdown(struct file *filp, 
> unsigned long arg)
>   case F2FS_GOING_DOWN_FULLSYNC:
>   sb = freeze_bdev(sb->s_bdev);
>   if (sb && !IS_ERR(sb)) {
> - f2fs_stop_checkpoint(sbi, false);
> + f2fs_stop_checkpoint(sbi, false, true);
>   thaw_bdev(sb->s_bdev, sb);
>   }
>   break;
>   case F2FS_GOING_DOWN_METASYNC:
>   /* do checkpoint only */
>   f2fs_sync_fs(sb, 1);
> - f2fs_stop_checkpoint(sbi, false);
> + f2fs_stop_checkpoint(sbi, false, true);
>   break;
>   case F2FS_GOING_DOWN_NOSYNC:
> - f2fs_stop_checkpoint(sbi, false);
> + f2fs_stop_checkpoint(sbi, false, true);
>   break;
>   

Re: [PATCH 2/3] f2fs: support checkpoint error injection

2016-09-23 Thread Chao Yu
Hi Jaegeuk,

On 2016/9/24 7:53, Jaegeuk Kim wrote:
> Hi Chao,
> 
> The basic rule is to stop every operations once CP_ERROR_FLAG is set.
> But, this patch simply breaks the rule.
> For example, f2fs_write_data_page() currently exits with mapping_set_error().
> So this patch incurs missing dentry blocks in a valid checkpoint.

Yes, that's right.

How about triggering checkpoint error in f2fs_stop_checkpoint?

>From 7bedfe9a0e97c4deead1c7cdbfc24187f5080268 Mon Sep 17 00:00:00 2001
From: Chao Yu 
Date: Fri, 23 Sep 2016 06:59:04 +0800
Subject: [PATCH] f2fs: support checkpoint error injection

This patch adds to support checkpoint error injection in f2fs for testing
fatal error tolerance.

Signed-off-by: Chao Yu 
---
 fs/f2fs/checkpoint.c | 14 +++---
 fs/f2fs/data.c   |  7 ---
 fs/f2fs/f2fs.h   |  5 -
 fs/f2fs/file.c   |  8 
 fs/f2fs/inode.c  |  7 +--
 fs/f2fs/super.c  |  1 +
 6 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index d1560bb..834c8ec 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -26,8 +26,17 @@
 static struct kmem_cache *ino_entry_slab;
 struct kmem_cache *inode_entry_slab;

-void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
+void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi,
+   bool end_io, bool need_stop)
 {
+#ifdef CONFIG_F2FS_FAULT_INJECTION
+   if (time_to_inject(FAULT_CHECKPOINT))
+   need_stop = true;
+#endif
+
+   if (!need_stop)
+   return;
+
set_ckpt_flags(sbi, CP_ERROR_FLAG);
sbi->sb->s_flags |= MS_RDONLY;
if (!end_io)
@@ -100,8 +109,7 @@ repeat:
 * readonly and make sure do not write checkpoint with non-uptodate
 * meta page.
 */
-   if (unlikely(!PageUptodate(page)))
-   f2fs_stop_checkpoint(sbi, false);
+   f2fs_stop_checkpoint(sbi, false, !PageUptodate(page));
 out:
return page;
 }
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index a9f7436..1b00d3d 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -74,10 +74,11 @@ static void f2fs_write_end_io(struct bio *bio)

fscrypt_pullback_bio_page(, true);

-   if (unlikely(bio->bi_error)) {
+   f2fs_stop_checkpoint(sbi, true, bio->bi_error);
+
+   if (unlikely(bio->bi_error))
set_bit(AS_EIO, >mapping->flags);
-   f2fs_stop_checkpoint(sbi, true);
-   }
+
end_page_writeback(page);
}
if (atomic_dec_and_test(>nr_wb_bios) &&
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index e216bc0..7bc1802 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -47,6 +47,7 @@ enum {
FAULT_DIR_DEPTH,
FAULT_EVICT_INODE,
FAULT_IO,
+   FAULT_CHECKPOINT,
FAULT_MAX,
 };

@@ -80,6 +81,8 @@ static inline bool time_to_inject(int type)
return false;
else if (type == FAULT_IO && !IS_FAULT_SET(type))
return false;
+   else if (type == FAULT_CHECKPOINT && !IS_FAULT_SET(type))
+   return false;

atomic_inc(_fault.inject_ops);
if (atomic_read(_fault.inject_ops) >= f2fs_fault.inject_rate) {
@@ -2115,7 +2118,7 @@ void destroy_segment_manager_caches(void);
 /*
  * checkpoint.c
  */
-void f2fs_stop_checkpoint(struct f2fs_sb_info *, bool);
+void f2fs_stop_checkpoint(struct f2fs_sb_info *, bool, bool);
 struct page *grab_meta_page(struct f2fs_sb_info *, pgoff_t);
 struct page *get_meta_page(struct f2fs_sb_info *, pgoff_t);
 struct page *get_tmp_page(struct f2fs_sb_info *, pgoff_t);
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index d341a0e..57c7a64 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1720,21 +1720,21 @@ static int f2fs_ioc_shutdown(struct file *filp, 
unsigned long arg)
case F2FS_GOING_DOWN_FULLSYNC:
sb = freeze_bdev(sb->s_bdev);
if (sb && !IS_ERR(sb)) {
-   f2fs_stop_checkpoint(sbi, false);
+   f2fs_stop_checkpoint(sbi, false, true);
thaw_bdev(sb->s_bdev, sb);
}
break;
case F2FS_GOING_DOWN_METASYNC:
/* do checkpoint only */
f2fs_sync_fs(sb, 1);
-   f2fs_stop_checkpoint(sbi, false);
+   f2fs_stop_checkpoint(sbi, false, true);
break;
case F2FS_GOING_DOWN_NOSYNC:
-   f2fs_stop_checkpoint(sbi, false);
+   f2fs_stop_checkpoint(sbi, false, true);
break;
case F2FS_GOING_DOWN_METAFLUSH:
sync_meta_pages(sbi, META, LONG_MAX);
-   f2fs_stop_checkpoint(sbi, false);
+   f2fs_stop_checkpoint(sbi, false, true);
break;
default:
ret = -EINVAL;
diff --git a/fs/f2fs/inode.c 

Re: [PATCH 2/3] f2fs: support checkpoint error injection

2016-09-23 Thread Chao Yu
Hi Jaegeuk,

On 2016/9/24 7:53, Jaegeuk Kim wrote:
> Hi Chao,
> 
> The basic rule is to stop every operations once CP_ERROR_FLAG is set.
> But, this patch simply breaks the rule.
> For example, f2fs_write_data_page() currently exits with mapping_set_error().
> So this patch incurs missing dentry blocks in a valid checkpoint.

Yes, that's right.

How about triggering checkpoint error in f2fs_stop_checkpoint?

>From 7bedfe9a0e97c4deead1c7cdbfc24187f5080268 Mon Sep 17 00:00:00 2001
From: Chao Yu 
Date: Fri, 23 Sep 2016 06:59:04 +0800
Subject: [PATCH] f2fs: support checkpoint error injection

This patch adds to support checkpoint error injection in f2fs for testing
fatal error tolerance.

Signed-off-by: Chao Yu 
---
 fs/f2fs/checkpoint.c | 14 +++---
 fs/f2fs/data.c   |  7 ---
 fs/f2fs/f2fs.h   |  5 -
 fs/f2fs/file.c   |  8 
 fs/f2fs/inode.c  |  7 +--
 fs/f2fs/super.c  |  1 +
 6 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index d1560bb..834c8ec 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -26,8 +26,17 @@
 static struct kmem_cache *ino_entry_slab;
 struct kmem_cache *inode_entry_slab;

-void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
+void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi,
+   bool end_io, bool need_stop)
 {
+#ifdef CONFIG_F2FS_FAULT_INJECTION
+   if (time_to_inject(FAULT_CHECKPOINT))
+   need_stop = true;
+#endif
+
+   if (!need_stop)
+   return;
+
set_ckpt_flags(sbi, CP_ERROR_FLAG);
sbi->sb->s_flags |= MS_RDONLY;
if (!end_io)
@@ -100,8 +109,7 @@ repeat:
 * readonly and make sure do not write checkpoint with non-uptodate
 * meta page.
 */
-   if (unlikely(!PageUptodate(page)))
-   f2fs_stop_checkpoint(sbi, false);
+   f2fs_stop_checkpoint(sbi, false, !PageUptodate(page));
 out:
return page;
 }
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index a9f7436..1b00d3d 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -74,10 +74,11 @@ static void f2fs_write_end_io(struct bio *bio)

fscrypt_pullback_bio_page(, true);

-   if (unlikely(bio->bi_error)) {
+   f2fs_stop_checkpoint(sbi, true, bio->bi_error);
+
+   if (unlikely(bio->bi_error))
set_bit(AS_EIO, >mapping->flags);
-   f2fs_stop_checkpoint(sbi, true);
-   }
+
end_page_writeback(page);
}
if (atomic_dec_and_test(>nr_wb_bios) &&
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index e216bc0..7bc1802 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -47,6 +47,7 @@ enum {
FAULT_DIR_DEPTH,
FAULT_EVICT_INODE,
FAULT_IO,
+   FAULT_CHECKPOINT,
FAULT_MAX,
 };

@@ -80,6 +81,8 @@ static inline bool time_to_inject(int type)
return false;
else if (type == FAULT_IO && !IS_FAULT_SET(type))
return false;
+   else if (type == FAULT_CHECKPOINT && !IS_FAULT_SET(type))
+   return false;

atomic_inc(_fault.inject_ops);
if (atomic_read(_fault.inject_ops) >= f2fs_fault.inject_rate) {
@@ -2115,7 +2118,7 @@ void destroy_segment_manager_caches(void);
 /*
  * checkpoint.c
  */
-void f2fs_stop_checkpoint(struct f2fs_sb_info *, bool);
+void f2fs_stop_checkpoint(struct f2fs_sb_info *, bool, bool);
 struct page *grab_meta_page(struct f2fs_sb_info *, pgoff_t);
 struct page *get_meta_page(struct f2fs_sb_info *, pgoff_t);
 struct page *get_tmp_page(struct f2fs_sb_info *, pgoff_t);
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index d341a0e..57c7a64 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1720,21 +1720,21 @@ static int f2fs_ioc_shutdown(struct file *filp, 
unsigned long arg)
case F2FS_GOING_DOWN_FULLSYNC:
sb = freeze_bdev(sb->s_bdev);
if (sb && !IS_ERR(sb)) {
-   f2fs_stop_checkpoint(sbi, false);
+   f2fs_stop_checkpoint(sbi, false, true);
thaw_bdev(sb->s_bdev, sb);
}
break;
case F2FS_GOING_DOWN_METASYNC:
/* do checkpoint only */
f2fs_sync_fs(sb, 1);
-   f2fs_stop_checkpoint(sbi, false);
+   f2fs_stop_checkpoint(sbi, false, true);
break;
case F2FS_GOING_DOWN_NOSYNC:
-   f2fs_stop_checkpoint(sbi, false);
+   f2fs_stop_checkpoint(sbi, false, true);
break;
case F2FS_GOING_DOWN_METAFLUSH:
sync_meta_pages(sbi, META, LONG_MAX);
-   f2fs_stop_checkpoint(sbi, false);
+   f2fs_stop_checkpoint(sbi, false, true);
break;
default:
ret = -EINVAL;
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index ac4daa5..bf53cd2 

Re: linux-next: Tree for Sep 21

2016-09-23 Thread Stephen Rothwell
Hi Linus,

On Fri, 23 Sep 2016 11:24:04 -0700 Linus Torvalds 
 wrote:
>
> On Tue, Sep 20, 2016 at 11:08 PM, Stephen Rothwell  
> wrote:
> >
> > Changes since 20160920:
> > [...]
> > Non-merge commits (relative to Linus' tree): 11180
> >  8424 files changed, 456474 insertions(+), 237951 deletions(-)  
> 
> What happened here? The previous linux-next tree was much smaller. The
> "changes since" part doesn't actually talk about the almost 3000 new
> non-merge commits that very suddenly showed up.

That was Greg's (cc'd) greybus stuff entering the staging tree:

$ git rev-list --count --no-merges origin/master..2bbadafbe4ea
2363

> I wonder if your automation could add some notes on things like this
> when clearly one of the trees changes radically. Back in 20160920,
> linux-next looked fairly small compared to previous releases. And then
> the next day it suddenly looked quite big.

I will have a look at what can be done.  Normally trees do not grow in
large leaps, this was exceptional.  Most often such an increase would
be caused by one tree merging in another (both of which are often in
linux-next) e.g. the drm tree merges 8 other trees that I have and the
net-next tree also merges 8 others.

> I get the feeling that several thousand new commits just before the
> merge window opens is not a good sign. Of course, I'm planning an rc8
> this time around anyway, but even so this is pretty surprising.

-- 
Cheers,
Stephen Rothwell


Re: linux-next: Tree for Sep 21

2016-09-23 Thread Stephen Rothwell
Hi Linus,

On Fri, 23 Sep 2016 11:24:04 -0700 Linus Torvalds 
 wrote:
>
> On Tue, Sep 20, 2016 at 11:08 PM, Stephen Rothwell  
> wrote:
> >
> > Changes since 20160920:
> > [...]
> > Non-merge commits (relative to Linus' tree): 11180
> >  8424 files changed, 456474 insertions(+), 237951 deletions(-)  
> 
> What happened here? The previous linux-next tree was much smaller. The
> "changes since" part doesn't actually talk about the almost 3000 new
> non-merge commits that very suddenly showed up.

That was Greg's (cc'd) greybus stuff entering the staging tree:

$ git rev-list --count --no-merges origin/master..2bbadafbe4ea
2363

> I wonder if your automation could add some notes on things like this
> when clearly one of the trees changes radically. Back in 20160920,
> linux-next looked fairly small compared to previous releases. And then
> the next day it suddenly looked quite big.

I will have a look at what can be done.  Normally trees do not grow in
large leaps, this was exceptional.  Most often such an increase would
be caused by one tree merging in another (both of which are often in
linux-next) e.g. the drm tree merges 8 other trees that I have and the
net-next tree also merges 8 others.

> I get the feeling that several thousand new commits just before the
> merge window opens is not a good sign. Of course, I'm planning an rc8
> this time around anyway, but even so this is pretty surprising.

-- 
Cheers,
Stephen Rothwell


Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation

2016-09-23 Thread Sebastian Reichel
On Fri, Sep 23, 2016 at 05:47:26PM -0500, Rob Herring wrote:
> On Fri, Sep 23, 2016 at 02:41:09PM +0200, H. Nikolaus Schaller wrote:
> > commit b98abe52fa8e ("Input: add common DT binding for touchscreens")
> > introduced common DT bindings for touchscreens [1] and a helper function to
> > parse the DT.
> > 
> > commit ed7c9870c9bc ("Input: of_touchscreen - add support for inverted / 
> > swapped axes")
> > added another helper for parsing axis inversion and swapping
> > and applying them to x and y coordinates.
> > 
> > Both helpers have been integrated to accommodate any orientation of the
> > touch panel in relation to the LCD.
> > 
> > A new feature is to introduce scaling the min/max ADC values to the screen
> > size.
> > 
> > This makes it possible to pre-calibrate the touch so that is (almost)
> > exactly matches the LCD pixel coordinates it is glued onto. This allows to
> > well enough operate the touch before a user space calibration step can
> > improve the precision.
> > 
> > Finally, calculate_pressure has been renamed to calculate_resistance
> > because that is what it is doing.
> 
> Seems like you are breaking compatibility with old DTs. I can't tell for 
> sure though.
> 
> > 
> > [1]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
> > 
> > Signed-off-by: H. Nikolaus Schaller 
> > ---
> >  .../bindings/input/touchscreen/tsc2007.txt |  20 ++--
> >  drivers/input/touchscreen/tsc2007.c| 126 
> > +
> >  include/linux/i2c/tsc2007.h|   8 ++
> >  3 files changed, 123 insertions(+), 31 deletions(-)
> > 
> > diff --git 
> > a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt 
> > b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> > index ec365e1..6e9fd55 100644
> > --- a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> > +++ b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> > @@ -6,6 +6,7 @@ Required properties:
> >  - ti,x-plate-ohms: X-plate resistance in ohms.
> >  
> >  Optional properties:
> > +- generic touch screen properties: see touchscreen binding [2].
> >  - gpios: the interrupt gpio the chip is connected to (trough the penirq 
> > pin).
> >The penirq pin goes to low when the panel is touched.
> >(see GPIO binding[1] for more details).
> > @@ -13,17 +14,20 @@ Optional properties:
> >(see interrupt binding[0]).
> >  - interrupts: (gpio) interrupt to which the chip is connected
> >(see interrupt binding[0]).
> > -- ti,max-rt: maximum pressure.
> > -- ti,fuzzx: specifies the absolute input fuzz x value.
> > -  If set, it will permit noise in the data up to +- the value given to the 
> > fuzz
> > -  parameter, that is used to filter noise from the event stream.
> > -- ti,fuzzy: specifies the absolute input fuzz y value.
> > -- ti,fuzzz: specifies the absolute input fuzz z value.
> > +- ti,max-rt: maximum pressure resistance above which samples are ignored
> > +  (default: 4095).
> > +- ti,report-resistance: report resistance (no pressure = max_rt) instead
> > +  of pressure (no pressure = 0).
> > +- ti,min-x: minimum value reported by X axis ADC (default 0).
> > +- ti,max-x: maximum value reported by X axis ADC (default 4095).
> > +- ti,min-y: minimum value reported by Y axis ADC (default 0).
> > +- ti,max-y: maximum value reported by Y axis ADC (default 4095).
> 
> Seems like these could be common too. They make more sense than giving x 
> and y sizes in pixel units which really should come from the panel.

The generic touchscreen properties are described "(in pixels)" in
the DT, but they are used in the same way.

So ti,max-[xy] is basically the same as touchscreen-size-[xy],
except, that the generic bindings don't support min-[xy] != 0.

So maybe change the generic bindings like this:

touchscreen-min-x: minimum value reported by X axis ADC (default 0)
touchscreen-max-x: maximum value reported by Y axis ADC
touchscreen-min-y: minimum value reported by Y axis ADC (default 0)
touchscreen-max-y: maximum value reported by Y axis ADC
touchscreen-size-x: deprecated alias for touchscreen-max-x
touchscreen-size-y: deprecated alias for touchscreen-max-y

-- Sebastian


signature.asc
Description: PGP signature


Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation

2016-09-23 Thread Sebastian Reichel
On Fri, Sep 23, 2016 at 05:47:26PM -0500, Rob Herring wrote:
> On Fri, Sep 23, 2016 at 02:41:09PM +0200, H. Nikolaus Schaller wrote:
> > commit b98abe52fa8e ("Input: add common DT binding for touchscreens")
> > introduced common DT bindings for touchscreens [1] and a helper function to
> > parse the DT.
> > 
> > commit ed7c9870c9bc ("Input: of_touchscreen - add support for inverted / 
> > swapped axes")
> > added another helper for parsing axis inversion and swapping
> > and applying them to x and y coordinates.
> > 
> > Both helpers have been integrated to accommodate any orientation of the
> > touch panel in relation to the LCD.
> > 
> > A new feature is to introduce scaling the min/max ADC values to the screen
> > size.
> > 
> > This makes it possible to pre-calibrate the touch so that is (almost)
> > exactly matches the LCD pixel coordinates it is glued onto. This allows to
> > well enough operate the touch before a user space calibration step can
> > improve the precision.
> > 
> > Finally, calculate_pressure has been renamed to calculate_resistance
> > because that is what it is doing.
> 
> Seems like you are breaking compatibility with old DTs. I can't tell for 
> sure though.
> 
> > 
> > [1]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
> > 
> > Signed-off-by: H. Nikolaus Schaller 
> > ---
> >  .../bindings/input/touchscreen/tsc2007.txt |  20 ++--
> >  drivers/input/touchscreen/tsc2007.c| 126 
> > +
> >  include/linux/i2c/tsc2007.h|   8 ++
> >  3 files changed, 123 insertions(+), 31 deletions(-)
> > 
> > diff --git 
> > a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt 
> > b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> > index ec365e1..6e9fd55 100644
> > --- a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> > +++ b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> > @@ -6,6 +6,7 @@ Required properties:
> >  - ti,x-plate-ohms: X-plate resistance in ohms.
> >  
> >  Optional properties:
> > +- generic touch screen properties: see touchscreen binding [2].
> >  - gpios: the interrupt gpio the chip is connected to (trough the penirq 
> > pin).
> >The penirq pin goes to low when the panel is touched.
> >(see GPIO binding[1] for more details).
> > @@ -13,17 +14,20 @@ Optional properties:
> >(see interrupt binding[0]).
> >  - interrupts: (gpio) interrupt to which the chip is connected
> >(see interrupt binding[0]).
> > -- ti,max-rt: maximum pressure.
> > -- ti,fuzzx: specifies the absolute input fuzz x value.
> > -  If set, it will permit noise in the data up to +- the value given to the 
> > fuzz
> > -  parameter, that is used to filter noise from the event stream.
> > -- ti,fuzzy: specifies the absolute input fuzz y value.
> > -- ti,fuzzz: specifies the absolute input fuzz z value.
> > +- ti,max-rt: maximum pressure resistance above which samples are ignored
> > +  (default: 4095).
> > +- ti,report-resistance: report resistance (no pressure = max_rt) instead
> > +  of pressure (no pressure = 0).
> > +- ti,min-x: minimum value reported by X axis ADC (default 0).
> > +- ti,max-x: maximum value reported by X axis ADC (default 4095).
> > +- ti,min-y: minimum value reported by Y axis ADC (default 0).
> > +- ti,max-y: maximum value reported by Y axis ADC (default 4095).
> 
> Seems like these could be common too. They make more sense than giving x 
> and y sizes in pixel units which really should come from the panel.

The generic touchscreen properties are described "(in pixels)" in
the DT, but they are used in the same way.

So ti,max-[xy] is basically the same as touchscreen-size-[xy],
except, that the generic bindings don't support min-[xy] != 0.

So maybe change the generic bindings like this:

touchscreen-min-x: minimum value reported by X axis ADC (default 0)
touchscreen-max-x: maximum value reported by Y axis ADC
touchscreen-min-y: minimum value reported by Y axis ADC (default 0)
touchscreen-max-y: maximum value reported by Y axis ADC
touchscreen-size-x: deprecated alias for touchscreen-max-x
touchscreen-size-y: deprecated alias for touchscreen-max-y

-- Sebastian


signature.asc
Description: PGP signature


Re: [PATCH v2 0/4] ACPI / watchdog: Add support for WDAT (Watchdog Action Table)

2016-09-23 Thread Rafael J. Wysocki
On Tuesday, September 20, 2016 03:30:50 PM Mika Westerberg wrote:
> Hi,
> 
> The WDAT (Watchdog Action Table) is a special ACPI table introduced by
> Microsoft [1] that abstracts the watchdog hardware from the OS. Windows
> uses this table for its watchdog implementation instead of a native iTCO
> driver.
> 
> Microsoft re-licensed the WDAT specification to be under Microsoft
> Community Promise license [2] so it should be fine to use it in Linux.
> 
> This series brings WDAT table support to Linux.
> 
> When the driver is enabled and we find out that there is a WDAT table, the
> driver will take over the native iTCO watchdog driver. Main advantage in
> this is that we do not need to change the native iTCO driver whenever the
> hardware changes. For example in Skylake iTCO moved to sit behind SMBus and
> the NO_REBOOT bit was hidden behind P2SB (Primary to Sideband). In addition
> we can expect this to be tested much better by OEMs who typically validate
> that Windows works fine on their hardware/firmware.
> 
> Patch [1/4] adds ACPI enumeration support and the driver itself. It also
> introduces acpi_has_watchdog() which can be used to check if we should use
> ACPI watchdog or native one.
> 
> Patches [2-4/4] prevent creation of the native iTCO platform device if we
> detect that the ACPI watchdog (WDAT) should be used instead.
> 
> The previous version of the series can be found in [3].
> 
> Changes from v1:
>   * Moved wdat_wdt.c to live under drivers/watchdog
>   * Added checks for timer_period, min_count and max_count
>   * Use min_hw_heartbeat_ms and max_hw_heartbeat_ms instead of
> min/max_timeout
>   * Instead of stopping the watchdog set WDOG_HW_RUNNING
>   * Switched to use devm_watchdog_register_device() and dropped
> wdat_wdt_remove()
>   * Do not ping watchdog in resume()
>   * Added review tag from Guenter Roeck to patches [2-4/4].
> 
> [1] http://msdn.microsoft.com/en-us/windows/hardware/gg463320.aspx
> [2] https://msdn.microsoft.com/en-us/openspecifications/dn646766.aspx
> [3] http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1230607.html
> 
> Mika Westerberg (4):
>   ACPI / watchdog: Add support for WDAT hardware watchdog
>   mfd: lpc_ich: Do not create iTCO watchdog when WDAT table exists
>   i2c: i801: Do not create iTCO watchdog when WDAT table exists
>   platform/x86: intel_pmc_ipc: Do not create iTCO watchdog when WDAT
> table exists
> 
>  drivers/acpi/Kconfig |   3 +
>  drivers/acpi/Makefile|   1 +
>  drivers/acpi/acpi_watchdog.c | 123 
>  drivers/acpi/internal.h  |  10 +
>  drivers/acpi/scan.c  |   1 +
>  drivers/i2c/busses/i2c-i801.c|   4 +-
>  drivers/mfd/lpc_ich.c|   4 +
>  drivers/platform/x86/intel_pmc_ipc.c |  12 +-
>  drivers/watchdog/Kconfig |  13 +
>  drivers/watchdog/Makefile|   1 +
>  drivers/watchdog/wdat_wdt.c  | 525 
> +++
>  include/linux/acpi.h |   6 +
>  12 files changed, 698 insertions(+), 5 deletions(-)
>  create mode 100644 drivers/acpi/acpi_watchdog.c
>  create mode 100644 drivers/watchdog/wdat_wdt.c

I'm queing up this series for 4.9.

Please let me know if there are any objections.

Thanks,
Rafael



Re: [PATCH v2 0/4] ACPI / watchdog: Add support for WDAT (Watchdog Action Table)

2016-09-23 Thread Rafael J. Wysocki
On Tuesday, September 20, 2016 03:30:50 PM Mika Westerberg wrote:
> Hi,
> 
> The WDAT (Watchdog Action Table) is a special ACPI table introduced by
> Microsoft [1] that abstracts the watchdog hardware from the OS. Windows
> uses this table for its watchdog implementation instead of a native iTCO
> driver.
> 
> Microsoft re-licensed the WDAT specification to be under Microsoft
> Community Promise license [2] so it should be fine to use it in Linux.
> 
> This series brings WDAT table support to Linux.
> 
> When the driver is enabled and we find out that there is a WDAT table, the
> driver will take over the native iTCO watchdog driver. Main advantage in
> this is that we do not need to change the native iTCO driver whenever the
> hardware changes. For example in Skylake iTCO moved to sit behind SMBus and
> the NO_REBOOT bit was hidden behind P2SB (Primary to Sideband). In addition
> we can expect this to be tested much better by OEMs who typically validate
> that Windows works fine on their hardware/firmware.
> 
> Patch [1/4] adds ACPI enumeration support and the driver itself. It also
> introduces acpi_has_watchdog() which can be used to check if we should use
> ACPI watchdog or native one.
> 
> Patches [2-4/4] prevent creation of the native iTCO platform device if we
> detect that the ACPI watchdog (WDAT) should be used instead.
> 
> The previous version of the series can be found in [3].
> 
> Changes from v1:
>   * Moved wdat_wdt.c to live under drivers/watchdog
>   * Added checks for timer_period, min_count and max_count
>   * Use min_hw_heartbeat_ms and max_hw_heartbeat_ms instead of
> min/max_timeout
>   * Instead of stopping the watchdog set WDOG_HW_RUNNING
>   * Switched to use devm_watchdog_register_device() and dropped
> wdat_wdt_remove()
>   * Do not ping watchdog in resume()
>   * Added review tag from Guenter Roeck to patches [2-4/4].
> 
> [1] http://msdn.microsoft.com/en-us/windows/hardware/gg463320.aspx
> [2] https://msdn.microsoft.com/en-us/openspecifications/dn646766.aspx
> [3] http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1230607.html
> 
> Mika Westerberg (4):
>   ACPI / watchdog: Add support for WDAT hardware watchdog
>   mfd: lpc_ich: Do not create iTCO watchdog when WDAT table exists
>   i2c: i801: Do not create iTCO watchdog when WDAT table exists
>   platform/x86: intel_pmc_ipc: Do not create iTCO watchdog when WDAT
> table exists
> 
>  drivers/acpi/Kconfig |   3 +
>  drivers/acpi/Makefile|   1 +
>  drivers/acpi/acpi_watchdog.c | 123 
>  drivers/acpi/internal.h  |  10 +
>  drivers/acpi/scan.c  |   1 +
>  drivers/i2c/busses/i2c-i801.c|   4 +-
>  drivers/mfd/lpc_ich.c|   4 +
>  drivers/platform/x86/intel_pmc_ipc.c |  12 +-
>  drivers/watchdog/Kconfig |  13 +
>  drivers/watchdog/Makefile|   1 +
>  drivers/watchdog/wdat_wdt.c  | 525 
> +++
>  include/linux/acpi.h |   6 +
>  12 files changed, 698 insertions(+), 5 deletions(-)
>  create mode 100644 drivers/acpi/acpi_watchdog.c
>  create mode 100644 drivers/watchdog/wdat_wdt.c

I'm queing up this series for 4.9.

Please let me know if there are any objections.

Thanks,
Rafael



  1   2   3   4   5   6   7   8   9   10   >