Re: [LKP] [lkp] [sctp] a6c2f79287: netperf.Throughput_Mbps -37.2% regression

2016-10-09 Thread Aaron Lu
On Mon, Oct 03, 2016 at 10:32:04AM +0800, Xin Long wrote:
> On Fri, Sep 30, 2016 at 3:05 PM, Aaron Lu  wrote:
> > On 08/23/2016 05:44 AM, Marcelo Ricardo Leitner wrote:
> >> Em 19-08-2016 04:24, Aaron Lu escreveu:
> >>> On Fri, Aug 19, 2016 at 04:19:39AM -0300, Marcelo Ricardo Leitner wrote:
>  Hi,
> 
>  Em 19-08-2016 02:29, Aaron Lu escreveu:
>  ...
> > It doesn't look insane and sctp_wait_for_sndbuf may actually have
> > something to do with a larger sctp_chunk I suppose?
> >
> > The same perf record doesn't capture any sample for the good commit,
> > which suggests the nerperf process doesn't sleep in 
> > sctp_wait_for_sndbuf.
> 
>  Ahhh yes! It does, and then it would mean your txbuf is too small for the
>  chunk sizes you're using (sctp tests option -m).
> 
>  What's your netperf cmdline again please?
> >>>
> >>> netperf -4 -t SCTP_STREAM_MANY -c -C -l 300 -- -m 10K -H 127.0.0.1
> >>>
> >>> Is the 10K used here a problem? If so, can you suggest a proper value
> >>> for our netperf performance test? Thanks.
> >>
> >> We're still working on this. Xin could reproduce it on an i3 too, but
> >> I'm afraid this commit just unmasked an issue in there. You're
> >> overloading the CPU by too much when spawning 8 parallel netperf's on a
> >> 4-core system, seems that commit a6c2f79287 was that last rock that made
> >> it slip into a precipice. sctp's cwnd and rwnd management are not as
> >> good as tcp's and now it seems you're triggering a corner case.
> >>
> >> I hope to have more soon.
> >
> > I wonder if there is any update on this issue?
> >
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> 
> be4947b sctp: change to check peer prsctp_capable when using prsctp polices
> 0605483 sctp: remove prsctp_param from sctp_chunk
> 73dca12 sctp: move sent_count to the memory hole in sctp_chunk
> 
> These three commit can avoid this issue by recovering sctp_chunk size.

Thanks for the update, I just confirmed the throughput is back on my
desktop.



Re: [PATCH v3 2/4] drivers: iio: ti_am335x_adc: add dma support

2016-10-09 Thread Jonathan Cameron
On 05/10/16 10:04, Mugunthan V N wrote:
> This patch adds the required pieces to ti_am335x_adc driver for
> DMA support
> 
> Signed-off-by: Mugunthan V N 
Hi,

Just the one question inline.  I'll also need an Ack from Lee as
this touches code in mfd (as does the previous patch).
We have obviously missed this merge window, so no particular rush.

Otherwise, looking very nice indeed.  Got to get my BBB out and play
with this now ;)

Jonathan
> ---
>  drivers/iio/adc/ti_am335x_adc.c  | 148 
> ++-
>  include/linux/mfd/ti_am335x_tscadc.h |   7 ++
>  2 files changed, 152 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
> index c3cfacca..ad9dec3 100644
> --- a/drivers/iio/adc/ti_am335x_adc.c
> +++ b/drivers/iio/adc/ti_am335x_adc.c
> @@ -30,10 +30,28 @@
>  #include 
>  #include 
>  
> +#include 
> +#include 
> +
> +#define DMA_BUFFER_SIZE  SZ_2K
> +
> +struct tiadc_dma {
> + struct dma_slave_config conf;
> + struct dma_chan *chan;
> + dma_addr_t  addr;
> + dma_cookie_tcookie;
> + u8  *buf;
> + int current_period;
> + int period_size;
> + u8  fifo_thresh;
> +};
> +
>  struct tiadc_device {
>   struct ti_tscadc_dev *mfd_tscadc;
> + struct tiadc_dma dma;
>   struct mutex fifo1_lock; /* to protect fifo access */
>   int channels;
> + int total_ch_enabled;
>   u8 channel_line[8];
>   u8 channel_step[8];
>   int buffer_en_ch_steps;
> @@ -198,6 +216,67 @@ static irqreturn_t tiadc_worker_h(int irq, void *private)
>   return IRQ_HANDLED;
>  }
>  
> +static void tiadc_dma_rx_complete(void *param)
> +{
> + struct iio_dev *indio_dev = param;
> + struct tiadc_device *adc_dev = iio_priv(indio_dev);
> + struct tiadc_dma *dma = _dev->dma;
> + u8 *data;
> + int i;
> +
> + data = dma->buf + dma->current_period * dma->period_size;
> + dma->current_period = 1 - dma->current_period; /* swap the buffer ID */
> +
> + for (i = 0; i < dma->period_size; i += indio_dev->scan_bytes) {
> + iio_push_to_buffers(indio_dev, data);
> + data += indio_dev->scan_bytes;
> + }
Hmm. Another case for the mooted iio_push_to_buffers_multi. Guess
we should move on with that one ;)
> +}
> +
> +static int tiadc_start_dma(struct iio_dev *indio_dev)
> +{
> + struct tiadc_device *adc_dev = iio_priv(indio_dev);
> + struct tiadc_dma *dma = _dev->dma;
> + struct dma_async_tx_descriptor *desc;
> +
> + dma->current_period = 0; /* We start to fill period 0 */
> + /*
> +  * Make the fifo thresh as the multiple of total number of
> +  * channels enabled, so make sure that cyclic DMA period
> +  * length is also a multiple of total number of channels
> +  * enabled. This ensures that no invalid data is reported
> +  * to the stack via iio_push_to_buffers().
> +  */
> + dma->fifo_thresh = rounddown(FIFO1_THRESHOLD + 1,
> +  adc_dev->total_ch_enabled) - 1;
> + /* Make sure that period length is multiple of fifo thresh level */
> + dma->period_size = rounddown(DMA_BUFFER_SIZE / 2,
> + (dma->fifo_thresh + 1) * sizeof(u16));
> +
> + dma->conf.src_maxburst = dma->fifo_thresh + 1;
> + dmaengine_slave_config(dma->chan, >conf);
> +
> + desc = dmaengine_prep_dma_cyclic(dma->chan, dma->addr,
> +  dma->period_size * 2,
> +  dma->period_size, DMA_DEV_TO_MEM,
> +  DMA_PREP_INTERRUPT);
> + if (!desc)
> + return -EBUSY;
> +
> + desc->callback = tiadc_dma_rx_complete;
> + desc->callback_param = indio_dev;
> +
> + dma->cookie = dmaengine_submit(desc);
> +
> + dma_async_issue_pending(dma->chan);
> +
> + tiadc_writel(adc_dev, REG_FIFO1THR, dma->fifo_thresh);
> + tiadc_writel(adc_dev, REG_DMA1REQ, dma->fifo_thresh);
> + tiadc_writel(adc_dev, REG_DMAENABLE_SET, DMA_FIFO1);
> +
> + return 0;
> +}
> +
>  static int tiadc_buffer_preenable(struct iio_dev *indio_dev)
>  {
>   struct tiadc_device *adc_dev = iio_priv(indio_dev);
> @@ -218,20 +297,30 @@ static int tiadc_buffer_preenable(struct iio_dev 
> *indio_dev)
>  static int tiadc_buffer_postenable(struct iio_dev *indio_dev)
>  {
>   struct tiadc_device *adc_dev = iio_priv(indio_dev);
> + struct tiadc_dma *dma = _dev->dma;
> + unsigned int irq_enable;
>   unsigned int enb = 0;
>   u8 bit;
>  
>   tiadc_step_config(indio_dev);
> - for_each_set_bit(bit, indio_dev->active_scan_mask, adc_dev->channels)
> + for_each_set_bit(bit, indio_dev->active_scan_mask, adc_dev->channels) {
>   enb |= (get_adc_step_bit(adc_dev, bit) << 1);
> + 

[PATCH V2 5/5] arm64:dt:ls2080a: Add TMU device tree support for LS2080A

2016-10-09 Thread Jia Hongtao
From: Hongtao Jia 

Also add nodes and properties for thermal management support.

Signed-off-by: Jia Hongtao 
---
Changes for V2:
* Rebase on latest linux-next tree (next-20161006).

 arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts  |   2 +-
 arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts  |   2 +-
 arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts |   2 +-
 arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi | 116 +++--
 4 files changed, 111 insertions(+), 11 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts 
b/arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts
index b0dd010..8bc1f8f 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts
@@ -46,7 +46,7 @@
 
 /dts-v1/;
 
-/include/ "fsl-ls2080a.dtsi"
+#include "fsl-ls2080a.dtsi"
 
 / {
model = "Freescale Layerscape 2080a QDS Board";
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts 
b/arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts
index ad0ebb8..265e0a8 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts
@@ -46,7 +46,7 @@
 
 /dts-v1/;
 
-/include/ "fsl-ls2080a.dtsi"
+#include "fsl-ls2080a.dtsi"
 
 / {
model = "Freescale Layerscape 2080a RDB Board";
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts 
b/arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts
index 505d038..290604b 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts
@@ -46,7 +46,7 @@
 
 /dts-v1/;
 
-/include/ "fsl-ls2080a.dtsi"
+#include "fsl-ls2080a.dtsi"
 
 / {
model = "Freescale Layerscape 2080a software Simulator model";
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi 
b/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
index 337da90..723185e 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
@@ -44,6 +44,8 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#include 
+
 / {
compatible = "fsl,ls2080a";
interrupt-parent = <>;
@@ -62,15 +64,16 @@
 */
 
/* We have 4 clusters having 2 Cortex-A57 cores each */
-   cpu@0 {
+   cpu0: cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x0>;
clocks = < 1 0>;
next-level-cache = <_l2>;
+   #cooling-cells = <2>;
};
 
-   cpu@1 {
+   cpu1: cpu@1 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x1>;
@@ -78,15 +81,16 @@
next-level-cache = <_l2>;
};
 
-   cpu@100 {
+   cpu2: cpu@100 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x100>;
clocks = < 1 1>;
next-level-cache = <_l2>;
+   #cooling-cells = <2>;
};
 
-   cpu@101 {
+   cpu3: cpu@101 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x101>;
@@ -94,15 +98,16 @@
next-level-cache = <_l2>;
};
 
-   cpu@200 {
+   cpu4: cpu@200 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x200>;
clocks = < 1 2>;
next-level-cache = <_l2>;
+   #cooling-cells = <2>;
};
 
-   cpu@201 {
+   cpu5: cpu@201 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x201>;
@@ -110,15 +115,16 @@
next-level-cache = <_l2>;
};
 
-   cpu@300 {
+   cpu6: cpu@300 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x300>;
clocks = < 1 3>;
next-level-cache = <_l2>;
+   #cooling-cells = <2>;
};
 
-   cpu@301 {
+   cpu7: cpu@301 {
device_type = "cpu";
compatible = "arm,cortex-a57";
reg = <0x301>;
@@ -215,6 +221,100 @@
clocks = <>;
};
 
+   tmu: tmu@1f8 {
+   compatible = "fsl,qoriq-tmu";
+   reg = <0x0 0x1f8 

[PATCH V2 3/5] arm:dt:ls1021a: Add TMU device tree support for LS1021A

2016-10-09 Thread Jia Hongtao
From: Hongtao Jia 

Also add nodes and properties for thermal management support.

Signed-off-by: Jia Hongtao 
---
Changes for V2:
* Rebase on latest linux-next tree (next-20161006).

 arch/arm/boot/dts/ls1021a.dtsi | 84 +-
 1 file changed, 82 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index 368e219..282d854 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -47,6 +47,7 @@
 
 #include "skeleton64.dtsi"
 #include 
+#include 
 
 / {
compatible = "fsl,ls1021a";
@@ -70,14 +71,15 @@
#address-cells = <1>;
#size-cells = <0>;
 
-   cpu@f00 {
+   cpu0: cpu@f00 {
compatible = "arm,cortex-a7";
device_type = "cpu";
reg = <0xf00>;
clocks = <_clk>;
+   #cooling-cells = <2>;
};
 
-   cpu@f01 {
+   cpu1: cpu@f01 {
compatible = "arm,cortex-a7";
device_type = "cpu";
reg = <0xf01>;
@@ -251,6 +253,84 @@
};
};
 
+   tmu: tmu@1f0 {
+   compatible = "fsl,qoriq-tmu";
+   reg = <0x0 0x1f0 0x0 0x1>;
+   interrupts = ;
+   fsl,tmu-range = <0xb 0xa0026 0x80048 0x30061>;
+   fsl,tmu-calibration = <0x 0x000f
+  0x0001 0x0017
+  0x0002 0x001e
+  0x0003 0x0026
+  0x0004 0x002e
+  0x0005 0x0035
+  0x0006 0x003d
+  0x0007 0x0044
+  0x0008 0x004c
+  0x0009 0x0053
+  0x000a 0x005b
+  0x000b 0x0064
+
+  0x0001 0x0011
+  0x00010001 0x001c
+  0x00010002 0x0024
+  0x00010003 0x002b
+  0x00010004 0x0034
+  0x00010005 0x0039
+  0x00010006 0x0042
+  0x00010007 0x004c
+  0x00010008 0x0051
+  0x00010009 0x005a
+  0x0001000a 0x0063
+
+  0x0002 0x0013
+  0x00020001 0x0019
+  0x00020002 0x0024
+  0x00020003 0x002c
+  0x00020004 0x0035
+  0x00020005 0x003d
+  0x00020006 0x0046
+  0x00020007 0x0050
+  0x00020008 0x0059
+
+  0x0003 0x0002
+  0x00030001 0x000d
+  0x00030002 0x0019
+  0x00030003 0x0024>;
+   #thermal-sensor-cells = <1>;
+   };
+
+   thermal-zones {
+   cpu_thermal: cpu-thermal {
+   polling-delay-passive = <1000>;
+   polling-delay = <5000>;
+
+   thermal-sensors = < 0>;
+
+   trips {
+   cpu_alert: cpu-alert {
+   temperature = <85000>;
+   hysteresis = <2000>;
+   type = "passive";
+   };
+   cpu_crit: cpu-crit {
+   temperature = <95000>;
+   hysteresis = <2000>;
+   

Re: [PATCH v3 3/4] ARM: dts: am33xx: add DMA properties for tscadc

2016-10-09 Thread Jonathan Cameron
On 05/10/16 10:04, Mugunthan V N wrote:
> Add DMA properties for tscadc
> 
> Signed-off-by: Mugunthan V N 
Do the binding docs need updating to reflect this?  I can't immediately
find the relevant doc to check!

Jonathan
> ---
>  arch/arm/boot/dts/am33xx.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
> index 98748c6..6d607b8 100644
> --- a/arch/arm/boot/dts/am33xx.dtsi
> +++ b/arch/arm/boot/dts/am33xx.dtsi
> @@ -917,6 +917,8 @@
>   interrupts = <16>;
>   ti,hwmods = "adc_tsc";
>   status = "disabled";
> + dmas = < 53 0>, < 57 0>;
> + dma-names = "fifo0", "fifo1";
>  
>   tsc {
>   compatible = "ti,am3359-tsc";
> 



Re: parisc crash on boot with 4.8+git

2016-10-09 Thread Helge Deller
On 09.10.2016 11:03, Meelis Roos wrote:
>> On 08.10.2016 23:52, Meelis Roos wrote:
>>> rp3410 crashed on boot with the following:
>>>
>>> Linux version 4.8.0-11288-gb66484c (mroos@rp3410) (gcc version 5.4.0 
>>> (Gentoo 5.4.0 p1.0) ) #81 Sat Oct 8 20:40:24 EEST 2016
>>> unwind_init: start = 0x4076e980, end = 0x407a7060, entries = 14446
>>> The 64-bit Kernel has started...
>>> Kernel default page size is 4 KB. Huge pages enabled with 1 MB physical and 
>>> 2 MB virtual size.
>>> bootconsole [ttyB0] enabled
>>> ...
>>> Memory Ranges:
>>>  0) Start 0x End 0x3fff Size   1024 MB
>>>  1) Start 0x00404000 End 0x00407fdf Size   1022 MB
>>> Total Memory: 2046 MB
>>> Backtrace:
>>>  [<40102d40>] paging_init+0x5e0/0x740
>>>  [<40103744>] setup_arch+0x16c/0x1b0
>>>  [<40100ce0>] start_kernel+0xb8/0x668
>>>
>>> Bad Address (null pointer deref?): Code=15 regs=408034c0 
>>> (Addr=00099cf94000)
>>
>> You probably are facing one or both of those problems:
>> 1. Your kernel is bigger than the initial kernel mappings
>> 2. You face a bug in the palo boot loader.
>>
>> Regarding 1, you probably have CONFIG_TRACE=y or CONFIG_TEST_RHASHTABLE=y 
>> enabled?
>> Both increase the kernel size a lot and trigger this bug. 
> 
> # CONFIG_TEST_RHASHTABLE is not set
> 
> There is no CONFIG_TRACE in my .config.
> # CONFIG_FTRACE is not set

I meant CONFIG_FTRACE (which you don't seem to have enabled).

I just pushed two updated patches to my for-next git tree.
Please pull them on top of Linux head and try again (please update palo before).
http://git.kernel.org/cgit/linux/kernel/git/deller/parisc-linux.git/log/?h=for-next

>> Even if you fix the kernel with the patches above, you still may run
>> into the palo bug. I've just pushed a fix for it into the palo tree:
>> https://git.kernel.org/cgit/linux/kernel/git/deller/palo.git/commit/?id=70bd7a9a41e318c0575755a78c4d18ad97495c47
>>
>> If you rebuild palo, please make sure to install the new ipl boot loader into
>> the palo partition of your boot disc. palo should report at bootup version 
>> 1.96.

Same here. Please pull latest version, and install it:
https://git.kernel.org/cgit/linux/kernel/git/deller/palo.git/

Helge


Re: callchain map refcounting fixes was Re: [PATCH perf/core] perf script: fix a use after free crash.

2016-10-09 Thread Krister Johansen
Hi Namhyung,

Thanks for looking this over.

On Fri, Oct 07, 2016 at 11:22:00AM +0900, Namhyung Kim wrote:
> On Wed, Oct 05, 2016 at 08:45:24AM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Sat, Oct 01, 2016 at 08:13:36PM -0700, Krister Johansen escreveu:

> > > diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
> > > index 07fd30b..15c89b2 100644
> > > --- a/tools/perf/util/callchain.c
> > > +++ b/tools/perf/util/callchain.c
> > > @@ -439,7 +439,7 @@ fill_node(struct callchain_node *node, struct 
> > > callchain_cursor *cursor)
> > >   }
> > >   call->ip = cursor_node->ip;
> > >   call->ms.sym = cursor_node->sym;
> > > - call->ms.map = cursor_node->map;
> > > + call->ms.map = map__get(cursor_node->map);
> > >   list_add_tail(>list, >val);
> > >  
> > >   callchain_cursor_advance(cursor);
> > > @@ -464,6 +464,7 @@ add_child(struct callchain_node *parent,
> > >  
> > >   list_for_each_entry_safe(call, tmp, >val, list) {
> > >   list_del(>list);
> > > + map__zput(call->ms.map);
> > >   free(call);
> > >   }
> > >   free(new);
> > > @@ -732,6 +733,7 @@ merge_chain_branch(struct callchain_cursor *cursor,
> > >   callchain_cursor_append(cursor, list->ip,
> > >   list->ms.map, list->ms.sym);
> > >   list_del(>list);
> > > + map__zput(list->ms.map);
> > >   free(list);
> > >   }
> > >  
> > > @@ -780,7 +782,8 @@ int callchain_cursor_append(struct callchain_cursor 
> > > *cursor,
> > >   }
> > >  
> > >   node->ip = ip;
> > > - node->map = map;
> > > + map__zput(node->map);
> > > + node->map = map__get(map);
> > >   node->sym = sym;
> > >  
> > >   cursor->nr++;
> > > @@ -830,6 +833,8 @@ int fill_callchain_info(struct addr_location *al, 
> > > struct callchain_cursor_node *
> > >   goto out;
> > >   }
> > >  
> > > + map__get(al->map);
> > > +
> > >   if (al->map->groups == >machine->kmaps) {
> > >   if (machine__is_host(al->machine)) {
> > >   al->cpumode = PERF_RECORD_MISC_KERNEL;
> > > @@ -947,11 +952,13 @@ static void free_callchain_node(struct 
> > > callchain_node *node)
> > >  
> > >   list_for_each_entry_safe(list, tmp, >parent_val, list) {
> > >   list_del(>list);
> > > + map__zput(list->ms.map);
> > >   free(list);
> > >   }
> > >  
> > >   list_for_each_entry_safe(list, tmp, >val, list) {
> > >   list_del(>list);
> > > + map__zput(list->ms.map);
> > >   free(list);
> > >   }
> > >  
> > > @@ -1035,6 +1042,7 @@ int callchain_node__make_parent_list(struct 
> > > callchain_node *node)
> > >  out:
> > >   list_for_each_entry_safe(chain, new, , list) {
> > >   list_del(>list);
> > > + map__zput(chain->ms.map);
> 
> I think you need to grab the refcnt in the "while (parent)" loop above.


Thanks; good catch.  I'll fix this.

> > > diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
> > > index b02992e..f8335e8 100644
> > > --- a/tools/perf/util/hist.c
> > > +++ b/tools/perf/util/hist.c
> > > @@ -1,6 +1,7 @@
> > >  #include "util.h"
> > >  #include "build-id.h"
> > >  #include "hist.h"
> > > +#include "map.h"
> > >  #include "session.h"
> > >  #include "sort.h"
> > >  #include "evlist.h"
> > > @@ -970,6 +971,8 @@ iter_add_next_cumulative_entry(struct hist_entry_iter 
> > > *iter,
> > >  
> > >   if (symbol_conf.use_callchain)
> > >   callchain_append(he->callchain, , sample->period);
> > > + /* Cleanup temporary cursor. */
> > > + callchain_cursor_snapshot_rele();
> 
> This callchain shotshot is used in a short period of time, and it's
> guaranteed that the maps in callchains will not freed due to refcnt in
> the orignal callchain cursor.  So I think we can skip to get/put
> refcnt on the snapshot cursor.  Also "rele" seems not a good name..

Ok. I'll remove the get/put from the snapshot stuff, and will excise the
rele function.

> > >   return 0;
> > >  }
> > >  
> > > @@ -979,6 +982,7 @@ iter_finish_cumulative_entry(struct hist_entry_iter 
> > > *iter,
> > >  {
> > >   zfree(>priv);
> > >   iter->he = NULL;
> > > + map__zput(al->map);
> 
> What is this needed?  Why other places like iter_finish_normal_entry
> isn't?

I put a map__zput() here because iter_next_cumulative_entry() calls
fill_callchain_info(), which takes a reference on the al->map in the
struct addr_location that it returns.  I had forgotten all of this by
the time you asked.  When I went back to work out my rationale, I
stumbled across addr_location__put().  Think it would make sense to
relocate the put of al->map there instead?

Thanks for the feedback.  I'll send out a v2 once I get your changes
incorporated and tested.

-K


RE: [tpmdd-devel] [PATCH RFC 3/3] tpm_crb: request and relinquish locality 0

2016-10-09 Thread Winkler, Tomas


> 
> Request and relinquish locality for the driver use in order to be a better 
> citizen
> in a multi locality environment like with TXT as it uses locality 2.  

> 
> Signed-off-by: Jarkko Sakkinen 
> ---
>  drivers/char/tpm/tpm_crb.c | 36 
>  1 file changed, 24 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index
> ffd3a6c..9e07cf3 100644
> --- a/drivers/char/tpm/tpm_crb.c
> +++ b/drivers/char/tpm/tpm_crb.c
> @@ -34,6 +34,15 @@ enum crb_defaults {
>   CRB_ACPI_START_INDEX = 1,
>  };
> 
> +enum crb_loc_ctrl {
> + CRB_LOC_CTRL_REQUEST_ACCESS = BIT(0),
> + CRB_LOC_CTRL_RELINQUISH = BIT(1),
> +};
> +
> +enum crb_loc_state {
> + CRB_LOC_STATE_LOC_ASSIGNED  = BIT(1),
> +};
> +
>  enum crb_ctrl_req {
>   CRB_CTRL_REQ_CMD_READY  = BIT(0),
>   CRB_CTRL_REQ_GO_IDLE= BIT(1),
> @@ -98,12 +107,8 @@ struct crb_priv {
>   * @dev:  crb device
>   * @priv: crb private data
>   *
> - * Write CRB_CTRL_REQ_GO_IDLE to TPM_CRB_CTRL_REQ
> - * The device should respond within TIMEOUT_C by clearing the bit.
> - * Anyhow, we do not wait here as a consequent CMD_READY request
> - * will be handled correctly even if idle was not completed.
> - *
> - * The function does nothing for devices with ACPI-start method.
> + * Put device to the idle state and relinquish locality. The function
> + does
> + * nothing for devices with the ACPI-start method.
>   *
>   * Return: 0 always
>   */
> @@ -112,6 +117,7 @@ static int __maybe_unused crb_go_idle(struct device
> *dev, struct crb_priv *priv)
>   if (priv->flags & CRB_FL_ACPI_START)
>   return 0;
> 
> + iowrite32(CRB_LOC_CTRL_RELINQUISH, >regs->loc_ctrl);


Please don't mix different functionalities in one function 
Also those functions are called from runtime pm, this has nothing to do with 
the power management 

>   iowrite32(CRB_CTRL_REQ_GO_IDLE, >regs->ctrl_req);
>   /* we don't really care when this settles */
> 
> @@ -143,11 +149,8 @@ static bool crb_wait_for_reg_32(u32 __iomem *reg,
> u32 mask, u32 value,
>   * @dev:  crb device
>   * @priv: crb private data
>   *
> - * Write CRB_CTRL_REQ_CMD_READY to TPM_CRB_CTRL_REQ
> - * and poll till the device acknowledge it by clearing the bit.
> - * The device should respond within TIMEOUT_C.
> - *
> - * The function does nothing for devices with ACPI-start method
> + * Try to wake up the device and request locality. The function does
> + nothing
> + * for devices with the ACPI-start method.
>   *
>   * Return: 0 on success -ETIME on timeout;
>   */
> @@ -162,7 +165,16 @@ static int __maybe_unused crb_cmd_ready(struct
> device *dev,
>CRB_CTRL_REQ_CMD_READY /* mask */,
>0, /* value */
>TPM2_TIMEOUT_C)) {
> - dev_warn(dev, "cmdReady timed out\n");
> + dev_warn(dev, "TPM_CRB_CTRL_REQ_x.cmdReady timed
> out\n");
> + return -ETIME;
> + }
> +
> + iowrite32(CRB_LOC_CTRL_REQUEST_ACCESS, >regs->loc_ctrl);
> + if (!crb_wait_for_reg_32(>regs->loc_state,
> +  CRB_LOC_STATE_LOC_ASSIGNED, /* mask */
> +  CRB_LOC_STATE_LOC_ASSIGNED, /* value */
> +  TPM2_TIMEOUT_C)) {
> + dev_warn(dev, "TPM_LOC_STATE_x.requestAccess timed
> out\n");
Same here

>   return -ETIME;
>   }
> 
> --



Re: [RESEND PATCH v6, 3/5] usb: xhci-mtk: make IPPC register optional

2016-10-09 Thread Chunfeng Yun
On Wed, 2016-09-21 at 13:54 +0800, Chunfeng Yun wrote:
> Make IPPC register optional to support host side of dual-role mode,
> due to it is moved into common glue layer for simplification.
> 
> Signed-off-by: Chunfeng Yun 
> ---
>  drivers/usb/host/xhci-mtk.c |   36 +---
>  1 file changed, 29 insertions(+), 7 deletions(-)

Hi Mathias,

Would you please take a little time out of your busy schedule and
help review this patch?

Thank you very much.



Re: [PATCH v3 00/17] pinctrl: exynos/samsung: Add header with values used for configuration

2016-10-09 Thread Tomasz Figa
Hi Krzysztof,

2016-09-04 20:04 GMT+09:00 Krzysztof Kozlowski :
>
> Hi,
>
> Changes since v2
> 
> 1. Combine separate patchsets into one. Previously I sent separately the fixes
>and changes for S3C platforms.
> 2. Fix issues pointed during review.
> 3. Add review tags.
>
> Changes since v1
> 
> 1. Follow Arnd's suggestion about moving the macros to common place.
> 2. Subjects: replace "GPIO" with "pinctrl".
> 3. There were some major changes here so I did not add Javier's
>reviewed-by and tested-by tags.
>
> Merging
> ===
> Patches #1 and #2 should probably go through pinctrl tree. In that case I 
> would
> appreciate a stable branch/tag so DTS could base on top of it.
>
> Goal
> 
> Increase readability:
> uart0_data: uart0-data {
> samsung,pins = "gpa0-0", "gpa0-1";
> -   samsung,pin-function = <2>;
> -   samsung,pin-pud = <0>;
> -   samsung,pin-drv = <0>;
> +   samsung,pin-function = ;
> +   samsung,pin-pud = ;
> +   samsung,pin-drv = ;

I like the idea, thanks for cleaning this up. However I'd like to
bikeshed the prefix a bit. Since the properties are already prefixed
by "samsung,", I think it would make much more sense to also prefix
the generic values with "SAMSUNG_". Of course for soc/family-specific
values, the soc/family name prefix sounds right.

Similarly for rest of the value names, such as SAMSUNG_PIN_PUD instead
of SAMSUNG_PIN_PULL, which obviously sounds more like correct English,
however hurts the consistency and could confuse the people writing new
dts files.

Best regards,
Tomasz


Re: Observed a ecryptFS crash

2016-10-09 Thread xiakaixu

ping...



Hi Tyhicks,

We observed a ecryptFS crash occasionally in Linux kernel 4.1.18. The call 
trace is attached below. Is it a known issue? Look forward to hearing from you. 
Thanks in advance!

[19314.529479s][pid:2694,cpu3,GAC_Executor[0]]Call trace:
[19314.529510s][pid:2694,cpu3,GAC_Executor[0]][] 
do_raw_spin_lock+0x20/0x200
[19314.529510s][pid:2694,cpu3,GAC_Executor[0]][] 
_raw_spin_lock+0x28/0x34
[19314.529541s][pid:2694,cpu3,GAC_Executor[0]][] 
selinux_inode_free_security+0x3c/0x94
[19314.529541s][pid:2694,cpu3,GAC_Executor[0]][] 
security_inode_free+0x2c/0x38
[19314.529541s][pid:2694,cpu3,GAC_Executor[0]][] 
__destroy_inode+0x2c/0x180
[19314.529571s][pid:2694,cpu3,GAC_Executor[0]][] 
destroy_inode+0x30/0xa0
[19314.529571s][pid:2694,cpu3,GAC_Executor[0]][] 
evict+0x108/0x1c0
[19314.529571s][pid:2694,cpu3,GAC_Executor[0]][] 
iput+0x184/0x258
[19314.529602s][pid:2694,cpu3,GAC_Executor[0]][] 
ecryptfs_evict_inode+0x30/0x3c
[19314.529602s][pid:2694,cpu3,GAC_Executor[0]][] 
evict+0xac/0x1c0
[19314.529602s][pid:2694,cpu3,GAC_Executor[0]][] 
dispose_list+0x44/0x5c
[19314.529632s][pid:2694,cpu3,GAC_Executor[0]][] 
evict_inodes+0xcc/0x12c
[19314.529632s][pid:2694,cpu3,GAC_Executor[0]][] 
generic_shutdown_super+0x58/0xe4
[19314.529632s][pid:2694,cpu3,GAC_Executor[0]][] 
kill_anon_super+0x30/0x74
[19314.529663s][pid:2694,cpu3,GAC_Executor[0]][] 
ecryptfs_kill_block_super+0x24/0x54
[19314.529663s][pid:2694,cpu3,GAC_Executor[0]][] 
deactivate_locked_super+0x60/0x8c
[19314.529663s][pid:2694,cpu3,GAC_Executor[0]][] 
deactivate_super+0x98/0xa4
[19314.529693s][pid:2694,cpu3,GAC_Executor[0]][] 
cleanup_mnt+0x50/0xd0
[19314.529693s][pid:2694,cpu3,GAC_Executor[0]][] 
__cleanup_mnt+0x20/0x2c
[19314.529693s][pid:2694,cpu3,GAC_Executor[0]][] 
task_work_run+0xbc/0xf8
[19314.529724s][pid:2694,cpu3,GAC_Executor[0]][] 
do_exit+0x2d4/0xa14
[19314.529724s][pid:2694,cpu3,GAC_Executor[0]][] 
do_group_exit+0x60/0xf8
[19314.529724s][pid:2694,cpu3,GAC_Executor[0]][] 
get_signal+0x284/0x598
[19314.529754s][pid:2694,cpu3,GAC_Executor[0]][] 
do_signal+0x170/0x5b8
[19314.529754s][pid:2694,cpu3,GAC_Executor[0]][] 
do_notify_resume+0x70/0x78
[19314.529785s][pid:2694,cpu3,GAC_Executor[0]]Code: aa0003f3 aa1e03e0 97fe7718 
5289d5a0 (b9400661)
[19314.529907s][pid:2694,cpu3,GAC_Executor[0]]---[ end trace 382e4b6264b035b5 
]---
[19314.529907s][pid:2694,cpu3,GAC_Executor[0]]Kernel panic - not syncing: Fatal 
exception

Regards,
Shuoran





[PATCH V2 4/5] arm64:dt:ls1043a: Add TMU device tree support for LS1043A

2016-10-09 Thread Jia Hongtao
From: Hongtao Jia 

Also add nodes and properties for thermal management support.

Signed-off-by: Jia Hongtao 
---
Changes for V2:
* Rebase on latest linux-next tree (next-20161006).

 arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts |  2 +-
 arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts |  2 +-
 arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi| 78 +++
 3 files changed, 80 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts 
b/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts
index dd9e919..0989d63 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts
@@ -45,7 +45,7 @@
  */
 
 /dts-v1/;
-/include/ "fsl-ls1043a.dtsi"
+#include "fsl-ls1043a.dtsi"
 
 / {
model = "LS1043A QDS Board";
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts 
b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts
index d2313e0..c37110b 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts
@@ -45,7 +45,7 @@
  */
 
 /dts-v1/;
-/include/ "fsl-ls1043a.dtsi"
+#include "fsl-ls1043a.dtsi"
 
 / {
model = "LS1043A RDB Board";
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi 
b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
index 220ac70..41e5dc1 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
@@ -44,6 +44,8 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#include 
+
 / {
compatible = "fsl,ls1043a";
interrupt-parent = <>;
@@ -66,6 +68,7 @@
reg = <0x0>;
clocks = < 1 0>;
next-level-cache = <>;
+   #cooling-cells = <2>;
};
 
cpu1: cpu@1 {
@@ -254,6 +257,81 @@
big-endian;
};
 
+   tmu: tmu@1f0 {
+   compatible = "fsl,qoriq-tmu";
+   reg = <0x0 0x1f0 0x0 0x1>;
+   interrupts = <0 33 0x4>;
+   fsl,tmu-range = <0xb 0x9002a 0x6004c 0x30062>;
+   fsl,tmu-calibration = <0x 0x0026
+  0x0001 0x002d
+  0x0002 0x0032
+  0x0003 0x0039
+  0x0004 0x003f
+  0x0005 0x0046
+  0x0006 0x004d
+  0x0007 0x0054
+  0x0008 0x005a
+  0x0009 0x0061
+  0x000a 0x006a
+  0x000b 0x0071
+
+  0x0001 0x0025
+  0x00010001 0x002c
+  0x00010002 0x0035
+  0x00010003 0x003d
+  0x00010004 0x0045
+  0x00010005 0x004e
+  0x00010006 0x0057
+  0x00010007 0x0061
+  0x00010008 0x006b
+  0x00010009 0x0076
+
+  0x0002 0x0029
+  0x00020001 0x0033
+  0x00020002 0x003d
+  0x00020003 0x0049
+  0x00020004 0x0056
+  0x00020005 0x0061
+  0x00020006 0x006d
+
+  0x0003 0x0021
+  0x00030001 0x002a
+  0x00030002 0x003c
+  0x00030003 0x004e>;
+   #thermal-sensor-cells = <1>;
+   };
+
+   thermal-zones {
+   cpu_thermal: cpu-thermal {
+   polling-delay-passive = <1000>;
+   polling-delay = <5000>;
+
+   thermal-sensors = < 3>;
+
+   trips {
+   cpu_alert: cpu-alert {
+ 

[PATCH V2 2/5] powerpc/mpc85xx: Update TMU device tree node for T1023/T1024

2016-10-09 Thread Jia Hongtao
From: Hongtao Jia 

SoC compatible string and endianness property are added according to the
new bindings.

Signed-off-by: Jia Hongtao 
---
Changes for V2:
* Rebase on latest linux-next tree (next-20161006).

 arch/powerpc/boot/dts/fsl/t1023si-post.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
index 6e0b489..bce762a 100644
--- a/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1023si-post.dtsi
@@ -321,7 +321,7 @@
   0x00030001 0x000d
   0x00030002 0x0019
   0x00030003 0x0024>;
-   #thermal-sensor-cells = <0>;
+   #thermal-sensor-cells = <1>;
};
 
thermal-zones {
@@ -329,7 +329,7 @@
polling-delay-passive = <1000>;
polling-delay = <5000>;
 
-   thermal-sensors = <>;
+   thermal-sensors = < 0>;
 
trips {
cpu_alert: cpu-alert {
-- 
2.1.0.27.g96db324



[PATCH V2 1/5] powerpc/mpc85xx: Update TMU device tree node for T1040/T1042

2016-10-09 Thread Jia Hongtao
From: Hongtao Jia 

SoC compatible string and endianness property are added according to the
new bindings.

Signed-off-by: Jia Hongtao 
---
Changes for V2:
* Rebase on latest linux-next tree (next-20161006).

 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
index 44e399b..145c7f4 100644
--- a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
@@ -526,7 +526,7 @@
 
   0x0003 0x0012
   0x00030001 0x001d>;
-   #thermal-sensor-cells = <0>;
+   #thermal-sensor-cells = <1>;
};
 
thermal-zones {
@@ -534,7 +534,7 @@
polling-delay-passive = <1000>;
polling-delay = <5000>;
 
-   thermal-sensors = <>;
+   thermal-sensors = < 2>;
 
trips {
cpu_alert: cpu-alert {
-- 
2.1.0.27.g96db324



Re: [PATCH v2 00/12] Fixes, cleanup and g_NCR5380_mmio/g_NCR5380 merger

2016-10-09 Thread Michael Schmitz
> This patch series has fixes for compatibility, reliability and
> performance issues and some cleanup. It also includes a new version
> of Ondrej Zary's patch that merges g_NCR5380_mmio into g_NCR5380.
> 
> I've tested this patch series on a Powerbook 180. If someone would
> test some of the other platforms that would be very helpful. All
> drivers were compile-tested.
> 
> Changes since v1:
> - rebased on 4.9/scsi-queue
> - added reviewed-by tags
> - tweaked the order of struct members in patch 7/12
> 
> 
> Finn Thain (12):
>   scsi/g_NCR5380: Merge g_NCR5380 and g_NCR5380_mmio drivers
>   scsi/cumana_1: Remove unused cumanascsi_setup() function
>   scsi/atari_scsi: Make device register accessors re-enterant
>   scsi/ncr5380: Simplify register polling limit
>   scsi/ncr5380: Increase register polling limit
>   scsi/ncr5380: Improve hostdata struct member alignment and
> cache-ability
>   scsi/ncr5380: Store IO ports and addresses in host private data
>   scsi/ncr5380: Use correct types for device register accessors
>   scsi/ncr5380: Pass hostdata pointer to register polling routines
>   scsi/ncr5380: Expedite register polling
>   scsi/ncr5380: Use correct types for DMA routines
>   scsi/ncr5380: Suppress unhelpful "interrupt without IRQ bit" message

Tested on Atari SCSI (Falcon) - no regressions.

Tested-by: Michael Schmitz 


kernel BUG at mm/huge_memory.c:1187!

2016-10-09 Thread Wenwei Tao
Hi,

I open the Transparent  huge page and run the system and hit the bug
in huge_memory.c:

static void __split_huge_page_refcount(struct page *page)
  .
  .
  .

 /* tail_page->_mapcount cannot change */
 BUG_ON(page_mapcount(page_tail) < 0);
   .
   .

In my understanding, the THP's tail page's mapcount is initialized to
-1,  page_mapcout(page_tail) should be 0.
Did anyone meet the same issue?

Thanks.

2016-09-28 02:12:08 [810422.485203] [ cut here ]
2016-09-28 02:12:08 [810422.489974] kernel BUG at mm/huge_memory.c:1187!
2016-09-28 02:12:08 [810422.494742] invalid opcode:  [#1] SMP
2016-09-28 02:12:08 [810422.499034] last sysfs file:
/sys/devices/system/cpu/online
2016-09-28 02:12:08 [810422.504757] CPU 31
2016-09-28 02:12:08 [810422.506775] Modules linked in: 8021q garp
bridge stp llc dell_rbu ipmi_devintf ipmi_si ipmi_msghandler bonding
ipv6 microcode  dca power_meter ext4 mbcache jbd2 ahci wmi dm_mirror
dm_region_hash dm_log dm_mod
2016-09-28 02:12:08 [810422.571439]
2016-09-28 02:12:08 [810422.573088] Pid: 10729, comm: observer
Tainted: GW     2.6.32-220.23.2.el6.x86_64
2016-09-28 02:12:08 [810422.586827] RIP: 0010:[]  [] split_huge_page+0x7c4/0x800
2016-09-28 02:12:08 [810422.595498] RSP: 0018:887661c9fcd8  EFLAGS: 00010086
2016-09-28 02:12:08 [810422.600956] RAX:  RBX:
ea011b4d4000 RCX: c9003018b000
2016-09-28 02:12:08 [810422.608300] RDX: 0002 RSI:
887f4fb3b400 RDI: 0004
2016-09-28 02:12:08 [810422.615644] RBP: 887661c9fd88 R08:
007d R09: 8800
2016-09-28 02:12:08 [810422.622983] R10:  R11:
0287 R12: ea011b4cdfc0
2016-09-28 02:12:08 [810422.630325] R13:  R14:
ea011b4cd000 R15: 0007f3253047
2016-09-28 02:12:08 [810422.637664] FS:  7f43aed23700()
GS:8802723e() knlGS:
2016-09-28 02:12:08 [810422.645957] CS:  0010 DS:  ES:  CR0:
80050033
2016-09-28 02:12:08 [810422.651855] CR2: 2b73a80013b0 CR3:
00557a658000 CR4: 001406e0
2016-09-28 02:12:08 [810422.659198] DR0:  DR1:
 DR2: 
2016-09-28 02:12:08 [810422.666543] DR3:  DR6:
fffe0ff0 DR7: 0400
2016-09-28 02:12:08 [810422.673882] Process observer (pid: 10729,
threadinfo 887661c9e000, task 88787fb94040)
2016-09-28 02:12:08 [810422.682611] Stack:
2016-09-28 02:12:08 [810422.684779]  000e 0006
887f46f4e640 887882be22e0
2016-09-28 02:12:08 [810422.692213] <0> 887f46f4e6c8
0001 887882be22f8 006cd0dcb067
2016-09-28 02:12:08 [810422.700185] <0> 887882be22d8
000181146034 ea011b4cd038 8802c1c0
2016-09-28 02:12:08 [810422.708420] Call Trace:
2016-09-28 02:12:08 [810422.711026]  [] __split_huge_page_pmd+0x81/0xc0
2016-09-28 02:12:08 [810422.717272]  [] split_huge_page_address+0x9a/0xa0
2016-09-28 02:12:08 [810422.723686]  [] __vma_adjust_trans_huge+0xd0/0xf0
2016-09-28 02:12:08 [810422.730102]  [] vma_adjust+0x4fa/0x590
2016-09-28 02:12:08 [810422.735566]  [] __split_vma+0x143/0x280
2016-09-28 02:12:08 [810422.741115]  [] do_munmap+0x25a/0x3a0
2016-09-28 02:12:08 [810422.746489]  [] sys_munmap+0x56/0x80
2016-09-28 02:12:08 [810422.751782]  [] system_call_fastpath+0x16/0x1b
2016-09-28 02:12:08 [810422.757939] Code: b0 fc ff ff 0f 0b 90 eb fd
49 8b 46 10 e9 d4 fc ff ff 0f 0b 0f 1f 00 eb fb 49 8b 06 a9 00 00 00
02 0f 84 1c fa ff ff f3 90 eb ee <0f> 0b eb fe 0f 0b 66 0f 1f 44 00 00
eb f8 0f 0b eb fe 0f 0b 0f
2016-09-28 02:12:08 [810422.778682] RIP  [] split_huge_page+0x7c4/0x800
2016-09-28 02:12:08 [810422.784947]  RSP
2016-09-28 02:12:08 [810422.789074] ---[ end trace a7919e7f17c0a727 ]---


Re: parisc crash on boot with 4.8+git

2016-10-09 Thread Meelis Roos
> On 08.10.2016 23:52, Meelis Roos wrote:
> > Just tried 4.8.0-11288-gb66484c on three of my parsic machines (enabled 
> > strict usercopy checking or somethinng like that in make oldconfig).
> 
> It's not related to the usercopy checks, instead it's most likely a
> parisc-specific problem I just noticed today as well and which I'm 
> currently fixing.
>  
> > rp3440 worked fine. a500 and rp3410 cras on boot.
> > 
> > rp3410 crashed on boot with the following:
> > 
> > Linux version 4.8.0-11288-gb66484c (mroos@rp3410) (gcc version 5.4.0 
> > (Gentoo 5.4.0 p1.0) ) #81 Sat Oct 8 20:40:24 EEST 2016
> > unwind_init: start = 0x4076e980, end = 0x407a7060, entries = 14446
> > The 64-bit Kernel has started...
> > Kernel default page size is 4 KB. Huge pages enabled with 1 MB physical and 
> > 2 MB virtual size.
> > bootconsole [ttyB0] enabled
> > ...
> > Memory Ranges:
> >  0) Start 0x End 0x3fff Size   1024 MB
> >  1) Start 0x00404000 End 0x00407fdf Size   1022 MB
> > Total Memory: 2046 MB
> > Backtrace:
> >  [<40102d40>] paging_init+0x5e0/0x740
> >  [<40103744>] setup_arch+0x16c/0x1b0
> >  [<40100ce0>] start_kernel+0xb8/0x668
> > 
> > Bad Address (null pointer deref?): Code=15 regs=408034c0 
> > (Addr=00099cf94000)
> 
> You probably are facing one or both of those problems:
> 1. Your kernel is bigger than the initial kernel mappings
> 2. You face a bug in the palo boot loader.
> 
> Regarding 1, you probably have CONFIG_TRACE=y or CONFIG_TEST_RHASHTABLE=y 
> enabled?
> Both increase the kernel size a lot and trigger this bug. 

# CONFIG_TEST_RHASHTABLE is not set

There is no CONFIG_TRACE in my .config.

grep TRACE .config gives
CONFIG_STACKTRACE_SUPPORT=y
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
# CONFIG_TRACE_SINK is not set
# CONFIG_STACKTRACE is not set
# CONFIG_RCU_TRACE is not set
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
# CONFIG_FTRACE is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
CONFIG_TRACE_IRQFLAGS_SUPPORT=y

> To fix it, make sure you have this patch in your kernel (it's upstream):
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=690d097c00c88fa9d93d198591e184164b1d8c20

I saw this batch of parisc changes in mainline, that's why I built new 
kernels for test and then I got the error. 4.8.0-11288-gb66484c is the 
version I ran, with the commit AFAIK.
 
> Additionally if people (not you) use a 32bit kernel I suggest this one too 
> (in my for-next tree):
> http://git.kernel.org/cgit/linux/kernel/git/deller/parisc-linux.git/commit/?h=for-next=96c65e4d1c77f461b34161dc8e6f2db7c50fd3e8
> 
> Both patches increase the initial kernel page mappings to 32MB which should 
> be sufficient.
> 
> Even if you fix the kernel with the patches above, you still may run
> into the palo bug. I've just pushed a fix for it into the palo tree:
> https://git.kernel.org/cgit/linux/kernel/git/deller/palo.git/commit/?id=70bd7a9a41e318c0575755a78c4d18ad97495c47
> 
> If you rebuild palo, please make sure to install the new ipl boot loader into
> the palo partition of your boot disc. palo should report at bootup version 
> 1.96.
> 
> Helge
> 

-- 
Meelis Roos (mr...@linux.ee)


[PATCH] irqchip/jcore: fix lost per-cpu interrupts

2016-10-09 Thread Rich Felker
The J-Core AIC does not have separate interrupt numbers reserved for
cpu-local vs global interrupts. Instead, the driver requesting the irq
is expected to know whether its device uses per-cpu interrupts or not.
Previously it was assumed that handle_simple_irq could work for both
cases, but it intentionally drops interrupts for an irq number that
already has a handler running. This resulted in the timer interrupt
for one cpu being lost when multiple cpus' timers were set for
approximately the same expiration time, leading to stalls. In theory
the same could also happen with IPIs.

To solve the problem, instead of registering handle_simple_irq as the
handler, register a wrapper function which checks whether the irq to
be handled was requested as per-cpu or not, and passes it to
handle_simple_irq or handle_percpu_irq accordingly.

Signed-off-by: Rich Felker 
---

Ideas for improvement are welcome -- for example the
irq_is_percpu(irq_desc_get_irq(desc)) thing looks rather silly but I
didn't see a better way without poking through abstractions -- but
overall I think this both solves the timer stall issue that I wasted
other people's time on, and addresses the concerns about the J-Core
AIC driver being oblivious to whether an irq is per-cpu.

---
 drivers/irqchip/irq-jcore-aic.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-jcore-aic.c b/drivers/irqchip/irq-jcore-aic.c
index 5e5e3bb..b53a8a5 100644
--- a/drivers/irqchip/irq-jcore-aic.c
+++ b/drivers/irqchip/irq-jcore-aic.c
@@ -25,12 +25,20 @@
 
 static struct irq_chip jcore_aic;
 
+static void handle_jcore_irq(struct irq_desc *desc)
+{
+   if (irq_is_percpu(irq_desc_get_irq(desc)))
+   handle_percpu_irq(desc);
+   else
+   handle_simple_irq(desc);
+}
+
 static int jcore_aic_irqdomain_map(struct irq_domain *d, unsigned int irq,
   irq_hw_number_t hwirq)
 {
struct irq_chip *aic = d->host_data;
 
-   irq_set_chip_and_handler(irq, aic, handle_simple_irq);
+   irq_set_chip_and_handler(irq, aic, handle_jcore_irq);
 
return 0;
 }
-- 
2.10.0



Re: [git pull] vfs pile 1 (splice)

2016-10-09 Thread Linus Torvalds
On Fri, Oct 7, 2016 at 3:20 PM, Al Viro  wrote:
> splice stuff.

Hmm. I've now gotten two oopses today, all at __kmalloc+0xc3/0x1f0,
which seems to be the

  *(void **)(object + s->offset);

in get_freepointer(). Because it started happening today, I'm inclined
to blame mainly stuff I merged late yesterday.

I'm pretty sure that 4.8.0-09134-g4c1fad64eff4 is all good, in
particular, while the problems definitely happen with
4.8.0-11288-gb66484cd7470.

Much of the stuff yesterday was non-x86 archiectures (the ARM soc
stuff, avr32,parisc and power), so the main suspects are

 - Andrew's series
 - Al's splice stuff
 - Ted's ext4 changes
 - Jens' block layer changes

yes, there are other things that came in between there, not just the
architecture things, but they seem much less likely to trigger for me.

The traces don't really give me any real ideas, they look like this:

 BUG: unable to handle kernel paging request at 9db749d0c000
 IP: [] __kmalloc+0xc3/0x1f0
 PGD 426098067
 PUD 426099067
 PMD 344b1a067
 PTE 0

 Oops:  [#1] SMP
 Modules linked in: fuse xt_CHECKSUM ipt_MASQUERADE
nf_nat_masquerade_ipv4 tun nf_conntrack_netbios_ns
nf_conntrack_broadcast ip6t_REJECT nf_reject_ipv6 ip6t_rpfilter
xt_conntrack ebtable_nat ebtable_broute bridge st
  acpi_als pinctrl_sunrisepoint tpm_tis pinctrl_intel kfifo_buf
tpm_tis_core tpm industrialio acpi_pad nfsd auth_rpcgss nfs_acl lockd
grace sunrpc dm_crypt i915 i2c_algo_bit drm_kms_helper
crct10dif_pclmul crc32_pclm
 CPU: 0 PID: 3091 Comm: collect2 Tainted: G   O
4.8.0-11288-gb66484cd7470-dirty #4
 Hardware name: System manufacturer System Product Name/Z170-K, BIOS
1803 05/06/2016
 task: 8ee43dbad940 task.stack: 9db749ee4000
 RIP: 0010:[]  [] __kmalloc+0xc3/0x1f0
 RSP: 0018:9db749ee7b80  EFLAGS: 00010246
 RAX: 9db749d0c000 RBX: 024000c0 RCX: 
 RDX: 34f7 RSI:  RDI: 0001b620
 RBP: 9db749ee7bb0 R08: 8ee4b6c1b620 R09: 8ee475810b3f
 R10: 9db749d0c000 R11: 8ee488a16240 R12: 024000c0
 R13: 0044 R14: 8ee4a60037c0 R15: 8ee4a60037c0
 FS:  7f3f8b10f740() GS:8ee4b6c0() knlGS:
 CS:  0010 DS:  ES:  CR0: 80050033
 CR2: 9db749d0c000 CR3: 0003a188a000 CR4: 003406f0
 DR0:  DR1:  DR2: 
 DR3:  DR6: fffe0ff0 DR7: 0400
 Stack:
  b3258f68 9db749ee7c40 0024 8ee3f5810b40
  7974697275636573 b3c99760 9db749ee7bd8 b3258f68
  9db749ee7c40 8ee4a1cb7378 8ee4a1cb7360 9db749ee7c10
 Call Trace:
  [] ? simple_xattr_alloc+0x28/0x60
  [] simple_xattr_alloc+0x28/0x60
  [] shmem_initxattrs+0x90/0xd0
  [] security_inode_init_security+0x11a/0x160
  [] ? shmem_fh_to_dentry+0x60/0x60
  [] shmem_mknod+0x62/0xd0
  [] shmem_create+0x18/0x20
  [] path_openat+0x128a/0x13c0
  [] do_filp_open+0x91/0x100
  [] ? __alloc_fd+0x3f/0x170
  [] do_sys_open+0x130/0x220
  [] SyS_open+0x1e/0x20
  [] entry_SYSCALL_64_fastpath+0x13/0x94
 Code: 49 83 78 10 00 4d 8b 10 0f 84 ce 00 00 00 4d 85 d2 0f 84 c5 00
00 00 49 63 47 20 49 8b 3f 4c 01 d0 40 f6 c7 0f 0f 85 1a 01 00 00 <48>
8b 18 48 8d 4a 01 4c 89 d0 65 48 0f c7 0f 0f 94 c0 84 c0 74
 RIP  [] __kmalloc+0xc3/0x1f0

and

 general protection fault:  [#1] SMP
 Modules linked in: fuse xt_CHECKSUM ipt_MASQUERADE
nf_nat_masquerade_ipv4 tun nf_conntrack_netbios_ns
nf_conntrack_broadcast ip6t_rpfilter ip6t_REJECT nf_reject_ipv6
xt_conntrack ebtable_nat ebtable_broute bridge st
  acpi_als pinctrl_sunrisepoint kfifo_buf pinctrl_intel industrialio
tpm_tis tpm_tis_core tpm acpi_pad nfsd auth_rpcgss nfs_acl lockd grace
sunrpc dm_crypt i915 crct10dif_pclmul crc32_pclmul crc32c_intel
i2c_algo_bit
 CPU: 5 PID: 3649 Comm: make Not tainted 4.8.0-11290-g13510890a847-dirty #3
 Hardware name: System manufacturer System Product Name/Z170-K, BIOS
1803 05/06/2016
 task: 8e3738188000 task.stack: abe649e88000
 RIP: 0010:[]  [] __kmalloc+0xc3/0x1f0
 RSP: 0018:abe649e8bc38  EFLAGS: 00010246
 RAX: 1e7acd36f90e784c RBX: 024080c0 RCX: 8e36e78631f4
 RDX: 284a RSI:  RDI: 0001b620
 RBP: abe649e8bc68 R08: 8e3776d5b620 R09: 84200088
 R10: 1e7acd36f90e784c R11: 69636574 R12: 024080c0
 R13: 004b R14: 8e37660037c0 R15: 8e37660037c0
 FS:  7f020d92a740() GS:8e3776d4() knlGS:
 CS:  0010 DS:  ES:  CR0: 80050033
 CR2: 7ffed15ee080 CR3: 0003f815a000 CR4: 003406e0
 DR0:  DR1:  DR2: 
 DR3:  DR6: fffe0ff0 DR7: 0400
 Stack:
  872bbb8e 8e36faebc818 8e3717123100 b0b3acc0
  0ce85fb7 8e36e78631f4 abe649e8bca8 872bbb8e
  abe649e8bcf0 

Re: [PATCH v3 00/17] pinctrl: exynos/samsung: Add header with values used for configuration

2016-10-09 Thread Krzysztof Kozlowski
On Mon, Oct 10, 2016 at 02:49:01AM +0900, Tomasz Figa wrote:
> 2016-10-10 1:39 GMT+09:00 Krzysztof Kozlowski :
> > On Sun, Oct 09, 2016 at 04:04:11PM +0900, Tomasz Figa wrote:
> >> Hi Krzysztof,
> >>
> >> 2016-09-04 20:04 GMT+09:00 Krzysztof Kozlowski :
> >> >
> >> > Hi,
> >> >
> >> > Changes since v2
> >> > 
> >> > 1. Combine separate patchsets into one. Previously I sent separately the 
> >> > fixes
> >> >and changes for S3C platforms.
> >> > 2. Fix issues pointed during review.
> >> > 3. Add review tags.
> >> >
> >> > Changes since v1
> >> > 
> >> > 1. Follow Arnd's suggestion about moving the macros to common place.
> >> > 2. Subjects: replace "GPIO" with "pinctrl".
> >> > 3. There were some major changes here so I did not add Javier's
> >> >reviewed-by and tested-by tags.
> >> >
> >> > Merging
> >> > ===
> >> > Patches #1 and #2 should probably go through pinctrl tree. In that case 
> >> > I would
> >> > appreciate a stable branch/tag so DTS could base on top of it.
> >> >
> >> > Goal
> >> > 
> >> > Increase readability:
> >> > uart0_data: uart0-data {
> >> > samsung,pins = "gpa0-0", "gpa0-1";
> >> > -   samsung,pin-function = <2>;
> >> > -   samsung,pin-pud = <0>;
> >> > -   samsung,pin-drv = <0>;
> >> > +   samsung,pin-function = ;
> >> > +   samsung,pin-pud = ;
> >> > +   samsung,pin-drv = ;
> >>
> >> I like the idea, thanks for cleaning this up. However I'd like to
> >> bikeshed the prefix a bit. Since the properties are already prefixed
> >> by "samsung,", I think it would make much more sense to also prefix
> >> the generic values with "SAMSUNG_". Of course for soc/family-specific
> >> values, the soc/family name prefix sounds right.
> >
> > I am lost. Sorry, I don't get what kind of final prefixes you would like
> > to have.
> >
> > SAMSUNG_EXYNOS4_PIN_DRV_LV1
> > SAMSUNG_EXYNOS5260_PIN_DRV_LV1
> > ?
> 
> For SoC-specific definitions:
> 
> EXYNOS4_PIN_DRV_LV1
> EXYNOS5260_PIN_DRV_LV1

ok... so no change needed in my patch.

> 
> >
> >> Similarly for rest of the value names, such as SAMSUNG_PIN_PUD instead
> >> of SAMSUNG_PIN_PULL, which obviously sounds more like correct English,
> >> however hurts the consistency and could confuse the people writing new
> >> dts files.
> >
> > SAMSUNG_S3C64XX_PIN_PUD_NONE
> > SAMSUNG_EXYNOS_PIN_PUD_NONE
> 
> For definitions common for the whole Samsung pinctrl driver:
> 
> SAMSUNG_PIN_PUD_NONE

These are not the same. The "none" is the same but rest is not.

> But actually I think I missed the fact that there is almost no common
> definitions. Is that correct? Was that the missing part of my
> understanding?

Yes. The only common definition for all Samsung SoCs would be the
function of a pin. On the other hand this will bring inconsistency:
everything prefixed with SoC except the function.

Best regards,
Krzysztof


Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jarkko Sakkinen
On Sun, Oct 09, 2016 at 09:32:32PM +0300, Jarkko Sakkinen wrote:
> On Sun, Oct 09, 2016 at 10:49:05AM -0600, Jason Gunthorpe wrote:
> > On Sun, Oct 09, 2016 at 12:38:18PM +0300, Jarkko Sakkinen wrote:
> > > On Sat, Oct 08, 2016 at 07:42:56PM -0600, Jason Gunthorpe wrote:
> > > > On Sun, Oct 09, 2016 at 03:15:09AM +0300, Jarkko Sakkinen wrote:
> > > > > + ctrl = crb_map_res(dev, priv, _res, buf->control_address,
> > > > > +sizeof(struct crb_regs) -
> > > > > +offsetof(struct crb_regs, ctrl_req));
> > > > > + if (IS_ERR(ctrl))
> > > > > + return PTR_ERR(ctrl);
> > > > > +
> > > > > + /* The control area always overrlaps IO memory mapped from the 
> > > > > ACPI
> > > > > +  * object with CRB start only devices. Thus, this is perfectly 
> > > > > safe.
> > > > > +  */
> > > > > + priv->regs = (void *)((unsigned long)ctrl -
> > > > > + offsetof(struct crb_regs, ctrl_req));
> > > > 
> > > > Hum. No, this makes bad assumptions about the structure of iomapping.
> > > > 
> > > > The map itself needs to be done with the adjustment:
> > > > 
> > > > ctrl = crb_map_res(dev, priv, _res, buf->control_address -
> > > > offsetof(struct crb_regs, ctrl_req),
> > > > sizeof(struct crb_regs));
> > > 
> > > That would be wrong address for the control area as it does not start
> > > from the beginning of CRB registers.
> > 
> > Of course, I just pointed out what the map call should look like
> > 
> > Something like this
> > 
> > priv->regs = crb_map_res(dev, priv, _res, buf->control_address -
> > offsetof(struct crb_regs, ctrl_req),
> > sizeof(struct crb_regs));
> > ctrl = >regs.ctrl_req;
> 
> Sorry I missed this part.
> 
> Here are the constraints for existing hardware:
> 
> 1. All the existing CRB start only hardware has the iomem covering the
>control area and registers for multiple localities.
> 2. All the existing ACPI start hardware has only the control area.
> 
> If you assume that SSDT does not have malicous behavior caused by either
> a BIOS bug or maybe a rootkit, then the current patch works for all the
> existing hardware.
> 
> To counter-measure for unexpected behavior in non-existing hardware and
> buggy or malicious firmware it probably make sense to use crb_map_res to
> validate the part of the CRB registers that is not part of the control
> area.
> 
> Doing it in the way you proposed does not work for ACPI start devices.
> 
> For them it should be done in the same way as I'm doing in the existing
> patch as for ACPI start devices the address below the control area are
> never accessed. Having a separate crb_map_res for CRB start only devices
> is sane thing to do for validation.

Alternative is to do two structures crb_regs_head and crb_regs_tail,
which might be cleaner. I'm fine with going either route.


/Jarkko


Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jarkko Sakkinen
On Sun, Oct 09, 2016 at 10:49:05AM -0600, Jason Gunthorpe wrote:
> On Sun, Oct 09, 2016 at 12:38:18PM +0300, Jarkko Sakkinen wrote:
> > On Sat, Oct 08, 2016 at 07:42:56PM -0600, Jason Gunthorpe wrote:
> > > On Sun, Oct 09, 2016 at 03:15:09AM +0300, Jarkko Sakkinen wrote:
> > > > +   ctrl = crb_map_res(dev, priv, _res, buf->control_address,
> > > > +  sizeof(struct crb_regs) -
> > > > +  offsetof(struct crb_regs, ctrl_req));
> > > > +   if (IS_ERR(ctrl))
> > > > +   return PTR_ERR(ctrl);
> > > > +
> > > > +   /* The control area always overrlaps IO memory mapped from the 
> > > > ACPI
> > > > +* object with CRB start only devices. Thus, this is perfectly 
> > > > safe.
> > > > +*/
> > > > +   priv->regs = (void *)((unsigned long)ctrl -
> > > > +   offsetof(struct crb_regs, ctrl_req));
> > > 
> > > Hum. No, this makes bad assumptions about the structure of iomapping.
> > > 
> > > The map itself needs to be done with the adjustment:
> > > 
> > >   ctrl = crb_map_res(dev, priv, _res, buf->control_address -
> > >   offsetof(struct crb_regs, ctrl_req),
> > >   sizeof(struct crb_regs));
> > 
> > That would be wrong address for the control area as it does not start
> > from the beginning of CRB registers.
> 
> Of course, I just pointed out what the map call should look like
> 
> Something like this
> 
>   priv->regs = crb_map_res(dev, priv, _res, buf->control_address -
>   offsetof(struct crb_regs, ctrl_req),
>   sizeof(struct crb_regs));
> ctrl = >regs.ctrl_req;

Sorry I missed this part.

Here are the constraints for existing hardware:

1. All the existing CRB start only hardware has the iomem covering the
   control area and registers for multiple localities.
2. All the existing ACPI start hardware has only the control area.

If you assume that SSDT does not have malicous behavior caused by either
a BIOS bug or maybe a rootkit, then the current patch works for all the
existing hardware.

To counter-measure for unexpected behavior in non-existing hardware and
buggy or malicious firmware it probably make sense to use crb_map_res to
validate the part of the CRB registers that is not part of the control
area.

Doing it in the way you proposed does not work for ACPI start devices.

For them it should be done in the same way as I'm doing in the existing
patch as for ACPI start devices the address below the control area are
never accessed. Having a separate crb_map_res for CRB start only devices
is sane thing to do for validation.

/Jarkko


[PATCH 2/2] [media] blackfin-capture: Delete an error message for a failed memory allocation

2016-10-09 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 9 Oct 2016 21:30:18 +0200

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such a statement here.

Link: 
http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf

Signed-off-by: Markus Elfring 
---
 drivers/media/platform/blackfin/bfin_capture.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/platform/blackfin/bfin_capture.c 
b/drivers/media/platform/blackfin/bfin_capture.c
index c5e1043..2e6edc0 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -802,10 +802,8 @@ static int bcap_probe(struct platform_device *pdev)
}
 
bcap_dev = kzalloc(sizeof(*bcap_dev), GFP_KERNEL);
-   if (!bcap_dev) {
-   v4l2_err(pdev->dev.driver, "Unable to alloc bcap_dev\n");
+   if (!bcap_dev)
return -ENOMEM;
-   }
 
bcap_dev->cfg = config;
 
-- 
2.10.1



Re: [PATCH 1/2] host: ehci-exynos: Convert to use the SET_SYSTEM_SLEEP_PM_OPS

2016-10-09 Thread Alan Stern
On Sun, 9 Oct 2016, Krzysztof Kozlowski wrote:

> On Sun, Oct 09, 2016 at 02:34:14PM +, Anand Moon wrote:
> > Move the ehci-exynos system PM callbacks within #ifdef CONFIG_PM_SLEEP
> > as to avoid them being build when not used. This also allows us to use the
> > SET_SYSTEM_SLEEP_PM_OPS macro which simplifies the code.
> > 
> > Signed-off-by: Anand Moon 
> > ---
> >  drivers/usb/host/ehci-exynos.c | 14 ++
> >  1 file changed, 6 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
> > index 42e5b66..1899900 100644
> > --- a/drivers/usb/host/ehci-exynos.c
> > +++ b/drivers/usb/host/ehci-exynos.c
> > @@ -251,7 +251,7 @@ static int exynos_ehci_remove(struct platform_device 
> > *pdev)
> > return 0;
> >  }
> >  
> > -#ifdef CONFIG_PM
> > +#ifdef CONFIG_PM_SLEEP
> 
> Does not look like an equivalent change. How will it behave in a config
> with !SUSPEND && !HIBERNATE && PM?

It's hard to say what Anand originally had in mind.  To me, it looks
like it will behave exactly the same as before, the only difference
being that the object image will not contain unused exynos_ehci_suspend
and exynos_ehci_resume routines.  And the compiler won't issue a 
warning at build time that the routines are unused.

Alan Stern



[PATCH v3 6/8] blk-mq: Rework blk_mq_realloc_hw_ctxs()

2016-10-09 Thread Alexander Gordeev
Rework blk_mq_realloc_hw_ctxs() so deallocation is done in order
reverse to allocation and indentation is bit more easy to read.

CC: linux-bl...@vger.kernel.org
Signed-off-by: Alexander Gordeev 
---
 block/blk-mq.c | 40 ++--
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 15c03c2..d2c11fc 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1895,6 +1895,7 @@ static void blk_mq_realloc_hw_ctxs(struct blk_mq_tag_set 
*set,
struct request_queue *q)
 {
int i, j;
+   struct blk_mq_hw_ctx *hctx;
struct blk_mq_hw_ctx **hctxs = q->queue_hw_ctx;
 
blk_mq_sysfs_unregister(q);
@@ -1908,33 +1909,36 @@ static void blk_mq_realloc_hw_ctxs(struct 
blk_mq_tag_set *set,
if (node == NUMA_NO_NODE)
node = set->numa_node;
 
-   hctxs[i] = kzalloc_node(sizeof(struct blk_mq_hw_ctx),
-   GFP_KERNEL, node);
-   if (!hctxs[i])
+   hctx = kzalloc_node(sizeof(*hctx), GFP_KERNEL, node);
+   if (!hctx)
break;
 
-   if (blk_mq_init_hctx(q, set, hctxs[i], i, node)) {
-   kfree(hctxs[i]);
-   hctxs[i] = NULL;
+   if (blk_mq_init_hctx(q, set, hctx, i, node)) {
+   kfree(hctx);
break;
}
-   blk_mq_hctx_kobj_init(hctxs[i]);
+
+   blk_mq_hctx_kobj_init(hctx);
+   hctxs[i] = hctx;
}
for (j = i; j < q->nr_hw_queues; j++) {
-   struct blk_mq_hw_ctx *hctx = hctxs[j];
+   hctx = hctxs[j];
 
-   if (hctx) {
-   if (hctx->tags) {
-   blk_mq_free_rq_map(set, hctx->tags, j);
-   set->tags[j] = NULL;
-   }
-   blk_mq_exit_hctx(q, set, hctx, j);
-   kobject_put(>kobj);
-   kfree(hctx->ctxs);
-   kfree(hctx);
-   hctxs[j] = NULL;
+   if (!hctx)
+   continue;
 
+   hctxs[j] = NULL;
+   kobject_put(>kobj);
+
+   if (hctx->tags) {
+   blk_mq_free_rq_map(set, hctx->tags, j);
+   set->tags[j] = NULL;
}
+
+   blk_mq_exit_hctx(q, set, hctx, j);
+
+   kfree(hctx->ctxs);
+   kfree(hctx);
}
q->nr_hw_queues = i;
blk_mq_sysfs_register(q);
-- 
1.8.3.1



Re: pci_alloc_irq_vectors use in 8250_lpss.c

2016-10-09 Thread Andy Shevchenko
On Mon, Oct 10, 2016 at 1:01 AM, Andy Shevchenko
 wrote:
> On Sun, Oct 9, 2016 at 8:56 PM, Christoph Hellwig  wrote:
>> Hi Andy,
>>
>> two comment on your ぱatch to add MSI support to the above driver.
>>
>> First pci_alloc_irq_vectors gained a mandatory flags argument, so
>> for MSI suport you now need to pass PCI_IRQ_MSI in flags for the
>> code to work.
>
> I will check this. Thanks for pointing to it.

Yeah, this has to be amended.

>
>>
>> Second please make sure to always pair pci_alloc_irq_vectors
>> with pci_free_irq_vectors on the remove path.
>
> For my opinion it should be done in PCI code since I'm using
> manageable resources. It's already done for all PCI API usually used
> at ->probe().

Nothing is required to do until you don't use some specific code. If
you plan extend *_free_*() function in the future, please, consider
manageable resources and automatic releasing.

-- 
With Best Regards,
Andy Shevchenko


[PATCH] drivers: staging: greybus: audio_codec.c: Fixed CHECKS for brace issues

2016-10-09 Thread Chase Metzger
Added braces to else statement where checkpatch complained.

Signed-off-by: Chase Metzger 
---
 drivers/staging/greybus/audio_codec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/audio_codec.c 
b/drivers/staging/greybus/audio_codec.c
index 8a0744b..1bdf849 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -655,8 +655,10 @@ static int gbcodec_mute_stream(struct snd_soc_dai *dai, 
int mute, int stream)
ret = gb_audio_apbridgea_shutdown_rx(data->connection,
 0);
params->state = GBAUDIO_CODEC_STOP;
-   } else
+   } else {
ret = -EINVAL;
+   }
+
if (ret)
dev_err_ratelimited(dai->dev,
"%s:Error during %s %s stream:%d\n",
-- 
2.1.4



Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jason Gunthorpe
On Sun, Oct 09, 2016 at 09:33:58PM +0300, Jarkko Sakkinen wrote:

> > Sorry I missed this part.
> > 
> > Here are the constraints for existing hardware:
> > 
> > 1. All the existing CRB start only hardware has the iomem covering the
> >control area and registers for multiple localities.
> > 2. All the existing ACPI start hardware has only the control area.
> > 
> > If you assume that SSDT does not have malicous behavior caused by either
> > a BIOS bug or maybe a rootkit, then the current patch works for all the
> > existing hardware.
> > 
> > To counter-measure for unexpected behavior in non-existing hardware and
> > buggy or malicious firmware it probably make sense to use crb_map_res to
> > validate the part of the CRB registers that is not part of the control
> > area.

I don't know how much I'd assume BIOS authors do what you think - the
spec I saw for this seems very vauge.

Certainly checking that locality region falls within the acpi mapping
seems essential.

> > Doing it in the way you proposed does not work for ACPI start devices.
> > 
> > For them it should be done in the same way as I'm doing in the existing
> > patch as for ACPI start devices the address below the control area are
> > never accessed. Having a separate crb_map_res for CRB start only devices
> > is sane thing to do for validation.
> 
> Alternative is to do two structures crb_regs_head and crb_regs_tail,
> which might be cleaner. I'm fine with going either route.

Since the iomem doesn't actually exist for a configuration having two
pointers is the better choice. Make sure one is null for the
configuration that does not support it.

The negative offset thing is way too subtle.

Jason


Re: [PATCH] extcon: usb-gpio: Add VBUS detection support

2016-10-09 Thread Chanwoo Choi
Hi Roger,

I'm sorry for late reply due to the vacation.

2016-10-07 18:18 GMT+09:00 Roger Quadros :
> Hi Chanwoo,
>
>
> On 27/09/16 08:48, Peter Chen wrote:
>> On Tue, Sep 20, 2016 at 05:53:55PM +0300, Roger Quadros wrote:
>>> Driver can now work with both ID and VBUS pins or either one of
>>> them.
>>>
>>> There can be the following 3 cases
>>>
>>> 1) Both ID and VBUS GPIOs are available:
>>>
>>> ID = LOW -> USB_HOST active, USB inactive
>>> ID = HIGH -> USB_HOST inactive, USB state is same as VBUS.
>>>
>>> 2) Only ID GPIO is available:
>>>
>>> ID = LOW -> USB_HOST active, USB inactive
>>> ID = HIGH -> USB_HOST inactive, USB active
>>>
>>> 3) Only VBUS GPIO is available:
>>>
>>> VBUS = LOW -> USB_HOST inactive, USB inactive
>>> VBUS = HIGH -> USB_HOST inactive, USB active
>>>
>>> Signed-off-by: Roger Quadros 
>
> Can you please pick this one for v4.9? Thanks.


I already sent the pull request of v4.9. It was finished.
So, this patch might be queued to v4.10.  I'll review it
after the business trip.

Regards,
Chanwoo Choi

>
> cheers,
> -roger
>
>>> ---
>>>  .../devicetree/bindings/extcon/extcon-usb-gpio.txt |   3 +
>>>  drivers/extcon/extcon-usb-gpio.c   | 169 
>>> -
>>>  2 files changed, 132 insertions(+), 40 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt 
>>> b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>>> index af0b903..dfc14f7 100644
>>> --- a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>>> +++ b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
>>> @@ -5,7 +5,10 @@ connected to a GPIO pin.
>>>
>>>  Required properties:
>>>  - compatible: Should be "linux,extcon-usb-gpio"
>>> +
>>> +Either one of id-gpio or vbus-gpio must be present. Both can be present as 
>>> well.
>>>  - id-gpio: gpio for USB ID pin. See gpio binding.
>>> +- vbus-gpio: gpio for USB VBUS pin.
>>>
>>>  Example: Examples of extcon-usb-gpio node in dra7-evm.dts as listed below:
>>>  extcon_usb1 {
>>> diff --git a/drivers/extcon/extcon-usb-gpio.c 
>>> b/drivers/extcon/extcon-usb-gpio.c
>>> index a27d350..d589c5f 100644
>>> --- a/drivers/extcon/extcon-usb-gpio.c
>>> +++ b/drivers/extcon/extcon-usb-gpio.c
>>> @@ -24,7 +24,6 @@
>>>  #include 
>>>  #include 
>>>  #include 
>>> -#include 
>>>  #include 
>>>  #include 
>>>  #include 
>>> @@ -36,7 +35,9 @@ struct usb_extcon_info {
>>>  struct extcon_dev *edev;
>>>
>>>  struct gpio_desc *id_gpiod;
>>> +struct gpio_desc *vbus_gpiod;
>>>  int id_irq;
>>> +int vbus_irq;
>>>
>>>  unsigned long debounce_jiffies;
>>>  struct delayed_work wq_detcable;
>>> @@ -48,31 +49,47 @@ static const unsigned int usb_extcon_cable[] = {
>>>  EXTCON_NONE,
>>>  };
>>>
>>> +/*
>>> + * "USB" = VBUS and "USB-HOST" = !ID, so we have:
>>> + * Both "USB" and "USB-HOST" can't be set as active at the
>>> + * same time so if "USB-HOST" is active (i.e. ID is 0)  we keep "USB" 
>>> inactive
>>> + * even if VBUS is on.
>>> + *
>>> + *  State  |ID   |   VBUS
>>> + * 
>>> + *  [1] USB|H|H
>>> + *  [2] none   |H|L
>>> + *  [3] USB-HOST   |L|H
>>> + *  [4] USB-HOST   |L|L
>>> + *
>>> + * In case we have only one of these signals:
>>> + * - VBUS only - we want to distinguish between [1] and [2], so ID is 
>>> always 1.
>>> + * - ID only - we want to distinguish between [1] and [4], so VBUS = ID.
>>> +*/
>>>  static void usb_extcon_detect_cable(struct work_struct *work)
>>>  {
>>> -int id;
>>> +int id, vbus;
>>>  struct usb_extcon_info *info = container_of(to_delayed_work(work),
>>>  struct usb_extcon_info,
>>>  wq_detcable);
>>>
>>> -/* check ID and update cable state */
>>> -id = gpiod_get_value_cansleep(info->id_gpiod);
>>> -if (id) {
>>> -/*
>>> - * ID = 1 means USB HOST cable detached.
>>> - * As we don't have event for USB peripheral cable attached,
>>> - * we simulate USB peripheral attach here.
>>> - */
>>> +/* check ID and VBUS and update cable state */
>>> +id = info->id_gpiod ?
>>> +gpiod_get_value_cansleep(info->id_gpiod) : 1;
>>> +vbus = info->vbus_gpiod ?
>>> +gpiod_get_value_cansleep(info->vbus_gpiod) : id;
>>> +
>>> +/* at first we clean states which are no longer active */
>>> +if (id)
>>>  extcon_set_state_sync(info->edev, EXTCON_USB_HOST, false);
>>> -extcon_set_state_sync(info->edev, EXTCON_USB, true);
>>> -} else {
>>> -/*
>>> - * ID = 0 means USB HOST cable attached.
>>> - * As we don't have event for USB peripheral cable detached,
>>> - * we simulate USB peripheral detach here.
>>> -   

lib/atomic64_test.c:217:9: error: implicit declaration of function 'atomic64_dec_if_positive'

2016-10-09 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   b66484cd74706fa8681d051840fe4b18a3da40ff
commit: 51a021244b9d579be6b4f8c15c493a76deb2a79e atomic64: no need for 
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
date:   2 days ago
config: frv-allmodconfig (attached as .config)
compiler: frv-linux-gcc (GCC) 6.2.0
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 51a021244b9d579be6b4f8c15c493a76deb2a79e
# save the attached .config to linux build tree
make.cross ARCH=frv 

All errors (new ones prefixed by >>):

   In file included from include/linux/init.h:4:0,
from lib/atomic64_test.c:14:
   lib/atomic64_test.c: In function 'test_atomic64':
   lib/atomic64_test.c:208:9: error: implicit declaration of function 
'atomic64_add_unless' [-Werror=implicit-function-declaration]
 BUG_ON(atomic64_add_unless(, one, v0));
^
   include/linux/compiler.h:168:42: note: in definition of macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
 ^
   lib/atomic64_test.c:208:2: note: in expansion of macro 'BUG_ON'
 BUG_ON(atomic64_add_unless(, one, v0));
 ^~
>> lib/atomic64_test.c:217:9: error: implicit declaration of function 
>> 'atomic64_dec_if_positive' [-Werror=implicit-function-declaration]
 BUG_ON(atomic64_dec_if_positive() != (onestwos - 1));
^
   include/linux/compiler.h:168:42: note: in definition of macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
 ^
   lib/atomic64_test.c:217:2: note: in expansion of macro 'BUG_ON'
 BUG_ON(atomic64_dec_if_positive() != (onestwos - 1));
 ^~
   lib/atomic64_test.c:230:10: error: implicit declaration of function 
'atomic64_inc_not_zero' [-Werror=implicit-function-declaration]
 BUG_ON(!atomic64_inc_not_zero());
 ^
   include/linux/compiler.h:168:42: note: in definition of macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
 ^
   lib/atomic64_test.c:230:2: note: in expansion of macro 'BUG_ON'
 BUG_ON(!atomic64_inc_not_zero());
 ^~
   cc1: some warnings being treated as errors

vim +/atomic64_dec_if_positive +217 lib/atomic64_test.c

978e5a36 Boqun Feng2015-11-04  202  DEC_RETURN_FAMILY_TEST(64, v0);
86a89380 Luca Barbieri 2010-02-24  203  
978e5a36 Boqun Feng2015-11-04  204  XCHG_FAMILY_TEST(64, v0, v1);
978e5a36 Boqun Feng2015-11-04  205  CMPXCHG_FAMILY_TEST(64, v0, v1, 
v2);
86a89380 Luca Barbieri 2010-02-24  206  
86a89380 Luca Barbieri 2010-02-24  207  INIT(v0);
9efbcd59 Luca Barbieri 2010-03-01 @208  BUG_ON(atomic64_add_unless(, 
one, v0));
86a89380 Luca Barbieri 2010-02-24  209  BUG_ON(v.counter != r);
86a89380 Luca Barbieri 2010-02-24  210  
86a89380 Luca Barbieri 2010-02-24  211  INIT(v0);
9efbcd59 Luca Barbieri 2010-03-01  212  BUG_ON(!atomic64_add_unless(, 
one, v1));
86a89380 Luca Barbieri 2010-02-24  213  r += one;
86a89380 Luca Barbieri 2010-02-24  214  BUG_ON(v.counter != r);
86a89380 Luca Barbieri 2010-02-24  215  
86a89380 Luca Barbieri 2010-02-24  216  INIT(onestwos);
86a89380 Luca Barbieri 2010-02-24 @217  
BUG_ON(atomic64_dec_if_positive() != (onestwos - 1));
86a89380 Luca Barbieri 2010-02-24  218  r -= one;
86a89380 Luca Barbieri 2010-02-24  219  BUG_ON(v.counter != r);
86a89380 Luca Barbieri 2010-02-24  220  

:: The code at line 217 was first introduced by commit
:: 86a8938078a8bb518c5376de493e348c7490d506 lib: Add self-test for 
atomic64_t

:: TO: Luca Barbieri 
:: CC: H. Peter Anvin 

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


.config.gz
Description: application/gzip


Re: [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed

2016-10-09 Thread Greg KH
On Fri, Oct 07, 2016 at 10:27:54PM +0530, Harman Kalra wrote:
> Warning "Prefer "pr_debug over printk(KERN_DEBUG... " and "few line more than 
> 80 character" fixed

That is two different things again :(

I can't take this as is...

greg k-h


[PATCH] Staging: i4l: act2000: Fixed warning "use pr_* instead of printk"

2016-10-09 Thread Harman Kalra
This patch replaces calls to the "printk" with  appropriate "pr_*"
function thus addressing the following warning generated by the
checkpatch script:

Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then
dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...:w

Signed-off-by: Harman Kalra 
---
 drivers/staging/i4l/act2000/act2000_isa.c |   25 +++--
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/i4l/act2000/act2000_isa.c 
b/drivers/staging/i4l/act2000/act2000_isa.c
index ad7a039..76195b9 100644
--- a/drivers/staging/i4l/act2000/act2000_isa.c
+++ b/drivers/staging/i4l/act2000/act2000_isa.c
@@ -78,10 +78,10 @@
if (istatus & ISA_ISR_ERR) {
/* Error Interrupt */
istatus &= ISA_ISR_ERR_MASK;
-   printk(KERN_WARNING "act2000: errIRQ\n");
+   pr_warn("act2000: errIRQ\n");
}
if (istatus)
-   printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", card->irq, 
istatus);
+   pr_debug("act2000: ?IRQ %d %02x\n", card->irq, istatus);
return IRQ_HANDLED;
 }
 
@@ -147,8 +147,7 @@
if (request_irq(irq, _isa_interrupt, 0, card->regname, card)) {
card->irq = old_irq;
card->flags |= ACT2000_FLAGS_IVALID;
-   printk(KERN_WARNING
-  "act2000: Could not request irq %d\n", irq);
+   pr_warn("act2000: Could not request irq %d\n", irq);
return -EBUSY;
} else {
act2000_isa_select_irq(card);
@@ -246,8 +245,7 @@
card->idat.isa.rcvskb = 
dev_alloc_skb(card->idat.isa.rcvlen);
if (!card->idat.isa.rcvskb) {
card->idat.isa.rcvignore = 1;
-   printk(KERN_WARNING
-  "act2000_isa_receive: no 
memory\n");
+   pr_warn("act2000_isa_receive: 
no memory\n");

test_and_clear_bit(ACT2000_LOCK_RX, (void *)>ilock);
return;
}
@@ -255,13 +253,12 @@
card->idat.isa.rcvptr = 
skb_put(card->idat.isa.rcvskb, card->idat.isa.rcvlen - 8);
} else {
card->idat.isa.rcvidx = 0;
-   printk(KERN_WARNING
-  "act2000_isa_receive: Invalid 
CAPI msg\n");
+   pr_warn("act2000_isa_receive: Invalid 
CAPI msg\n");
{
int i; __u8 *p; __u8 *t; __u8 
tmp[30];
for (i = 0, p = (__u8 
*)>idat.isa.rcvhdr, t = tmp; i < 8; i++)
t += sprintf(t, "%02x 
", *(p++));
-   printk(KERN_WARNING 
"act2000_isa_receive: %s\n", tmp);
+   pr_warn("act2000_isa_receive: 
%s\n", tmp);
}
}
}
@@ -370,21 +367,21 @@
count++;
}
if (count <= 20) {
-   printk(KERN_WARNING "act2000: No Firmware-ID!\n");
+   pr_warn("act2000: No Firmware-ID!\n");
return -ETIME;
}
*p = '\0';
fid.revlen[0] = '\0';
if (strcmp(fid.isdn, "ISDN")) {
-   printk(KERN_WARNING "act2000: Wrong Firmware-ID!\n");
+   pr_warn("act2000: Wrong Firmware-ID!\n");
return -EPROTO;
}
p = strchr(fid.revision, '\n');
if (p)
*p = '\0';
-   printk(KERN_INFO "act2000: Firmware-ID: %s\n", fid.revision);
+   pr_info("act2000: Firmware-ID: %s\n", fid.revision);
if (card->flags & ACT2000_FLAGS_IVALID) {
-   printk(KERN_DEBUG "Enabling Interrupts ...\n");
+   pr_debug("Enabling Interrupts ...\n");
act2000_isa_enable_irq(card);
}
return 0;
@@ -426,7 +423,7 @@
}
while (c < l) {
if (act2000_isa_writeb(card, *b++)) {
-   printk(KERN_WARNING
+   pr_warn(
   "act2000: loader timed out"
   " len=%d c=%d\n", length, c);
kfree(buf);
-- 
1.7.9.5



Re: [PATCH 5/7] ramoops: Split ftrace buffer space into per-CPU zones

2016-10-09 Thread Joel Fernandes
On Fri, Oct 7, 2016 at 10:28 PM, Joel Fernandes  wrote:
> If FTRACE_PER_CPU flag is passed to ramoops pdata, split the space into
> multiple zones depending on the number of CPUs.
>
> This speeds up the performance of function tracing by about 280% in my tests 
> as
> we avoid the locking. The trade off being lesser space available per CPU.  Let
> the ramoops user decide which option they want based on pdata flag.
>
> Signed-off-by: Joel Fernandes 
> ---
>  fs/pstore/ram.c| 70 
> +++---
>  include/linux/pstore_ram.h |  3 ++
>  2 files changed, 56 insertions(+), 17 deletions(-)
>
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
[..]
> @@ -391,14 +418,21 @@ static void ramoops_free_przs(struct ramoops_context 
> *cxt)
>  {
> int i;
>
> -   if (!cxt->przs)
> -   return;
> +   /* Free dump PRZs */
> +   if (cxt->przs) {
> +   for (i = 0; i < cxt->max_dump_cnt; i++)
> +   persistent_ram_free(cxt->przs[i]);
>
> -   for (i = 0; i < cxt->max_dump_cnt; i++)
> -   persistent_ram_free(cxt->przs[i]);
> +   kfree(cxt->przs);
> +   cxt->max_dump_cnt = 0;
> +   }
>
> -   kfree(cxt->przs);
> -   cxt->max_dump_cnt = 0;
> +   /* Free ftrace PRZs */
> +   if (cxt->fprzs) {
> +   for (i = 0; i < nr_cpu_ids; i++)
> +   persistent_ram_free(cxt->przs[i]);

I am supposed to free fprzs[i] here, instead of przs[i]. Also need to
check flag and free correct number of zones. Will fix for v2, sorry
about that.

Thanks,
Joel


Re: [PATCH 1/2] host: ehci-exynos: Convert to use the SET_SYSTEM_SLEEP_PM_OPS

2016-10-09 Thread Krzysztof Kozlowski
On Sun, Oct 09, 2016 at 10:45:40PM +0530, Anand Moon wrote:
> Hi Krzysztof,
> 
> On 9 October 2016 at 22:04, Krzysztof Kozlowski  wrote:
> > On Sun, Oct 09, 2016 at 02:34:14PM +, Anand Moon wrote:
> >> Move the ehci-exynos system PM callbacks within #ifdef CONFIG_PM_SLEEP
> >> as to avoid them being build when not used. This also allows us to use the
> >> SET_SYSTEM_SLEEP_PM_OPS macro which simplifies the code.
> >>
> >> Signed-off-by: Anand Moon 
> >> ---
> >>  drivers/usb/host/ehci-exynos.c | 14 ++
> >>  1 file changed, 6 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/drivers/usb/host/ehci-exynos.c 
> >> b/drivers/usb/host/ehci-exynos.c
> >> index 42e5b66..1899900 100644
> >> --- a/drivers/usb/host/ehci-exynos.c
> >> +++ b/drivers/usb/host/ehci-exynos.c
> >> @@ -251,7 +251,7 @@ static int exynos_ehci_remove(struct platform_device 
> >> *pdev)
> >>   return 0;
> >>  }
> >>
> >> -#ifdef CONFIG_PM
> >> +#ifdef CONFIG_PM_SLEEP
> >
> > Does not look like an equivalent change. How will it behave in a config
> > with !SUSPEND && !HIBERNATE && PM?
> >
> 
> [snip]
> 
> I just wanted to update suspend and resume callback to use
> SET_SYSTEM_SLEEP_PM_OPS
> as they are define under CONFIG_PM_SLEEP so I update above to avoid
> compilation warning/error.

First of all you did not answer to my question, so let me rephrase into
two:
1. Is the code equivalent?
2. What will be the output with !SUSPEND && !HIBERNATE && PM?

You didn't mention compilation warning/error in message commit so I do
not know what you are thinking about...

Best regards,
Krzysztof


Re: [PATCH 32/41] staging: lustre: llite: restart short read/write for normal IO

2016-10-09 Thread Greg Kroah-Hartman
On Sun, Oct 02, 2016 at 10:28:28PM -0400, James Simmons wrote:
> From: Bobi Jam 
> 
> If normal IO got short read/write, we'd restart the IO from where
> we've accomplished until we meet EOF or error happens.
> 
> Signed-off-by: Bobi Jam 
> Signed-off-by: Jinshan Xiong 
> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6389
> Reviewed-on: http://review.whamcloud.com/14123
> Reviewed-by: Andreas Dilger 
> Reviewed-by: Oleg Drokin 
> Signed-off-by: James Simmons 
> ---
>  drivers/staging/lustre/lnet/libcfs/fail.c  |1 +
>  .../staging/lustre/lustre/include/obd_support.h|2 +
>  drivers/staging/lustre/lustre/llite/file.c |   41 
> 
>  drivers/staging/lustre/lustre/llite/vvp_io.c   |   19 -
>  4 files changed, 45 insertions(+), 18 deletions(-)

Due to other changes in the filesystem tree, this patch no longer
applies :(

Can you rebase it and resend?

thanks,

greg k-h


Re: [PATCH 1/3] staging: ks7010: use __packed instead of __attribute__((packed))

2016-10-09 Thread Greg KH
On Sun, Oct 09, 2016 at 11:22:32AM +0530, Sabitha George wrote:
> This patch fixes the below checkpatch warning in ks_hostif.c:
>  __packed is preferred over __attribute__((packed))
> 
> Signed-off-by: Sabitha George 
> ---
>  drivers/staging/ks7010/ks_hostif.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

Someone else sent this right before you did, sorry :(


Re: [PATCH 2/3] staging: ks7010: use netdev_* instead of printk()

2016-10-09 Thread Greg KH
On Sun, Oct 09, 2016 at 11:23:25AM +0530, Sabitha George wrote:
> Fixes checkpatch warning on printk usage in ks_hostif.c
> 
> Signed-off-by: Sabitha George 
> ---
>  drivers/staging/ks7010/ks_hostif.c | 31 +++
>  1 file changed, 15 insertions(+), 16 deletions(-)

Due to other changes in my tree, this no longer applies :(

Can you rebase it against my staging-testing branch of staging.git and
resend?

thanks,

greg k-h


Re: [PATCH v5 11/17] dax: correct dax iomap code namespace

2016-10-09 Thread Christoph Hellwig
Can you send this one to Dave for 4.9?  It would be silly to rename
something one merge window after it's just been introduced.


Re: [PATCH RFC 1/3] tpm_crb: expand struct crb_control_area to struct crb_regs

2016-10-09 Thread Jason Gunthorpe
On Sun, Oct 09, 2016 at 12:38:18PM +0300, Jarkko Sakkinen wrote:
> On Sat, Oct 08, 2016 at 07:42:56PM -0600, Jason Gunthorpe wrote:
> > On Sun, Oct 09, 2016 at 03:15:09AM +0300, Jarkko Sakkinen wrote:
> > > + ctrl = crb_map_res(dev, priv, _res, buf->control_address,
> > > +sizeof(struct crb_regs) -
> > > +offsetof(struct crb_regs, ctrl_req));
> > > + if (IS_ERR(ctrl))
> > > + return PTR_ERR(ctrl);
> > > +
> > > + /* The control area always overrlaps IO memory mapped from the ACPI
> > > +  * object with CRB start only devices. Thus, this is perfectly safe.
> > > +  */
> > > + priv->regs = (void *)((unsigned long)ctrl -
> > > + offsetof(struct crb_regs, ctrl_req));
> > 
> > Hum. No, this makes bad assumptions about the structure of iomapping.
> > 
> > The map itself needs to be done with the adjustment:
> > 
> > ctrl = crb_map_res(dev, priv, _res, buf->control_address -
> > offsetof(struct crb_regs, ctrl_req),
> > sizeof(struct crb_regs));
> 
> That would be wrong address for the control area as it does not start
> from the beginning of CRB registers.

Of course, I just pointed out what the map call should look like

Something like this

priv->regs = crb_map_res(dev, priv, _res, buf->control_address -
offsetof(struct crb_regs, ctrl_req),
sizeof(struct crb_regs));
ctrl = >regs.ctrl_req;

> I think the crb_map_io and crb_map_res are too generic. Better way to do
> things would be to validate that assumptions for these two cases hold.

If the driver is going to be using a negative offset like this, then
it very much should validate the assumptions before doing it.

and not even map these regsiters if they are not supported by
hardware.

Jason


Re: [lkp] [ipc/sem.c] 0882cba0a0: aim9.shared_memory.ops_per_sec -8.8% regression

2016-10-09 Thread Manfred Spraul

Hi,

On 10/09/2016 09:05 AM, kernel test robot wrote:

FYI, we noticed a -8.8% regression of aim9.shared_memory.ops_per_sec due to 
commit:

commit 0882cba0a03bca73acd8fab8fb50db04691908e9 ("ipc/sem.c: fix complex_count vs. 
simple op race")
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master

in testcase: aim9
on test machine: 4 threads Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz with 4G 
memory
with following parameters:

testtime: 300s
test: shared_memory
cpufreq_governor: performance

Suite IX is the "AIM Independent Resource Benchmark:" the famous synthetic 
benchmark.



It is probably caused by this change:

--- ipc/sem-fast-but-wrong.c2016-10-09 19:24:47.914825410 +0200
+++ ipc/sem.c2016-10-09 19:24:57.960841540 +0200
@@ -363,6 +363,14 @@
  */
 spin_lock(>lock);

+/*
+ * See 51d7d5205d33
+ * ("powerpc: Add smp_mb() to arch_spin_is_locked()"):
+ * A full barrier is required: the write of sem->lock
+ * must be visible before the read is executed
+ */
+smp_mb();
+
 if (!smp_load_acquire(>complex_mode)) {
 /* fast path successful! */
 return sops->sem_num;

Unfortunately, we need it, at least for powerpc.
And I do not want to add a CONFIG_PPC into ipc/sem.c.

Is it possible to do a test what happens with patch that avoids 
spin_unlock_wait()?


https://patchwork.kernel.org/patch/9359365/
https://patchwork.kernel.org/patch/9359371/

(if possible, with both patches together)

Thanks,
Manfred


Re: [PATCH] irqchip/jcore: fix lost per-cpu interrupts

2016-10-09 Thread Thomas Gleixner
On Sun, 9 Oct 2016, Rich Felker wrote:
> Ideas for improvement are welcome -- for example the
> irq_is_percpu(irq_desc_get_irq(desc)) thing looks rather silly but I

See the other mail.

> didn't see a better way without poking through abstractions -- but
> overall I think this both solves the timer stall issue that I wasted
> other people's time on, and addresses the concerns about the J-Core
> AIC driver being oblivious to whether an irq is per-cpu.

You could put that knowledge into the device tree so you can decide at
mapping time whether it is per cpu or not.

Thanks,

tglx




[PATCH] Staging: fbtft: Fixed open parenthesis alignment check

2016-10-09 Thread Harman Kalra
This patch resolves all the following CHECKs caught by checkpatch.pl
CHECK: Alignment should match open parenthesis

Signed-off-by: Harman Kalra 
---
 drivers/staging/fbtft/fb_ili9325.c |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/fbtft/fb_ili9325.c 
b/drivers/staging/fbtft/fb_ili9325.c
index c31e2e0..4ab4479 100644
--- a/drivers/staging/fbtft/fb_ili9325.c
+++ b/drivers/staging/fbtft/fb_ili9325.c
@@ -38,18 +38,15 @@
 
 static unsigned int vc = 0x03; /* Vci1=Vci*0.80 */
 module_param(vc, uint, 0);
-MODULE_PARM_DESC(vc,
-"Sets the ratio factor of Vci to generate the reference voltages Vci1");
+MODULE_PARM_DESC(vc, "Sets the ratio factor of Vci to generate the reference 
voltages Vci1");
 
 static unsigned int vrh = 0x0d; /* VREG1OUT=Vci*1.85 */
 module_param(vrh, uint, 0);
-MODULE_PARM_DESC(vrh,
-"Set the amplifying rate (1.6 ~ 1.9) of Vci applied to output the VREG1OUT");
+MODULE_PARM_DESC(vrh, "Set the amplifying rate (1.6 ~ 1.9) of Vci applied to 
output the VREG1OUT");
 
 static unsigned int vdv = 0x12; /* VCOMH amplitude=VREG1OUT*0.98 */
 module_param(vdv, uint, 0);
-MODULE_PARM_DESC(vdv,
-"Select the factor of VREG1OUT to set the amplitude of Vcom");
+MODULE_PARM_DESC(vdv, "Select the factor of VREG1OUT to set the amplitude of 
Vcom");
 
 static unsigned int vcm = 0x0a; /* VCOMH=VREG1OUT*0.735 */
 module_param(vcm, uint, 0);
-- 
1.7.9.5



Re: [Resend PATCH] SCSI: scan: fix use-after-free

2016-10-09 Thread Christoph Hellwig
Looks fine:

Reviewed-by: Christoph Hellwig 


Re: [RFC PATCH-tip v4 02/10] locking/rwsem: Stop active read lock ASAP

2016-10-09 Thread Christoph Hellwig
On Fri, Oct 07, 2016 at 08:47:51AM +1100, Dave Chinner wrote:
> Except that it's DAX, and in 4.7-rc1 that used shared locking at the
> XFS level and never took exclusive locks.
> 
> *However*, the DAX IO path locking in XFS  has changed in 4.9-rc1 to
> match the buffered IO single writer POSIX semantics - the test is a
> bad test based on the fact it exercised a path that is under heavy
> development and so can't be used as a regression test across
> multiple kernels.

That being said - I wonder if we should allow the shared lock on DAX
files IFF the user is specifying O_DIRECT in the open mode..


[PATCH 2/3] Staging: i4l: icn: prefer pr_* instead of printk

2016-10-09 Thread Harman Kalra
This patch replaces call to  printk with  appropriate pr_*
function thus addressing the following warning generated by the
checkpatch script:
Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then
dev_dbg(dev, ... then pr_debug(...  to printk(KERN_DEBUG ...

Signed-off-by: Harman Kalra 
---
 drivers/staging/i4l/icn/icn.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/i4l/icn/icn.h b/drivers/staging/i4l/icn/icn.h
index f8f2e76..e273c27 100644
--- a/drivers/staging/i4l/icn/icn.h
+++ b/drivers/staging/i4l/icn/icn.h
@@ -54,7 +54,7 @@
 
 /* some useful macros for debugging */
 #ifdef ICN_DEBUG_PORT
-#define OUTB_P(v, p) {printk(KERN_DEBUG "icn: outb_p(0x%02x,0x%03x)\n", v, p); 
outb_p(v, p);}
+#define OUTB_P(v, p) {pr_debug("icn: outb_p(0x%02x,0x%03x)\n", v, p); 
outb_p(v, p);}
 #else
 #define OUTB_P outb
 #endif
-- 
1.7.9.5



[PATCH 1/3] Staging: i4l: icn: Fixed open brace should be on previous line error

2016-10-09 Thread Harman Kalra
This patch resolves the following error caught by checkpatch.pl:
ERROR: that open brace { should be on the previous line

Signed-off-by: Harman Kalra 
---
 drivers/staging/i4l/icn/icn.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index 514bfc2..3750ba3 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -411,8 +411,7 @@
int action;
 } icn_stat;
 /* *INDENT-OFF* */
-static icn_stat icn_stat_table[] =
-{
+static icn_stat icn_stat_table[] = {
{"BCON_",  ISDN_STAT_BCONN, 1}, /* B-Channel connected*/
{"BDIS_",  ISDN_STAT_BHUP,  2}, /* B-Channel disconnected */
/*
-- 
1.7.9.5



[PATCH 3/3] Staging: i4l: icn: Fixed open brace should be on previous line error

2016-10-09 Thread Harman Kalra
This patch resolves the following error caught by checkpatch.pl:
ERROR: that open brace { should be on the previous line

Signed-off-by: Harman Kalra 
---
 drivers/staging/i4l/icn/icn.h |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.h b/drivers/staging/i4l/icn/icn.h
index e273c27..07e2e01 100644
--- a/drivers/staging/i4l/icn/icn.h
+++ b/drivers/staging/i4l/icn/icn.h
@@ -186,8 +186,7 @@
 #ifdef __KERNEL__
 
 static icn_card *cards = (icn_card *) 0;
-static u_char chan2bank[] =
-{0, 4, 8, 12};  /* for icn_map_channel() */
+static u_char chan2bank[] = {0, 4, 8, 12};  /* for 
icn_map_channel() */
 
 static icn_dev dev;
 
-- 
1.7.9.5



Re: [PATCH] staging: wlan-ng: get memory from kernel allocators instead of big static buffer

2016-10-09 Thread Greg KH
On Sun, Oct 09, 2016 at 05:14:52PM +0200, Sergio Paracuellos wrote:
> This patch fix the following sparse warnings in prism2fw.c:
> warning: memset with byte count of 12
> 
> Signed-off-by: Sergio Paracuellos 
> ---
>  drivers/staging/wlan-ng/prism2fw.c | 11 ---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/prism2fw.c 
> b/drivers/staging/wlan-ng/prism2fw.c
> index 96aa211..7e33048 100644
> --- a/drivers/staging/wlan-ng/prism2fw.c
> +++ b/drivers/staging/wlan-ng/prism2fw.c
> @@ -124,7 +124,7 @@ struct imgchunk {
>  
>  /* Data records */
>  static unsigned int ns3data;
> -static struct s3datarec s3data[S3DATA_MAX];
> +static struct s3datarec *s3data;
>  
>  /* Plug records */
>  static unsigned int ns3plug;
> @@ -248,7 +248,12 @@ static int prism2_fwapply(const struct ihex_binrec 
> *rfptr,
>  
>   /* Initialize the data structures */
>   ns3data = 0;
> - memset(s3data, 0, sizeof(s3data));
> + s3data = kcalloc(S3DATA_MAX, sizeof(*s3data), GFP_KERNEL);
> + if (unlikely(!s3data)) {

Unless you can measure the speed difference, NEVER use likely or
unlikely in kernel code.  The CPU and compiler knows better than you do
what is going to happen, and optimizes it.  Especially for allocating
memory, that is a very common pattern and it knows what to do here.

Please remove this and resend.

thanks,

greg k-h


Re: [PATCH] staging: wlan-ng: get memory from kernel allocators instead of big static buffer

2016-10-09 Thread Greg KH
On Sun, Oct 09, 2016 at 05:29:22PM +0200, Sergio Paracuellos wrote:
> This patch fix the following sparse warnings in prism2fw.c:
> warning: memset with byte count of 12
> 
> Signed-off-by: Sergio Paracuellos 
> ---
>  drivers/staging/wlan-ng/prism2fw.c | 11 ---
>  1 file changed, 8 insertions(+), 3 deletions(-)

Fastest patch review turn-around time ever :)

nice work, all now applied.

greg k-h


[PATCH v2 7/9] staging: wlan-ng: fix block comments style in p80211netdev.h

2016-10-09 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211netdev.h
Block comments should align the * on each line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211netdev.h | 100 -
 1 file changed, 50 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211netdev.h 
b/drivers/staging/wlan-ng/p80211netdev.h
index 1e6a774..972e076 100644
--- a/drivers/staging/wlan-ng/p80211netdev.h
+++ b/drivers/staging/wlan-ng/p80211netdev.h
@@ -1,54 +1,54 @@
 /* p80211netdev.h
-*
-* WLAN net device structure and functions
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*
-* This file declares the structure type that represents each wlan
-* interface.
-*
-* 
-*/
+ *
+ * WLAN net device structure and functions
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ *
+ * This file declares the structure type that represents each wlan
+ * interface.
+ *
+ * 
+ */
 
 #ifndef _LINUX_P80211NETDEV_H
 #define _LINUX_P80211NETDEV_H
-- 
1.9.1



[PATCH v2 9/9] staging: wlan-ng: fix block comments style in prism2mgmt.h

2016-10-09 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in prism2mgmt.h
Block comments should align the * on each line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/prism2mgmt.h | 122 ++-
 1 file changed, 62 insertions(+), 60 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.h 
b/drivers/staging/wlan-ng/prism2mgmt.h
index 567820f..88b979f 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.h
+++ b/drivers/staging/wlan-ng/prism2mgmt.h
@@ -1,61 +1,61 @@
 /* prism2mgmt.h
-*
-* Declares the mgmt command handler functions
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*
-* This file contains the constants and data structures for interaction
-* with the hfa384x Wireless LAN (WLAN) Media Access Controller (MAC).
-* The hfa384x is a portion of the Harris PRISM(tm) WLAN chipset.
-*
-* [Implementation and usage notes]
-*
-* [References]
-*   CW10 Programmer's Manual v1.5
-*   IEEE 802.11 D10.0
-*
-*
-*/
+ *
+ * Declares the mgmt command handler functions
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ *
+ * This file contains the constants and data structures for interaction
+ * with the hfa384x Wireless LAN (WLAN) Media Access Controller 

[PATCH v2 3/9] staging: wlan-ng: fix block comments style in p80211ioctl.h

2016-10-09 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211ioctl.h
Block comments should align the * on each line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211ioctl.h | 120 +-
 1 file changed, 60 insertions(+), 60 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211ioctl.h 
b/drivers/staging/wlan-ng/p80211ioctl.h
index 06c5e366..ab6067e 100644
--- a/drivers/staging/wlan-ng/p80211ioctl.h
+++ b/drivers/staging/wlan-ng/p80211ioctl.h
@@ -1,64 +1,64 @@
 /* p80211ioctl.h
-*
-* Declares constants and types for the p80211 ioctls
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*
-*  While this file is called 'ioctl' is purpose goes a little beyond
-*  that.  This file defines the types and contants used to implement
-*  the p80211 request/confirm/indicate interfaces on Linux.  The
-*  request/confirm interface is, in fact, normally implemented as an
-*  ioctl.  The indicate interface on the other hand, is implemented
-*  using the Linux 'netlink' interface.
-*
-*  The reason I say that request/confirm is 'normally' implemented
-*  via ioctl is that we're reserving the right to be able to send
-*  request commands via the netlink interface.  This will be necessary
-*  if we ever need to send request messages when there aren't any
-*  wlan network devices present (i.e. sending a message that only p80211
-*  cares about.
-* 
-*/
+ *
+ * Declares constants and types for the p80211 ioctls
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com

[PATCH v2 5/9] staging: wlan-ng: fix block comments style in p80211mgmt.h

2016-10-09 Thread Sergio Paracuellos
 This patch fixes the following checkpatch.pl warning in p80211mgmt.h:
 Block comments should align the * on each line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211mgmt.h | 194 +--
 1 file changed, 97 insertions(+), 97 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211mgmt.h 
b/drivers/staging/wlan-ng/p80211mgmt.h
index 3dd066a..653950f 100644
--- a/drivers/staging/wlan-ng/p80211mgmt.h
+++ b/drivers/staging/wlan-ng/p80211mgmt.h
@@ -1,101 +1,101 @@
 /* p80211mgmt.h
-*
-* Macros, types, and functions to handle 802.11 mgmt frames
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*
-* This file declares the constants and types used in the interface
-* between a wlan driver and the user mode utilities.
-*
-* Notes:
-*  - Constant values are always in HOST byte order.  To assign
-*values to multi-byte fields they _must_ be converted to
-*ieee byte order.  To retrieve multi-byte values from incoming
-*frames, they must be converted to host order.
-*
-*  - The len member of the frame structure does NOT!!! include
-*the MAC CRC.  Therefore, the len field on rx'd frames should
-*have 4 subtracted from it.
-*
-* All functions declared here are implemented in p80211.c
-*
-* The types, macros, and functions defined here are primarily
-* used for encoding and decoding management frames.  They are
-* designed to follow these patterns of use:
-*
-* DECODE:
-* 1) a frame of length len is received into buffer b
-* 2) using the hdr structure and macros, we determine the type
-* 3) an appropriate mgmt frame structure, mf, is allocated and zeroed
-* 4) mf.hdr = b
-*mf.buf = b
-*mf.len = len
-* 5) call mgmt_decode( mf )
-* 6) the frame field pointers in mf are now set.  Note that any
-*multi-byte frame field values accessed using the frame field
-*pointers are in ieee byte order and will have to be converted
-*to host order.
-*
-* ENCODE:
-* 1) Library client allocates buffer space for maximum length
-*frame of the desired type
-* 2) Library client allocates a mgmt frame structure, called mf,
-*of the desired type
-* 3) Set the following:
-*mf.type = 
-*mf.buf = 
-* 4) call mgmt_encode( mf )
-* 5) all of the fixed field pointers and fixed length information element
-*pointers in mf are now set to their respective locations in the
-*allocated space (fortunately, all variable length information elements
-*fall at the end of their respective frames).
-* 5a) The length field is set to include the last of the fixed and fixed
-* length fields.  It may have to be updated for optional or variable
-*  length information elements.
-* 6) Optional and variable length information elements are special cases
-*and must be handled individually by the client code.
-* 
-*/
+ *
+ * Macros, types, and functions to handle 802.11 mgmt frames
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The 

[PATCH v2 4/9] staging: wlan-ng: fix block comments style in p80211metadef.h

2016-10-09 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211metadef.h
Block comments should align the * on each line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211metadef.h | 88 -
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211metadef.h 
b/drivers/staging/wlan-ng/p80211metadef.h
index b0d3567..ea3d9ce 100644
--- a/drivers/staging/wlan-ng/p80211metadef.h
+++ b/drivers/staging/wlan-ng/p80211metadef.h
@@ -1,48 +1,48 @@
 /* This file is GENERATED AUTOMATICALLY.  DO NOT EDIT OR MODIFY.
-* 
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*/
+ * 
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ */
 
 #ifndef _P80211MKMETADEF_H
 #define _P80211MKMETADEF_H
-- 
1.9.1



[PATCH v2 2/9] staging: wlan-ng: fix block comments style in p80211hdr.h

2016-10-09 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211hdr.h:
Block comments should align the * on each line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211hdr.h | 114 ++--
 1 file changed, 57 insertions(+), 57 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211hdr.h 
b/drivers/staging/wlan-ng/p80211hdr.h
index 79d9b20..c9b7337 100644
--- a/drivers/staging/wlan-ng/p80211hdr.h
+++ b/drivers/staging/wlan-ng/p80211hdr.h
@@ -1,61 +1,61 @@
 /* p80211hdr.h
-*
-* Macros, types, and functions for handling 802.11 MAC headers
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*
-* This file declares the constants and types used in the interface
-* between a wlan driver and the user mode utilities.
-*
-* Note:
-*  - Constant values are always in HOST byte order.  To assign
-*values to multi-byte fields they _must_ be converted to
-*ieee byte order.  To retrieve multi-byte values from incoming
-*frames, they must be converted to host order.
-*
-* All functions declared here are implemented in p80211.c
-* 
-*/
+ *
+ * Macros, types, and functions for handling 802.11 MAC headers
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ *
+ * 

[PATCH v2 6/9] staging: wlan-ng: fix block comments style in p80211msg.h

2016-10-09 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211msg.h
Block comments should align the * on each line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211msg.h | 90 ++---
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211msg.h 
b/drivers/staging/wlan-ng/p80211msg.h
index 43d2f97..40c5cf5 100644
--- a/drivers/staging/wlan-ng/p80211msg.h
+++ b/drivers/staging/wlan-ng/p80211msg.h
@@ -1,49 +1,49 @@
 /* p80211msg.h
-*
-* Macros, constants, types, and funcs for req and ind messages
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*/
+ *
+ * Macros, constants, types, and funcs for req and ind messages
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ */
 
 #ifndef _P80211MSG_H
 #define _P80211MSG_H
-- 
1.9.1



Re: [PATCH] mm/vmalloc: reduce the number of lazy_max_pages to reduce latency

2016-10-09 Thread Chris Wilson
On Sat, Oct 08, 2016 at 08:43:51PM -0700, Joel Fernandes wrote:
> On Thu, Sep 29, 2016 at 1:18 AM, Chris Wilson  
> wrote:
> > On Thu, Sep 29, 2016 at 03:34:11PM +0800, Jisheng Zhang wrote:
> >> On Marvell berlin arm64 platforms, I see the preemptoff tracer report
> >> a max 26543 us latency at __purge_vmap_area_lazy, this latency is an
> >> awfully bad for STB. And the ftrace log also shows __free_vmap_area
> >> contributes most latency now. I noticed that Joel mentioned the same
> >> issue[1] on x86 platform and gave two solutions, but it seems no patch
> >> is sent out for this purpose.
> >>
> >> This patch adopts Joel's first solution, but I use 16MB per core
> >> rather than 8MB per core for the number of lazy_max_pages. After this
> >> patch, the preemptoff tracer reports a max 6455us latency, reduced to
> >> 1/4 of original result.
> >
> > My understanding is that
> >
> > diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> > index 91f44e78c516..3f7c6d6969ac 100644
> > --- a/mm/vmalloc.c
> > +++ b/mm/vmalloc.c
> > @@ -626,7 +626,6 @@ void set_iounmap_nonlazy(void)
> >  static void __purge_vmap_area_lazy(unsigned long *start, unsigned long 
> > *end,
> > int sync, int force_flush)
> >  {
> > -   static DEFINE_SPINLOCK(purge_lock);
> > struct llist_node *valist;
> > struct vmap_area *va;
> > struct vmap_area *n_va;
> > @@ -637,12 +636,6 @@ static void __purge_vmap_area_lazy(unsigned long 
> > *start, unsigned long *end,
> >  * should not expect such behaviour. This just simplifies locking 
> > for
> >  * the case that isn't actually used at the moment anyway.
> >  */
> > -   if (!sync && !force_flush) {
> > -   if (!spin_trylock(_lock))
> > -   return;
> > -   } else
> > -   spin_lock(_lock);
> > -
> > if (sync)
> > purge_fragmented_blocks_allcpus();
> >
> > @@ -667,7 +660,6 @@ static void __purge_vmap_area_lazy(unsigned long 
> > *start, unsigned long *end,
> > __free_vmap_area(va);
> > spin_unlock(_area_lock);
> > }
> > -   spin_unlock(_lock);
> >  }
> >
> [..]
> > should now be safe. That should significantly reduce the preempt-disabled
> > section, I think.
> 
> I believe that the purge_lock is supposed to prevent concurrent purges
> from happening.
> 
> For the case where if you have another concurrent overflow happen in
> alloc_vmap_area() between the spin_unlock and purge :
> 
> spin_unlock(_area_lock);
> if (!purged)
>purge_vmap_area_lazy();
> 
> Then the 2 purges would happen at the same time and could subtract
> vmap_lazy_nr twice.

That itself is not the problem, as each instance of
__purge_vmap_area_lazy() operates on its own freelist, and so there will
be no double accounting.

However, removing the lock removes the serialisation which does mean
that alloc_vmap_area() will not block on another thread conducting the
purge, and so it will try to reallocate before that is complete and the
free area made available. It also means that we are doing the
atomic_sub(vmap_lazy_nr) too early.

That supports making the outer lock a mutex as you suggested. But I think
cond_resched_lock() is better for the vmap_area_lock (just because it
turns out to be an expensive loop and we may want the reschedule).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


[PATCH 1/2] host: ehci-exynos: Convert to use the SET_SYSTEM_SLEEP_PM_OPS

2016-10-09 Thread Anand Moon
Move the ehci-exynos system PM callbacks within #ifdef CONFIG_PM_SLEEP
as to avoid them being build when not used. This also allows us to use the
SET_SYSTEM_SLEEP_PM_OPS macro which simplifies the code.

Signed-off-by: Anand Moon 
---
 drivers/usb/host/ehci-exynos.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
index 42e5b66..1899900 100644
--- a/drivers/usb/host/ehci-exynos.c
+++ b/drivers/usb/host/ehci-exynos.c
@@ -251,7 +251,7 @@ static int exynos_ehci_remove(struct platform_device *pdev)
return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int exynos_ehci_suspend(struct device *dev)
 {
struct usb_hcd *hcd = dev_get_drvdata(dev);
@@ -292,15 +292,13 @@ static int exynos_ehci_resume(struct device *dev)
ehci_resume(hcd, false);
return 0;
 }
-#else
-#define exynos_ehci_suspendNULL
-#define exynos_ehci_resume NULL
-#endif
 
 static const struct dev_pm_ops exynos_ehci_pm_ops = {
-   .suspend= exynos_ehci_suspend,
-   .resume = exynos_ehci_resume,
+   SET_SYSTEM_SLEEP_PM_OPS(exynos_ehci_suspend, exynos_ehci_resume)
 };
+#endif /* CONFIG_PM_SLEEP */
+
+#define DEV_PM_OPS IS_ENABLED(CONFIG_PM_SLEEP) ? _ehci_pm_ops : NULL
 
 #ifdef CONFIG_OF
 static const struct of_device_id exynos_ehci_match[] = {
@@ -317,7 +315,7 @@ static struct platform_driver exynos_ehci_driver = {
.shutdown   = usb_hcd_platform_shutdown,
.driver = {
.name   = "exynos-ehci",
-   .pm = _ehci_pm_ops,
+   .pm = DEV_PM_OPS,
.of_match_table = of_match_ptr(exynos_ehci_match),
}
 };
-- 
2.7.4



[PATCH] net: dsa: slave: use new api ethtool_{get|set}_link_ksettings

2016-10-09 Thread Philippe Reynes
The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

Signed-off-by: Philippe Reynes 
---
 net/dsa/slave.c |   14 --
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 6b1282c..68714a5 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -641,7 +641,8 @@ static netdev_tx_t dsa_slave_xmit(struct sk_buff *skb, 
struct net_device *dev)
 
 /* ethtool operations ***/
 static int
-dsa_slave_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+dsa_slave_get_link_ksettings(struct net_device *dev,
+struct ethtool_link_ksettings *cmd)
 {
struct dsa_slave_priv *p = netdev_priv(dev);
int err;
@@ -650,19 +651,20 @@ dsa_slave_get_settings(struct net_device *dev, struct 
ethtool_cmd *cmd)
if (p->phy != NULL) {
err = phy_read_status(p->phy);
if (err == 0)
-   err = phy_ethtool_gset(p->phy, cmd);
+   err = phy_ethtool_ksettings_get(p->phy, cmd);
}
 
return err;
 }
 
 static int
-dsa_slave_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+dsa_slave_set_link_ksettings(struct net_device *dev,
+const struct ethtool_link_ksettings *cmd)
 {
struct dsa_slave_priv *p = netdev_priv(dev);
 
if (p->phy != NULL)
-   return phy_ethtool_sset(p->phy, cmd);
+   return phy_ethtool_ksettings_set(p->phy, cmd);
 
return -EOPNOTSUPP;
 }
@@ -990,8 +992,6 @@ void dsa_cpu_port_ethtool_init(struct ethtool_ops *ops)
 }
 
 static const struct ethtool_ops dsa_slave_ethtool_ops = {
-   .get_settings   = dsa_slave_get_settings,
-   .set_settings   = dsa_slave_set_settings,
.get_drvinfo= dsa_slave_get_drvinfo,
.get_regs_len   = dsa_slave_get_regs_len,
.get_regs   = dsa_slave_get_regs,
@@ -1007,6 +1007,8 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = {
.get_wol= dsa_slave_get_wol,
.set_eee= dsa_slave_set_eee,
.get_eee= dsa_slave_get_eee,
+   .get_link_ksettings = dsa_slave_get_link_ksettings,
+   .set_link_ksettings = dsa_slave_set_link_ksettings,
 };
 
 static const struct net_device_ops dsa_slave_netdev_ops = {
-- 
1.7.4.4



Re: [PATCH 1/8] staging: rts5208: Fix CamelCase found by checkpatch

2016-10-09 Thread Greg KH
On Mon, Oct 03, 2016 at 11:16:22PM +, Wayne Porter wrote:
> Convert CamelCase to recommended style.
> 
> Signed-off-by: Wayne Porter 
> ---
>  drivers/staging/rts5208/xd.c | 8 
>  drivers/staging/rts5208/xd.h | 8 
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c
> index 1de02bb..1fab4ee 100644
> --- a/drivers/staging/rts5208/xd.c
> +++ b/drivers/staging/rts5208/xd.c
> @@ -693,13 +693,13 @@ static int reset_xd(struct rtsx_chip *chip)
>   xd_card->zone_cnt = 32;
>   xd_card->capacity = 1024000;
>   break;
> - case xD_1G_X8_512:

This is probably a spec-specific define, so I wouldn't worry about the
checkpatch.pl warning for this, just leave it as-is please.

thanks,

greg k-h


Re: [PATCH v2 2/4] ACPI / gpio: Add support for naming GPIOs

2016-10-09 Thread Mika Westerberg
On Fri, Oct 07, 2016 at 08:05:14PM +0300, Andy Shevchenko wrote:
> On Thu, Sep 29, 2016 at 4:39 PM, Mika Westerberg
>  wrote:
> > DT has property 'gpio-line-names' to name GPIO lines the controller has if
> > present. Use this very same property in ACPI as well to provide nice names
> > for the GPIOS.
> 
> One nit below.
> 
> > @@ -835,6 +875,9 @@ void acpi_gpiochip_add(struct gpio_chip *chip)
> > return;
> > }
> >
> > +   if (!chip->names)
> > +   acpi_gpiochip_set_names(acpi_gpio);
> > +
> 
> I'm okay with this, though wouldn't be better to call it
> unconditionally like it's done for below call and move check inside?

DT does it like this. I can move the check inside the function as well.

> 
> > acpi_gpiochip_request_regions(acpi_gpio);
> > acpi_walk_dep_device_list(handle);
> >  }
> 
> -- 
> With Best Regards,
> Andy Shevchenko


Re: parisc crash on boot with 4.8+git

2016-10-09 Thread John David Anglin
On 2016-10-09, at 5:03 AM, Meelis Roos wrote:

>>> Linux version 4.8.0-11288-gb66484c (mroos@rp3410) (gcc version 5.4.0 
>>> (Gentoo 5.4.0 p1.0) ) #81 Sat Oct 8 20:40:24 EEST 2016
>>> unwind_init: start = 0x4076e980, end = 0x407a7060, entries = 14446
>>> The 64-bit Kernel has started...
>>> Kernel default page size is 4 KB. Huge pages enabled with 1 MB physical and 
>>> 2 MB virtual size.

The first thing I would suspect is the enabling of huge pages.

Dave
--
John David Anglin   dave.ang...@bell.net





Re: [PATCH 35/41] staging: lustre: hsm: Use file lease to implement migration

2016-10-09 Thread Greg Kroah-Hartman
On Sun, Oct 02, 2016 at 10:28:31PM -0400, James Simmons wrote:
> From: Henri Doreau 
> 
> Implement non-blocking migration based on exclusive open instead of
> group lock. Implemented exclusive close operation to atomically put
> a lease, swap two layouts and close a file. This allows race-free
> migrations.
> 
> Make the caller responsible for retrying on failure (EBUSY, EAGAIN)
> in non-blocking mode.
> 
> In blocking mode, allow applications to trigger layout swaps using a
> grouplock they already own, to prevent race conditions between the
> actual data copy and the layout swap. Updated lfs accordingly. File
> leases are also taken in blocking mode, so that lfs migrate can issue
> a warning if an application attempts to open a file that is being
> migrated and gets blocked.
> 
> Timestamps (atime/mtime) are set from userland, after the layout swap
> is performed, to prevent conflicts with the grouplock.
> 
> lli_trunc_sem is taken/released in the vvp_io layer, under the DLM
> lock. This re-ordering fixes the original issue between truncate and
> migrate.
> 
> Signed-off-by: Henri Doreau 
> Signed-off-by: Jinshan Xiong 
> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4840
> Reviewed-on: http://review.whamcloud.com/10013
> Reviewed-by: John L. Hammond 
> Reviewed-by: frank zago 
> Reviewed-by: Oleg Drokin 
> Signed-off-by: James Simmons 
> ---
>  .../lustre/lustre/include/lustre/lustre_idl.h  |5 +-
>  .../lustre/lustre/include/lustre/lustre_user.h |1 +
>  .../lustre/lustre/include/lustre_req_layout.h  |2 +-
>  drivers/staging/lustre/lustre/llite/file.c |  231 
> 
>  drivers/staging/lustre/lustre/llite/llite_lib.c|4 -
>  drivers/staging/lustre/lustre/llite/vvp_io.c   |   82 +---
>  drivers/staging/lustre/lustre/mdc/mdc_lib.c|   34 ++--
>  drivers/staging/lustre/lustre/mdc/mdc_request.c|7 +-
>  drivers/staging/lustre/lustre/ptlrpc/layout.c  |   10 +-
>  9 files changed, 235 insertions(+), 141 deletions(-)

This patch also failed to apply :(


Re: [PATCH] Staging: i4l: act2000: Fixed warning "use pr_* instead of printk"

2016-10-09 Thread Greg KH
On Sun, Oct 09, 2016 at 07:58:00PM +0530, Harman Kalra wrote:
> This patch replaces calls to the "printk" with  appropriate "pr_*"
> function thus addressing the following warning generated by the
> checkpatch script:
> 
> Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then
>   dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...
> 
> Signed-off-by: Harman Kalra 
> ---
>  drivers/staging/i4l/act2000/act2000_isa.c |   23 ++-
>  1 file changed, 10 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/i4l/act2000/act2000_isa.c 
> b/drivers/staging/i4l/act2000/act2000_isa.c
> index ad7a039..1a91b52 100644
> --- a/drivers/staging/i4l/act2000/act2000_isa.c
> +++ b/drivers/staging/i4l/act2000/act2000_isa.c
> @@ -78,10 +78,10 @@
>   if (istatus & ISA_ISR_ERR) {
>   /* Error Interrupt */
>   istatus &= ISA_ISR_ERR_MASK;
> - printk(KERN_WARNING "act2000: errIRQ\n");
> + pr_warn("act2000: errIRQ\n");
>   }
>   if (istatus)
> - printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", card->irq, 
> istatus);
> + pr_warn("act2000: ?IRQ %d %02x\n", card->irq, istatus);

shouldn't that be pr_debug()?


Re: [PATCH] Staging: i4l: act2000: Fixed warning "use pr_* instead of printk"

2016-10-09 Thread Greg KH
On Sun, Oct 09, 2016 at 08:29:11PM +0530, Harman Kalra wrote:
> This patch replaces calls to the "printk" with  appropriate "pr_*"
> function thus addressing the following warning generated by the
> checkpatch script:
> 
> Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then
> dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...:w
> 
> Signed-off-by: Harman Kalra 
> ---
>  drivers/staging/i4l/act2000/act2000_isa.c |   25 +++--
>  1 file changed, 11 insertions(+), 14 deletions(-)

This is a new version of the patch, so you need to version it, see the
file, Documentation/SubmittingPatches for all of the details on how to
do that properly.

thanks,

greg k-h


ppc64 qemu test failure since commit f9aa67142 ("powerpc/64s: Consolidate Alignment 0x600 interrupt")

2016-10-09 Thread Guenter Roeck
Nicholas,

some of my qemu tests for ppc64 started failing on mainline (and -next).
You can find a test log at
http://kerneltests.org/builders/qemu-ppc64-master/builds/580/steps/qemubuildcommand/logs/stdio

The scripts to run the test are available at
https://github.com/groeck/linux-build-test/tree/master/rootfs/ppc64

Bisect points to commit f9aa67142ef26 ("powerpc/64s: Consolidate Alignment 0x600
interrupt"). Bisect log is attached.

Since I don't have the means to run the code on a real system, I have no idea
if the problem is caused by qemu or by the code. It is interesting, though, that
only the 'mac99' tests are affected.

Please let me know if there is anything I can do to help tracking down the
problem.

Thanks,
Guenter

---
# bad: [b66484cd74706fa8681d051840fe4b18a3da40ff] Merge branch 'akpm' (patches 
from Andrew)
# good: [87840a2b7e048018d18d60bdac5c09224de85370] Merge branch 'i2c/for-4.9' 
of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
git bisect start 'HEAD' '87840a2'
# bad: [6afd563d4bbc1924b7de9e053324c007e0d36476] Merge tag 'armsoc-drivers' of 
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
git bisect bad 6afd563d4bbc1924b7de9e053324c007e0d36476
# bad: [07021b43597f506cc525d139ed1a94e79cf184f2] Merge tag 'powerpc-4.9-1' of 
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
git bisect bad 07021b43597f506cc525d139ed1a94e79cf184f2
# bad: [e909fb83d39292679118761426d7784715ad79ad] powerpc: Never giveup a 
reclaimed thread when enabling kernel {fp, altivec, vsx}
git bisect bad e909fb83d39292679118761426d7784715ad79ad
# good: [313483dd72289ff0b7dff4207032d94dbce39cf6] powerpc/powernv: Unfreeze PE 
on allocation
git bisect good 313483dd72289ff0b7dff4207032d94dbce39cf6
# bad: [792cbddd628282027f99f5499f2899613e07f8f9] powerpc/64s: Consolidate VSX 
Unavailable 0xf40 interrupt
git bisect bad 792cbddd628282027f99f5499f2899613e07f8f9
# bad: [11e87346b9b885f3b088efb6afda604e91233026] powerpc/64s: Consolidate 
Program 0x700 interrupt
git bisect bad 11e87346b9b885f3b088efb6afda604e91233026
# good: [57f266497d81e16141bd2c9009e91dad34ea5f70] powerpc: Use gas sections 
for arranging exception vectors
git bisect good 57f266497d81e16141bd2c9009e91dad34ea5f70
# good: [2b9af6e40e477fbfe39777dda9a609ae359d3dd8] powerpc/64s: Consolidate 
Data Segment 0x380 interrupt
git bisect good 2b9af6e40e477fbfe39777dda9a609ae359d3dd8
# good: [8d04631ad7cbbe27d058ae79e3d41009a8e006d1] powerpc/64s: Consolidate 
Instruction Segment 0x480 interrupt
git bisect good 8d04631ad7cbbe27d058ae79e3d41009a8e006d1
# bad: [f9aa67142ef2697990d1f36aa3d59320820bcfae] powerpc/64s: Consolidate 
Alignment 0x600 interrupt
git bisect bad f9aa67142ef2697990d1f36aa3d59320820bcfae
# good: [c138e58890dd5128a5706ed30c5deab6736320d6] powerpc/64s: Consolidate 
External 0x500 interrupt
git bisect good c138e58890dd5128a5706ed30c5deab6736320d6
# first bad commit: [f9aa67142ef2697990d1f36aa3d59320820bcfae] powerpc/64s: 
Consolidate Alignment 0x600 interrupt


Re: [PATCH 14/15] staging: wlan-ng: fix line style warnings in prism2sta.c

2016-10-09 Thread Greg KH
On Sun, Oct 09, 2016 at 05:10:31PM +0200, Sergio Paracuellos wrote:
> This patch fix the following checkpatch.pl warnings in prism2sta.c:
> WARNING: line over 80 characters
> 
> Signed-off-by: Sergio Paracuellos 
> ---
>  drivers/staging/wlan-ng/prism2sta.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

This patch doesn't apply to my tree :(



Re: [PATCH 14/15] staging: wlan-ng: fix line style warnings in prism2sta.c

2016-10-09 Thread Sergio Paracuellos

This warnings seems to be fixed in the new tree, so I don't resend anything.

El 2016年10月09日 a las 17:23, Greg KH escribió:

On Sun, Oct 09, 2016 at 05:10:31PM +0200, Sergio Paracuellos wrote:

This patch fix the following checkpatch.pl warnings in prism2sta.c:
WARNING: line over 80 characters

Signed-off-by: Sergio Paracuellos 
---
  drivers/staging/wlan-ng/prism2sta.c | 9 ++---
  1 file changed, 6 insertions(+), 3 deletions(-)


This patch doesn't apply to my tree :(



Re: [PATCH V2 2/2] fs/super.c: don't fool lockdep in freeze_super() and thaw_super() paths

2016-10-09 Thread Oleg Nesterov
On 10/08, Dave Chinner wrote:
>
> On Fri, Oct 07, 2016 at 07:15:18PM +0200, Oleg Nesterov wrote:
> > > >
> > > > --- x/fs/xfs/xfs_trans.c
> > > > +++ x/fs/xfs/xfs_trans.c
> > > > @@ -245,7 +245,8 @@ xfs_trans_alloc(
> > > > atomic_inc(>m_active_trans);
> > > >
> > > > tp = kmem_zone_zalloc(xfs_trans_zone,
> > > > -   (flags & XFS_TRANS_NOFS) ? KM_NOFS : KM_SLEEP);
> > > > +   (flags & (XFS_TRANS_NOFS | XFS_TRANS_NO_WRITECOUNT))
> > > > +   ? KM_NOFS : KM_SLEEP);
> > > > tp->t_magic = XFS_TRANS_HEADER_MAGIC;
> > > > tp->t_flags = flags;
> > > > tp->t_mountp = mp;
> > >
> > > Brief examination says caller should set XFS_TRANS_NOFS, not change
> > > the implementation to make XFS_TRANS_NO_WRITECOUNT flag to also mean
> > > XFS_TRANS_NOFS.
> >
> > I didn't mean the change above can fix the problem, and I don't really
> > understand your suggestion.
>
> xfs_syncsb() does:
>
>   tp = xfs_trans_alloc(... , XFS_TRANS_NO_WRITECOUNT, );
>
> but it's running in a GFP_NOFS context when a freeze is being
> finalised. SO, rather than changing what XFS_TRANS_NO_WRITECOUNT
> does in xfs_trans_alloc(), we should tell it to do a GFP_NOFS
> allocation. i.e.
>
>   tp = xfs_trans_alloc(... , XFS_TRANS_NOFS | XFS_TRANS_NO_WRITECOUNT, 
> );

Ah. This is clear but I am not sure it is enough,

> > Obviously any GFP_FS allocation in xfs_fs_freeze()
> > paths will trigger the same warning.
>
> Of which there should be none except for that xfs_trans_alloc()
> call.

Really? Again, I can be easily wrong, but when I look at xfs_freeze_fs()
paths I can see

xfs_fs_freeze()->xfs_quiesce_attr()->xfs_log_quiesce()->xfs_log_unmount_write()
->xfs_log_reserve()->xlog_ticket_alloc(KM_SLEEP)

at least. But I can test the change above, perhaps this call chain is
not possible...

> > I added this hack
> >
> > --- a/fs/xfs/xfs_super.c
> > +++ b/fs/xfs/xfs_super.c
> > @@ -1333,10 +1333,15 @@ xfs_fs_freeze(
> > struct super_block  *sb)
> >  {
> > struct xfs_mount*mp = XFS_M(sb);
> > +   int ret;
> >
> > +   current->flags |= PF_FSTRANS; // tell kmem_flags_convert() to 
> > remove GFP_FS
> > xfs_save_resvblks(mp);
> > xfs_quiesce_attr(mp);
> > -   return xfs_sync_sb(mp, true);
> > +   ret = xfs_sync_sb(mp, true);
> > +   current->flags &= ~PF_FSTRANS;
> > +
> > +   return ret;
> >  }
>
> /me shudders

don't worry, this debugging change won't escape my testing machine!

> > just for testing purposes and after that I got another warning below. I 
> > didn't
> > read it carefully yet, but _at first glance_ it looks like the lock 
> > inversion
> > uncovered by 2/2, although I can be easily wrong. 
> > cancel_delayed_work_sync(l_work)
> > under sb_internal can hang if xfs_log_worker() waits for this rwsem?`
>
> Actually: I *can't read it*. I've got no fucking clue what lockdep
> is trying to say here. This /looks/ like a lockdep is getting
> confused

I can almost never understand what lockdep tells me, it is too clever for me.
But this time I think it is right.

Suppose that freeze_super() races with xfs_log_worker() callback.

freeze_super() takes sb_internal lock and xfs_log_quiesce() calls
cancel_delayed_work_sync(l_work). This will sleep until xfs_log_worker()
finishes.

xfs_log_worker() does a __GFP_FS alloc, triggers reclaim, and blocks
on the same sb_internal lock. Say, in xfs_do_writepage()->xfs_trans_alloc()
path.

Deadlock. The worker thread can't take sb_internal hold by freeze_super(),
cancel_delayed_work_sync() will sleep forever because xfs_log_worker()
can't finish.

So xfs_log_worker() should run in a GFP_NOFS context too. And perhaps
the change above in xfs_trans_alloc() or in xfs_sync_sb() can help if
it doesn't do other allocatiions, I dunno.

Oleg.



Re: [PATCH 1/2] host: ehci-exynos: Convert to use the SET_SYSTEM_SLEEP_PM_OPS

2016-10-09 Thread Krzysztof Kozlowski
On Sun, Oct 09, 2016 at 02:34:14PM +, Anand Moon wrote:
> Move the ehci-exynos system PM callbacks within #ifdef CONFIG_PM_SLEEP
> as to avoid them being build when not used. This also allows us to use the
> SET_SYSTEM_SLEEP_PM_OPS macro which simplifies the code.
> 
> Signed-off-by: Anand Moon 
> ---
>  drivers/usb/host/ehci-exynos.c | 14 ++
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
> index 42e5b66..1899900 100644
> --- a/drivers/usb/host/ehci-exynos.c
> +++ b/drivers/usb/host/ehci-exynos.c
> @@ -251,7 +251,7 @@ static int exynos_ehci_remove(struct platform_device 
> *pdev)
>   return 0;
>  }
>  
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP

Does not look like an equivalent change. How will it behave in a config
with !SUSPEND && !HIBERNATE && PM?

Best regards,
Krzysztof

>  static int exynos_ehci_suspend(struct device *dev)
>  {
>   struct usb_hcd *hcd = dev_get_drvdata(dev);
> @@ -292,15 +292,13 @@ static int exynos_ehci_resume(struct device *dev)
>   ehci_resume(hcd, false);
>   return 0;
>  }
> -#else
> -#define exynos_ehci_suspend  NULL
> -#define exynos_ehci_resume   NULL
> -#endif
>  
>  static const struct dev_pm_ops exynos_ehci_pm_ops = {
> - .suspend= exynos_ehci_suspend,
> - .resume = exynos_ehci_resume,
> + SET_SYSTEM_SLEEP_PM_OPS(exynos_ehci_suspend, exynos_ehci_resume)
>  };
> +#endif /* CONFIG_PM_SLEEP */
> +
> +#define DEV_PM_OPS IS_ENABLED(CONFIG_PM_SLEEP) ? _ehci_pm_ops : NULL
>  
>  #ifdef CONFIG_OF
>  static const struct of_device_id exynos_ehci_match[] = {
> @@ -317,7 +315,7 @@ static struct platform_driver exynos_ehci_driver = {
>   .shutdown   = usb_hcd_platform_shutdown,
>   .driver = {
>   .name   = "exynos-ehci",
> - .pm = _ehci_pm_ops,
> + .pm = DEV_PM_OPS,
>   .of_match_table = of_match_ptr(exynos_ehci_match),
>   }
>  };
> -- 
> 2.7.4
> 


Re: [PATCH 1/2] host: ehci-exynos: Convert to use the SET_SYSTEM_SLEEP_PM_OPS

2016-10-09 Thread Anand Moon
Hi Krzysztof,

On 9 October 2016 at 22:04, Krzysztof Kozlowski  wrote:
> On Sun, Oct 09, 2016 at 02:34:14PM +, Anand Moon wrote:
>> Move the ehci-exynos system PM callbacks within #ifdef CONFIG_PM_SLEEP
>> as to avoid them being build when not used. This also allows us to use the
>> SET_SYSTEM_SLEEP_PM_OPS macro which simplifies the code.
>>
>> Signed-off-by: Anand Moon 
>> ---
>>  drivers/usb/host/ehci-exynos.c | 14 ++
>>  1 file changed, 6 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
>> index 42e5b66..1899900 100644
>> --- a/drivers/usb/host/ehci-exynos.c
>> +++ b/drivers/usb/host/ehci-exynos.c
>> @@ -251,7 +251,7 @@ static int exynos_ehci_remove(struct platform_device 
>> *pdev)
>>   return 0;
>>  }
>>
>> -#ifdef CONFIG_PM
>> +#ifdef CONFIG_PM_SLEEP
>
> Does not look like an equivalent change. How will it behave in a config
> with !SUSPEND && !HIBERNATE && PM?
>

[snip]

I just wanted to update suspend and resume callback to use
SET_SYSTEM_SLEEP_PM_OPS
as they are define under CONFIG_PM_SLEEP so I update above to avoid
compilation warning/error.

http://lxr.free-electrons.com/source/include/linux/pm.h#L321

-Best Regards
Anand Moon


Re: [PATCH] pinctrl: intel: Configure GPIO chip IRQ as wakeup interrupts

2016-10-09 Thread Andy Shevchenko
On Sun, Oct 9, 2016 at 5:59 PM, Mika Westerberg
 wrote:
> On Fri, Oct 07, 2016 at 10:40:42PM +0300, Andy Shevchenko wrote:
>> On Fri, Oct 7, 2016 at 9:17 PM, Bacchewar, Nilesh
>>  wrote:
>> > Here, Its marking  GPIO controller IRQ line as wake capable not GPIO lines.
>>
>> AFAIU this is called per (GPIO) pin which is IRQ enabled.
>>
>> Imagine a case when you have more than one such pin.
>>
>> 1. Set IRQ wake for pin 1
>> 2. Set IRQ wake for pin 2 (assume that is pin under the question)
>> 3. Unset IRQ wake for pin 1 (for some reason)
>> 4. Global pinctrl IRQ wake is unset. Resulting same issue as before.
>>
>> What did I miss above?
>
> enable/disable_irq_wake() include reference count.

Good to know. Thanks!

-- 
With Best Regards,
Andy Shevchenko


[PATCH] ahci: qoriq: added ls1046a platform support

2016-10-09 Thread yuantian.tang
From: Tang Yuantian 

Ls1046a is a new introduced soc which supports ATA3.0.

Signed-off-by: Tang Yuantian 
---
 drivers/ata/ahci_qoriq.c | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c
index 1eba8df..9884c8c 100644
--- a/drivers/ata/ahci_qoriq.c
+++ b/drivers/ata/ahci_qoriq.c
@@ -46,11 +46,13 @@
 #define LS1021A_AXICC_ADDR 0xC0
 
 #define SATA_ECC_DISABLE   0x0002
+#define LS1046A_SATA_ECC_DIS   0x8000
 
 enum ahci_qoriq_type {
AHCI_LS1021A,
AHCI_LS1043A,
AHCI_LS2080A,
+   AHCI_LS1046A,
 };
 
 struct ahci_qoriq_priv {
@@ -63,6 +65,7 @@ static const struct of_device_id ahci_qoriq_of_match[] = {
{ .compatible = "fsl,ls1021a-ahci", .data = (void *)AHCI_LS1021A},
{ .compatible = "fsl,ls1043a-ahci", .data = (void *)AHCI_LS1043A},
{ .compatible = "fsl,ls2080a-ahci", .data = (void *)AHCI_LS2080A},
+   { .compatible = "fsl,ls1046a-ahci", .data = (void *)AHCI_LS1046A},
{},
 };
 MODULE_DEVICE_TABLE(of, ahci_qoriq_of_match);
@@ -175,6 +178,13 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv 
*hpriv)
writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS);
writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC);
break;
+
+   case AHCI_LS1046A:
+   writel(LS1046A_SATA_ECC_DIS, qpriv->ecc_addr);
+   writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1);
+   writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS);
+   writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC);
+   break;
}
 
return 0;
@@ -204,9 +214,9 @@ static int ahci_qoriq_probe(struct platform_device *pdev)
 
qoriq_priv->type = (enum ahci_qoriq_type)of_id->data;
 
-   if (qoriq_priv->type == AHCI_LS1021A) {
-   res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-   "sata-ecc");
+   res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+   "sata-ecc");
+   if (res) {
qoriq_priv->ecc_addr = devm_ioremap_resource(dev, res);
if (IS_ERR(qoriq_priv->ecc_addr))
return PTR_ERR(qoriq_priv->ecc_addr);
-- 
2.1.0.27.g96db324



Re: [PATCH 7/10] mmc: sdhci-xenon: Add support to PHYs of Marvell Xenon SDHC

2016-10-09 Thread Shawn Lin

在 2016/10/8 17:28, Ziji Hu 写道:

Hi Shawn,

On 2016/10/8 10:44, Shawn Lin wrote:

在 2016/10/7 23:22, Gregory CLEMENT 写道:

From: Ziji Hu 

Marvell Xenon eMMC/SD/SDIO Host Controller contains PHY.
Three types of PHYs are supported.

Add support to multiple types of PHYs init and configuration.
Add register definitions of PHYs.

Signed-off-by: Hu Ziji 
Reviewed-by: Gregory CLEMENT 
Signed-off-by: Gregory CLEMENT 
---
 MAINTAINERS|1 +-
 drivers/mmc/host/Makefile  |2 +-
 drivers/mmc/host/sdhci-xenon-phy.c | 1141 +-
 drivers/mmc/host/sdhci-xenon-phy.h |  157 -
 drivers/mmc/host/sdhci-xenon.c |4 +-
 drivers/mmc/host/sdhci-xenon.h |   17 +-
 6 files changed, 1321 insertions(+), 1 deletion(-)
 create mode 100644 drivers/mmc/host/sdhci-xenon-phy.c
 create mode 100644 drivers/mmc/host/sdhci-xenon-phy.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 859420e5dfd3..b5673c2ee5f2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7583,6 +7583,7 @@ M:Ziji Hu 
 L:linux-...@vger.kernel.org
 S:Supported
 F:drivers/mmc/host/sdhci-xenon.*
+F:drivers/mmc/host/sdhci-xenon-phy.*


drivers/mmc/host/sdhci-xenon* shoube enough


 F:Documentation/devicetree/bindings/mmc/marvell,sdhci-xenon.txt

 MATROX FRAMEBUFFER DRIVER
diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
index 75eaf743486c..4f2854556ff7 100644
--- a/drivers/mmc/host/Makefile
+++ b/drivers/mmc/host/Makefile
@@ -82,4 +82,4 @@ ifeq ($(CONFIG_CB710_DEBUG),y)
 endif

 obj-$(CONFIG_MMC_SDHCI_XENON)+= sdhci-xenon-driver.o
-sdhci-xenon-driver-y+= sdhci-xenon.o
+sdhci-xenon-driver-y+= sdhci-xenon.o sdhci-xenon-phy.o
diff --git a/drivers/mmc/host/sdhci-xenon-phy.c 
b/drivers/mmc/host/sdhci-xenon-phy.c
new file mode 100644
index ..4eb8fea1bec9
--- /dev/null
+++ b/drivers/mmc/host/sdhci-xenon-phy.c


Well, it's legit to use phy API and move your phy
operations to PHY subsystem. :)



Actually we tried to put the PHY code into Linux PHY framework.
But it cannot fit in Linux common PHY framework.



Indeed, it seems you need much intercation between the phy and host,
but the phy APIs are not so rich. :)


Our Xenon SDHC PHY register is a part of Xenon SDHC register set.
Besides, during MMC initialization, MMC sequence has to call several PHY 
functions to complete timing setting.
In those PHY setting functions, they have to access SDHC register and know 
current MMC setting, such as bus width, clock frequency and speed mode.
As a result, we have to implement PHY under MMC directory.

Thank you.

Best regards,
Hu Ziji


@@ -0,0 +1,1141 @@
+/*
+ * PHY support for Xenon SDHC
+ *
+ * Copyright (C) 2016 Marvell, All Rights Reserved.
+ *
+ * Author:Hu Ziji 
+ * Date:2016-8-24
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "sdhci.h"
+#include "sdhci-pltfm.h"
+#include "sdhci-xenon.h"
+
+static const char * const phy_types[] = {
+"sdh phy",
+"emmc 5.0 phy",
+"emmc 5.1 phy"
+};
+
+enum phy_type_enum {
+SDH_PHY,
+EMMC_5_0_PHY,
+EMMC_5_1_PHY,
+NR_PHY_TYPES
+};
+
+struct soc_pad_ctrl_table {
+const char *soc;
+void (*set_soc_pad)(struct sdhci_host *host,
+unsigned char signal_voltage);
+};
+
+struct soc_pad_ctrl {
+/* Register address of SOC PHY PAD ctrl */
+void __iomem*reg;
+/* SOC PHY PAD ctrl type */
+enum soc_pad_ctrl_type pad_type;
+/* SOC specific operation to set SOC PHY PAD */
+void (*set_soc_pad)(struct sdhci_host *host,
+unsigned char signal_voltage);
+};
+
+static struct xenon_emmc_phy_regs  xenon_emmc_5_0_phy_regs = {
+.timing_adj= EMMC_5_0_PHY_TIMING_ADJUST,
+.func_ctrl= EMMC_5_0_PHY_FUNC_CONTROL,
+.pad_ctrl= EMMC_5_0_PHY_PAD_CONTROL,
+.pad_ctrl2= EMMC_5_0_PHY_PAD_CONTROL2,
+.dll_ctrl= EMMC_5_0_PHY_DLL_CONTROL,
+.logic_timing_adj = EMMC_5_0_PHY_LOGIC_TIMING_ADJUST,
+.delay_mask= EMMC_5_0_PHY_FIXED_DELAY_MASK,
+.dll_update= DLL_UPDATE_STROBE_5_0,
+};
+
+static struct xenon_emmc_phy_regs  xenon_emmc_5_1_phy_regs = {
+.timing_adj= EMMC_PHY_TIMING_ADJUST,
+.func_ctrl= EMMC_PHY_FUNC_CONTROL,
+.pad_ctrl= EMMC_PHY_PAD_CONTROL,
+.pad_ctrl2= EMMC_PHY_PAD_CONTROL2,
+.dll_ctrl= EMMC_PHY_DLL_CONTROL,
+.logic_timing_adj = EMMC_PHY_LOGIC_TIMING_ADJUST,
+.delay_mask= EMMC_PHY_FIXED_DELAY_MASK,
+.dll_update= DLL_UPDATE,
+};
+
+static int xenon_delay_adj_test(struct mmc_card *card);
+
+/*
+ * eMMC PHY 

Re: [patch] staging: ion: use two separate locks for heaps and clients in ion_device

2016-10-09 Thread Greg KH
On Fri, Oct 07, 2016 at 04:27:49PM +0800, YiPing Xu wrote:
> 
> 
> On 2016/10/5 2:02, Laura Abbott wrote:
> > On 09/30/2016 01:18 AM, Xu YiPing wrote:
> > > ion_alloc may get into slow path to get free page,
> > > the call stack:
> > > 
> > > __alloc_pages_slowpath
> > > ion_page_pool_alloc_pages
> > > alloc_buffer_page
> > > ion_system_heap_allocate
> > > ion_buffer_create  <-- hold ion_device->lock
> > > ion_alloc
> > > 
> > > after that, kernel invokes low-memory killer to kill some apps in
> > > order to free memory in android system. However, sometimes, the
> > > killing is blocked,
> > > the app's call stack:
> > > 
> > > rwsem_down_write_failed
> > > down_write
> > > ion_client_destroy
> > > ion_release
> > > fput
> > > do_signal
> > > 
> > > the killing is blocked because ion_device->lock is held by ion_alloc.
> > > 
> > > ion_alloc hold the lock for accessing the heaps list,
> > > ion_destroy_client hold the lock for accessing the clients list.
> > > 
> > > so, we can use two separate locks for heaps and clients, to avoid the
> > > unnecessary race.
> > > 
> > 
> > I've reviewed this and it looks okay at first pass but I don't want it
> > applied just yet. Ion locking is a bit of a mess and has been added
> 
> yes, and now "debugfs_mutex" and "ion_root_client" is redundant, after
> commit 49d200deaa680501f19a247b1fffb29301e51d2b and
> 9fd4dcece43a53e5a9e65a973df5693702ee6401.

Ok, now dropping this patch from my queue.

thanks,

greg k-h


Re: [PATCH 00/15] staging: wlang-ng: Fix several style issues in several source files.

2016-10-09 Thread Greg KH
On Mon, Oct 03, 2016 at 06:04:00PM +0200, Sergio Paracuellos wrote:
> This patch series fix some of the following checkpatch.pl reported warnings:
> WARNING: line over 80 characters
> WARNING: Block comments should align the * on each line
> WARNING: Block comments use a trailing */ on a separate line
> WARNING: ENOSYS means 'invalid syscall nr' and nothing else
> 
> Sergio Paracuellos (15):
>   staging: wlang-ng: fix line style warnings in hfa384x_usb.c

For all of these, you mispelled the driver name :(

It is "wlan-ng" not "wlang-ng" :(

Care to fix that up and resend the series?

thanks,

greg k-h


Re: [PATCH] staging: wlang-ng: avoid new typedef CTLX_STATE

2016-10-09 Thread Greg KH
On Mon, Oct 03, 2016 at 06:07:03PM +0200, Sergio Paracuellos wrote:
> This patch fixes the following checkpatch.pl warning in hfa384x.h:
> WARNING: do not add new typedefs
> 
> It applies for typedef CTLX_STATE
> 
> Signed-off-by: Sergio Paracuellos 
> ---
>  drivers/staging/wlan-ng/hfa384x.h | 3 +--
>  drivers/staging/wlan-ng/hfa384x_usb.c | 2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)

Subject also wrong :(


Re: [PATCH] staging: wlang-ng: get memory from kernel allocators instead of big static buffer

2016-10-09 Thread Greg KH
On Mon, Oct 03, 2016 at 06:05:44PM +0200, Sergio Paracuellos wrote:
> This patch fix the following sparse warnings in prism2fw.c:
> warning: memset with byte count of 12
> 
> Signed-off-by: Sergio Paracuellos 
> ---
>  drivers/staging/wlan-ng/prism2fw.c | 11 ---
>  1 file changed, 8 insertions(+), 3 deletions(-)

Subject also wrong :(


[PATCH 2/2] host: ohci-exynos: Convert to use the SET_SYSTEM_SLEEP_PM_OPS

2016-10-09 Thread Anand Moon
Move the ohci-exynos system PM callbacks within #ifdef CONFIG_PM_SLEEP
as to avoid them being build when not used. This also allows us to use the
SET_SYSTEM_SLEEP_PM_OPS macro which simplifies the code.

Signed-off-by: Anand Moon 
---
 drivers/usb/host/ohci-exynos.c | 20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 2cd105b..1764baa 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -219,7 +219,7 @@ static void exynos_ohci_shutdown(struct platform_device 
*pdev)
hcd->driver->shutdown(hcd);
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int exynos_ohci_suspend(struct device *dev)
 {
struct usb_hcd *hcd = dev_get_drvdata(dev);
@@ -256,18 +256,16 @@ static int exynos_ohci_resume(struct device *dev)
 
return 0;
 }
-#else
-#define exynos_ohci_suspendNULL
-#define exynos_ohci_resume NULL
-#endif
 
-static const struct ohci_driver_overrides exynos_overrides __initconst = {
-   .extra_priv_size =  sizeof(struct exynos_ohci_hcd),
+static const struct dev_pm_ops exynos_ohci_pm_ops = {
+   SET_SYSTEM_SLEEP_PM_OPS(exynos_ohci_suspend, exynos_ohci_resume)
 };
+#endif /* CONFIG_PM_SLEEP */
 
-static const struct dev_pm_ops exynos_ohci_pm_ops = {
-   .suspend= exynos_ohci_suspend,
-   .resume = exynos_ohci_resume,
+#define DEV_PM_OPS IS_ENABLED(CONFIG_PM_SLEEP) ? _ohci_pm_ops : NULL
+
+static const struct ohci_driver_overrides exynos_overrides __initconst = {
+   .extra_priv_size =  sizeof(struct exynos_ohci_hcd),
 };
 
 #ifdef CONFIG_OF
@@ -285,7 +283,7 @@ static struct platform_driver exynos_ohci_driver = {
.shutdown   = exynos_ohci_shutdown,
.driver = {
.name   = "exynos-ohci",
-   .pm = _ohci_pm_ops,
+   .pm = DEV_PM_OPS,
.of_match_table = of_match_ptr(exynos_ohci_match),
}
 };
-- 
2.7.4



[PATCH 05/15] staging: wlan-ng: fix block comment warnings in p80211netdev.c

2016-10-09 Thread Sergio Paracuellos
This patch fix the following checkpatch.pl warnings in p80211netdev.c:
WARNING: Block comments should align the * on each line
WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211netdev.c | 613 +
 1 file changed, 314 insertions(+), 299 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211netdev.c 
b/drivers/staging/wlan-ng/p80211netdev.c
index 78a10af..fb28d8f 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -1,53 +1,53 @@
 /* src/p80211/p80211knetdev.c
-*
-* Linux Kernel net device interface
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*
-* The functions required for a Linux network device are defined here.
-*
-* 
-*/
+ *
+ * Linux Kernel net device interface
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ *
+ * The functions required for a Linux network device are defined here.
+ *
+ * 
+ */
 
 #include 
 #include 
@@ -112,17 +112,18 @@ static int p80211knetdev_do_ioctl(struct net_device *dev, 
struct ifreq *ifr,
 MODULE_PARM_DESC(wlan_wext_write, "enable 

[PATCH 15/15] staging: wlan-ng: fix block comment warnings in prism2fw.c

2016-10-09 Thread Sergio Paracuellos
This patch fix the following checkpatch.pl warnings in prism2fw.c

WARNING: Block comments should align the * on each line
WARNING: Block comments use a trailing */ on a separate line
Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/prism2fw.c | 485 +++--
 1 file changed, 248 insertions(+), 237 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c 
b/drivers/staging/wlan-ng/prism2fw.c
index 96aa211..2454a78 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -1,49 +1,49 @@
 /* from src/prism2/download/prism2dl.c
-*
-* utility for downloading prism2 images moved into kernelspace
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*/
+ *
+ * utility for downloading prism2 images moved into kernelspace
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ */
 
 /**/
 /* System Includes */
@@ -189,18 +189,19 @@ static int writeimage(struct wlandevice *wlandev, struct 
imgchunk *fchunk,
 /* Function Definitions */
 
 /*
-* prism2_fwtry
-*
-* Try and get firmware into memory
-*
-* Arguments:
-*  udevusb device structure
-*  wlandev wlan device 

[PATCH 02/15] staging: wlan-ng: fix block comment warnings in hfa384x_usb.c

2016-10-09 Thread Sergio Paracuellos
 This patch fix the following checkpatch.pl warnings in hfa384x_usb.c:
 WARNING: Block comments should align the * on each line
 WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/hfa384x_usb.c | 2370 +
 1 file changed, 1213 insertions(+), 1157 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c 
b/drivers/staging/wlan-ng/hfa384x_usb.c
index 395690f..1bfea8d 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -1,114 +1,114 @@
 /* src/prism2/driver/hfa384x_usb.c
-*
-* Functions that talk to the USB variantof the Intersil hfa384x MAC
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*
-* This file implements functions that correspond to the prism2/hfa384x
-* 802.11 MAC hardware and firmware host interface.
-*
-* The functions can be considered to represent several levels of
-* abstraction.  The lowest level functions are simply C-callable wrappers
-* around the register accesses.  The next higher level represents C-callable
-* prism2 API functions that match the Intersil documentation as closely
-* as is reasonable.  The next higher layer implements common sequences
-* of invocations of the API layer (e.g. write to bap, followed by cmd).
-*
-* Common sequences:
-* hfa384x_drvr_xxx Highest level abstractions provided by the
-*  hfa384x code.  They are driver defined wrappers
-*  for common sequences.  These functions generally
-*  use the services of the lower levels.
-*
-* hfa384x_drvr_xxxconfig  An example of the drvr level abstraction. These
-*  functions are wrappers for the RID get/set
-*  sequence. They call copy_[to|from]_bap() and
-*  cmd_access(). These functions operate on the
-*  RIDs and buffers without validation. The caller
-*  is responsible for that.
-*
-* API wrapper functions:
-* hfa384x_cmd_xxx  functions that provide access to the f/w commands.
-*  The function arguments correspond to each command
-*  argument, even command arguments that get packed
-*  into single registers.  These functions _just_
-*  issue the command by setting the cmd/parm regs
-*  & reading the status/resp regs.  Additional
-*  activities required to fully use a command
-*  (read/write from/to bap, get/set int status etc.)
-*  are implemented separately.  Think of these as
-*  C-callable prism2 commands.
-*
-* Lowest Layer Functions:
-* hfa384x_docmd_xxxThese functions implement the sequence required
-*  to issue any prism2 command.  Primarily used by the
-*  hfa384x_cmd_xxx functions.
-*
-* hfa384x_bap_xxx  BAP read/write access functions.
-*  Note: we usually use BAP0 for non-interrupt context
-*   and BAP1 

[PATCH 12/15] staging: wlan-ng: fix block comment warnings in prism2mib.c

2016-10-09 Thread Sergio Paracuellos
This patch fix the following checkpatch.pl warnings in prism2mib.c:
WARNING: Block comments should align the * on each line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/prism2mib.c | 100 ++--
 1 file changed, 50 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mib.c 
b/drivers/staging/wlan-ng/prism2mib.c
index 63ab6bc8..d7792cd 100644
--- a/drivers/staging/wlan-ng/prism2mib.c
+++ b/drivers/staging/wlan-ng/prism2mib.c
@@ -1,54 +1,54 @@
 /* src/prism2/driver/prism2mib.c
-*
-* Management request for mibset/mibget
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*
-* The functions in this file handle the mibset/mibget management
-* functions.
-*
-* 
-*/
+ *
+ * Management request for mibset/mibget
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ *
+ * The functions in this file handle the mibset/mibget management
+ * functions.
+ *
+ * 
+ */
 
 #include 
 #include 
-- 
1.9.1



[PATCH 01/15] staging: wlan-ng: fix line style warnings in hfa384x_usb.c

2016-10-09 Thread Sergio Paracuellos
This patch fix the following checkpatch.pl warnings in hfa384x_usb.c:
WARNING: line over 80 characters

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/hfa384x_usb.c | 71 +++
 1 file changed, 38 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c 
b/drivers/staging/wlan-ng/hfa384x_usb.c
index 6a107f8..395690f 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -153,8 +153,8 @@ enum cmd_mode {
 static void dbprint_urb(struct urb *urb);
 #endif
 
-static void
-hfa384x_int_rxmonitor(struct wlandevice *wlandev, struct hfa384x_usb_rxfrm 
*rxfrm);
+static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
+ struct hfa384x_usb_rxfrm *rxfrm);
 
 static void hfa384x_usb_defer(struct work_struct *data);
 
@@ -173,7 +173,8 @@ enum cmd_mode {
 
 static void hfa384x_usbin_rx(struct wlandevice *wlandev, struct sk_buff *skb);
 
-static void hfa384x_usbin_info(struct wlandevice *wlandev, union hfa384x_usbin 
*usbin);
+static void hfa384x_usbin_info(struct wlandevice *wlandev,
+  union hfa384x_usbin *usbin);
 
 static void hfa384x_usbin_ctlx(struct hfa384x *hw, union hfa384x_usbin *usbin,
   int urb_status);
@@ -193,9 +194,11 @@ static void hfa384x_usbin_ctlx(struct hfa384x *hw, union 
hfa384x_usbin *usbin,
 
 static void hfa384x_usbctlx_reaper_task(unsigned long data);
 
-static int hfa384x_usbctlx_submit(struct hfa384x *hw, struct hfa384x_usbctlx 
*ctlx);
+static int hfa384x_usbctlx_submit(struct hfa384x *hw,
+ struct hfa384x_usbctlx *ctlx);
 
-static void unlocked_usbctlx_complete(struct hfa384x *hw, struct 
hfa384x_usbctlx *ctlx);
+static void unlocked_usbctlx_complete(struct hfa384x *hw,
+ struct hfa384x_usbctlx *ctlx);
 
 struct usbctlx_completor {
int (*complete)(struct usbctlx_completor *);
@@ -209,7 +212,8 @@ struct usbctlx_completor {
 static int
 unlocked_usbctlx_cancel_async(struct hfa384x *hw, struct hfa384x_usbctlx 
*ctlx);
 
-static void hfa384x_cb_status(struct hfa384x *hw, const struct hfa384x_usbctlx 
*ctlx);
+static void hfa384x_cb_status(struct hfa384x *hw,
+ const struct hfa384x_usbctlx *ctlx);
 
 static int
 usbctlx_get_status(const struct hfa384x_usb_statusresp *cmdresp,
@@ -664,12 +668,10 @@ static inline int usbctlx_cmd_completor_fn(struct 
usbctlx_completor *head)
return usbctlx_get_status(complete->cmdresp, complete->result);
 }
 
-static inline struct usbctlx_completor *init_cmd_completor(
-   struct usbctlx_cmd_completor
-   *completor,
-   const struct 
hfa384x_usb_statusresp
-   *cmdresp,
-   struct hfa384x_cmdresult 
*result)
+static inline struct usbctlx_completor *
+init_cmd_completor(struct usbctlx_cmd_completor *completor,
+   const struct hfa384x_usb_statusresp *cmdresp,
+   struct hfa384x_cmdresult *result)
 {
completor->head.complete = usbctlx_cmd_completor_fn;
completor->cmdresp = cmdresp;
@@ -710,13 +712,11 @@ static int usbctlx_rrid_completor_fn(struct 
usbctlx_completor *head)
return 0;
 }
 
-static inline struct usbctlx_completor *init_rrid_completor(
-   struct usbctlx_rrid_completor
-   *completor,
-   const struct 
hfa384x_usb_rridresp
-   *rridresp,
-   void *riddata,
-   unsigned int riddatalen)
+static inline struct usbctlx_completor *
+init_rrid_completor(struct usbctlx_rrid_completor *completor,
+   const struct hfa384x_usb_rridresp *rridresp,
+   void *riddata,
+   unsigned int riddatalen)
 {
completor->head.complete = usbctlx_rrid_completor_fn;
completor->rridresp = rridresp;
@@ -759,13 +759,11 @@ static int usbctlx_rmem_completor_fn(struct 
usbctlx_completor *head)
return 0;
 }
 
-static inline struct usbctlx_completor *init_rmem_completor(
-   struct usbctlx_rmem_completor
-   *completor,
-   struct hfa384x_usb_rmemresp
-   *rmemresp,
-   void *data,
-   unsigned int len)
+static inline 

[PATCH 11/15] staging: wlan-ng: fix block comment warnings in prism2mgmt.c

2016-10-09 Thread Sergio Paracuellos
This patch fix the following checkpatch.pl warnings in prism2mgmt.c:
WARNING: Block comments should align the * on each line
WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/prism2mgmt.c | 518 ++-
 1 file changed, 264 insertions(+), 254 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c 
b/drivers/staging/wlan-ng/prism2mgmt.c
index 170de1c..90db53d 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -1,61 +1,61 @@
 /* src/prism2/driver/prism2mgmt.c
-*
-* Management request handler functions.
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*
-* The functions in this file handle management requests sent from
-* user mode.
-*
-* Most of these functions have two separate blocks of code that are
-* conditional on whether this is a station or an AP.  This is used
-* to separate out the STA and AP responses to these management primitives.
-* It's a choice (good, bad, indifferent?) to have the code in the same
-* place so it's clear that the same primitive is implemented in both
-* cases but has different behavior.
-*
-* 
-*/
+ *
+ * Management request handler functions.
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product 

[PATCH 07/15] staging: wlan-ng: fix block comment warnings in p80211req.c

2016-10-09 Thread Sergio Paracuellos
This patch fix the following checkpatch.pl warnings in p80211req.c:
WARNING: Block comments should align the * on each line
WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211req.c | 166 ++--
 1 file changed, 84 insertions(+), 82 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211req.c 
b/drivers/staging/wlan-ng/p80211req.c
index d43e85b..440dfc1 100644
--- a/drivers/staging/wlan-ng/p80211req.c
+++ b/drivers/staging/wlan-ng/p80211req.c
@@ -1,54 +1,54 @@
 /* src/p80211/p80211req.c
-*
-* Request/Indication/MacMgmt interface handling functions
-*
-* Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*
-* This file contains the functions, types, and macros to support the
-* MLME request interface that's implemented via the device ioctls.
-*
-* 
-*/
+ *
+ * Request/Indication/MacMgmt interface handling functions
+ *
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ *
+ * This file contains the functions, types, and macros to support the
+ * MLME request interface that's implemented via the device ioctls.
+ *
+ * 
+ */
 
 #include 

[PATCH 13/15] staging: wlan-ng: fix block comment warnings in prism2sta.c

2016-10-09 Thread Sergio Paracuellos
This patch fix the following checkpatch.pl warnings in prism2sta.c:
WARNING: Block comments should align the * on each line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/prism2sta.c | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2sta.c 
b/drivers/staging/wlan-ng/prism2sta.c
index e1b4a94..1a6ea1f 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -1859,24 +1859,24 @@ void prism2sta_ev_alloc(struct wlandevice *wlandev)
 }
 
 /*
-* create_wlan
-*
-* Called at module init time.  This creates the struct wlandevice structure
-* and initializes it with relevant bits.
-*
-* Arguments:
-*  none
-*
-* Returns:
-*  the created struct wlandevice structure.
-*
-* Side effects:
-*  also allocates the priv/hw structures.
-*
-* Call context:
-*  process thread
-*
-*/
+ * create_wlan
+ *
+ * Called at module init time.  This creates the struct wlandevice structure
+ * and initializes it with relevant bits.
+ *
+ * Arguments:
+ * none
+ *
+ * Returns:
+ * the created struct wlandevice structure.
+ *
+ * Side effects:
+ * also allocates the priv/hw structures.
+ *
+ * Call context:
+ * process thread
+ *
+ */
 static struct wlandevice *create_wlan(void)
 {
struct wlandevice *wlandev = NULL;
-- 
1.9.1



[PATCH] staging: wlan-ng: get memory from kernel allocators instead of big static buffer

2016-10-09 Thread Sergio Paracuellos
This patch fix the following sparse warnings in prism2fw.c:
warning: memset with byte count of 12

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/prism2fw.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c 
b/drivers/staging/wlan-ng/prism2fw.c
index 96aa211..7e33048 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -124,7 +124,7 @@ struct imgchunk {
 
 /* Data records */
 static unsigned int ns3data;
-static struct s3datarec s3data[S3DATA_MAX];
+static struct s3datarec *s3data;
 
 /* Plug records */
 static unsigned int ns3plug;
@@ -248,7 +248,12 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr,
 
/* Initialize the data structures */
ns3data = 0;
-   memset(s3data, 0, sizeof(s3data));
+   s3data = kcalloc(S3DATA_MAX, sizeof(*s3data), GFP_KERNEL);
+   if (unlikely(!s3data)) {
+   result = -ENOMEM;
+   goto out;
+   }
+
ns3plug = 0;
memset(s3plug, 0, sizeof(s3plug));
ns3crc = 0;
@@ -475,7 +480,7 @@ static void free_chunks(struct imgchunk *fchunk, unsigned 
int *nfchunks)
 static void free_srecs(void)
 {
ns3data = 0;
-   memset(s3data, 0, sizeof(s3data));
+   kfree(s3data);
ns3plug = 0;
memset(s3plug, 0, sizeof(s3plug));
ns3crc = 0;
-- 
1.9.1



[PATCH 09/15] staging: wlan-ng: fix block comment warnings in p80211wep.c

2016-10-09 Thread Sergio Paracuellos
This patch fix the following checkpatch.pl warnings in p80211wep.c:
WARNING: Block comments should align the * on each line

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211wep.c | 90 ++---
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211wep.c 
b/drivers/staging/wlan-ng/p80211wep.c
index 23b1837..59efb35 100644
--- a/drivers/staging/wlan-ng/p80211wep.c
+++ b/drivers/staging/wlan-ng/p80211wep.c
@@ -1,49 +1,49 @@
 /* src/p80211/p80211wep.c
-*
-* WEP encode/decode for P80211.
-*
-* Copyright (C) 2002 AbsoluteValue Systems, Inc.  All Rights Reserved.
-* 
-*
-* linux-wlan
-*
-*   The contents of this file are subject to the Mozilla Public
-*   License Version 1.1 (the "License"); you may not use this file
-*   except in compliance with the License. You may obtain a copy of
-*   the License at http://www.mozilla.org/MPL/
-*
-*   Software distributed under the License is distributed on an "AS
-*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-*   implied. See the License for the specific language governing
-*   rights and limitations under the License.
-*
-*   Alternatively, the contents of this file may be used under the
-*   terms of the GNU Public License version 2 (the "GPL"), in which
-*   case the provisions of the GPL are applicable instead of the
-*   above.  If you wish to allow the use of your version of this file
-*   only under the terms of the GPL and not to allow others to use
-*   your version of this file under the MPL, indicate your decision
-*   by deleting the provisions above and replace them with the notice
-*   and other provisions required by the GPL.  If you do not delete
-*   the provisions above, a recipient may use your version of this
-*   file under either the MPL or the GPL.
-*
-* 
-*
-* Inquiries regarding the linux-wlan Open Source project can be
-* made directly to:
-*
-* AbsoluteValue Systems Inc.
-* i...@linux-wlan.com
-* http://www.linux-wlan.com
-*
-* 
-*
-* Portions of the development of this software were funded by
-* Intersil Corporation as part of PRISM(R) chipset product development.
-*
-* 
-*/
+ *
+ * WEP encode/decode for P80211.
+ *
+ * Copyright (C) 2002 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ *
+ * linux-wlan
+ *
+ *   The contents of this file are subject to the Mozilla Public
+ *   License Version 1.1 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.mozilla.org/MPL/
+ *
+ *   Software distributed under the License is distributed on an "AS
+ *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ *   implied. See the License for the specific language governing
+ *   rights and limitations under the License.
+ *
+ *   Alternatively, the contents of this file may be used under the
+ *   terms of the GNU Public License version 2 (the "GPL"), in which
+ *   case the provisions of the GPL are applicable instead of the
+ *   above.  If you wish to allow the use of your version of this file
+ *   only under the terms of the GPL and not to allow others to use
+ *   your version of this file under the MPL, indicate your decision
+ *   by deleting the provisions above and replace them with the notice
+ *   and other provisions required by the GPL.  If you do not delete
+ *   the provisions above, a recipient may use your version of this
+ *   file under either the MPL or the GPL.
+ *
+ * 
+ *
+ * Inquiries regarding the linux-wlan Open Source project can be
+ * made directly to:
+ *
+ * AbsoluteValue Systems Inc.
+ * i...@linux-wlan.com
+ * http://www.linux-wlan.com
+ *
+ * 
+ *
+ * Portions of the development of this software were funded by
+ * Intersil Corporation as part of PRISM(R) chipset product development.
+ *
+ * 
+ */
 
 /**/
 /* System Includes */
-- 
1.9.1



[PATCH V2] staging: ks7010: use netdev_* instead of printk()

2016-10-09 Thread Sabitha George
Fixes checkpatch warning on printk usage in ks_hostif.c

Signed-off-by: Sabitha George 
---
 drivers/staging/ks7010/ks_hostif.c | 25 -
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 5714cf7..1d62033 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -465,8 +465,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
skb->dev->last_rx = jiffies;
netif_rx(skb);
} else {
-   printk(KERN_WARNING
-  "ks_wlan: Memory squeeze, dropping packet.\n");
+   netdev_warn(priv->net_dev, "ks_wlan: Memory squeeze, 
dropping packet.\n");
priv->nstats.rx_dropped++;
}
break;
@@ -500,8 +499,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
skb->dev->last_rx = jiffies;
netif_rx(skb);
} else {
-   printk(KERN_WARNING
-  "ks_wlan: Memory squeeze, dropping packet.\n");
+   netdev_warn(priv->net_dev, "ks_wlan: Memory squeeze, 
dropping packet.\n");
priv->nstats.rx_dropped++;
}
break;
@@ -549,7 +547,8 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
dev->dev_addr[5] = priv->eth_addr[5];
dev->dev_addr[6] = 0x00;
dev->dev_addr[7] = 0x00;
-   printk(KERN_INFO "ks_wlan: MAC ADDRESS = %pM\n", 
priv->eth_addr);
+   netdev_info(dev, "ks_wlan: MAC ADDRESS = %pM\n",
+   priv->eth_addr);
break;
case DOT11_PRODUCT_VERSION:
/* firmware version */
@@ -557,8 +556,8 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
priv->version_size = priv->rx_size;
memcpy(priv->firmware_version, priv->rxp, priv->rx_size);
priv->firmware_version[priv->rx_size] = '\0';
-   printk(KERN_INFO "ks_wlan: firmware ver. = %s\n",
-  priv->firmware_version);
+   netdev_info(dev, "ks_wlan: firmware ver. = %s\n",
+   priv->firmware_version);
hostif_sme_enqueue(priv, SME_GET_PRODUCT_VERSION);
/* wake_up_interruptible_all(>confirm_wait); */
complete(>confirm_wait);
@@ -578,12 +577,12 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
} else if (priv->eeprom_sum.type == 1) {
if (priv->eeprom_sum.result == 0) {
priv->eeprom_checksum = EEPROM_NG;
-   printk("LOCAL_EEPROM_SUM NG\n");
+   netdev_info(dev, "LOCAL_EEPROM_SUM NG\n");
} else if (priv->eeprom_sum.result == 1) {
priv->eeprom_checksum = EEPROM_OK;
}
} else {
-   printk("LOCAL_EEPROM_SUM error!\n");
+   netdev_err(dev, "LOCAL_EEPROM_SUM error!\n");
}
break;
default:
@@ -880,7 +879,7 @@ void hostif_stop_confirm(struct ks_wlan_private *priv)
netif_carrier_off(netdev);
tmp = FORCE_DISCONNECT & priv->connect_status;
priv->connect_status = tmp | DISCONNECT_STATUS;
-   printk("IWEVENT: disconnect\n");
+   netdev_info(netdev, "IWEVENT: disconnect\n");
 
wrqu0.data.length = 0;
wrqu0.data.flags = 0;
@@ -890,7 +889,7 @@ void hostif_stop_confirm(struct ks_wlan_private *priv)
&& (old_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
eth_zero_addr(wrqu0.ap_addr.sa_data);
DPRINTK(3, "IWEVENT: disconnect\n");
-   printk("IWEVENT: disconnect\n");
+   netdev_info(netdev, "IWEVENT: disconnect\n");
DPRINTK(3, "disconnect :: scan_ind_count=%d\n",
priv->scan_ind_count);
wireless_send_event(netdev, SIOCGIWAP, , NULL);
@@ -1096,7 +1095,7 @@ void hostif_event_check(struct ks_wlan_private *priv)
case HIF_AP_SET_CONF:
default:
//DPRINTK(1, "undefined event[%04X]\n", event);
-   printk("undefined event[%04X]\n", event);
+   netdev_err(priv->net_dev, "undefined event[%04X]\n", event);
/* wake_up_all(>confirm_wait); */
complete(>confirm_wait);
break;
@@ -2644,7 +2643,7 @@ void hostif_sme_enqueue(struct ks_wlan_private *priv, 
unsigned short event)
} else {

Re: [PATCH v2 2/4] ACPI / gpio: Add support for naming GPIOs

2016-10-09 Thread Andy Shevchenko
On Sun, Oct 9, 2016 at 6:01 PM, Mika Westerberg
 wrote:
> On Fri, Oct 07, 2016 at 08:05:14PM +0300, Andy Shevchenko wrote:
>> On Thu, Sep 29, 2016 at 4:39 PM, Mika Westerberg
>>  wrote:

>> > +   if (!chip->names)
>> > +   acpi_gpiochip_set_names(acpi_gpio);
>> > +
>>
>> I'm okay with this, though wouldn't be better to call it
>> unconditionally like it's done for below call and move check inside?
>
> DT does it like this. I can move the check inside the function as well.

Up to you. If it even worth to change.

-- 
With Best Regards,
Andy Shevchenko


Re: [tpmdd-devel] [PATCH RFC 3/3] tpm_crb: request and relinquish locality 0

2016-10-09 Thread Jarkko Sakkinen
On Sun, Oct 09, 2016 at 09:43:59AM +, Winkler, Tomas wrote:
> 
> > >
> > > >
> > > > Request and relinquish locality for the driver use in order to be a 
> > > > better
> > citizen
> > > > in a multi locality environment like with TXT as it uses locality 2.
> > >
> > > >
> > > > Signed-off-by: Jarkko Sakkinen 
> > > > ---
> > > >  drivers/char/tpm/tpm_crb.c | 36
> > > > 
> > > >  1 file changed, 24 insertions(+), 12 deletions(-)
> > > >
> > > > diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
> > > > index
> > > > ffd3a6c..9e07cf3 100644
> > > > --- a/drivers/char/tpm/tpm_crb.c
> > > > +++ b/drivers/char/tpm/tpm_crb.c
> > > > @@ -34,6 +34,15 @@ enum crb_defaults {
> > > > CRB_ACPI_START_INDEX = 1,
> > > >  };
> > > >
> > > > +enum crb_loc_ctrl {
> > > > +   CRB_LOC_CTRL_REQUEST_ACCESS = BIT(0),
> > > > +   CRB_LOC_CTRL_RELINQUISH = BIT(1),
> > > > +};
> > > > +
> > > > +enum crb_loc_state {
> > > > +   CRB_LOC_STATE_LOC_ASSIGNED  = BIT(1),
> > > > +};
> > > > +
> > > >  enum crb_ctrl_req {
> > > > CRB_CTRL_REQ_CMD_READY  = BIT(0),
> > > > CRB_CTRL_REQ_GO_IDLE= BIT(1),
> > > > @@ -98,12 +107,8 @@ struct crb_priv {
> > > >   * @dev:  crb device
> > > >   * @priv: crb private data
> > > >   *
> > > > - * Write CRB_CTRL_REQ_GO_IDLE to TPM_CRB_CTRL_REQ
> > > > - * The device should respond within TIMEOUT_C by clearing the bit.
> > > > - * Anyhow, we do not wait here as a consequent CMD_READY request
> > > > - * will be handled correctly even if idle was not completed.
> > > > - *
> > > > - * The function does nothing for devices with ACPI-start method.
> > > > + * Put device to the idle state and relinquish locality. The
> > > > + function does
> > > > + * nothing for devices with the ACPI-start method.
> > > >   *
> > > >   * Return: 0 always
> > > >   */
> > > > @@ -112,6 +117,7 @@ static int __maybe_unused crb_go_idle(struct
> > > > device *dev, struct crb_priv *priv)
> > > > if (priv->flags & CRB_FL_ACPI_START)
> > > > return 0;
> > > >
> > > > +   iowrite32(CRB_LOC_CTRL_RELINQUISH, >regs->loc_ctrl);
> > >
> > >
> > > Please don't mix different functionalities in one function
> > 
> > ??
> > 
> > > Also those functions are called from runtime pm, this has nothing to
> > > do with the power management
> > 
> > It all depends on granularity. If you want to make an argument, could you
> > propose a better granularity? Do you think it'd be better to do it for each
> > transmission?
> 
> Not sure, I don't believe we closed the design here with all the
> parties, you are jumping ahead. 

I also added RFC tag.

I have had this done for a while but it has had a dependency for runtime
PM so I decided to make it available.

> > You are saying that this is all bad without saying really backing up your
> > statements by any means.
> 
> You are right,  I assumed it's pretty obvious, I'm taking this to my
> attention not do it again.
> 
> So my point is if you have a function which is named go_idle  it
> probably does go idle flow and no other things like relinquish
> functionality that's for code readability and style.  Also you lost

When you go to idle you certain tasks before going to sleep. If the
granularity matches, relinquishing locality is one of those tasks.

> degree  of freedom even now you may want perform each of these
> operation for each tpm request, that might not be true in general, we
> would like to witch to runtime auto suspend it won't work anymore, for
> example. Also as you pointed right now we are not clear on the
> granularity of the locality access. 

That's not true. You don't loose any freedoms. You can start with
something simple like once per transmission or once per idle/ready.

If that does not scale, then it must be adjusted. I think this is
really business as usual...

> Thanks
> Tomas

/Jarkko


hello LKML

2016-10-09 Thread Mark Underwood
Good morning LKML



http://jyt.org.uk/valuable.php?theres=khya20h4t8hkzymt2




Mark


Re: [RFC][PATCH 4/4] futex: Rewrite FUTEX_UNLOCK_PI

2016-10-09 Thread Thomas Gleixner
On Fri, 7 Oct 2016, Peter Zijlstra wrote:
>   top_waiter = futex_top_waiter(hb, );
>   if (top_waiter) {
> - ret = wake_futex_pi(uaddr, uval, top_waiter, hb);
> + struct futex_pi_state *pi_state = top_waiter->pi_state;
> +
> + ret = -EINVAL;
> + if (!pi_state)
> + goto out_unlock;
> +
> + /*
> +  * If current does not own the pi_state then the futex is
> +  * inconsistent and user space fiddled with the futex value.
> +  */
> + if (pi_state->owner != current)
> + goto out_unlock;
> +
> + /*
> +  * Grab a reference on the pi_state and drop hb->lock.
> +  *
> +  * The reference ensures pi_state lives, dropping the hb->lock
> +  * is tricky.. wake_futex_pi() will take rt_mutex::wait_lock to
> +  * close the races against futex_lock_pi(), but in case of
> +  * _any_ fail we'll abort and retry the whole deal.
> +  */
> + WARN_ON_ONCE(!atomic_inc_not_zero(_state->refcount));
> + spin_unlock(>lock);
> +
> + ret = wake_futex_pi(uaddr, uval, pi_state);
> +
> + put_pi_state(pi_state);

put_pi_state() requires hb->lock protection AFAICT.

CPU0 CPU1

wake_futex_pi()  attach_to_pi_state()
put_pi_state()
refcount--; 
if (!refcount)  
free_state();   
WARN_ON(!pi_state->refcount);

we might not see the warning, but in any case the following access to
pi_state on cpu1 is borked.

Thanks,

tglx









Re: [PATCH v3 07/18] x86/intel_rdt: Add Haswell feature discovery

2016-10-09 Thread Borislav Petkov
On Fri, Oct 07, 2016 at 07:45:52PM -0700, Fenghua Yu wrote:
> From: Fenghua Yu 
> 
> Some Haswell generation CPUs support RDT, but they don't enumerate this
> using CPUID.  Use rdmsr_safe() and wrmsr_safe() to probe the MSRs on
> cpu model 63 (INTEL_FAM6_HASWELL_X)
> 
> Signed-off-by: Fenghua Yu 
> Signed-off-by: Tony Luck 
> ---
>  arch/x86/events/intel/cqm.c |  2 +-
>  arch/x86/include/asm/intel_rdt_common.h |  6 ++
>  arch/x86/kernel/cpu/intel_rdt.c | 38 
> +
>  3 files changed, 45 insertions(+), 1 deletion(-)
>  create mode 100644 arch/x86/include/asm/intel_rdt_common.h

...

> +static inline bool cache_alloc_hsw_probe(void)
> +{
> + u32 l, h_old, h_new, h_tmp;
> +
> + if (rdmsr_safe(MSR_IA32_PQR_ASSOC, , _old))
> + return false;
> +
> + /*
> +  * Default value is always 0 if feature is present.
> +  */
> + h_tmp = h_old ^ 0x1U;
> + if (wrmsr_safe(MSR_IA32_PQR_ASSOC, l, h_tmp))

I don't understand - you do the family/model check below and yet still
use the _safe() variants. Isn't the presence of that MSR guaranteed on
those machines?

> + return false;
> + rdmsr(MSR_IA32_PQR_ASSOC, l, h_new);
> +
> + if (h_tmp != h_new)
> + return false;
> +
> + wrmsr(MSR_IA32_PQR_ASSOC, l, h_old);
> +
> + return true;
> +}
>  
>  static inline bool get_rdt_resources(struct cpuinfo_x86 *c)
>  {
>   bool ret = false;
>  
> + if (c->x86_vendor == X86_VENDOR_INTEL && c->x86 == 6 &&
> + c->x86_model == INTEL_FAM6_HASWELL_X)
> + return cache_alloc_hsw_probe();
> +
>   if (!cpu_has(c, X86_FEATURE_RDT_A))
>   return false;
>   if (cpu_has(c, X86_FEATURE_CAT_L3))
> -- 
> 2.5.0
> 

-- 
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 
(AG Nürnberg)
-- 


Re: [PATCH v3 07/18] x86/intel_rdt: Add Haswell feature discovery

2016-10-09 Thread Fenghua Yu
On Sun, Oct 09, 2016 at 01:41:16PM +0200, Borislav Petkov wrote:
> On Fri, Oct 07, 2016 at 07:45:52PM -0700, Fenghua Yu wrote:
> > From: Fenghua Yu 
> > 
> > Some Haswell generation CPUs support RDT, but they don't enumerate this
> > using CPUID.  Use rdmsr_safe() and wrmsr_safe() to probe the MSRs on
> > cpu model 63 (INTEL_FAM6_HASWELL_X)
> > 
> > Signed-off-by: Fenghua Yu 
> > Signed-off-by: Tony Luck 
> > ---
> >  arch/x86/events/intel/cqm.c |  2 +-
> >  arch/x86/include/asm/intel_rdt_common.h |  6 ++
> >  arch/x86/kernel/cpu/intel_rdt.c | 38 
> > +
> >  3 files changed, 45 insertions(+), 1 deletion(-)
> >  create mode 100644 arch/x86/include/asm/intel_rdt_common.h
> 
> ...
> 
> > +static inline bool cache_alloc_hsw_probe(void)
> > +{
> > +   u32 l, h_old, h_new, h_tmp;
> > +
> > +   if (rdmsr_safe(MSR_IA32_PQR_ASSOC, , _old))
> > +   return false;
> > +
> > +   /*
> > +* Default value is always 0 if feature is present.
> > +*/
> > +   h_tmp = h_old ^ 0x1U;
> > +   if (wrmsr_safe(MSR_IA32_PQR_ASSOC, l, h_tmp))
> 
> I don't understand - you do the family/model check below and yet still
> use the _safe() variants. Isn't the presence of that MSR guaranteed on
> those machines?

The MSR is not guaranteed on every stepping of the family and model machine
because some parts may have the MSR fused off. And some bits in the MSR
may not be implemented on some parts. And in KVM or guest, the MSR may not
implemented. Those are reasons why we use wrmsr_safe/rdmsr_safe in Haswell
probe.

Thanks.

-Fenghua


[PATCH] staging: wlan-ng: get memory from kernel allocators instead of big static buffer

2016-10-09 Thread Sergio Paracuellos
This patch fix the following sparse warnings in prism2fw.c:
warning: memset with byte count of 12

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/prism2fw.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c 
b/drivers/staging/wlan-ng/prism2fw.c
index 96aa211..7e33048 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -124,7 +124,7 @@ struct imgchunk {
 
 /* Data records */
 static unsigned int ns3data;
-static struct s3datarec s3data[S3DATA_MAX];
+static struct s3datarec *s3data;
 
 /* Plug records */
 static unsigned int ns3plug;
@@ -248,7 +248,12 @@ static int prism2_fwapply(const struct ihex_binrec *rfptr,
 
/* Initialize the data structures */
ns3data = 0;
-   memset(s3data, 0, sizeof(s3data));
+   s3data = kcalloc(S3DATA_MAX, sizeof(*s3data), GFP_KERNEL);
+   if (!s3data) {
+   result = -ENOMEM;
+   goto out;
+   }
+
ns3plug = 0;
memset(s3plug, 0, sizeof(s3plug));
ns3crc = 0;
@@ -475,7 +480,7 @@ static void free_chunks(struct imgchunk *fchunk, unsigned 
int *nfchunks)
 static void free_srecs(void)
 {
ns3data = 0;
-   memset(s3data, 0, sizeof(s3data));
+   kfree(s3data);
ns3plug = 0;
memset(s3plug, 0, sizeof(s3plug));
ns3crc = 0;
-- 
1.9.1



Re: [PATCH v3 07/18] x86/intel_rdt: Add Haswell feature discovery

2016-10-09 Thread Borislav Petkov
On Sun, Oct 09, 2016 at 10:09:37AM -0700, Fenghua Yu wrote:
> The MSR is not guaranteed on every stepping of the family and model machine
> because some parts may have the MSR fused off. And some bits in the MSR
> may not be implemented on some parts. And in KVM or guest, the MSR may not
> implemented. Those are reasons why we use wrmsr_safe/rdmsr_safe in Haswell
> probe.

Please add that info in a comment somewhere there as we'll all forget
about it otherwise.

Thanks.

-- 
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 
(AG Nürnberg)
-- 


[PATCH] net: usb: lan78xx: use new api ethtool_{get|set}_link_ksettings

2016-10-09 Thread Philippe Reynes
The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

Signed-off-by: Philippe Reynes 
---
 drivers/net/usb/lan78xx.c |   70 +---
 1 files changed, 40 insertions(+), 30 deletions(-)

diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index db558b8..13f033c 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -1092,7 +1092,7 @@ static int lan78xx_update_flowcontrol(struct lan78xx_net 
*dev, u8 duplex,
 static int lan78xx_link_reset(struct lan78xx_net *dev)
 {
struct phy_device *phydev = dev->net->phydev;
-   struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
+   struct ethtool_link_ksettings ecmd;
int ladv, radv, ret;
u32 buf;
 
@@ -1126,12 +1126,12 @@ static int lan78xx_link_reset(struct lan78xx_net *dev)
} else if (phydev->link && !dev->link_on) {
dev->link_on = true;
 
-   phy_ethtool_gset(phydev, );
+   phy_ethtool_ksettings_get(phydev, );
 
ret = phy_read(phydev, LAN88XX_INT_STS);
 
if (dev->udev->speed == USB_SPEED_SUPER) {
-   if (ethtool_cmd_speed() == 1000) {
+   if (ecmd.base.speed == 1000) {
/* disable U2 */
ret = lan78xx_read_reg(dev, USB_CFG1, );
buf &= ~USB_CFG1_DEV_U2_INIT_EN_;
@@ -1159,9 +1159,10 @@ static int lan78xx_link_reset(struct lan78xx_net *dev)
 
netif_dbg(dev, link, dev->net,
  "speed: %u duplex: %d anadv: 0x%04x anlpa: 0x%04x",
- ethtool_cmd_speed(), ecmd.duplex, ladv, radv);
+ ecmd.base.speed, ecmd.base.duplex, ladv, radv);
 
-   ret = lan78xx_update_flowcontrol(dev, ecmd.duplex, ladv, radv);
+   ret = lan78xx_update_flowcontrol(dev, ecmd.base.duplex, ladv,
+radv);
phy_mac_interrupt(phydev, 1);
 
if (!timer_pending(>stat_monitor)) {
@@ -1484,7 +1485,8 @@ static void lan78xx_set_mdix_status(struct net_device 
*net, __u8 mdix_ctrl)
dev->mdix_ctrl = mdix_ctrl;
 }
 
-static int lan78xx_get_settings(struct net_device *net, struct ethtool_cmd 
*cmd)
+static int lan78xx_get_link_ksettings(struct net_device *net,
+ struct ethtool_link_ksettings *cmd)
 {
struct lan78xx_net *dev = netdev_priv(net);
struct phy_device *phydev = net->phydev;
@@ -1495,20 +1497,20 @@ static int lan78xx_get_settings(struct net_device *net, 
struct ethtool_cmd *cmd)
if (ret < 0)
return ret;
 
-   ret = phy_ethtool_gset(phydev, cmd);
+   ret = phy_ethtool_ksettings_get(phydev, cmd);
 
buf = lan78xx_get_mdix_status(net);
 
buf &= LAN88XX_EXT_MODE_CTRL_MDIX_MASK_;
if (buf == LAN88XX_EXT_MODE_CTRL_AUTO_MDIX_) {
-   cmd->eth_tp_mdix = ETH_TP_MDI_AUTO;
-   cmd->eth_tp_mdix_ctrl = ETH_TP_MDI_AUTO;
+   cmd->base.eth_tp_mdix = ETH_TP_MDI_AUTO;
+   cmd->base.eth_tp_mdix_ctrl = ETH_TP_MDI_AUTO;
} else if (buf == LAN88XX_EXT_MODE_CTRL_MDI_) {
-   cmd->eth_tp_mdix = ETH_TP_MDI;
-   cmd->eth_tp_mdix_ctrl = ETH_TP_MDI;
+   cmd->base.eth_tp_mdix = ETH_TP_MDI;
+   cmd->base.eth_tp_mdix_ctrl = ETH_TP_MDI;
} else if (buf == LAN88XX_EXT_MODE_CTRL_MDI_X_) {
-   cmd->eth_tp_mdix = ETH_TP_MDI_X;
-   cmd->eth_tp_mdix_ctrl = ETH_TP_MDI_X;
+   cmd->base.eth_tp_mdix = ETH_TP_MDI_X;
+   cmd->base.eth_tp_mdix_ctrl = ETH_TP_MDI_X;
}
 
usb_autopm_put_interface(dev->intf);
@@ -1516,7 +1518,8 @@ static int lan78xx_get_settings(struct net_device *net, 
struct ethtool_cmd *cmd)
return ret;
 }
 
-static int lan78xx_set_settings(struct net_device *net, struct ethtool_cmd 
*cmd)
+static int lan78xx_set_link_ksettings(struct net_device *net,
+ const struct ethtool_link_ksettings *cmd)
 {
struct lan78xx_net *dev = netdev_priv(net);
struct phy_device *phydev = net->phydev;
@@ -1527,14 +1530,13 @@ static int lan78xx_set_settings(struct net_device *net, 
struct ethtool_cmd *cmd)
if (ret < 0)
return ret;
 
-   if (dev->mdix_ctrl != cmd->eth_tp_mdix_ctrl) {
-   lan78xx_set_mdix_status(net, cmd->eth_tp_mdix_ctrl);
-   }
+   if (dev->mdix_ctrl != cmd->base.eth_tp_mdix_ctrl)
+   lan78xx_set_mdix_status(net, cmd->base.eth_tp_mdix_ctrl);
 
/* change speed & duplex */
-   ret = phy_ethtool_sset(phydev, cmd);
+   ret = phy_ethtool_ksettings_set(phydev, cmd);
 
-   if (!cmd->autoneg) {
+   if (!cmd->base.autoneg) {
/* force link down */
   

[PATCH] staging: net: netlogic: use new api ethtool_{get|set}_link_ksettings

2016-10-09 Thread Philippe Reynes
The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

Signed-off-by: Philippe Reynes 
---
 drivers/staging/netlogic/xlr_net.c |   14 --
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/netlogic/xlr_net.c 
b/drivers/staging/netlogic/xlr_net.c
index 552a7dc..cdf01b9 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -172,29 +172,31 @@ static struct phy_device *xlr_get_phydev(struct 
xlr_net_priv *priv)
 /*
  * Ethtool operation
  */
-static int xlr_get_settings(struct net_device *ndev, struct ethtool_cmd *ecmd)
+static int xlr_get_link_ksettings(struct net_device *ndev,
+ struct ethtool_link_ksettings *ecmd)
 {
struct xlr_net_priv *priv = netdev_priv(ndev);
struct phy_device *phydev = xlr_get_phydev(priv);
 
if (!phydev)
return -ENODEV;
-   return phy_ethtool_gset(phydev, ecmd);
+   return phy_ethtool_ksettings_get(phydev, ecmd);
 }
 
-static int xlr_set_settings(struct net_device *ndev, struct ethtool_cmd *ecmd)
+static int xlr_set_link_ksettings(struct net_device *ndev,
+ const struct ethtool_link_ksettings *ecmd)
 {
struct xlr_net_priv *priv = netdev_priv(ndev);
struct phy_device *phydev = xlr_get_phydev(priv);
 
if (!phydev)
return -ENODEV;
-   return phy_ethtool_sset(phydev, ecmd);
+   return phy_ethtool_ksettings_set(phydev, ecmd);
 }
 
 static const struct ethtool_ops xlr_ethtool_ops = {
-   .get_settings = xlr_get_settings,
-   .set_settings = xlr_set_settings,
+   .get_link_ksettings = xlr_get_link_ksettings,
+   .set_link_ksettings = xlr_set_link_ksettings,
 };
 
 /*
-- 
1.7.4.4



  1   2   3   4   5   6   >