Re: [PATCH] w1_therm: Free the correct variable

2020-05-20 Thread Akira shimahara
ring copys as buf is const */ > if (!p_args) { > dev_warn(device, > @@ -1611,7 +1612,7 @@ static ssize_t alarms_store(struct device *device, > > free_m: > /* free allocated memory */ > - kfree(p_args); > + kfree(orig); > > return

Re: [PATCH v7 1/9] w1_therm: adding code comments and code reordering

2020-05-15 Thread Akira shimahara
Le vendredi 15 mai 2020 à 16:29 +0200, Greg KH a écrit : > On Mon, May 11, 2020 at 10:35:35PM +0200, Akira Shimahara wrote: > > Adding code comments to split code in dedicated parts. After the global > > declarations (defines, macros and function declarations), code is organize

[PATCH v7 9/9] w1_therm: adding bulk read support to trigger multiple conversion on bus

2020-05-11 Thread Akira Shimahara
parameter. Updating documentation in Documentation/ABI/testing/sysfs-driver-w1_therm and Documentation/w1/slaves/w1_therm.rst accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code

[PATCH v7 7/9] w1_therm: optimizing temperature read timings

2020-05-11 Thread Akira Shimahara
/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code comments according to kernel-doc requirements Changes in v7: - Formatting code comments

[PATCH v7 8/9] w1_therm: adding alarm sysfs entry

2020-05-11 Thread Akira Shimahara
/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code comments according to kernel-doc requirements Changes in v7: - Formatting code comments

[PATCH v7 5/9] w1_therm: adding resolution sysfs entry

2020-05-11 Thread Akira Shimahara
was only set and never read (so not stored in the device struct). Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code

[PATCH v7 6/9] w1_therm: adding eeprom sysfs entry

2020-05-11 Thread Akira Shimahara
device families structures. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code comments according to kernel-doc

[PATCH v7 4/9] w1_therm: adding ext_power sysfs entry

2020-05-11 Thread Akira Shimahara
several times (W1_THERM_MAX_TRY), waiting W1_THERM_RETRY_DELAY between two attempt. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6

[PATCH v7 3/9] w1_therm: adding sysfs-driver-w1_therm doc

2020-05-11 Thread Akira Shimahara
Adding a sysfs-driver-w1_therm documentation file in Documentation/ABI/testing. It describe the onlys sysfs entry of w1_therm module, based on Documentation/w1/slaves/w1_therm.rst Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments

[PATCH v7 2/9] w1_therm: fix reset_select_slave during discovery

2020-05-11 Thread Akira Shimahara
. A dedicated reset_select_slave() function is implemented here, it always perform an adressing to each slave using the MATCH ROM command. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code

[PATCH v7 1/9] w1_therm: adding code comments and code reordering

2020-05-11 Thread Akira Shimahara
interface functions Signed-off-by: Akira Shimahara --- Main motivation on the first patch of this serie is to clean up the code, document it and reorder it to prepare the next patches, which are clearer after this. One main point is to keep all device/family dependent code gather at the beginning

Re: [PATCH v6 1/9] w1_therm: adding code comments and code reordering

2020-05-11 Thread Akira shimahara
Hi, Le dimanche 10 mai 2020 à 20:33 -0700, Randy Dunlap a écrit : > Hi, > > A few more comments here (inline): > > On 5/10/20 7:15 AM, Akira Shimahara wrote: > > > drivers/w1/slaves/w1_therm.c | 398 --- > > 1 file changed, 23

Re: [PATCH v6 5/9] w1_therm: adding resolution sysfs entry

2020-05-11 Thread Akira shimahara
Hi, Le dimanche 10 mai 2020 à 20:25 -0700, Randy Dunlap a écrit : > Hi, > > > > The kernel-doc comment changes look good. Thanks for doing that. > > > > > > On 5/10/20 7:17 AM, Akira Shimahara wrote: > > > > > diff --git a/driv

[PATCH v6 8/9] w1_therm: adding alarm sysfs entry

2020-05-10 Thread Akira Shimahara
/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code comments according to kernel-doc requirements .../ABI/testing/sysfs-driver-w1_therm

[PATCH v6 9/9] w1_therm: adding bulk read support to trigger multiple conversion on bus

2020-05-10 Thread Akira Shimahara
parameter. Updating documentation in Documentation/ABI/testing/sysfs-driver-w1_therm and Documentation/w1/slaves/w1_therm.rst accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code

[PATCH v6 5/9] w1_therm: adding resolution sysfs entry

2020-05-10 Thread Akira Shimahara
was only set and never read (so not stored in the device struct). Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code

[PATCH v6 7/9] w1_therm: optimizing temperature read timings

2020-05-10 Thread Akira Shimahara
/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code comments according to kernel-doc requirements .../ABI/testing/sysfs-driver-w1_therm

[PATCH v6 6/9] w1_therm: adding eeprom sysfs entry

2020-05-10 Thread Akira Shimahara
protocol), it is removed from device families structures. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code comments

[PATCH v6 4/9] w1_therm: adding ext_power sysfs entry

2020-05-10 Thread Akira Shimahara
several times (W1_THERM_MAX_TRY), waiting W1_THERM_RETRY_DELAY between two attempt. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6

[PATCH v6 3/9] w1_therm: adding sysfs-driver-w1_therm doc

2020-05-10 Thread Akira Shimahara
Adding a sysfs-driver-w1_therm documentation file in Documentation/ABI/testing. It describe the onlys sysfs entry of w1_therm module, based on Documentation/w1/slaves/w1_therm.rst Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments

[PATCH v6 2/9] w1_therm: fix reset_select_slave during discovery

2020-05-10 Thread Akira Shimahara
. A dedicated reset_select_slave() function is implemented here, it always perform an adressing to each slave using the MATCH ROM command. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include Changes in v6: - Formatting code

[PATCH v6 1/9] w1_therm: adding code comments and code reordering

2020-05-10 Thread Akira Shimahara
interface functions Signed-off-by: Akira Shimahara --- Main motivation on the first patch of this serie is to clean up the code, document it and reorder it to prepare the next patches, which are clearer after this. One main point is to keep all device/family dependent code gather at the beginning

Re: [PATCH v5 1/9] w1_therm: adding code comments and code reordering

2020-05-10 Thread Akira shimahara
*f; > > + int (*convert)(u8 rom[9]); > > + int (*precision)(struct device *device, int val); > > + int (*eeprom)(struct device *device); > > +}; > > + > > > thanks. > > -- > > ~Randy Hi, Well noted, I will do it and re submit the serie. Thanks for your time. Akira SHIMAHARA

[PATCH v5 9/9] w1_therm: adding bulk read support to trigger multiple conversion on bus

2020-05-09 Thread Akira Shimahara
parameter. Updating documentation in Documentation/ABI/testing/sysfs-driver-w1_therm and Documentation/w1/slaves/w1_therm.rst accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include .../ABI/testing/sysfs-driver

[PATCH v5 7/9] w1_therm: optimizing temperature read timings

2020-05-09 Thread Akira Shimahara
/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include .../ABI/testing/sysfs-driver-w1_therm | 12 + drivers/w1/slaves/w1_therm.c | 278 -- 2

[PATCH v5 8/9] w1_therm: adding alarm sysfs entry

2020-05-09 Thread Akira Shimahara
/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include .../ABI/testing/sysfs-driver-w1_therm | 16 ++ drivers/w1/slaves/w1_therm.c | 158

[PATCH v5 6/9] w1_therm: adding eeprom sysfs entry

2020-05-09 Thread Akira Shimahara
protocol), it is removed from device families structures. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include .../ABI/testing/sysfs-driver-w1_therm

[PATCH v5 5/9] w1_therm: adding resolution sysfs entry

2020-05-09 Thread Akira Shimahara
was only set and never read (so not stored in the device struct). Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include .../ABI/testing/sysfs-driver-w1_therm

[PATCH v5 4/9] w1_therm: adding ext_power sysfs entry

2020-05-09 Thread Akira Shimahara
several times (W1_THERM_MAX_TRY), waiting W1_THERM_RETRY_DELAY between two attempt. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include .../ABI/testing

[PATCH v5 3/9] w1_therm: adding sysfs-driver-w1_therm doc

2020-05-09 Thread Akira Shimahara
Adding a sysfs-driver-w1_therm documentation file in Documentation/ABI/testing. It describe the onlys sysfs entry of w1_therm module, based on Documentation/w1/slaves/w1_therm.rst Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments

[PATCH v5 2/9] w1_therm: fix reset_select_slave during discovery

2020-05-09 Thread Akira Shimahara
. A dedicated reset_select_slave() function is implemented here, it always perform an adressing to each slave using the MATCH ROM command. Signed-off-by: Akira Shimahara --- Changes in v5: - All patch serie in one .c file - Correcting some comments - adding include drivers/w1/slaves/w1_therm.c

[PATCH v5 1/9] w1_therm: adding code comments and code reordering

2020-05-09 Thread Akira Shimahara
interface functions Signed-off-by: Akira Shimahara --- Main motivation on the first patch of this serie is to clean up the code, document it and reorder it to prepare the next patches, which are clearer after this. One main point is to keep all device/family dependent code gather at the beginning

Re: [PATCH v4 1/9] w1_therm: creating w1_therm.h

2020-05-06 Thread Akira shimahara
multiple .c files, otherwise it's not needed. > > > > thanks, > > > > greg k-h Hi, Ok well noted, I will do it tomorrow, and keep it as 8 patches. Thanks for your time Akira Shimahara

Re: [PATCH v4 2/9] w1_therm: fix reset_select_slave at beginning of search process

2020-05-05 Thread Akira shimahara
+ w1_write_block(sl->master, match, 9); > > + > > + return 0; > > +} > > > If you put this higher up in the .c file, no function definition is > > needed in the .h file at all, right? > > > > thanks, > > > > greg k-h Yes, everything could be put in the .c file, but I think we will loose clarity. Please, let me know what you prefer. Thanks Akira Shimahara

Re: [PATCH v4 1/9] w1_therm: creating w1_therm.h

2020-05-05 Thread Akira shimahara
Le mardi 05 mai 2020 à 16:48 +0200, Greg KH a écrit : > > Creating w1_therm.h header to organize code. Organize the > > w1_therm.c file > > to gather hardware functions, device specific functions, interface > > functions and sysfs functions. > >

Re: [PATCH v3 2/5] w1_therm: adding sysfs entry to check device power

2020-04-30 Thread Akira shimahara
Le jeudi 30 avril 2020 à 13:21 +0200, Greg KH a écrit : > On Thu, Apr 30, 2020 at 12:34:03PM +0200, Akira shimahara wrote: > > Hello, > > > > Le mercredi 29 avril 2020 à 18:18 +0300, Evgeniy Polyakov a écrit : > > > Hi > > > > >

Re: [PATCH v3 2/5] w1_therm: adding sysfs entry to check device power

2020-04-30 Thread Akira shimahara
Hello, Le mercredi 29 avril 2020 à 18:18 +0300, Evgeniy Polyakov a écrit : > Hi > > > > 29.04.2020, 16:47, "Greg KH" : > > > > > > +What: /sys/bus/w1/devices/.../w1_slave > > > +Date: Apr 2020 > > > +Contact: Akira Shimahara &

[PATCH v4 9/9] w1_therm: adding bulk read support to trigger multiple conversion on the bus

2020-04-29 Thread Akira Shimahara
in Documentation/ABI/testing/sysfs-driver-w1_therm and Documentation/w1/slaves/w1_therm.rst accordingly. Signed-off-by: Akira Shimahara --- .../ABI/testing/sysfs-driver-w1_therm | 36 ++- Documentation/w1/slaves/w1_therm.rst | 50 +++- drivers/w1/slaves/w1_therm.c

[PATCH v4 8/9] w1_therm: adding alarm sysfs entry to set device internal alarms values

2020-04-29 Thread Akira Shimahara
, a safe cast shall be performed using the min and max temperature that device are able to measure. This is done by int_to_short inline function. Updating doc in Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- .../ABI/testing/sysfs-driver-w1_therm

[PATCH v4 6/9] w1_therm: adding eeprom sysfs entry

2020-04-29 Thread Akira Shimahara
device families structures. Signed-off-by: Akira Shimahara --- .../ABI/testing/sysfs-driver-w1_therm | 14 ++ drivers/w1/slaves/w1_therm.c | 151 +++--- drivers/w1/slaves/w1_therm.h | 36 - 3 files changed, 142 insertions(+), 59

[PATCH v4 7/9] w1_therm: optimizing temperature reading timings

2020-04-29 Thread Akira Shimahara
w1_slave has been kept for compatibility, without changing its output format. Updating doc in Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- .../ABI/testing/sysfs-driver-w1_therm | 12 + drivers/w1/slaves/w1_therm.c | 266

[PATCH v4 5/9] w1_therm: adding resolution sysfs entry

2020-04-29 Thread Akira Shimahara
. Signed-off-by: Akira Shimahara --- .../ABI/testing/sysfs-driver-w1_therm | 17 + drivers/w1/slaves/w1_therm.c | 404 ++ drivers/w1/slaves/w1_therm.h | 91 +++- 3 files changed, 408 insertions(+), 104 deletions(-) diff --git a/Documentation

[PATCH v4 4/9] w1_therm: adding ext_power sysfs entry

2020-04-29 Thread Akira Shimahara
. Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly. Signed-off-by: Akira Shimahara --- .../ABI/testing/sysfs-driver-w1_therm | 12 +++ drivers/w1/slaves/w1_therm.c | 94 ++- drivers/w1/slaves/w1_therm.h | 43 - 3 files

[PATCH v4 3/9] w1_therm: adding sysfs-driver-w1_therm documentation

2020-04-29 Thread Akira Shimahara
Adding a sysfs-driver-w1_therm documentation file in Documentation/ABI/testing. It describe the onlys sysfs entry of w1_therm module, based on Documentation/w1/slaves/w1_therm.rst Signed-off-by: Akira Shimahara --- Documentation/ABI/testing/sysfs-driver-w1_therm | 17 + 1 file

[PATCH v4 2/9] w1_therm: fix reset_select_slave at beginning of search process

2020-04-29 Thread Akira Shimahara
. A dedicated reset_select_slave() function is implemented here, it always perform an adressing to each slave using the MATCH ROM command. Signed-off-by: Akira Shimahara --- drivers/w1/slaves/w1_therm.c | 29 ++--- drivers/w1/slaves/w1_therm.h | 13 + 2 files

[PATCH v4 1/9] w1_therm: creating w1_therm.h

2020-04-29 Thread Akira Shimahara
Creating w1_therm.h header to organize code. Organize the w1_therm.c file to gather hardware functions, device specific functions, interface functions and sysfs functions. Signed-off-by: Akira Shimahara --- drivers/w1/slaves/w1_therm.c | 302 +++ drivers/w1

Re: [PATCH v3 3/5] w1_therm: Optimizing read timing by checking device resolution. Updating documentation

2020-04-29 Thread Akira shimahara
Le mercredi 29 avril 2020 à 15:47 +0200, Greg KH a écrit : > On Wed, Apr 29, 2020 at 03:33:20PM +0200, Akira Shimahara wrote: > > Patch for enhacement of w1_therm module. Added features : > > - Optimized conversion time regarding to device resolution > > - Dedicated sysfs

_

2020-04-29 Thread Akira shimahara
Le mercredi 29 avril 2020 à 15:46 +0200, Greg KH a écrit : > On Wed, Apr 29, 2020 at 03:32:04PM +0200, Akira Shimahara wrote: > > Patch for enhacement of w1_therm module. > > Adding ext_power sysfs entry (RO). Return the power status of the > > device: > > - 0: devic

Re: [PATCH v3 1/5] w1_therm: fix reset_select_slave. Creating w1_therm.h

2020-04-29 Thread Akira shimahara
Le mercredi 29 avril 2020 à 15:43 +0200, Greg KH a écrit : > On Wed, Apr 29, 2020 at 03:30:48PM +0200, Akira Shimahara wrote: > > Patch for enhancement of w1_therm module. > > - Creating a w1_therm.h file to clean up the code and documenting > > it. > > - fix

[PATCH v3 5/5] w1_therm: adding bulk read support. Updating docs in w1_therm.rst and sysfs-driver-w1_therm

2020-04-29 Thread Akira Shimahara
documentation in Documentation/ABI/testing/sysfs-driver-w1_therm and Documentation/w1/slaves/w1_therm.rst Signed-off-by: Akira Shimahara --- .../ABI/testing/sysfs-driver-w1_therm | 36 ++- Documentation/w1/slaves/w1_therm.rst | 50 +++- drivers/w1/slaves/w1_therm.c

[PATCH v3 4/5] w1_therm: alarms support by adding sysfs entry. Updating doc

2020-04-29 Thread Akira Shimahara
-w1_therm accordingly. Signed-off-by: Akira Shimahara --- .../ABI/testing/sysfs-driver-w1_therm | 15 ++ drivers/w1/slaves/w1_therm.c | 129 ++ drivers/w1/slaves/w1_therm.h | 12 ++ 3 files changed, 156 insertions(+) diff --git

[PATCH v3 3/5] w1_therm: Optimizing read timing by checking device resolution. Updating documentation

2020-04-29 Thread Akira Shimahara
-by: Akira Shimahara --- .../ABI/testing/sysfs-driver-w1_therm | 43 + drivers/w1/slaves/w1_therm.c | 785 +- drivers/w1/slaves/w1_therm.h | 168 +++- 3 files changed, 760 insertions(+), 236 deletions(-) diff --git a/Documentation/ABI

[PATCH v3 2/5] w1_therm: adding sysfs entry to check device power

2020-04-29 Thread Akira Shimahara
and this new entry. Signed-off-by: Akira Shimahara --- .../ABI/testing/sysfs-driver-w1_therm | 29 ++ drivers/w1/slaves/w1_therm.c | 93 ++- drivers/w1/slaves/w1_therm.h | 44 - 3 files changed, 163 insertions(+), 3 deletions(-) create

[PATCH v3 1/5] w1_therm: fix reset_select_slave. Creating w1_therm.h

2020-04-29 Thread Akira Shimahara
. At the beginning of the search process, sl->master->slave_count is 1 even if more devices are on the line, causing data collision in the bus. Signed-off-by: Akira Shimahara --- drivers/w1/slaves/w1_therm.c | 325 --- drivers/w1/slaves/w1_therm.h

Re: [PATCH v2 1/2] Changes in w1_therm.c and adding w1_therm.h

2020-04-28 Thread Akira shimahara
Le mardi 28 avril 2020 à 14:44 +0200, Greg KH a écrit : > On Sun, Apr 26, 2020 at 07:20:30PM +0200, Akira shimahara wrote: > > Le dimanche 26 avril 2020 à 19:09 +0200, Greg KH a écrit : > > > On Sun, Apr 26, 2020 at 02:36:52PM +0200, Akira shimahara wrote: > > > > Le