Re: [Linaro-mm-sig] [PATCH v3] staging: android: ion: Zero CMA allocated memory

2018-01-26 Thread Laura Abbott

On 01/26/2018 06:04 PM, Chen Feng wrote:



On 2018/1/27 1:48, Liam Mark wrote:

Since commit 204f672255c2 ("staging: android: ion: Use CMA APIs directly")
the CMA API is now used directly and therefore the allocated memory is no
longer automatically zeroed.

Explicitly zero CMA allocated memory to ensure that no data is exposed to
userspace.

Fixes: 204f672255c2 ("staging: android: ion: Use CMA APIs directly")
Signed-off-by: Liam Mark 
---
Changes in v2:
   - Clean up the commit message.
   - Add 'Fixes:'

Changes in v3:
  - Add support for highmem pages

  drivers/staging/android/ion/ion_cma_heap.c | 17 +
  1 file changed, 17 insertions(+)

diff --git a/drivers/staging/android/ion/ion_cma_heap.c 
b/drivers/staging/android/ion/ion_cma_heap.c
index 86196ffd2faf..fa3e4b7e0c9f 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -21,6 +21,7 @@
  #include 
  #include 
  #include 
+#include 
  
  #include "ion.h"
  
@@ -51,6 +52,22 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,

if (!pages)
return -ENOMEM;
  
+	if (PageHighMem(pages)) {

+   unsigned long nr_clear_pages = nr_pages;
+   struct page *page = pages;
+
+   while (nr_clear_pages > 0) {
+   void *vaddr = kmap_atomic(page);
+
+   memset(vaddr, 0, PAGE_SIZE);
+   kunmap_atomic(vaddr);


Here. This way may cause performance latency at mapping-memset-umap page one 
bye one.

Take a look at ion_heap_pages_zero.

Not very critical, arm64 always have linear mapping.



This is under a PageHighMem check so arm64 isn't affected. It's also
the same algorithm arm32 dma-mapping.c uses so I'd like to see some
data about the performance improvement before we go changing things
too much.

Thanks,
Laura




+   page++;
+   nr_clear_pages--;
+   }
+   } else {
+   memset(page_address(pages), 0, size);
+   }
+
table = kmalloc(sizeof(*table), GFP_KERNEL);
if (!table)
goto err;





___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Linaro-mm-sig] [PATCH v3] staging: android: ion: Zero CMA allocated memory

2018-01-26 Thread Chen Feng


On 2018/1/27 1:48, Liam Mark wrote:
> Since commit 204f672255c2 ("staging: android: ion: Use CMA APIs directly")
> the CMA API is now used directly and therefore the allocated memory is no
> longer automatically zeroed.
> 
> Explicitly zero CMA allocated memory to ensure that no data is exposed to
> userspace.
> 
> Fixes: 204f672255c2 ("staging: android: ion: Use CMA APIs directly")
> Signed-off-by: Liam Mark 
> ---
> Changes in v2:
>   - Clean up the commit message.
>   - Add 'Fixes:'
> 
> Changes in v3:
>  - Add support for highmem pages
> 
>  drivers/staging/android/ion/ion_cma_heap.c | 17 +
>  1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/staging/android/ion/ion_cma_heap.c 
> b/drivers/staging/android/ion/ion_cma_heap.c
> index 86196ffd2faf..fa3e4b7e0c9f 100644
> --- a/drivers/staging/android/ion/ion_cma_heap.c
> +++ b/drivers/staging/android/ion/ion_cma_heap.c
> @@ -21,6 +21,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include "ion.h"
>  
> @@ -51,6 +52,22 @@ static int ion_cma_allocate(struct ion_heap *heap, struct 
> ion_buffer *buffer,
>   if (!pages)
>   return -ENOMEM;
>  
> + if (PageHighMem(pages)) {
> + unsigned long nr_clear_pages = nr_pages;
> + struct page *page = pages;
> +
> + while (nr_clear_pages > 0) {
> + void *vaddr = kmap_atomic(page);
> +
> + memset(vaddr, 0, PAGE_SIZE);
> + kunmap_atomic(vaddr);

Here. This way may cause performance latency at mapping-memset-umap page one 
bye one.

Take a look at ion_heap_pages_zero.

Not very critical, arm64 always have linear mapping.


> + page++;
> + nr_clear_pages--;
> + }
> + } else {
> + memset(page_address(pages), 0, size);
> + }
> +
>   table = kmalloc(sizeof(*table), GFP_KERNEL);
>   if (!table)
>   goto err;
> 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] hv_vmbus: Correct the stale comments regarding cpu affinity

2018-01-26 Thread Haiyang Zhang
The comments doesn't match what the current code does, also have a
typo. This patch corrects them.

Signed-off-by: Haiyang Zhang 
---
 drivers/hv/channel_mgmt.c | 6 ++
 include/linux/hyperv.h| 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index c21020b69114..c6d9d19bc04e 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -596,10 +596,8 @@ static int next_numa_node_id;
 /*
  * Starting with Win8, we can statically distribute the incoming
  * channel interrupt load by binding a channel to VCPU.
- * We do this in a hierarchical fashion:
- * First distribute the primary channels across available NUMA nodes
- * and then distribute the subchannels amongst the CPUs in the NUMA
- * node assigned to the primary channel.
+ * We distribute the interrupt loads to one or more NUMA nodes based on
+ * the channel's affinity_policy.
  *
  * For pre-win8 hosts or non-performance critical channels we assign the
  * first CPU in the first NUMA node.
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 93bd6fcd6e62..2048f3c3b68a 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -844,7 +844,7 @@ struct vmbus_channel {
 
/*
 * NUMA distribution policy:
-* We support teo policies:
+* We support two policies:
 * 1) Balanced: Here all performance critical channels are
 *distributed evenly amongst all the NUMA nodes.
 *This policy will be the default policy.
-- 
2.15.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 char-misc 1/1] Drivers: hv: vmbus: Implement Direct Mode for stimer0

2018-01-26 Thread Greg KH
On Fri, Jan 26, 2018 at 05:34:28PM +, Michael Kelley (EOSG) wrote:
> > -Original Message-
> > From: Greg KH [mailto:gre...@linuxfoundation.org]
> > Sent: Thursday, January 25, 2018 2:00 AM
> > To: Michael Kelley (EOSG) 
> > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; 
> > o...@aepfle.de;
> > a...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com;
> > leann.ogasaw...@canonical.com; marcelo.ce...@canonical.com; Stephen 
> > Hemminger
> > ; KY Srinivasan ; 
> > x...@kernel.org;
> > j...@pun.org
> > Subject: Re: [PATCH v2 char-misc 1/1] Drivers: hv: vmbus: Implement Direct 
> > Mode for stimer0
> > 
> > On Mon, Jan 22, 2018 at 03:29:29PM -0700, mikel...@exchange.microsoft.com 
> > wrote:
> > > +/*
> > > + * If false, we're using the old mechanism for stimer0 interrupts
> > > + * where it sends a VMbus message when it expires. The old
> > > + * mechanism is used if Direct Mode is explicitly disabled
> > > + * by the module parameter, or on older versions of Hyper-V
> > > + * that don't support Direct Mode. While Hyper-V provides
> > > + * four stimer's per CPU, Linux uses only stimer0.
> > > + */
> > > +static bool direct_mode_enabled = true;
> > > +module_param(direct_mode_enabled, bool, 0444);
> > > +MODULE_PARM_DESC(direct_mode_enabled,
> > > + "Set to N to disable stimer Direct Mode.");
> > 
> > Ick ick ick.  How is a distro or user supposed to know if/when to enable
> > this and not to enable it?  This isn't ok, can you please make this
> > "automatic" to always do the right thing based on what it is running on?
> 
> To be clear, this patch already does the "automatic" thing based on the
> capabilities of the hypervisor.  But it's often handy to be able to override
> the automatic behavior without having to rebuild the kernel.

Then put the option somewhere else.  sysfs, debugfs, somewhere else.
Never a module parameter please, not for new code.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC PATCH 0/2] hv_netvsc: Fix shutdown regression on Win2012 hosts

2018-01-26 Thread Stephen Hemminger
On Tue, 23 Jan 2018 10:34:03 +0100
Mohammed Gamal  wrote:

> Commit 0cf737808ae7 ("hv_netvsc: netvsc_teardown_gpadl() split") introduced
> a regression that caused VMs not to shutdown after netvsc_device_remove() is
> called. This is caused by GPADL teardown sequence change, and while that was 
> necessary to fix issues with Win2016 hosts, it did introduce a regression for
> earlier versions.
> 
> Prior to commit 0cf737808 the call sequence in netvsc_device_remove() was as 
> follows (as implemented in netvsc_destroy_buf()):
> 1- Send NVSP_MSG1_TYPE_REVOKE_RECV_BUF message
> 2- Teardown receive buffer GPADL
> 3- Send NVSP_MSG1_TYPE_REVOKE_SEND_BUF message
> 4- Teardown send buffer GPADL
> 5- Close vmbus
> 
> This didn't work for WS2016 hosts. Commit 0cf737808 split netvsc_destroy_buf()
> into two functions and rearranged the order as follows
> 1- Send NVSP_MSG1_TYPE_REVOKE_RECV_BUF message
> 2- Send NVSP_MSG1_TYPE_REVOKE_SEND_BUF message
> 3- Close vmbus
> 4- Teardown receive buffer GPADL
> 5- Teardown send buffer GPADL
> 
> That worked well for WS2016 hosts, but for WS2012 hosts it prevented VMs from
> shutting down. 
> 
> This patch series works around this problem. The first patch splits
> netvsc_revoke_buf() and netvsc_teardown_gpadl() into two finer grained
> functions for tearing down send and receive buffers individally. The second 
> patch
> uses the finer grained functions to implement the teardown sequence according 
> to
> the host's version. We keep the behavior introduced in 0cf737808ae7 for 
> Windows
> 2016 hosts, while we re-introduce the old sequence for earlier verions.
> 
> Mohammed Gamal (2):
>   hv_netvsc: Split netvsc_revoke_buf() and netvsc_teardown_gpadl()
>   hv_netvsc: Change GPADL teardown order according to Hyper-V version
> 
>  drivers/net/hyperv/netvsc.c | 50 
> +
>  1 file changed, 42 insertions(+), 8 deletions(-)
> 

What I am experimenting with is sending an NDIS_RESET (instead of setting 
packet filter)
as part of the close processing. This seems more like what the description of 
what Windows
driver does and matches my reading of the public RNDIS specification.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3] staging: android: ion: Zero CMA allocated memory

2018-01-26 Thread Liam Mark
Since commit 204f672255c2 ("staging: android: ion: Use CMA APIs directly")
the CMA API is now used directly and therefore the allocated memory is no
longer automatically zeroed.

Explicitly zero CMA allocated memory to ensure that no data is exposed to
userspace.

Fixes: 204f672255c2 ("staging: android: ion: Use CMA APIs directly")
Signed-off-by: Liam Mark 
---
Changes in v2:
  - Clean up the commit message.
  - Add 'Fixes:'

Changes in v3:
 - Add support for highmem pages

 drivers/staging/android/ion/ion_cma_heap.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/drivers/staging/android/ion/ion_cma_heap.c 
b/drivers/staging/android/ion/ion_cma_heap.c
index 86196ffd2faf..fa3e4b7e0c9f 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "ion.h"
 
@@ -51,6 +52,22 @@ static int ion_cma_allocate(struct ion_heap *heap, struct 
ion_buffer *buffer,
if (!pages)
return -ENOMEM;
 
+   if (PageHighMem(pages)) {
+   unsigned long nr_clear_pages = nr_pages;
+   struct page *page = pages;
+
+   while (nr_clear_pages > 0) {
+   void *vaddr = kmap_atomic(page);
+
+   memset(vaddr, 0, PAGE_SIZE);
+   kunmap_atomic(vaddr);
+   page++;
+   nr_clear_pages--;
+   }
+   } else {
+   memset(page_address(pages), 0, size);
+   }
+
table = kmalloc(sizeof(*table), GFP_KERNEL);
if (!table)
goto err;
-- 
1.8.5.2


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v2 char-misc 1/1] Drivers: hv: vmbus: Implement Direct Mode for stimer0

2018-01-26 Thread Michael Kelley (EOSG)
> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Thursday, January 25, 2018 2:00 AM
> To: Michael Kelley (EOSG) 
> Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; 
> o...@aepfle.de;
> a...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com;
> leann.ogasaw...@canonical.com; marcelo.ce...@canonical.com; Stephen Hemminger
> ; KY Srinivasan ; x...@kernel.org;
> j...@pun.org
> Subject: Re: [PATCH v2 char-misc 1/1] Drivers: hv: vmbus: Implement Direct 
> Mode for stimer0
> 
> On Mon, Jan 22, 2018 at 03:29:29PM -0700, mikel...@exchange.microsoft.com 
> wrote:
> > +/*
> > + * If false, we're using the old mechanism for stimer0 interrupts
> > + * where it sends a VMbus message when it expires. The old
> > + * mechanism is used if Direct Mode is explicitly disabled
> > + * by the module parameter, or on older versions of Hyper-V
> > + * that don't support Direct Mode. While Hyper-V provides
> > + * four stimer's per CPU, Linux uses only stimer0.
> > + */
> > +static bool direct_mode_enabled = true;
> > +module_param(direct_mode_enabled, bool, 0444);
> > +MODULE_PARM_DESC(direct_mode_enabled,
> > +   "Set to N to disable stimer Direct Mode.");
> 
> Ick ick ick.  How is a distro or user supposed to know if/when to enable
> this and not to enable it?  This isn't ok, can you please make this
> "automatic" to always do the right thing based on what it is running on?

To be clear, this patch already does the "automatic" thing based on the
capabilities of the hypervisor.  But it's often handy to be able to override
the automatic behavior without having to rebuild the kernel.

> 
> Module parameters are not a good idea as they are impossible to maintain
> and document and use over time.  Please never add new ones to the
> kernel.
> 

Is there a better alternative for providing an "override" capability?
Having an override isn't super important in this case, so I'll drop the
parameter, but it would be nice to have something easier than a rebuild.

Michael

> thanks,
> 
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: media: remove unused VIDEO_ATOMISP_OV8858 kconfig

2018-01-26 Thread Andy Shevchenko
On Fri, Jan 26, 2018 at 2:49 PM, LABBE Corentin  wrote:
> On Tue, Jan 23, 2018 at 07:20:12PM +0100, Greg Kroah-Hartman wrote:
>> On Tue, Jan 23, 2018 at 07:31:27PM +0200, Andy Shevchenko wrote:
>> > On Tue, Jan 23, 2018 at 4:37 PM, Corentin Labbe  
>> > wrote:
>> > > Nothing in kernel use VIDEO_ATOMISP_OV8858 since commit 3a81c7660f80 
>> > > ("media: staging: atomisp: Remove IMX sensor support")
>> > > Lets remove this kconfig option.
>> >
>> > First of all, I hardly understand how that change is related.
>> > Second, did you check Makefile?
>>
>> I don't see it being used in any Makefile, what file do you see it:
>>   $ git grep VIDEO_ATOMISP_OV8858
>>   drivers/staging/media/atomisp/i2c/Kconfig:config VIDEO_ATOMISP_OV8858
>>
>> So it should be removed.
>>
>> thanks,

> I just see that 3a81c7660f80 left ov8858.c so do you agree that I send a v2 
> which remove also this file ?
> av8858.c is useless without dw9718.c and vcm.c which 3a81c7660f80 removed.

Removal of dead code is pretty fine to me, though the decision is to
Alan and Sakari.

-- 
With Best Regards,
Andy Shevchenko
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] media: staging: atomisp: remove redundant assignments to various variables

2018-01-26 Thread Colin King
From: Colin Ian King 

There are various assignments that are being made to variables that are
not read and the variables are being updated later on, hence the redundant
assignments can be removed.

Cleans up clang warnings:
drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:1950:8:
warning: Value stored to 'pdata' during its initialization is never read
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:1853:29:
warning: Value stored to 'asd' during its initialization is never read
drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c:4505:29:
warning: Value stored to 'asd' during its initialization is never read
drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c:1139:30:
warning: Value stored to 'asd' during its initialization is never read
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c:6961:27:
warning: Value stored to 'tmp_in_info' during its initialization is
never read

Signed-off-by: Colin Ian King 
---
 drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c | 2 +-
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c  | 2 +-
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c | 2 +-
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c | 1 -
 drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c   | 2 +-
 5 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c 
b/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c
index 40d01bf4bf28..ba0c584d5be7 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c
+++ b/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c
@@ -1947,7 +1947,7 @@ static int ov5693_probe(struct i2c_client *client)
struct ov5693_device *dev;
int i2c;
int ret = 0;
-   void *pdata = client->dev.platform_data;
+   void *pdata;
unsigned int i;
 
/*
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c 
b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index debf0e3853ff..ddad1231f2e5 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -1850,7 +1850,7 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr)
bool frame_done_found[MAX_STREAM_NUM] = {0};
bool css_pipe_done[MAX_STREAM_NUM] = {0};
unsigned int i;
-   struct atomisp_sub_device *asd = >asd[0];
+   struct atomisp_sub_device *asd;
 
dev_dbg(isp->dev, ">%s\n", __func__);
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c 
b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
index b7f9da014641..7621b4537147 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
@@ -4502,7 +4502,7 @@ int atomisp_css_isr_thread(struct atomisp_device *isp,
 {
enum atomisp_input_stream_id stream_id = 0;
struct atomisp_css_event current_event;
-   struct atomisp_sub_device *asd = >asd[0];
+   struct atomisp_sub_device *asd;
 #ifndef ISP2401
bool reset_wdt_timer[MAX_STREAM_NUM] = {false};
 #endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c 
b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
index 548e00e7d67b..ba20344ec560 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
@@ -1137,7 +1137,6 @@ static int init_atomisp_wdts(struct atomisp_device *isp)
 
for (i = 0; i < isp->num_of_streams; i++) {
struct atomisp_sub_device *asd = >asd[i];
-   asd = >asd[i];
 #ifndef ISP2401
timer_setup(>wdt, atomisp_wdt, 0);
 #else
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index 322bb3de6098..b3300969089b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -6958,7 +6958,7 @@ static enum ia_css_err 
ia_css_pipe_create_cas_scaler_desc_single_output(
unsigned int i;
unsigned int hor_ds_factor = 0, ver_ds_factor = 0;
enum ia_css_err err = IA_CSS_SUCCESS;
-   struct ia_css_frame_info tmp_in_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO;
+   struct ia_css_frame_info tmp_in_info;
 
unsigned max_scale_factor_per_stage = MAX_PREFERRED_YUV_DS_PER_STEP;
 
-- 
2.15.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v5 1/2] staging: fsl-mc: Move core bus out of staging

2018-01-26 Thread Bogdan Purcareata
> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Friday, January 26, 2018 4:06 PM
> To: Bogdan Purcareata 
> Cc: Laurentiu Tudor ; Ruxandra Ioana Ciocoi Radulescu
> ; stuyo...@gmail.com; a...@arndb.de;
> r...@kernel.org; Ioana Ciornei ; Nipun Gupta
> ; Roy Pledge ; Horia Geantă
> ; marc.zyng...@arm.com; t...@linutronix.de;
> ja...@lakedaemon.net; de...@driverdev.osuosl.org; 
> linux-ker...@vger.kernel.org;
> linux-arm-ker...@lists.infradead.org
> Subject: Re: [PATCH v5 1/2] staging: fsl-mc: Move core bus out of staging
> 
> On Fri, Jan 26, 2018 at 06:51:26AM -0600, Bogdan Purcareata wrote:
> > Move the source files out of staging into their final locations:
> >   -mc.h include file in drivers/staging/fsl-mc/include go to
> include/linux/fsl
> >   -source files in drivers/staging/fsl-mc/bus go to drivers/bus/fsl-mc
> >   -overview.rst, providing an overview of DPAA2, goes to
> >Documentation/networking/dpaa2/overview.rst
> >
> > Update or delete other remaining staging files -- Makefile, Kconfig, TODO.
> > Update dpaa2_eth and dpio staging drivers.
> > Add integration bits for the documentation build system.
> >
> > Signed-off-by: Stuart Yoder 
> > [rebased, add dpaa2_eth and dpio #include updates]
> > Signed-off-by: Laurentiu Tudor 
> > [rebased, split irqchip to separate patch]
> > Signed-off-by: Bogdan Purcareata 
> > Cc: Thomas Gleixner 
> > Cc: Jason Cooper 
> > Cc: Marc Zyngier 
> > ---
> > Notes:
> > -v5:
> >   - split irqchip glue code to separate patch (GregKH)
> >   - integrate doc with the kernel build system
> > -v4:
> >   - regenerated patch with renames detection disabled (Andrew Lunn)
> > -v3:
> >   - rebased
> > -v2:
> >   - group irqchip gic its glue code together with the rest (Marc 
> > Zyngier)
> >
> >  Documentation/networking/dpaa2/index.rst   |   8 +
> >  Documentation/networking/dpaa2/overview.rst| 404 +
> >  Documentation/networking/index.rst |   1 +
> >  MAINTAINERS|   3 +-
> >  drivers/bus/Kconfig|   2 +
> >  drivers/bus/Makefile   |   4 +
> >  drivers/bus/fsl-mc/Kconfig |  16 +
> >  drivers/bus/fsl-mc/Makefile|  16 +
> >  drivers/bus/fsl-mc/dpmcp.c |  99 +++
> >  drivers/bus/fsl-mc/dprc-driver.c   | 809 ++
> >  drivers/bus/fsl-mc/dprc.c  | 532 
> >  drivers/bus/fsl-mc/fsl-mc-allocator.c  | 648 ++
> >  drivers/bus/fsl-mc/fsl-mc-bus.c| 948
> +
> >  drivers/bus/fsl-mc/fsl-mc-msi.c| 285 +++
> >  drivers/bus/fsl-mc/fsl-mc-private.h| 475 +++
> >  drivers/bus/fsl-mc/mc-io.c | 268 ++
> >  drivers/bus/fsl-mc/mc-sys.c| 296 +++
> >  drivers/staging/fsl-dpaa2/ethernet/README  |   2 +-
> >  drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c |   2 +-
> >  drivers/staging/fsl-dpaa2/ethernet/dpni.c  |   2 +-
> >  drivers/staging/fsl-mc/TODO|  18 -
> >  drivers/staging/fsl-mc/bus/Kconfig |  10 -
> >  drivers/staging/fsl-mc/bus/Makefile|  16 +-
> >  drivers/staging/fsl-mc/bus/dpbp.c  |   2 +-
> >  drivers/staging/fsl-mc/bus/dpcon.c |   2 +-
> >  drivers/staging/fsl-mc/bus/dpio/dpio-driver.c  |   2 +-
> >  drivers/staging/fsl-mc/bus/dpio/dpio-service.c |   2 +-
> >  drivers/staging/fsl-mc/bus/dpio/dpio.c |   2 +-
> >  drivers/staging/fsl-mc/bus/dpmcp.c |  99 ---
> >  drivers/staging/fsl-mc/bus/dprc-driver.c   | 809 --
> >  drivers/staging/fsl-mc/bus/dprc.c  | 531 
> >  drivers/staging/fsl-mc/bus/fsl-mc-allocator.c  | 648 --
> >  drivers/staging/fsl-mc/bus/fsl-mc-bus.c| 948 
> > ---
> --
> >  drivers/staging/fsl-mc/bus/fsl-mc-msi.c| 284 --
> >  drivers/staging/fsl-mc/bus/fsl-mc-private.h| 475 ---
> >  .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   2 +-
> >  drivers/staging/fsl-mc/bus/mc-io.c | 268 --
> >  drivers/staging/fsl-mc/bus/mc-sys.c| 296 ---
> >  drivers/staging/fsl-mc/include/mc.h| 454 --
> >  drivers/staging/fsl-mc/overview.rst| 404 -
> >  include/linux/fsl/mc.h | 454 ++
> >  41 

Re: [PATCH v5 1/2] staging: fsl-mc: Move core bus out of staging

2018-01-26 Thread Greg KH
On Fri, Jan 26, 2018 at 06:51:26AM -0600, Bogdan Purcareata wrote:
> Move the source files out of staging into their final locations:
>   -mc.h include file in drivers/staging/fsl-mc/include go to include/linux/fsl
>   -source files in drivers/staging/fsl-mc/bus go to drivers/bus/fsl-mc
>   -overview.rst, providing an overview of DPAA2, goes to
>Documentation/networking/dpaa2/overview.rst
> 
> Update or delete other remaining staging files -- Makefile, Kconfig, TODO.
> Update dpaa2_eth and dpio staging drivers.
> Add integration bits for the documentation build system.
> 
> Signed-off-by: Stuart Yoder 
> [rebased, add dpaa2_eth and dpio #include updates]
> Signed-off-by: Laurentiu Tudor 
> [rebased, split irqchip to separate patch]
> Signed-off-by: Bogdan Purcareata 
> Cc: Thomas Gleixner 
> Cc: Jason Cooper 
> Cc: Marc Zyngier 
> ---
> Notes:
> -v5:
>   - split irqchip glue code to separate patch (GregKH)
>   - integrate doc with the kernel build system
> -v4:
>   - regenerated patch with renames detection disabled (Andrew Lunn)
> -v3:
>   - rebased
> -v2:
>   - group irqchip gic its glue code together with the rest (Marc Zyngier)
> 
>  Documentation/networking/dpaa2/index.rst   |   8 +
>  Documentation/networking/dpaa2/overview.rst| 404 +
>  Documentation/networking/index.rst |   1 +
>  MAINTAINERS|   3 +-
>  drivers/bus/Kconfig|   2 +
>  drivers/bus/Makefile   |   4 +
>  drivers/bus/fsl-mc/Kconfig |  16 +
>  drivers/bus/fsl-mc/Makefile|  16 +
>  drivers/bus/fsl-mc/dpmcp.c |  99 +++
>  drivers/bus/fsl-mc/dprc-driver.c   | 809 ++
>  drivers/bus/fsl-mc/dprc.c  | 532 
>  drivers/bus/fsl-mc/fsl-mc-allocator.c  | 648 ++
>  drivers/bus/fsl-mc/fsl-mc-bus.c| 948 
> +
>  drivers/bus/fsl-mc/fsl-mc-msi.c| 285 +++
>  drivers/bus/fsl-mc/fsl-mc-private.h| 475 +++
>  drivers/bus/fsl-mc/mc-io.c | 268 ++
>  drivers/bus/fsl-mc/mc-sys.c| 296 +++
>  drivers/staging/fsl-dpaa2/ethernet/README  |   2 +-
>  drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c |   2 +-
>  drivers/staging/fsl-dpaa2/ethernet/dpni.c  |   2 +-
>  drivers/staging/fsl-mc/TODO|  18 -
>  drivers/staging/fsl-mc/bus/Kconfig |  10 -
>  drivers/staging/fsl-mc/bus/Makefile|  16 +-
>  drivers/staging/fsl-mc/bus/dpbp.c  |   2 +-
>  drivers/staging/fsl-mc/bus/dpcon.c |   2 +-
>  drivers/staging/fsl-mc/bus/dpio/dpio-driver.c  |   2 +-
>  drivers/staging/fsl-mc/bus/dpio/dpio-service.c |   2 +-
>  drivers/staging/fsl-mc/bus/dpio/dpio.c |   2 +-
>  drivers/staging/fsl-mc/bus/dpmcp.c |  99 ---
>  drivers/staging/fsl-mc/bus/dprc-driver.c   | 809 --
>  drivers/staging/fsl-mc/bus/dprc.c  | 531 
>  drivers/staging/fsl-mc/bus/fsl-mc-allocator.c  | 648 --
>  drivers/staging/fsl-mc/bus/fsl-mc-bus.c| 948 
> -
>  drivers/staging/fsl-mc/bus/fsl-mc-msi.c| 284 --
>  drivers/staging/fsl-mc/bus/fsl-mc-private.h| 475 ---
>  .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   2 +-
>  drivers/staging/fsl-mc/bus/mc-io.c | 268 --
>  drivers/staging/fsl-mc/bus/mc-sys.c| 296 ---
>  drivers/staging/fsl-mc/include/mc.h| 454 --
>  drivers/staging/fsl-mc/overview.rst| 404 -
>  include/linux/fsl/mc.h | 454 ++
>  41 files changed, 5279 insertions(+), 5267 deletions(-)
>  create mode 100644 Documentation/networking/dpaa2/index.rst
>  create mode 100644 Documentation/networking/dpaa2/overview.rst
>  create mode 100644 drivers/bus/fsl-mc/Kconfig
>  create mode 100644 drivers/bus/fsl-mc/Makefile
>  create mode 100644 drivers/bus/fsl-mc/dpmcp.c
>  create mode 100644 drivers/bus/fsl-mc/dprc-driver.c
>  create mode 100644 drivers/bus/fsl-mc/dprc.c
>  create mode 100644 drivers/bus/fsl-mc/fsl-mc-allocator.c
>  create mode 100644 drivers/bus/fsl-mc/fsl-mc-bus.c
>  create mode 100644 drivers/bus/fsl-mc/fsl-mc-msi.c
>  create mode 100644 drivers/bus/fsl-mc/fsl-mc-private.h
>  create mode 100644 drivers/bus/fsl-mc/mc-io.c
>  create mode 100644 drivers/bus/fsl-mc/mc-sys.c
>  delete mode 100644 drivers/staging/fsl-mc/TODO
>  delete mode 100644 drivers/staging/fsl-mc/bus/dpmcp.c
>  delete mode 100644 

[PATCH] staging: rtlwifi: remove redundant initialization of 'cfg_cmd'

2018-01-26 Thread Colin King
From: Colin Ian King 

The initialization of cfg_cmd is redundant as the value is never read
and it is being re-assigned to cfg_cmd = pwrcfgcmd[ary_idx] inside a
loop, hence it can be removed.

Cleans up clang warning:
drivers/staging/rtlwifi/core.c:1819:22: warning: Value stored to
'cfg_cmd' during its initialization is never read

Signed-off-by: Colin Ian King 
---
 drivers/staging/rtlwifi/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtlwifi/core.c b/drivers/staging/rtlwifi/core.c
index a43d37452e8b..3ec039498208 100644
--- a/drivers/staging/rtlwifi/core.c
+++ b/drivers/staging/rtlwifi/core.c
@@ -1816,7 +1816,7 @@ bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, 
u8 cut_version,
  u8 faversion, u8 interface_type,
  struct wlan_pwr_cfg pwrcfgcmd[])
 {
-   struct wlan_pwr_cfg cfg_cmd = {0};
+   struct wlan_pwr_cfg cfg_cmd;
bool polling_bit = false;
u32 ary_idx = 0;
u8 value = 0;
-- 
2.15.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v5 2/2] staging: fsl-mc: Move irqchip code out of staging

2018-01-26 Thread Marc Zyngier
On 26/01/18 12:51, Bogdan Purcareata wrote:
> Now that the fsl-mc bus core infrastructure is out of staging, the
> remaining irqchip glue code used (irq-gic-v3-its-fsl-mc-msi.c) goes
> to drivers/irqchip.
> 
> Signed-off-by: Stuart Yoder 
> [rebased, add dpaa2_eth and dpio #include updates]
> Signed-off-by: Laurentiu Tudor 
> [rebased, split irqchip to separate patch]
> Signed-off-by: Bogdan Purcareata 
> Cc: Thomas Gleixner 
> Cc: Jason Cooper 
> Cc: Marc Zyngier 
> ---
> Notes:
> -v5:
>   - split irqchip glue code to separate patch (GregKH)
> -v4 - v1:
>   - no change
> 
>  drivers/irqchip/Makefile   |   1 +
>  drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c| 100 
> +
>  drivers/staging/fsl-mc/bus/Makefile|   3 +-
>  .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 100 
> -
>  4 files changed, 102 insertions(+), 102 deletions(-)
>  create mode 100644 drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c
>  delete mode 100644 drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
> 
> diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
> index d2df34a..641d8a4 100644
> --- a/drivers/irqchip/Makefile
> +++ b/drivers/irqchip/Makefile
> @@ -32,6 +32,7 @@ obj-$(CONFIG_ARM_GIC_V2M)   += irq-gic-v2m.o
>  obj-$(CONFIG_ARM_GIC_V3) += irq-gic-v3.o irq-gic-common.o
>  obj-$(CONFIG_ARM_GIC_V3_ITS) += irq-gic-v3-its.o 
> irq-gic-v3-its-platform-msi.o irq-gic-v4.o
>  obj-$(CONFIG_ARM_GIC_V3_ITS_PCI) += irq-gic-v3-its-pci-msi.o
> +obj-$(CONFIG_FSL_MC_BUS) += irq-gic-v3-its-fsl-mc-msi.o
>  obj-$(CONFIG_PARTITION_PERCPU)   += irq-partition-percpu.o
>  obj-$(CONFIG_HISILICON_IRQ_MBIGEN)   += irq-mbigen.o
>  obj-$(CONFIG_ARM_NVIC)   += irq-nvic.o
> diff --git a/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c 
> b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c
> new file mode 100644
> index 000..b365fbb
> --- /dev/null
> +++ b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c
> @@ -0,0 +1,100 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Freescale Management Complex (MC) bus driver MSI support
> + *
> + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
> + * Author: German Rivera 
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +static struct irq_chip its_msi_irq_chip = {
> + .name = "ITS-fMSI",
> + .irq_mask = irq_chip_mask_parent,
> + .irq_unmask = irq_chip_unmask_parent,
> + .irq_eoi = irq_chip_eoi_parent,
> + .irq_set_affinity = msi_domain_set_affinity
> +};
> +
> +static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
> +   struct device *dev,
> +   int nvec, msi_alloc_info_t *info)
> +{
> + struct fsl_mc_device *mc_bus_dev;
> + struct msi_domain_info *msi_info;
> +
> + if (!dev_is_fsl_mc(dev))
> + return -EINVAL;
> +
> + mc_bus_dev = to_fsl_mc_device(dev);
> + if (!(mc_bus_dev->flags & FSL_MC_IS_DPRC))
> + return -EINVAL;
> +
> + /*
> +  * Set the device Id to be passed to the GIC-ITS:
> +  *
> +  * NOTE: This device id corresponds to the IOMMU stream ID
> +  * associated with the DPRC object (ICID).
> +  */
> +#ifdef GENERIC_MSI_DOMAIN_OPS
> + info->scratchpad[0].ul = mc_bus_dev->icid;
> +#endif

I'd really like to avoid this kind of condition in irqchip drivers.
Either the architecture you're targeting this at can deal with it, and
you can compile this driver, or it doesn't, and you really shouldn't
offer it. And given that this thing is 100% specific to the ARM GICv3
ITS, you should really have a dependency on it.

Thanks,

M.
-- 
Jazz is not dead. It just smells funny...
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v5 0/2] staging: fsl-mc: Move bus driver out of staging

2018-01-26 Thread Bogdan Purcareata
Previous submission: https://patchwork.kernel.org/patch/10081731/

Most of the feedback was addressed by a separate series of cleanup
/ refactoring patches [1] which were applied.

The thing left to do is to split the original patch into moving out the
core bus infrastructure separate from the irqchip glue code, and
integrate the documentation with the kernel build system.

This patchset only handles moving the fsl-mc bus core out of staging.
The remaining objects (DPBP, DPCON) and drivers (dpio, dpaa2-eth) will
be moved out in subsequent patches.

[1] https://lkml.org/lkml/2018/1/16/386

Notes:
-v5:
  - split irqchip glue code to separate patch (GregKH)
  - integrate doc with the kernel build system
-v4:
  - regenerated patch with renames detection disabled (Andrew Lunn)
-v3:
  - rebased
-v2:
  - group irqchip gic its glue code together with the rest (Marc Zyngier)

Bogdan Purcareata (2):
  staging: fsl-mc: Move core bus out of staging
  staging: fsl-mc: Move irqchip code out of staging

 Documentation/networking/dpaa2/index.rst   |   8 +
 Documentation/networking/dpaa2/overview.rst| 404 +
 Documentation/networking/index.rst |   1 +
 MAINTAINERS|   3 +-
 drivers/bus/Kconfig|   2 +
 drivers/bus/Makefile   |   4 +
 drivers/bus/fsl-mc/Kconfig |  16 +
 drivers/bus/fsl-mc/Makefile|  16 +
 drivers/bus/fsl-mc/dpmcp.c |  99 +++
 drivers/bus/fsl-mc/dprc-driver.c   | 809 ++
 drivers/bus/fsl-mc/dprc.c  | 532 
 drivers/bus/fsl-mc/fsl-mc-allocator.c  | 648 ++
 drivers/bus/fsl-mc/fsl-mc-bus.c| 948 +
 drivers/bus/fsl-mc/fsl-mc-msi.c| 285 +++
 drivers/bus/fsl-mc/fsl-mc-private.h| 475 +++
 drivers/bus/fsl-mc/mc-io.c | 268 ++
 drivers/bus/fsl-mc/mc-sys.c| 296 +++
 drivers/irqchip/Makefile   |   1 +
 drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c| 100 +++
 drivers/staging/fsl-dpaa2/ethernet/README  |   2 +-
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c |   2 +-
 drivers/staging/fsl-dpaa2/ethernet/dpni.c  |   2 +-
 drivers/staging/fsl-mc/TODO|  18 -
 drivers/staging/fsl-mc/bus/Kconfig |  10 -
 drivers/staging/fsl-mc/bus/Makefile|  15 +-
 drivers/staging/fsl-mc/bus/dpbp.c  |   2 +-
 drivers/staging/fsl-mc/bus/dpcon.c |   2 +-
 drivers/staging/fsl-mc/bus/dpio/dpio-driver.c  |   2 +-
 drivers/staging/fsl-mc/bus/dpio/dpio-service.c |   2 +-
 drivers/staging/fsl-mc/bus/dpio/dpio.c |   2 +-
 drivers/staging/fsl-mc/bus/dpmcp.c |  99 ---
 drivers/staging/fsl-mc/bus/dprc-driver.c   | 809 --
 drivers/staging/fsl-mc/bus/dprc.c  | 531 
 drivers/staging/fsl-mc/bus/fsl-mc-allocator.c  | 648 --
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c| 948 -
 drivers/staging/fsl-mc/bus/fsl-mc-msi.c| 284 --
 drivers/staging/fsl-mc/bus/fsl-mc-private.h| 475 ---
 .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 100 ---
 drivers/staging/fsl-mc/bus/mc-io.c | 268 --
 drivers/staging/fsl-mc/bus/mc-sys.c| 296 ---
 drivers/staging/fsl-mc/include/mc.h| 454 --
 drivers/staging/fsl-mc/overview.rst| 404 -
 include/linux/fsl/mc.h | 454 ++
 43 files changed, 5378 insertions(+), 5366 deletions(-)
 create mode 100644 Documentation/networking/dpaa2/index.rst
 create mode 100644 Documentation/networking/dpaa2/overview.rst
 create mode 100644 drivers/bus/fsl-mc/Kconfig
 create mode 100644 drivers/bus/fsl-mc/Makefile
 create mode 100644 drivers/bus/fsl-mc/dpmcp.c
 create mode 100644 drivers/bus/fsl-mc/dprc-driver.c
 create mode 100644 drivers/bus/fsl-mc/dprc.c
 create mode 100644 drivers/bus/fsl-mc/fsl-mc-allocator.c
 create mode 100644 drivers/bus/fsl-mc/fsl-mc-bus.c
 create mode 100644 drivers/bus/fsl-mc/fsl-mc-msi.c
 create mode 100644 drivers/bus/fsl-mc/fsl-mc-private.h
 create mode 100644 drivers/bus/fsl-mc/mc-io.c
 create mode 100644 drivers/bus/fsl-mc/mc-sys.c
 create mode 100644 drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c
 delete mode 100644 drivers/staging/fsl-mc/TODO
 delete mode 100644 drivers/staging/fsl-mc/bus/dpmcp.c
 delete mode 100644 drivers/staging/fsl-mc/bus/dprc-driver.c
 delete mode 100644 drivers/staging/fsl-mc/bus/dprc.c
 delete mode 100644 drivers/staging/fsl-mc/bus/fsl-mc-allocator.c
 delete mode 100644 drivers/staging/fsl-mc/bus/fsl-mc-bus.c
 delete 

[PATCH v5 2/2] staging: fsl-mc: Move irqchip code out of staging

2018-01-26 Thread Bogdan Purcareata
Now that the fsl-mc bus core infrastructure is out of staging, the
remaining irqchip glue code used (irq-gic-v3-its-fsl-mc-msi.c) goes
to drivers/irqchip.

Signed-off-by: Stuart Yoder 
[rebased, add dpaa2_eth and dpio #include updates]
Signed-off-by: Laurentiu Tudor 
[rebased, split irqchip to separate patch]
Signed-off-by: Bogdan Purcareata 
Cc: Thomas Gleixner 
Cc: Jason Cooper 
Cc: Marc Zyngier 
---
Notes:
-v5:
  - split irqchip glue code to separate patch (GregKH)
-v4 - v1:
  - no change

 drivers/irqchip/Makefile   |   1 +
 drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c| 100 +
 drivers/staging/fsl-mc/bus/Makefile|   3 +-
 .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 100 -
 4 files changed, 102 insertions(+), 102 deletions(-)
 create mode 100644 drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c
 delete mode 100644 drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c

diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
index d2df34a..641d8a4 100644
--- a/drivers/irqchip/Makefile
+++ b/drivers/irqchip/Makefile
@@ -32,6 +32,7 @@ obj-$(CONFIG_ARM_GIC_V2M) += irq-gic-v2m.o
 obj-$(CONFIG_ARM_GIC_V3)   += irq-gic-v3.o irq-gic-common.o
 obj-$(CONFIG_ARM_GIC_V3_ITS)   += irq-gic-v3-its.o 
irq-gic-v3-its-platform-msi.o irq-gic-v4.o
 obj-$(CONFIG_ARM_GIC_V3_ITS_PCI)   += irq-gic-v3-its-pci-msi.o
+obj-$(CONFIG_FSL_MC_BUS)   += irq-gic-v3-its-fsl-mc-msi.o
 obj-$(CONFIG_PARTITION_PERCPU) += irq-partition-percpu.o
 obj-$(CONFIG_HISILICON_IRQ_MBIGEN) += irq-mbigen.o
 obj-$(CONFIG_ARM_NVIC) += irq-nvic.o
diff --git a/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c 
b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c
new file mode 100644
index 000..b365fbb
--- /dev/null
+++ b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c
@@ -0,0 +1,100 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Freescale Management Complex (MC) bus driver MSI support
+ *
+ * Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
+ * Author: German Rivera 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static struct irq_chip its_msi_irq_chip = {
+   .name = "ITS-fMSI",
+   .irq_mask = irq_chip_mask_parent,
+   .irq_unmask = irq_chip_unmask_parent,
+   .irq_eoi = irq_chip_eoi_parent,
+   .irq_set_affinity = msi_domain_set_affinity
+};
+
+static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain,
+ struct device *dev,
+ int nvec, msi_alloc_info_t *info)
+{
+   struct fsl_mc_device *mc_bus_dev;
+   struct msi_domain_info *msi_info;
+
+   if (!dev_is_fsl_mc(dev))
+   return -EINVAL;
+
+   mc_bus_dev = to_fsl_mc_device(dev);
+   if (!(mc_bus_dev->flags & FSL_MC_IS_DPRC))
+   return -EINVAL;
+
+   /*
+* Set the device Id to be passed to the GIC-ITS:
+*
+* NOTE: This device id corresponds to the IOMMU stream ID
+* associated with the DPRC object (ICID).
+*/
+#ifdef GENERIC_MSI_DOMAIN_OPS
+   info->scratchpad[0].ul = mc_bus_dev->icid;
+#endif
+   msi_info = msi_get_domain_info(msi_domain->parent);
+   return msi_info->ops->msi_prepare(msi_domain->parent, dev, nvec, info);
+}
+
+static struct msi_domain_ops its_fsl_mc_msi_ops __ro_after_init = {
+   .msi_prepare = its_fsl_mc_msi_prepare,
+};
+
+static struct msi_domain_info its_fsl_mc_msi_domain_info = {
+   .flags  = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS),
+   .ops= _fsl_mc_msi_ops,
+   .chip   = _msi_irq_chip,
+};
+
+static const struct of_device_id its_device_id[] = {
+   {   .compatible = "arm,gic-v3-its", },
+   {},
+};
+
+static int __init its_fsl_mc_msi_init(void)
+{
+   struct device_node *np;
+   struct irq_domain *parent;
+   struct irq_domain *mc_msi_domain;
+
+   for (np = of_find_matching_node(NULL, its_device_id); np;
+np = of_find_matching_node(np, its_device_id)) {
+   if (!of_property_read_bool(np, "msi-controller"))
+   continue;
+
+   parent = irq_find_matching_host(np, DOMAIN_BUS_NEXUS);
+   if (!parent || !msi_get_domain_info(parent)) {
+   pr_err("%pOF: unable to locate ITS domain\n", np);
+   continue;
+   }
+
+   mc_msi_domain = fsl_mc_msi_create_irq_domain(
+of_node_to_fwnode(np),
+_fsl_mc_msi_domain_info,
+parent);
+   if (!mc_msi_domain) {
+   

Re: [PATCH] staging: media: remove unused VIDEO_ATOMISP_OV8858 kconfig

2018-01-26 Thread LABBE Corentin
On Tue, Jan 23, 2018 at 07:20:12PM +0100, Greg Kroah-Hartman wrote:
> On Tue, Jan 23, 2018 at 07:31:27PM +0200, Andy Shevchenko wrote:
> > On Tue, Jan 23, 2018 at 4:37 PM, Corentin Labbe  wrote:
> > > Nothing in kernel use VIDEO_ATOMISP_OV8858 since commit 3a81c7660f80 
> > > ("media: staging: atomisp: Remove IMX sensor support")
> > > Lets remove this kconfig option.
> > 
> > First of all, I hardly understand how that change is related.
> > Second, did you check Makefile?
> 
> I don't see it being used in any Makefile, what file do you see it:
>   $ git grep VIDEO_ATOMISP_OV8858
>   drivers/staging/media/atomisp/i2c/Kconfig:config VIDEO_ATOMISP_OV8858
> 
> So it should be removed.
> 
> thanks,
> 

Hello

I just see that 3a81c7660f80 left ov8858.c so do you agree that I send a v2 
which remove also this file ?
av8858.c is useless without dw9718.c and vcm.c which 3a81c7660f80 removed.

Regards
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723bs: remove a couple of redundant initializations

2018-01-26 Thread Colin King
From: Colin Ian King 

The initialization of PwrCfgCmd is redundant as the value is never read
and it is being re-assigned to PwrSeqCmd[AryIdx] inside a loop, hence
it can be removed.  Also, the initialization of ie_ptr is redundant as
the value is never read and it is being re-assigned in either path of
an if statement, hence it can be removed too.

Cleans up clang warnings:
drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c:53:15: warning: Value
stored to 'PwrCfgCmd' during its initialization is never read
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:374:7: warning: Value
stored to 'ie_ptr' during its initialization is never read

Signed-off-by: Colin Ian King 
---
 drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c   | 2 +-
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c 
b/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c
index f4619768a99f..334d680b9b1c 100644
--- a/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c
+++ b/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c
@@ -50,7 +50,7 @@ u8 HalPwrSeqCmdParsing(
WLAN_PWR_CFG PwrSeqCmd[]
 )
 {
-   WLAN_PWR_CFG PwrCfgCmd = {0};
+   WLAN_PWR_CFG PwrCfgCmd;
u8 bPollingBit = false;
u32 AryIdx = 0;
u8 value = 0;
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index da59496f6e04..cc18d0ad7d7b 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -371,7 +371,7 @@ static char *translate_scan(struct adapter *padapter,
u8 *wpsie_ptr = NULL;
uint wps_ielen = 0;
 
-   u8 *ie_ptr = pnetwork->network.IEs + ie_offset;
+   u8 *ie_ptr;
total_ielen = pnetwork->network.IELength - ie_offset;
 
if (pnetwork->network.Reserved[0] == 2) { /*  Probe Request */
-- 
2.15.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel