[PATCH v7 2/3] hwmon: pmbus: use more devres helpers

2020-08-17 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Shrink pmbus code by using devm_hwmon_device_register_with_groups() and devm_krealloc() instead of their non-managed variants. Signed-off-by: Bartosz Golaszewski Acked-by: Guenter Roeck --- drivers/hwmon/pmbus/pmbus_core.c | 28 +--- 1 file

[PATCH v7 1/3] devres: provide devm_krealloc()

2020-08-17 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Implement the managed variant of krealloc(). This function works with all memory allocated by devm_kmalloc() (or devres functions using it implicitly like devm_kmemdup(), devm_kstrdup() etc.). Managed realloc'ed chunks can be manually released with devm_kfree

[PATCH v7 3/3] iio: adc: xilinx-xadc: use devm_krealloc()

2020-08-17 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Use the managed variant of krealloc() and shrink the code a bit. Signed-off-by: Bartosz Golaszewski Acked-by: Jonathan Cameron --- drivers/iio/adc/xilinx-xadc-core.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/iio/adc

Re: [PATCH v4 11/20] gpiolib: cdev: support GPIO_V2_LINE_SET_VALUES_IOCTL

2020-08-16 Thread Bartosz Golaszewski
On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote: > > Add support for the GPIO_V2_LINE_SET_VALUES_IOCTL. > > Signed-off-by: Kent Gibson > --- Just the same thing as with patch 10/20 regarding the _locked/_unlocked suffix. I don't have other comments, looks good to me. Bart [snip]

Re: [PATCH v4 10/20] gpiolib: cdev: support GPIO_V2_LINE_SET_CONFIG_IOCTL

2020-08-16 Thread Bartosz Golaszewski
On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote: > > Add support for GPIO_V2_LINE_SET_CONFIG_IOCTL, the uAPI v2 > line set config ioctl. > > Signed-off-by: Kent Gibson > --- > drivers/gpio/gpiolib-cdev.c | 92 + > 1 file changed, 92 insertions(+) > > diff

Re: [PATCH v4 09/20] gpiolib: cdev: support edge detection for uAPI v2

2020-08-16 Thread Bartosz Golaszewski
On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote: > > Add support for edge detection to lines requested using > GPIO_V2_GET_LINE_IOCTL. > > Signed-off-by: Kent Gibson > --- > > The edge_detector implementation is based on the v1 lineevent implementation. > > drivers/gpio/gpiolib-cdev.c | 316

Re: [PATCH v4 07/20] gpiolib: cdev: support GPIO_V2_GET_LINE_IOCTL and GPIO_V2_LINE_GET_VALUES_IOCTL

2020-08-16 Thread Bartosz Golaszewski
On Sat, Aug 15, 2020 at 3:21 PM Kent Gibson wrote: > > On Sat, Aug 15, 2020 at 09:21:22AM +0200, Bartosz Golaszewski wrote: > > On Sat, Aug 15, 2020 at 8:53 AM Kent Gibson wrote: > > > > > > On Fri, Aug 14, 2020 at 09:31:29PM +0200, Bartosz Golaszewski wrote: > &

Re: [PATCH v4 08/20] gpiolib: cdev: support GPIO_V2_GET_LINEINFO_IOCTL and GPIO_V2_GET_LINEINFO_WATCH_IOCTL

2020-08-16 Thread Bartosz Golaszewski
On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote: > > Add support for GPIO_V2_GET_LINEINFO_IOCTL and > GPIO_V2_GET_LINEINFO_WATCH_IOCTL. > > Signed-off-by: Kent Gibson > --- > > The core of this change is the event kfifo switching to contain > struct gpioline_info_changed_v2, instead of v1 as

Re: [PATCH v4 07/20] gpiolib: cdev: support GPIO_V2_GET_LINE_IOCTL and GPIO_V2_LINE_GET_VALUES_IOCTL

2020-08-15 Thread Bartosz Golaszewski
On Sat, Aug 15, 2020 at 8:53 AM Kent Gibson wrote: > > On Fri, Aug 14, 2020 at 09:31:29PM +0200, Bartosz Golaszewski wrote: > > On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote: > > > > > > Add support for requesting lines using the GPIO_V2_GET_LINE_IOCTL, and

Re: [PATCH v4 07/20] gpiolib: cdev: support GPIO_V2_GET_LINE_IOCTL and GPIO_V2_LINE_GET_VALUES_IOCTL

2020-08-14 Thread Bartosz Golaszewski
On Fri, Aug 14, 2020 at 5:04 AM Kent Gibson wrote: > > Add support for requesting lines using the GPIO_V2_GET_LINE_IOCTL, and > returning their current values using GPIO_V2_LINE_GET_VALUES_IOCTL. > > Signed-off-by: Kent Gibson > --- Hi Kent, not many comments here, just a couple minor details

Re: [PATCH v4 5/6] at24: Support probing while off

2020-08-12 Thread Bartosz Golaszewski
On Wed, Aug 12, 2020 at 9:25 PM Wolfram Sang wrote: > > > > Wolfram says. From my side: I'd prefer to see the > > disable_i2c_core_irq_mapping converted to flags first and then the > > flags extended with whatever you need. disable_i2c_core_irq_mapping > > could also be removed AFAICT - nobody

Re: [PATCH v4 5/6] at24: Support probing while off

2020-08-12 Thread Bartosz Golaszewski
On Tue, Aug 11, 2020 at 10:00 AM Sakari Ailus wrote: > > Hi Bartosz, > > On Mon, Aug 10, 2020 at 08:12:00PM +0200, Bartosz Golaszewski wrote: > > On Mon, Aug 10, 2020 at 10:26 AM Sakari Ailus wrote: > > > > > > > [snip] > > > > > > > &g

Re: [PATCH v3 02/18] gpio: uapi: define uAPI v2

2020-08-12 Thread Bartosz Golaszewski
On Wed, Aug 12, 2020 at 3:55 AM Kent Gibson wrote: > > On Tue, Aug 11, 2020 at 09:11:41PM +0200, Bartosz Golaszewski wrote: > > On Sun, Aug 9, 2020 at 3:26 PM Kent Gibson wrote: > > > > [snip] > > > > > > +/* > > > + * Maximum number of requ

Re: [PATCH v3 02/18] gpio: uapi: define uAPI v2

2020-08-11 Thread Bartosz Golaszewski
On Sun, Aug 9, 2020 at 3:26 PM Kent Gibson wrote: > > Add a new version of the uAPI to address existing 32/64-bit alignment > issues, add support for debounce and event sequence numbers, allow > requested lines with different configurations, and provide some future > proofing by adding padding

Re: [PATCH v2] ARM: davinci: use simple i2c probe function

2020-08-10 Thread Bartosz Golaszewski
> .name = "cpld_video", > }, > - .probe = cpld_video_probe, > + .probe_new = cpld_video_probe, > .remove = cpld_video_remove, > .id_table = cpld_video_id, > }; > > base-commit: bcf876870b95592b52519ed4aafcf9d95999bc9c > -- > 2.20.1 > Reviewed-by: Bartosz Golaszewski

Re: [PATCH v4 5/6] at24: Support probing while off

2020-08-10 Thread Bartosz Golaszewski
On Mon, Aug 10, 2020 at 10:26 AM Sakari Ailus wrote: > [snip] > > > > Rafael: I think that there are two issues with patch 1/5: > > 1. It adds a very specific boolean flag to a structure that's meant to > > be very general. As I pointed out in the i2c patch: at the very least > > this could be

Re: [PATCH v2 02/18] gpio: uapi: define uAPI v2

2020-08-06 Thread Bartosz Golaszewski
On Thu, Aug 6, 2020 at 3:15 AM Kent Gibson wrote: > > On Wed, Aug 05, 2020 at 01:18:53PM +0800, Kent Gibson wrote: > > On Tue, Aug 04, 2020 at 07:42:34PM +0200, Bartosz Golaszewski wrote: > > > On Sat, Jul 25, 2020 at 6:20 AM Kent Gibson wrote: > > [snip] > >

Re: [PATCH v2 02/18] gpio: uapi: define uAPI v2

2020-08-05 Thread Bartosz Golaszewski
On Wed, Aug 5, 2020 at 7:19 AM Kent Gibson wrote: > [snip] > > > > > > +/* > > > + * Maximum number of requested lines. > > > + * > > > + * Must be a multiple of 8 to ensure 32/64-bit alignment of structs. > > > + */ > > > +#define GPIOLINES_MAX 64 > > > + > > > +/* The number of __u64 required

Re: VAIO EEPROM support in at24

2020-08-05 Thread Bartosz Golaszewski
On Wed, Aug 5, 2020 at 4:36 PM Jean Delvare wrote: > > Hi Bartosz, > > On Tue, 17 Mar 2020 15:32:56 +0100, Bartosz Golaszewski wrote: > > wt., 17 mar 2020 o 15:14 Jean Delvare napisał(a): > > > Before I start implementing the idea above, I would like to know if > &g

Re: [PATCH v2 11/18] gpio: uapi: document uAPI v1 as deprecated

2020-08-04 Thread Bartosz Golaszewski
On Sat, Jul 25, 2020 at 6:22 AM Kent Gibson wrote: > > Update uAPI documentation to deprecate v1 structs and ioctls. > > Signed-off-by: Kent Gibson > --- > include/uapi/linux/gpio.h | 26 ++ > 1 file changed, 26 insertions(+) > > diff --git a/include/uapi/linux/gpio.h

Re: [PATCH v2 07/18] gpiolib: cdev: support edge detection for uAPI v2

2020-08-04 Thread Bartosz Golaszewski
On Sat, Jul 25, 2020 at 6:21 AM Kent Gibson wrote: > > Add support for edge detection to lines requested using > GPIO_GET_LINE_IOCTL. > > Signed-off-by: Kent Gibson > --- [snip!] > + > +static irqreturn_t edge_irq_thread(int irq, void *p) > +{ > + struct edge_detector *edet = p; > +

Re: [PATCH v2 05/18] gpiolib: cdev: support GPIO_GET_LINE_IOCTL and GPIOLINE_GET_VALUES_IOCTL

2020-08-04 Thread Bartosz Golaszewski
On Tue, Aug 4, 2020 at 1:01 AM Kent Gibson wrote: > [snip] > > > Also: I just started going through the patches - nice idea with the > > GPIO attributes, I really like it. Although I need to give it a longer > > thought tomorrow - I'm wondering if we can maybe unify them and the > > flags. > >

Re: [PATCH v2 02/18] gpio: uapi: define uAPI v2

2020-08-04 Thread Bartosz Golaszewski
On Sat, Jul 25, 2020 at 6:20 AM Kent Gibson wrote: > > Add a new version of the uAPI to address existing 32/64-bit alignment > issues, add support for debounce and event sequence numbers, and provide > some future proofing by adding padding reserved for future use. > > The alignment issue relates

Re: [PATCH v2 05/18] gpiolib: cdev: support GPIO_GET_LINE_IOCTL and GPIOLINE_GET_VALUES_IOCTL

2020-08-03 Thread Bartosz Golaszewski
On Sun, Aug 2, 2020 at 5:32 AM Kent Gibson wrote: > > On Fri, Jul 31, 2020 at 06:05:10PM +0200, Bartosz Golaszewski wrote: > > On Sun, Jul 26, 2020 at 3:12 AM Kent Gibson wrote: [snip!] > > > > > > > > > +static u64 gpioline_config_flags(struct gpiol

Re: [PATCH v2 05/18] gpiolib: cdev: support GPIO_GET_LINE_IOCTL and GPIOLINE_GET_VALUES_IOCTL

2020-08-03 Thread Bartosz Golaszewski
On Sun, Aug 2, 2020 at 11:32 AM Kent Gibson wrote: > > On Sun, Aug 02, 2020 at 11:31:58AM +0800, Kent Gibson wrote: > > On Fri, Jul 31, 2020 at 06:05:10PM +0200, Bartosz Golaszewski wrote: > > > On Sun, Jul 26, 2020 at 3:12

Re: [PATCH v6 1/3] devres: provide devm_krealloc()

2020-08-03 Thread Bartosz Golaszewski
On Sun, Aug 2, 2020 at 12:42 PM Andy Shevchenko wrote: > [snip] > > I was thinking about this bit... Shouldn't we rather issue a simple > dev_warn() and return the existing pointer? > For example in some cases we might want to have resources coming > either from heap or from constant. Then, if

[PATCH v6 0/3] devres: provide and use devm_krealloc()

2020-08-02 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Hi Greg, Andy, this is a reworked version of devm_krealloc(). This time without the risk of sleeping with spinlock taken. I noticed that devres_lock is only there to protect the integrity of the devres list - we can assume users are sane enough to not devm_kfree

[PATCH v6 1/3] devres: provide devm_krealloc()

2020-08-02 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Implement the managed variant of krealloc(). This function works with all memory allocated by devm_kmalloc() (or devres functions using it implicitly like devm_kmemdup(), devm_kstrdup() etc.). Managed realloc'ed chunks can be manually released with devm_kfree

[PATCH v6 3/3] iio: adc: xilinx-xadc: use devm_krealloc()

2020-08-02 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Use the managed variant of krealloc() and shrink the code a bit. Signed-off-by: Bartosz Golaszewski Acked-by: Jonathan Cameron --- drivers/iio/adc/xilinx-xadc-core.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/iio/adc

[PATCH v6 2/3] hwmon: pmbus: use more devres helpers

2020-08-02 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Shrink pmbus code by using devm_hwmon_device_register_with_groups() and devm_krealloc() instead of their non-managed variants. Signed-off-by: Bartosz Golaszewski Acked-by: Guenter Roeck --- drivers/hwmon/pmbus/pmbus_core.c | 28 +--- 1 file

[net-next PATCH] net: phy: mdio-mvusb: select MDIO_DEVRES in Kconfig

2020-08-02 Thread Bartosz Golaszewski
From: Bartosz Golaszewski PHYLIB is not selected by the mvusb driver but it uses mdio devres helpers. Explicitly select MDIO_DEVRES in this driver's Kconfig entry. Reported-by: kernel test robot Fixes: 1814cff26739 ("net: phy: add a Kconfig option for mdio_devres") Signed-off-b

Re: [PATCH v2 05/18] gpiolib: cdev: support GPIO_GET_LINE_IOCTL and GPIOLINE_GET_VALUES_IOCTL

2020-07-31 Thread Bartosz Golaszewski
On Sun, Jul 26, 2020 at 3:12 AM Kent Gibson wrote: > [snip] > > > > > +static bool padding_not_zeroed(__u32 *padding, int pad_size) > > > +{ > > > + int i, sum = 0; > > > + > > > + for (i = 0; i < pad_size; i++) > > > + sum |= padding[i]; > > > + > > > + return

Re: [PATCH] gpio: don't use same lockdep class for all devm_gpiochip_add_data users

2020-07-31 Thread Bartosz Golaszewski
struct device *dev, struct gpio_chip *gc, > - void *data); > +extern int devm_gpiochip_add_data_with_key(struct device *dev, struct > gpio_chip *gc, void *data, > + struct lock_class_key *lock_key, > + struct lock_class_key > *request_key); > > extern struct gpio_chip *gpiochip_find(void *data, > int (*match)(struct gpio_chip *gc, void *data)); > -- > 2.27.0 > Looks good to me and the previous code indeed looks buggy. Reviewed-by: Bartosz Golaszewski

Re: [Linux-kernel-mentees] [PATCH v3] media/v4l2-core: Fix kernel-infoleak in video_put_user()

2020-07-30 Thread Bartosz Golaszewski
On Tue, Jul 28, 2020 at 3:58 PM Arnd Bergmann wrote: > > On Tue, Jul 28, 2020 at 3:06 PM Dan Carpenter > wrote: > > > > On Tue, Jul 28, 2020 at 02:22:29PM +0200, Linus Walleij wrote: > > > On Mon, Jul 27, 2020 at 3:17 PM Dan Carpenter > > > wrote: > > > > > > > Here are my latest warnings on

Re: [PATCH v5 1/3] devres: provide devm_krealloc()

2020-07-25 Thread Bartosz Golaszewski
On Wed, Jul 15, 2020 at 11:25 AM Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > Implement the managed variant of krealloc(). This function works with > all memory allocated by devm_kmalloc() (or devres functions using it > implicitly like devm_kmemdup(),

Re: [PATCH 15/30] iio: dummy: iio_dummy_evgen: Demote file header and supply description for 'irq_sim_domain'

2020-07-18 Thread Bartosz Golaszewski
on line 30 - I thought it was a doc line > drivers/iio/dummy/iio_dummy_evgen.c:42: warning: Function parameter or > member 'irq_sim_domain' not described in 'iio_dummy_eventgen' > > Cc: Marc Zyngier > Cc: Bartosz Golaszewski > Signed-off-by: Lee Jones > --- > drivers/iio/du

Re: [PATCH v2 1/8] arch: arm: mach-davinci: Fix trivial spelling

2020-07-16 Thread Bartosz Golaszewski
vm_nand_mirror_pattern[] = { '1', 't', 'b', 'B' }; > > -- > 2.25.1 > Reviewed-by: Bartosz Golaszewski

[PATCH v5 0/3] devres: provide and use devm_krealloc()

2020-07-15 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Regular krealloc() obviously can't work with managed memory. This series implements devm_krealloc() and adds the first users with hope that this helper will be adopted by other drivers currently using non-managed krealloc(). Some additional changes to the code modified

[PATCH v5 1/3] devres: provide devm_krealloc()

2020-07-15 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Implement the managed variant of krealloc(). This function works with all memory allocated by devm_kmalloc() (or devres functions using it implicitly like devm_kmemdup(), devm_kstrdup() etc.). Managed realloc'ed chunks can be manually released with devm_kfree

[PATCH v5 2/3] hwmon: pmbus: use more devres helpers

2020-07-15 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Shrink pmbus code by using devm_hwmon_device_register_with_groups() and devm_krealloc() instead of their non-managed variants. Signed-off-by: Bartosz Golaszewski Acked-by: Guenter Roeck --- drivers/hwmon/pmbus/pmbus_core.c | 28 +--- 1 file

[PATCH v5 3/3] iio: adc: xilinx-xadc: use devm_krealloc()

2020-07-15 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Use the managed variant of krealloc() and shrink the code a bit. Signed-off-by: Bartosz Golaszewski --- drivers/iio/adc/xilinx-xadc-core.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b

Re: [PATCH v4 1/3] devres: provide devm_krealloc()

2020-07-14 Thread Bartosz Golaszewski
On Mon, Jul 13, 2020 at 9:29 PM Andy Shevchenko wrote: > > On Mon, Jul 13, 2020 at 04:59:32PM +0200, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > Implement the managed variant of krealloc(). This function works with > > all memory allocate

[PATCH] net: phy: fix mdio-mscc-miim build

2020-07-13 Thread Bartosz Golaszewski
From: Bartosz Golaszewski PHYLIB is not selected by mdio-mscc-miim but it uses mdio devres helpers. Explicitly select MDIO_DEVRES in this driver's Kconfig entry. Reported-by: kernel test robot Fixes: 1814cff26739 ("net: phy: add a Kconfig option for mdio_devres") Signed-off-b

[PATCH v4 2/3] hwmon: pmbus: use more devres helpers

2020-07-13 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Shrink pmbus code by using devm_hwmon_device_register_with_groups() and devm_krealloc() instead of their non-managed variants. Signed-off-by: Bartosz Golaszewski Acked-by: Guenter Roeck --- drivers/hwmon/pmbus/pmbus_core.c | 28 +--- 1 file

[PATCH v4 0/3] devres: provide and use devm_krealloc()

2020-07-13 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Regular krealloc() obviously can't work with managed memory. This series implements devm_krealloc() and adds the first users with hope that this helper will be adopted by other drivers currently using non-managed krealloc(). Some additional changes to the code modified

[PATCH v4 3/3] iio: adc: xilinx-xadc: use devm_krealloc()

2020-07-13 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Use the managed variant of krealloc() and shrink the code a bit. Signed-off-by: Bartosz Golaszewski --- drivers/iio/adc/xilinx-xadc-core.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b

[PATCH v4 1/3] devres: provide devm_krealloc()

2020-07-13 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Implement the managed variant of krealloc(). This function works with all memory allocated by devm_kmalloc() (or devres functions using it implicitly like devm_kmemdup(), devm_kstrdup() etc.). Managed realloc'ed chunks can be manually released with devm_kfree

Re: [PATCH v3 1/3] devres: provide devm_krealloc()

2020-07-12 Thread Bartosz Golaszewski
On Sat, Jul 11, 2020 at 5:08 PM Andy Shevchenko wrote: > > On Fri, Jul 10, 2020 at 7:17 PM Bartosz Golaszewski wrote: > > > > From: Bartosz Golaszewski > > > > Implement the managed variant of krealloc(). This function works with > > all memory allocated by

Re: [PATCH v2 4/6] devres: handle zero size in devm_kmalloc()

2020-07-10 Thread Bartosz Golaszewski
On Fri, Jul 10, 2020 at 6:11 PM Jon Hunter wrote: > > > On 10/07/2020 17:03, Bartosz Golaszewski wrote: > > On Fri, Jul 10, 2020 at 3:46 PM Jon Hunter wrote: > >> > >> Hi Bartosz, > >> > >> On 29/06/2020 07:50, Bartosz Golaszewski wrote

[PATCH v3 2/3] hwmon: pmbus: use more devres helpers

2020-07-10 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Shrink pmbus code by using devm_hwmon_device_register_with_groups() and devm_krealloc() instead of their non-managed variants. Signed-off-by: Bartosz Golaszewski Acked-by: Guenter Roeck --- drivers/hwmon/pmbus/pmbus_core.c | 28 +--- 1 file

[PATCH v3 0/3] devres: provide and use devm_krealloc()

2020-07-10 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Hi Greg, As discussed, resending the remaining devm_krealloc() patches. === Regular krealloc() obviously can't work with managed memory. This series implements devm_krealloc() and adds the first users with hope that this helper will be adopted by other drivers

[PATCH v3 3/3] iio: adc: xilinx-xadc: use devm_krealloc()

2020-07-10 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Use the managed variant of krealloc() and shrink the code a bit. Signed-off-by: Bartosz Golaszewski --- drivers/iio/adc/xilinx-xadc-core.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b

[PATCH v3 1/3] devres: provide devm_krealloc()

2020-07-10 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Implement the managed variant of krealloc(). This function works with all memory allocated by devm_kmalloc() (or devres functions using it implicitly like devm_kmemdup(), devm_kstrdup() etc.). Managed realloc'ed chunks can be manually released with devm_kfree

Re: [PATCH v2 4/6] devres: handle zero size in devm_kmalloc()

2020-07-10 Thread Bartosz Golaszewski
On Fri, Jul 10, 2020 at 3:46 PM Jon Hunter wrote: > > Hi Bartosz, > > On 29/06/2020 07:50, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > Make devm_kmalloc() behave similarly to non-managed kmalloc(): return > > ZERO_SIZE_PTR when re

Re: [PATCH 00/17] gpiolib: cdev: pre-uAPI v2 cleanups

2020-07-09 Thread Bartosz Golaszewski
On Wed, Jul 8, 2020 at 6:18 AM Kent Gibson wrote: > > This collection of patches provides improvements to or > address minor problems in gpiolib-cdev. > > The majority of the patches (1-7, 9-11) have been pulled directly from > my "gpio: cdev: add uAPI V2" patch set, as they are not related to

Re: [PATCH 08/17] gpiolib: cdev: use blocking notifier call chain instead of atomic

2020-07-09 Thread Bartosz Golaszewski
On Wed, Jul 8, 2020 at 6:19 AM Kent Gibson wrote: > > Replace usage of atomic_notifier_call_chain with > blocking_notifier_call_chain as the notifier function, > lineinfo_changed_notify, calls gpio_desc_to_lineinfo, > which calls pinctrl_gpio_can_use_line, which can sleep. > > The chain isn't

Re: [PATCH v2 26/30] misc: eeprom: at24: Tell the compiler that ACPI functions may not be used

2020-07-06 Thread Bartosz Golaszewski
quot;INT3499",(kernel_ulong_t)_data_INT3499 }, > { "TPF0001",(kernel_ulong_t)_data_24c1024 }, > { /* END OF LIST */ } Acked-by: Bartosz Golaszewski Please, drop the "Re:" prefix from the subject next time, I nearly missed this in my inbox. Thanks! Bartosz

Re: [PATCH v2 5/6] devres: provide devm_krealloc()

2020-07-06 Thread Bartosz Golaszewski
On Thu, Jul 2, 2020 at 3:11 PM Bartosz Golaszewski wrote: > > On Thu, Jul 2, 2020 at 2:42 PM Greg Kroah-Hartman > wrote: > > > > On Mon, Jun 29, 2020 at 08:50:07AM +0200, Bartosz Golaszewski wrote: > > > From: Bartosz Golaszewski > > > > >

Re: [PATCH v5 1/2] gpio: add GPO driver for PCA9570

2020-07-06 Thread Bartosz Golaszewski
On Sun, Jul 5, 2020 at 3:31 PM Sungbo Eo wrote: > > NXP PCA9570 is a 4-bit I2C GPO expander without interrupt functionality. > Its ports are controlled only by a data byte without register address. > > Datasheet: https://www.nxp.com/docs/en/data-sheet/PCA9570.pdf > > Signed-off-by: Sungbo Eo >

[PATCH net-next] net: phy: add a Kconfig option for mdio_devres

2020-07-05 Thread Bartosz Golaszewski
From: Bartosz Golaszewski If phylib is built as a module and CONFIG_MDIO_DEVICE is 'y', the mdio_device and mdio_bus code will be in the phylib module, not in the kernel image. Meanwhile we build mdio_devres depending on the CONFIG_MDIO_DEVICE symbol, so if it's 'y', it will go into the kernel

[PATCH RFT] iio: adc: xilinx-xadc: use devm_krealloc()

2020-07-02 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Use the managed variant of krealloc() and shrink the code a bit. Signed-off-by: Bartosz Golaszewski --- NOTE: this patch depends on the series adding devm_krealloc() which is not yet accepted. Greg, here's just a quick example of a second user of devm_krealloc

Re: [PATCH v2 5/6] devres: provide devm_krealloc()

2020-07-02 Thread Bartosz Golaszewski
On Thu, Jul 2, 2020 at 2:42 PM Greg Kroah-Hartman wrote: > > On Mon, Jun 29, 2020 at 08:50:07AM +0200, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > Implement the managed variant of krealloc(). This function works with > > all memory allocate

Re: [PATCH v2 6/6] hwmon: pmbus: use more devres helpers

2020-07-02 Thread Bartosz Golaszewski
On Thu, Jul 2, 2020 at 2:44 PM Greg Kroah-Hartman wrote: > > On Mon, Jun 29, 2020 at 08:50:08AM +0200, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > Shrink pmbus code by using devm_hwmon_device_register_with_groups() > > and devm_krealloc(

Re: [PATCH 22/22] tools: gpio: support monitoring multiple lines

2020-06-30 Thread Bartosz Golaszewski
ff-by: Kent Gibson Reviewed-by: Bartosz Golaszewski

Re: [PATCH v2 1/2] gpio: add GPO driver for PCA9570

2020-06-30 Thread Bartosz Golaszewski
On Thu, Jun 25, 2020 at 9:58 AM Sungbo Eo wrote: > > NXP PCA9570 is 4-bit I2C GPO expander without interrupt functionality. > Its ports are controlled only by a data byte without register address. > > As there is no other driver similar enough to be adapted for it, a new > driver is introduced

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-06-30 Thread Bartosz Golaszewski
On Tue, Jun 30, 2020 at 8:58 AM Miquel Raynal wrote: > > Hi Uwe, > > Uwe Kleine-König wrote on Mon, 29 Jun > 2020 21:50:44 +0200: > > > On Mon, Jun 29, 2020 at 04:08:44PM +0200, Miquel Raynal wrote: > > > Hello Uwe, Thierry, > > > > > > Miquel Raynal wrote on Sun, 3 May 2020 > > > 12:54:53

Re: [PATCH 08/22] gpiolib: cdev: complete the irq/thread timestamp handshake

2020-06-30 Thread Bartosz Golaszewski
On Thu, Jun 25, 2020 at 12:01 PM Kent Gibson wrote: > > On Thu, Jun 25, 2020 at 11:44:30AM +0200, Bartosz Golaszewski wrote: > > On Wed, Jun 24, 2020 at 4:08 PM Kent Gibson wrote: > > > > > > On Wed, Jun 24, 2020 at 04:00:42PM +0200, Bartosz Golaszewski wrote: &g

Re: [PATCH 11/22] gpiolib: cdev: remove recalculation of offset

2020-06-30 Thread Bartosz Golaszewski
set -> desc -> hwgpio is > the range check in the offset -> desc, but where desc is required you > still get that, and where desc isn't required it is simpler to perform > the range check directly. > > Signed-off-by: Kent Gibson Reviewed-by: Bartosz Golaszewski

[PATCH v2 2/6] devres: move the size check from alloc_dr() into a separate function

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski We will perform the same size check in devm_krealloc(). Move the relevant code into a separate helper. Signed-off-by: Bartosz Golaszewski --- drivers/base/devres.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/base

[PATCH v2 09/10] of: mdio: provide devm_of_mdiobus_register()

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Implement a managed variant of of_mdiobus_register(). We need to make mdio_devres into its own module because otherwise we'd hit circular sumbol dependencies between phylib and of_mdio. Signed-off-by: Bartosz Golaszewski --- .../driver-api/driver-model/devres.rst

[PATCH v2 6/6] hwmon: pmbus: use more devres helpers

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Shrink pmbus code by using devm_hwmon_device_register_with_groups() and devm_krealloc() instead of their non-managed variants. Signed-off-by: Bartosz Golaszewski --- drivers/hwmon/pmbus/pmbus_core.c | 28 +--- 1 file changed, 9 insertions

[PATCH v2 1/6] devres: remove stray space from devm_kmalloc() definition

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Use the preferred coding style for functions returning pointers. Signed-off-by: Bartosz Golaszewski --- drivers/base/devres.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/devres.c b/drivers/base/devres.c index 0bbb328bd17f

[PATCH v2 07/10] net: phy: don't abuse devres in devm_mdiobus_register()

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski We currently have two managed helpers for mdiobus - devm_mdiobus_alloc() and devm_mdiobus_register(). The idea behind devres is that the release callback releases whatever resource the devm function allocates. In the mdiobus case however there's no devres associated

[PATCH v2 08/10] of: mdio: remove the 'extern' keyword from function declarations

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski The 'extern' keyword in headers doesn't have any benefit. Remove them all from the of_mdio.h header. Signed-off-by: Bartosz Golaszewski --- include/linux/of_mdio.h | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff

[PATCH v2 4/6] devres: handle zero size in devm_kmalloc()

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Make devm_kmalloc() behave similarly to non-managed kmalloc(): return ZERO_SIZE_PTR when requested size is 0. Update devm_kfree() to handle this case. Signed-off-by: Bartosz Golaszewski --- drivers/base/devres.c | 9 ++--- 1 file changed, 6 insertions(+), 3

[PATCH v2 3/6] device: remove 'extern' attribute from function prototypes in device.h

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Functions are declared 'extern' implicitly by the compiler. There's no reason to prepend every prototype with it. Remove the 'extern' keyword from all function declarations in linux/device.h. Signed-off-by: Bartosz Golaszewski --- include/linux/device.h | 223

[PATCH v2 05/10] phy: un-inline devm_mdiobus_register()

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Functions should only be static inline if they're very short. This devres helper is already over 10 lines and it will grow soon as we'll be improving upon its approach. Pull it into mdio_devres.c. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/Makefile

Re: [PATCH 14/22] gpiolib: make cdev a build option

2020-06-29 Thread Bartosz Golaszewski
erface specific build options to follow. > > Suggested-by: Bartosz Golaszewski > Signed-off-by: Kent Gibson > > --- > drivers/gpio/Kconfig| 16 ++-- > drivers/gpio/Makefile | 2 +- > drivers/gpio/gpiolib-cdev.h | 15 +++ > 3 fi

[PATCH v2 5/6] devres: provide devm_krealloc()

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Implement the managed variant of krealloc(). This function works with all memory allocated by devm_kmalloc() (or devres functions using it implicitly like devm_kmemdup(), devm_kstrdup() etc.). Managed realloc'ed chunks can be manually released with devm_kfree

[PATCH v2 00/10] net: improve devres helpers

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski So it seems like there's no support for relaxing certain networking devres helpers to not require previously allocated structures to also be managed. However the way mdio devres variants are implemented is still wrong and I modified my series to address it while keeping

[PATCH v2 06/10] phy: mdio: add kerneldoc for __devm_mdiobus_register()

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski This function is not documented. Add a short kerneldoc description. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/mdio_devres.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/phy/mdio_devres.c b/drivers/net/phy/mdio_devres.c index

Re: [PATCH 15/22] gpiolib: add build option for CDEV V1 ABI

2020-06-29 Thread Bartosz Golaszewski
On Tue, Jun 23, 2020 at 6:03 AM Kent Gibson wrote: > > Add a build option to allow the removal of the CDEV v1 ABI. > > Suggested-by: Bartosz Golaszewski > Signed-off-by: Kent Gibson > > --- > > This patch is before the V2 implementation, and is non-functional until

[PATCH v2 04/10] Documentation: devres: add missing mdio helper

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski We have a devres variant of mdiobus_register() but it's not listed in devres.rst. Add it under other mdio devm functions. Signed-off-by: Bartosz Golaszewski --- Documentation/driver-api/driver-model/devres.rst | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v2 03/10] net: devres: rename the release callback of devm_register_netdev()

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Make it an explicit counterpart to devm_register_netdev() just like we do with devm_free_netdev() for better clarity. Signed-off-by: Bartosz Golaszewski --- net/devres.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/devres.c b/net

[PATCH v2 10/10] net: ethernet: mtk-star-emac: use devm_of_mdiobus_register()

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Shrink the code by using the managed variant of of_mdiobus_register(). Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/mediatek/mtk_star_emac.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/net/ethernet/mediatek

[PATCH v2 01/10] net: ethernet: ixgbe: check the return value of ixgbe_mii_bus_init()

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski This function may fail. Check its return value and propagate the error code. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe

[PATCH v2 02/10] net: ethernet: ixgbe: don't call devm_mdiobus_free()

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski The idea behind devres is that the release callbacks are called if probe fails. As we now check the return value of ixgbe_mii_bus_init(), we can drop the call devm_mdiobus_free() in error path as the release callback will be called automatically. Signed-off-by: Bartosz

[PATCH v2 0/6] devres: provide and use devm_krealloc()

2020-06-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Regular krealloc() obviously can't work with managed memory. This series implements devm_krealloc() and adds the first user with hope that this helper will be adopted by other drivers currently using non-managed krealloc(). Some additional changes to the code modified

Re: [PATCH] mm: util: update the kerneldoc for kstrdup_const()

2020-06-28 Thread Bartosz Golaszewski
On Sun, Jun 28, 2020 at 7:37 PM Joe Perches wrote: > > On Sun, 2020-06-28 at 17:25 +0200, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > Memory allocated with kstrdup_const() must not be passed to regular > > krealloc() as it is not aware o

[PATCH] mm: util: update the kerneldoc for kstrdup_const()

2020-06-28 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Memory allocated with kstrdup_const() must not be passed to regular krealloc() as it is not aware of the possibility of the chunk residing in .rodata. Since there are no potential users of krealloc_const() at the moment, let's just update the doc to make it explicit

[PATCH 3/5] device: remove 'extern' attribute from function prototypes in device.h

2020-06-26 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Functions are declared 'extern' implicitly by the compiler. There's no reason to prepend every prototype with it. Remove the 'extern' keyword from all function declarations in linux/device.h. Signed-off-by: Bartosz Golaszewski --- include/linux/device.h | 223

[PATCH 1/5] devres: remove stray space from devm_kmalloc() definition

2020-06-26 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Use the preferred coding style for functions returning pointers. Signed-off-by: Bartosz Golaszewski --- drivers/base/devres.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/devres.c b/drivers/base/devres.c index 0bbb328bd17f

[PATCH 2/5] devres: move the size check from alloc_dr() into a separate function

2020-06-26 Thread Bartosz Golaszewski
From: Bartosz Golaszewski We will perform the same size check in devm_krealloc(). Move the relevant code into a separate helper. Signed-off-by: Bartosz Golaszewski --- drivers/base/devres.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/base

[PATCH 4/5] devres: provide devm_krealloc()

2020-06-26 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Implement the managed variant of krealloc(). This function works with all memory allocated by devm_kmalloc() (or devres functions using it implicitly like devm_kmemdup(), devm_kstrdup() etc.). Managed realloc'ed chunks can be manually released with devm_kfree

[PATCH 5/5] hwmon: pmbus: use more devres helpers

2020-06-26 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Shrink pmbus code by using devm_hwmon_device_register_with_groups() and devm_krealloc() instead of their non-managed variants. Signed-off-by: Bartosz Golaszewski --- drivers/hwmon/pmbus/pmbus_core.c | 27 +-- 1 file changed, 9 insertions

[PATCH 0/5] devres: provide and use devm_krealloc()

2020-06-26 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Regular krealloc() obviously can't work with managed memory. This series implements devm_krealloc() and adds the first user with hope that this helper will be adopted by other drivers currently using non-managed krealloc(). Some cosmetic changes to the code modified

[PATCH 4/6] net: mdio: add a forward declaration for reset_control to mdio.h

2020-06-26 Thread Bartosz Golaszewski
From: Bartosz Golaszewski This header refers to struct reset_control but doesn't include any reset header. The structure definition is probably somehow indirectly pulled in since no warnings are reported but for the sake of correctness add the forward declaration for struct reset_control

[PATCH 5/6] net: phy: reset the PHY even if probe() is not implemented

2020-06-26 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Currently we only call phy_device_reset() if the PHY driver implements the probe() callback. This is not mandatory and many drivers (e.g. realtek) don't need probe() for most devices but still can have reset GPIOs defined. There's no reason to depend on the presence

[PATCH 3/6] net: phy: arrange headers in phy_device.c alphabetically

2020-06-26 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Keeping the headers in alphabetical order is better for readability and allows to easily see if given header is already included. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli --- drivers/net/phy/phy_device.c | 28

[PATCH 0/6] net: phy: relax PHY and MDIO reset handling

2020-06-26 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Previously these patches were submitted as part of a larger series[1] but since the approach in it will have to be reworked I'm resending the ones that were non-controversial and have been reviewed for upstream. Florian suggested a better solution for managing multiple

<    4   5   6   7   8   9   10   11   12   13   >