答复: [PATCHv7 0/5] Add initial support for slimport anx78xx

2016-01-05 Thread Chengxiang Jiao
Hi Enric,

Just to confirm with you.
This version is from https://chromium-review.googlesource.com/#/c/308442/11, 
right?

Chengxiang
2016/1/5


-邮件原件-
发件人: Enric Balletbo i Serra [mailto:eballe...@gmail.com] 
发送时间: 2016年1月4日 5:38
收件人: devicet...@vger.kernel.org; linux-ker...@vger.kernel.org; 
dri-de...@lists.freedesktop.org; de...@driverdev.osuosl.org; tred...@nvidia.com
抄送: robh...@kernel.org; pawel.m...@arm.com; mark.rutl...@arm.com; 
ijc+devicet...@hellion.org.uk; ga...@codeaurora.org; airl...@linux.ie; 
gre...@linuxfoundation.org; sjoerd.sim...@collabora.co.uk; jav...@dowhile0.org; 
Sheng Pan; nathan.ch...@mediatek.com; djku...@chromium.org; 
drink...@chromium.org; laurent.pinch...@ideasonboard.com; 
dan.carpen...@oracle.com; jb.t...@mediatek.com; cawa.ch...@mediatek.com; 
eddie.hu...@mediatek.com; Chengxiang Jiao; emil.l.veli...@gmail.com
主题: [PATCHv7 0/5] Add initial support for slimport anx78xx

Hi all,

This is another version of the patch set to introduce the anx7814 transmitter.
Any comments are welcome.

The following series add initial support for the Slimport ANX7814 transmitter, 
a ultra-low power Full-HD (1080p60) transmitter designed for portable device.

The driver was originally created and based from the work of Junhua Xia from 
Analogix. This driver is a refactor of the original driver and fixes different 
coding style lines, and different errors/warnings reported by checkpatch. Also 
there were things that I noticed that we need to change like:

 - Convert the numbered GPIO API to the new descriptor based GPIO API.
 - Review the DT binding
 - Add missing MODULE_DEVICE_TABLE(of, ...);
 - Fix Makefiles and Kconfig to build conditionally.
 - Use SIMPLE_DEV_PM_OPS() instead of the deprecated i2c .suspend and
  .resume callbacks.
 - Move to use managed device resources.
 - Remove dead/unused code.
 - And others ...

Enric Balletbo i Serra (5):
  drm/dp: add DPCD definitions from DP 1.1
  hdmi: added functions for MPEG InfoFrames
  of: Add vendor prefix for Analogix Semiconductor, Inc.
  devicetree: Add new ANX7814 SlimPort transmitter binding.
  drm: bridge: anx78xx: Add anx78xx driver support by analogix.

 .../devicetree/bindings/vendor-prefixes.txt|1 +
 .../devicetree/bindings/video/bridge/anx7814.txt   |   39 +
 drivers/gpu/drm/bridge/Kconfig |2 +
 drivers/gpu/drm/bridge/Makefile|1 +
 drivers/gpu/drm/bridge/anx78xx/Kconfig |5 +
 drivers/gpu/drm/bridge/anx78xx/Makefile|4 +
 drivers/gpu/drm/bridge/anx78xx/anx78xx.h   |   44 +
 drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c  |  334 ++
 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.c   | 3194 
 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.h   |  110 +
 drivers/gpu/drm/bridge/anx78xx/slimport_tx_reg.h   |  737 +
 drivers/video/hdmi.c   |  156 +
 include/drm/drm_dp_helper.h|   10 +
 include/linux/hdmi.h   |   24 +
 14 files changed, 4661 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/bridge/anx7814.txt
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/Kconfig
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/Makefile
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/anx78xx.h
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.c
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.h
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_reg.h

--
2.1.0

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


Re: [PATCH] Staging: speakup: Fix getting port information

2016-01-05 Thread Dan Carpenter
On Tue, Jan 05, 2016 at 02:19:12AM +0100, Samuel Thibault wrote:
> --- a/drivers/staging/speakup/serialio.c
> +++ b/drivers/staging/speakup/serialio.c
> @@ -6,6 +6,9 @@
>  #include "spk_priv.h"
>  #include "serialio.h"
>  
> +#include 
> +#include 
> +

I'm sorry to do this but can you add a comment here, otherwise someone
is going to just change it back because it causes a checkpatch.pl
warning.  Make it a big ugly warning.

#include 
/* WARNING:  Do not change this to  without testing. */
#include 

regards,
dan carpenter

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


Re: [PATCH V5 9/9] hvsock: introduce Hyper-V VM Sockets feature

2016-01-05 Thread Vitaly Kuznetsov
Dexuan Cui  writes:

Just some minor nitpicks below -- I have to admit I didn't test the feature.

[..skip..] 

> +
> + if (sk->sk_err) {
> + ret = -sk->sk_err;
> + goto out_wait_error;
> + } else {
> + ret = 0;
> + }
> +
> +out_wait:
> + finish_wait(sk_sleep(sk), );
> +out:
> + release_sock(sk);
> + return ret;
> +
> +out_wait_error:
> + sk->sk_state = SS_UNCONNECTED;
> + sock->state = SS_UNCONNECTED;
> + goto out_wait;
> +}

Why not just place out_wait_error label before out_wait (and do 'goto
out_wait' in ret = 0 case instead of 'goto out_wait_error' in the error
case)?

[..skip..]

> +
> +static int __init hvsock_init(void)
> +{
> + int ret;
> +
> + /* Hyper-V socket requires at least VMBus 4.0 */
> + if ((vmbus_proto_version >> 16) < 4) {
> + pr_err("failed to load: VMBus 4 or later is required\n");
> + return -ENODEV;

(Let me pretend I'm Dan :-) So here we return ...

> + }
> +
> + ret = vmbus_driver_register(_drv);
> + if (ret) {
> + pr_err("failed to register hv_sock driver\n");
> + goto out;

... and here we goto where we just return. I suggest we bring some
consistency by directly returning ret here and eliminating 'out' label. 

> + }
> +
> + ret = proto_register(_proto, 0);
> + if (ret) {
> + pr_err("failed to register protocol\n");
> + goto unreg_hvsock_drv;
> + }
> +
> + ret = sock_register(_family_ops);
> + if (ret) {
> + pr_err("failed to register address family\n");
> + goto unreg_proto;
> + }
> +
> + return 0;
> +
> +unreg_proto:
> + proto_unregister(_proto);
> +unreg_hvsock_drv:
> + vmbus_driver_unregister(_drv);
> +out:
> + return ret;
> +}
> +
> +static void __exit hvsock_exit(void)
> +{
> + sock_unregister(AF_HYPERV);
> + proto_unregister(_proto);
> + vmbus_driver_unregister(_drv);
> +}
> +
> +module_init(hvsock_init);
> +module_exit(hvsock_exit);
> +
> +MODULE_DESCRIPTION("Microsoft Hyper-V Virtual Socket Family");
> +MODULE_VERSION("0.1");

Do we really need it? When the driver is commited we won't probably be
updating it with v0.2 as a whole, we'll be sending patches addressing
issues and there always will be a question when to swtich to 0.2, 0.3,
... And we don't have MODULE_VERSION for other Hyper-V drivers.

> +MODULE_LICENSE("Dual BSD/GPL");

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


Re: [PATCH] media: use unsigned for pad index

2016-01-05 Thread Lad, Prabhakar
On Fri, Dec 11, 2015 at 2:26 PM, Mauro Carvalho Chehab
 wrote:
> The pad index is unsigned. Replace the occurences of it where
> pertinent.
>
> Suggested-by: Laurent Pinchart 
> Signed-off-by: Mauro Carvalho Chehab 
> ---
>  drivers/staging/media/davinci_vpfe/dm365_ipipeif.c | 2 +-
>  drivers/staging/media/davinci_vpfe/dm365_isif.c| 2 +-
>  drivers/staging/media/davinci_vpfe/dm365_resizer.c | 2 +-

For the above:

Acked-by: Lad, Prabhakar 

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


Re: [RFC PATCH] staging: rtl8723au: fix byte order problems

2016-01-05 Thread Larry Finger

On 01/05/2016 09:53 AM, Jes Sorensen wrote:

Julian Calaby  writes:

Hi Sven,

On Tue, Jan 5, 2016 at 2:29 AM, Sven Dziadek  wrote:

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
index 1662c03c..57f5941 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
@@ -93,11 +93,9 @@ int FillH2CCmd(struct rtw_adapter *padapter, u8 ElementID, 
u32 CmdLen,

 if (h2c_cmd & BIT(7)) {
 msgbox_ex_addr = REG_HMEBOX_EXT_0 + (h2c_box_num * 
EX_MESSAGE_BOX_SIZE);
-   h2c_cmd_ex = le16_to_cpu(h2c_cmd_ex);
 rtl8723au_write16(padapter, msgbox_ex_addr, 
h2c_cmd_ex);
 }
 msgbox_addr = REG_HMEBOX_0 + (h2c_box_num * MESSAGE_BOX_SIZE);
-   h2c_cmd = le32_to_cpu(h2c_cmd);
 rtl8723au_write32(padapter, msgbox_addr, h2c_cmd);


While Jes has NACK'd this change, it does highlight that the h2c_cmd
and h2c_cmd_ex variables are being used to hold both cpu-endian and
little-endian data. A worthwhile change here might be to move the
conversion into the function call following these lines so that they
remain "clean".

That said, I'm not sure this particular snippet of code would work on
big-endian at all as I'm pretty sure that BIT() produces cpu-endian
values and we know from the line you remove that h2c_cmd is
little-endian at this point.


I am not opposed to cleaning it up, however I hope we can just remove
all of the code down the line instead. You may want to look at the h2c
implementation I did for rtl8xxxu. I believe it does work on big-endian,
at least I know Larry has been able to test it on big-endian systems.


I have tested rtl8xxxu for the RTL8192CU devices on a PowerBook G4 with a 
big-endian processor.


I do not have any RTL8723AU devices that can be tested this way, thus I have no 
idea if either of the drivers work on BE. If I were to guess, I would expect the 
staging driver to fail and rtl8xxxu to work.


Larry


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


RE: [PATCH V5 4/9] Drivers: hv: ring_buffer: enhance hv_ringbuffer_read() to support hvsock

2016-01-05 Thread Dexuan Cui
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Tuesday, January 5, 2016 20:31
> ...
> > To get the payload of hvsock, we need raw=0 to skip the level-1 header
> > (i.e., struct vmpacket_descriptor desc) and we also need to skip the
> > level-2 header (i.e., struct vmpipe_proto_header pipe_hdr).
> >
> > NB: if the length of the hvsock payload is not aligned with the 8-byte
> > boundeary, at most 7 padding bytes are appended, so the real hvsock
> > payload's length must be retrieved by the pipe_hdr.data_size field.
> >
> > I 'upgrade' the 'raw' parameter of hv_ringbuffer_read() to a
> > 'read_flags', trying to share the logic of the function.
> 
> When I was touching this code last time I was actually thinking about
> eliminating 'raw' flag by making all ring reads raw and moving this
> header filtering job to the upper layer (as we already have
> vmbus_recvpacket()/vmbus_recvpacket_raw()) but for some reason I didn't
> do it. I believe you have more or less the same reasoing for introducing
> new read type instead of parsing this at a higher level. Some comments
> below ...

I feel it's more convenient to do the parsing in the vmbus driver than in
all the driver users of vmbus driver.

However, yes, I admit hv_ringbuffer_read() becomes less readable with
my introduction of 'read_flags'.

It may be a better idea to do the parsing in higher level, i.e., the hvsock 
driver,
in my case.
It looks I can avoid introducing vmbus_recvpacket_hvsock() and use 
vmbus_recvpacket() directly in my hvsock driver.

Let me try to make a new patch this way.

> > This patch is required by the next patch, which will introduce the hvsock
> > send/recv APIs.
> >
> > ...
> > @@ -619,9 +619,20 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info
> *ring_info,
> > struct kvec *kv_list,
> > u32 kv_count, bool *signal);
> >
> > +/*
> > + * By default, a read_flags of 0 means: the payload offset is
> > + * sizeof(struct vmpacket_descriptor).
> > + *
> > + * If HV_RINGBUFFER_READ_FLAG_RAW is used, the payload offset is 0.
> > + *
> > + * If HV_RINGBUFFER_READ_FLAG_HVSOCK is used, the payload offset is
> > + * sizeof(struct vmpacket_descriptor) + sizeof(struct
> > vmpipe_proto_header).
> 
> So these are mutually exclusive, right? Should we introduce 'int
> payload_offset' parameter instead of flags?
Sorry for making the code less readable. :-)
As I mentioned above, let me try to do things in a better way.

> > @@ -415,17 +426,26 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info
> *inring_info,
> > goto out_unlock;
> > }
> >
> > +   if (tot_hdrlen > buflen) {
> > +   ret = -ENOBUFS;
> > +   goto out_unlock;
> > +   }
> > +
> > +   desc = (struct vmpacket_descriptor *)buffer;
> > +
> > next_read_location = hv_get_next_read_location(inring_info);
> > -   next_read_location = hv_copyfrom_ringbuffer(inring_info, ,
> > -   sizeof(desc),
> > +   next_read_location = hv_copyfrom_ringbuffer(inring_info, desc,
> > +   tot_hdrlen,
> > next_read_location);
> > +   offset = 0;
> > +   if (!raw)
> > +   offset += (desc->offset8 << 3);
> > +   if (hvsock)
> > +   offset += sizeof(*pipe_hdr);
> 
> So in case of !raw and hvsock we add both offsets?
Yes...
 
Thanks for you review, Vitaly.

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


RE: [lustre-devel] [PATCH] staging: lustre/lustre/libcfs: Fix type mismatch reported by sparse

2016-01-05 Thread Simmons, James A.
>> On Wed, Dec 09, 2015 at 10:38:13PM +0530, Niranjan Dighe wrote:
>>> The third argument to function kportal_memhog_alloc is expected to
>>> be gfp_t whereas the actual argument was unsigned int. Fix this by
>>> explicitly typecasting to gfp_t
>>>
>>> Signed-off-by: Niranjan Dighe 
>>> ---
>>>  drivers/staging/lustre/lustre/libcfs/module.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
>>> b/drivers/staging/lustre/lustre/libcfs/module.c
>>> index 96d9d46..9c79f6e 100644
>>> --- a/drivers/staging/lustre/lustre/libcfs/module.c
>>> +++ b/drivers/staging/lustre/lustre/libcfs/module.c
>>> @@ -268,7 +268,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file 
>>> *pfile, unsigned long cmd,
>>>   /* XXX The ioc_flags is not GFP flags now, need to be 
>>> fixed */
>>>   err = kportal_memhog_alloc(pfile->private_data,
>>>  data->ioc_count,
>>> -data->ioc_flags);
>>> + (__force gfp_t)data->ioc_flags);
>>
>> No, please fix the type to be correct properly, like the comment says
>> needs to be done.
>>
>> thanks,
>>
>> greg k-h
>
>Hello Greg,
>
>I could see that the ioc_flags member of the struct libcfs_ioctl_data
>is used as gfp_t only in the
>case of the ioctl IOC_LIBCFS_MEMHOG. I can think of following ways to
>correct it -

IOC_LIBCFS_MEMHOG will be going away. Since this keeps coming up I will prepare 
some patches.
Especially now that out tools no longer uses these obsolete ioctls.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: use %pM and %ph formatting

2016-01-05 Thread Jes Sorensen
mele...@gmail.com writes:
> From: Daniil Leshchev 
>
> use %pM and %ph specifiers instead of placing each byte on stack.
> (staging/rtl8723au/TODO)
>
> Signed-off-by: Daniil Leshchev 
> ---
>  drivers/staging/rtl8723au/core/rtw_recv.c  | 32 
> +-
>  .../staging/rtl8723au/hal/rtl8723a_bt-coexist.c| 24 
>  drivers/staging/rtl8723au/hal/usb_halinit.c|  6 ++--
>  3 files changed, 15 insertions(+), 47 deletions(-)

Looks fine to me.

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


RE: [PATCH V5 5/9] Drivers: hv: vmbus: add APIs to send/recv hvsock packets

2016-01-05 Thread Dexuan Cui
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Tuesday, January 5, 2016 20:39
> ...
> > +/*
> > + * vmbus_sendpacket_hvsock - Send the hvsock payload 'buf' of a length 
> > 'len'
> > + */
> > +int vmbus_sendpacket_hvsock(struct vmbus_channel *channel, void *buf,
> u32 len)
> > ...
> > +
> > +   bufferlist[0].iov_base = 
> > +   bufferlist[0].iov_len  = sizeof(struct vmpacket_descriptor);
> > +   bufferlist[1].iov_base = _hdr;
> > +   bufferlist[1].iov_len  = sizeof(struct vmpipe_proto_header);
> > +   bufferlist[2].iov_base = buf;
> > +   bufferlist[2].iov_len  = len;
> > +   bufferlist[3].iov_base = _data;
> > +   bufferlist[3].iov_len  = packetlen_aligned - packetlen;
> > +
> > +   ret = hv_ringbuffer_write(>outbound, bufferlist, 4,
> > );
> 
> Using ARRAY_SIZE(bufferlist) instead of 4 would allow us to keep this
> line untouched when we decide to add something (and compiler will
> optimize it to 4 anyway).

Thanks for the suggestion! I'll fix it.

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


Re: [RFC PATCH] staging: rtl8723au: fix byte order problems

2016-01-05 Thread Jes Sorensen
Julian Calaby  writes:
> Hi Sven,
>
> On Tue, Jan 5, 2016 at 2:29 AM, Sven Dziadek  wrote:
>> diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c 
>> b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
>> index 1662c03c..57f5941 100644
>> --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
>> +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
>> @@ -93,11 +93,9 @@ int FillH2CCmd(struct rtw_adapter *padapter, u8 
>> ElementID, u32 CmdLen,
>>
>> if (h2c_cmd & BIT(7)) {
>> msgbox_ex_addr = REG_HMEBOX_EXT_0 + (h2c_box_num * 
>> EX_MESSAGE_BOX_SIZE);
>> -   h2c_cmd_ex = le16_to_cpu(h2c_cmd_ex);
>> rtl8723au_write16(padapter, msgbox_ex_addr, 
>> h2c_cmd_ex);
>> }
>> msgbox_addr = REG_HMEBOX_0 + (h2c_box_num * 
>> MESSAGE_BOX_SIZE);
>> -   h2c_cmd = le32_to_cpu(h2c_cmd);
>> rtl8723au_write32(padapter, msgbox_addr, h2c_cmd);
>
> While Jes has NACK'd this change, it does highlight that the h2c_cmd
> and h2c_cmd_ex variables are being used to hold both cpu-endian and
> little-endian data. A worthwhile change here might be to move the
> conversion into the function call following these lines so that they
> remain "clean".
>
> That said, I'm not sure this particular snippet of code would work on
> big-endian at all as I'm pretty sure that BIT() produces cpu-endian
> values and we know from the line you remove that h2c_cmd is
> little-endian at this point.

I am not opposed to cleaning it up, however I hope we can just remove
all of the code down the line instead. You may want to look at the h2c
implementation I did for rtl8xxxu. I believe it does work on big-endian,
at least I know Larry has been able to test it on big-endian systems.

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


[PATCH 09/13] staging: wilc1000: rename pvUserArg in wilc_scan

2016-01-05 Thread Chaehyun Lim
This patch renames pvUserArg to user_arg to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index a1e9052..1e27431 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3674,7 +3674,7 @@ int wilc_get_statistics(struct wilc_vif *vif, struct 
rf_info *stats)
 
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
  u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
- size_t ies_len, wilc_scan_result scan_result, void *pvUserArg,
+ size_t ies_len, wilc_scan_result scan_result, void *user_arg,
  struct hidden_network *pstrHiddenNetwork)
 {
int result = 0;
@@ -3701,7 +3701,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 
scan_type,
msg.body.scan_info.src = scan_source;
msg.body.scan_info.type = scan_type;
msg.body.scan_info.result = scan_result;
-   msg.body.scan_info.arg = pvUserArg;
+   msg.body.scan_info.arg = user_arg;
 
msg.body.scan_info.ch_list_len = ch_list_len;
msg.body.scan_info.ch_freq_list = kmalloc(ch_list_len, GFP_KERNEL);
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index fd9f21739..693a3f5 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -337,7 +337,7 @@ int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel);
 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level);
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
  u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
- size_t ies_len, wilc_scan_result scan_result, void *pvUserArg,
+ size_t ies_len, wilc_scan_result scan_result, void *user_arg,
  struct hidden_network *pstrHiddenNetwork);
 int wilc_hif_set_cfg(struct wilc_vif *vif,
 struct cfg_param_val *cfg_param);
-- 
2.6.4

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


[PATCH 04/13] staging: wilc1000: rename pu8ChnlFreqList in wilc_scan

2016-01-05 Thread Chaehyun Lim
This patch renames pu8ChnlFreqList to ch_freq_list to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index a09bd86..48c40de 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3673,7 +3673,7 @@ int wilc_get_statistics(struct wilc_vif *vif, struct 
rf_info *stats)
 }
 
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
- u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs,
+ u8 *ch_freq_list, u8 u8ChnlListLen, const u8 *pu8IEs,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork)
 {
@@ -3705,7 +3705,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 
scan_type,
 
msg.body.scan_info.ch_list_len = u8ChnlListLen;
msg.body.scan_info.ch_freq_list = kmalloc(u8ChnlListLen, GFP_KERNEL);
-   memcpy(msg.body.scan_info.ch_freq_list, pu8ChnlFreqList, u8ChnlListLen);
+   memcpy(msg.body.scan_info.ch_freq_list, ch_freq_list, u8ChnlListLen);
 
msg.body.scan_info.ies_len = IEsLen;
msg.body.scan_info.ies = kmalloc(IEsLen, GFP_KERNEL);
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 8d26569..998d449 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -336,7 +336,7 @@ int wilc_disconnect(struct wilc_vif *vif, u16 reason_code);
 int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel);
 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level);
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
- u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs,
+ u8 *ch_freq_list, u8 u8ChnlListLen, const u8 *pu8IEs,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork);
 int wilc_hif_set_cfg(struct wilc_vif *vif,
-- 
2.6.4

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


[PATCH 07/13] staging: wilc1000: rename IEsLen in wilc_scan

2016-01-05 Thread Chaehyun Lim
This patch renames IEsLen to ies_len to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 8 
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 3907717..67d0d14 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3674,7 +3674,7 @@ int wilc_get_statistics(struct wilc_vif *vif, struct 
rf_info *stats)
 
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
  u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
- size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
+ size_t ies_len, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork)
 {
int result = 0;
@@ -3707,9 +3707,9 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 
scan_type,
msg.body.scan_info.ch_freq_list = kmalloc(ch_list_len, GFP_KERNEL);
memcpy(msg.body.scan_info.ch_freq_list, ch_freq_list, ch_list_len);
 
-   msg.body.scan_info.ies_len = IEsLen;
-   msg.body.scan_info.ies = kmalloc(IEsLen, GFP_KERNEL);
-   memcpy(msg.body.scan_info.ies, ies, IEsLen);
+   msg.body.scan_info.ies_len = ies_len;
+   msg.body.scan_info.ies = kmalloc(ies_len, GFP_KERNEL);
+   memcpy(msg.body.scan_info.ies, ies, ies_len);
 
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
if (result) {
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index b7bcd93..ed00f9d 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -337,7 +337,7 @@ int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel);
 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level);
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
  u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
- size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
+ size_t ies_len, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork);
 int wilc_hif_set_cfg(struct wilc_vif *vif,
 struct cfg_param_val *cfg_param);
-- 
2.6.4

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


[PATCH 02/13] staging: wilc1000: rename u8ScanSource in wilc_scan

2016-01-05 Thread Chaehyun Lim
This patch renames u8ScanSource to scan_source to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 7581c8f..f32cb76 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3672,7 +3672,7 @@ int wilc_get_statistics(struct wilc_vif *vif, struct 
rf_info *stats)
return result;
 }
 
-int wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 u8ScanType,
+int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 u8ScanType,
  u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork)
@@ -3698,7 +3698,7 @@ int wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 
u8ScanType,
PRINT_D(HOSTINF_DBG, "pstrHiddenNetwork IS EQUAL TO NULL\n");
 
msg.vif = vif;
-   msg.body.scan_info.src = u8ScanSource;
+   msg.body.scan_info.src = scan_source;
msg.body.scan_info.type = u8ScanType;
msg.body.scan_info.result = ScanResult;
msg.body.scan_info.arg = pvUserArg;
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 4ff6b4f..fc71f16 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -335,7 +335,7 @@ int wilc_flush_join_req(struct wilc_vif *vif);
 int wilc_disconnect(struct wilc_vif *vif, u16 reason_code);
 int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel);
 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level);
-int wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 u8ScanType,
+int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 u8ScanType,
  u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork);
-- 
2.6.4

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


[PATCH 12/13] staging: wilc1000: rename phWFIDrv in wilc_init declaration

2016-01-05 Thread Chaehyun Lim
The second argument name is different between wilc_init declaration and
definition. This patch renames phWFIDrv to hif_drv_handler to match
argument name.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index b58c33a..e2d5ee2 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -341,7 +341,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 
scan_type,
  struct hidden_network *hidden_network);
 int wilc_hif_set_cfg(struct wilc_vif *vif,
 struct cfg_param_val *cfg_param);
-s32 wilc_init(struct net_device *dev, struct host_if_drv **phWFIDrv);
+s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler);
 int wilc_deinit(struct wilc_vif *vif);
 int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period,
u32 head_len, u8 *head, u32 tail_len, u8 *tail);
-- 
2.6.4

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


[PATCH 13/13] staging: wilc1000: fix return type of wilc_init

2016-01-05 Thread Chaehyun Lim
This patch changes return type of wilc_init from s32 to int.
The error code as -ENOMEM or -EFAULT is returned in the wilc_init.
It is better to use return type of int in this function, not s32.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 8d022a0..5fac516 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3779,9 +3779,9 @@ static void GetPeriodicRSSI(unsigned long arg)
mod_timer(_rssi, jiffies + msecs_to_jiffies(5000));
 }
 
-s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
+int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
 {
-   s32 result = 0;
+   int result = 0;
struct host_if_drv *hif_drv;
struct wilc_vif *vif;
struct wilc *wilc;
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index e2d5ee2..f4e6839 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -341,7 +341,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 
scan_type,
  struct hidden_network *hidden_network);
 int wilc_hif_set_cfg(struct wilc_vif *vif,
 struct cfg_param_val *cfg_param);
-s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler);
+int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler);
 int wilc_deinit(struct wilc_vif *vif);
 int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period,
u32 head_len, u8 *head, u32 tail_len, u8 *tail);
-- 
2.6.4

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


[PATCH 03/13] staging: wilc1000: rename u8ScanType in wilc_scan

2016-01-05 Thread Chaehyun Lim
This patch renames u8ScanType to scan_type to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index f32cb76..a09bd86 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3672,7 +3672,7 @@ int wilc_get_statistics(struct wilc_vif *vif, struct 
rf_info *stats)
return result;
 }
 
-int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 u8ScanType,
+int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
  u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork)
@@ -3699,7 +3699,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 
u8ScanType,
 
msg.vif = vif;
msg.body.scan_info.src = scan_source;
-   msg.body.scan_info.type = u8ScanType;
+   msg.body.scan_info.type = scan_type;
msg.body.scan_info.result = ScanResult;
msg.body.scan_info.arg = pvUserArg;
 
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index fc71f16..8d26569 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -335,7 +335,7 @@ int wilc_flush_join_req(struct wilc_vif *vif);
 int wilc_disconnect(struct wilc_vif *vif, u16 reason_code);
 int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel);
 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level);
-int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 u8ScanType,
+int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
  u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork);
-- 
2.6.4

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


[PATCH 05/13] staging: wilc1000: rename u8ChnlListLen in wilc_scan

2016-01-05 Thread Chaehyun Lim
This patch renames u8ChnlListLen to ch_list_len to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 8 
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 48c40de..07ff083 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3673,7 +3673,7 @@ int wilc_get_statistics(struct wilc_vif *vif, struct 
rf_info *stats)
 }
 
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
- u8 *ch_freq_list, u8 u8ChnlListLen, const u8 *pu8IEs,
+ u8 *ch_freq_list, u8 ch_list_len, const u8 *pu8IEs,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork)
 {
@@ -3703,9 +3703,9 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 
scan_type,
msg.body.scan_info.result = ScanResult;
msg.body.scan_info.arg = pvUserArg;
 
-   msg.body.scan_info.ch_list_len = u8ChnlListLen;
-   msg.body.scan_info.ch_freq_list = kmalloc(u8ChnlListLen, GFP_KERNEL);
-   memcpy(msg.body.scan_info.ch_freq_list, ch_freq_list, u8ChnlListLen);
+   msg.body.scan_info.ch_list_len = ch_list_len;
+   msg.body.scan_info.ch_freq_list = kmalloc(ch_list_len, GFP_KERNEL);
+   memcpy(msg.body.scan_info.ch_freq_list, ch_freq_list, ch_list_len);
 
msg.body.scan_info.ies_len = IEsLen;
msg.body.scan_info.ies = kmalloc(IEsLen, GFP_KERNEL);
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 998d449..7d7675a 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -336,7 +336,7 @@ int wilc_disconnect(struct wilc_vif *vif, u16 reason_code);
 int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel);
 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level);
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
- u8 *ch_freq_list, u8 u8ChnlListLen, const u8 *pu8IEs,
+ u8 *ch_freq_list, u8 ch_list_len, const u8 *pu8IEs,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork);
 int wilc_hif_set_cfg(struct wilc_vif *vif,
-- 
2.6.4

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


[PATCH 11/13] staging: wilc1000: use kmemdup instead of kmalloc/memcpy

2016-01-05 Thread Chaehyun Lim
This patch replaces kmalloc followed by memcpy with kmemdup.
It is also added error checking to return -ENOMEM when kmemdup is
failed.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 85aae56..8d022a0 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3704,12 +3704,16 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 
scan_type,
msg.body.scan_info.arg = user_arg;
 
msg.body.scan_info.ch_list_len = ch_list_len;
-   msg.body.scan_info.ch_freq_list = kmalloc(ch_list_len, GFP_KERNEL);
-   memcpy(msg.body.scan_info.ch_freq_list, ch_freq_list, ch_list_len);
+   msg.body.scan_info.ch_freq_list = kmemdup(ch_freq_list,
+ ch_list_len,
+ GFP_KERNEL);
+   if (!msg.body.scan_info.ch_freq_list)
+   return -ENOMEM;
 
msg.body.scan_info.ies_len = ies_len;
-   msg.body.scan_info.ies = kmalloc(ies_len, GFP_KERNEL);
-   memcpy(msg.body.scan_info.ies, ies, ies_len);
+   msg.body.scan_info.ies = kmemdup(ies, ies_len, GFP_KERNEL);
+   if (!msg.body.scan_info.ies)
+   return -ENOMEM;
 
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
if (result) {
-- 
2.6.4

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


[PATCH 10/13] staging: wilc1000: rename pstrHiddenNetwork in wilc_scan

2016-01-05 Thread Chaehyun Lim
This patch renames pstrHiddenNetwork to hidden_network to avoid
camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 10 +-
 drivers/staging/wilc1000/host_interface.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 1e27431..85aae56 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3675,7 +3675,7 @@ int wilc_get_statistics(struct wilc_vif *vif, struct 
rf_info *stats)
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
  u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
  size_t ies_len, wilc_scan_result scan_result, void *user_arg,
- struct hidden_network *pstrHiddenNetwork)
+ struct hidden_network *hidden_network)
 {
int result = 0;
struct host_if_msg msg;
@@ -3690,12 +3690,12 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 
scan_type,
 
msg.id = HOST_IF_MSG_SCAN;
 
-   if (pstrHiddenNetwork) {
-   msg.body.scan_info.hidden_network.net_info = 
pstrHiddenNetwork->net_info;
-   msg.body.scan_info.hidden_network.n_ssids = 
pstrHiddenNetwork->n_ssids;
+   if (hidden_network) {
+   msg.body.scan_info.hidden_network.net_info = 
hidden_network->net_info;
+   msg.body.scan_info.hidden_network.n_ssids = 
hidden_network->n_ssids;
 
} else
-   PRINT_D(HOSTINF_DBG, "pstrHiddenNetwork IS EQUAL TO NULL\n");
+   PRINT_D(HOSTINF_DBG, "hidden_network IS EQUAL TO NULL\n");
 
msg.vif = vif;
msg.body.scan_info.src = scan_source;
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 693a3f5..b58c33a 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -338,7 +338,7 @@ int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level);
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
  u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
  size_t ies_len, wilc_scan_result scan_result, void *user_arg,
- struct hidden_network *pstrHiddenNetwork);
+ struct hidden_network *hidden_network);
 int wilc_hif_set_cfg(struct wilc_vif *vif,
 struct cfg_param_val *cfg_param);
 s32 wilc_init(struct net_device *dev, struct host_if_drv **phWFIDrv);
-- 
2.6.4

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


[PATCH 08/13] staging: wilc1000: rename ScanResult in wilc_scan

2016-01-05 Thread Chaehyun Lim
This patch renames ScanResult to scan_result to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 8 
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 67d0d14..a1e9052 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3674,15 +3674,15 @@ int wilc_get_statistics(struct wilc_vif *vif, struct 
rf_info *stats)
 
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
  u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
- size_t ies_len, wilc_scan_result ScanResult, void *pvUserArg,
+ size_t ies_len, wilc_scan_result scan_result, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork)
 {
int result = 0;
struct host_if_msg msg;
struct host_if_drv *hif_drv = vif->hif_drv;
 
-   if (!hif_drv || !ScanResult) {
-   PRINT_ER("hif_drv or ScanResult = NULL\n");
+   if (!hif_drv || !scan_result) {
+   PRINT_ER("hif_drv or scan_result = NULL\n");
return -EFAULT;
}
 
@@ -3700,7 +3700,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 
scan_type,
msg.vif = vif;
msg.body.scan_info.src = scan_source;
msg.body.scan_info.type = scan_type;
-   msg.body.scan_info.result = ScanResult;
+   msg.body.scan_info.result = scan_result;
msg.body.scan_info.arg = pvUserArg;
 
msg.body.scan_info.ch_list_len = ch_list_len;
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index ed00f9d..fd9f21739 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -337,7 +337,7 @@ int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel);
 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level);
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
  u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
- size_t ies_len, wilc_scan_result ScanResult, void *pvUserArg,
+ size_t ies_len, wilc_scan_result scan_result, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork);
 int wilc_hif_set_cfg(struct wilc_vif *vif,
 struct cfg_param_val *cfg_param);
-- 
2.6.4

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


[PATCH 06/13] staging: wilc1000: rename pu8IEs in wilc_scan

2016-01-05 Thread Chaehyun Lim
This patch renames pu8IEs to ies to avoid camelcase.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 07ff083..3907717 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3673,7 +3673,7 @@ int wilc_get_statistics(struct wilc_vif *vif, struct 
rf_info *stats)
 }
 
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
- u8 *ch_freq_list, u8 ch_list_len, const u8 *pu8IEs,
+ u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork)
 {
@@ -3709,7 +3709,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 
scan_type,
 
msg.body.scan_info.ies_len = IEsLen;
msg.body.scan_info.ies = kmalloc(IEsLen, GFP_KERNEL);
-   memcpy(msg.body.scan_info.ies, pu8IEs, IEsLen);
+   memcpy(msg.body.scan_info.ies, ies, IEsLen);
 
result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg));
if (result) {
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 7d7675a..b7bcd93 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -336,7 +336,7 @@ int wilc_disconnect(struct wilc_vif *vif, u16 reason_code);
 int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel);
 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level);
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
- u8 *ch_freq_list, u8 ch_list_len, const u8 *pu8IEs,
+ u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork);
 int wilc_hif_set_cfg(struct wilc_vif *vif,
-- 
2.6.4

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


[PATCH 01/13] staging: wilc1000: fix return type of wilc_scan

2016-01-05 Thread Chaehyun Lim
This patch changes return type of wilc_scan from s32 to int.
The result variable gets return value from wilc_mq_send that has data
type of int. It should be changed return type of this function as well
as data type of result variable.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 27e18c9..7581c8f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3672,12 +3672,12 @@ int wilc_get_statistics(struct wilc_vif *vif, struct 
rf_info *stats)
return result;
 }
 
-s32 wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 u8ScanType,
+int wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 u8ScanType,
  u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork)
 {
-   s32 result = 0;
+   int result = 0;
struct host_if_msg msg;
struct host_if_drv *hif_drv = vif->hif_drv;
 
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 8541d16..4ff6b4f 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -335,7 +335,7 @@ int wilc_flush_join_req(struct wilc_vif *vif);
 int wilc_disconnect(struct wilc_vif *vif, u16 reason_code);
 int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel);
 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level);
-s32 wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 u8ScanType,
+int wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 u8ScanType,
  u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs,
  size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg,
  struct hidden_network *pstrHiddenNetwork);
-- 
2.6.4

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


Re: [PATCH] staging/ion: Add support to get ion handle from dma buf

2016-01-05 Thread Laura Abbott

On 01/05/2016 05:03 AM, Rohit kumar wrote:

Currently we can only import dma buf fd's to get ion_handle.
Adding support to import dma buf handles to support kernel
specific use cases.

Signed-off-by: Rohit kumar 
---
Currently, ION is the memory manager for graphics in android. However,
in other linux platforms such as Tizen, DRM-GEM is used for buffer
management for graphics. It has gem_handle corresponding to a buffer
and uses gem_name for sharing the buffer with other processes. However,
it also uses dma_buf fd for 3d operations. For wayland, there are
multiple calls for gem_handle to dma_buf fd conversion. So, we store
dma_buf associated with buffer. But, there is no api for getting
ion_handle from dma_buf. This patch exposes api to retrieve the ion
handle from dma_buf for similar use cases. With this patch, we can
integrate ION within DRM-GEM for buffer management and dma_buf sharing.



Is this the same patch that was sent on 12/29? In general it's best to
wait a bit longer before resending, especially with lots of people
being off for the holidays. Please also tag your patch with [RESEND]
so it's easier to tell that this is the same patch being sent again.

This is also a good explanation that should be included in the commit
text as well. It gives a much more thorough explanation why this
API is needed. The substance of the patch looks okay to me.

Thanks,
Laura


  drivers/staging/android/ion/ion.c |   21 +++--
  drivers/staging/android/ion/ion.h |   20 
  2 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/android/ion/ion.c 
b/drivers/staging/android/ion/ion.c
index e237e9f..5509716 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -1151,16 +1151,13 @@ int ion_share_dma_buf_fd(struct ion_client *client, 
struct ion_handle *handle)
  }
  EXPORT_SYMBOL(ion_share_dma_buf_fd);

-struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd)
+struct ion_handle *ion_import_dma_buf(struct ion_client *client,
+ struct dma_buf *dmabuf)
  {
-   struct dma_buf *dmabuf;
struct ion_buffer *buffer;
struct ion_handle *handle;
int ret;

-   dmabuf = dma_buf_get(fd);
-   if (IS_ERR(dmabuf))
-   return ERR_CAST(dmabuf);
/* if this memory came from ion */

if (dmabuf->ops != _buf_ops) {
@@ -1199,6 +1196,18 @@ end:
  }
  EXPORT_SYMBOL(ion_import_dma_buf);

+struct ion_handle *ion_import_dma_buf_fd(struct ion_client *client, int fd)
+{
+   struct dma_buf *dmabuf;
+
+   dmabuf = dma_buf_get(fd);
+   if (IS_ERR(dmabuf))
+   return ERR_CAST(dmabuf);
+
+   return ion_import_dma_buf(client, dmabuf);
+}
+EXPORT_SYMBOL(ion_import_dma_buf_fd);
+
  static int ion_sync_for_device(struct ion_client *client, int fd)
  {
struct dma_buf *dmabuf;
@@ -1306,7 +1315,7 @@ static long ion_ioctl(struct file *filp, unsigned int 
cmd, unsigned long arg)
{
struct ion_handle *handle;

-   handle = ion_import_dma_buf(client, data.fd.fd);
+   handle = ion_import_dma_buf_fd(client, data.fd.fd);
if (IS_ERR(handle))
ret = PTR_ERR(handle);
else
diff --git a/drivers/staging/android/ion/ion.h 
b/drivers/staging/android/ion/ion.h
index b860c5f..a1331fc 100644
--- a/drivers/staging/android/ion/ion.h
+++ b/drivers/staging/android/ion/ion.h
@@ -192,14 +192,26 @@ struct dma_buf *ion_share_dma_buf(struct ion_client 
*client,
  int ion_share_dma_buf_fd(struct ion_client *client, struct ion_handle 
*handle);

  /**
- * ion_import_dma_buf() - given an dma-buf fd from the ion exporter get handle
+ * ion_import_dma_buf() - get ion_handle from dma-buf
+ * @client:the client
+ * @dmabuf:the dma-buf
+ *
+ * Get the ion_buffer associated with the dma-buf and return the ion_handle.
+ * If no ion_handle exists for this buffer, return newly created ion_handle.
+ * If dma-buf from another exporter is passed, return ERR_PTR(-EINVAL)
+ */
+struct ion_handle *ion_import_dma_buf(struct ion_client *client,
+ struct dma_buf *dmabuf);
+
+/**
+ * ion_import_dma_buf_fd() - given a dma-buf fd from the ion exporter get 
handle
   * @client:   the client
   * @fd:   the dma-buf fd
   *
- * Given an dma-buf fd that was allocated through ion via ion_share_dma_buf,
- * import that fd and return a handle representing it.  If a dma-buf from
+ * Given an dma-buf fd that was allocated through ion via ion_share_dma_buf_fd,
+ * import that fd and return a handle representing it. If a dma-buf from
   * another exporter is passed in this function will return ERR_PTR(-EINVAL)
   */
-struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd);
+struct ion_handle *ion_import_dma_buf_fd(struct ion_client *client, int fd);

  #endif /* _LINUX_ION_H */




Re: [PATCH v2] staging/rdma/hfi1: check for ARMED->ACTIVE transition in receive interrupt

2016-01-05 Thread Jubin John
On Mon, Jan 04, 2016 at 10:23:46PM +0200, Leon Romanovsky wrote:
> On Mon, Jan 04, 2016 at 11:21:19AM -0500, Jubin John wrote:
> > From: Jim Snow 
> > 
> > } else {
> > +   /* Auto activate link on non-SC15 packet receive */
> > +   if (unlikely(rcd->ppd->host_link_state ==
> > +HLS_UP_ARMED))
> > +   if (set_armed_to_active(rcd, packet, dd))
> > +   goto bail;
> 
> What is the advantage of double "if" over one "if"?
> Something like that
> + if (unlikely(rcd->ppd->host_link_state == HLS_UP_ARMED) && 
> (set_armed_to_active(rcd, packet, dd))
> + goto bail;

I don't think there is an advantage to the double if, so I will change
it to the single if in v3.

> 
> > last = process_rcv_packet(, thread);
> > }
> >  
> > @@ -984,6 +1020,42 @@ bail:
> >  }
> >  
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/7] staging:lustre: remove struct libcfs_device_userstate

2016-01-05 Thread James Simmons
From: Parinay Kondekar 

With the removal of the IOC_LIBCFS_MEMHOG ioctl we no
longer need struct libcfs_device_userstate.

Signed-off-by: Parinay Kondekar 
Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger 
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 .../lustre/include/linux/libcfs/libcfs_private.h   |5 -
 .../lustre/lustre/libcfs/linux/linux-module.c  |8 ++--
 drivers/staging/lustre/lustre/libcfs/module.c  |   16 
 3 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
index d6273e1..e044d6f 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
@@ -391,11 +391,6 @@ int cfs_percpt_atomic_summary(atomic_t **refs);
  * Support for temporary event tracing with minimal Heisenberg effect.
  *  */
 
-struct libcfs_device_userstate {
-   intldu_memhog_pages;
-   struct page   *ldu_memhog_root_page;
-};
-
 #define MKSTR(ptr) ((ptr)) ? (ptr) : ""
 
 static inline int cfs_size_round4(int val)
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
index 0d7..33f6036 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
@@ -98,14 +98,12 @@ int libcfs_ioctl_popdata(void *arg, void *data, int size)
 static int
 libcfs_psdev_open(struct inode *inode, struct file *file)
 {
-   struct libcfs_device_userstate **pdu = NULL;
intrc = 0;
 
if (!inode)
return -EINVAL;
-   pdu = (struct libcfs_device_userstate **)>private_data;
if (libcfs_psdev_ops.p_open != NULL)
-   rc = libcfs_psdev_ops.p_open(0, (void *)pdu);
+   rc = libcfs_psdev_ops.p_open(0, NULL);
else
return -EPERM;
return rc;
@@ -115,14 +113,12 @@ libcfs_psdev_open(struct inode *inode, struct file *file)
 static int
 libcfs_psdev_release(struct inode *inode, struct file *file)
 {
-   struct libcfs_device_userstate *pdu;
intrc = 0;
 
if (!inode)
return -EINVAL;
-   pdu = file->private_data;
if (libcfs_psdev_ops.p_close != NULL)
-   rc = libcfs_psdev_ops.p_close(0, (void *)pdu);
+   rc = libcfs_psdev_ops.p_close(0, NULL);
else
rc = -EPERM;
return rc;
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 286c53f..80d2333 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -71,29 +71,13 @@ static struct dentry *lnet_debugfs_root;
 /* called when opening /dev/device */
 static int libcfs_psdev_open(unsigned long flags, void *args)
 {
-   struct libcfs_device_userstate *ldu;
-
try_module_get(THIS_MODULE);
-
-   LIBCFS_ALLOC(ldu, sizeof(*ldu));
-   if (ldu != NULL) {
-   ldu->ldu_memhog_pages = 0;
-   ldu->ldu_memhog_root_page = NULL;
-   }
-   *(struct libcfs_device_userstate **)args = ldu;
-
return 0;
 }
 
 /* called when closing /dev/device */
 static int libcfs_psdev_release(unsigned long flags, void *args)
 {
-   struct libcfs_device_userstate *ldu;
-
-   ldu = (struct libcfs_device_userstate *)args;
-   if (ldu != NULL)
-   LIBCFS_FREE(ldu, sizeof(*ldu));
-
module_put(THIS_MODULE);
return 0;
 }
-- 
1.7.1

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


[PATCH 2/7] staging:lustre: remove last bits of the IOC_LIBCFS_PANIC ioctl

2016-01-05 Thread James Simmons
From: Parinay Kondekar 

A few pieces still exist for the IOC_LIBCFS_PANIC ioctl. Remove
these last bits to prevent old tools from using them. The latest
lustre utilities no longer use this ioctl.

Signed-off-by: Parinay Kondekar 
Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger 
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 .../lustre/include/linux/libcfs/libcfs_ioctl.h |2 +-
 .../staging/lustre/include/linux/lnet/lnetctl.h|1 -
 .../lustre/lustre/libcfs/linux/linux-module.c  |5 -
 drivers/staging/lustre/lustre/libcfs/module.c  |5 +
 4 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
index ba47cdf..b0d5c78 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
@@ -105,7 +105,7 @@ struct libcfs_ioctl_handler {
 #define IOC_LIBCFS_TYPE   'e'
 #define IOC_LIBCFS_MIN_NR   30
 /* libcfs ioctls */
-#define IOC_LIBCFS_PANIC  _IOWR('e', 30, long)
+/* IOC_LIBCFS_PANIC obsolete in 2.8.0, was _IOWR('e', 30, IOCTL_LIBCFS_TYPE) */
 #define IOC_LIBCFS_CLEAR_DEBUG  _IOWR('e', 31, long)
 #define IOC_LIBCFS_MARK_DEBUG_IOWR('e', 32, long)
 #define IOC_LIBCFS_MEMHOG_IOWR('e', 36, long)
diff --git a/drivers/staging/lustre/include/linux/lnet/lnetctl.h 
b/drivers/staging/lustre/include/linux/lnet/lnetctl.h
index bdd69b2..b9ec555 100644
--- a/drivers/staging/lustre/include/linux/lnet/lnetctl.h
+++ b/drivers/staging/lustre/include/linux/lnet/lnetctl.h
@@ -74,6 +74,5 @@ int jt_dbg_debug_file(int argc, char **argv);
 int jt_dbg_clear_debug_buf(int argc, char **argv);
 int jt_dbg_mark_debug_buf(int argc, char **argv);
 int jt_dbg_modules(int argc, char **argv);
-int jt_dbg_panic(int argc, char **argv);
 
 #endif
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
index 70a99cf..4ade712 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
@@ -147,11 +147,6 @@ static long libcfs_ioctl(struct file *file,
 
/* Handle platform-dependent IOC requests */
switch (cmd) {
-   case IOC_LIBCFS_PANIC:
-   if (!capable(CFS_CAP_SYS_BOOT))
-   return -EPERM;
-   panic("debugctl-invoked panic");
-   return 0;
case IOC_LIBCFS_MEMHOG:
if (!capable(CFS_CAP_SYS_ADMIN))
return -EPERM;
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 329d78c..1ad67c6 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -250,10 +250,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, 
unsigned long cmd,
case IOC_LIBCFS_CLEAR_DEBUG:
libcfs_debug_clear_buffer();
return 0;
-   /*
-* case IOC_LIBCFS_PANIC:
-* Handled in arch/cfs_module.c
-*/
+
case IOC_LIBCFS_MARK_DEBUG:
if (data->ioc_inlbuf1 == NULL ||
data->ioc_inlbuf1[data->ioc_inllen1 - 1] != '\0')
-- 
1.7.1

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


[PATCH 5/7] staging:lustre: simplify libcfs_psdev_[open|release]

2016-01-05 Thread James Simmons
From: Parinay Kondekar 

With struct libcfs_device_userstate gone we can move
the remaining code of libcfs_psdev_ops.p_[open|close]
into the libcfs_psdev_[open|release] functions directly.

Signed-off-by: Parinay Kondekar 
Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger 
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/libcfs/libcfs.h   |2 --
 .../lustre/lustre/libcfs/linux/linux-module.c  |   20 ++--
 drivers/staging/lustre/lustre/libcfs/module.c  |   16 
 3 files changed, 6 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 0d8a91e..06bb676 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -73,8 +73,6 @@ struct cfs_psdev_file {
 };
 
 struct cfs_psdev_ops {
-   int (*p_open)(unsigned long, void *);
-   int (*p_close)(unsigned long, void *);
int (*p_read)(struct cfs_psdev_file *, char *, unsigned long);
int (*p_write)(struct cfs_psdev_file *, char *, unsigned long);
int (*p_ioctl)(struct cfs_psdev_file *, unsigned long, void *);
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
index 33f6036..64f0fbf 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
@@ -98,30 +98,22 @@ int libcfs_ioctl_popdata(void *arg, void *data, int size)
 static int
 libcfs_psdev_open(struct inode *inode, struct file *file)
 {
-   intrc = 0;
-
if (!inode)
return -EINVAL;
-   if (libcfs_psdev_ops.p_open != NULL)
-   rc = libcfs_psdev_ops.p_open(0, NULL);
-   else
-   return -EPERM;
-   return rc;
+
+   try_module_get(THIS_MODULE);
+   return 0;
 }
 
 /* called when closing /dev/device */
 static int
 libcfs_psdev_release(struct inode *inode, struct file *file)
 {
-   intrc = 0;
-
if (!inode)
return -EINVAL;
-   if (libcfs_psdev_ops.p_close != NULL)
-   rc = libcfs_psdev_ops.p_close(0, NULL);
-   else
-   rc = -EPERM;
-   return rc;
+
+   module_put(THIS_MODULE);
+   return 0;
 }
 
 static long libcfs_ioctl(struct file *file,
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 80d2333..8a8a533 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -68,20 +68,6 @@ MODULE_LICENSE("GPL");
 
 static struct dentry *lnet_debugfs_root;
 
-/* called when opening /dev/device */
-static int libcfs_psdev_open(unsigned long flags, void *args)
-{
-   try_module_get(THIS_MODULE);
-   return 0;
-}
-
-/* called when closing /dev/device */
-static int libcfs_psdev_release(unsigned long flags, void *args)
-{
-   module_put(THIS_MODULE);
-   return 0;
-}
-
 static DECLARE_RWSEM(ioctl_list_sem);
 static LIST_HEAD(ioctl_list);
 
@@ -180,8 +166,6 @@ out:
 }
 
 struct cfs_psdev_ops libcfs_psdev_ops = {
-   libcfs_psdev_open,
-   libcfs_psdev_release,
NULL,
NULL,
libcfs_ioctl
-- 
1.7.1

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


[PATCH 3/7] staging:lustre: remove the IOC_LIBCFS_MEMHOG ioctl

2016-01-05 Thread James Simmons
From: Parinay Kondekar 

The IOC_LIBCFS_MEMHOG is not needed so remove it.

Signed-off-by: Parinay Kondekar 
Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger 
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 .../lustre/include/linux/libcfs/libcfs_ioctl.h |2 +-
 .../staging/lustre/include/linux/lnet/lnetctl.h|1 -
 .../lustre/lustre/libcfs/linux/linux-module.c  |8 --
 drivers/staging/lustre/lustre/libcfs/module.c  |  125 +---
 4 files changed, 2 insertions(+), 134 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
index b0d5c78..7e8ccf6 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
@@ -108,7 +108,7 @@ struct libcfs_ioctl_handler {
 /* IOC_LIBCFS_PANIC obsolete in 2.8.0, was _IOWR('e', 30, IOCTL_LIBCFS_TYPE) */
 #define IOC_LIBCFS_CLEAR_DEBUG  _IOWR('e', 31, long)
 #define IOC_LIBCFS_MARK_DEBUG_IOWR('e', 32, long)
-#define IOC_LIBCFS_MEMHOG_IOWR('e', 36, long)
+/* IOC_LIBCFS_MEMHOG obsolete in 2.8.0, was _IOWR('e', 36, IOCTL_LIBCFS_TYPE) 
*/
 /* lnet ioctls */
 #define IOC_LIBCFS_GET_NI_IOWR('e', 50, long)
 #define IOC_LIBCFS_FAIL_NID_IOWR('e', 51, long)
diff --git a/drivers/staging/lustre/include/linux/lnet/lnetctl.h 
b/drivers/staging/lustre/include/linux/lnet/lnetctl.h
index b9ec555..a437bf0 100644
--- a/drivers/staging/lustre/include/linux/lnet/lnetctl.h
+++ b/drivers/staging/lustre/include/linux/lnet/lnetctl.h
@@ -62,7 +62,6 @@ int jt_ptl_print_routes(int argc, char **argv);
 int jt_ptl_fail_nid(int argc, char **argv);
 int jt_ptl_lwt(int argc, char **argv);
 int jt_ptl_testprotocompat(int argc, char **argv);
-int jt_ptl_memhog(int argc, char **argv);
 
 int dbg_initialize(int argc, char **argv);
 int jt_dbg_filter(int argc, char **argv);
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
index 4ade712..0d7 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
@@ -145,14 +145,6 @@ static long libcfs_ioctl(struct file *file,
return -EINVAL;
}
 
-   /* Handle platform-dependent IOC requests */
-   switch (cmd) {
-   case IOC_LIBCFS_MEMHOG:
-   if (!capable(CFS_CAP_SYS_ADMIN))
-   return -EPERM;
-   /* go thought */
-   }
-
pfile.off = 0;
pfile.private_data = file->private_data;
if (libcfs_psdev_ops.p_ioctl != NULL)
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 1ad67c6..286c53f 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -68,114 +68,6 @@ MODULE_LICENSE("GPL");
 
 static struct dentry *lnet_debugfs_root;
 
-static void kportal_memhog_free(struct libcfs_device_userstate *ldu)
-{
-   struct page **level0p = >ldu_memhog_root_page;
-   struct page **level1p;
-   struct page **level2p;
-   intcount1;
-   intcount2;
-
-   if (*level0p != NULL) {
-
-   level1p = (struct page **)page_address(*level0p);
-   count1 = 0;
-
-   while (count1 < PAGE_CACHE_SIZE/sizeof(struct page *) &&
-  *level1p != NULL) {
-
-   level2p = (struct page **)page_address(*level1p);
-   count2 = 0;
-
-   while (count2 < PAGE_CACHE_SIZE/sizeof(struct page *) &&
-  *level2p != NULL) {
-
-   __free_page(*level2p);
-   ldu->ldu_memhog_pages--;
-   level2p++;
-   count2++;
-   }
-
-   __free_page(*level1p);
-   ldu->ldu_memhog_pages--;
-   level1p++;
-   count1++;
-   }
-
-   __free_page(*level0p);
-   ldu->ldu_memhog_pages--;
-
-   *level0p = NULL;
-   }
-
-   LASSERT(ldu->ldu_memhog_pages == 0);
-}
-
-static int kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int 
npages,
-gfp_t flags)
-{
-   struct page **level0p;
-   struct page **level1p;
-   struct page **level2p;
-   intcount1;
-   intcount2;
-
-   

[PATCH 0/7] staging:lustre: get rid of IOC_LIBCFS_MEMHOG and IOC_LIBCFS_PANIC ioctls

2016-01-05 Thread James Simmons
Removing unused IOC_LIBCFS_MEMHOG and IOC_LIBCFS_PANIC ioctls
from the libcfs/ lnet/ code. This cleanup allows us to remove
the cfs_psdev abstraction.

Signed-off-by: Parinay Kondekar 
Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger 
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 

Parinay Kondekar (7):
  staging:lustre: remove obsolete comment in libcfs_ioctl.h
  staging:lustre: remove last bits of the IOC_LIBCFS_PANIC ioctl
  staging:lustre: remove the IOC_LIBCFS_MEMHOG ioctl
  staging:lustre: remove struct libcfs_device_userstate
  staging:lustre: simplify libcfs_psdev_[open|release]
  staging:lustre: call libcfs_ioctl directly
  staging:lustre: remove libcfs pseudo device abstraction

 .../staging/lustre/include/linux/libcfs/libcfs.h   |   23 +---
 .../lustre/include/linux/libcfs/libcfs_ioctl.h |5 +-
 .../lustre/include/linux/libcfs/libcfs_private.h   |5 -
 .../staging/lustre/include/linux/lnet/lnetctl.h|2 -
 .../lustre/lustre/libcfs/linux/linux-module.c  |   54 +-
 drivers/staging/lustre/lustre/libcfs/module.c  |  175 +---
 6 files changed, 19 insertions(+), 245 deletions(-)

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


[PATCH 7/7] staging:lustre: remove libcfs pseudo device abstraction

2016-01-05 Thread James Simmons
From: Parinay Kondekar 

With the libcfs ioctl cleanup we no longer need the libcfs
pseudo device abstraction.

Signed-off-by: Parinay Kondekar 
Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger 
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/libcfs/libcfs.h   |   21 +---
 .../lustre/lustre/libcfs/linux/linux-module.c  |6 +
 drivers/staging/lustre/lustre/libcfs/module.c  |   13 +++
 3 files changed, 6 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 38d65ee..6995367 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -59,24 +59,7 @@
 #define LNET_ACCEPTOR_MIN_RESERVED_PORT512
 #define LNET_ACCEPTOR_MAX_RESERVED_PORT1023
 
-/*
- * libcfs pseudo device operations
- *
- * It's just draft now.
- */
-
-struct cfs_psdev_file {
-   unsigned long   off;
-   void*private_data;
-   unsigned long   reserved1;
-   unsigned long   reserved2;
-};
-
-struct cfs_psdev_ops {
-   int (*p_read)(struct cfs_psdev_file *, char *, unsigned long);
-   int (*p_write)(struct cfs_psdev_file *, char *, unsigned long);
-};
-int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *arg);
+int libcfs_ioctl(unsigned long cmd, void *arg);
 
 /*
  * Drop into debugger, if possible. Implementation is provided by platform.
@@ -143,8 +126,6 @@ extern struct miscdevice libcfs_dev;
 extern char lnet_upcall[1024];
 extern char lnet_debug_log_upcall[1024];
 
-extern struct cfs_psdev_ops libcfs_psdev_ops;
-
 extern struct cfs_wi_sched *cfs_sched_rehash;
 
 struct lnet_debugfs_symlink_def {
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
index 0710d0b..02ef039 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
@@ -119,8 +119,6 @@ libcfs_psdev_release(struct inode *inode, struct file *file)
 static long
 libcfs_psdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-   struct cfs_psdev_filepfile;
-
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
 
@@ -132,9 +130,7 @@ libcfs_psdev_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
return -EINVAL;
}
 
-   pfile.off = 0;
-   pfile.private_data = file->private_data;
-   return libcfs_ioctl(, cmd, (void __user *)arg);
+   return libcfs_ioctl(cmd, (void __user *)arg);
 }
 
 static const struct file_operations libcfs_fops = {
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 63b2b37..1c8da7d 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -101,8 +101,8 @@ int libcfs_deregister_ioctl(struct libcfs_ioctl_handler 
*hand)
 }
 EXPORT_SYMBOL(libcfs_deregister_ioctl);
 
-static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, unsigned long cmd,
-   void *arg, struct libcfs_ioctl_data *data)
+static int
+libcfs_ioctl_int(unsigned long cmd, void *arg, struct libcfs_ioctl_data *data)
 {
int err = -EINVAL;
 
@@ -141,7 +141,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, 
unsigned long cmd,
 }
 
 int
-libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *arg)
+libcfs_ioctl(unsigned long cmd, void *arg)
 {
char*buf;
struct libcfs_ioctl_data *data;
@@ -159,18 +159,13 @@ libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long 
cmd, void *arg)
}
data = (struct libcfs_ioctl_data *)buf;
 
-   err = libcfs_ioctl_int(pfile, cmd, arg, data);
+   err = libcfs_ioctl_int(cmd, arg, data);
 
 out:
LIBCFS_FREE(buf, 1024);
return err;
 }
 
-struct cfs_psdev_ops libcfs_psdev_ops = {
-   NULL,
-   NULL,
-};
-
 static int proc_call_handler(void *data, int write, loff_t *ppos,
void __user *buffer, size_t *lenp,
int (*handler)(void *data, int write,
-- 
1.7.1

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


[PATCH 1/7] staging:lustre: remove obsolete comment in libcfs_ioctl.h

2016-01-05 Thread James Simmons
From: Parinay Kondekar 

The libcfs_ioctl.h header has a comment about a snapshot ioctl
which has been removed for years. Lets remove the comment to
avoid confusion. Broken out of patch 17492.

Signed-off-by: Parinay Kondekar 
Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger 
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 .../lustre/include/linux/libcfs/libcfs_ioctl.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
index 485ab26..ba47cdf 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
@@ -102,7 +102,6 @@ struct libcfs_ioctl_handler {
 /* FIXME check conflict with lustre_lib.h */
 #define LIBCFS_IOC_DEBUG_MASK   _IOWR('f', 250, long)
 
-/* ioctls for manipulating snapshots 30- */
 #define IOC_LIBCFS_TYPE   'e'
 #define IOC_LIBCFS_MIN_NR   30
 /* libcfs ioctls */
-- 
1.7.1

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


[PATCH 6/7] staging:lustre: call libcfs_ioctl directly

2016-01-05 Thread James Simmons
From: Parinay Kondekar 

No reason to go through the cfs_psdev_ops abstract
to call libcfs_ioctl. Just call libcfs_ioctl directly.

Signed-off-by: Parinay Kondekar 
Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger 
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/libcfs/libcfs.h   |2 +-
 .../lustre/lustre/libcfs/linux/linux-module.c  |   13 -
 drivers/staging/lustre/lustre/libcfs/module.c  |4 ++--
 3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 06bb676..38d65ee 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -75,8 +75,8 @@ struct cfs_psdev_file {
 struct cfs_psdev_ops {
int (*p_read)(struct cfs_psdev_file *, char *, unsigned long);
int (*p_write)(struct cfs_psdev_file *, char *, unsigned long);
-   int (*p_ioctl)(struct cfs_psdev_file *, unsigned long, void *);
 };
+int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *arg);
 
 /*
  * Drop into debugger, if possible. Implementation is provided by platform.
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
index 64f0fbf..0710d0b 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
@@ -116,11 +116,10 @@ libcfs_psdev_release(struct inode *inode, struct file 
*file)
return 0;
 }
 
-static long libcfs_ioctl(struct file *file,
-unsigned int cmd, unsigned long arg)
+static long
+libcfs_psdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
struct cfs_psdev_filepfile;
-   intrc = 0;
 
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
@@ -135,15 +134,11 @@ static long libcfs_ioctl(struct file *file,
 
pfile.off = 0;
pfile.private_data = file->private_data;
-   if (libcfs_psdev_ops.p_ioctl != NULL)
-   rc = libcfs_psdev_ops.p_ioctl(, cmd, (void *)arg);
-   else
-   rc = -EPERM;
-   return rc;
+   return libcfs_ioctl(, cmd, (void __user *)arg);
 }
 
 static const struct file_operations libcfs_fops = {
-   .unlocked_ioctl = libcfs_ioctl,
+   .unlocked_ioctl = libcfs_psdev_ioctl,
.open   = libcfs_psdev_open,
.release= libcfs_psdev_release,
 };
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 8a8a533..63b2b37 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -140,7 +140,8 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, 
unsigned long cmd,
return err;
 }
 
-static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void 
*arg)
+int
+libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *arg)
 {
char*buf;
struct libcfs_ioctl_data *data;
@@ -168,7 +169,6 @@ out:
 struct cfs_psdev_ops libcfs_psdev_ops = {
NULL,
NULL,
-   libcfs_ioctl
 };
 
 static int proc_call_handler(void *data, int write, loff_t *ppos,
-- 
1.7.1

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


[PATCH v3] staging/rdma/hfi1: check for ARMED->ACTIVE transition in receive interrupt

2016-01-05 Thread Jubin John
From: Jim Snow 

The link state will transition from ARMED to ACTIVE when a non-SC15
packet arrives, but the driver might not notice the change.  With this
fix, if the slowpath receive interrupt handler sees a non-SC15 packet
while in the ARMED state, we queue work to call linkstate_active_work
from process context to promote it to ACTIVE.

Reviewed-by: Dean Luick 
Reviewed-by: Ira Weiny 
Reviewed-by: Mike Marciniszyn 
Signed-off-by: Jim Snow 
Signed-off-by: Brendan Cunningham 
Signed-off-by: Jubin John 
---
Changes in v2:
- Fixed whitespace
- Converted armed->active transition to inline function
- Added comment to document reason for skipping HFI1_CTRL_CTXT
  in set_all_slowpath()

Changes in v3:
- Changed from double if to single if statement in
  handle_receive_interrupt()

 drivers/staging/rdma/hfi1/chip.c   |  5 +--
 drivers/staging/rdma/hfi1/chip.h   |  2 ++
 drivers/staging/rdma/hfi1/driver.c | 72 ++
 drivers/staging/rdma/hfi1/hfi.h| 11 ++
 drivers/staging/rdma/hfi1/init.c   |  1 +
 5 files changed, 89 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c
index f7bf902..63d5d71 100644
--- a/drivers/staging/rdma/hfi1/chip.c
+++ b/drivers/staging/rdma/hfi1/chip.c
@@ -7878,7 +7878,7 @@ static inline void clear_recv_intr(struct hfi1_ctxtdata 
*rcd)
 }
 
 /* force the receive interrupt */
-static inline void force_recv_intr(struct hfi1_ctxtdata *rcd)
+void force_recv_intr(struct hfi1_ctxtdata *rcd)
 {
write_csr(rcd->dd, CCE_INT_FORCE + (8 * rcd->ireg), rcd->imask);
 }
@@ -7977,7 +7977,7 @@ u32 read_physical_state(struct hfi1_devdata *dd)
& DC_DC8051_STS_CUR_STATE_PORT_MASK;
 }
 
-static u32 read_logical_state(struct hfi1_devdata *dd)
+u32 read_logical_state(struct hfi1_devdata *dd)
 {
u64 reg;
 
@@ -9952,6 +9952,7 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)
ppd->link_enabled = 1;
}
 
+   set_all_slowpath(ppd->dd);
ret = set_local_link_attributes(ppd);
if (ret)
break;
diff --git a/drivers/staging/rdma/hfi1/chip.h b/drivers/staging/rdma/hfi1/chip.h
index b46ef66..78ba425 100644
--- a/drivers/staging/rdma/hfi1/chip.h
+++ b/drivers/staging/rdma/hfi1/chip.h
@@ -690,6 +690,8 @@ u64 read_dev_cntr(struct hfi1_devdata *dd, int index, int 
vl);
 u64 write_dev_cntr(struct hfi1_devdata *dd, int index, int vl, u64 data);
 u64 read_port_cntr(struct hfi1_pportdata *ppd, int index, int vl);
 u64 write_port_cntr(struct hfi1_pportdata *ppd, int index, int vl, u64 data);
+u32 read_logical_state(struct hfi1_devdata *dd);
+void force_recv_intr(struct hfi1_ctxtdata *rcd);
 
 /* Per VL indexes */
 enum {
diff --git a/drivers/staging/rdma/hfi1/driver.c 
b/drivers/staging/rdma/hfi1/driver.c
index 3218520..d096f11 100644
--- a/drivers/staging/rdma/hfi1/driver.c
+++ b/drivers/staging/rdma/hfi1/driver.c
@@ -862,6 +862,37 @@ static inline void set_all_dma_rtail(struct hfi1_devdata 
*dd)
_receive_interrupt_dma_rtail;
 }
 
+void set_all_slowpath(struct hfi1_devdata *dd)
+{
+   int i;
+
+   /* HFI1_CTRL_CTXT must always use the slow path interrupt handler */
+   for (i = HFI1_CTRL_CTXT + 1; i < dd->first_user_ctxt; i++)
+   dd->rcd[i]->do_interrupt = _receive_interrupt;
+}
+
+static inline int set_armed_to_active(struct hfi1_ctxtdata *rcd,
+ struct hfi1_packet packet,
+ struct hfi1_devdata *dd)
+{
+   struct work_struct *lsaw = >ppd->linkstate_active_work;
+   struct hfi1_message_header *hdr = hfi1_get_msgheader(packet.rcd->dd,
+packet.rhf_addr);
+
+   if (hdr2sc(hdr, packet.rhf) != 0xf) {
+   int hwstate = read_logical_state(dd);
+
+   if (hwstate != LSTATE_ACTIVE) {
+   dd_dev_info(dd, "Unexpected link state %d\n", hwstate);
+   return 0;
+   }
+
+   queue_work(rcd->ppd->hfi1_wq, lsaw);
+   return 1;
+   }
+   return 0;
+}
+
 /*
  * handle_receive_interrupt - receive a packet
  * @rcd: the context
@@ -929,6 +960,11 @@ int handle_receive_interrupt(struct hfi1_ctxtdata *rcd, 
int thread)
last = skip_rcv_packet(, thread);
skip_pkt = 0;
} else {
+   /* Auto activate link on non-SC15 packet receive */
+   if (unlikely(rcd->ppd->host_link_state ==
+HLS_UP_ARMED) &&
+   set_armed_to_active(rcd, 

[PATCH V2] staging: rtl8712: consolidate kmalloc + memset 0 to kzalloc

2016-01-05 Thread Nicholas Mc Guire
This is an API consolidation only. The use of kmalloc + memset to 0
here is equivalent to kzalloc.

Signed-off-by: Nicholas Mc Guire <hof...@osadl.org>
---

V2: use kzalloc rather than kcalloc which was not an equivalent
replacement as flaged by Joe Perches <j...@perches.com>

Patch was compile tested with: x86_64_defconfig +
CONFIG_STAGING=y, CONFIG_R8712U=m

Patch is against linux-next (localversion-next is -next-20160105)

 drivers/staging/rtl8712/rtl871x_recv.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_recv.c 
b/drivers/staging/rtl8712/rtl871x_recv.c
index 4ff5301..2a8c492 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.c
+++ b/drivers/staging/rtl8712/rtl871x_recv.c
@@ -72,14 +72,12 @@ sint _r8712_init_recv_priv(struct recv_priv *precvpriv,
_init_queue(>recv_pending_queue);
precvpriv->adapter = padapter;
precvpriv->free_recvframe_cnt = NR_RECVFRAME;
-   precvpriv->pallocated_frame_buf = kmalloc(NR_RECVFRAME *
+   precvpriv->pallocated_frame_buf = kzalloc(NR_RECVFRAME *
sizeof(union recv_frame) + RXFRAME_ALIGN_SZ,
GFP_ATOMIC);
if (precvpriv->pallocated_frame_buf == NULL)
return _FAIL;
kmemleak_not_leak(precvpriv->pallocated_frame_buf);
-   memset(precvpriv->pallocated_frame_buf, 0, NR_RECVFRAME *
-   sizeof(union recv_frame) + RXFRAME_ALIGN_SZ);
precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf +
RXFRAME_ALIGN_SZ -
((addr_t)(precvpriv->pallocated_frame_buf) &
-- 
2.1.4

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


I am presently in your Country/

2016-01-05 Thread John Grieger



I am a Diplomat from the Caribbeans named John Grieger, mandated to deliver 
your inheritance to you in your country of residence.

The funds total AU$10.5 Million and you were made the beneficiary of these 
funds by a benefactor whose details will be revealed to you after handing over 
the Funds to you in accordance with the Agreement i signed with the benefactor 
when he enlisted my assistance in delivering the funds to you.

I am presently in your Country and before i can deliver the funds you have to 
reconfirm the following information so as to ensure that i am dealing with the 
right person.

1. Full Name

2.Residential Address/City

3.Age

4.Occupation

5.Direct Telephone Numbers

After verification of the information with what I have on file, i shall contact 
you so that we can make arrangements on the exact time I will be bringing your 
package to your residential address.

Send the requested information so that we can proceed.

Regards

John Grieger

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


Re: [PATCH] staging/ion: Add support to get ion handle from dma buf

2016-01-05 Thread Rohit
Sorry to resend the patch without [RESEND] tag. Actually I had missed
to add  de...@driverdev.osuosl.org, linux-ker...@vger.kernel.org in
mail last time.

I will update the commit message with the explanation and send the
PATCHv2 soon.

Thanks,
Rohit

On Tue, 05 Jan 2016 10:12:39 -0800
Laura Abbott  wrote:

> On 01/05/2016 05:03 AM, Rohit kumar wrote:
> > Currently we can only import dma buf fd's to get ion_handle.
> > Adding support to import dma buf handles to support kernel
> > specific use cases.
> >
> > Signed-off-by: Rohit kumar 
> > ---
> > Currently, ION is the memory manager for graphics in android.
> > However, in other linux platforms such as Tizen, DRM-GEM is used
> > for buffer management for graphics. It has gem_handle corresponding
> > to a buffer and uses gem_name for sharing the buffer with other
> > processes. However, it also uses dma_buf fd for 3d operations. For
> > wayland, there are multiple calls for gem_handle to dma_buf fd
> > conversion. So, we store dma_buf associated with buffer. But, there
> > is no api for getting ion_handle from dma_buf. This patch exposes
> > api to retrieve the ion handle from dma_buf for similar use cases.
> > With this patch, we can integrate ION within DRM-GEM for buffer
> > management and dma_buf sharing.
> >
> 
> Is this the same patch that was sent on 12/29? In general it's best to
> wait a bit longer before resending, especially with lots of people
> being off for the holidays. Please also tag your patch with [RESEND]
> so it's easier to tell that this is the same patch being sent again.
> 
> This is also a good explanation that should be included in the commit
> text as well. It gives a much more thorough explanation why this
> API is needed. The substance of the patch looks okay to me.
> 
> Thanks,
> Laura
> 
> >   drivers/staging/android/ion/ion.c |   21 +++--
> >   drivers/staging/android/ion/ion.h |   20 
> >   2 files changed, 31 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/staging/android/ion/ion.c
> > b/drivers/staging/android/ion/ion.c index e237e9f..5509716 100644
> > --- a/drivers/staging/android/ion/ion.c
> > +++ b/drivers/staging/android/ion/ion.c
> > @@ -1151,16 +1151,13 @@ int ion_share_dma_buf_fd(struct ion_client
> > *client, struct ion_handle *handle) }
> >   EXPORT_SYMBOL(ion_share_dma_buf_fd);
> >
> > -struct ion_handle *ion_import_dma_buf(struct ion_client *client,
> > int fd) +struct ion_handle *ion_import_dma_buf(struct ion_client
> > *client,
> > + struct dma_buf *dmabuf)
> >   {
> > -   struct dma_buf *dmabuf;
> > struct ion_buffer *buffer;
> > struct ion_handle *handle;
> > int ret;
> >
> > -   dmabuf = dma_buf_get(fd);
> > -   if (IS_ERR(dmabuf))
> > -   return ERR_CAST(dmabuf);
> > /* if this memory came from ion */
> >
> > if (dmabuf->ops != _buf_ops) {
> > @@ -1199,6 +1196,18 @@ end:
> >   }
> >   EXPORT_SYMBOL(ion_import_dma_buf);
> >
> > +struct ion_handle *ion_import_dma_buf_fd(struct ion_client
> > *client, int fd) +{
> > +   struct dma_buf *dmabuf;
> > +
> > +   dmabuf = dma_buf_get(fd);
> > +   if (IS_ERR(dmabuf))
> > +   return ERR_CAST(dmabuf);
> > +
> > +   return ion_import_dma_buf(client, dmabuf);
> > +}
> > +EXPORT_SYMBOL(ion_import_dma_buf_fd);
> > +
> >   static int ion_sync_for_device(struct ion_client *client, int fd)
> >   {
> > struct dma_buf *dmabuf;
> > @@ -1306,7 +1315,7 @@ static long ion_ioctl(struct file *filp,
> > unsigned int cmd, unsigned long arg) {
> > struct ion_handle *handle;
> >
> > -   handle = ion_import_dma_buf(client, data.fd.fd);
> > +   handle = ion_import_dma_buf_fd(client, data.fd.fd);
> > if (IS_ERR(handle))
> > ret = PTR_ERR(handle);
> > else
> > diff --git a/drivers/staging/android/ion/ion.h
> > b/drivers/staging/android/ion/ion.h index b860c5f..a1331fc 100644
> > --- a/drivers/staging/android/ion/ion.h
> > +++ b/drivers/staging/android/ion/ion.h
> > @@ -192,14 +192,26 @@ struct dma_buf *ion_share_dma_buf(struct
> > ion_client *client, int ion_share_dma_buf_fd(struct ion_client
> > *client, struct ion_handle *handle);
> >
> >   /**
> > - * ion_import_dma_buf() - given an dma-buf fd from the ion
> > exporter get handle
> > + * ion_import_dma_buf() - get ion_handle from dma-buf
> > + * @client:the client
> > + * @dmabuf:the dma-buf
> > + *
> > + * Get the ion_buffer associated with the dma-buf and return the
> > ion_handle.
> > + * If no ion_handle exists for this buffer, return newly created
> > ion_handle.
> > + * If dma-buf from another exporter is passed, return
> > ERR_PTR(-EINVAL)
> > + */
> > +struct ion_handle *ion_import_dma_buf(struct ion_client *client,
> > + struct dma_buf *dmabuf);
> > +
> > +/**
> > + * ion_import_dma_buf_fd() - given a dma-buf fd from the ion
> > exporter get handle

[PATCHv2 1/1] staging/ion: Add support to get ion handle from dma buf

2016-01-05 Thread Rohit kumar
Currently we can only import dma buf fd's to get ion_handle.
Adding support to import dma buf handles to support kernel
specific use cases.

An example use case is in linux platforms such as Tizen, in which
DRM-GEM is used for buffer management for graphics. It has gem_handle
corresponding to a buffer and uses gem_name for sharing the buffer
with other processes. However,it also uses dma_buf fd for 3d operations.
For wayland, there are multiple calls for gem_handle to dma_buf fd
conversion. So, we store dma_buf associated with buffer. But, there is
no api for getting ion_handle from dma_buf. This patch exposes api to
retrieve the ion handle from dma_buf for similar use cases. With this
patch, we can integrate ION within DRM-GEM for buffer management and
dma_buf sharing.

Signed-off-by: Rohit kumar 
---
v2: Updated commit message with use case explanation, as suggested by
Laura Abbott

 drivers/staging/android/ion/ion.c |   21 +++--
 drivers/staging/android/ion/ion.h |   20 
 2 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/android/ion/ion.c 
b/drivers/staging/android/ion/ion.c
index e237e9f..5509716 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -1151,16 +1151,13 @@ int ion_share_dma_buf_fd(struct ion_client *client, 
struct ion_handle *handle)
 }
 EXPORT_SYMBOL(ion_share_dma_buf_fd);
 
-struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd)
+struct ion_handle *ion_import_dma_buf(struct ion_client *client,
+ struct dma_buf *dmabuf)
 {
-   struct dma_buf *dmabuf;
struct ion_buffer *buffer;
struct ion_handle *handle;
int ret;
 
-   dmabuf = dma_buf_get(fd);
-   if (IS_ERR(dmabuf))
-   return ERR_CAST(dmabuf);
/* if this memory came from ion */
 
if (dmabuf->ops != _buf_ops) {
@@ -1199,6 +1196,18 @@ end:
 }
 EXPORT_SYMBOL(ion_import_dma_buf);
 
+struct ion_handle *ion_import_dma_buf_fd(struct ion_client *client, int fd)
+{
+   struct dma_buf *dmabuf;
+
+   dmabuf = dma_buf_get(fd);
+   if (IS_ERR(dmabuf))
+   return ERR_CAST(dmabuf);
+
+   return ion_import_dma_buf(client, dmabuf);
+}
+EXPORT_SYMBOL(ion_import_dma_buf_fd);
+
 static int ion_sync_for_device(struct ion_client *client, int fd)
 {
struct dma_buf *dmabuf;
@@ -1306,7 +1315,7 @@ static long ion_ioctl(struct file *filp, unsigned int 
cmd, unsigned long arg)
{
struct ion_handle *handle;
 
-   handle = ion_import_dma_buf(client, data.fd.fd);
+   handle = ion_import_dma_buf_fd(client, data.fd.fd);
if (IS_ERR(handle))
ret = PTR_ERR(handle);
else
diff --git a/drivers/staging/android/ion/ion.h 
b/drivers/staging/android/ion/ion.h
index b860c5f..a1331fc 100644
--- a/drivers/staging/android/ion/ion.h
+++ b/drivers/staging/android/ion/ion.h
@@ -192,14 +192,26 @@ struct dma_buf *ion_share_dma_buf(struct ion_client 
*client,
 int ion_share_dma_buf_fd(struct ion_client *client, struct ion_handle *handle);
 
 /**
- * ion_import_dma_buf() - given an dma-buf fd from the ion exporter get handle
+ * ion_import_dma_buf() - get ion_handle from dma-buf
+ * @client:the client
+ * @dmabuf:the dma-buf
+ *
+ * Get the ion_buffer associated with the dma-buf and return the ion_handle.
+ * If no ion_handle exists for this buffer, return newly created ion_handle.
+ * If dma-buf from another exporter is passed, return ERR_PTR(-EINVAL)
+ */
+struct ion_handle *ion_import_dma_buf(struct ion_client *client,
+ struct dma_buf *dmabuf);
+
+/**
+ * ion_import_dma_buf_fd() - given a dma-buf fd from the ion exporter get 
handle
  * @client:the client
  * @fd:the dma-buf fd
  *
- * Given an dma-buf fd that was allocated through ion via ion_share_dma_buf,
- * import that fd and return a handle representing it.  If a dma-buf from
+ * Given an dma-buf fd that was allocated through ion via ion_share_dma_buf_fd,
+ * import that fd and return a handle representing it. If a dma-buf from
  * another exporter is passed in this function will return ERR_PTR(-EINVAL)
  */
-struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd);
+struct ion_handle *ion_import_dma_buf_fd(struct ion_client *client, int fd);
 
 #endif /* _LINUX_ION_H */
-- 
1.7.9.5

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


RE: [PATCH V5 9/9] hvsock: introduce Hyper-V VM Sockets feature

2016-01-05 Thread Dexuan Cui
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Tuesday, January 5, 2016 17:52
> 
> Just some minor nitpicks below -- I have to admit I didn't test the feature.
> 
> [..skip..]
> 
> > +
> > +   if (sk->sk_err) {
> > +   ret = -sk->sk_err;
> > +   goto out_wait_error;
> > +   } else {
> > +   ret = 0;
> > +   }
> > +
> > +out_wait:
> > +   finish_wait(sk_sleep(sk), );
> > +out:
> > +   release_sock(sk);
> > +   return ret;
> > +
> > +out_wait_error:
> > +   sk->sk_state = SS_UNCONNECTED;
> > +   sock->state = SS_UNCONNECTED;
> > +   goto out_wait;
> > +}
> 
> Why not just place out_wait_error label before out_wait (and do 'goto
> out_wait' in ret = 0 case instead of 'goto out_wait_error' in the error
> case)?
Good point.  I'll update the code.

> [..skip..]
> 
> > +
> > +static int __init hvsock_init(void)
> > +{
> > +   int ret;
> > +
> > +   /* Hyper-V socket requires at least VMBus 4.0 */
> > +   if ((vmbus_proto_version >> 16) < 4) {
> > +   pr_err("failed to load: VMBus 4 or later is required\n");
> > +   return -ENODEV;
> 
> (Let me pretend I'm Dan :-) So here we return ...
> 
> > +   }
> > +
> > +   ret = vmbus_driver_register(_drv);
> > +   if (ret) {
> > +   pr_err("failed to register hv_sock driver\n");
> > +   goto out;
> 
> ... and here we goto where we just return. I suggest we bring some
> consistency by directly returning ret here and eliminating 'out' label.

Thanks! I'll update the code.

> > +   }
> > +
> > +   ret = proto_register(_proto, 0);
> > +   if (ret) {
> > +   pr_err("failed to register protocol\n");
> > +   goto unreg_hvsock_drv;
> > +   }
> > +
> > +   ret = sock_register(_family_ops);
> > +   if (ret) {
> > +   pr_err("failed to register address family\n");
> > +   goto unreg_proto;
> > +   }
> > +
> > +   return 0;
> > +
> > +unreg_proto:
> > +   proto_unregister(_proto);
> > +unreg_hvsock_drv:
> > +   vmbus_driver_unregister(_drv);
> > +out:
> > +   return ret;
> > +}
> > +
> > +static void __exit hvsock_exit(void)
> > +{
> > +   sock_unregister(AF_HYPERV);
> > +   proto_unregister(_proto);
> > +   vmbus_driver_unregister(_drv);
> > +}
> > +
> > +module_init(hvsock_init);
> > +module_exit(hvsock_exit);
> > +
> > +MODULE_DESCRIPTION("Microsoft Hyper-V Virtual Socket Family");
> > +MODULE_VERSION("0.1");
> 
> Do we really need it? When the driver is commited we won't probably be
> updating it with v0.2 as a whole, we'll be sending patches addressing
> issues and there always will be a question when to swtich to 0.2, 0.3,
> ... And we don't have MODULE_VERSION for other Hyper-V drivers.

Good point. I'll remove the line MODULE_VERSION.
 
Thanks,
-- Dexuan
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC PATCH 00/15] staging/rdma/hfi1: Initial patches to add rdmavt support in HFI1

2016-01-05 Thread ira.weiny
> > > > > 
> > > > > If Doug accepts the library changes, let me know that public git 
> > > > > commit
> > > > > and I can pull it into the staging-next branch and you can continue to
> > > > > send me staging patches that way.
> > > > 
> > > > Won't this cause a conflict during the merge window?
> > > 
> > > No, git is good :)
> > > 
> > > > How do we handle changes which affect both qib and hfi1?
> > > 
> > > I don't know, now this gets messy...
> > > 
> > 
> > Agreed and this is what we are worried about.
> > 
> > Can we do what Dan and Doug have proposed in the past and have Doug take 
> > over
> > the staging/rdma sub-tree?
> > 
> > http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-November/081922.html
> > 
> > I think the upcoming merge window is a reasonable time for him to do that.
> 
> Ok, but keeping on top of all of the generic staging patches that come
> in is a tough thing to do, that's up to Doug, if he is ready for it...
> 

Greg,

Forgive me for not knowing how multiple maintainers deal with hand offs like
this.  I'm hoping you, and/or Doug, can answer some questions for me.

Am I correct in assuming the merge window will be open on Monday?  If so, when
will Linus pull the staging tree?  Then at what point will Doug get the hfi1
changes which have already been accepted?

Are you going to be able to review the outstanding patches for
staging/rdma/hfi1 before the merge window?  Or should we consider them dropped
and resubmit to Doug to apply after he has merged the latest hfi1 code from
Linus?


Doug,

At what point should we start submitting additional patches to you which we
have queued up but are not yet submitted to Greg?

So far we have been cross posting to linux-rdma for feedback and I see that the
patches have been dropped from patchworks.  I assume you dropped them from
patchworks because you knew that Greg was handling them?

Thanks,
Ira

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


RE: [lustre-devel] [PATCH] staging: lustre/lustre/libcfs: Fix type mismatch reported by sparse

2016-01-05 Thread Simmons, James A.
>>>2. Is it OK to hardcode the appropriate gfp_t flags for the
>>>IOC_LIBCFS_MEMHOG, as the userspace
>>>seems to be taking the decision about the page allocation
>>>zone/strategy, is this what is intended?
>>
>> The memhog functionality is used to introduce memory pressure on a client
>> or server during operation to test error handling as well as memory
>> allocation deadlocks (e.g. GFP_KERNEL used where GFP_NOFS should be used).
>> There are other ways to do this in the kernel today, so all of the memhog
>> code could just be deleted I think.
>>
>> This looks like kportal_memhog_alloc(), kportal_memhog_free(),
>> IOC_LIBCFS_MEMHOG, and struct libcfs_device_userstate could be removed.
>>
>>
>> Cheers, Andreas
>>
>Thanks Andreas, I will send out a separate patch with the cleanup as
>you suggested.

I missed this email. I just sent the cleanup patches a bit ago.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH V5 7/9] Drivers: hv: vmbus: add a mechanism to pass hvsock events to the hvsock driver

2016-01-05 Thread Vitaly Kuznetsov
Dexuan Cui  writes:

> For now only 1 event is defined: HVSOCK_RESCIND_CHANNEL.
> We'll have more events in the future.
>
> Signed-off-by: Dexuan Cui 
> ---
>  drivers/hv/channel_mgmt.c | 18 ++
>  include/linux/hyperv.h| 17 +
>  2 files changed, 35 insertions(+)
>
> diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
> index 4611b50..87fc7d2 100644
> --- a/drivers/hv/channel_mgmt.c
> +++ b/drivers/hv/channel_mgmt.c
> @@ -608,6 +608,16 @@ static void vmbus_onoffer_rescind(struct 
> vmbus_channel_message_header *hdr)
>   spin_unlock_irqrestore(>lock, flags);
>
>   if (channel->device_obj) {
> + if (is_hvsock_channel(channel) &&
> + channel->hvsock_event_callback) {
> + channel->hvsock_event_callback(channel,
> +HVSOCK_RESCIND_CHANNEL);
> + /*
> +  * We can't invoke vmbus_device_unregister()
> +  * until the socket fd is closed.
> +  */
> + return;
> + }
>   /*
>* We will have to unregister this device from the
>* driver core.
> @@ -977,3 +987,11 @@ bool vmbus_are_subchannels_present(struct vmbus_channel 
> *primary)
>   return ret;
>  }
>  EXPORT_SYMBOL_GPL(vmbus_are_subchannels_present);
> +
> +void vmbus_set_hvsock_event_callback(struct vmbus_channel *channel,
> + void (*hvsock_event_callback)(struct vmbus_channel *,
> +   enum hvsock_event))
> +{
> + channel->hvsock_event_callback = hvsock_event_callback;
> +}
> +EXPORT_SYMBOL_GPL(vmbus_set_hvsock_event_callback);
> diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
> index b4cc44c..7e507bb 100644
> --- a/include/linux/hyperv.h
> +++ b/include/linux/hyperv.h
> @@ -645,6 +645,12 @@ enum hv_signal_policy {
>   HV_SIGNAL_POLICY_EXPLICIT,
>  };
>
> +/* hvsock related definitions */
> +enum hvsock_event {
> + /* The host application is close()-ing the connection */
> + HVSOCK_RESCIND_CHANNEL,
> +};
> +
>  struct vmbus_channel {
>   /* Unique channel id */
>   int id;
> @@ -740,6 +746,13 @@ struct vmbus_channel {
>   void (*sc_creation_callback)(struct vmbus_channel *new_sc);
>
>   /*
> +  * hvsock event callback.
> +  * For now only 1 event is defined: HVSOCK_RESCIND_CHANNEL.
> +  */
> + void (*hvsock_event_callback)(struct vmbus_channel *channel,
> +   enum hvsock_event event);

Would it make sense to rename it to something more general,
e.g. sc_rescind_callback and call it for all drivers (even if we don't
need it now) intead of introducing enum hvsock_event? When new events
arrive we'll just add new callbacks (or, alternatively, we could unify
it to 'channel_event_callback' and merging with sc_creation_callback()
but I'd say it is uglier).

> +
> + /*
>* The spinlock to protect the structure. It is being used to protect
>* test-and-set access to various attributes of the structure as well
>* as all sc_list operations.
> @@ -825,6 +838,10 @@ int vmbus_request_offers(void);
>  void vmbus_set_sc_create_callback(struct vmbus_channel *primary_channel,
>   void (*sc_cr_cb)(struct vmbus_channel *new_sc));
>
> +void vmbus_set_hvsock_event_callback(struct vmbus_channel *channel,
> + void (*hvsock_event_callback)(struct vmbus_channel *,
> +   enum hvsock_event));
> +
>  /*
>   * Retrieve the (sub) channel on which to send an outgoing request.
>   * When a primary channel has multiple sub-channels, we choose a

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


Re: [PATCH V5 4/9] Drivers: hv: ring_buffer: enhance hv_ringbuffer_read() to support hvsock

2016-01-05 Thread Vitaly Kuznetsov
Dexuan Cui  writes:

> To get the payload of hvsock, we need raw=0 to skip the level-1 header
> (i.e., struct vmpacket_descriptor desc) and we also need to skip the
> level-2 header (i.e., struct vmpipe_proto_header pipe_hdr).
>
> NB: if the length of the hvsock payload is not aligned with the 8-byte
> boundeary, at most 7 padding bytes are appended, so the real hvsock
> payload's length must be retrieved by the pipe_hdr.data_size field.
>
> I 'upgrade' the 'raw' parameter of hv_ringbuffer_read() to a
> 'read_flags', trying to share the logic of the function.

When I was touching this code last time I was actually thinking about
eliminating 'raw' flag by making all ring reads raw and moving this
header filtering job to the upper layer (as we already have
vmbus_recvpacket()/vmbus_recvpacket_raw()) but for some reason I didn't
do it. I believe you have more or less the same reasoing for introducing
new read type instead of parsing this at a higher level. Some comments
below ...

>
> This patch is required by the next patch, which will introduce the hvsock
> send/recv APIs.
>
> Signed-off-by: Dexuan Cui 
> Cc: Vitaly Kuznetsov 
> ---
>  drivers/hv/channel.c  | 10 +
>  drivers/hv/hyperv_vmbus.h | 13 +++-
>  drivers/hv/ring_buffer.c  | 54 
> ---
>  include/linux/hyperv.h| 12 +++
>  4 files changed, 72 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
> index eaaa066..cc49966 100644
> --- a/drivers/hv/channel.c
> +++ b/drivers/hv/channel.c
> @@ -940,13 +940,14 @@ EXPORT_SYMBOL_GPL(vmbus_sendpacket_multipagebuffer);
>  static inline int
>  __vmbus_recvpacket(struct vmbus_channel *channel, void *buffer,
>  u32 bufferlen, u32 *buffer_actual_len, u64 *requestid,
> -bool raw)
> +u32 read_flags)
>  {
>   int ret;
>   bool signal = false;
>
>   ret = hv_ringbuffer_read(>inbound, buffer, bufferlen,
> -  buffer_actual_len, requestid, , raw);
> +  buffer_actual_len, requestid, ,
> +  read_flags);
>
>   if (signal)
>   vmbus_setevent(channel);
> @@ -959,7 +960,7 @@ int vmbus_recvpacket(struct vmbus_channel *channel, void 
> *buffer,
>u64 *requestid)
>  {
>   return __vmbus_recvpacket(channel, buffer, bufferlen,
> -   buffer_actual_len, requestid, false);
> +   buffer_actual_len, requestid, 0);
>  }
>  EXPORT_SYMBOL(vmbus_recvpacket);
>
> @@ -971,6 +972,7 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, 
> void *buffer,
> u64 *requestid)
>  {
>   return __vmbus_recvpacket(channel, buffer, bufferlen,
> -   buffer_actual_len, requestid, true);
> +   buffer_actual_len, requestid,
> +   HV_RINGBUFFER_READ_FLAG_RAW);
>  }
>  EXPORT_SYMBOL_GPL(vmbus_recvpacket_raw);
> diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
> index 0411b7b..46206b6 100644
> --- a/drivers/hv/hyperv_vmbus.h
> +++ b/drivers/hv/hyperv_vmbus.h
> @@ -619,9 +619,20 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info 
> *ring_info,
>   struct kvec *kv_list,
>   u32 kv_count, bool *signal);
>
> +/*
> + * By default, a read_flags of 0 means: the payload offset is
> + * sizeof(struct vmpacket_descriptor).
> + *
> + * If HV_RINGBUFFER_READ_FLAG_RAW is used, the payload offset is 0.
> + *
> + * If HV_RINGBUFFER_READ_FLAG_HVSOCK is used, the payload offset is
> + * sizeof(struct vmpacket_descriptor) + sizeof(struct
> vmpipe_proto_header).

So these are mutually exclusive, right? Should we introduce 'int
payload_offset' parameter instead of flags? 

> + */
> +#define HV_RINGBUFFER_READ_FLAG_RAW  (1 << 0)
> +#define HV_RINGBUFFER_READ_FLAG_HVSOCK   (1 << 1)
>  int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info,
>  void *buffer, u32 buflen, u32 *buffer_actual_len,
> -u64 *requestid, bool *signal, bool raw);
> +u64 *requestid, bool *signal, u32 read_flags);
>
>  void hv_ringbuffer_get_debuginfo(struct hv_ring_buffer_info *ring_info,
>   struct hv_ring_buffer_debug_info *debug_info);
> diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
> index b53702c..03a509c 100644
> --- a/drivers/hv/ring_buffer.c
> +++ b/drivers/hv/ring_buffer.c
> @@ -382,32 +382,43 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info 
> *outring_info,
>
>  int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info,
>  void *buffer, u32 buflen, u32 *buffer_actual_len,
> -u64 *requestid, bool *signal, bool raw)
> +u64 

Re: [PATCH V5 5/9] Drivers: hv: vmbus: add APIs to send/recv hvsock packets

2016-01-05 Thread Vitaly Kuznetsov
Dexuan Cui  writes:

> This will be used by the coming net/hvsock driver.
>
> Signed-off-by: Dexuan Cui 
> ---
>  drivers/hv/channel.c   | 59 
> ++
>  include/linux/hyperv.h |  9 
>  2 files changed, 68 insertions(+)
>
> diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
> index cc49966..ce1b885 100644
> --- a/drivers/hv/channel.c
> +++ b/drivers/hv/channel.c
> @@ -924,6 +924,52 @@ int vmbus_sendpacket_multipagebuffer(struct 
> vmbus_channel *channel,
>  }
>  EXPORT_SYMBOL_GPL(vmbus_sendpacket_multipagebuffer);
>
> +/*
> + * vmbus_sendpacket_hvsock - Send the hvsock payload 'buf' of a length 'len'
> + */
> +int vmbus_sendpacket_hvsock(struct vmbus_channel *channel, void *buf, u32 
> len)
> +{
> + struct vmpipe_proto_header pipe_hdr;
> + struct vmpacket_descriptor desc;
> + struct kvec bufferlist[4];
> + u32 packetlen_aligned;
> + u32 packetlen;
> + u64 aligned_data = 0;
> + bool signal = false;
> + int ret;
> +
> + packetlen = HVSOCK_HEADER_LEN + len;
> + packetlen_aligned = ALIGN(packetlen, sizeof(u64));
> +
> + /* Setup the descriptor */
> + desc.type = VM_PKT_DATA_INBAND;
> + /* in 8-bytes granularity */
> + desc.offset8 = sizeof(struct vmpacket_descriptor) >> 3;
> + desc.len8 = (u16)(packetlen_aligned >> 3);
> + desc.flags = 0;
> + desc.trans_id = 0;
> +
> + pipe_hdr.pkt_type = 1;
> + pipe_hdr.data_size = len;
> +
> + bufferlist[0].iov_base = 
> + bufferlist[0].iov_len  = sizeof(struct vmpacket_descriptor);
> + bufferlist[1].iov_base = _hdr;
> + bufferlist[1].iov_len  = sizeof(struct vmpipe_proto_header);
> + bufferlist[2].iov_base = buf;
> + bufferlist[2].iov_len  = len;
> + bufferlist[3].iov_base = _data;
> + bufferlist[3].iov_len  = packetlen_aligned - packetlen;
> +
> + ret = hv_ringbuffer_write(>outbound, bufferlist, 4,
> );

Using ARRAY_SIZE(bufferlist) instead of 4 would allow us to keep this
line untouched when we decide to add something (and compiler will
optimize it to 4 anyway).

> +
> + if (ret == 0 && signal)
> + vmbus_setevent(channel);
> +
> + return ret;
> +}
> +EXPORT_SYMBOL_GPL(vmbus_sendpacket_hvsock);
> +
>  /**
>   * vmbus_recvpacket() - Retrieve the user packet on the specified channel
>   * @channel: Pointer to vmbus_channel structure.
> @@ -976,3 +1022,16 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, 
> void *buffer,
> HV_RINGBUFFER_READ_FLAG_RAW);
>  }
>  EXPORT_SYMBOL_GPL(vmbus_recvpacket_raw);
> +
> +/*
> + * vmbus_recvpacket_hvsock - Receive the hvsock payload from the vmbus
> + * ringbuffer into the 'buffer'.
> + */
> +int vmbus_recvpacket_hvsock(struct vmbus_channel *channel, void *buffer,
> + u32 bufferlen, u32 *buffer_actual_len)
> +{
> + return __vmbus_recvpacket(channel, buffer, bufferlen,
> +   buffer_actual_len, NULL,
> +   HV_RINGBUFFER_READ_FLAG_HVSOCK);
> +}
> +EXPORT_SYMBOL_GPL(vmbus_recvpacket_hvsock);
> diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
> index e005223..646c20d 100644
> --- a/include/linux/hyperv.h
> +++ b/include/linux/hyperv.h
> @@ -908,6 +908,9 @@ extern int vmbus_sendpacket_ctl(struct vmbus_channel 
> *channel,
> u32 flags,
> bool kick_q);
>
> +extern int vmbus_sendpacket_hvsock(struct vmbus_channel *channel,
> +void *buf, u32 len);
> +
>  extern int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
>   struct hv_page_buffer pagebuffers[],
>   u32 pagecount,
> @@ -958,6 +961,9 @@ extern int vmbus_recvpacket_raw(struct vmbus_channel 
> *channel,
>u64 *requestid);
>
> +extern int vmbus_recvpacket_hvsock(struct vmbus_channel *channel, void 
> *buffer,
> +u32 bufferlen, u32 *buffer_actual_len);
> +
>  extern void vmbus_ontimer(unsigned long data);
>
>  /* Base driver object */
> @@ -1280,4 +1286,7 @@ struct vmpipe_proto_header {
>   };
>  } __packed;
>
> +#define HVSOCK_HEADER_LEN(sizeof(struct vmpacket_descriptor) + \
> +  sizeof(struct vmpipe_proto_header))
> +
>  #endif /* _HYPERV_H */

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


[PATCH] staging/ion: Add support to get ion handle from dma buf

2016-01-05 Thread Rohit kumar
Currently we can only import dma buf fd's to get ion_handle.
Adding support to import dma buf handles to support kernel
specific use cases.

Signed-off-by: Rohit kumar 
---
Currently, ION is the memory manager for graphics in android. However,
in other linux platforms such as Tizen, DRM-GEM is used for buffer 
management for graphics. It has gem_handle corresponding to a buffer
and uses gem_name for sharing the buffer with other processes. However,
it also uses dma_buf fd for 3d operations. For wayland, there are
multiple calls for gem_handle to dma_buf fd conversion. So, we store
dma_buf associated with buffer. But, there is no api for getting
ion_handle from dma_buf. This patch exposes api to retrieve the ion
handle from dma_buf for similar use cases. With this patch, we can
integrate ION within DRM-GEM for buffer management and dma_buf sharing.

 drivers/staging/android/ion/ion.c |   21 +++--
 drivers/staging/android/ion/ion.h |   20 
 2 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/android/ion/ion.c 
b/drivers/staging/android/ion/ion.c
index e237e9f..5509716 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -1151,16 +1151,13 @@ int ion_share_dma_buf_fd(struct ion_client *client, 
struct ion_handle *handle)
 }
 EXPORT_SYMBOL(ion_share_dma_buf_fd);
 
-struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd)
+struct ion_handle *ion_import_dma_buf(struct ion_client *client,
+ struct dma_buf *dmabuf)
 {
-   struct dma_buf *dmabuf;
struct ion_buffer *buffer;
struct ion_handle *handle;
int ret;
 
-   dmabuf = dma_buf_get(fd);
-   if (IS_ERR(dmabuf))
-   return ERR_CAST(dmabuf);
/* if this memory came from ion */
 
if (dmabuf->ops != _buf_ops) {
@@ -1199,6 +1196,18 @@ end:
 }
 EXPORT_SYMBOL(ion_import_dma_buf);
 
+struct ion_handle *ion_import_dma_buf_fd(struct ion_client *client, int fd)
+{
+   struct dma_buf *dmabuf;
+
+   dmabuf = dma_buf_get(fd);
+   if (IS_ERR(dmabuf))
+   return ERR_CAST(dmabuf);
+
+   return ion_import_dma_buf(client, dmabuf);
+}
+EXPORT_SYMBOL(ion_import_dma_buf_fd);
+
 static int ion_sync_for_device(struct ion_client *client, int fd)
 {
struct dma_buf *dmabuf;
@@ -1306,7 +1315,7 @@ static long ion_ioctl(struct file *filp, unsigned int 
cmd, unsigned long arg)
{
struct ion_handle *handle;
 
-   handle = ion_import_dma_buf(client, data.fd.fd);
+   handle = ion_import_dma_buf_fd(client, data.fd.fd);
if (IS_ERR(handle))
ret = PTR_ERR(handle);
else
diff --git a/drivers/staging/android/ion/ion.h 
b/drivers/staging/android/ion/ion.h
index b860c5f..a1331fc 100644
--- a/drivers/staging/android/ion/ion.h
+++ b/drivers/staging/android/ion/ion.h
@@ -192,14 +192,26 @@ struct dma_buf *ion_share_dma_buf(struct ion_client 
*client,
 int ion_share_dma_buf_fd(struct ion_client *client, struct ion_handle *handle);
 
 /**
- * ion_import_dma_buf() - given an dma-buf fd from the ion exporter get handle
+ * ion_import_dma_buf() - get ion_handle from dma-buf
+ * @client:the client
+ * @dmabuf:the dma-buf
+ *
+ * Get the ion_buffer associated with the dma-buf and return the ion_handle.
+ * If no ion_handle exists for this buffer, return newly created ion_handle.
+ * If dma-buf from another exporter is passed, return ERR_PTR(-EINVAL)
+ */
+struct ion_handle *ion_import_dma_buf(struct ion_client *client,
+ struct dma_buf *dmabuf);
+
+/**
+ * ion_import_dma_buf_fd() - given a dma-buf fd from the ion exporter get 
handle
  * @client:the client
  * @fd:the dma-buf fd
  *
- * Given an dma-buf fd that was allocated through ion via ion_share_dma_buf,
- * import that fd and return a handle representing it.  If a dma-buf from
+ * Given an dma-buf fd that was allocated through ion via ion_share_dma_buf_fd,
+ * import that fd and return a handle representing it. If a dma-buf from
  * another exporter is passed in this function will return ERR_PTR(-EINVAL)
  */
-struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd);
+struct ion_handle *ion_import_dma_buf_fd(struct ion_client *client, int fd);
 
 #endif /* _LINUX_ION_H */
-- 
1.7.9.5

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