mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* linux-next: manual merge of the gpio-brgl tree with the origin tree
@ 2026-11-09 14:44 Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-11-09 14:44 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Bartosz Golaszewski, Kees Cook, Kees Cook,
	Linux Kernel Mailing List, Linux Next Mailing List, Peng Fan

[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]

Hi all,

Today's linux-next merge of the gpio-brgl tree got a conflict in:

  drivers/gpio/gpio-mxc.c

between commit:

  4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")

from the origin tree and commit:

  569d0a6f57fc1 ("gpio: mxc: use local dev variable")

from the gpio-brgl tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc drivers/gpio/gpio-mxc.c
index 7dabe8073dc65,1fdbbc9617aa9..0000000000000
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@@ -425,7 -479,7 +479,7 @@@ static int mxc_gpio_probe(struct platfo
  	int irq_base;
  	int err;
  
- 	port = devm_kzalloc_obj(&pdev->dev, *port);
 -	port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
++	port = devm_kzalloc_obj(dev, *port);
  	if (!port)
  		return -ENOMEM;
  

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* linux-next: manual merge of the gpio-brgl tree with the origin tree
@ 2026-11-09 14:44 Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-11-09 14:44 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Bartosz Golaszewski, Francesco Valla, Kees Cook, Kees Cook,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 5110 bytes --]

Hi all,

Today's linux-next merge of the gpio-brgl tree got a conflict in:

  drivers/gpio/gpio-virtio.c

between commit:

  4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")

from the origin tree and commit:

  d5d4132419a41 ("gpio: virtio: convert to immutable irq_chip")

from the gpio-brgl tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --combined drivers/gpio/gpio-virtio.c
index d0ae3d57c6403,e2add87d76a8a..0000000000000
--- a/drivers/gpio/gpio-virtio.c
+++ b/drivers/gpio/gpio-virtio.c
@@@ -17,6 -17,7 +17,7 @@@
  #include <linux/kernel.h>
  #include <linux/module.h>
  #include <linux/mutex.h>
+ #include <linux/seq_file.h>
  #include <linux/spinlock.h>
  #include <linux/virtio_config.h>
  #include <uapi/linux/virtio_gpio.h>
@@@ -243,6 -244,8 +244,8 @@@ static void virtio_gpio_irq_enable(stru
  	struct virtio_gpio *vgpio = gpiochip_get_data(gc);
  	struct vgpio_irq_line *irq_line = &vgpio->irq_lines[d->hwirq];
  
+ 	gpiochip_enable_irq(gc, d->hwirq);
+ 
  	raw_spin_lock(&vgpio->eventq_lock);
  	irq_line->disabled = false;
  	irq_line->masked = false;
@@@ -265,6 -268,8 +268,8 @@@ static void virtio_gpio_irq_disable(str
  	raw_spin_unlock(&vgpio->eventq_lock);
  
  	irq_line->update_pending = true;
+ 
+ 	gpiochip_disable_irq(gc, d->hwirq);
  }
  
  static void virtio_gpio_irq_mask(struct irq_data *d)
@@@ -512,7 -517,7 +517,7 @@@ static const char **virtio_gpio_get_nam
  		return NULL;
  	}
  
 -	names = devm_kcalloc(dev, ngpio, sizeof(*names), GFP_KERNEL);
 +	names = devm_kzalloc_objs(dev, *names, ngpio);
  	if (!names)
  		return NULL;
  
@@@ -532,16 -537,35 +537,35 @@@
  	return names;
  }
  
+ static void virtio_gpio_irq_print_chip(struct irq_data *d, struct seq_file *p)
+ {
+ 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+ 
+ 	seq_puts(p, dev_name(gc->parent));
+ }
+ 
+ static const struct irq_chip virtio_gpio_irqchip = {
+ 	.irq_enable = virtio_gpio_irq_enable,
+ 	.irq_disable = virtio_gpio_irq_disable,
+ 	.irq_mask = virtio_gpio_irq_mask,
+ 	.irq_unmask = virtio_gpio_irq_unmask,
+ 	.irq_set_type = virtio_gpio_irq_set_type,
+ 	.irq_bus_lock = virtio_gpio_irq_bus_lock,
+ 	.irq_bus_sync_unlock = virtio_gpio_irq_bus_sync_unlock,
+ 	.irq_print_chip = virtio_gpio_irq_print_chip,
+ 	.flags = IRQCHIP_IMMUTABLE,
+ 	GPIOCHIP_IRQ_RESOURCE_HELPERS,
+ };
+ 
  static int virtio_gpio_probe(struct virtio_device *vdev)
  {
  	struct device *dev = &vdev->dev;
  	struct virtio_gpio *vgpio;
- 	struct irq_chip *gpio_irq_chip;
  	u32 gpio_names_size;
  	u16 ngpio;
  	int ret, i;
  
 -	vgpio = devm_kzalloc(dev, sizeof(*vgpio), GFP_KERNEL);
 +	vgpio = devm_kzalloc_obj(dev, *vgpio);
  	if (!vgpio)
  		return -ENOMEM;
  
@@@ -556,7 -580,7 +580,7 @@@
  		return -EINVAL;
  	}
  
 -	vgpio->lines = devm_kcalloc(dev, ngpio, sizeof(*vgpio->lines), GFP_KERNEL);
 +	vgpio->lines = devm_kzalloc_objs(dev, *vgpio->lines, ngpio);
  	if (!vgpio->lines)
  		return -ENOMEM;
  
@@@ -584,31 -608,17 +608,18 @@@
  
  	/* Interrupt support */
  	if (virtio_has_feature(vdev, VIRTIO_GPIO_F_IRQ)) {
 -		vgpio->irq_lines = devm_kcalloc(dev, ngpio, sizeof(*vgpio->irq_lines), GFP_KERNEL);
 +		vgpio->irq_lines = devm_kzalloc_objs(dev, *vgpio->irq_lines,
 +						     ngpio);
  		if (!vgpio->irq_lines)
  			return -ENOMEM;
  
- 		gpio_irq_chip = devm_kzalloc_obj(dev, *gpio_irq_chip);
- 		if (!gpio_irq_chip)
- 			return -ENOMEM;
- 
- 		gpio_irq_chip->name = dev_name(dev);
- 		gpio_irq_chip->irq_enable = virtio_gpio_irq_enable;
- 		gpio_irq_chip->irq_disable = virtio_gpio_irq_disable;
- 		gpio_irq_chip->irq_mask = virtio_gpio_irq_mask;
- 		gpio_irq_chip->irq_unmask = virtio_gpio_irq_unmask;
- 		gpio_irq_chip->irq_set_type = virtio_gpio_irq_set_type;
- 		gpio_irq_chip->irq_bus_lock = virtio_gpio_irq_bus_lock;
- 		gpio_irq_chip->irq_bus_sync_unlock = virtio_gpio_irq_bus_sync_unlock;
- 
  		/* The event comes from the outside so no parent handler */
  		vgpio->gc.irq.parent_handler	= NULL;
  		vgpio->gc.irq.num_parents	= 0;
  		vgpio->gc.irq.parents		= NULL;
  		vgpio->gc.irq.default_type	= IRQ_TYPE_NONE;
  		vgpio->gc.irq.handler		= handle_level_irq;
- 		vgpio->gc.irq.chip		= gpio_irq_chip;
+ 		gpio_irq_chip_set_chip(&vgpio->gc.irq, &virtio_gpio_irqchip);
  
  		for (i = 0; i < ngpio; i++) {
  			vgpio->irq_lines[i].type = VIRTIO_GPIO_IRQ_TYPE_NONE;
@@@ -647,8 -657,8 +658,8 @@@ static void virtio_gpio_remove(struct v
  }
  
  static const struct virtio_device_id id_table[] = {
- 	{ VIRTIO_ID_GPIO, VIRTIO_DEV_ANY_ID },
- 	{},
+ 	{ .device = VIRTIO_ID_GPIO, .vendor = VIRTIO_DEV_ANY_ID },
+ 	{ }
  };
  MODULE_DEVICE_TABLE(virtio, id_table);
  

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* linux-next: manual merge of the gpio-brgl tree with the origin tree
@ 2026-10-21 13:05 Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-10-21 13:05 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Bartosz Golaszewski, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2567 bytes --]

Hi all,

Today's linux-next merge of the gpio-brgl tree got a conflict in:

  drivers/gpio/gpiolib-kunit.c

between commit:

  851bb4a429916 ("gpio: kunit: fix GPIO device reference leak with __free()")

from the origin tree and commit:

  c3e8906112e0c ("gpio: kunit: factor out common code for waiting for device probe")

from the gpio-brgl tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc drivers/gpio/gpiolib-kunit.c
index 6a2c8b34f34bb,c5d4637ea2c58..0000000000000
--- a/drivers/gpio/gpiolib-kunit.c
+++ b/drivers/gpio/gpiolib-kunit.c
@@@ -27,9 -29,21 +29,23 @@@
  
  #define GPIO_TEST_PROVIDER_NGPIO	4
  
 +KUNIT_DEFINE_ACTION_WRAPPER(gpio_device_put_wrapper, gpio_device_put, struct gpio_device *);
 +
+ static void gpio_test_device_check_bound(struct kunit *test,
+ 					 struct device *dev, bool expected)
+ {
+ 	bool bound = false;
+ 
+ 	wait_for_device_probe();
+ 	scoped_guard(device, dev)
+ 		bound = device_is_bound(dev);
+ 
+ 	if (expected)
+ 		KUNIT_ASSERT_TRUE(test, bound);
+ 	else
+ 		KUNIT_ASSERT_FALSE(test, bound);
+ }
+ 
  /*
   * The test provider tracks per-line direction and value so that lines can be
   * driven as both inputs and outputs - this is needed to exercise input as well
@@@ -772,9 -737,7 +739,8 @@@ static void gpio_hog_assert(struct kuni
  	struct property_entry properties[2];
  	struct platform_device *pdev;
  	struct fwnode_handle *fwnode;
 +	struct gpio_device *gdev;
  	struct gpio_desc *desc;
- 	bool bound = true;
  	int ret;
  
  	fwnode = software_node_fwnode(&gpio_test_provider_swnode);
@@@ -792,12 -755,10 +758,12 @@@
  	wait_for_device_probe();
  
  	/* The hog must have configured the line with the expected direction. */
- 	gdev = gpio_device_find_by_label(GPIO_CONSUMER_NAME);
 -	struct gpio_device *gdev __free(gpio_device_put) =
 -			gpio_device_find_by_label(GPIO_TEST_PROVIDER);
++	gdev = gpio_device_find_by_label(GPIO_TEST_PROVIDER);
  	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, gdev);
  
 +	ret = kunit_add_action_or_reset(test, gpio_device_put_wrapper, gdev);
 +	KUNIT_ASSERT_EQ(test, ret, 0);
 +
  	desc = gpio_device_get_desc(gdev, offset);
  	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, desc);
  

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: linux-next: manual merge of the gpio-brgl tree with the origin tree
  2026-08-12 16:45 Mark Brown
@ 2026-08-18  7:44 ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2026-08-18  7:44 UTC (permalink / raw)
  To: Mark Brown
  Cc: Bartosz Golaszewski, Alex Tran, Bartosz Golaszewski,
	Linux Kernel Mailing List, Linux Next Mailing List

Hi Mark,

On Wed, 12 Aug 2026 at 18:59, Mark Brown <broonie@kernel.org> wrote:
> Today's linux-next merge of the gpio-brgl tree got a conflict in:
>
>   drivers/gpio/gpio-by-pinctrl.c
>
> between commit:
>
>   67ff4bf723c8b ("gpio: gpio-by-pinctrl: Apply initial value in direction output wrapper")
>
> from the origin tree and commit:
>
>   408866669ce01 ("gpio: gpio-by-pinctrl: Apply initial value in direction output wrapper")
>
> from the gpio-brgl tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Thanks for your resolution!

> --- a/drivers/gpio/gpio-by-pinctrl.c
> +++ b/drivers/gpio/gpio-by-pinctrl.c
> @@@ -54,11 -54,11 +54,11 @@@ static int pin_control_gpio_direction_o
>   {
>         int ret;
>
>  -      ret = pin_control_gpio_set(chip, offset, val);
>  +      ret = pinctrl_gpio_direction_output(chip, offset);
>         if (ret)
>                 return ret;
>
>  -      return pinctrl_gpio_direction_output(chip, offset);
>  +      return pin_control_gpio_set(chip, offset, val);
>   }
>
>   static int pin_control_gpio_probe(struct platform_device *pdev)

I think this is wrong: the origin tree has v2, while the gpio-brgl tree
has v3 of the same patch.

[v2] https://lore.kernel.org/20260724-gpio-pinctrl-output-set-val-v2-1-cad55d025636@oss.qualcomm.com/
[v3]https://lore.kernel.org/20260810-gpio-pinctrl-output-set-val-v3-1-8e35222b5c8c@oss.qualcomm.com/

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* linux-next: manual merge of the gpio-brgl tree with the origin tree
@ 2026-08-12 16:45 Mark Brown
  2026-08-18  7:44 ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2026-08-12 16:45 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Alex Tran, Bartosz Golaszewski, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

Hi all,

Today's linux-next merge of the gpio-brgl tree got a conflict in:

  drivers/gpio/gpio-by-pinctrl.c

between commit:

  67ff4bf723c8b ("gpio: gpio-by-pinctrl: Apply initial value in direction output wrapper")

from the origin tree and commit:

  408866669ce01 ("gpio: gpio-by-pinctrl: Apply initial value in direction output wrapper")

from the gpio-brgl tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --combined drivers/gpio/gpio-by-pinctrl.c
index fb8440acb31d9,f54efd635f139..0000000000000
--- a/drivers/gpio/gpio-by-pinctrl.c
+++ b/drivers/gpio/gpio-by-pinctrl.c
@@@ -54,11 -54,11 +54,11 @@@ static int pin_control_gpio_direction_o
  {
  	int ret;
  
 -	ret = pin_control_gpio_set(chip, offset, val);
 +	ret = pinctrl_gpio_direction_output(chip, offset);
  	if (ret)
  		return ret;
  
 -	return pinctrl_gpio_direction_output(chip, offset);
 +	return pin_control_gpio_set(chip, offset, val);
  }
  
  static int pin_control_gpio_probe(struct platform_device *pdev)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-09 14:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 14:44 linux-next: manual merge of the gpio-brgl tree with the origin tree Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2026-11-09 14:44 Mark Brown
2026-10-21 13:05 Mark Brown
2026-08-12 16:45 Mark Brown
2026-08-18  7:44 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®