Re: [PATCH] staging: pi433: fix race condition in pi433_open

2018-06-18 Thread Hugo Lefeuvre
ces: 1296 /* make sure ops on existing fds can abort cleanly */ 1297 device->spi = NULL; Thanks for your time ! Regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA

[PATCH] staging: pi433: fix race condition in pi433_open

2018-06-17 Thread Hugo Lefeuvre
f minor_lock in pi433_open(). Signed-off-by: Hugo Lefeuvre --- drivers/staging/pi433/pi433_if.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index 94e0bfcec991..73c511249f7f 100644 --- a/drivers/staging/pi43

rf69_set_deviation in rf69.c (pi433 driver)

2018-06-04 Thread Hugo Lefeuvre
nything, simply expose API) I'd really prefer going for the first one, but I wanted to have your opinion on this. Thanks for your work ! Best regards, Hugo [0] http://www.hoperf.com/upload/rf/RFM69CW-V1.1.pdf [CC-ing Valentin Vidic, he was quite active on the pi433 driver these last months]

Re: [PATCH] staging: pi433: fix race condition in pi433_open

2018-06-19 Thread Hugo Lefeuvre
/* make sure ops on existing fds can abort cleanly */ > > 1297 device->spi = NULL; > > That's when we're unloading the module so there aren't any users left. I'll submit an updated version of my patch getting rid of the counter and addressing the remaining race conditions. Thanks

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

2018-06-19 Thread Hugo Lefeuvre
counter and move rx buffer {de,}allocation to probe() and remove(). Remove associated dead code from open() and release(). Remove related TODO entry from ioctl(). Signed-off-by: Hugo Lefeuvre --- Changes in v2: - Remove useless users counter. - Remove unneeded TODO entry in ioctl

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

2018-06-20 Thread Hugo Lefeuvre
On Wed, Jun 20, 2018 at 11:34:39AM +0300, Dan Carpenter wrote: > On Tue, Jun 19, 2018 at 10:33:26PM -0400, Hugo Lefeuvre wrote: > > @@ -1178,6 +1152,11 @@ static int pi433_probe(struct spi_device *spi) > > device->tx_active = false; > > device->i

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

2018-06-20 Thread Hugo Lefeuvre
counter and move rx buffer {de,}allocation to probe() and remove(). Remove associated dead code from open() and release(). Remove related TODO entry from ioctl(). Signed-off-by: Hugo Lefeuvre --- Changes in v3: - add missing free call in probe() (in case of failure during memory allocation

pi433: initialization of tx config in pi433_open()

2018-06-21 Thread Hugo Lefeuvre
fault values of the rf69 datasheet[0] ? Also, is there a specific reason why you chose 4711 as a default value for the bit rate ? I couldn't find it anywhere in the datasheet nor on the internet. Thanks ! Regards, Hugo [0] http://www.hoperf.com/upload/rf/RFM69CW-V1.1.pdf -- Hugo L

Re: rf69_set_deviation in rf69.c (pi433 driver)

2018-06-21 Thread Hugo Lefeuvre
nted to have your opinion > > on this. > > Agree. I'll prepare a patch addressing both issues. However I don't own test devices so it would be really great if you could test it ! I'm currently thinking of adapting this driver for other HopeRf modules like RFM69HCW or RFM12 so I will pro

[PATCH] staging/android: use multiple futex wait queues

2019-02-14 Thread Hugo Lefeuvre
Use multiple per-offset wait queues instead of one big wait queue per region. Signed-off-by: Hugo Lefeuvre --- This patch is based on the simplify handle_vsoc_cond_wait patchset, currently under review: https://lkml.org/lkml/2019/2/7/870 --- drivers/staging/android/TODO | 4 --- drivers

Re: [PATCH] staging/android: use multiple futex wait queues

2019-02-14 Thread Hugo Lefeuvre
> > Use multiple per-offset wait queues instead of one big wait queue per > > region. > > > > Signed-off-by: Hugo Lefeuvre > > Have you tested this? > > Noticed any performance speedups or slow downs? Not yet. I have started to set up a cuttlefish test env

Re: [PATCH] tty/nozomi: use pci_iomap instead of ioremap_nocache

2019-02-14 Thread Hugo Lefeuvre
> I will provide a patch if somebody is available to test it. FTR, I have found test devices and should be able to run some tests by the end of next week. regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3

staging/android: questions regarding TODO entries

2019-01-14 Thread Hugo Lefeuvre
. So, once VSOC_SELF_INTERRUPT has been executed once, VSOC_WAIT_FOR_INCOMING_INTERRUPT doesn't work anymore ? Thanks for your work ! cheers, Hugo PS: cc-ing the result of get_maintainer.pl + contacts from todo. Please tell me if this is not the right way to go. -- Hugo Lef

void __iomem *addr should be const

2019-02-10 Thread Hugo Lefeuvre
addressing this issue or is it a definitive wontfix? This issue triggers warnings in my current work but I would like to avoid dropping the const if possible. regards, Hugo [0] https://patchwork.kernel.org/patch/5742881/ -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3

[PATCH] tty/nozomi: use pci_iomap instead of ioremap_nocache

2019-02-10 Thread Hugo Lefeuvre
Use pci_iomap instead of ioremap_nocache in nozomi_card_init(). This is a cleaner way to do PCI MMIO (performs additional checks) and allows to drop the manual call to pci_resource_start. pci_iomap relies on ioremap for MMIO and thus has uncached behavior. Signed-off-by: Hugo Lefeuvre

Re: [PATCH] tty/nozomi: use pci_iomap instead of ioremap_nocache

2019-02-10 Thread Hugo Lefeuvre
uot;at once", I'm not sure how this is supposed to work. Is there any kind of guarantee that all six regions will be adjacent? If this is a bug then this patch "somehow" already adresses it since pci_iomap calls pci_resource_len itself. Otherwise this patch is broken

Re: staging/android: questions regarding TODO entries

2019-01-17 Thread Hugo Lefeuvre
> It should probably say "address." Thanks. I'm working on a few patches for staging/android, this issue will be addressed as well. regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD ed25519_ 3

[PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-17 Thread Hugo Lefeuvre
introduce wait_event_freezable_hrtimeout, an interruptible and freezable version of wait_event_hrtimeout. simplify handle_vsoc_cond_wait (drivers/staging/android/vsoc.c) using this newly added helper and remove useless includes. Signed-off-by: Hugo Lefeuvre --- drivers/staging/android/vsoc.c

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-17 Thread Hugo Lefeuvre
Hi Greg, > > introduce wait_event_freezable_hrtimeout, an interruptible and freezable > > version of wait_event_hrtimeout. > > > > simplify handle_vsoc_cond_wait (drivers/staging/android/vsoc.c) using this > > newly added helper and remove useless includes. > &g

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-18 Thread Hugo Lefeuvre
during the schedule() call, but in the end try_to_freeze() is still called so the result is the same, right? I wonder why wait_event_freezable is not calling freezable_schedule(). That being said, I am not sure that the try_to_freeze() call does anything in the vsoc case because there is no

Re: [PATCH 1/3] sched/wait: use freezable_schedule when possible

2019-02-06 Thread Hugo Lefeuvre
emoves a necessary #include . I will submit an updated version tomorrow. Thanks for the review! regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C

Re: [PATCH 1/3] sched/wait: use freezable_schedule when possible

2019-02-07 Thread Hugo Lefeuvre
lines in kern.log. Results: Without my patch: 448 calls freeze_task, 12 skipped. With my patch: 448 calls, 32 skipped. 2.6x more tasks skipped. Not sure this is the best way to test this patch, though. Any advice? regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.c

[PATCH v2] sched/wait: use freezable_schedule when possible

2019-02-07 Thread Hugo Lefeuvre
Debian vm running a 4.19 stable kernel, the number of tasks skipped in freeze_task() went up from 12 without the patch to 32 with the patch (out of 448), an increase of > x2.5. Signed-off-by: Hugo Lefeuvre --- Changes in v2: - Add test results to commit message. - Split from initial patch se

[PATCH v2 0/2] sched/wait, staging/android: simplification of freeze related code

2019-02-07 Thread Hugo Lefeuvre
: use freezable_schedule when possible", it was submitted separately. - Patch 3/3 (now 2/2): Fix removal of a necessary linux/freezer.h include and improve commit message. [1] v1: https://lkml.org/lkml/2019/2/1/19 Hugo Lefeuvre (2): sched/wait: introduce wait_event_freezable_hrtimeout

[PATCH v2 1/2] sched/wait: introduce wait_event_freezable_hrtimeout

2019-02-07 Thread Hugo Lefeuvre
introduce wait_event_freezable_hrtimeout, an interruptible and freezable version of wait_event_hrtimeout. This helper will allow for simplifications in staging/android/vsoc.c, among others. Signed-off-by: Hugo Lefeuvre --- Changes in v2: - No change. include/linux/wait.h | 25

[PATCH v2 2/2] staging/android: simplify handle_vsoc_cond_wait

2019-02-07 Thread Hugo Lefeuvre
simplify handle_vsoc_cond_wait (drivers/staging/android/vsoc.c) using newly added wait_event_freezable_hrtimeout helper and remove duplicate include. Signed-off-by: Hugo Lefeuvre --- Changes in v2: - Fix removal of necessary linux/freezer.h include. - Make commit message more precise about

Re: [PATCH 1/3] sched/wait: use freezable_schedule when possible

2019-02-07 Thread Hugo Lefeuvre
ael (power maintainer) on it. Thanks, I have splitted the patch set[0][1] and submitted the freezable_schedule patch separately (only cc-ing people responsible for the wait api + Rafael). regards, Hugo [0] https://lkml.org/lkml/2019/2/7/802 [1] https://lkml.org/lkml/2019/2/7/870 --

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

2018-06-20 Thread Hugo Lefeuvre
counter and move rx buffer {de,}allocation to probe() and remove(). Remove associated dead code from open() and release(). Remove related TODO entry from ioctl(). Signed-off-by: Hugo Lefeuvre --- Changes in v3: - add missing free call in probe() (in case of failure during memory allocation

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

2018-06-20 Thread Hugo Lefeuvre
On Wed, Jun 20, 2018 at 11:34:39AM +0300, Dan Carpenter wrote: > On Tue, Jun 19, 2018 at 10:33:26PM -0400, Hugo Lefeuvre wrote: > > @@ -1178,6 +1152,11 @@ static int pi433_probe(struct spi_device *spi) > > device->tx_active = false; > > device->i

Re: rf69_set_deviation in rf69.c (pi433 driver)

2018-06-21 Thread Hugo Lefeuvre
nted to have your opinion > > on this. > > Agree. I'll prepare a patch addressing both issues. However I don't own test devices so it would be really great if you could test it ! I'm currently thinking of adapting this driver for other HopeRf modules like RFM69HCW or RFM12 so I will pro

pi433: initialization of tx config in pi433_open()

2018-06-21 Thread Hugo Lefeuvre
fault values of the rf69 datasheet[0] ? Also, is there a specific reason why you chose 4711 as a default value for the bit rate ? I couldn't find it anywhere in the datasheet nor on the internet. Thanks ! Regards, Hugo [0] http://www.hoperf.com/upload/rf/RFM69CW-V1.1.pdf -- Hugo L

[PATCH] staging: pi433: fix race condition in pi433_open

2018-06-17 Thread Hugo Lefeuvre
f minor_lock in pi433_open(). Signed-off-by: Hugo Lefeuvre --- drivers/staging/pi433/pi433_if.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index 94e0bfcec991..73c511249f7f 100644 --- a/drivers/staging/pi43

Re: [PATCH] staging: pi433: fix race condition in pi433_open

2018-06-18 Thread Hugo Lefeuvre
ces: 1296 /* make sure ops on existing fds can abort cleanly */ 1297 device->spi = NULL; Thanks for your time ! Regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA

Re: [PATCH] staging: pi433: fix race condition in pi433_open

2018-06-19 Thread Hugo Lefeuvre
/* make sure ops on existing fds can abort cleanly */ > > 1297 device->spi = NULL; > > That's when we're unloading the module so there aren't any users left. I'll submit an updated version of my patch getting rid of the counter and addressing the remaining race conditions. Thanks

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

2018-06-19 Thread Hugo Lefeuvre
counter and move rx buffer {de,}allocation to probe() and remove(). Remove associated dead code from open() and release(). Remove related TODO entry from ioctl(). Signed-off-by: Hugo Lefeuvre --- Changes in v2: - Remove useless users counter. - Remove unneeded TODO entry in ioctl

rf69_set_deviation in rf69.c (pi433 driver)

2018-06-04 Thread Hugo Lefeuvre
nything, simply expose API) I'd really prefer going for the first one, but I wanted to have your opinion on this. Thanks for your work ! Best regards, Hugo [0] http://www.hoperf.com/upload/rf/RFM69CW-V1.1.pdf [CC-ing Valentin Vidic, he was quite active on the pi433 driver these last months]

Re: [PATCH 0/4] iomap: fix multiple consistency issues, interface cleanup

2019-02-18 Thread Hugo Lefeuvre
m asm-generic/io.h... Drivers wishing to pass volatile pointers to ioread() should probably use a more low level api. regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C

Re: linux-next: build failure after merge of the asm-generic tree

2019-02-18 Thread Hugo Lefeuvre
ualifier to the addr argument in the iowrite case. That was a bad commit message. Thanks, and sorry for the trouble. regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C

[PATCH] powerpc: iomap: add missing const to ioread addr argument

2019-02-19 Thread Hugo Lefeuvre
*() definitions from arch/powerpc/kernel/iomap.c. Signed-off-by: Hugo Lefeuvre --- arch/powerpc/kernel/iomap.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c index 5ac84efc6ede..9fe4fb3b08aa

Re: linux-next: build failure after merge of the asm-generic tree

2019-02-19 Thread Hugo Lefeuvre
nd sh are already ready and built with cross compiler. I still have to setup a cross compiler to build my parisc changes. Thanks, regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C

Re: [PATCH] tty/nozomi: use pci_iomap instead of ioremap_nocache

2019-02-12 Thread Hugo Lefeuvre
0]. I will provide a patch if somebody is available to test it. regards, Hugo [0] https://elixir.bootlin.com/linux/latest/source/drivers/crypto/hifn_795x.c#L2504 -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C signature.asc Description: PGP signature

[PATCH v2] staging/android: use multiple futex wait queues

2019-02-14 Thread Hugo Lefeuvre
Use multiple per-offset wait queues instead of one big wait queue per region. Signed-off-by: Hugo Lefeuvre --- Changes in v2: - dereference the it pointer instead of wait_queue (which is not set yet) in handle_vsoc_cond_wait() --- drivers/staging/android/TODO | 4 --- drivers/staging

Re: [PATCH] staging/android: use multiple futex wait queues

2019-02-14 Thread Hugo Lefeuvre
> > + list_for_each_entry(it, >futex_wait_queue_list, list) { > > + if (wait_queue->offset == arg->offset) { > ^^ > You meant "it->offset". Right, this is not good. Fixed in v2. Thanks for the feedback!

Re: [PATCH] staging/android: use multiple futex wait queues

2019-02-16 Thread Hugo Lefeuvre
Hugo [0] https://lore.kernel.org/patchwork/patch/1039712/ -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C

Re: void __iomem *addr should be const

2019-02-16 Thread Hugo Lefeuvre
Hi, > The const makes perfectly sense and we should have consistent state all > over the place. Thanks, I will submit a patch addressing this issue soon. regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A24

[PATCH 0/4] iomap: fix multiple consistency issues, interface cleanup

2019-02-18 Thread Hugo Lefeuvre
qualifiers in mmio_ins* and ioread*/iowrite definitions in include/asm-generic/iomap.h and lib/iomap.c. The third patch modifies io*_rep definitions from asm-generic/io.h to take unsigned long count parameter instead of unsigned int which is inconsistent with other definitions in the kernel. Hugo

[PATCH 2/4] iomap: add missing const to ioread*/iowrite addr arg

2019-02-18 Thread Hugo Lefeuvre
ioread* and iowrite* definitions from asm-generic/iomap.h and lib/iomap.c are missing const qualifiers. This is inconsistent with the definitions from asm-generic/io.h and results in compilation warnings when compiling drivers. Add missing const qualifiers. Signed-off-by: Hugo Lefeuvre

[PATCH 3/4] io: change io*_rep definitions to take ulong count

2019-02-18 Thread Hugo Lefeuvre
ioread*_rep and iowrite*_rep from asm-generic/io.h expect unsigned int count parameter. This is inconsistent with all other definitions in the kernel which take unsigned long count. Change io*_rep definitions to take unsigned long count instead of unsigned int. Signed-off-by: Hugo Lefeuvre

[PATCH 4/4] lib/iomap: add missing const to mmio_ins* addr arg

2019-02-18 Thread Hugo Lefeuvre
mmio_ins* definitions from lib/iomap.c are missing const qualifiers for the addr argument. This results in compilation warnings when compiling drivers. Add missing const qualifiers. Signed-off-by: Hugo Lefeuvre --- lib/iomap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH 1/4] iomap: add missing function args identifier names

2019-02-18 Thread Hugo Lefeuvre
Add missing function arguments identifier names to asm-generic/iomap.h definitions. This addresses multiple checkpatch.pl code style warnings. Signed-off-by: Hugo Lefeuvre --- include/asm-generic/iomap.h | 32 1 file changed, 16 insertions(+), 16 deletions

[PATCH 0/3] sched/wait, staging/android: simplification and optimization of freeze related code

2019-01-31 Thread Hugo Lefeuvre
[0] https://lkml.org/lkml/2019/1/17/877 [1] https://lkml.org/lkml/2019/1/19/58 Hugo Lefeuvre (3): sched/wait: use freezable_schedule when possible sched/wait: introduce wait_event_freezable_hrtimeout staging/android: simplify handle_vsoc_cond_wait drivers/staging/android/v

[PATCH 1/3] sched/wait: use freezable_schedule when possible

2019-01-31 Thread Hugo Lefeuvre
try_to_freeze() when they wake up if the freeze is still underway. It is not a problem since sleeping tasks can't do anything which isn't allowed for a frozen task while sleeping. The result is a potential performance gain during freeze, since less tasks have to be awaken. Signed-off-by: Hugo

[PATCH 2/3] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-31 Thread Hugo Lefeuvre
introduce wait_event_freezable_hrtimeout, an interruptible and freezable version of wait_event_hrtimeout. Among others this helper will allow for simplifications in staging/android/vsoc.c. Signed-off-by: Hugo Lefeuvre --- include/linux/wait.h | 25 + 1 file changed, 21

[PATCH 3/3] staging/android: simplify handle_vsoc_cond_wait

2019-01-31 Thread Hugo Lefeuvre
simplify handle_vsoc_cond_wait (drivers/staging/android/vsoc.c) using newly added wait_event_freezable_hrtimeout helper and remove useless includes. Signed-off-by: Hugo Lefeuvre --- drivers/staging/android/vsoc.c | 69 +- 1 file changed, 10 insertions(+), 59

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-31 Thread Hugo Lefeuvre
egards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C signature.asc Description: PGP signature

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-19 Thread Hugo Lefeuvre
regards, Hugo [0] https://elixir.bootlin.com/linux/latest/source/include/linux/freezer.h#L103 [1] https://elixir.bootlin.com/linux/latest/source/Documentation/power/freezing-of-tasks.txt#L90 [2] https://elixir.bootlin.com/linux/latest/source/kernel/kthread.c#L569 -- Hugo Lefeuvr

[tip:sched/core] sched/wait: Use freezable_schedule() when possible

2019-02-11 Thread tip-bot for Hugo Lefeuvre
Commit-ID: 2b9c2a4859ad5ac7b5a28e9db28c3e618760fe8c Gitweb: https://git.kernel.org/tip/2b9c2a4859ad5ac7b5a28e9db28c3e618760fe8c Author: Hugo Lefeuvre AuthorDate: Thu, 7 Feb 2019 21:03:52 +0100 Committer: Ingo Molnar CommitDate: Mon, 11 Feb 2019 08:34:04 +0100 sched/wait: Use