Re: [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-04 Thread Andy Shevchenko
us enough. Maybe it's worth the long > name to spell it out some more.. e.g. something like And perhaps drop 'extern' as it's not needed. > extern void release_softresv_mem_region_adjustable() ? > > #ifdef CONFIG_MEMORY_HOTPLUG > > extern void merge_system_ram_resource(struct resource *res); > > #endif -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-03 Thread Andy Shevchenko
comments as per above function. > +} > +EXPORT_SYMBOL(release_srmem_region_adjustable); > +#endif -- With Best Regards, Andy Shevchenko

Re: [PATCH v9 5/6] scanf: tidy header `#include`s

2025-03-07 Thread Andy Shevchenko
On Fri, Mar 07, 2025 at 07:34:29PM +0200, Andy Shevchenko wrote: > On Fri, Mar 07, 2025 at 06:27:38AM -0500, Tamir Duberstein wrote: ... > > #include > > + array_size.h > > > #include > + bug.h // BUILD_BUG_ON() Actually if it's only BUILD_BUG_ON()

Re: [PATCH v9 5/6] scanf: tidy header `#include`s

2025-03-07 Thread Andy Shevchenko
based on the context of your changes, I haven't checked the resulting file in full, please do it yourself. -- With Best Regards, Andy Shevchenko

Re: [PATCH v8 4/4] scanf: break kunit into test cases

2025-03-05 Thread Andy Shevchenko
On Wed, Mar 05, 2025 at 10:57:47AM -0500, Tamir Duberstein wrote: > On Wed, Mar 5, 2025 at 10:55 AM Andy Shevchenko > wrote: > > On Wed, Mar 05, 2025 at 10:25:51AM -0500, Tamir Duberstein wrote: > > > On Wed, Mar 5, 2025 at 10:01 AM Petr Mladek wrote: > > > >

Re: [PATCH v8 4/4] scanf: break kunit into test cases

2025-03-05 Thread Andy Shevchenko
AFAIK, there > > are people working in this optimization and they might need > > to revert this change. > > Yeah, I don't feel strongly. I'll just restore all the includes. It will be blind approach. Please, try to look at them closely and include what you use (IWYU principle). I don't think anybody uses kernel.h here, for example. -- With Best Regards, Andy Shevchenko

Re: [PATCH v8 4/4] scanf: break kunit into test cases

2025-03-05 Thread Andy Shevchenko
the header files which helps to speedup build. AFAIK, there > are people working in this optimization and they might need > to revert this change. +1. -- With Best Regards, Andy Shevchenko

[PATCH net-next v4 0/4] ieee802154: ca8210: Sparse fix and GPIOd conversion

2025-03-05 Thread Andy Shevchenko
) - unfolded PTR_ERR_OR_ZERO() to the preferred pattern (Miquel) - collected tags (Miquel) Andy Shevchenko (4): ieee802154: ca8210: Use proper setters and getters for bitwise types ieee802154: ca8210: Get platform data via dev_get_platdata() ieee802154: ca8210: Switch to using gpiod API dt-bindings

[PATCH net-next v4 3/4] ieee802154: ca8210: Switch to using gpiod API

2025-03-05 Thread Andy Shevchenko
: Andy Shevchenko --- drivers/gpio/gpiolib-of.c | 9 ++ drivers/net/ieee802154/ca8210.c | 57 +++-- 2 files changed, 28 insertions(+), 38 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index a7370fa48556..280d56736844 100644

[PATCH net-next v4 4/4] dt-bindings: ieee802154: ca8210: Update polarity of the reset pin

2025-03-05 Thread Andy Shevchenko
The code has been updated to follow what datasheet says about the polarity of the reset pin, which is active-low. Update the device tree bindings accordingly. Signed-off-by: Andy Shevchenko --- Documentation/devicetree/bindings/net/ieee802154/ca8210.txt | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH net-next v4 1/4] ieee802154: ca8210: Use proper setters and getters for bitwise types

2025-03-05 Thread Andy Shevchenko
Linus Walleij Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index 753215ebc67c..a036910f6082 100644 --- a/drivers/net/ieee802154/ca8

[PATCH net-next v4 2/4] ieee802154: ca8210: Get platform data via dev_get_platdata()

2025-03-05 Thread Andy Shevchenko
Access to platform data via dev_get_platdata() getter to make code cleaner. Reviewed-by: Linus Walleij Reviewed-by: Miquel Raynal Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net

Re: [PATCH net-next v3 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-05 Thread Andy Shevchenko
On Wed, Mar 05, 2025 at 08:04:17AM +0100, Krzysztof Kozlowski wrote: > On Tue, Mar 04, 2025 at 01:22:34PM +0200, Andy Shevchenko wrote: > > This updates the driver to gpiod API, and removes yet another use of > > of_get_named_gpio(). > > > > With this, invert the logi

[PATCH net-next v3 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-04 Thread Andy Shevchenko
This updates the driver to gpiod API, and removes yet another use of of_get_named_gpio(). With this, invert the logic of the reset pin which is active low and add a quirk for the legacy and incorrect device tree descriptions. Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko

[PATCH net-next v3 0/3] ieee802154: ca8210: Sparse fix and GPIOd conversion

2025-03-04 Thread Andy Shevchenko
) - collected tags (Miquel) Andy Shevchenko (3): ieee802154: ca8210: Use proper setter and getters for bitwise types ieee802154: ca8210: Get platform data via dev_get_platdata() ieee802154: ca8210: Switch to using gpiod API .../bindings/net/ieee802154/ca8210.txt| 2 +- drivers/gpio/gpiolib

[PATCH net-next v3 1/3] ieee802154: ca8210: Use proper setter and getters for bitwise types

2025-03-04 Thread Andy Shevchenko
Linus Walleij Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index 753215ebc67c..a036910f6082 100644 --- a/drivers/net/ieee802154/ca8

[PATCH net-next v3 2/3] ieee802154: ca8210: Get platform data via dev_get_platdata()

2025-03-04 Thread Andy Shevchenko
Access to platform data via dev_get_platdata() getter to make code cleaner. Reviewed-by: Linus Walleij Reviewed-by: Miquel Raynal Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net

Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-04 Thread Andy Shevchenko
On Tue, Mar 04, 2025 at 01:03:41AM +0100, Linus Walleij wrote: > On Mon, Mar 3, 2025 at 9:39 PM Andy Shevchenko > wrote: > > > > Maybe add a comment in the code that this is wrong and the > > > driver and DTS files should be fixed. > > > > Or maybe fix in t

Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Andy Shevchenko
Mon, Mar 03, 2025 at 09:00:39PM +0100, Linus Walleij kirjoitti: > On Mon, Mar 3, 2025 at 5:49 PM Andy Shevchenko > wrote: ... > > reinit_completion(&priv->ca8210_is_awake); > > msleep(ms); > > - gpio_set_value(pdata->gpio_reset, 1);

[PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Andy Shevchenko
This updates the driver to gpiod API, and removes yet another use of of_get_named_gpio(). Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 57 +++-- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b

[PATCH net-next v2 2/3] ieee802154: ca8210: Get platform data via dev_get_platdata()

2025-03-03 Thread Andy Shevchenko
Access to platform data via dev_get_platdata() getter to make code cleaner. Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index

[PATCH v2 0/3] ieee802154: ca8210: Sparse fix and GPIOd conversion

2025-03-03 Thread Andy Shevchenko
) - updated kernel doc for changed members (Miquel) - unfolded PTR_ERR_OR_ZERO() to the preferred pattern (Miquel) - collected tags (Miquel) Andy Shevchenko (3): ieee802154: ca8210: Use proper setter and getters for bitwise types ieee802154: ca8210: Get platform data via dev_get_platdata

[PATCH net-next v2 1/3] ieee802154: ca8210: Use proper setter and getters for bitwise types

2025-03-03 Thread Andy Shevchenko
got restricted __le16 [addressable] [usertype] pan_id Use proper setter and getters for bitwise types. Note, in accordance with [1] the protocol is little endian. Link: https://www.cascoda.com/wp-content/uploads/2018/11/CA-8210_datasheet_0418.pdf [1] Reviewed-by: Miquel Raynal Signed-off-by:

Re: [PATCH net-next v1 2/2] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Andy Shevchenko
; + pdata->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); > + if (IS_ERR(pdata->reset_gpio)) { > + dev_crit(dev, "Reset GPIO did not set to output mode\n"); > +return PTR_ERR(pdata->reset_pgio); > + } > + > + return 0; Sure I can do this in v2. ... > Otherwise the rest lgtm. Thank you for the review! -- With Best Regards, Andy Shevchenko

Re: [PATCH net-next v1 1/2] ieee802154: ca8210: Use proper setter and getters for bitwise types

2025-03-03 Thread Andy Shevchenko
On Mon, Mar 03, 2025 at 05:06:32PM +0100, Miquel Raynal wrote: > On 03/03/2025 at 17:07:39 +02, Andy Shevchenko > wrote: > > > Sparse complains that the driver doesn't respect the bitwise types: > > > > drivers/net/ieee802154/ca8210.c:1796:27: warning: i

[PATCH net-next v1 0/2] ieee802154: ca8210: Sparse fix and GPIOd conversion

2025-03-03 Thread Andy Shevchenko
The main part is the patch 2 that converts the driver to GPIO descriptor APIs, the first one is just an ad-hoc fix WRT sparse complains on the bitwise types misuse. Andy Shevchenko (2): ieee802154: ca8210: Use proper setter and getters for bitwise types ieee802154: ca8210: Switch to using

[PATCH net-next v1 1/2] ieee802154: ca8210: Use proper setter and getters for bitwise types

2025-03-03 Thread Andy Shevchenko
got restricted __le16 [addressable] [usertype] pan_id Use proper setter and getters for bitwise types. Note, in accordance with [1] the protocol is little endian. Link: https://www.cascoda.com/wp-content/uploads/2018/11/CA-8210_datasheet_0418.pdf [1] Signed-off-by: Andy Shevchenko --- driver

[PATCH net-next v1 2/2] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Andy Shevchenko
This updates the driver to gpiod API, and removes yet another use of of_get_named_gpio(). Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 63 - 1 file changed, 22 insertions(+), 41 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b

Re: [PATCH v8 3/4] scanf: convert self-test to KUnit

2025-02-16 Thread Andy Shevchenko
f! I have just wasted a couple of minutes to understand what's going on in the message that is 2700 lines of text as the reply to the bot message which was ~700 lines. -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 6/8] iio: light: stk3310: use dev_err_probe where possible

2025-02-12 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 07:43:11PM +, Jonathan Cameron wrote: > On Sun, 9 Feb 2025 16:47:44 +0200 > Andy Shevchenko wrote: > > On Sat, Feb 08, 2025 at 04:13:24PM -0500, Aren Moynihan wrote: > > > Using dev_err_probe instead of dev_err and return makes the errors >

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 10:57:11AM -0500, Tamir Duberstein wrote: > On Tue, Feb 11, 2025 at 10:54 AM Andy Shevchenko > wrote: > > On Tue, Feb 11, 2025 at 10:47:03AM -0500, Tamir Duberstein wrote: > > > On Tue, Feb 11, 2025 at 10:40 AM Andy Shevchenko > > > wrote: &

Re: [PATCH v7 1/3] scanf: remove redundant debug logs

2025-02-11 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 11:02:59AM -0500, Tamir Duberstein wrote: > On Tue, Feb 11, 2025 at 10:58 AM Andy Shevchenko > wrote: > > On Tue, Feb 11, 2025 at 10:50:33AM -0500, Tamir Duberstein wrote: > > > On Tue, Feb 11, 2025 at 10:42 AM Andy Shevchenko > > > wrote: &

Re: [PATCH v7 1/3] scanf: remove redundant debug logs

2025-02-11 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 10:50:33AM -0500, Tamir Duberstein wrote: > On Tue, Feb 11, 2025 at 10:42 AM Andy Shevchenko > wrote: > > On Tue, Feb 11, 2025 at 10:13:37AM -0500, Tamir Duberstein wrote: > > > The test already prints the same information on failure; remove > >

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 10:47:03AM -0500, Tamir Duberstein wrote: > On Tue, Feb 11, 2025 at 10:40 AM Andy Shevchenko > wrote: > > On Tue, Feb 11, 2025 at 10:13:36AM -0500, Tamir Duberstein wrote: ... > > > - Use original test assertions as KUNIT_*_EQ_MSG produces hard-to-p

Re: [PATCH v7 1/3] scanf: remove redundant debug logs

2025-02-11 Thread Andy Shevchenko
ot = (fn)(test_buffer, &endp, base); > \ > - pr_debug(#fn "(\"%s\", %d) -> " gen_fmt "\n", test_buffer, base, got); > \ > if (got != (expect)) { > \ > fail = true; > \ > pr_warn(#fn "(\"%s\", %d): got " gen_fmt " expected " gen_fmt > "\n", \ -- With Best Regards, Andy Shevchenko

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
f_kunit.c:92 > vsscanf("403/0/17/1/11e7/1/1fe8/34ba", > "%3hx/%1hx/%2hx/%1hx/%4hx/%1hx/%4hx/%4hx", ...) expected 65559 got 1507328 > not ok 5 "/" > # numbers_list_field_width_val_width: pass:0 fail:5 skip:0 total:5 > not ok 4 numbers_list_field_width_val_width > # numbers_slice: ASSERTION FAILED at lib/scanf_kunit.c:92 > vsscanf("3c87eac0f4afa1f9231da52", "%1hx%4hx%4hx%4hx%1hx%4hx%4hx%1hx", > ...) expected 1257942031 got 2886715518 -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 1/2] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
nds to. Can > you help me understand how you're testing? You are missing something. https://stackoverflow.com/a/57762255/2511795 -- With Best Regards, Andy Shevchenko

[PATCH v1 1/1] virtio_console: Get rid of unneeded temporary variable

2025-02-10 Thread Andy Shevchenko
re in use. Fix this by using dev_name() of the newly created device that is luckily the same as the string used for the DebugFS node name. Signed-off-by: Andy Shevchenko --- drivers/char/virtio_console.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers

Re: [PATCH v5 6/8] iio: light: stk3310: use dev_err_probe where possible

2025-02-09 Thread Andy Shevchenko
es for -ENOMEM. If it's in the current code, add a new patch to drop this message and return an error code directly. ... > + if (ret < 0) Perhaps, while at it, drop these ' < 0' parts where they are not hinting about anything. > + return dev_err_probe(dev, ret, "device_register failed\n"); -- With Best Regards, Andy Shevchenko

Re: [PATCH] scanf: convert self-test to KUnit

2025-01-31 Thread Andy Shevchenko
On Fri, Jan 31, 2025 at 12:25:20PM -0500, Tamir Duberstein wrote: > On Fri, Jan 31, 2025 at 12:22 PM Tamir Duberstein wrote: > > On Fri, Jan 31, 2025 at 12:11 PM Andy Shevchenko > > wrote: ... > > Can you explain what you mean by using -M -C? The formatting was done >

Re: [PATCH] scanf: convert self-test to KUnit

2025-01-31 Thread Andy Shevchenko
On Fri, Jan 31, 2025 at 12:22:39PM -0500, Tamir Duberstein wrote: > On Fri, Jan 31, 2025 at 12:11 PM Andy Shevchenko > wrote: > > On Fri, Jan 31, 2025 at 10:47:49AM -0500, Tamir Duberstein wrote: > > > Convert the scanf() self-test to a KUnit test. > > > > > &g

Re: [PATCH] scanf: convert self-test to KUnit

2025-01-31 Thread Andy Shevchenko
d remove all of them at once, if somebody wants debug configuration, they would specify it and use with help of merge_config or alike. -- With Best Regards, Andy Shevchenko

Re: [PATCH 0/2] selftest: fix riscv/vector tests

2025-01-05 Thread Andy Chiu
> > tools/testing/selftests/riscv/vector/v_initval_nolibc.c | 4 > tools/testing/selftests/riscv/vector/vstate_prctl.c | 2 ++ > 2 files changed, 6 insertions(+) > > -- > 2.17.1 > For the series, Reviewed-by: Andy Chiu Thanks, Andy

Re: [PATCH v2 0/6] [PATCH 0/6] KUnit test moves / renames

2024-12-02 Thread Andy Shevchenko
9acd8646 ("platform/x86: intel: Add 'intel' prefix to the modules automatically") for the details how to achieve that in non-verbose way. -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 4/6] iio: light: stk3310: use dev_err_probe where possible

2024-11-12 Thread Andy Shevchenko
On Tue, Nov 12, 2024 at 12:15 PM Uwe Kleine-König wrote: > On Mon, Nov 11, 2024 at 11:44:51AM +0200, Andy Shevchenko wrote: > > On Sun, Nov 10, 2024 at 04:34:30PM -0500, Aren wrote: > > > On Sun, Nov 10, 2024 at 09:52:32PM +0200, Andy Shevchenko wrote: > > > > S

Re: [PATCH v4 4/6] iio: light: stk3310: use dev_err_probe where possible

2024-11-11 Thread Andy Shevchenko
On Sun, Nov 10, 2024 at 04:34:30PM -0500, Aren wrote: > On Sun, Nov 10, 2024 at 09:52:32PM +0200, Andy Shevchenko wrote: > > Sun, Nov 10, 2024 at 02:14:24PM -0500, Aren kirjoitti: > > > On Mon, Nov 04, 2024 at 10:40:16AM +0200, Andy Shevchenko wrote: > > > > On S

Re: [PATCH v4 2/6] iio: light: stk3310: handle all remove logic with devm callbacks

2024-11-11 Thread Andy Shevchenko
On Sun, Nov 10, 2024 at 05:37:56PM -0500, Aren wrote: > On Sun, Nov 10, 2024 at 09:51:04PM +0200, Andy Shevchenko wrote: > > Sun, Nov 10, 2024 at 01:38:39PM -0500, Aren kirjoitti: > > > On Mon, Nov 04, 2024 at 10:32:08AM +0200, Andy Shevchenko wrote: > > > > On S

Re: [PATCH v4 4/6] iio: light: stk3310: use dev_err_probe where possible

2024-11-10 Thread Andy Shevchenko
Sun, Nov 10, 2024 at 02:14:24PM -0500, Aren kirjoitti: > On Mon, Nov 04, 2024 at 10:40:16AM +0200, Andy Shevchenko wrote: > > On Sat, Nov 02, 2024 at 03:50:41PM -0400, Aren Moynihan wrote: ... > > > #define STK3310_REGFIELD(name) >

Re: [PATCH v4 2/6] iio: light: stk3310: handle all remove logic with devm callbacks

2024-11-10 Thread Andy Shevchenko
Sun, Nov 10, 2024 at 01:38:39PM -0500, Aren kirjoitti: > On Mon, Nov 04, 2024 at 10:32:08AM +0200, Andy Shevchenko wrote: > > On Sat, Nov 02, 2024 at 03:50:37PM -0400, Aren Moynihan wrote: ... > > > + ret = devm_add_action_or_reset(&client->dev, stk3310_set_s

Re: [PATCH v4 5/6] iio: light: stk3310: log error if reading the chip id fails

2024-11-04 Thread Andy Shevchenko
ke sure you have consistent style in the messages. Most of what I have seen use period at the end. This one doesn't. -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 4/6] iio: light: stk3310: use dev_err_probe where possible

2024-11-04 Thread Andy Shevchenko
gt; @@ -654,12 +652,11 @@ static int stk3310_probe(struct i2c_client *client) > int ret; > struct iio_dev *indio_dev; > struct stk3310_data *data; > + struct device *dev = &client->dev; This should has been done a few patches earlier... -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 3/6] iio: light: stk3310: Implement vdd and leda supplies

2024-11-04 Thread Andy Shevchenko
On Sun, Nov 03, 2024 at 11:11:13AM -0500, Aren wrote: > On Sun, Nov 03, 2024 at 11:31:03AM +, Jonathan Cameron wrote: > > On Sat, 2 Nov 2024 15:50:39 -0400 > > Aren Moynihan wrote: ... > > For this Andy was asking for consistency. Generally we don't insist on a

Re: [PATCH v4 3/6] iio: light: stk3310: Implement vdd and leda supplies

2024-11-04 Thread Andy Shevchenko
+ if (ret) { > + dev_err(dev, "failed to disable regulators: %d\n", ret); > + return ret; > + } ... > - u8 state = 0; > + int ret; > struct stk3310_data *data; > + u8 state = 0; Can we try to make it RCT ordered? -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 2/6] iio: light: stk3310: handle all remove logic with devm callbacks

2024-11-04 Thread Andy Shevchenko
->lock); > + devm_mutex_init(&client->dev, &data->lock); Missed error check, otherwise what's the point? Also can add a temporary variable for 'dev'. -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 5/6] iio: light: stk3310: log error if reading the chip id fails

2024-10-28 Thread Andy Shevchenko
On Mon, Oct 28, 2024 at 11:29:35AM -0400, Aren wrote: > On Mon, Oct 28, 2024 at 04:45:35PM +0200, Andy Shevchenko wrote: > > On Mon, Oct 28, 2024 at 10:19:59AM -0400, Aren Moynihan wrote: > > > If the chip isn't powered, this call is likely to return an error. > > &g

Re: [PATCH v3 3/6] iio: light: stk3310: Implement vdd and leda supplies

2024-10-28 Thread Andy Shevchenko
ile changing to RCT order here, it seems you have inconsistent approach elsewhere (in your own patches!). Please, be consistent with chosen style. > data = iio_priv(i2c_get_clientdata(to_i2c_client(dev))); -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 5/6] iio: light: stk3310: log error if reading the chip id fails

2024-10-28 Thread Andy Shevchenko
bus > isn't powered). The commit message does not explain why dev_err_probe() has been chosen and not simple dev_err(). -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 4/6] iio: light: stk3310: use dev_err_probe where possible

2024-10-28 Thread Andy Shevchenko
0) Same remark, if client is not used here, supply struct device pointer directly and make these all lines better to read. -- With Best Regards, Andy Shevchenko

Re: [PATCH RESEND] vdpa: solidrun: Fix UB bug with devres

2024-10-16 Thread Andy Shevchenko
On Wed, Oct 16, 2024 at 12:22 PM Philipp Stanner wrote: > On Wed, 2024-10-16 at 12:08 +0300, Andy Shevchenko wrote: > > On Wed, Oct 16, 2024 at 09:25:54AM +0200, Philipp Stanner wrote: ... > > > --- > > > > I haven't found the reason for resending. Can yo

Re: [PATCH RESEND] vdpa: solidrun: Fix UB bug with devres

2024-10-16 Thread Andy Shevchenko
g later ever be used, this, consequently, causes > undefined behavior since the stack frame will by then have disappeared. > > Fix the bug by allocating the strings on the heap through > devm_kasprintf(). > --- I haven't found the reason for resending. Can you elaborate

Re: [PATCH v2 1/6] riscv: ftrace: support fastcc in Clang for WITH_ARGS

2024-08-22 Thread Andy Chiu
On Tue, Aug 13, 2024 at 7:09 PM Björn Töpel wrote: > > Andy Chiu writes: > > > Some caller-saved registers which are not defined as function arguments > > in the ABI can still be passed as arguments when the kernel is compiled > > with Clang. As a result, we must save

[PATCH v2 6/6] riscv: ftrace: support PREEMPT

2024-06-28 Thread Andy Chiu
Now, we can safely enable dynamic ftrace with kernel preemption. Signed-off-by: Andy Chiu --- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 55c70efbad0a..881ea466ff52 100644 --- a/arch/riscv/Kconfig +++ b

[PATCH v2 5/6] riscv: vector: Support calling schedule() for preemptible Vector

2024-06-28 Thread Andy Chiu
schedule(). Besides, we currently don't pass argument through vector register, so we don't have to save/restore V-regs in ftrace trampoline. Signed-off-by: Andy Chiu --- arch/riscv/include/asm/processor.h | 5 + arch/riscv/include/asm/vector.h| 22 +++--- 2 fil

[PATCH v2 4/6] riscv: ftrace: do not use stop_machine to update code

2024-06-28 Thread Andy Chiu
Now it is safe to remove dependency from stop_machine() for us to patch code in ftrace. Signed-off-by: Andy Chiu --- arch/riscv/kernel/ftrace.c | 53 -- 1 file changed, 4 insertions(+), 49 deletions(-) diff --git a/arch/riscv/kernel/ftrace.c b/arch

[PATCH v2 3/6] riscv: ftrace: prepare ftrace for atomic code patching

2024-06-28 Thread Andy Chiu
perform the jump. This enable the kernel to update the target atomically. The ordering of reading/updating the targert address should be guarded by generic ftrace code, where it sends smp_rmb ipi. Signed-off-by: Andy Chiu --- arch/riscv/include/asm/ftrace.h | 4 +++ arch/riscv/kernel/ftrace.c

[PATCH v2 2/6] riscv: ftrace: align patchable functions to 4 Byte boundary

2024-06-28 Thread Andy Chiu
functions properly on newer versions of gcc. So, we add a cc-option to test if the toolchain supports it. Suggested-by: Evgenii Shatokhin Signed-off-by: Andy Chiu --- Changelog v2: - Use CC_HAS_MIN_FUNCTION_ALIGNMENT and it friends to prevent reinventing wheels (Nathan) --- arch/riscv/Kconfig

[PATCH v2 1/6] riscv: ftrace: support fastcc in Clang for WITH_ARGS

2024-06-28 Thread Andy Chiu
Reported-by: Evgenii Shatokhin Closes: https://lore.kernel.org/linux-riscv/7e7c7914-445d-426d-89a0-59a9199c4...@yadro.com/ Acked-by: Nathan Chancellor Signed-off-by: Andy Chiu --- arch/riscv/include/asm/ftrace.h | 7 +++ arch/riscv/kernel/asm-offsets.c | 7 +++ arch/riscv/kernel/mcount-dyn.S

[PATCH v2 0/6] riscv: ftrace: atmoic patching and preempt improvements

2024-06-28 Thread Andy Chiu
n functions. - Link to v1: https://lore.kernel.org/r/20240613-dev-andyc-dyn-ftrace-v4-v1-0-1a538e12c...@sifive.com --- Andy Chiu (6): riscv: ftrace: support fastcc in Clang for WITH_ARGS riscv: ftrace: align patchable functions to 4 Byte boundary riscv: ftrace: prepare ftrace

Re: [PATCH -fixes] riscv: patch: Flush the icache right after patching to avoid illegal insns

2024-06-24 Thread Andy Chiu
On Mon, Jun 24, 2024 at 7:49 PM Andy Chiu wrote: > > Hi Alex, > > On Mon, Jun 24, 2024 at 4:21 PM Alexandre Ghiti > wrote: > > > > We cannot delay the icache flush after patching some functions as we may > > have patched a function that will get called before t

Re: [PATCH -fixes] riscv: patch: Flush the icache right after patching to avoid illegal insns

2024-06-24 Thread Andy Chiu
*addr, const void *insns, > size_t len) > > ret = patch_insn_write(tp, insns, len); > > - if (!ret) > - flush_icache_range((uintptr_t) tp, (uintptr_t) tp + len); > - > return ret; > } > NOKPROBE_SYMBOL(patch_text_nosync); > @@ -253,9 +263,9 @@ static int patch_text_cb(void *data) > } else { > while (atomic_read(&patch->cpu_count) <= num_online_cpus()) > cpu_relax(); > - } > > - local_flush_icache_all(); > + local_flush_icache_all(); > + } > > return ret; > } > -- > 2.39.2 > Thanks, Andy

Re: [PATCH] riscv: Fix early ftrace nop patching

2024-06-18 Thread Andy Chiu
On Tue, Jun 18, 2024 at 9:40 PM Alexandre Ghiti wrote: > > Hi Andy, > > On Tue, Jun 18, 2024 at 2:48 PM Andy Chiu wrote: > > > > On Tue, Jun 18, 2024 at 8:02 PM Alexandre Ghiti wrote: > > > > > > Hi Conor, > > > > > >

Re: [PATCH] riscv: Fix early ftrace nop patching

2024-06-18 Thread Andy Chiu
to provide my thoughts, please let me know if I missed anything. I think what Conor suggested is safe for init_nop, as it would be called only when there is only one core (booting) and at the loading stage of kernel modules. In the first case we just have to make sure there is no patchable entry be

Re: [PATCH 4/8] riscv: ftrace: align patchable functions to 4 Byte boundary

2024-06-16 Thread Andy Chiu
Sorry for the noise, On Mon, Jun 17, 2024 at 10:38 AM Andy Chiu wrote: > > On Fri, Jun 14, 2024 at 3:09 AM Nathan Chancellor wrote: > > > > Hi Andy, > > > > On Thu, Jun 13, 2024 at 03:11:09PM +0800, Andy Chiu wrote: > > > We are changing ftrace code patc

Re: [PATCH 4/8] riscv: ftrace: align patchable functions to 4 Byte boundary

2024-06-16 Thread Andy Chiu
On Fri, Jun 14, 2024 at 3:09 AM Nathan Chancellor wrote: > > Hi Andy, > > On Thu, Jun 13, 2024 at 03:11:09PM +0800, Andy Chiu wrote: > > We are changing ftrace code patching in order to remove dependency from > > stop_machine() and enable kernel preemption. This requires u

Re: [PATCH 2/8] tracing: do not trace kernel_text_address()

2024-06-16 Thread Andy Chiu
On Thu, Jun 13, 2024 at 9:32 PM Steven Rostedt wrote: > > On Thu, 13 Jun 2024 15:11:07 +0800 > Andy Chiu wrote: > > > kernel_text_address() and __kernel_text_address() are called in > > arch_stack_walk() of riscv. This results in excess amount of un-related > > trac

[PATCH 8/8] riscv: ftrace: support PREEMPT

2024-06-13 Thread Andy Chiu
Now, we can safely enable dynamic ftrace with kernel preemption. Signed-off-by: Andy Chiu --- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 80b8d48e1e46..c1493ee1b8cd 100644 --- a/arch/riscv/Kconfig +++ b

[PATCH 7/8] riscv: vector: Support calling schedule() for preemptible Vector

2024-06-13 Thread Andy Chiu
schedule(). Besides, we currently don't pass argument through vector register, so we don't have to save/restore V-regs in ftrace trampoline. Signed-off-by: Andy Chiu --- arch/riscv/include/asm/processor.h | 5 + arch/riscv/include/asm/vector.h| 22 +++--- 2 fil

[PATCH 6/8] riscv: ftrace: do not use stop_machine to update code

2024-06-13 Thread Andy Chiu
Now it is safe to remove dependency from stop_machine() for us to patch code in ftrace. Signed-off-by: Andy Chiu --- arch/riscv/kernel/ftrace.c | 53 -- 1 file changed, 4 insertions(+), 49 deletions(-) diff --git a/arch/riscv/kernel/ftrace.c b/arch

[PATCH 5/8] riscv: ftrace: prepare ftrace for atomic code patching

2024-06-13 Thread Andy Chiu
perform the jump. This enable the kernel to update the target atomically. The ordering of reading/updating the targert address should be guarded by generic ftrace code, where it sends smp_rmb ipi. Signed-off-by: Andy Chiu --- arch/riscv/include/asm/ftrace.h | 4 +++ arch/riscv/kernel/ftrace.c

[PATCH 4/8] riscv: ftrace: align patchable functions to 4 Byte boundary

2024-06-13 Thread Andy Chiu
functions properly on newer versions of gcc. So, we add a cc-option to test if the toolchain supports it. Suggested-by: Evgenii Shatokhin Signed-off-by: Andy Chiu --- arch/riscv/Kconfig | 1 + arch/riscv/Makefile | 7 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/riscv

[PATCH 3/8] riscv: ftrace: support fastcc in Clang for WITH_ARGS

2024-06-13 Thread Andy Chiu
-by: Evgenii Shatokhin Closes: https://lore.kernel.org/linux-riscv/7e7c7914-445d-426d-89a0-59a9199c4...@yadro.com/ Signed-off-by: Andy Chiu --- arch/riscv/include/asm/ftrace.h | 7 +++ arch/riscv/kernel/asm-offsets.c | 7 +++ arch/riscv/kernel/mcount-dyn.S | 16 ++-- 3

[PATCH 2/8] tracing: do not trace kernel_text_address()

2024-06-13 Thread Andy Chiu
function's entry/exit. This patch adds both functions to notrace, so they won't show up on the trace records. Signed-off-by: Andy Chiu --- kernel/extable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/extable.c b/kernel/extable.c index 71f482581cab..d0

[PATCH 1/8] riscv: stacktrace: convert arch_stack_walk() to noinstr

2024-06-13 Thread Andy Chiu
dd CALLER_ADDRx support") Signed-off-by: Andy Chiu --- arch/riscv/kernel/stacktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c index 528ec7cc9a62..0d3f00eb0bae 100644 --- a/arch/riscv/kernel/stacktrac

[PATCH 0/8] riscv: ftrace: atmoic patching and preempt improvements

2024-06-13 Thread Andy Chiu
epare ftrace to be able to run with kernel preemption (7,8) --- Andy Chiu (8): riscv: stacktrace: convert arch_stack_walk() to noinstr tracing: do not trace kernel_text_address() riscv: ftrace: support fastcc in Clang for WITH_ARGS riscv: ftrace: align patchable functions to 4

Re: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-24 Thread Andy Shevchenko
On Wed, Apr 24, 2024 at 7:14 PM Ondřej Jirman wrote: > On Wed, Apr 24, 2024 at 06:20:41PM GMT, Andy Shevchenko wrote: > > On Wed, Apr 24, 2024 at 3:59 PM Ondřej Jirman wrote: > > > On Wed, Apr 24, 2024 at 02:16:06AM GMT, Andy Shevchenko wrote: > > > > On Wed

Re: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-24 Thread Andy Shevchenko
On Wed, Apr 24, 2024 at 3:59 PM Ondřej Jirman wrote: > On Wed, Apr 24, 2024 at 02:16:06AM GMT, Andy Shevchenko wrote: > > On Wed, Apr 24, 2024 at 1:41 AM Aren Moynihan > > wrote: ... > > > ret = stk3310_init(indio_dev); > > > if (ret <

Re: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-23 Thread Andy Shevchenko
to use dev_get_drvdata() directly. Jonathan, do we have something like iio_priv_from_drvdata(struct device *dev)? Seems many drivers may utilise it. > } ... > static int stk3310_resume(struct device *dev) Ditto. -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 3/6] iio: light: stk3310: Manage LED power supply

2024-04-23 Thread Andy Shevchenko
t;dev, ret, "get regulator vdd > failed\n"); > > + data->led_reg = devm_regulator_get(&client->dev, "leda"); > + if (IS_ERR(data->led_reg)) > + return dev_err_probe(&client->dev, ret, "get regulator led > failed\n"); Can't you use a bulk regulator API instead? -- With Best Regards, Andy Shevchenko

Re: [PATCH 2/4] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-18 Thread Andy Shevchenko
On Thu, Apr 18, 2024 at 8:50 PM Aren wrote: > On Thu, Apr 18, 2024 at 06:56:09PM +0300, Andy Shevchenko wrote: > > On Thu, Apr 18, 2024 at 6:06 PM Aren wrote: > > > On Mon, Apr 15, 2024 at 05:04:53PM +0300, Andy Shevchenko wrote: > > > > On Sun, Apr 14,

Re: [PATCH 2/4] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-18 Thread Andy Shevchenko
On Thu, Apr 18, 2024 at 6:06 PM Aren wrote: > On Mon, Apr 15, 2024 at 05:04:53PM +0300, Andy Shevchenko wrote: > > On Sun, Apr 14, 2024 at 8:57 PM Aren Moynihan > > wrote: ... > > > stk3310_set_state(iio_priv(indio_dev), STK3310_STATE_STANDBY); > &g

Re: [PATCH 3/4] iio: light: stk3310: log error if reading the chip id fails

2024-04-15 Thread Andy Shevchenko
} Briefly looking at the code it seems that this one is strictly part of the probe phase, which means we may use return dev_err_probe(...); pattern. Yet, you may add another patch to clean up all of them: _probe(), _init(), _regmap_init() to use the same pattern everywhere. -- With Best Regards, Andy Shevchenko

Re: [PATCH 2/4] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-15 Thread Andy Shevchenko
able(data->vdd_reg); I forgot to check the order of freeing resources, be sure you have no devm_*() releases happening before this call. ... > + usleep_range(1000, 2000); fsleep() -- With Best Regards, Andy Shevchenko

Re: [PATCH] [v3] module: don't ignore sysfs_create_link() failures

2024-03-26 Thread Andy Shevchenko
es of code this can be improved beforehand. So, we will reduce a technical debt, and not adding to it. > + goto out_detach; > + } ... > +int module_add_driver(struct module *mod, struct device_driver *drv) > { > char *driver_name; > - int no_warn; > + int ret; I would move it... > struct module_kobject *mk = NULL; ...to be here. -- With Best Regards, Andy Shevchenko

Re: [RFC PATCH] riscv: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS

2024-03-21 Thread Andy Chiu
On Thu, Mar 21, 2024 at 4:48 PM Björn Töpel wrote: > > Andy, > > Pulling out the A option: > > >> > A) Use auipc/jalr, only patch jalr to take us to a common > >> >dispatcher/trampoline > >> > > >> > | # probabl

Re: [RFC PATCH] riscv: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS

2024-03-20 Thread Andy Chiu
call that out during boot than blindly assume. However, one thing I am not very sure is: do we need a destination address in a "per-function" manner? It seems like most of the time the destination address can only be ftrace_call, or ftrace_regs_call. If the number of destination addresses is very few, then we could potentially reduce the size of . > > There are 4 CMODX possiblities: >mv, nop: fully disabled, no problems >mv, jalr: We will jump to zero. We would need to have the inst > page/access fault handler take care of this case. Especially > if we align the instructions so that they can be patched > together, being interrupted in the middle and taking this > path will be rare. > ld, nop: no problems > ld, jalr: fully enabled, no problems > > Patching is a 64b store/sd, and we only need a fence.i at the end, since > we can handle all 4 possibilities. > > For the disabled case we'll have: > A) mv, aupic, nop > D) mv, aupic, mv, nop. > > Puranjay, I've flipped. Let's go Mark's CALL_OPS together with a new > text patch mechanism w/o stop_machine(). > > > Björn Cheers, Andy

Re: [RFC PATCH] riscv: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS

2024-03-08 Thread Andy Chiu
nes > for per callsite tracers, would CALL_OPS provide better performance than that? > > > > > I'm trying to wrap my head if it makes sense to have it on RISC-V, given > > that we're a bit different from Arm64. Does the scale tip to the GOOD > > side? > > > > Oh, and we really need to see performance numbers on real HW! I have a > > VF2 that I could try this series on. > > It would be great if you can do it :D. > > Thanks, > Puranjay > > ___ > linux-riscv mailing list > linux-ri...@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv - [1] https://yhbt.net/lore/all/cajf2gtsn3_cdysf9d8dt-br2wf_m8y02a09xgrq8kxi91sn...@mail.gmail.com/T/ Regards, Andy

Re: [RFC PATCH] riscv: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS

2024-03-08 Thread Andy Chiu
gt; 4. I would like to benchmark this on real hardware and put the results > > > in > > > the commit message. > > > > > > Signed-off-by: Puranjay Mohan > > > --- > > > arch/riscv/Kconfig | 2 ++ > > > arch/riscv/

Re: [PATCH v1 1/1] ACPI: NFIT: Switch to use acpi_evaluate_dsm_typed()

2024-02-02 Thread Andy Shevchenko
On Mon, Nov 20, 2023 at 07:19:44PM +0200, Andy Shevchenko wrote: > On Mon, Nov 20, 2023 at 04:11:54PM +0100, Rafael J. Wysocki wrote: > > On Mon, Nov 20, 2023 at 4:03 PM Andy Shevchenko > > wrote: > > > On Thu, Oct 19, 2023 at 06:03:28PM -0700, Dan Williams wrote: >

Re: [PATCH] tracing histograms: Simplify parse_actions() function

2024-01-08 Thread Andy Shevchenko
27;) { // not sure if you need data to be assigned here as well ret = -EINVAL; ... } -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 0/5] params: harden string ops and allocatio ops

2023-12-01 Thread Andy Shevchenko
On Fri, Dec 01, 2023 at 09:43:34AM -0800, Kees Cook wrote: > On Mon, 20 Nov 2023 17:11:41 +0200, Andy Shevchenko wrote: > > A couple of patches are for get the string ops, used in the module, > > slightly harden. On top a few cleanups. > > > > Since the main part is ra

  1   2   3   4   5   6   7   8   9   10   >