All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the gpio tree with the kspp-gustavo tree
@ 2020-11-18  3:24 Stephen Rothwell
  2020-11-18  7:49 ` Linus Walleij
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2020-11-18  3:24 UTC (permalink / raw)
  To: Linus Walleij, Gustavo A. R. Silva
  Cc: Andy Shevchenko, Linux Kernel Mailing List, Linux Next Mailing List

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

Hi all,

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

  drivers/gpio/gpiolib-acpi.c

between commit:

  b8e0b635e6e6 ("gpio: Fix fall-through warnings for Clang")

from the kspp-gustavo tree and commit:

  1a81f19154b4 ("gpiolib: acpi: Move acpi_gpio_to_gpiod_flags() upper in the code")

from the gpio 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.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpio/gpiolib-acpi.c
index 23fa9df8241d,6cc5f91bfe2e..000000000000
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@@ -205,6 -205,67 +205,68 @@@ static void acpi_gpiochip_request_irqs(
  		acpi_gpiochip_request_irq(acpi_gpio, event);
  }
  
+ static enum gpiod_flags
+ acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio, int polarity)
+ {
+ 	/* GpioInt() implies input configuration */
+ 	if (agpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT)
+ 		return GPIOD_IN;
+ 
+ 	switch (agpio->io_restriction) {
+ 	case ACPI_IO_RESTRICT_INPUT:
+ 		return GPIOD_IN;
+ 	case ACPI_IO_RESTRICT_OUTPUT:
+ 		/*
+ 		 * ACPI GPIO resources don't contain an initial value for the
+ 		 * GPIO. Therefore we deduce that value from the pull field
+ 		 * and the polarity instead. If the pin is pulled up we assume
+ 		 * default to be high, if it is pulled down we assume default
+ 		 * to be low, otherwise we leave pin untouched. For active low
+ 		 * polarity values will be switched. See also
+ 		 * Documentation/firmware-guide/acpi/gpio-properties.rst.
+ 		 */
+ 		switch (agpio->pin_config) {
+ 		case ACPI_PIN_CONFIG_PULLUP:
+ 			return polarity == GPIO_ACTIVE_LOW ? GPIOD_OUT_LOW : GPIOD_OUT_HIGH;
+ 		case ACPI_PIN_CONFIG_PULLDOWN:
+ 			return polarity == GPIO_ACTIVE_LOW ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
+ 		default:
+ 			break;
+ 		}
++		break;
+ 	default:
+ 		break;
+ 	}
+ 
+ 	/*
+ 	 * Assume that the BIOS has configured the direction and pull
+ 	 * accordingly.
+ 	 */
+ 	return GPIOD_ASIS;
+ }
+ 
+ static struct gpio_desc *acpi_request_own_gpiod(struct gpio_chip *chip,
+ 						struct acpi_resource_gpio *agpio,
+ 						unsigned int index,
+ 						const char *label)
+ {
+ 	int polarity = GPIO_ACTIVE_HIGH;
+ 	enum gpiod_flags flags = acpi_gpio_to_gpiod_flags(agpio, polarity);
+ 	unsigned int pin = agpio->pin_table[index];
+ 	struct gpio_desc *desc;
+ 	int ret;
+ 
+ 	desc = gpiochip_request_own_desc(chip, pin, label, polarity, flags);
+ 	if (IS_ERR(desc))
+ 		return desc;
+ 
+ 	ret = gpio_set_debounce_timeout(desc, agpio->debounce_timeout);
+ 	if (ret)
+ 		gpiochip_free_own_desc(desc);
+ 
+ 	return ret ? ERR_PTR(ret) : desc;
+ }
+ 
  static bool acpi_gpio_in_ignore_list(const char *controller_in, int pin_in)
  {
  	const char *controller, *pin_str;

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

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

* Re: linux-next: manual merge of the gpio tree with the kspp-gustavo tree
  2020-11-18  3:24 linux-next: manual merge of the gpio tree with the kspp-gustavo tree Stephen Rothwell
@ 2020-11-18  7:49 ` Linus Walleij
  2020-11-18  9:29   ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2020-11-18  7:49 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Gustavo A. R. Silva, Andy Shevchenko, Linux Kernel Mailing List,
	Linux Next Mailing List

On Wed, Nov 18, 2020 at 4:24 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:

>   b8e0b635e6e6 ("gpio: Fix fall-through warnings for Clang")
>
> from the kspp-gustavo tree and commit:

Interesting I guess this is a clang tree?
Please rebase on the GPIO tree and send me + Andy this patch so we
can integrate it properly.

Yours,
Linus Walleij

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

* Re: linux-next: manual merge of the gpio tree with the kspp-gustavo tree
  2020-11-18  7:49 ` Linus Walleij
@ 2020-11-18  9:29   ` Andy Shevchenko
  2020-11-18 10:52     ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2020-11-18  9:29 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Stephen Rothwell, Gustavo A. R. Silva, Andy Shevchenko,
	Linux Kernel Mailing List, Linux Next Mailing List

On Wed, Nov 18, 2020 at 9:53 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Wed, Nov 18, 2020 at 4:24 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> >   b8e0b635e6e6 ("gpio: Fix fall-through warnings for Clang")
> >
> > from the kspp-gustavo tree and commit:

Stephen, the fix looks good to me.

> Interesting I guess this is a clang tree?
> Please rebase on the GPIO tree and send me + Andy this patch so we
> can integrate it properly.

Linus, I don't think they are rebasing their trees, so we simply may
pull their tree to yours, or they may pull your immutable branch/tag
to theirs.
In any case it's a standard procedure to solve conflicts. I think
Linus T. can do it when the second PR (whoever will be second) comes
to him.
Just mention this conflict in a PR message.

-- 
With Best Regards,
Andy Shevchenko

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

* Re: linux-next: manual merge of the gpio tree with the kspp-gustavo tree
  2020-11-18  9:29   ` Andy Shevchenko
@ 2020-11-18 10:52     ` Andy Shevchenko
  2020-11-18 11:00       ` Gustavo A. R. Silva
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2020-11-18 10:52 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Stephen Rothwell, Gustavo A. R. Silva, Andy Shevchenko,
	Linux Kernel Mailing List, Linux Next Mailing List

On Wed, Nov 18, 2020 at 11:29 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Wed, Nov 18, 2020 at 9:53 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> > On Wed, Nov 18, 2020 at 4:24 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > >   b8e0b635e6e6 ("gpio: Fix fall-through warnings for Clang")
> > >
> > > from the kspp-gustavo tree and commit:

Gustavo, one remark though. It's not okay to hide changes from
maintainers. I have checked
b8e0b635e6e6 ("gpio: Fix fall-through warnings for Clang") and found
nothing except your SoB.

Please, inform maintainers about changes you are doing in their realm(s).

-- 
With Best Regards,
Andy Shevchenko

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

* Re: linux-next: manual merge of the gpio tree with the kspp-gustavo tree
  2020-11-18 10:52     ` Andy Shevchenko
@ 2020-11-18 11:00       ` Gustavo A. R. Silva
  2020-11-18 14:15         ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Gustavo A. R. Silva @ 2020-11-18 11:00 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, Stephen Rothwell, Gustavo A. R. Silva,
	Andy Shevchenko, Linux Kernel Mailing List,
	Linux Next Mailing List

Hi Andy,

On Wed, Nov 18, 2020 at 12:52:25PM +0200, Andy Shevchenko wrote:
> On Wed, Nov 18, 2020 at 11:29 AM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Wed, Nov 18, 2020 at 9:53 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> > > On Wed, Nov 18, 2020 at 4:24 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > >
> > > >   b8e0b635e6e6 ("gpio: Fix fall-through warnings for Clang")
> > > >
> > > > from the kspp-gustavo tree and commit:
> 
> Gustavo, one remark though. It's not okay to hide changes from
> maintainers. I have checked
> b8e0b635e6e6 ("gpio: Fix fall-through warnings for Clang") and found
> nothing except your SoB.
> 
> Please, inform maintainers about changes you are doing in their realm(s).

Sorry about that. I'll remove that change from my tree. I just wanted to
test some changes in linux-next.

Thanks for the feedback.
--
Gustavo



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

* Re: linux-next: manual merge of the gpio tree with the kspp-gustavo tree
  2020-11-18 11:00       ` Gustavo A. R. Silva
@ 2020-11-18 14:15         ` Andy Shevchenko
  2020-11-18 20:38           ` Gustavo A. R. Silva
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2020-11-18 14:15 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Linus Walleij, Stephen Rothwell, Gustavo A. R. Silva,
	Linux Kernel Mailing List, Linux Next Mailing List

On Wed, Nov 18, 2020 at 05:00:57AM -0600, Gustavo A. R. Silva wrote:
> On Wed, Nov 18, 2020 at 12:52:25PM +0200, Andy Shevchenko wrote:
> > On Wed, Nov 18, 2020 at 11:29 AM Andy Shevchenko
> > <andy.shevchenko@gmail.com> wrote:
> > > On Wed, Nov 18, 2020 at 9:53 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> > > > On Wed, Nov 18, 2020 at 4:24 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > > >
> > > > >   b8e0b635e6e6 ("gpio: Fix fall-through warnings for Clang")
> > > > >
> > > > > from the kspp-gustavo tree and commit:
> > 
> > Gustavo, one remark though. It's not okay to hide changes from
> > maintainers. I have checked
> > b8e0b635e6e6 ("gpio: Fix fall-through warnings for Clang") and found
> > nothing except your SoB.
> > 
> > Please, inform maintainers about changes you are doing in their realm(s).
> 
> Sorry about that. I'll remove that change from my tree. I just wanted to
> test some changes in linux-next.
> 
> Thanks for the feedback.

No problem, thanks for taking care of this.

As Linus mentioned, please send a formal patch he will include in his tree.
(I have noticed that there are two drivers in the same change, I recommend
 to split, so should be two separated patches)

-- 
With Best Regards,
Andy Shevchenko



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

* Re: linux-next: manual merge of the gpio tree with the kspp-gustavo tree
  2020-11-18 14:15         ` Andy Shevchenko
@ 2020-11-18 20:38           ` Gustavo A. R. Silva
  0 siblings, 0 replies; 7+ messages in thread
From: Gustavo A. R. Silva @ 2020-11-18 20:38 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, Stephen Rothwell, Gustavo A. R. Silva,
	Linux Kernel Mailing List, Linux Next Mailing List

On Wed, Nov 18, 2020 at 04:15:37PM +0200, Andy Shevchenko wrote:
> No problem, thanks for taking care of this.
> 
> As Linus mentioned, please send a formal patch he will include in his tree.
> (I have noticed that there are two drivers in the same change, I recommend
>  to split, so should be two separated patches)

Sure thing. I will do so. :)

Thanks
--
Gustavo

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

end of thread, other threads:[~2020-11-18 20:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18  3:24 linux-next: manual merge of the gpio tree with the kspp-gustavo tree Stephen Rothwell
2020-11-18  7:49 ` Linus Walleij
2020-11-18  9:29   ` Andy Shevchenko
2020-11-18 10:52     ` Andy Shevchenko
2020-11-18 11:00       ` Gustavo A. R. Silva
2020-11-18 14:15         ` Andy Shevchenko
2020-11-18 20:38           ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.