searching for a missing driver

2018-05-22 Thread Hugo Lefeuvre
usb-device/ -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA signature.asc Description: PGP signature ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.o

Re: searching for a missing driver

2018-05-23 Thread Hugo Lefeuvre
those should not be hard to come by. Thanks for your answers. I'm going to take a look at TODO entries in staging, and at sensor drivers then. You might see me come back later with questions. :) Happy hacking ! Regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4

Re: [PATCH v2] staging: pi433: add mutex fixing concurrency issues.

2018-06-09 Thread Hugo Lefeuvre
test it because I don't have test devices. -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[PATCH] staging: pi433: add mutex fixing race condition when accessing tx_cfg

2018-06-11 Thread Hugo Lefeuvre
enter in an inconsistent state. Add a mutex making sure that the PI433_IOC_WR_TX_CFG case will never be run by several threads concurrently. Signed-off-by: Hugo Lefeuvre --- drivers/staging/pi433/pi433_if.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/staging

Re: [PATCH v2] staging: pi433: add mutex fixing concurrency issues.

2018-06-07 Thread Hugo Lefeuvre
_data, which > wraps struct pi433_instance and its mutex. > > Make filp->private_data point to a struct pi433_data, allowing to > acquire the lock before accessing the struct pi433_instance. > > Signed-off-by: Hugo Lefeuvre > --- > Changes in v2: > - Use mutex

Re: [PATCH] staging: pi433: add mutex fixing race condition when accessing tx_cfg

2018-06-12 Thread Hugo Lefeuvre
don't even need to introduce a new lock, using device->tx_fifo_lock should be fine. I'll update the patch. -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA signature.asc Descript

Re: [PATCH v2] staging: pi433: add mutex fixing concurrency issues.

2018-06-12 Thread Hugo Lefeuvre
en to the fifo by pi433_write. What kind of checks do you want to perform exactly ? But, right, I prefer the idea of the temporary buffer too, and seeing the rest of kernel code it seems to be the usual way to go. Regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096

[PATCH v2] staging: pi433: fix race condition in pi433_ioctl

2018-06-12 Thread Hugo Lefeuvre
_CFG case in pi433_ioctl. Also, do not copy data directly from user space to instance->tx_cfg. Instead use a temporary buffer allowing future checks for correctness of copied data. Signed-off-by: Hugo Lefeuvre --- Changes in v2: - Use device->tx_fifo_lock instead of introducing a new lock in

Re: [PATCH v3] staging: pi433: fix race condition in pi433_ioctl

2018-06-14 Thread Hugo Lefeuvre
fixed in v4. Sorry for the noise. -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA signature.asc Description: PGP signature ___ Kernelnewbies mailing list Kernelnewbies@kerne

[PATCH v4] staging: pi433: fix race condition in pi433_ioctl

2018-06-13 Thread Hugo Lefeuvre
_CFG case in pi433_ioctl. Also, do not copy data directly from user space to instance->tx_cfg. Instead use a temporary buffer allowing future checks for correctness of copied data and simpler code. Signed-off-by: Hugo Lefeuvre --- Changes in v4: - Fix incorrect buffer name in memcpy. --- drivers/s

Re: [PATCH v2] staging: pi433: fix race condition in pi433_ioctl

2018-06-13 Thread Hugo Lefeuvre
if (copy_from_user(_cfg_buffer, argp, > > + sizeof(struct pi433_tx_cfg))) { > > Sorry for the duplicate review, but it got sent to both my inboxes... :P Thanks for your review ! Patch updated. Please tell me if you don't to be CC-ed anymore. :) regard

[PATCH v3] staging: pi433: fix race condition in pi433_ioctl

2018-06-13 Thread Hugo Lefeuvre
_CFG case in pi433_ioctl. Also, do not copy data directly from user space to instance->tx_cfg. Instead use a temporary buffer allowing future checks for correctness of copied data and simpler code. Signed-off-by: Hugo Lefeuvre --- Changes in v3: - Use tx_cfg for the name of temporary buffer (sho

develoment workflow: how to avoid duplicate work ?

2018-05-28 Thread Hugo Lefeuvre
on this particular issue ? (apart from the bug tracker, which doesn't seem to be very active when it comes to the staging subtree) Thanks ! Regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA signature.asc Description: PGP

Re: develoment workflow: how to avoid duplicate work ?

2018-05-30 Thread Hugo Lefeuvre
appen. I'll submit a patch. Thanks ! Cheers, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA signature.asc Description: PGP signature ___ Kernelnewbies mailing list Kernelnewb

Re: develoment workflow: how to avoid duplicate work ?

2018-05-29 Thread Hugo Lefeuvre
ecuting between lines 879 and 880, we might perform a NULL pointer dereference, right ? Regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA signature.asc Description: PGP signature

Re: develoment workflow: how to avoid duplicate work ?

2018-05-29 Thread Hugo Lefeuvre
uite rare. Then I will simply submit my patch and let the maintainer check for conflicts. Thanks for your answer. Cheers, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA signature.asc Descript

Re: develoment workflow: how to avoid duplicate work ?

2018-06-03 Thread Hugo Lefeuvre
t while release is being called, the ioctl call from T1 may still be running, right ? -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA signature.asc Description: PGP signature ___ Kernelnew

Re: develoment workflow: how to avoid duplicate work ?

2018-06-04 Thread Hugo Lefeuvre
340] [<8010b810>] (do_work_pending) from [<80108094>] > (slow_work_pending+0xc/0x20) Interesting. I don't know what's happening here, but the idea that release() would be delayed until all operations returned (as nice as it sounds) seems pretty odd to me. I'll not have time to experiment on

Re: develoment workflow: how to avoid duplicate work ?

2018-06-04 Thread Hugo Lefeuvre
passed FD but instead create duplicates to make sure the open file description won't be freed during their execution, right ? Cheers, hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA signature.asc Descri

[PATCH] staging: pi433: add rw semaphore fixing concurrency issues

2018-06-01 Thread Hugo Lefeuvre
lso affect pi433_write and pi433_read. The newly introduced semaphore makes sure that filp->private_data will not be freed by pi433_release (writer) as long as pi433_write, pi433_read or pi433_ioctl (readers) are still executing. Signed-off-by: Hugo Lefeuvre --- drivers/staging/pi433/pi433_if.

Re: [PATCH] staging: pi433: add rw semaphore fixing concurrency issues

2018-06-01 Thread Hugo Lefeuvre
dn't notice it. Thanks ! Otherwise, do you think the usage of rw semaphore is appropriate in this case ? Regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA ___ Kernelnewbies mai

[PATCH v2] staging: pi433: add mutex fixing concurrency issues.

2018-06-02 Thread Hugo Lefeuvre
ilp->private_data point to a struct pi433_data, allowing to acquire the lock before accessing the struct pi433_instance. Signed-off-by: Hugo Lefeuvre --- Changes in v2: - Use mutex instead of rw semaphore. - Introduce struct pi433_data in order to allow functions t

Re: [PATCH] staging: pi433: add rw semaphore fixing concurrency issues

2018-06-02 Thread Hugo Lefeuvre
wrapper struct pi433_data which would contain pointers to the pi433_instance and its mutex. I couldn't find any similar situation in the kernel, so I'm not sure it's the right way to go though. Thanks ! Regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0

Re: develoment workflow: how to avoid duplicate work ?

2018-06-05 Thread Hugo Lefeuvre
atch later. Thanks ! Cheers, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA signature.asc Description: PGP signature ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies

Re: develoment workflow: how to avoid duplicate work ?

2018-06-05 Thread Hugo Lefeuvre
safe :) I'll take a closer look at the TODO and come back later with a patch. If there's nothing to do I'll remove it, otherwise I'll fix it. Cheers, Hugo [0] https://elixir.bootlin.com/linux/latest/source/fs/ioctl.c#L692 -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F