Re: [PATCH] usbip: tools usbip_attach: Fix cryptic error messages

2018-02-27 Thread Krzysztof Opasiak
(rhport < 0) { - err("query"); + err("Attach request for Device %s. Is this device exported?", + busid); return -1; } The code itself is ok and you may put my: Reviewed-by: Krzysztof Opasiak but just because

Re: [PATCH] usbip: vudc: fix null pointer dereference on udc->lock

2018-02-27 Thread Krzysztof Opasiak
- dev_err(dev, "no device or gadget not bound"); + if (!udc->driver || !udc->pullup) { + dev_err(dev, "gadget not bound"); ret = -ENODEV; goto unlock; } Thanks for the patch. Looks good to me. Acke

Re: [RFC PATCH v2 4/4] Allow to trace fd usage with rlimit-events

2017-12-15 Thread Krzysztof Opasiak
On 12/15/2017 12:59 AM, Andreas Dilger wrote: On Dec 14, 2017, at 3:00 PM, Krzysztof Opasiak wrote: Add rlimit-events calls to file descriptors management code to allow tracing of FD usage. This allows userspace process (monitor) to get notification when other process (subject) uses given

[RFC PATCH v2 4/4] Allow to trace fd usage with rlimit-events

2017-12-14 Thread Krzysztof Opasiak
;s in system services instead of polling with predefined interval. Signed-off-by: Krzysztof Opasiak --- drivers/android/binder.c | 4 +-- fs/exec.c| 2 +- fs/file.c| 82 +++- fs/open.c| 2 +- include/

[RFC PATCH v2 3/4] Connect rlimit-events with process life cycle

2017-12-14 Thread Krzysztof Opasiak
Add rlimit-events call to process lifecycle to ensure that we get notified whenever process dies (to cleanup our watch levels) or forks (to implement watch levels inheritance). Signed-off-by: Krzysztof Opasiak --- kernel/exit.c | 3 +++ kernel/fork.c | 11 ++- 2 files changed, 13

[RFC PATCH v2 1/4] sched: Allow to get() and put() signal struct

2017-12-14 Thread Krzysztof Opasiak
Allow to get() and put() signal struct from different parts of kernel core, not only from signal.c. This is useful when you place inside signal struct additional resources that has to be accessed after process dies. Signed-off-by: Krzysztof Opasiak --- include/linux/sched/signal.h | 13

[RFC PATCH v2 2/4] Add rlimit-events framework

2017-12-14 Thread Krzysztof Opasiak
given resource. When monitoring subject crosses given usage level monitoring fd will be ready to read resource change event from it. It's possible to monitor multiple processes and single process can be monitored by multiple other processes. Signed-off-by: Krzysztof Opasiak --- Document

[RFC PATCH v2 0/4] Add rlimit-resources change notification mechanism

2017-12-14 Thread Krzysztof Opasiak
tion can be found on my github: https://github.com/kopasiak/rlimit-events-tests Please share your opinion about idea and current design. -- Best regards Krzysztof Opasiak Changes since v1: - Reuse binder's file structure stored in proc - Fix license issues - Fix indentation - Fi

Re: [PATCH 2/2] usbip: use monotonic timestamps

2017-11-07 Thread Krzysztof Opasiak
and should be better synchronized with other machines we talk to. Signed-off-by: Arnd Bergmann Looks good to me: Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH 1/2] usbip: fix off-by-one frame number calculation

2017-11-07 Thread Krzysztof Opasiak
best explanation is that it was a simple typo, so I'm changing the % modulo operator into a cheaper bitmask that the other drivers use, to make it wrap after 0x7ff rather than before it. Signed-off-by: Arnd Bergmann Looks good to me: Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak S

Re: [PATCH 3/4][PoC][RFC] Connect rlimit-events with process life cycle

2017-10-19 Thread Krzysztof Opasiak
On 10/19/2017 09:41 AM, Greg KH wrote: On Wed, Oct 18, 2017 at 10:32:29PM +0200, Krzysztof Opasiak wrote: Add rlimit-events call to process lifecycle to ensure that we get notified whenever process dies (to cleanup our watch levels) or forks (to implement watch levels inheritance). Signed

Re: [PATCH 2/4][PoC][RFC] Add rlimit-events framework

2017-10-19 Thread Krzysztof Opasiak
Hi, On 10/19/2017 09:41 AM, Greg KH wrote: Meta-comments on the code, I'm not commenting on the content, just normal code review things that I always see in kernel code... On Wed, Oct 18, 2017 at 10:32:28PM +0200, Krzysztof Opasiak wrote: diff --git a/include/linux/rlimit_noti_ker

Re: [PATCH 1/4][PoC][RFC] sched: Allow to get() and put() signal struct

2017-10-19 Thread Krzysztof Opasiak
On 10/19/2017 09:34 AM, Greg KH wrote: On Wed, Oct 18, 2017 at 10:32:27PM +0200, Krzysztof Opasiak wrote: Allow to get() and put() signal struct from different parts of kernel core, not only from signal.c. That says what this does, but not _why_. Who would ever want to have access to these

Re: [PATCH 4/4][PoC][RFC] Allow to trace fd usage with rlimit-events

2017-10-19 Thread Krzysztof Opasiak
Hi, On 10/19/2017 01:05 AM, Al Viro wrote: On Wed, Oct 18, 2017 at 10:32:30PM +0200, Krzysztof Opasiak wrote: @@ -417,7 +417,7 @@ static int task_get_unused_fd_flags(struct binder_proc *proc, int flags) rlim_cur = task_rlimit(proc->tsk, RLIMIT_NOFILE); unlock_task_sigh

[PATCH 0/4][PoC][RFC] Add rlimit-resources change notification mechanism

2017-10-18 Thread Krzysztof Opasiak
tion can be found on my github: https://github.com/kopasiak/rlimit-events-tests Please share your opinion about idea and current design. -- Best regards Krzysztof Opasiak --- Krzysztof Opasiak (4): sched: Allow to get() and put() signal struct Add rlimit-events framework Connect rlimit-e

[PATCH 4/4][PoC][RFC] Allow to trace fd usage with rlimit-events

2017-10-18 Thread Krzysztof Opasiak
;s in system services instead of polling with predefined interval. Signed-off-by: Krzysztof Opasiak --- drivers/android/binder.c | 4 +-- fs/exec.c| 2 +- fs/file.c| 83 fs/open.c| 2 +- include/

[PATCH 2/4][PoC][RFC] Add rlimit-events framework

2017-10-18 Thread Krzysztof Opasiak
given resource. When monitoring subject crosses given usage level monitoring fd will be ready to read resource change event from it. It's possible to monitor multiple processes and single process can be monitored by multiple other processes. Signed-off-by: Krzysztof Opasiak --- includ

[PATCH 3/4][PoC][RFC] Connect rlimit-events with process life cycle

2017-10-18 Thread Krzysztof Opasiak
Add rlimit-events call to process lifecycle to ensure that we get notified whenever process dies (to cleanup our watch levels) or forks (to implement watch levels inheritance). Signed-off-by: Krzysztof Opasiak --- kernel/exit.c | 4 kernel/fork.c | 16 +++- 2 files changed, 19

[PATCH 1/4][PoC][RFC] sched: Allow to get() and put() signal struct

2017-10-18 Thread Krzysztof Opasiak
Allow to get() and put() signal struct from different parts of kernel core, not only from signal.c. Signed-off-by: Krzysztof Opasiak --- include/linux/sched/signal.h | 13 + kernel/fork.c| 9 ++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a

[tip:timers/core] posix-cpu-timers: Use dedicated helper to access rlimit values

2017-08-20 Thread tip-bot for Krzysztof Opasiak
Commit-ID: 3cf294962df8fcde710eb5e762e0929e2ba49947 Gitweb: http://git.kernel.org/tip/3cf294962df8fcde710eb5e762e0929e2ba49947 Author: Krzysztof Opasiak AuthorDate: Wed, 5 Jul 2017 19:25:48 +0200 Committer: Thomas Gleixner CommitDate: Fri, 18 Aug 2017 12:44:42 +0200 posix-cpu-timers

[PATCH 4/4] mm: Use dedicated helper to access rlimit value

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() helper instead of manually writing whole chain from current task to rlim_cur Signed-off-by: Krzysztof Opasiak --- mm/mmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index a5e3dcd75e79..8d268b3983c9 100644 --- a/mm/mmap.c +++ b

[PATCH 3/4] fs: Use dedicated helper to access rlimit value

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() helper instead of manually writing whole chain from current task to rlim_cur Signed-off-by: Krzysztof Opasiak --- fs/exec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/exec.c b/fs/exec.c index 904199086490..964e34e307df 100644 --- a/fs/exec.c +++ b/fs

[PATCH 2/4] time: posix: Use dedicated helper to access rlimit values

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() and rlimit_max() helper instead of manually writing whole chain from task to rlimit value Signed-off-by: Krzysztof Opasiak --- kernel/time/posix-cpu-timers.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/kernel/time/posix-cpu-timers.c b/kernel

[PATCH 1/4] android: binder: Use dedicated helper to access rlimit value

2017-07-05 Thread Krzysztof Opasiak
Use rlimit() helper instead of manually writing whole chain from current task to rlim_cur Signed-off-by: Krzysztof Opasiak --- drivers/android/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index aae4d8d4be36

Re: [PATCH 03/11] Creation of "usb_device_auth" LSM hook

2017-06-12 Thread Krzysztof Opasiak
dification... without matching and storing rules inside kernel.. just pure userspace which uses device/interface authorization Footnote: 1 - https://dkopecek.github.io/usbguard/ Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH] usb: gadget: remove redundant self assignment

2017-04-19 Thread Krzysztof Opasiak
) goto out; ret = ep->ops->disable(ep); - if (ret) { - ret = ret; + if (ret) goto out; - } ep->enabled = false; Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH 1/2] fs: configfs: make qw_sign attribute symmetric

2017-04-19 Thread Krzysztof Opasiak
ines in case of gadget/config strings. Reviewed-by: Krzysztof Opasiak Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH 2/2] fs: configfs: use hexadecimal values and new line

2017-04-19 Thread Krzysztof Opasiak
n sprintf(page, "%d\n", to_usb_os_desc_ext_prop(item)->type); } static ssize_t ext_prop_type_store(struct config_item *item, looks good to me: Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: counting file descriptors with a cgroup controller

2017-03-08 Thread Krzysztof Opasiak
On 03/07/2017 09:48 PM, Tejun Heo wrote: Hello, On Tue, Mar 07, 2017 at 09:06:49PM +0100, Krzysztof Opasiak wrote: Personally, I don't want to use rlimit for this as it ends up returning error code from for example open() when we hit the limit. This may lead to some unpredictable crash

Re: counting file descriptors with a cgroup controller

2017-03-08 Thread Krzysztof Opasiak
On 03/08/2017 03:59 AM, Parav Pandit wrote: Hi, On Tue, Mar 7, 2017 at 2:48 PM, Tejun Heo wrote: Hello, On Tue, Mar 07, 2017 at 09:06:49PM +0100, Krzysztof Opasiak wrote: Personally, I don't want to use rlimit for this as it ends up returning error code from for example open() wh

Re: counting file descriptors with a cgroup controller

2017-03-07 Thread Krzysztof Opasiak
On 03/07/2017 08:41 PM, Tejun Heo wrote: Hello, Krzysztof. On Tue, Mar 07, 2017 at 12:19:52PM +0100, Krzysztof Opasiak wrote: So maybe let me clarify our use case so we can have some more discussion about this. We are dealing with task of monitoring system services on an IoT system. So this

Re: counting file descriptors with a cgroup controller

2017-03-07 Thread Krzysztof Opasiak
Hi On 03/06/2017 07:58 PM, Tejun Heo wrote: Hello, On Fri, Feb 17, 2017 at 12:37:11PM +0100, Krzysztof Opasiak wrote: We need to limit and monitor the number of file descriptors processes keep open. If a process exceeds certain limit we'd like to terminate it and restart it or reboo

Re: [PATCH] usb: gadget: add RNDIS configfs option for Windows rndiscmp.inf compatibility

2017-03-01 Thread Krzysztof Opasiak
s_rndiscmp attribute? So instead of having single attribute which sets the whole triple of values to some hardcoded ones I would prefer to have one attribute per each of this values and allow user to set them to his own values from userspace. Best regards, -- Krzysztof Opasiak Samsung R&D In

Re: [PATCH v2 1/2] usbip: Fix-format-overflow

2017-02-21 Thread Krzysztof Opasiak
Best regards -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH 1/2] Fix format overflows

2017-02-20 Thread Krzysztof Opasiak
= 30) { Please don't hardcode such values in if. use sizeof() like one line above + err("socket length %i >= 30", size); + return -1; + } ret = write_sysfs_attribute(sockfd_attr_path, sockfd_buff, strlen(sockfd_buff)); Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: counting file descriptors with a cgroup controller

2017-02-17 Thread Krzysztof Opasiak
e descriptors of its members (similar to > memory controler). > > Any comments? Is there any alternative that: > > + does not require modifications of user-land code, > + enables other process (e.g. init) to be notified and apply policy. > > Kind regards, > -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH] tools: usb usbip - update README USB/IP driver location

2017-01-15 Thread Krzysztof Opasiak
On 01/14/2017 12:38 AM, Shuah Khan wrote: > Update USB/IP driver location in README. > > Signed-off-by: Shuah Khan Reviewed-by: Krzysztof Opasiak Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH] usbip: vudc: check for NULL before use

2016-12-21 Thread Krzysztof Opasiak
should check in those callbacks if our params are NULL or not. I have also run through udc-core implementation and generally it doesn't check if params are NULL or not and just dereference some of them and pass them to our callbacks. I think that the best option is just to ask Felipe (USB gadget maintainer) if we should check this or not. @Felipe Should each UDC check if values passed to gadget/endpoint callbacks is not NULL or just simply dereference them? Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

[PATCH] tools: usb: usbip: Update README

2016-12-13 Thread Krzysztof Opasiak
Update README file: - remove outdated parts - clarify terminology and general structure - add some description of vUDC Signed-off-by: Krzysztof Opasiak --- tools/usb/usbip/README | 56 +- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git

[PATCH v3] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-12 Thread Krzysztof Opasiak
Add some simple script which creates a USB gadget using ConfigFS and then exports it using vUDC. This may be useful for people who just started playing with USB/IP and vUDC as it shows exact steps how to setup all stuff. Signed-off-by: Krzysztof Opasiak --- Changes since v2: - mention about

Re: [PATCH v2] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-12 Thread Krzysztof Opasiak
Hi, On 12/09/2016 10:40 PM, Shuah Khan wrote: > Hi Krzysztof, > > Thanks for getting to this so quickly. Couple of comments below: > > On 12/09/2016 10:15 AM, Krzysztof Opasiak wrote: >> Add some simple script which creates a USB gadget using ConfigFS >> and

[PATCH v2] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-09 Thread Krzysztof Opasiak
Add some simple script which creates a USB gadget using ConfigFS and then exports it using vUDC. This may be useful for people who just started playing with USB/IP and vUDC as it shows exact steps how to setup all stuff. Signed-off-by: Krzysztof Opasiak --- Changes since v1: - Fix terminology

Re: [PATCH] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-09 Thread Krzysztof Opasiak
On 12/09/2016 06:07 PM, Krzysztof Opasiak wrote: > Add some simple script which creates a USB gadget using ConfigFS > and then exports it using vUDC. > > This may be useful for people who just started playing with > USB/IP and vUDC as it shows exact steps how to setup all stuff.

Re: Fwd: Antwort: Re: vUDC

2016-12-09 Thread Krzysztof Opasiak
On 12/09/2016 03:43 PM, Shuah Khan wrote: > Hi Krzysztof, > > On 12/09/2016 01:43 AM, Krzysztof Opasiak wrote: >> FYI to the list for next generations;) >> >> >> Forwarded Message >> Subject: Antwort: Re: vUDC >> Date: Fri, 9 Dec

[PATCH] tools: usb: usbip: Add simple script to show how to setup vUDC

2016-12-09 Thread Krzysztof Opasiak
Add some simple script which creates a USB gadget using ConfigFS and then exports it using vUDC. This may be useful for people who just started playing with USB/IP and vUDC as it shows exact steps how to setup all stuff. Signed-off-by: Krzysztof Opasiak --- tools/usb/usbip/vudc

Fwd: Antwort: Re: vUDC

2016-12-09 Thread Krzysztof Opasiak
FYI to the list for next generations;) Forwarded Message Subject: Antwort: Re: vUDC Date: Fri, 9 Dec 2016 09:00:04 +0100 From: Elen Niedermeyer To: Krzysztof Opasiak Hi, so your script solved my problem. I didn't know that I should start the daemon with 'usbip

Re: vUDC

2016-12-08 Thread Krzysztof Opasiak
ce Client: $ modprobe usbip-vhci $ usbip attach -r $SERVER_IP -d usbip-vudc.0 Please let me know if your setup script is similar and what exactly is not working for you. > Any ideas. Maybe it is time the documentation is updated with vudc details. > Yes I think it's a good idea. I'll try to do this when I have some spare time. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: usb/gadget: GPF in usb_gadget_unregister_driver

2016-12-05 Thread Krzysztof Opasiak
_registered will be set to true in dev_config() > and dev_release() will call usb_gadget_unregister_driver(), which in > turn will try to remove driver from gadget_driver_pending_list. > > Does it make any sense? > Yes. We should add gadget to pending list only if suitable UDC has not been found and gadget driver is willing to wait for new UDC to appear. Otherwise we call udc_bind_to_gadget() and if this success then we should just return 0 as we took some free udc. usually you should have empty pending list;) Your description sounds really quite similar to what Felix fixed in his patch[1]. This patch fix this function in case when we found matching UDC but it is busy. Footnotes: 1 - http://marc.info/?l=linux-usb&m=148054830631070&w=2 Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [LINUX PATCH] usb: gadget: Configure bulk maxburst through module parameter in gadget zero.

2016-09-29 Thread Krzysztof Opasiak
such option to f_sourcesink then you should probably do this as configfs attribute not only g_zero module param. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [RFC PATCH 0/5] USB Audio Gadget refactoring

2016-07-26 Thread Krzysztof Opasiak
if we should break the userspace api that the existing UAC1 > driver exposes. Maybe we should add another virtual-sound-card > exposing UAC1 driver ... and hopefully very similar to (or just port > of) the f_audio_source.c from android. Definitely agree with this opinion. I don't se

Re: [PATCH] usb: usbip: remove null check

2016-06-06 Thread Krzysztof Opasiak
questType = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE; > Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH] usb: usbip: fix null pointer dereference

2016-06-06 Thread Krzysztof Opasiak
On 06/05/2016 07:54 PM, Sudip Mukherjee wrote: > On Friday 03 June 2016 09:29 AM, Krzysztof Opasiak wrote: >> >> >> On 06/02/2016 03:22 PM, Sudip Mukherjee wrote: >>> We have been dereferencing udc before checking it. Lets use it after it >>> has been check

Re: [PATCH] usb: usbip: fix null pointer dereference

2016-06-03 Thread Krzysztof Opasiak
(for example stack trace)? If this patch is just to prevent us from something that will never happen then I would rather to not submit this. In my opinion if we get a NULL in this function this means that we have some serious problem in UDC core and this check will just mask this error. Best reg

Re: usbip: vudc: Fix apparent cut-n-paste error

2016-06-01 Thread Krzysztof Opasiak
_socket, SHUT_RDWR); > > - if (ud->tcp_tx) { > + if (ud->tcp_rx) { > kthread_stop_put(ud->tcp_rx); > ud->tcp_rx = NULL; > } > > Reviewed-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-16 Thread Krzysztof Opasiak
this need to be fixed as well? > I think it has been already fixed: http://permalink.gmane.org/gmane.linux.usb.general/139316 Cheers, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH 1/2] usb: configfs: allow UDC binding rule configured as binding to *any* UDC

2016-05-05 Thread Krzysztof Opasiak
busy. >> >>> In a word, this patch is just an improvement, not to fix any issues or >>> add new function. >> >> So it doesn't add any new functionality and breaks existing user space >> tools. >> Yes, currently it's true but it's a bug which I h

Re: [PATCH 1/2] usb: configfs: allow UDC binding rule configured as binding to *any* UDC

2016-05-05 Thread Krzysztof Opasiak
situation in which I >> have to turn the light off before turning it on once again;) >> > That is not a problem. But just avoid pseudo 'busy'. If gadget is not > bind, it is free to reconfigure it. So seem no need block re-configuration. > What do you mean ps

Re: [PATCH 1/2] usb: configfs: allow UDC binding rule configured as binding to *any* UDC

2016-05-04 Thread Krzysztof Opasiak
nefit of adding this special "any" keyword to kernel? > And also we can change UDC name > at any time if it is not binded (no need set to "" first). > Not sure if: $ echo "" > UDC is really a problem. Personally I'm quite used to situation in which

Re: [PATCH] usbip: vudc: fix Kconfig dependencies

2016-04-29 Thread Krzysztof Opasiak
BIP_VUDC > tristate "VUDC driver" > - depends on USBIP_CORE > + depends on USBIP_CORE && USB_GADGET So having in mind what I wrote you above about urs I would suggest changing this line to: depends on USBIP_CORE && USB_GADGET && USB And we can remove this in a future when we will refactor usbip code. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH] MAINTAINERS: nfc: s3fwrn5: Add second maintainer

2016-03-10 Thread Krzysztof Opasiak
On 03/10/2016 03:22 PM, Robert Baldyga wrote: > Add Krzysztof Opasiak as maintainer of S3FWRN5 driver. > > Signed-off-by: Robert Baldyga Acked-by: Krzysztof Opasiak -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH 3/5] usb: gadget: gmidi: remove bus powered requirement on bmAttributes

2016-03-08 Thread Krzysztof Opasiak
ng usbg_import_gadget() in C code or gt[2] load from shell. Footnotes: 1 - https://github.com/libusbgx/libusbgx/blob/master/doc/gadget_schemes.txt 2 - https://github.com/kopasiak/gt Cheers, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH 3/5] usb: gadget: gmidi: remove bus powered requirement on bmAttributes

2016-03-08 Thread Krzysztof Opasiak
drivers, we still need >> these modules. > > there is already a library called libusbg. As libusbg itself is a little bit dead there is a fork called libusbgx[1] and it is still active;) It already has support for f_midi so it is ready to use. Footnotes: 1 - https://github.com/libusbgx/libusbgx Cheers, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics

Re: [PATCH] configfs: implement binary attributes

2015-12-29 Thread Krzysztof Opasiak
ne helper here instead of adding this or as this may simplify the code in a few places. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord..

Re: [PATCH] configfs: implement binary attributes

2015-12-29 Thread Krzysztof Opasiak
if (buffer->write_in_progress) { >> + retval = -EINVAL; >> + goto out; >> + } > > These are valid arguments, it's just competing with another operation. > Wouldn't something like EINPROGRESS or ETXTBSY make more sense and be > more

Re: [PATCH v1 0/1] ioctl to disallow detaching kernel USB drivers

2015-11-30 Thread Krzysztof Opasiak
On 11/30/2015 06:20 PM, Greg KH wrote: On Mon, Nov 30, 2015 at 06:12:22PM +0100, Krzysztof Opasiak wrote: On 11/30/2015 05:16 PM, Alan Stern wrote: On Fri, 27 Nov 2015, Krzysztof Opasiak wrote: I run through your code and as far as I understand above is not exactly true. Your patch

Re: [PATCH v1 0/1] ioctl to disallow detaching kernel USB drivers

2015-11-30 Thread Krzysztof Opasiak
On 11/30/2015 05:16 PM, Alan Stern wrote: On Fri, 27 Nov 2015, Krzysztof Opasiak wrote: I run through your code and as far as I understand above is not exactly true. Your patch allows only to prevent userspace from accessing interfaces which has kernel drivers, there is no way to stop an

Re: [PATCH v1 0/1] ioctl to disallow detaching kernel USB drivers

2015-11-27 Thread Krzysztof Opasiak
On 11/26/2015 06:29 PM, Greg KH wrote: On Thu, Nov 26, 2015 at 10:19:29AM +0100, Krzysztof Opasiak wrote: On 11/25/2015 04:45 PM, Emilio López wrote: Hi everyone, This patch introduces a new ioctl, USBDEVFS_DROP_PRIVILEGES, to voluntarily forgo the ability to issue ioctls which may

Re: [PATCH v1 0/1] ioctl to disallow detaching kernel USB drivers

2015-11-26 Thread Krzysztof Opasiak
s quite a lot of work and I don't know if any one is going to accept such a change Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord..

Re: [PATCH 03/23] usb: gadget: f_sourcesink: free requests in sourcesink_disable()

2015-11-16 Thread Krzysztof Opasiak
Hi, On 11/10/2015 03:02 AM, Peter Chen wrote: On Fri, Nov 06, 2015 at 10:58:39AM +0100, Krzysztof Opasiak wrote: On 11/06/2015 10:48 AM, Peter Chen wrote: On Fri, Nov 06, 2015 at 09:50:11AM +0100, Robert Baldyga wrote: On 11/06/2015 09:15 AM, Peter Chen wrote: On Tue, Nov 03, 2015 at 01

Re: [PATCH 03/23] usb: gadget: f_sourcesink: free requests in sourcesink_disable()

2015-11-06 Thread Krzysztof Opasiak
ter. Moreover, I would suggest to add qlen and iso_qlen params not only qlen as even now we are using different qlen for bulk and iso. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "un

Re: [PATCH v2] usb: gadget: f_sourcesink: fix function params handling

2015-09-24 Thread Krzysztof Opasiak
y the same case. Both those functions have the same bug. Footnotes: 1 - http://marc.info/?l=linux-usb&m=144311466118170&w=2 -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

Re: [PATCH 1/2] usb: gadget: loopback: fix: Don't share qlen and buflen between instances

2015-09-22 Thread Krzysztof Opasiak
On 09/22/2015 06:53 PM, Felipe Balbi wrote: On Tue, Sep 22, 2015 at 06:39:26PM +0200, Krzysztof Opasiak wrote: Each instance of loopback function may have different qlen and buflen attributes values. When linking function to configuration those values had been assigned to global variables

[PATCH v2 1/2] usb: gadget: loopback: fix: Don't share qlen and buflen between instances

2015-09-22 Thread Krzysztof Opasiak
avoid overwriting. Now each function has its own instance of those values. Cc: # 3.10+ Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/f_loopback.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/usb/gadget/function

[PATCH v2 2/2] usb: gadget: loopback: Fix looping back logic implementation

2015-09-22 Thread Krzysztof Opasiak
n oposite direction. Cc: # 3.18+ Signed-off-by: Krzysztof Opasiak --- Changes since v1: - add missing usb_ep_free_request() in complete() callback --- drivers/usb/gadget/function/f_loopback.c | 131 +- 1 file changed, 92 insertions(+), 39 deletions(-) diff --

[PATCH 2/2] usb: gadget: loopback: Fix looping back logic implementation

2015-09-22 Thread Krzysztof Opasiak
n oposite direction. Cc: # 3.18+ Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/f_loopback.c | 128 +- 1 file changed, 89 insertions(+), 39 deletions(-) diff --git a/drivers/usb/gadget/function/f_loopback.c b/drivers/usb/gadget/function/f_loopback.c in

[PATCH 1/2] usb: gadget: loopback: fix: Don't share qlen and buflen between instances

2015-09-22 Thread Krzysztof Opasiak
avoid overwriting. Now each function has its own instance of those values. Cc: # 3.10+ Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/f_loopback.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/usb/gadget/function

Re: [PATCH 04/26] usb: gadget: introduce 'enabled' flag in struct usb_ep

2015-09-15 Thread Krzysztof Opasiak
On 09/15/2015 05:43 PM, Felipe Balbi wrote: On Tue, Sep 15, 2015 at 05:37:27PM +0200, Krzysztof Opasiak wrote: Hello, On 09/15/2015 04:26 PM, Robert Baldyga wrote: This patch introduces 'enabled' flag in struct usb_ep, and modifies usb_ep_enable() and usb_ep_disable() fu

Re: [PATCH 05/26] usb: gadget: f_ecm: eliminate abuse of ep->driver data

2015-09-15 Thread Krzysztof Opasiak
resources when exiting with non 0 code. Endpoints are some kind of resources, they are "allocated" using usb_ep_autoconfig() and if you are not going to use them because error occurred you should free the using usb_ep_autoconfig_release(). Moreover, you have done this in source sink fu

Re: [PATCH 04/26] usb: gadget: introduce 'enabled' flag in struct usb_ep

2015-09-15 Thread Krzysztof Opasiak
ep_enable() should fail if ep is already disabled/enabled. Then in function code we should check if endpoint is enabled (maybe even we should have usb_ep_is_enabled()) and call disable only when it is really enabled. Best Regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electron

Re: [RFC][PATCH 1/2] usb: gadget: configfs: add MTP function

2015-08-13 Thread Krzysztof Opasiak
On 08/13/2015 09:57 PM, Greg Kroah-Hartman wrote: On Thu, Aug 13, 2015 at 09:34:46PM +0200, Krzysztof Opasiak wrote: Hello, On 08/13/2015 09:12 PM, Amit Pundir wrote: his MTP function is based on years of work originally done in the Android kernel tree by: Mike Lockwood Benoit

Re: [RFC][PATCH 1/2] usb: gadget: configfs: add MTP function

2015-08-13 Thread Krzysztof Opasiak
On 08/13/2015 09:57 PM, Greg Kroah-Hartman wrote: On Thu, Aug 13, 2015 at 09:34:46PM +0200, Krzysztof Opasiak wrote: Hello, On 08/13/2015 09:12 PM, Amit Pundir wrote: his MTP function is based on years of work originally done in the Android kernel tree by: Mike Lockwood Benoit

Re: [RFC][PATCH 2/2] usb: gadget: configfs: notify userspace of usb state changes

2015-08-13 Thread Krzysztof Opasiak
instead of adding mtp function we don't need this notification as mtp-responder can get all the required informations about gadget (function) via ep0 using functionfs events. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this

Re: [RFC][PATCH 1/2] usb: gadget: configfs: add MTP function

2015-08-13 Thread Krzysztof Opasiak
related to userspace I think that porting MTP daemon to use this is a right way to go. This should be much more reasonable than adding new function which also requires daemon for proper working. So why add another interface while we can use a generic one? Best regards, -- Krzysztof Opasiak Sa

Re: [PATCH v3 26/46] usb: gadget: pch_ud: add ep capabilities support

2015-07-20 Thread Krzysztof Opasiak
IZE); list_add_tail(&ep->ep.ep_list, &dev->gadget.ep_list); Best Regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord.

Re: [PATCH v3 01/46] usb: gadget: encapsulate endpoint claiming mechanism

2015-07-20 Thread Krzysztof Opasiak
lue, and if it has, it was assumed that it is claimed). It could cause bugs becouse if some function doesn't s/becouse/because Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe lin

Re: [Spice-devel] [RFC PATCH 1/1] Add a usbredir kernel module to remotely connect USB devices over IP.

2015-07-03 Thread Krzysztof Opasiak
swap should be set up only on real block devices which are fully served in kernel. -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.o

Re: [PATCH v5 2/5] usb: gadget: configfs: pass UDC name via usb_gadget_driver struct

2015-06-22 Thread Krzysztof Opasiak
ing like gadget_dev_bound() or gadget_dev_is_active() or some other more suitable name. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] usb: gadget: nokia: Add mass storage driver to g_nokia

2015-05-28 Thread Krzysztof Opasiak
On 05/28/2015 04:31 PM, Pali Rohár wrote: On Thursday 28 May 2015 16:27:44 Krzysztof Opasiak wrote: On 05/28/2015 09:47 AM, Pali Rohár wrote: On Saturday 31 January 2015 10:53:30 Pali Rohár wrote: This patch adds removable mass storage support to g_nokia gadget (for N900). It means that

Re: [PATCH] usb: gadget: nokia: Add mass storage driver to g_nokia

2015-05-28 Thread Krzysztof Opasiak
cy gadget you may switch to configfs interface and compose equivalent of g_nokia + mass storage without any changes in kernel. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe linux-kerne

Re: [PATCH v3] usb: gadget: ether: Fix MAC address parsing

2015-05-18 Thread Krzysztof Opasiak
ed as 00:14:3d:0f:ff:00 and used as correct MAC address. If this is the way it should be, maybe place at least a comment about it as it was not obvious (at least for me) that too short mac address should be also accepted. Best regards, -- Krzysztof Opasiak Samsung R&D Institute Poland Samsung

[PATCH v3 3/4] usb: gadget: mass_storage: Ensure that lun ids are contiguous

2015-04-09 Thread Krzysztof Opasiak
led to remove 'lun.1': Device or resource busy $ rmdir lun.2 $ rmdir lun.1 Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/f_mass_storage.c | 29 ++ 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/function/f

[PATCH v3 4/4] Documentation: ABI: Fix documentation for mass_storage function

2015-04-09 Thread Krzysztof Opasiak
w lun only if its id equals to max id + 1. Signed-off-by: Krzysztof Opasiak --- .../ABI/testing/configfs-usb-gadget-mass-storage |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/configfs-usb-gadget-mass-storage b/Documentation/ABI/testing/con

[PATCH v3 2/4] usb: gadget: mass_storage: Store lun_opts in fsg_opts

2015-04-09 Thread Krzysztof Opasiak
other luns using their id. Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/f_mass_storage.c |5 + drivers/usb/gadget/function/f_mass_storage.h |1 + 2 files changed, 6 insertions(+) diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget

[PATCH v3 1/4] fs: configfs: Add unlocked version of configfs_depend_item()

2015-04-09 Thread Krzysztof Opasiak
has configfs_depend/undepend_item() methods but they cannot be used in configfs callbacks. This commit adds unlocked version of this methods which can be used only in configfs callbacks. Signed-off-by: Krzysztof Opasiak --- fs/configfs/dir.c| 29 + include

[PATCH v3 0/4] Ensure that lun ids are contiguous

2015-04-09 Thread Krzysztof Opasiak
evice or resource busy $ rmdir lun.2 $ rmdir lun.1 Footnotes: 1 - http://www.usb.org/developers/docs/devclass_docs/usbmassbulk_10.pdf -- Best regards, Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics --- Changes since v1: - drop incorrect typo fix ("iff" is not a

Re: [PATCH 1/5] fs: configfs: Fix typo in comment

2015-04-09 Thread Krzysztof Opasiak
On 04/09/2015 03:46 PM, Felipe Balbi wrote: On Wed, Apr 08, 2015 at 01:28:44PM +0200, Krzysztof Opasiak wrote: Signed-off-by: Krzysztof Opasiak --- fs/configfs/dir.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index cf0db00

Re: [PATCH v2 4/4] Documentation: ABI: Fix documentation for mass_storage function

2015-04-09 Thread Krzysztof Opasiak
On 04/09/2015 10:32 AM, Tal Shorer wrote: On Wed, Apr 8, 2015 at 3:06 PM, Krzysztof Opasiak wrote: Luns in mass storage function are identified using their id. While creating lun's directory user cannot choose any arbitrary name other than arabic numeral from 1 to FSG_MAX_LUNS. Signe

Re: [PATCH v2 2/4] usb: gadget: mass_storage: Store lun_opts in fsg_opts

2015-04-08 Thread Krzysztof Opasiak
Hi, On 04/08/2015 04:15 PM, Alan Stern wrote:> On Wed, 8 Apr 2015, Krzysztof Opasiak wrote: > >> Signed-off-by: Krzysztof Opasiak >> --- >> drivers/usb/gadget/function/f_mass_storage.c |5 + >> drivers/usb/gadget/function/f_mass_storage.h |1 + >

[PATCH v2 4/4] Documentation: ABI: Fix documentation for mass_storage function

2015-04-08 Thread Krzysztof Opasiak
Luns in mass storage function are identified using their id. While creating lun's directory user cannot choose any arbitrary name other than arabic numeral from 1 to FSG_MAX_LUNS. Signed-off-by: Krzysztof Opasiak --- .../ABI/testing/configfs-usb-gadget-mass-storage |7 ++- 1

[PATCH v2 3/4] usb: gadget: mass_storage: Ensure that lun ids are contiguous

2015-04-08 Thread Krzysztof Opasiak
Signed-off-by: Krzysztof Opasiak --- drivers/usb/gadget/function/f_mass_storage.c | 35 +++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 095b618..9d9fafb

  1   2   >