Re: [RFC DO NOT MERGE] treewide: use __xchg in most obvious places

2023-01-10 Thread Andy Shevchenko
return __xchg(_chain->p_prod_elem, > + (void *)(((u8 *)p_chain->p_prod_elem) + > p_chain->elem_size)); Wondering if you still need a (void *) casting after the change. Ditto for the rest of similar cases. > } ... Btw, is it done by coccinelle? If no, why not providing the script? -- With Best Regards, Andy Shevchenko

Re: [PATCH 10/15] staging: fbtft: core: Introduce backlight_is_blank()

2023-01-09 Thread Andy Shevchenko
set_value(par->gpio.led[0], polarity); ? -- With Best Regards, Andy Shevchenko

Re: [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank()

2023-01-09 Thread Andy Shevchenko
pped - it was only used for debug. > Signed-off-by: Sam Ravnborg > Cc: Stephen Kitt > Cc: Greg Kroah-Hartman > Cc: Daniel Thompson > Cc: Andy Shevchenko > Cc: linux-fb...@vger.kernel.org Not sure why you have this (at least) explicitly mentioned as get_maintainer.pl ca

Re: [PATCH v7 3/9] drm/display: Add Type-C switch helpers

2023-01-05 Thread Andy Shevchenko
_switch(dev, sw, switch_desc, data, mux_set); if (ret) goto err_unregister_typec_switches; return 0; err_unregister_typec_switches: of_node_put(sw); drm_dp_unregister_typec_switches(switch_desc); dev_err(dev, "Failed to register mode switch: %d\n", ret); return ret; -- With Best Regards, Andy Shevchenko

Re: [PATCH v7 2/9] platform/chrome: cros_ec_typec: Purge blocking switch devlinks

2023-01-05 Thread Andy Shevchenko
->of_node) I would use if (dev_of_node(dev)), but it's up to you and maintainers. > + device_for_each_child_node(dev, fwnode) > + fw_devlink_purge_absent_suppliers(fwnode); -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 0/3] Add generic framebuffer support to EFI earlycon driver

2022-12-28 Thread Andy Shevchenko
> > behavior on EFI systems, by selecting the mapping type > > based on if the framebuffer region intersects with system RAM. If it does, > > it's > > common sense that it should be in RAM as a whole, and so the system RAM > > mapping is > > used. It was tested to be w

Re: [PATCH 18/19] linux/include: add non-atomic version of xchg

2022-12-22 Thread Andy Shevchenko
IW, Reviewed-by: Andy Shevchenko > Signed-off-by: Andrzej Hajda > --- > include/linux/non-atomic/xchg.h | 19 +++ > 1 file changed, 19 insertions(+) > create mode 100644 include/linux/non-atomic/xchg.h > > diff --git a/include/linux/non-atomic/xchg.h b/include/l

Re: [PATCH 1/5] Renaming weak prng invocations - prandom_bytes_state, prandom_u32_state

2022-12-14 Thread Andy Shevchenko
On Wed, Dec 14, 2022 at 05:53:52PM +0200, Andy Shevchenko wrote: > On Wed, Dec 14, 2022 at 04:15:49PM +0100, Eric Dumazet wrote: > > On Wed, Dec 14, 2022 at 1:34 PM Stanislaw Gruszka > > wrote: > > > On Mon, Dec 12, 2022 at 03:35:20PM +0100, Jason A. Donenfeld wro

Re: [PATCH 1/5] Renaming weak prng invocations - prandom_bytes_state, prandom_u32_state

2022-12-14 Thread Andy Shevchenko
for casual readers. P.S. I believe you applied a common sense and in some cases the renames are necessary. -- With Best Regards, Andy Shevchenko

Re: [Intel-gfx] [PATCH 1/5] linux/minmax.h: add non-atomic version of xchg

2022-12-13 Thread Andy Shevchenko
On Tue, Dec 13, 2022 at 11:09:12AM +0100, Andrzej Hajda wrote: > On 09.12.2022 19:56, Andy Shevchenko wrote: > > On Fri, Dec 09, 2022 at 04:48:39PM +0100, Andrzej Hajda wrote: ... > > > I hope there will be place for such tiny helper in kernel. > > > Quick cocci anal

Re: [PATCH 1/5] Renaming weak prng invocations - prandom_bytes_state, prandom_u32_state

2022-12-12 Thread Andy Shevchenko
; Isn't it too many "random":s encoded in the name? I would leave either "rng" or "[p]random". > rand %= (i + 1); > swap_free_obj(slab, i, rand); > } -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 00/11] pwm: Allow .get_state to fail

2022-12-11 Thread Andy Shevchenko
On Sat, Dec 10, 2022 at 11:41:54PM +0100, Uwe Kleine-König wrote: > On Sat, Dec 10, 2022 at 10:57:16PM +0200, Andy Shevchenko wrote: > > On Sat, Dec 10, 2022 at 10:18:33AM +0100, Uwe Kleine-König wrote: > > > On Fri, Dec 09, 2022 at 11:47:54PM +0200, Andy Shevchenko wrote: >

Re: [PATCH v2 00/11] pwm: Allow .get_state to fail

2022-12-10 Thread Andy Shevchenko
On Sat, Dec 10, 2022 at 10:18:33AM +0100, Uwe Kleine-König wrote: > On Fri, Dec 09, 2022 at 11:47:54PM +0200, Andy Shevchenko wrote: > > On Wed, Nov 30, 2022 at 04:21:37PM +0100, Uwe Kleine-König wrote: ... > > I'm wondering why we didn't see a compiler warning about mi

Re: [PATCH v2 00/11] pwm: Allow .get_state to fail

2022-12-09 Thread Andy Shevchenko
now see the same as if .get_state wasn't implemented at all. I'm wondering why we didn't see a compiler warning about mistyped function prototypes in some drivers. P.S. The series is good thing to do, thank you. -- With Best Regards, Andy Shevchenko

Re: [PATCH 1/5] linux/minmax.h: add non-atomic version of xchg

2022-12-09 Thread Andy Shevchenko
On Fri, Dec 09, 2022 at 08:56:28PM +0200, Andy Shevchenko wrote: > On Fri, Dec 09, 2022 at 04:48:39PM +0100, Andrzej Hajda wrote: ... > > I hope there will be place for such tiny helper in kernel. > > Quick cocci analyze shows there is probably few thousands places > > w

Re: [PATCH 1/5] linux/minmax.h: add non-atomic version of xchg

2022-12-09 Thread Andy Shevchenko
non-atomic/xchg.h, dunno. Btw, have you looked if Ingo's gigantic series have done anything to cmpxchg.h and related headers? Maybe some ideas can be taken from there? -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 1/4] i915: Move list_count() to list.h as list_count_nodes() for broader use

2022-12-08 Thread Andy Shevchenko
On Thu, Dec 08, 2022 at 02:14:54PM +0100, Greg Kroah-Hartman wrote: > On Thu, Dec 08, 2022 at 02:54:45PM +0200, Andy Shevchenko wrote: > > On Wed, Nov 30, 2022 at 03:48:35PM +0200, Andy Shevchenko wrote: > > > Some of the existing users, and definitely will be new ones, w

Re: [PATCH v5 1/4] i915: Move list_count() to list.h as list_count_nodes() for broader use

2022-12-08 Thread Andy Shevchenko
On Wed, Nov 30, 2022 at 03:48:35PM +0200, Andy Shevchenko wrote: > Some of the existing users, and definitely will be new ones, want to > count existing nodes in the list. Provide a generic API for that by > moving code from i915 to list.h. Greg, I believe this one is ready to be taken.

[PATCH v5 3/4] usb: gadget: udc: bcm63xx: Convert to use list_count_nodes()

2022-11-30 Thread Andy Shevchenko
The list API provides the list_count_nodes() to help with counting existing nodes in the list. Utilise it. Signed-off-by: Andy Shevchenko --- v5: used renamed API (LKP) v4: no change v3: no change v2: no change drivers/usb/gadget/udc/bcm63xx_udc.c | 11 +++ 1 file changed, 3 insertions

[PATCH v5 2/4] usb: gadget: hid: Convert to use list_count_nodes()

2022-11-30 Thread Andy Shevchenko
The list API provides the list_count_nodes() to help with counting existing nodes in the list. Utilise it. Signed-off-by: Andy Shevchenko --- v5: used renamed API (LKP) v4: no change v3: fixed typo in the commit message (Fabio

[PATCH v5 1/4] i915: Move list_count() to list.h as list_count_nodes() for broader use

2022-11-30 Thread Andy Shevchenko
Some of the existing users, and definitely will be new ones, want to count existing nodes in the list. Provide a generic API for that by moving code from i915 to list.h. Reviewed-by: Lucas De Marchi Acked-by: Jani Nikula Signed-off-by: Andy Shevchenko --- v5: added tag (Lucas), renamed API

[PATCH v5 4/4] xhci: Convert to use list_count_nodes()

2022-11-30 Thread Andy Shevchenko
The list API provides the list_count_nodes() to help with counting existing nodes in the list. Utilise it. Acked-by: Mathias Nyman Signed-off-by: Andy Shevchenko --- v5: used renamed API (LKP) v4: added tag (Mathias) v3: no change v2: no change drivers/usb/host/xhci-ring.c | 7 ++- 1 file

Re: [PATCH v6 2/7] platform/chrome: cros_ec_typec: Purge blocking switch devlinks

2022-11-24 Thread Andy Shevchenko
e to avoid a deadlock in switch probe (the > switch mistakenly > + * assumes the connector is a supplier). > + */ A bit too long lines... > + if (dev->of_node) Why do you need this check? > + device_for_each_child_node(dev, fwnode) > + fw_devlink_purge_absent_suppliers(fwnode); -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 7/7] drm/bridge: it6505: Register Type C mode switches

2022-11-24 Thread Andy Shevchenko
p;& port_num != dp_lanes[i] / 2) { > + dev_err(dev, "Invalid data lane numbers\n"); > + return -EINVAL; > + } As per previous patch comments. > + port_num = dp_lanes[i] / 2; > + } The above seems like tons of duplicating code that drivers need to implement. Can we shrink that burden by adding some library functions? -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 5/7] drm/bridge: anx7625: Register Type C mode switches

2022-11-24 Thread Andy Shevchenko
GFP_KERNEL); > + if (!ctx->typec_ports) > + return -ENOMEM; ... > +struct anx7625_port_data { > + bool dp_connected; You can save some bytes on some architectures if move this to be last field. > + struct typec_mux_dev *typec_mux; > + struct anx7625_data *ctx; > +}; -- With Best Regards, Andy Shevchenko

[PATCH v4 2/4] usb: gadget: hid: Convert to use list_count()

2022-11-23 Thread Andy Shevchenko
The list API now provides the list_count() to help with counting existing nodes in the list. Utilise it. Signed-off-by: Andy Shevchenko --- v4: no change v3: fixed typo in the commit message (Fabio) v2: no change drivers/usb/gadget/legacy/hid.c | 7 ++- 1 file changed, 2 insertions(+), 5

[PATCH v4 3/4] usb: gadget: udc: bcm63xx: Convert to use list_count()

2022-11-23 Thread Andy Shevchenko
The list API now provides the list_count() to help with counting existing nodes in the list. Utilise it. Signed-off-by: Andy Shevchenko --- v4: no change v3: no change v2: no change drivers/usb/gadget/udc/bcm63xx_udc.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff

[PATCH v4 1/4] i915: Move list_count() to list.h for broader use

2022-11-23 Thread Andy Shevchenko
Some of the existing users, and definitely will be new ones, want to count existing nodes in the list. Provide a generic API for that by moving code from i915 to list.h. Signed-off-by: Andy Shevchenko Acked-by: Jani Nikula --- v4: fixed prototype when converting to static inline v3: added tag

[PATCH v4 4/4] xhci: Convert to use list_count()

2022-11-23 Thread Andy Shevchenko
The list API now provides the list_count() to help with counting existing nodes in the list. Utilise it. Signed-off-by: Andy Shevchenko Acked-by: Mathias Nyman --- v4: added tag (Mathias) v3: no change v2: no change drivers/usb/host/xhci-ring.c | 7 ++- 1 file changed, 2 insertions(+), 5

Re: [PATCH v3 1/4] i915: Move list_count() to list.h for broader use

2022-11-22 Thread Andy Shevchenko
On Tue, Nov 22, 2022 at 05:35:13PM +0200, Andy Shevchenko wrote: > Some of the existing users, and definitely will be new ones, want to > count existing nodes in the list. Provide a generic API for that by > moving code from i915 to list.h. Sorry for the noise, forgot to squash one

[PATCH v3 4/4] xhci: Convert to use list_count()

2022-11-22 Thread Andy Shevchenko
The list API now provides the list_count() to help with counting existing nodes in the list. Utilise it. Signed-off-by: Andy Shevchenko --- v3: no change v2: no change drivers/usb/host/xhci-ring.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci

[PATCH v3 2/4] usb: gadget: hid: Convert to use list_count()

2022-11-22 Thread Andy Shevchenko
The list API now provides the list_count() to help with counting existing nodes in the list. Utilise it. Signed-off-by: Andy Shevchenko --- v3: fixed typo in the commit message (Fabio) v2: no change drivers/usb/gadget/legacy/hid.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions

[PATCH v3 3/4] usb: gadget: udc: bcm63xx: Convert to use list_count()

2022-11-22 Thread Andy Shevchenko
The list API now provides the list_count() to help with counting existing nodes in the list. Utilise it. Signed-off-by: Andy Shevchenko --- v3: no change v2: no change drivers/usb/gadget/udc/bcm63xx_udc.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH v3 1/4] i915: Move list_count() to list.h for broader use

2022-11-22 Thread Andy Shevchenko
Some of the existing users, and definitely will be new ones, want to count existing nodes in the list. Provide a generic API for that by moving code from i915 to list.h. Signed-off-by: Andy Shevchenko Acked-by: Jani Nikula --- v3: added tag (Jani), changed to be static inline (Mike) v2: dropped

Re: [PATCH v2 1/4] i915: Move list_count() to list.h for broader use

2022-11-22 Thread Andy Shevchenko
On Tue, Nov 15, 2022 at 05:46:28PM +0200, Jani Nikula wrote: > On Mon, 14 Nov 2022, Andy Shevchenko > wrote: > > Some of the existing users, and definitely will be new ones, want to > > count existing nodes in the list. Provide a generic API for that by > > moving

Re: [PATCH v2 2/4] usb: gadget: hid: Convert to use list_count()

2022-11-22 Thread Andy Shevchenko
On Mon, Nov 14, 2022 at 04:15:35PM -0300, Fabio Estevam wrote: > On Mon, Nov 14, 2022 at 1:22 PM Andy Shevchenko > wrote: > > > > The list API now provides the list_count() to help with counting > > existing nodes in the list. Uilise it. > > s/Uilise/Utilise Fixed

Re: [PATCH v2 1/4] i915: Move list_count() to list.h for broader use

2022-11-14 Thread Andy Shevchenko
ove. However, I'm fine with the inline. -- With Best Regards, Andy Shevchenko

[PATCH v2 3/4] usb: gadget: udc: bcm63xx: Convert to use list_count()

2022-11-14 Thread Andy Shevchenko
The list API now provides the list_count() to help with counting existing nodes in the list. Uilise it. Signed-off-by: Andy Shevchenko --- v2: no change drivers/usb/gadget/udc/bcm63xx_udc.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/usb/gadget/udc

[PATCH v2 4/4] xhci: Convert to use list_count()

2022-11-14 Thread Andy Shevchenko
The list API now provides the list_count() to help with counting existing nodes in the list. Uilise it. Signed-off-by: Andy Shevchenko --- v2: no change drivers/usb/host/xhci-ring.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers

[PATCH v2 1/4] i915: Move list_count() to list.h for broader use

2022-11-14 Thread Andy Shevchenko
Some of the existing users, and definitely will be new ones, want to count existing nodes in the list. Provide a generic API for that by moving code from i915 to list.h. Signed-off-by: Andy Shevchenko --- v2: dropped the duplicate code in i915 (LKP) drivers/gpu/drm/i915/gt/intel_engine_cs.c

[PATCH v2 2/4] usb: gadget: hid: Convert to use list_count()

2022-11-14 Thread Andy Shevchenko
The list API now provides the list_count() to help with counting existing nodes in the list. Uilise it. Signed-off-by: Andy Shevchenko --- v2: no change drivers/usb/gadget/legacy/hid.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/legacy/hid.c b

[PATCH v1 2/2] fbdev: ssd1307fb: Drop duplicate NULL checks for PWM APIs

2022-11-01 Thread Andy Shevchenko
pwm_disable() and pwm_put() are NULL-aware, no need to duplicate the check in the caller. Signed-off-by: Andy Shevchenko --- drivers/video/fbdev/ssd1307fb.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev

[PATCH v1 1/2] fbdev: ssd1307fb: Drop optional dependency

2022-11-01 Thread Andy Shevchenko
that select GPIOLIB. Fixes: a2ed00da5047 ("drivers/video: add support for the Solomon SSD1307 OLED Controller") Signed-off-by: Andy Shevchenko --- drivers/video/fbdev/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index a9

Re: [PATCH v5 00/10] Driver of Intel(R) Gaussian & Neural Accelerator

2022-10-20 Thread Andy Shevchenko
ace all those dev_dbg():s by trace events/points? -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 06/10] gna: add GNA_GEM_NEW and GNA_GEM_FREE ioctls

2022-10-20 Thread Andy Shevchenko
struct drm_gem_shmem_object base; > + > + uint32_t handle; Not u32 or __u32? Is it a subsystem requirement to have uint32_t? Or your driver, then why are you not using similar types elsewhere? > +}; -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 04/10] gna: initialize MMU

2022-10-20 Thread Andy Shevchenko
On Thu, Oct 20, 2022 at 10:00 PM Andy Shevchenko wrote: > On Thu, Oct 20, 2022 at 8:57 PM Maciej Kwapulinski > wrote: ... > > + desc_size = round_up(gna_priv->info.desc_info.desc_size, PAGE_SIZE); > > PFN_UP() ? Or PFN_ALIGN() ? -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 04/10] gna: initialize MMU

2022-10-20 Thread Andy Shevchenko
a comma at the end. Same for all similar declarations. > +}; ... > +#define INTEL_GNA_DEVICE(hwid, info) \ > + { PCI_VDEVICE(INTEL, hwid), (kernel_ulong_t)(info) } Drop this and use PCI_DEVICE_DATA() instead. -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 02/10] gna: add GNA DRM device

2022-10-20 Thread Andy Shevchenko
"20211201" Really? ... > +#include Are you sure? > +struct gna_dev_info { > + u32 hwid; > + u32 num_pagetables; > + u32 num_page_entries; > + u32 max_layer_count; > + u64 max_hw_mem; > +}; -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 01/10] gna: add PCI driver module

2022-10-20 Thread Andy Shevchenko
) += sprd/ > +obj-$(CONFIG_DRM_GNA) += gna/ Ditto. ... > +config DRM_GNA > + tristate "Intel(R) Gaussian & Neural Accelerator (Intel(R) GNA)" > + depends on X86 && PCI No compile test for the rest of possible options? -- With Best Regards, Andy Shevchenko

Re: [PATCH v2] drm: Remove drm_mode_config::fb_base

2022-10-18 Thread Andy Shevchenko
On Tue, Oct 18, 2022 at 08:26:17PM +, Zack Rusin wrote: > > On Oct 18, 2022, at 4:20 PM, Andy Shevchenko > > wrote: > > On Tue, Oct 18, 2022 at 12:11:51PM -0400, Zack Rusin wrote: > >> From: Zack Rusin > >> > >> v2: Thomas and Lauren

Re: [PATCH v2] drm: Remove drm_mode_config::fb_base

2022-10-18 Thread Andy Shevchenko
se = pci_resource_start(pdev, 0); Unused pdev. > if (ast->chip == AST2100 || > ast->chip == AST2200 || I suggest to compile with `make W=1 C=1` on your side before sending v3 and address all compiler complaints. -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 2/6] treewide: use prandom_u32_max() when possible

2022-10-08 Thread Andy Shevchenko
ULT; > >> identifier FUNC; > >> @@ > >> > >> - (FUNC()@p & (LITERAL)) > >> + prandom_u32_max(RESULT) > > > >Oh that's pretty cool. I can do the saturation check in python, since > >`value` holds the parsed result. Neat. > > It is (at least how I have it here) just the string, so YMMV. ... > >Thanks a bunch for the guidance. > > Sure thing! I was pleased to figure out how to do the python bit. I believe it can be optimized -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 1/5] treewide: use prandom_u32_max() when possible

2022-10-06 Thread Andy Shevchenko
; have a chance to flow through subsystem trees. +1 to all arguments for the splitting. I looked a bit into the code I have the interest to, but I won't spam people with not-so-important questions / comments / tags, etc. -- With Best Regards, Andy Shevchenko

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Andy Shevchenko
catch. I'll move these to patch #1. I believe coccinelle is able to handle this kind of code as well, so Kees' proposal to use it seems more plausible since it's less error prone and more flexible / powerful. -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Andy Shevchenko
again it's not more clear. Authors here are going for > a 24-bit number, and masking seems like a clear way to express that. We have some 24-bit APIs (and 48-bit) already in kernel, why not to have get_random_u24() ? -- With Best Regards, Andy Shevchenko

Re: [PATCH v9 09/10] leds: flash: mt6370: Add MediaTek MT6370 flashlight support

2022-09-21 Thread Andy Shevchenko
32000 > > > +#define MT6370_STRBTO_MAX_US 2432000 > > Hi Jingoo, > > This coding style is in accordance with Andy's opinion in this mail: > https://lore.kernel.org/linux-arm-kernel/CAHp75Vciq4M4kVrabNV9vTLLcd1vR=bme8jledaf9mkrtpc...@mail.gmail.com/ True. -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 04/11] usb: phy: tegra: switch to using devm_gpiod_get()

2022-09-06 Thread Andy Shevchenko
On Mon, Sep 05, 2022 at 03:07:48PM -0700, Guenter Roeck wrote: > On 9/5/22 12:55, Andy Shevchenko wrote: > > On Mon, Sep 5, 2022 at 10:51 PM Dmitry Torokhov > > wrote: > > > On Mon, Sep 05, 2022 at 10:41:40PM +0300, Andy Shevchenko wrote: > > > > On Mon, Sep

Re: [PATCH v1 04/11] usb: phy: tegra: switch to using devm_gpiod_get()

2022-09-05 Thread Andy Shevchenko
On Mon, Sep 5, 2022 at 10:51 PM Dmitry Torokhov wrote: > On Mon, Sep 05, 2022 at 10:41:40PM +0300, Andy Shevchenko wrote: > > On Mon, Sep 5, 2022 at 10:40 PM Dmitry Torokhov > > wrote: > > > On Mon, Sep 05, 2022 at 01:59:44PM +0300, Andy Shevchenko wrote: > > >

Re: [PATCH v1 04/11] usb: phy: tegra: switch to using devm_gpiod_get()

2022-09-05 Thread Andy Shevchenko
On Mon, Sep 5, 2022 at 10:40 PM Dmitry Torokhov wrote: > On Mon, Sep 05, 2022 at 01:59:44PM +0300, Andy Shevchenko wrote: > > On Mon, Sep 5, 2022 at 9:32 AM Dmitry Torokhov > > wrote: ... > > > - gpiod = devm_gpiod_g

Re: [PATCH v1 10/11] watchdog: bd9576_wdt: switch to using devm_fwnode_gpiod_get()

2022-09-05 Thread Andy Shevchenko
On Mon, Sep 5, 2022 at 6:13 PM Guenter Roeck wrote: > On 9/5/22 04:09, Andy Shevchenko wrote: > > On Mon, Sep 5, 2022 at 9:33 AM Dmitry Torokhov > > wrote: ... > >> + count = device_property_count_u32(dev->parent, > >> "rohm,hw-timeout-

Re: [PATCH v1 09/11] regulator: bd9576: switch to using devm_fwnode_gpiod_get()

2022-09-05 Thread Andy Shevchenko
On Mon, Sep 5, 2022 at 4:19 PM Matti Vaittinen wrote: > On 9/5/22 13:40, Andy Shevchenko wrote: > > On Mon, Sep 5, 2022 at 9:33 AM Dmitry Torokhov > > wrote: ... > >> + vout_mode = device_property_read_bool(pdev->dev.parent, > >> +

Re: [PATCH v1 00/11] Get rid of [devm_]gpiod_get_from_of_node() public APIs

2022-09-05 Thread Andy Shevchenko
I'm in favour of the series, but some comments would be good to be addressed. -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 10/11] watchdog: bd9576_wdt: switch to using devm_fwnode_gpiod_get()

2022-09-05 Thread Andy Shevchenko
- hw_margin_min = hw_margin[0]; > + if (count == 1) > + hw_margin_max = hw_margin[0]; > + > + if (count == 2) { > + hw_margin_max = hw_margin[1]; > + hw_margin_min = hw_margin[0]; > + } > } -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 04/11] usb: phy: tegra: switch to using devm_gpiod_get()

2022-09-05 Thread Andy Shevchenko
GPIO: %d\n", err); > return err; > } -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 02/11] drm/tegra: switch to using devm_fwnode_gpiod_get

2022-09-05 Thread Andy Shevchenko
handling secondary fwnodes when gpiolib is taught to handle > gpios described by swnodes. I would remove this sentence from all commit messages since it's a debatable thing and might even not happen, so the above is a pure speculation. -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 01/11] PCI: tegra: switch to using devm_fwnode_gpiod_get

2022-09-05 Thread Andy Shevchenko
On Mon, Sep 5, 2022 at 1:53 PM Pali Rohár wrote: > On Monday 05 September 2022 13:49:21 Andy Shevchenko wrote: ... > > It's not the same dev and its node in this case. There is one reset > > for _all_ ports, here is the reset on _per port_ basis. > > aardvark is singl

Re: [PATCH v1 01/11] PCI: tegra: switch to using devm_fwnode_gpiod_get

2022-09-05 Thread Andy Shevchenko
On Mon, Sep 5, 2022 at 1:49 PM Andy Shevchenko wrote: > > On Mon, Sep 5, 2022 at 10:23 AM Pali Rohár wrote: > > On Sunday 04 September 2022 23:30:53 Dmitry Torokhov wrote: > > ... > > > > - rp->reset_gpio = devm

Re: [PATCH v1 01/11] PCI: tegra: switch to using devm_fwnode_gpiod_get

2022-09-05 Thread Andy Shevchenko
eset-gpio you have used > devm_gpiod_get_optional() and here in pci-tegra.c you have used > devm_fwnode_gpiod_get()? I think that PERST# logic is same in both > drivers. It's not the same dev and its node in this case. There is one reset for _all_ ports, here is the reset on _per port_ basis. -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 06/11] PCI: aardvark: switch to using devm_gpiod_get_optional()

2022-09-05 Thread Andy Shevchenko
name(pcie->reset_gpio, "pcie1-reset"); > > + if (ret) { > > + dev_err(dev, "Failed to set reset gpio name: %d\n", ret); > > + return ret; > > } Ditto. -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 08/11] regulator: bd71815: switch to using devm_fwnode_gpiod_get()

2022-09-05 Thread Andy Shevchenko
On Mon, Sep 5, 2022 at 9:33 AM Dmitry Torokhov wrote: > > I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() > so that gpiolib can be cleaned a bit, so let's switch to the generic > fwnode property API. Special thanks for using dev_fwnode(). Reviewed-by: And

Re: [PATCH v1 09/11] regulator: bd9576: switch to using devm_fwnode_gpiod_get()

2022-09-05 Thread Andy Shevchenko
to read properties in > bd957x_probe() to the generic device property API as well. With or without below addressed, Reviewed-by: Andy Shevchenko > Signed-off-by: Dmitry Torokhov > > diff --git a/drivers/regulator/bd9576-regulator.c > b/drivers/regulator/bd9576-regulator.c > ind

Re: [PATCH v9 00/10] Add MediaTek MT6370 PMIC support

2022-08-30 Thread Andy Shevchenko
e added a macro to the for declaring the > linear_range struct simply (see patch v9-0005) and made some changes for > MT6370 drivers (see v9 section of the change log below). Your cover letter is dangling. Make sure you are using --cover-letter --thread when preparing the series. -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 00/14] Use devm helpers for regulator get and enable

2022-08-19 Thread Andy Shevchenko
ing devm_regulator_get_enable() > hwmon: adm1177: simplify using devm_regulator_get_enable() hwmon uses a different pattern for the Subject line. -- With Best Regards, Andy Shevchenko

Re: (subset) [PATCH v2 0/7] Devm helpers for regulator get and enable

2022-08-16 Thread Andy Shevchenko
s the resources in the right order. These devres helpers give > a false sense of security to driver authors and they will end up > introducing problems, the same way that devm_kzalloc() makes it > outrageously easy to crash the kernel by disconnecting a device that is > in use. -- With Best Regards, Andy Shevchenko

Re: (subset) [PATCH v2 0/7] Devm helpers for regulator get and enable

2022-08-16 Thread Andy Shevchenko
e already in trouble? -- With Best Regards, Andy Shevchenko

Re: tiny drm driver for NOKIA-5110 LCD

2022-08-09 Thread Andy Shevchenko
ource/drivers/staging/fbtft/fb_pcd8544.c [2]: https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/solomon -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 3/3] efi: earlycon: Add support for generic framebuffers and move to console subsystem

2022-08-06 Thread Andy Shevchenko
if ((x >> (7 - n)) & 1) > + memset(dst, 0xff, (info.depth / 8)); Too many parentheses. > + else > + memset(dst, 0, (info.depth / 8)); Ditto. > + dst += (info.depth / 8); Ditto. > + } > +} -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 1/3] drivers: serial: earlycon: Correct argument name

2022-08-06 Thread Andy Shevchenko
On Sat, Aug 6, 2022 at 6:37 PM Markuss Broks wrote: > > The "node" argument is actually an offset, and it's also > an "int", and not "unsigned long". Correct the of_setup_earlycon > function. Suggested-by: Greg KH? > Signed-off-by: Markuss Broks -- With Best Regards, Andy Shevchenko

Re: [PATCH v7 12/13] leds: flash: mt6370: Add MediaTek MT6370 flashlight support

2022-08-05 Thread Andy Shevchenko
o check the style * of multi-line comments like * this one. */ > +*/ -- With Best Regards, Andy Shevchenko

Re: [PATCH v7 13/13] video: backlight: mt6370: Add MediaTek MT6370 support

2022-08-05 Thread Andy Shevchenko
use different mask, shift and default > +* maxiimum brightness value. Use spell-checker for all your patches. > +*/ -- With Best Regards, Andy Shevchenko

Re: [PATCH v7 11/13] leds: rgb: mt6370: Add MediaTek MT6370 current sink type LED Indicator support

2022-08-05 Thread Andy Shevchenko
e_property_read_string(init_data->fwnode, "default-state", > + _str); > + if (!ret) { > + ret = match_string(states, ARRAY_SIZE(states), stat_str); > + if (ret < 0) > + ret = STATE_OFF; > + > + led->default_state = ret; > + } Replace this by using led_init_default_state_get(). -- With Best Regards, Andy Shevchenko

Re: [PATCH v7 10/13] power: supply: mt6370: Add MediaTek MT6370 charger driver

2022-08-05 Thread Andy Shevchenko
switching battery > charger, a USB Type-C & Power Delivery (PD) controller, dual > Flash LED current sources, a RGB LED driver, a backlight WLED driver, > a display bias driver and a general LDO for portable devices. > > Add a support for the Type-C & Power Delivery contr

Re: [PATCH v7 09/13] iio: adc: mt6370: Add MediaTek MT6370 support

2022-08-05 Thread Andy Shevchenko
cklight WLED driver, > a display bias driver and a general LDO for portable devices. > > Add a support for the Type-C & Power Delivery controller in > MediaTek MT6370 IC. Reviewed-by: Andy Shevchenko > Reviewed-by: AngeloGioacchino Del Regno > > Signed-off-by: ChiaEn Wu >

Re: [PATCH v7 08/13] usb: typec: tcpci_mt6370: Add MediaTek MT6370 tcpci driver

2022-08-05 Thread Andy Shevchenko
al > Flash LED current sources, a RGB LED driver, a backlight WLED driver, > a display bias driver and a general LDO for portable devices. > > Add a support for the Type-C & Power Delivery controller in > MediaTek MT6370 IC. Reviewed-by: Andy Shevchenko > Reviewed-b

Re: [PATCH 2/2] efi: earlycon: Add support for generic framebuffers and move to fbdev subsystem

2022-07-30 Thread Andy Shevchenko
On Sat, Jul 30, 2022 at 10:55 AM Markuss Broks wrote: > On 7/29/22 00:19, Andy Shevchenko wrote: > > On Thu, Jul 28, 2022 at 4:32 PM Markuss Broks > > wrote: ... > I suppose we could use something like: > > if (region_intersects() == REGION_INTERSECTS) Yes. ... &

Re: [PATCH 1/2] drivers: serial: earlycon: Pass device-tree node

2022-07-29 Thread Andy Shevchenko
On Fri, Jul 29, 2022 at 9:57 AM Greg Kroah-Hartman wrote: > On Thu, Jul 28, 2022 at 11:04:24PM +0200, Andy Shevchenko wrote: > > On Thu, Jul 28, 2022 at 4:41 PM Greg Kroah-Hartman > > wrote: > > > On Thu, Jul 28, 2022 at 05:28:18PM +0300, Markuss Broks wrote: ... >

Re: [PATCH v6 12/13] leds: flash: mt6370: Add MediaTek MT6370 flashlight support

2022-07-29 Thread Andy Shevchenko
On Fri, Jul 29, 2022 at 8:17 AM szuni chen wrote: > Andy Shevchenko 於 2022年7月25日 週一 下午4:51寫道: > > On Fri, Jul 22, 2022 at 12:25 PM ChiaEn Wu wrote: > > > > > > From: Alice Chen ... > > > Signed-off-by: Alice Chen > > > > This SoB chain

Re: [PATCH 2/2] efi: earlycon: Add support for generic framebuffers and move to fbdev subsystem

2022-07-28 Thread Andy Shevchenko
else > + memset(dst, 0, (info.depth / 8)); > + dst += (info.depth / 8); > + } > +} Wondering if we already have something like this in DRM/fbdev and can split into a generic helper. ... > + ret = sscanf(device->options, "%u,%u,%u", , , > ); > + if (ret != 3) > + return -ENODEV; Don't we have some standard template of this, something like XxYxD, where X, Y, and D are respective decimal numbers? -- With Best Regards, Andy Shevchenko

Re: [PATCH 2/2] efi: earlycon: Add support for generic framebuffers and move to fbdev subsystem

2022-07-28 Thread Andy Shevchenko
vers/video/fbdev/earlycon.c > > > > That should be a rename, not a delete/create, right? > > Should this change be split into two separate commits, > one for moving the file and the second for making changes? I think it's a pointer to use `git format-patch -M -C ...` when preparing patches. -- With Best Regards, Andy Shevchenko

Re: [PATCH 1/2] drivers: serial: earlycon: Pass device-tree node

2022-07-28 Thread Andy Shevchenko
nter, but what puzzles me, why it can't be declared as a such: struct device_node *node; ? > And it's not really a "node" but an "offset", right? Seems no. -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 11/13] leds: rgb: mt6370: Add MediaTek MT6370 current sink type LED Indicator support

2022-07-27 Thread Andy Shevchenko
On Wed, Jul 27, 2022 at 9:37 AM ChiaEn Wu wrote: > On Tue, Jul 26, 2022 at 8:18 PM Andy Shevchenko > wrote: > > ... > > > > Just for saving memory space. > > > Because these led_classdevs do not be used at the same time. > > > Or do you think i

Re: [PATCH v6 11/13] leds: rgb: mt6370: Add MediaTek MT6370 current sink type LED Indicator support

2022-07-26 Thread Andy Shevchenko
On Tue, Jul 26, 2022 at 1:46 PM ChiaEn Wu wrote: > On Mon, Jul 25, 2022 at 4:41 PM Andy Shevchenko > wrote: ... > > > +struct mt6370_led { > > > + union { > > > + struct led_classdev isink; > > > + struct led_clas

Re: [PATCH v6 12/13] leds: flash: mt6370: Add MediaTek MT6370 flashlight support

2022-07-26 Thread Andy Shevchenko
cription to > "For the flash to turn on/off, need to wait for 5ms/500us analog settling > time. > If any flash led is already used, then the analog is settled done, we > don't need to wait again." > is it answer the question? No. I'm talking from the Linux APIs perspective. There is a huge difference between those branches. Please, conduct research, read documentation to understand what my question is about. -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 07/13] mfd: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread Andy Shevchenko
On Mon, Jul 25, 2022 at 11:06 AM ChiaEn Wu wrote: > On Mon, Jul 25, 2022 at 4:43 PM Andy Shevchenko > wrote: ... > > > > > +#define MT6370_REG_DEV_INFO0x100 > > > > > +#define MT6370_REG_CHG_IRQ10x1C0 > > > > > +#define MT6370_R

Re: [PATCH v6 13/13] video: backlight: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread Andy Shevchenko
GPIOD_OUT_HIGH); > + if (IS_ERR(priv->enable_gpio)) > + dev_err(dev, "Failed to get 'enable' gpio\n"); What does this mean? Shouldn't be return dev_err_probe()? -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 12/13] leds: flash: mt6370: Add MediaTek MT6370 flashlight support

2022-07-25 Thread Andy Shevchenko
else if (prev && !curr) > + udelay(500); This still remains unanswered, why in the first place we allow switching, and a busy loop in the other place? -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 12/13] leds: flash: mt6370: Add MediaTek MT6370 flashlight support

2022-07-25 Thread Andy Shevchenko
if (ret) > + goto unlock; > + } > + } > + > + ret = regmap_update_bits(priv->regmap, MT6370_REG_FLEDEN, > +enable_mask, val); > + if (ret) > + goto unlock; > + > + priv->fled_torch_used = curr; > + > +unlock: > + mutex_unlock(>lock); > + return ret; > +} ... > + struct v4l2_flash_config v4l2_config = {0}; 0 is not needed. -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 07/13] mfd: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread Andy Shevchenko
On Mon, Jul 25, 2022 at 10:30 AM ChiaEn Wu wrote: > On Mon, Jul 25, 2022 at 4:00 PM Andy Shevchenko > wrote: ... > > > +#define MT6370_REG_DEV_INFO0x100 > > > +#define MT6370_REG_CHG_IRQ10x1C0 > > > +#define MT6370_REG_CHG_MASK1 0x1E0 > &g

Re: [PATCH v6 11/13] leds: rgb: mt6370: Add MediaTek MT6370 current sink type LED Indicator support

2022-07-25 Thread Andy Shevchenko
+ break; > + } > + > + mutex_unlock(>priv->lock); > + > + return ret; > +} ... > + if (!fwnode_property_read_string(init_data->fwnode, "default-state", > +_str)) { ret = fwnode_...(...); if (!ret) > + ret = match_string(states, ARRAY_SIZE(states), stat_str); > + if (ret < 0) > + ret = STATE_OFF; > + > + led->default_state = ret; > + } ... > + int i = 0, ret; unsigned int i = 0; int ret; -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 10/13] power: supply: mt6370: Add MediaTek MT6370 charger driver

2022-07-25 Thread Andy Shevchenko
dev_name(priv->dev), priv); > + Redundant blank line. > + if (ret < 0) > + return dev_err_probe(priv->dev, ret, > + "Failed to request irq %s\n", > +mt6370_chg_irqs[i].name); > + } -- With Best Regards, Andy Shevchenko

<    1   2   3   4   5   6   7   8   9   10   >