Linux GPIO subsystem development
 help / color / mirror / Atom feed
* Re: [PATCH RFC 6/7] pwm: rcar: Add gpio support to output duty zero
From: Geert Uytterhoeven @ 2019-08-08  6:49 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: Uwe Kleine-König, linus.walleij@linaro.org,
	geert+renesas@glider.be, thierry.reding@gmail.com,
	robh+dt@kernel.org, mark.rutland@arm.com,
	linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org
In-Reply-To: <TYAPR01MB45445D854C1FDBB473A89559D8D70@TYAPR01MB4544.jpnprd01.prod.outlook.com>

Hi Shimoda-san,

On Thu, Aug 8, 2019 at 5:53 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> > From: Uwe Kleine-König, Sent: Wednesday, August 7, 2019 4:03 PM
> > While at it: If there is a publicly available reference manual adding a line:
> >
> >       Reference Manual: https://...
> >
> > would be great, too.
>
> Unfortunately, the document is not public...

RZ/G1 has the same hardware block, right?
Its Hardware User's Manual is publicly available, e.g. for RZ/G1M:
https://www.renesas.com/eu/en/products/microcontrollers-microprocessors/rz/rzg/rzg1m.html#documents

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

* [PATCH v2 3/3] pinctrl: sh-pfc: Rollback to mux if requires when the gpio is freed
From: Yoshihiro Shimoda @ 2019-08-08  6:19 UTC (permalink / raw)
  To: linus.walleij, geert+renesas
  Cc: linux-gpio, linux-renesas-soc, Yoshihiro Shimoda
In-Reply-To: <1565245143-15018-1-git-send-email-yoshihiro.shimoda.uh@renesas.com>

R-Car PWM controller requires the gpio to output zero duty,
this patch allows to roll it back from gpio to mux when the gpio
is freed.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/pinctrl/sh-pfc/pinctrl.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c
index ab2aa93..c9bdca5 100644
--- a/drivers/pinctrl/sh-pfc/pinctrl.c
+++ b/drivers/pinctrl/sh-pfc/pinctrl.c
@@ -26,6 +26,7 @@
 #include "../pinconf.h"
 
 struct sh_pfc_pin_config {
+	unsigned int mux_mark;
 	bool mux_set;
 	bool gpio_enabled;
 };
@@ -353,6 +354,16 @@ static int sh_pfc_func_set_mux(struct pinctrl_dev *pctldev, unsigned selector,
 	spin_lock_irqsave(&pfc->lock, flags);
 
 	for (i = 0; i < grp->nr_pins; ++i) {
+		int idx = sh_pfc_get_pin_index(pfc, grp->pins[i]);
+		struct sh_pfc_pin_config *cfg = &pmx->configs[idx];
+
+		/*
+		 * This driver cannot manage both gpio and mux when the gpio
+		 * pin is already enabled. So, this function failed.
+		 */
+		if (cfg->gpio_enabled)
+			return -EBUSY;
+
 		ret = sh_pfc_config_mux(pfc, grp->mux[i], PINMUX_TYPE_FUNCTION);
 		if (ret < 0)
 			goto done;
@@ -364,6 +375,7 @@ static int sh_pfc_func_set_mux(struct pinctrl_dev *pctldev, unsigned selector,
 		struct sh_pfc_pin_config *cfg = &pmx->configs[idx];
 
 		cfg->mux_set = true;
+		cfg->mux_mark = grp->mux[i];
 	}
 
 done:
@@ -417,6 +429,9 @@ static void sh_pfc_gpio_disable_free(struct pinctrl_dev *pctldev,
 
 	spin_lock_irqsave(&pfc->lock, flags);
 	cfg->gpio_enabled = false;
+	/* If mux is already set, this configures it here */
+	if (cfg->mux_set)
+		sh_pfc_config_mux(pfc, cfg->mux_mark, PINMUX_TYPE_FUNCTION);
 	spin_unlock_irqrestore(&pfc->lock, flags);
 }
 
-- 
2.7.4


^ permalink raw reply related

* [PATCH v2 2/3] pinctrl: sh-pfc: remove incomplete flag "cfg->type"
From: Yoshihiro Shimoda @ 2019-08-08  6:19 UTC (permalink / raw)
  To: linus.walleij, geert+renesas
  Cc: linux-gpio, linux-renesas-soc, Yoshihiro Shimoda
In-Reply-To: <1565245143-15018-1-git-send-email-yoshihiro.shimoda.uh@renesas.com>

The old commit c58d9c1b26e3 ("sh-pfc: Implement generic pinconf
support") broke the cfg->type flag to PINMUX_TYPE_FUNCTION because
sh_pfc_pinconf_set() didn't call sh_pfc_reconfig_pin().
Now if we fix the cfg->type condition, it gets worse because:
 - Some drivers might be deferred so that .set_mux() will be called
   multiple times.
 - In such the case, the sh-pfc driver returns -EBUSY even if
   the group is the same, and then that driver fails to probe.

Since the pinctrl subsystem already has such conditions according
to @set_mux and @gpio_request_enable, this patch just remove
the incomplete flag from sh-pfc/pinctrl.c.

Fixes: c58d9c1b26e3 ("sh-pfc: Implement generic pinconf support")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/pinctrl/sh-pfc/pinctrl.c | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c
index 864da24..ab2aa93 100644
--- a/drivers/pinctrl/sh-pfc/pinctrl.c
+++ b/drivers/pinctrl/sh-pfc/pinctrl.c
@@ -26,7 +26,6 @@
 #include "../pinconf.h"
 
 struct sh_pfc_pin_config {
-	u32 type;
 	bool mux_set;
 	bool gpio_enabled;
 };
@@ -354,16 +353,6 @@ static int sh_pfc_func_set_mux(struct pinctrl_dev *pctldev, unsigned selector,
 	spin_lock_irqsave(&pfc->lock, flags);
 
 	for (i = 0; i < grp->nr_pins; ++i) {
-		int idx = sh_pfc_get_pin_index(pfc, grp->pins[i]);
-		struct sh_pfc_pin_config *cfg = &pmx->configs[idx];
-
-		if (cfg->type != PINMUX_TYPE_NONE) {
-			ret = -EBUSY;
-			goto done;
-		}
-	}
-
-	for (i = 0; i < grp->nr_pins; ++i) {
 		ret = sh_pfc_config_mux(pfc, grp->mux[i], PINMUX_TYPE_FUNCTION);
 		if (ret < 0)
 			goto done;
@@ -395,14 +384,6 @@ static int sh_pfc_gpio_request_enable(struct pinctrl_dev *pctldev,
 
 	spin_lock_irqsave(&pfc->lock, flags);
 
-	if (cfg->type != PINMUX_TYPE_NONE) {
-		dev_err(pfc->dev,
-			"Pin %u is busy, can't configure it as GPIO.\n",
-			offset);
-		ret = -EBUSY;
-		goto done;
-	}
-
 	if (!pfc->gpio) {
 		/* If GPIOs are handled externally the pin mux type need to be
 		 * set to GPIO here.
@@ -414,7 +395,6 @@ static int sh_pfc_gpio_request_enable(struct pinctrl_dev *pctldev,
 			goto done;
 	}
 
-	cfg->type = PINMUX_TYPE_GPIO;
 	cfg->gpio_enabled = true;
 
 	ret = 0;
@@ -436,7 +416,6 @@ static void sh_pfc_gpio_disable_free(struct pinctrl_dev *pctldev,
 	unsigned long flags;
 
 	spin_lock_irqsave(&pfc->lock, flags);
-	cfg->type = PINMUX_TYPE_NONE;
 	cfg->gpio_enabled = false;
 	spin_unlock_irqrestore(&pfc->lock, flags);
 }
@@ -450,7 +429,6 @@ static int sh_pfc_gpio_set_direction(struct pinctrl_dev *pctldev,
 	int new_type = input ? PINMUX_TYPE_INPUT : PINMUX_TYPE_OUTPUT;
 	int idx = sh_pfc_get_pin_index(pfc, offset);
 	const struct sh_pfc_pin *pin = &pfc->info->pins[idx];
-	struct sh_pfc_pin_config *cfg = &pmx->configs[idx];
 	unsigned long flags;
 	unsigned int dir;
 	int ret;
@@ -470,8 +448,6 @@ static int sh_pfc_gpio_set_direction(struct pinctrl_dev *pctldev,
 	if (ret < 0)
 		goto done;
 
-	cfg->type = new_type;
-
 done:
 	spin_unlock_irqrestore(&pfc->lock, flags);
 	return ret;
@@ -794,13 +770,11 @@ static int sh_pfc_map_pins(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx)
 
 	for (i = 0; i < pfc->info->nr_pins; ++i) {
 		const struct sh_pfc_pin *info = &pfc->info->pins[i];
-		struct sh_pfc_pin_config *cfg = &pmx->configs[i];
 		struct pinctrl_pin_desc *pin = &pmx->pins[i];
 
 		/* If the pin number is equal to -1 all pins are considered */
 		pin->number = info->pin != (u16)-1 ? info->pin : i;
 		pin->name = info->name;
-		cfg->type = PINMUX_TYPE_NONE;
 	}
 
 	return 0;
-- 
2.7.4


^ permalink raw reply related

* [PATCH v2 1/3] pinctrl: sh-pfc: add new flags into struct sh_pfc_pin_config
From: Yoshihiro Shimoda @ 2019-08-08  6:19 UTC (permalink / raw)
  To: linus.walleij, geert+renesas
  Cc: linux-gpio, linux-renesas-soc, Yoshihiro Shimoda
In-Reply-To: <1565245143-15018-1-git-send-email-yoshihiro.shimoda.uh@renesas.com>

To clean/modify the code up later, this patch just adds new flags
"mux_set" and "gpio_enabled" into the struct sh_pfc_pin_config.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/pinctrl/sh-pfc/pinctrl.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c
index 2824be4..864da24 100644
--- a/drivers/pinctrl/sh-pfc/pinctrl.c
+++ b/drivers/pinctrl/sh-pfc/pinctrl.c
@@ -27,6 +27,8 @@
 
 struct sh_pfc_pin_config {
 	u32 type;
+	bool mux_set;
+	bool gpio_enabled;
 };
 
 struct sh_pfc_pinctrl {
@@ -364,7 +366,15 @@ static int sh_pfc_func_set_mux(struct pinctrl_dev *pctldev, unsigned selector,
 	for (i = 0; i < grp->nr_pins; ++i) {
 		ret = sh_pfc_config_mux(pfc, grp->mux[i], PINMUX_TYPE_FUNCTION);
 		if (ret < 0)
-			break;
+			goto done;
+	}
+
+	/* All group pins are configured, mark the pins as mux_set */
+	for (i = 0; i < grp->nr_pins; ++i) {
+		int idx = sh_pfc_get_pin_index(pfc, grp->pins[i]);
+		struct sh_pfc_pin_config *cfg = &pmx->configs[idx];
+
+		cfg->mux_set = true;
 	}
 
 done:
@@ -405,6 +415,7 @@ static int sh_pfc_gpio_request_enable(struct pinctrl_dev *pctldev,
 	}
 
 	cfg->type = PINMUX_TYPE_GPIO;
+	cfg->gpio_enabled = true;
 
 	ret = 0;
 
@@ -426,6 +437,7 @@ static void sh_pfc_gpio_disable_free(struct pinctrl_dev *pctldev,
 
 	spin_lock_irqsave(&pfc->lock, flags);
 	cfg->type = PINMUX_TYPE_NONE;
+	cfg->gpio_enabled = false;
 	spin_unlock_irqrestore(&pfc->lock, flags);
 }
 
-- 
2.7.4


^ permalink raw reply related

* [PATCH v2 0/3] pinctrl: sh-pfc: Rollback to mux if requires when the gpio is freed
From: Yoshihiro Shimoda @ 2019-08-08  6:19 UTC (permalink / raw)
  To: linus.walleij, geert+renesas
  Cc: linux-gpio, linux-renesas-soc, Yoshihiro Shimoda

This patch series is based on renesas-drivers.git /
renesas-drivers-2019-07-30-v5.3-rc2 tag.

About R-Car PWM driver modification, it seems to need more time to achieve
output duty zero about suitable gpio vs pinctrl handling. But, I believe
this pinctrl patches could be applied into the mainline regardless
the R-Car PWM modification.

Changes from v1:
 - Spin-off the pinctrl patches (from 1/7 to 3/7).
 - Add Geert-san's Reviewed-by on 1/3 and 2/3.
 - Add Fixes tag on 2/3.
https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=143129

Yoshihiro Shimoda (3):
  pinctrl: sh-pfc: add new flags into struct sh_pfc_pin_config
  pinctrl: sh-pfc: remove incomplete flag "cfg->type"
  pinctrl: sh-pfc: Rollback to mux if requires when the gpio is freed

 drivers/pinctrl/sh-pfc/pinctrl.c | 45 ++++++++++++++++++++--------------------
 1 file changed, 23 insertions(+), 22 deletions(-)

-- 
2.7.4


^ permalink raw reply

* [pinctrl:for-next 3/3] drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c:2325:9: error: initialization from incompatible pointer type
From: kbuild test robot @ 2019-08-08  5:33 UTC (permalink / raw)
  To: Linus Walleij; +Cc: kbuild-all, linux-gpio

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

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git for-next
head:   b0f0e8f55fa8d8a573022573d6629a3f3fe98234
commit: b0f0e8f55fa8d8a573022573d6629a3f3fe98234 [3/3] Merge branch 'devel' into for-next
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout b0f0e8f55fa8d8a573022573d6629a3f3fe98234
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c:2325:9: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .set = aspeed_g6_sig_expr_set,
            ^~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c:2325:9: note: (near initialization for 'aspeed_g5_ops.set')
   cc1: some warnings being treated as errors

vim +2325 drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c

2eda1cdec49f8a Andrew Jeffery 2019-07-11  2323  
2eda1cdec49f8a Andrew Jeffery 2019-07-11  2324  static const struct aspeed_pinmux_ops aspeed_g5_ops = {
2eda1cdec49f8a Andrew Jeffery 2019-07-11 @2325  	.set = aspeed_g6_sig_expr_set,
2eda1cdec49f8a Andrew Jeffery 2019-07-11  2326  };
2eda1cdec49f8a Andrew Jeffery 2019-07-11  2327  

:::::: The code at line 2325 was first introduced by commit
:::::: 2eda1cdec49f8ae7878e60d1b06bd8157a95424f pinctrl: aspeed: Add AST2600 pinmux support

:::::: TO: Andrew Jeffery <andrew@aj.id.au>
:::::: CC: Linus Walleij <linus.walleij@linaro.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 71394 bytes --]

^ permalink raw reply

* Re: [RFC/RFT v3 07/14] clk: meson: g12a: add notifiers to handle cpu clock change
From: Stephen Boyd @ 2019-08-08  4:43 UTC (permalink / raw)
  To: Martin Blumenstingl, Neil Armstrong, dbasehore
  Cc: jbrunet, khilman, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-clk, linux-gpio
In-Reply-To: <CAFBinCAnKeGYkyCmEMugWuQaSxgBp4DqtHN3b0rLJY6jwOF0QA@mail.gmail.com>

Quoting Martin Blumenstingl (2019-07-02 16:28:55)
> Hi Stephen, Hi Neil,
> 
> On Mon, Jul 1, 2019 at 11:13 AM Neil Armstrong <narmstrong@baylibre.com> wrote:
> >
> > In order to implement clock switching for the CLKID_CPU_CLK and
> > CLKID_CPUB_CLK, notifiers are added on specific points of the
> > clock tree :
> >
> > cpu_clk / cpub_clk
> > |   \- cpu_clk_dyn
> > |      |  \- cpu_clk_premux0
> > |      |        |- cpu_clk_postmux0
> > |      |        |    |- cpu_clk_dyn0_div
> > |      |        |    \- xtal/fclk_div2/fclk_div3
> > |      |        \- xtal/fclk_div2/fclk_div3
> > |      \- cpu_clk_premux1
> > |            |- cpu_clk_postmux1
> > |            |    |- cpu_clk_dyn1_div
> > |            |    \- xtal/fclk_div2/fclk_div3
> > |            \- xtal/fclk_div2/fclk_div3
> > \ sys_pll / sys1_pll
> >
> > This for each cluster, a single one for G12A, two for G12B.
> >
> > Each cpu_clk_premux1 tree is marked as read-only and CLK_SET_RATE_NO_REPARENT,
> > to be used as "parking" clock in a safe clock frequency.
> it seems that this is one case where the "coordinated clocks" feature
> would come handy: [0]
> Stephen, do you know if those patches stopped in March or if there's
> still some ongoing effort to get them ready?
> 

Derek told me yesterday he wants to work on it again, but I don't know
his timeline. If Derek doesn't reply here then maybe it can be picked up
by someone else.


^ permalink raw reply

* [gpio:devel-gpio-driver-isolation 10/14] arch/arm/plat-orion/gpio.c:316:3: error: implicit declaration of function 'gpio_set_value'; did you mean 'gpiod_set_value'?
From: kbuild test robot @ 2019-08-08  4:35 UTC (permalink / raw)
  To: Linus Walleij; +Cc: kbuild-all, linux-gpio

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

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/linusw/linux-gpio.git devel-gpio-driver-isolation
head:   e1db9bf671ed01b4f9fc33bbaa57d0c493c0389f
commit: 63aeaf4945d628653770b05655b0aed90ec1ae51 [10/14] ARM: plat-orion: Include the right header
config: arm-multi_v5_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 63aeaf4945d628653770b05655b0aed90ec1ae51
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/arm/plat-orion/gpio.c: In function 'orion_gpio_led_blink_set':
>> arch/arm/plat-orion/gpio.c:316:3: error: implicit declaration of function 'gpio_set_value'; did you mean 'gpiod_set_value'? [-Werror=implicit-function-declaration]
      gpio_set_value(gpio, state);
      ^~~~~~~~~~~~~~
      gpiod_set_value
   cc1: some warnings being treated as errors

vim +316 arch/arm/plat-orion/gpio.c

ff3e660b5a881b Arnaud Patard     2012-04-18  303  
c673a2b4008103 Mika Westerberg   2014-10-31  304  int orion_gpio_led_blink_set(struct gpio_desc *desc, int state,
ff3e660b5a881b Arnaud Patard     2012-04-18  305  	unsigned long *delay_on, unsigned long *delay_off)
ff3e660b5a881b Arnaud Patard     2012-04-18  306  {
c673a2b4008103 Mika Westerberg   2014-10-31  307  	unsigned gpio = desc_to_gpio(desc);
ff3e660b5a881b Arnaud Patard     2012-04-18  308  
ff3e660b5a881b Arnaud Patard     2012-04-18  309  	if (delay_on && delay_off && !*delay_on && !*delay_off)
ff3e660b5a881b Arnaud Patard     2012-04-18  310  		*delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
ff3e660b5a881b Arnaud Patard     2012-04-18  311  
ff3e660b5a881b Arnaud Patard     2012-04-18  312  	switch (state) {
ff3e660b5a881b Arnaud Patard     2012-04-18  313  	case GPIO_LED_NO_BLINK_LOW:
ff3e660b5a881b Arnaud Patard     2012-04-18  314  	case GPIO_LED_NO_BLINK_HIGH:
ff3e660b5a881b Arnaud Patard     2012-04-18  315  		orion_gpio_set_blink(gpio, 0);
ff3e660b5a881b Arnaud Patard     2012-04-18 @316  		gpio_set_value(gpio, state);
ff3e660b5a881b Arnaud Patard     2012-04-18  317  		break;
ff3e660b5a881b Arnaud Patard     2012-04-18  318  	case GPIO_LED_BLINK:
ff3e660b5a881b Arnaud Patard     2012-04-18  319  		orion_gpio_set_blink(gpio, 1);
ff3e660b5a881b Arnaud Patard     2012-04-18  320  	}
ff3e660b5a881b Arnaud Patard     2012-04-18  321  	return 0;
ff3e660b5a881b Arnaud Patard     2012-04-18  322  }
ff3e660b5a881b Arnaud Patard     2012-04-18  323  EXPORT_SYMBOL_GPL(orion_gpio_led_blink_set);
ff3e660b5a881b Arnaud Patard     2012-04-18  324  
07332318f33da6 Lennert Buytenhek 2008-10-20  325  

:::::: The code at line 316 was first introduced by commit
:::::: ff3e660b5a881b401b2b6735aa5334f433237dcb orion/kirkwood: create a generic function for gpio led blinking

:::::: TO: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
:::::: CC: Jason Cooper <jason@lakedaemon.net>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32560 bytes --]

^ permalink raw reply

* RE: [PATCH RFC 6/7] pwm: rcar: Add gpio support to output duty zero
From: Yoshihiro Shimoda @ 2019-08-08  3:52 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linus.walleij@linaro.org, geert+renesas@glider.be,
	thierry.reding@gmail.com, robh+dt@kernel.org,
	mark.rutland@arm.com, linux-gpio@vger.kernel.org,
	linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
In-Reply-To: <20190807070326.cgkbt4kpzhqvo5a3@pengutronix.de>

Hi Uwe,

Thank you for your review!

> From: Uwe Kleine-König, Sent: Wednesday, August 7, 2019 4:03 PM
> 
> Hello,
> 
> On Mon, Jul 08, 2019 at 06:07:47PM +0900, Yoshihiro Shimoda wrote:
> > The R-Car SoCs PWM Timer cannot output duty zero. So, this patch
> > adds gpio support to output it.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > ---
> >  drivers/pwm/pwm-rcar.c | 36 ++++++++++++++++++++++++++++++++++--
> >  1 file changed, 34 insertions(+), 2 deletions(-)
> 
> I'd like to see a paragraph at the top of the driver describing the
> limitations of this driver similar to what pwm-sifive.c does.
> 
> Something like:
> 
> diff --git a/drivers/pwm/pwm-rcar.c b/drivers/pwm/pwm-rcar.c
> index 5b2b8ecc354c..b67ac84db834 100644
> --- a/drivers/pwm/pwm-rcar.c
> +++ b/drivers/pwm/pwm-rcar.c
> @@ -3,6 +3,9 @@
>   * R-Car PWM Timer driver
>   *
>   * Copyright (C) 2015 Renesas Electronics Corporation
> + *
> + * Limitations:
> + * - The hardware cannot generate a 0% duty cycle.
>   */

I'll add this.

>  #include <linux/clk.h>
> 
> While at it: If there is a publicly available reference manual adding a line:
> 
> 	Reference Manual: https://...
> 
> would be great, too.

Unfortunately, the document is not public...

> > diff --git a/drivers/pwm/pwm-rcar.c b/drivers/pwm/pwm-rcar.c
> > index c8cd43f..1c19a8b 100644
> > --- a/drivers/pwm/pwm-rcar.c
> > +++ b/drivers/pwm/pwm-rcar.c
> > @@ -7,6 +7,7 @@
> >
> >  #include <linux/clk.h>
> >  #include <linux/err.h>
> > +#include <linux/gpio/consumer.h>
> >  #include <linux/io.h>
> >  #include <linux/log2.h>
> >  #include <linux/math64.h>
> > @@ -38,6 +39,7 @@ struct rcar_pwm_chip {
> >  	struct pwm_chip chip;
> >  	void __iomem *base;
> >  	struct clk *clk;
> > +	struct gpio_desc *gpio;
> >  };
> >
> >  static inline struct rcar_pwm_chip *to_rcar_pwm_chip(struct pwm_chip *chip)
> > @@ -119,8 +121,11 @@ static int rcar_pwm_set_counter(struct rcar_pwm_chip *rp, int div, int duty_ns,
> >  	ph = tmp & RCAR_PWMCNT_PH0_MASK;
> >
> >  	/* Avoid prohibited setting */
> > -	if (cyc == 0 || ph == 0)
> > +	if (cyc == 0)
> >  		return -EINVAL;
> > +	/* Try to use GPIO to output duty zero */
> > +	if (ph == 0)
> > +		return -EAGAIN;
> 
> If there is no gpio requesting cyc=0 should still yield an error.

I'm sorry, I cannot understand this.

> >  	rcar_pwm_write(rp, cyc | ph, RCAR_PWMCNT);
> >
> > @@ -157,6 +162,28 @@ static void rcar_pwm_disable(struct rcar_pwm_chip *rp)
> >  	rcar_pwm_update(rp, RCAR_PWMCR_EN0, 0, RCAR_PWMCR);
> >  }
> >
> > +static int rcar_pwm_gpiod_get(struct rcar_pwm_chip *rp)
> > +{
> > +	if (rp->gpio)
> > +		return 0;
> > +
> > +	rp->gpio = gpiod_get(rp->chip.dev, "renesas,duty-zero", GPIOD_OUT_LOW);
> > +	if (!IS_ERR(rp->gpio))
> > +		return 0;
> > +
> > +	rp->gpio = NULL;
> > +	return -EINVAL;
> 
> Please use gpiod_get_optional() instead of open coding it.

I got it.

> Does getting the gpio automatically switch the pinmuxing?
> 
> If yes, this is IMHO a really surprising mis-feature of the gpio
> subsystem. I'd prefer to "get" the gpio at probe time and only switch
> the pinmuxing in .apply(). This makes .apply() quicker, ensures that all
> resources necessary for pwm operation are available, handles
> -EPROBE_DEFER (and maybe other errors) correctly.

The current pinctrl subsystem only has .set_mux(). I checked the pinctrl subsystem
history and the commit 2243a87d90b42eb38bc281957df3e57c712b5e56 removed the ".disable()" ops.
So, IIUC, we cannot such a handling.

> Note you're introducing a bug here because switching to gpio doesn't
> ensure that the currently running period is completed.

Umm, the hardware doesn't have such a condition so that the driver cannot manage it.
So, I'll add this into the "Limitations" too.

> > +static void rcar_pwm_gpiod_put(struct rcar_pwm_chip *rp)
> > +{
> > +	if (!rp->gpio)
> > +		return;
> > +
> > +	gpiod_put(rp->gpio);
> > +	rp->gpio = NULL;
> > +}
> > +
> >  static int rcar_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> >  			  struct pwm_state *state)
> >  {
> > @@ -171,6 +198,7 @@ static int rcar_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> >
> >  	if (!state->enabled) {
> >  		rcar_pwm_disable(rp);
> > +		rcar_pwm_gpiod_put(rp);
> 
> From the framework's POV disabling a PWM is quite similar to duty cycle
> 0. Assuming disabling the PWM completes the currently running period[1]
> it might be better and easier to disable instead of switching to gpio.
> (Further assuming that disable really yields the inactive level which is
> should and is another limitation if not.)

If we disable the hardware, the duty cycle is 100% unfortunately. So,
I think I should describe it as one of "Limitations".

> >  		return 0;
> >  	}
> >
> > @@ -187,8 +215,12 @@ static int rcar_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> >  	/* The SYNC should be set to 0 even if rcar_pwm_set_counter failed */
> >  	rcar_pwm_update(rp, RCAR_PWMCR_SYNC, 0, RCAR_PWMCR);
> >
> > -	if (!ret)
> > +	if (!ret) {
> >  		ret = rcar_pwm_enable(rp);
> > +		rcar_pwm_gpiod_put(rp);
> > +	} else if (ret == -EAGAIN) {
> > +		ret = rcar_pwm_gpiod_get(rp);
> > +	}
> >
> >  	return ret;
> >  }
> 
> Best regards
> Uwe
> 
> [1] if not, please add "Disabling doesn't complete the currently running
>     period" to the list of limitations.

Yeah, the hardware will complete the currently running period, but as I said,
the hardware doesn't have such a condition, so that the driver's .apply()
returns immediately without the completion. So, I'll add it as a Limitation.

Best regards,
Yoshihiro Shimoda

> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply

* [gpio:devel-gpio-driver-isolation 13/14] drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:133:2: error: implicit declaration of function 'irq_set_chip_and_handler'; did you mean 'acpi_scan_add_handler'?
From: kbuild test robot @ 2019-08-08  3:26 UTC (permalink / raw)
  To: Linus Walleij; +Cc: kbuild-all, linux-gpio

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

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/linusw/linux-gpio.git devel-gpio-driver-isolation
head:   e1db9bf671ed01b4f9fc33bbaa57d0c493c0389f
commit: 79f925bb1584cc0ad4af9a37cd2e6bb5ed51ab5a [13/14] gpio: Drop driver header from legacy header include
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 79f925bb1584cc0ad4af9a37cd2e6bb5ed51ab5a
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=arm64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/gpio.h:62:0,
                    from drivers/gpu//drm/msm/disp/dpu1/dpu_io_util.h:8,
                    from drivers/gpu//drm/msm/disp/dpu1/dpu_kms.h:20,
                    from drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:6:
   include/asm-generic/gpio.h: In function 'gpio_to_chip':
   include/asm-generic/gpio.h:60:9: error: implicit declaration of function 'gpiod_to_chip'; did you mean 'gpio_to_chip'? [-Werror=implicit-function-declaration]
     return gpiod_to_chip(gpio_to_desc(gpio));
            ^~~~~~~~~~~~~
            gpio_to_chip
   include/asm-generic/gpio.h:60:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return gpiod_to_chip(gpio_to_desc(gpio));
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c: In function 'dpu_mdss_irq':
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:64:30: error: implicit declaration of function 'irq_desc_get_handler_data'; did you mean 'i2c_get_adapdata'? [-Werror=implicit-function-declaration]
     struct dpu_mdss *dpu_mdss = irq_desc_get_handler_data(desc);
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
                                 i2c_get_adapdata
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:64:30: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:65:26: error: implicit declaration of function 'irq_desc_get_chip'; did you mean 'msm_dss_get_clk'? [-Werror=implicit-function-declaration]
     struct irq_chip *chip = irq_desc_get_chip(desc);
                             ^~~~~~~~~~~~~~~~~
                             msm_dss_get_clk
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:65:26: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:68:2: error: implicit declaration of function 'chained_irq_enter'; did you mean 'rcu_irq_enter'? [-Werror=implicit-function-declaration]
     chained_irq_enter(chip, desc);
     ^~~~~~~~~~~~~~~~~
     rcu_irq_enter
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:84:8: error: implicit declaration of function 'generic_handle_irq'; did you mean 'generic_read_dir'? [-Werror=implicit-function-declaration]
      rc = generic_handle_irq(mapping);
           ^~~~~~~~~~~~~~~~~~
           generic_read_dir
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:94:2: error: implicit declaration of function 'chained_irq_exit'; did you mean 'rcu_irq_exit'? [-Werror=implicit-function-declaration]
     chained_irq_exit(chip, desc);
     ^~~~~~~~~~~~~~~~
     rcu_irq_exit
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c: In function 'dpu_mdss_irq_mask':
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:99:30: error: implicit declaration of function 'irq_data_get_irq_chip_data'; did you mean 'irq_get_irqchip_state'? [-Werror=implicit-function-declaration]
     struct dpu_mdss *dpu_mdss = irq_data_get_irq_chip_data(irqd);
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                 irq_get_irqchip_state
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:99:30: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:103:16: error: dereferencing pointer to incomplete type 'struct irq_data'
     clear_bit(irqd->hwirq, &dpu_mdss->irq_controller.enabled_mask);
                   ^~
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c: In function 'dpu_mdss_irq_unmask':
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:110:30: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
     struct dpu_mdss *dpu_mdss = irq_data_get_irq_chip_data(irqd);
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c: At top level:
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:119:15: error: variable 'dpu_mdss_irq_chip' has initializer but incomplete type
    static struct irq_chip dpu_mdss_irq_chip = {
                  ^~~~~~~~
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:120:3: error: 'struct irq_chip' has no member named 'name'
     .name = "dpu_mdss",
      ^~~~
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:120:10: warning: excess elements in struct initializer
     .name = "dpu_mdss",
             ^~~~~~~~~~
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:120:10: note: (near initialization for 'dpu_mdss_irq_chip')
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:121:3: error: 'struct irq_chip' has no member named 'irq_mask'
     .irq_mask = dpu_mdss_irq_mask,
      ^~~~~~~~
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:121:14: warning: excess elements in struct initializer
     .irq_mask = dpu_mdss_irq_mask,
                 ^~~~~~~~~~~~~~~~~
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:121:14: note: (near initialization for 'dpu_mdss_irq_chip')
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:122:3: error: 'struct irq_chip' has no member named 'irq_unmask'
     .irq_unmask = dpu_mdss_irq_unmask,
      ^~~~~~~~~~
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:122:16: warning: excess elements in struct initializer
     .irq_unmask = dpu_mdss_irq_unmask,
                   ^~~~~~~~~~~~~~~~~~~
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:122:16: note: (near initialization for 'dpu_mdss_irq_chip')
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c: In function 'dpu_mdss_irqdomain_map':
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:132:2: error: implicit declaration of function 'irq_set_lockdep_class'; did you mean 'irq_set_irqchip_state'? [-Werror=implicit-function-declaration]
     irq_set_lockdep_class(irq, &dpu_mdss_lock_key, &dpu_mdss_request_key);
     ^~~~~~~~~~~~~~~~~~~~~
     irq_set_irqchip_state
>> drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:133:2: error: implicit declaration of function 'irq_set_chip_and_handler'; did you mean 'acpi_scan_add_handler'? [-Werror=implicit-function-declaration]
     irq_set_chip_and_handler(irq, &dpu_mdss_irq_chip, handle_level_irq);
     ^~~~~~~~~~~~~~~~~~~~~~~~
     acpi_scan_add_handler
>> drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:133:52: error: 'handle_level_irq' undeclared (first use in this function); did you mean 'rtc_handle_legacy_irq'?
     irq_set_chip_and_handler(irq, &dpu_mdss_irq_chip, handle_level_irq);
                                                       ^~~~~~~~~~~~~~~~
                                                       rtc_handle_legacy_irq
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:133:52: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:134:9: error: implicit declaration of function 'irq_set_chip_data'; did you mean 'i2c_set_adapdata'? [-Werror=implicit-function-declaration]
     return irq_set_chip_data(irq, dpu_mdss);
            ^~~~~~~~~~~~~~~~~
            i2c_set_adapdata
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c: In function 'dpu_mdss_destroy':
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:213:2: error: implicit declaration of function 'irq_set_chained_handler_and_data' [-Werror=implicit-function-declaration]
     irq_set_chained_handler_and_data(irq, NULL, NULL);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c: At top level:
   drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c:119:24: error: storage size of 'dpu_mdss_irq_chip' isn't known
    static struct irq_chip dpu_mdss_irq_chip = {
                           ^~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +133 drivers/gpu//drm/msm/disp/dpu1/dpu_mdss.c

25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  118  
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  119  static struct irq_chip dpu_mdss_irq_chip = {
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  120  	.name = "dpu_mdss",
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  121  	.irq_mask = dpu_mdss_irq_mask,
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 @122  	.irq_unmask = dpu_mdss_irq_unmask,
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  123  };
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  124  
070e64dc1bbc87 Stephen Boyd      2019-01-03  125  static struct lock_class_key dpu_mdss_lock_key, dpu_mdss_request_key;
070e64dc1bbc87 Stephen Boyd      2019-01-03  126  
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  127  static int dpu_mdss_irqdomain_map(struct irq_domain *domain,
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  128  		unsigned int irq, irq_hw_number_t hwirq)
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  129  {
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  130  	struct dpu_mdss *dpu_mdss = domain->host_data;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  131  
070e64dc1bbc87 Stephen Boyd      2019-01-03 @132  	irq_set_lockdep_class(irq, &dpu_mdss_lock_key, &dpu_mdss_request_key);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 @133  	irq_set_chip_and_handler(irq, &dpu_mdss_irq_chip, handle_level_irq);
070e64dc1bbc87 Stephen Boyd      2019-01-03 @134  	return irq_set_chip_data(irq, dpu_mdss);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  135  }
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27  136  

:::::: The code at line 133 was first introduced by commit
:::::: 25fdd5933e4c0f5fe2ea5cd59994f8ac5fbe90ef drm/msm: Add SDM845 DPU support

:::::: TO: Jeykumar Sankaran <jsanka@codeaurora.org>
:::::: CC: Sean Paul <seanpaul@chromium.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45532 bytes --]

^ permalink raw reply

* [gpio:devel-gpio-driver-isolation 13/14] drivers/gpu/drm/sti/sti_hdmi.c:1378:15: error: implicit declaration of function 'devm_ioremap_nocache'; did you mean 'ioremap_nocache'?
From: kbuild test robot @ 2019-08-08  3:18 UTC (permalink / raw)
  To: Linus Walleij; +Cc: kbuild-all, linux-gpio

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

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/linusw/linux-gpio.git devel-gpio-driver-isolation
head:   e1db9bf671ed01b4f9fc33bbaa57d0c493c0389f
commit: 79f925bb1584cc0ad4af9a37cd2e6bb5ed51ab5a [13/14] gpio: Drop driver header from legacy header include
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 79f925bb1584cc0ad4af9a37cd2e6bb5ed51ab5a
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   In file included from arch/arm/include/asm/gpio.h:10:0,
                    from include/linux/gpio.h:59,
                    from include/linux/of_gpio.h:16,
                    from drivers/gpu/drm/sti/sti_hdmi.c:12:
   include/asm-generic/gpio.h: In function 'gpio_to_chip':
   include/asm-generic/gpio.h:60:9: error: implicit declaration of function 'gpiod_to_chip'; did you mean 'gpio_to_chip'? [-Werror=implicit-function-declaration]
     return gpiod_to_chip(gpio_to_desc(gpio));
            ^~~~~~~~~~~~~
            gpio_to_chip
   include/asm-generic/gpio.h:60:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return gpiod_to_chip(gpio_to_desc(gpio));
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/sti/sti_hdmi.c:12:0:
   include/linux/of_gpio.h: At top level:
   include/linux/of_gpio.h:41:19: error: field 'gc' has incomplete type
     struct gpio_chip gc;
                      ^~
   In file included from include/linux/err.h:5:0,
                    from include/linux/clk.h:12,
                    from drivers/gpu/drm/sti/sti_hdmi.c:7:
   include/linux/of_gpio.h: In function 'to_of_mm_gpio_chip':
   include/linux/kernel.h:973:32: error: dereferencing pointer to incomplete type 'struct gpio_chip'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                                   ^~~~~~
   include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:973:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
     ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:973:20: note: in expansion of macro '__same_type'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                       ^~~~~~~~~~~
   include/linux/of_gpio.h:48:9: note: in expansion of macro 'container_of'
     return container_of(gc, struct of_mm_gpio_chip, gc);
            ^~~~~~~~~~~~
   drivers/gpu/drm/sti/sti_hdmi.c: In function 'sti_hdmi_probe':
>> drivers/gpu/drm/sti/sti_hdmi.c:1378:15: error: implicit declaration of function 'devm_ioremap_nocache'; did you mean 'ioremap_nocache'? [-Werror=implicit-function-declaration]
     hdmi->regs = devm_ioremap_nocache(dev, res->start, resource_size(res));
                  ^~~~~~~~~~~~~~~~~~~~
                  ioremap_nocache
>> drivers/gpu/drm/sti/sti_hdmi.c:1378:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     hdmi->regs = devm_ioremap_nocache(dev, res->start, resource_size(res));
                ^
   cc1: some warnings being treated as errors
--
   In file included from arch/arm/include/asm/gpio.h:10:0,
                    from include/linux/gpio.h:59,
                    from include/linux/of_gpio.h:16,
                    from drivers/gpu/drm/sti/sti_dvo.c:11:
   include/asm-generic/gpio.h: In function 'gpio_to_chip':
   include/asm-generic/gpio.h:60:9: error: implicit declaration of function 'gpiod_to_chip'; did you mean 'gpio_to_chip'? [-Werror=implicit-function-declaration]
     return gpiod_to_chip(gpio_to_desc(gpio));
            ^~~~~~~~~~~~~
            gpio_to_chip
   include/asm-generic/gpio.h:60:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return gpiod_to_chip(gpio_to_desc(gpio));
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/sti/sti_dvo.c:11:0:
   include/linux/of_gpio.h: At top level:
   include/linux/of_gpio.h:41:19: error: field 'gc' has incomplete type
     struct gpio_chip gc;
                      ^~
   In file included from include/linux/err.h:5:0,
                    from include/linux/clk.h:12,
                    from drivers/gpu/drm/sti/sti_dvo.c:7:
   include/linux/of_gpio.h: In function 'to_of_mm_gpio_chip':
   include/linux/kernel.h:973:32: error: dereferencing pointer to incomplete type 'struct gpio_chip'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                                   ^~~~~~
   include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:973:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
     ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:973:20: note: in expansion of macro '__same_type'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                       ^~~~~~~~~~~
   include/linux/of_gpio.h:48:9: note: in expansion of macro 'container_of'
     return container_of(gc, struct of_mm_gpio_chip, gc);
            ^~~~~~~~~~~~
   drivers/gpu/drm/sti/sti_dvo.c: In function 'sti_dvo_probe':
>> drivers/gpu/drm/sti/sti_dvo.c:538:14: error: implicit declaration of function 'devm_ioremap_nocache'; did you mean 'ioremap_nocache'? [-Werror=implicit-function-declaration]
     dvo->regs = devm_ioremap_nocache(dev, res->start,
                 ^~~~~~~~~~~~~~~~~~~~
                 ioremap_nocache
>> drivers/gpu/drm/sti/sti_dvo.c:538:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     dvo->regs = devm_ioremap_nocache(dev, res->start,
               ^
   cc1: some warnings being treated as errors

vim +1378 drivers/gpu/drm/sti/sti_hdmi.c

5402626c83a2f1 Benjamin Gaignard  2014-07-30  1345  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1346  static int sti_hdmi_probe(struct platform_device *pdev)
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1347  {
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1348  	struct device *dev = &pdev->dev;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1349  	struct sti_hdmi *hdmi;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1350  	struct device_node *np = dev->of_node;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1351  	struct resource *res;
53bdcf5f026c56 Benjamin Gaignard  2015-07-17  1352  	struct device_node *ddc;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1353  	int ret;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1354  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1355  	DRM_INFO("%s\n", __func__);
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1356  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1357  	hdmi = devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL);
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1358  	if (!hdmi)
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1359  		return -ENOMEM;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1360  
53bdcf5f026c56 Benjamin Gaignard  2015-07-17  1361  	ddc = of_parse_phandle(pdev->dev.of_node, "ddc", 0);
53bdcf5f026c56 Benjamin Gaignard  2015-07-17  1362  	if (ddc) {
4d5821a71ce9be Vladimir Zapolskiy 2015-09-21  1363  		hdmi->ddc_adapt = of_get_i2c_adapter_by_node(ddc);
53bdcf5f026c56 Benjamin Gaignard  2015-07-17  1364  		of_node_put(ddc);
4d5821a71ce9be Vladimir Zapolskiy 2015-09-21  1365  		if (!hdmi->ddc_adapt)
53bdcf5f026c56 Benjamin Gaignard  2015-07-17  1366  			return -EPROBE_DEFER;
53bdcf5f026c56 Benjamin Gaignard  2015-07-17  1367  	}
53bdcf5f026c56 Benjamin Gaignard  2015-07-17  1368  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1369  	hdmi->dev = pdev->dev;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1370  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1371  	/* Get resources */
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1372  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi-reg");
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1373  	if (!res) {
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1374  		DRM_ERROR("Invalid hdmi resource\n");
807642d731e08f Vladimir Zapolskiy 2015-09-21  1375  		ret = -ENOMEM;
807642d731e08f Vladimir Zapolskiy 2015-09-21  1376  		goto release_adapter;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1377  	}
5402626c83a2f1 Benjamin Gaignard  2014-07-30 @1378  	hdmi->regs = devm_ioremap_nocache(dev, res->start, resource_size(res));
807642d731e08f Vladimir Zapolskiy 2015-09-21  1379  	if (!hdmi->regs) {
807642d731e08f Vladimir Zapolskiy 2015-09-21  1380  		ret = -ENOMEM;
807642d731e08f Vladimir Zapolskiy 2015-09-21  1381  		goto release_adapter;
807642d731e08f Vladimir Zapolskiy 2015-09-21  1382  	}
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1383  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1384  	hdmi->phy_ops = (struct hdmi_phy_ops *)
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1385  		of_match_node(hdmi_of_match, np)->data;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1386  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1387  	/* Get clock resources */
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1388  	hdmi->clk_pix = devm_clk_get(dev, "pix");
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1389  	if (IS_ERR(hdmi->clk_pix)) {
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1390  		DRM_ERROR("Cannot get hdmi_pix clock\n");
807642d731e08f Vladimir Zapolskiy 2015-09-21  1391  		ret = PTR_ERR(hdmi->clk_pix);
807642d731e08f Vladimir Zapolskiy 2015-09-21  1392  		goto release_adapter;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1393  	}
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1394  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1395  	hdmi->clk_tmds = devm_clk_get(dev, "tmds");
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1396  	if (IS_ERR(hdmi->clk_tmds)) {
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1397  		DRM_ERROR("Cannot get hdmi_tmds clock\n");
807642d731e08f Vladimir Zapolskiy 2015-09-21  1398  		ret = PTR_ERR(hdmi->clk_tmds);
807642d731e08f Vladimir Zapolskiy 2015-09-21  1399  		goto release_adapter;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1400  	}
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1401  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1402  	hdmi->clk_phy = devm_clk_get(dev, "phy");
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1403  	if (IS_ERR(hdmi->clk_phy)) {
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1404  		DRM_ERROR("Cannot get hdmi_phy clock\n");
807642d731e08f Vladimir Zapolskiy 2015-09-21  1405  		ret = PTR_ERR(hdmi->clk_phy);
807642d731e08f Vladimir Zapolskiy 2015-09-21  1406  		goto release_adapter;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1407  	}
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1408  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1409  	hdmi->clk_audio = devm_clk_get(dev, "audio");
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1410  	if (IS_ERR(hdmi->clk_audio)) {
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1411  		DRM_ERROR("Cannot get hdmi_audio clock\n");
807642d731e08f Vladimir Zapolskiy 2015-09-21  1412  		ret = PTR_ERR(hdmi->clk_audio);
807642d731e08f Vladimir Zapolskiy 2015-09-21  1413  		goto release_adapter;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1414  	}
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1415  
765692078f08d0 Benjamin Gaignard  2014-10-09  1416  	hdmi->hpd = readl(hdmi->regs + HDMI_STA) & HDMI_STA_HOT_PLUG;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1417  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1418  	init_waitqueue_head(&hdmi->wait_event);
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1419  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1420  	hdmi->irq = platform_get_irq_byname(pdev, "irq");
c83ecfa5851f4d Arvind Yadav       2017-11-17  1421  	if (hdmi->irq < 0) {
c83ecfa5851f4d Arvind Yadav       2017-11-17  1422  		DRM_ERROR("Cannot get HDMI irq\n");
c83ecfa5851f4d Arvind Yadav       2017-11-17  1423  		ret = hdmi->irq;
c83ecfa5851f4d Arvind Yadav       2017-11-17  1424  		goto release_adapter;
c83ecfa5851f4d Arvind Yadav       2017-11-17  1425  	}
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1426  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1427  	ret = devm_request_threaded_irq(dev, hdmi->irq, hdmi_irq,
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1428  			hdmi_irq_thread, IRQF_ONESHOT, dev_name(dev), hdmi);
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1429  	if (ret) {
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1430  		DRM_ERROR("Failed to register HDMI interrupt\n");
807642d731e08f Vladimir Zapolskiy 2015-09-21  1431  		goto release_adapter;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1432  	}
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1433  
bca55958ea8758 Benjamin Gaignard  2017-01-03  1434  	hdmi->notifier = cec_notifier_get(&pdev->dev);
bca55958ea8758 Benjamin Gaignard  2017-01-03  1435  	if (!hdmi->notifier)
bca55958ea8758 Benjamin Gaignard  2017-01-03  1436  		goto release_adapter;
bca55958ea8758 Benjamin Gaignard  2017-01-03  1437  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1438  	hdmi->reset = devm_reset_control_get(dev, "hdmi");
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1439  	/* Take hdmi out of reset */
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1440  	if (!IS_ERR(hdmi->reset))
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1441  		reset_control_deassert(hdmi->reset);
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1442  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1443  	platform_set_drvdata(pdev, hdmi);
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1444  
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1445  	return component_add(&pdev->dev, &sti_hdmi_ops);
807642d731e08f Vladimir Zapolskiy 2015-09-21  1446  
807642d731e08f Vladimir Zapolskiy 2015-09-21  1447   release_adapter:
4d5821a71ce9be Vladimir Zapolskiy 2015-09-21  1448  	i2c_put_adapter(hdmi->ddc_adapt);
807642d731e08f Vladimir Zapolskiy 2015-09-21  1449  
807642d731e08f Vladimir Zapolskiy 2015-09-21  1450  	return ret;
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1451  }
5402626c83a2f1 Benjamin Gaignard  2014-07-30  1452  

:::::: The code at line 1378 was first introduced by commit
:::::: 5402626c83a2f19da14859e2bab231a53e16ee74 drm: sti: add HDMI driver

:::::: TO: Benjamin Gaignard <benjamin.gaignard@linaro.org>
:::::: CC: Benjamin Gaignard <benjamin.gaignard@linaro.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 48009 bytes --]

^ permalink raw reply

* [pinctrl:devel 16/53] drivers/pinctrl/bcm/pinctrl-bcm2835.c:995:10: error: incompatible types when assigning to type 'volatile struct SHIFTER' from type 'unsigned int'
From: kbuild test robot @ 2019-08-08  3:01 UTC (permalink / raw)
  To: Stefan Wahren; +Cc: kbuild-all, linux-gpio, Linus Walleij

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

Hi Stefan,

FYI, the error/warning still remains.

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
head:   f2ae04c45b1a9d6c61faa8a946d515f81876e703
commit: e38a9a437fb93ddafab5030165e4c6a3a5021669 [16/53] pinctrl: bcm2835: Add support for BCM2711 pull-up functionality
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout e38a9a437fb93ddafab5030165e4c6a3a5021669
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   In file included from arch/m68k/include/asm/io_mm.h:32:0,
                    from arch/m68k/include/asm/io.h:8,
                    from include/linux/io.h:13,
                    from include/linux/irq.h:20,
                    from include/linux/gpio/driver.h:7,
                    from drivers/pinctrl/bcm/pinctrl-bcm2835.c:17:
   drivers/pinctrl/bcm/pinctrl-bcm2835.c: In function 'bcm2711_pull_config_set':
>> arch/m68k/include/asm/atarihw.h:190:22: error: expected identifier or '(' before 'volatile'
    # define shifter ((*(volatile struct SHIFTER *)SHF_BAS))
                         ^
>> drivers/pinctrl/bcm/pinctrl-bcm2835.c:990:6: note: in expansion of macro 'shifter'
     u32 shifter;
         ^~~~~~~
>> arch/m68k/include/asm/atarihw.h:172:17: error: expected ')' before '(' token
    #define SHF_BAS (0xffff8200)
                    ^
>> arch/m68k/include/asm/atarihw.h:190:48: note: in expansion of macro 'SHF_BAS'
    # define shifter ((*(volatile struct SHIFTER *)SHF_BAS))
                                                   ^~~~~~~
>> drivers/pinctrl/bcm/pinctrl-bcm2835.c:990:6: note: in expansion of macro 'shifter'
     u32 shifter;
         ^~~~~~~
>> drivers/pinctrl/bcm/pinctrl-bcm2835.c:995:10: error: incompatible types when assigning to type 'volatile struct SHIFTER' from type 'unsigned int'
     shifter = PUD_2711_REG_SHIFT(pin);
             ^
>> drivers/pinctrl/bcm/pinctrl-bcm2835.c:998:27: error: invalid operands to binary << (have 'int' and 'volatile struct SHIFTER')
     value &= ~(PUD_2711_MASK << shifter);
                              ^~
>> drivers/pinctrl/bcm/pinctrl-bcm2835.c:999:16: error: invalid operands to binary << (have 'unsigned int' and 'volatile struct SHIFTER')
     value |= (arg << shifter);
                   ^~
--
   In file included from arch/m68k/include/asm/io_mm.h:32:0,
                    from arch/m68k/include/asm/io.h:8,
                    from include/linux/io.h:13,
                    from include/linux/irq.h:20,
                    from include/linux/gpio/driver.h:7,
                    from drivers/pinctrl//bcm/pinctrl-bcm2835.c:17:
   drivers/pinctrl//bcm/pinctrl-bcm2835.c: In function 'bcm2711_pull_config_set':
>> arch/m68k/include/asm/atarihw.h:190:22: error: expected identifier or '(' before 'volatile'
    # define shifter ((*(volatile struct SHIFTER *)SHF_BAS))
                         ^
   drivers/pinctrl//bcm/pinctrl-bcm2835.c:990:6: note: in expansion of macro 'shifter'
     u32 shifter;
         ^~~~~~~
>> arch/m68k/include/asm/atarihw.h:172:17: error: expected ')' before '(' token
    #define SHF_BAS (0xffff8200)
                    ^
>> arch/m68k/include/asm/atarihw.h:190:48: note: in expansion of macro 'SHF_BAS'
    # define shifter ((*(volatile struct SHIFTER *)SHF_BAS))
                                                   ^~~~~~~
   drivers/pinctrl//bcm/pinctrl-bcm2835.c:990:6: note: in expansion of macro 'shifter'
     u32 shifter;
         ^~~~~~~
   drivers/pinctrl//bcm/pinctrl-bcm2835.c:995:10: error: incompatible types when assigning to type 'volatile struct SHIFTER' from type 'unsigned int'
     shifter = PUD_2711_REG_SHIFT(pin);
             ^
   drivers/pinctrl//bcm/pinctrl-bcm2835.c:998:27: error: invalid operands to binary << (have 'int' and 'volatile struct SHIFTER')
     value &= ~(PUD_2711_MASK << shifter);
                              ^~
   drivers/pinctrl//bcm/pinctrl-bcm2835.c:999:16: error: invalid operands to binary << (have 'unsigned int' and 'volatile struct SHIFTER')
     value |= (arg << shifter);
                   ^~

vim +995 drivers/pinctrl/bcm/pinctrl-bcm2835.c

   986	
   987	static void bcm2711_pull_config_set(struct bcm2835_pinctrl *pc,
   988					    unsigned int pin, unsigned int arg)
   989	{
 > 990		u32 shifter;
   991		u32 value;
   992		u32 off;
   993	
   994		off = PUD_2711_REG_OFFSET(pin);
 > 995		shifter = PUD_2711_REG_SHIFT(pin);
   996	
   997		value = bcm2835_gpio_rd(pc, GP_GPIO_PUP_PDN_CNTRL_REG0 + (off * 4));
 > 998		value &= ~(PUD_2711_MASK << shifter);
 > 999		value |= (arg << shifter);
  1000		bcm2835_gpio_wr(pc, GP_GPIO_PUP_PDN_CNTRL_REG0 + (off * 4), value);
  1001	}
  1002	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 50912 bytes --]

^ permalink raw reply

* Re: [PATCH V6 14/21] clk: tegra210: Add suspend and resume support
From: Stephen Boyd @ 2019-08-07 21:22 UTC (permalink / raw)
  To: Dmitry Osipenko, Sowjanya Komatineni, jason, jonathanh,
	linus.walleij, marc.zyngier, mark.rutland, stefan, tglx,
	thierry.reding
  Cc: pdeschrijver, pgaikwad, linux-clk, linux-gpio, jckuo, josephl,
	talho, linux-tegra, linux-kernel, mperttunen, spatra, robh+dt,
	devicetree
In-Reply-To: <641727e6-4796-f982-3b58-4c8d666de1a2@nvidia.com>

Quoting Sowjanya Komatineni (2019-08-02 13:39:57)
> 
> On 8/2/19 10:51 AM, Stephen Boyd wrote:
> > And also add a comment to this location in the code because it's
> > non-obvious that we can't use iopoll here.
> >
> Actually added comment during function usage instead of during include 
> as iopoll.h is removed.
> 
> Will add additional comment in include section as well highlighting 
> reason for removal of iopoll.h
> 

No I wasn't saying to add a comment to the include section, just add a
comment in the place where you would have called iopoll but don't. Sorry
that it wasn't clear.


^ permalink raw reply

* [libgpiod] [PATCH 1/5] bindings: cxx: Use 'upstream' include path
From: Alexander Stein @ 2019-08-07 19:51 UTC (permalink / raw)
  To: linux-gpio; +Cc: Alexander Stein

According to https://github.com/catchorg/Catch2/issues/1202 the
regular include is 'catch2/catch.hpp'
Also CMake and pkg-config provide include paths for this include name.

Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
---
 bindings/cxx/tests/gpiod-cxx-test.cpp | 2 +-
 bindings/cxx/tests/tests-chip.cpp     | 2 +-
 bindings/cxx/tests/tests-event.cpp    | 2 +-
 bindings/cxx/tests/tests-iter.cpp     | 2 +-
 bindings/cxx/tests/tests-line.cpp     | 2 +-
 configure.ac                          | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bindings/cxx/tests/gpiod-cxx-test.cpp b/bindings/cxx/tests/gpiod-cxx-test.cpp
index fbae84f..236fd2d 100644
--- a/bindings/cxx/tests/gpiod-cxx-test.cpp
+++ b/bindings/cxx/tests/gpiod-cxx-test.cpp
@@ -6,7 +6,7 @@
  */
 
 #define CATCH_CONFIG_MAIN
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 #include <linux/version.h>
 #include <sys/utsname.h>
 #include <system_error>
diff --git a/bindings/cxx/tests/tests-chip.cpp b/bindings/cxx/tests/tests-chip.cpp
index 276b533..11c2d4c 100644
--- a/bindings/cxx/tests/tests-chip.cpp
+++ b/bindings/cxx/tests/tests-chip.cpp
@@ -5,7 +5,7 @@
  * Copyright (C) 2019 Bartosz Golaszewski <bgolaszewski@baylibre.com>
  */
 
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 #include <gpiod.hpp>
 
 #include "gpio-mockup.hpp"
diff --git a/bindings/cxx/tests/tests-event.cpp b/bindings/cxx/tests/tests-event.cpp
index f93bb72..b34347f 100644
--- a/bindings/cxx/tests/tests-event.cpp
+++ b/bindings/cxx/tests/tests-event.cpp
@@ -5,7 +5,7 @@
  * Copyright (C) 2019 Bartosz Golaszewski <bgolaszewski@baylibre.com>
  */
 
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 #include <gpiod.hpp>
 #include <map>
 #include <poll.h>
diff --git a/bindings/cxx/tests/tests-iter.cpp b/bindings/cxx/tests/tests-iter.cpp
index 1af0256..fdc2cb5 100644
--- a/bindings/cxx/tests/tests-iter.cpp
+++ b/bindings/cxx/tests/tests-iter.cpp
@@ -5,7 +5,7 @@
  * Copyright (C) 2019 Bartosz Golaszewski <bgolaszewski@baylibre.com>
  */
 
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 #include <gpiod.hpp>
 
 #include "gpio-mockup.hpp"
diff --git a/bindings/cxx/tests/tests-line.cpp b/bindings/cxx/tests/tests-line.cpp
index 2684bcb..e827e60 100644
--- a/bindings/cxx/tests/tests-line.cpp
+++ b/bindings/cxx/tests/tests-line.cpp
@@ -5,7 +5,7 @@
  * Copyright (C) 2019 Bartosz Golaszewski <bgolaszewski@baylibre.com>
  */
 
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 #include <gpiod.hpp>
 
 #include "gpio-mockup.hpp"
diff --git a/configure.ac b/configure.ac
index f72e13b..0459007 100644
--- a/configure.ac
+++ b/configure.ac
@@ -165,7 +165,7 @@ then
 	if test "x$with_tests" = xtrue
 	then
 		AC_LANG_PUSH([C++])
-		AC_CHECK_HEADERS([catch.hpp], [], [HEADER_NOT_FOUND_CXX([catch.hpp])])
+		AC_CHECK_HEADERS([catch2/catch.hpp], [], [HEADER_NOT_FOUND_CXX([catch2/catch.hpp])])
 		AC_LANG_POP([C++])
 	fi
 fi
-- 
2.22.0


^ permalink raw reply related

* [libgpiod] [PATCH 2/5] bindings: cxx: Try using pkg-config to detect catch2
From: Alexander Stein @ 2019-08-07 19:51 UTC (permalink / raw)
  To: linux-gpio; +Cc: Alexander Stein
In-Reply-To: <20190807195132.7538-1-alexander.stein@mailbox.org>

If there is no system wide package, try using a regular header as before.

Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
---
 bindings/cxx/tests/Makefile.am | 2 +-
 configure.ac                   | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/bindings/cxx/tests/Makefile.am b/bindings/cxx/tests/Makefile.am
index 155445f..d1da0d3 100644
--- a/bindings/cxx/tests/Makefile.am
+++ b/bindings/cxx/tests/Makefile.am
@@ -8,7 +8,7 @@
 
 AM_CPPFLAGS = -I$(top_srcdir)/bindings/cxx/ -I$(top_srcdir)/include
 AM_CPPFLAGS += -I$(top_srcdir)/tests/mockup/
-AM_CPPFLAGS += -Wall -Wextra -g -std=gnu++11
+AM_CPPFLAGS += -Wall -Wextra -g -std=gnu++11 $(CATCH2_CFLAGS)
 AM_LDFLAGS = -lgpiodcxx -L$(top_builddir)/bindings/cxx/
 AM_LDFLAGS += -lgpiomockup -L$(top_builddir)/tests/mockup/
 AM_LDFLAGS += -pthread
diff --git a/configure.ac b/configure.ac
index 0459007..bf364e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,9 +164,11 @@ then
 
 	if test "x$with_tests" = xtrue
 	then
-		AC_LANG_PUSH([C++])
-		AC_CHECK_HEADERS([catch2/catch.hpp], [], [HEADER_NOT_FOUND_CXX([catch2/catch.hpp])])
-		AC_LANG_POP([C++])
+		PKG_CHECK_MODULES([CATCH2], [catch2],, [
+			AC_LANG_PUSH([C++])
+			AC_CHECK_HEADERS([catch2/catch.hpp], [], [HEADER_NOT_FOUND_CXX([catch2/catch.hpp])])
+			AC_LANG_POP([C++])
+		])
 	fi
 fi
 
-- 
2.22.0


^ permalink raw reply related

* [libgpiod] [PATCH 5/5] bindings: cxx: Workaround --success run
From: Alexander Stein @ 2019-08-07 19:51 UTC (permalink / raw)
  To: linux-gpio; +Cc: Alexander Stein
In-Reply-To: <20190807195132.7538-1-alexander.stein@mailbox.org>

If run with --success, all expressions are evaluated and printed out.
But REQUIRE_FALSE(chip) tries to iterate over the chip resulting in this
backtrace:
#0  gpiod_chip_num_lines (chip=chip@entry=0x0) at ../../lib/core.c:235
#1  gpiod_line_iter_new (chip=0x0) at ../../lib/iter.c:140
#2  gpiod::(anonymous namespace)::make_line_iter (chip=0x0) at ../../../bindings/cxx/iter.cpp:29
#3  gpiod::line_iter::line_iter (this=0x7fffffffd690, owner=...) at ../../../bindings/cxx/iter.cpp:109
#4  Catch::rangeToString<gpiod::chip> (range=...) at /usr/include/catch2/catch.hpp:1959
[...]

Workaround by forcing catch2 to call gpiod::chip::operator bool().

Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
---
This actually looks like a flaw in the binding itself that the
gpiod::line_iter can't cope with an empty gpiod::chip.

 bindings/cxx/tests/tests-chip.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bindings/cxx/tests/tests-chip.cpp b/bindings/cxx/tests/tests-chip.cpp
index c9eb8e5..1c69872 100644
--- a/bindings/cxx/tests/tests-chip.cpp
+++ b/bindings/cxx/tests/tests-chip.cpp
@@ -70,7 +70,7 @@ TEST_CASE("GPIO chip can be opened with the open() method in different modes", "
 	mockup::probe_guard mockup_chips({ 8, 8, 8 });
 	::gpiod::chip chip;
 
-	REQUIRE_FALSE(chip);
+	REQUIRE_FALSE(!!chip);
 
 	SECTION("open by name")
 	{
@@ -102,7 +102,7 @@ TEST_CASE("Uninitialized GPIO chip behaves correctly", "[chip]")
 
 	SECTION("uninitialized chip is 'false'")
 	{
-		REQUIRE_FALSE(chip);
+		REQUIRE_FALSE(!!chip);
 	}
 
 	SECTION("using uninitialized chip throws logic_error")
@@ -149,7 +149,7 @@ TEST_CASE("Chip object can be reset", "[chip]")
 	::gpiod::chip chip(mockup::instance().chip_name(0));
 	REQUIRE(chip);
 	chip.reset();
-	REQUIRE_FALSE(chip);
+	REQUIRE_FALSE(!!chip);
 }
 
 TEST_CASE("Chip info can be correctly retrieved", "[chip]")
-- 
2.22.0


^ permalink raw reply related

* [libgpiod] [PATCH 3/5] bindings: cxx: Split out catch's main()
From: Alexander Stein @ 2019-08-07 19:51 UTC (permalink / raw)
  To: linux-gpio; +Cc: Alexander Stein
In-Reply-To: <20190807195132.7538-1-alexander.stein@mailbox.org>

Compiling the source using CATCH_CONFIG_MAIN to provide main() takes
several seconds, so split it out from any library testing code, so it
really needs to be built once only.

Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
---
 bindings/cxx/tests/Makefile.am             | 3 ++-
 bindings/cxx/tests/gpiod-cxx-test-main.cpp | 2 ++
 bindings/cxx/tests/gpiod-cxx-test.cpp      | 2 --
 3 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 bindings/cxx/tests/gpiod-cxx-test-main.cpp

diff --git a/bindings/cxx/tests/Makefile.am b/bindings/cxx/tests/Makefile.am
index d1da0d3..5800a23 100644
--- a/bindings/cxx/tests/Makefile.am
+++ b/bindings/cxx/tests/Makefile.am
@@ -15,7 +15,8 @@ AM_LDFLAGS += -pthread
 
 bin_PROGRAMS = gpiod-cxx-test
 
-gpiod_cxx_test_SOURCES =	gpiod-cxx-test.cpp \
+gpiod_cxx_test_SOURCES =	gpiod-cxx-test-main.cpp \
+				gpiod-cxx-test.cpp \
 				gpio-mockup.cpp \
 				gpio-mockup.hpp \
 				tests-chip.cpp \
diff --git a/bindings/cxx/tests/gpiod-cxx-test-main.cpp b/bindings/cxx/tests/gpiod-cxx-test-main.cpp
new file mode 100644
index 0000000..4ed06df
--- /dev/null
+++ b/bindings/cxx/tests/gpiod-cxx-test-main.cpp
@@ -0,0 +1,2 @@
+#define CATCH_CONFIG_MAIN
+#include <catch2/catch.hpp>
diff --git a/bindings/cxx/tests/gpiod-cxx-test.cpp b/bindings/cxx/tests/gpiod-cxx-test.cpp
index 236fd2d..e110a3c 100644
--- a/bindings/cxx/tests/gpiod-cxx-test.cpp
+++ b/bindings/cxx/tests/gpiod-cxx-test.cpp
@@ -5,8 +5,6 @@
  * Copyright (C) 2019 Bartosz Golaszewski <bgolaszewski@baylibre.com>
  */
 
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
 #include <linux/version.h>
 #include <sys/utsname.h>
 #include <system_error>
-- 
2.22.0


^ permalink raw reply related

* [libgpiod] [PATCH 4/5] bindings: cxx: Fix compile errors
From: Alexander Stein @ 2019-08-07 19:51 UTC (permalink / raw)
  To: linux-gpio; +Cc: Alexander Stein
In-Reply-To: <20190807195132.7538-1-alexander.stein@mailbox.org>

This fixes the following compile errors:
tests-event.cpp:152:3: error: cannot declare reference to
'class std::system_error&', which is not a typedef or a template type
argument
  152 |   REQUIRE_THROWS_AS(line.event_get_fd(), ::std::system_error&);

Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
---
 bindings/cxx/tests/tests-chip.cpp  |  8 ++++----
 bindings/cxx/tests/tests-event.cpp |  4 ++--
 bindings/cxx/tests/tests-line.cpp  | 16 ++++++++--------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/bindings/cxx/tests/tests-chip.cpp b/bindings/cxx/tests/tests-chip.cpp
index 11c2d4c..c9eb8e5 100644
--- a/bindings/cxx/tests/tests-chip.cpp
+++ b/bindings/cxx/tests/tests-chip.cpp
@@ -107,7 +107,7 @@ TEST_CASE("Uninitialized GPIO chip behaves correctly", "[chip]")
 
 	SECTION("using uninitialized chip throws logic_error")
 	{
-		REQUIRE_THROWS_AS(chip.name(), ::std::logic_error&);
+		REQUIRE_THROWS_AS(chip.name(), ::std::logic_error);
 	}
 }
 
@@ -139,7 +139,7 @@ TEST_CASE("GPIO chip can be opened with the open() method with implicit lookup",
 
 TEST_CASE("Trying to open a nonexistent chip throws system_error", "[chip]")
 {
-	REQUIRE_THROWS_AS(::gpiod::chip("nonexistent-chip"), ::std::system_error&);
+	REQUIRE_THROWS_AS(::gpiod::chip("nonexistent-chip"), ::std::system_error);
 }
 
 TEST_CASE("Chip object can be reset", "[chip]")
@@ -244,12 +244,12 @@ TEST_CASE("Errors occurring when retrieving lines are correctly reported", "[chi
 
 	SECTION("invalid offset (single line)")
 	{
-		REQUIRE_THROWS_AS(chip.get_line(9), ::std::out_of_range&);
+		REQUIRE_THROWS_AS(chip.get_line(9), ::std::out_of_range);
 	}
 
 	SECTION("invalid offset (multiple lines)")
 	{
-		REQUIRE_THROWS_AS(chip.get_lines({ 1, 19, 4, 7 }), ::std::out_of_range&);
+		REQUIRE_THROWS_AS(chip.get_lines({ 1, 19, 4, 7 }), ::std::out_of_range);
 	}
 
 	SECTION("line not found by name")
diff --git a/bindings/cxx/tests/tests-event.cpp b/bindings/cxx/tests/tests-event.cpp
index b34347f..b41cf7e 100644
--- a/bindings/cxx/tests/tests-event.cpp
+++ b/bindings/cxx/tests/tests-event.cpp
@@ -149,7 +149,7 @@ TEST_CASE("It's possible to retrieve the event file descriptor", "[event][line]"
 
 	SECTION("error if not requested")
 	{
-		REQUIRE_THROWS_AS(line.event_get_fd(), ::std::system_error&);
+		REQUIRE_THROWS_AS(line.event_get_fd(), ::std::system_error);
 	}
 
 	SECTION("error if requested for values")
@@ -157,7 +157,7 @@ TEST_CASE("It's possible to retrieve the event file descriptor", "[event][line]"
 		config.request_type = ::gpiod::line_request::DIRECTION_INPUT;
 
 		line.request(config);
-		REQUIRE_THROWS_AS(line.event_get_fd(), ::std::system_error&);
+		REQUIRE_THROWS_AS(line.event_get_fd(), ::std::system_error);
 	}
 }
 
diff --git a/bindings/cxx/tests/tests-line.cpp b/bindings/cxx/tests/tests-line.cpp
index e827e60..08ff1e8 100644
--- a/bindings/cxx/tests/tests-line.cpp
+++ b/bindings/cxx/tests/tests-line.cpp
@@ -122,7 +122,7 @@ TEST_CASE("Line bulk object works correctly", "[line][bulk]")
 	{
 		auto lines = chip.get_all_lines();
 
-		REQUIRE_THROWS_AS(lines.get(11), ::std::out_of_range&);
+		REQUIRE_THROWS_AS(lines.get(11), ::std::out_of_range);
 	}
 }
 
@@ -242,7 +242,7 @@ TEST_CASE("Exported line can be released", "[line]")
 	line.release();
 
 	REQUIRE_FALSE(line.is_requested());
-	REQUIRE_THROWS_AS(line.get_value(), ::std::system_error&);
+	REQUIRE_THROWS_AS(line.get_value(), ::std::system_error);
 }
 
 TEST_CASE("Uninitialized GPIO line behaves correctly", "[line]")
@@ -256,7 +256,7 @@ TEST_CASE("Uninitialized GPIO line behaves correctly", "[line]")
 
 	SECTION("using uninitialized line throws logic_error")
 	{
-		REQUIRE_THROWS_AS(line.name(), ::std::logic_error&);
+		REQUIRE_THROWS_AS(line.name(), ::std::logic_error);
 	}
 }
 
@@ -271,7 +271,7 @@ TEST_CASE("Uninitialized GPIO line_bulk behaves correctly", "[line][bulk]")
 
 	SECTION("using uninitialized line_bulk throws logic_error")
 	{
-		REQUIRE_THROWS_AS(bulk.get(0), ::std::logic_error&);
+		REQUIRE_THROWS_AS(bulk.get(0), ::std::logic_error);
 	}
 }
 
@@ -289,7 +289,7 @@ TEST_CASE("Cannot request the same line twice", "[line]")
 		auto line = chip.get_line(3);
 
 		REQUIRE_NOTHROW(line.request(config));
-		REQUIRE_THROWS_AS(line.request(config), ::std::system_error&);
+		REQUIRE_THROWS_AS(line.request(config), ::std::system_error);
 	}
 
 	SECTION("request the same line twice in line_bulk")
@@ -300,7 +300,7 @@ TEST_CASE("Cannot request the same line twice", "[line]")
 		 */
 		auto lines = chip.get_lines({ 2, 3, 4, 4 });
 
-		REQUIRE_THROWS_AS(lines.request(config), ::std::system_error&);
+		REQUIRE_THROWS_AS(lines.request(config), ::std::system_error);
 	}
 }
 
@@ -312,12 +312,12 @@ TEST_CASE("Cannot get/set values of unrequested lines", "[line]")
 
 	SECTION("get value")
 	{
-		REQUIRE_THROWS_AS(line.get_value(), ::std::system_error&);
+		REQUIRE_THROWS_AS(line.get_value(), ::std::system_error);
 	}
 
 	SECTION("set value")
 	{
-		REQUIRE_THROWS_AS(line.set_value(1), ::std::system_error&);
+		REQUIRE_THROWS_AS(line.set_value(1), ::std::system_error);
 	}
 }
 
-- 
2.22.0


^ permalink raw reply related

* linusw/for-next boot: 45 boots: 1 failed, 44 passed (gpio-v5.3-3-20-g6926e30f09db)
From: kernelci.org bot @ 2019-08-07 17:48 UTC (permalink / raw)
  To: linux-gpio, fellows

linusw/for-next boot: 45 boots: 1 failed, 44 passed (gpio-v5.3-3-20-g6926e30f09db)

Full Boot Summary: https://kernelci.org/boot/all/job/linusw/branch/for-next/kernel/gpio-v5.3-3-20-g6926e30f09db/
Full Build Summary: https://kernelci.org/build/linusw/branch/for-next/kernel/gpio-v5.3-3-20-g6926e30f09db/

Tree: linusw
Branch: for-next
Git Describe: gpio-v5.3-3-20-g6926e30f09db
Git Commit: 6926e30f09db0b77f5a3689c662d96ff85ef1a2a
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Tested: 35 unique boards, 14 SoC families, 2 builds out of 5

Boot Regressions Detected:

arm64:

    defconfig:
        gcc-8:
          apq8016-sbc:
              lab-mhart: failing since 8 days (last pass: v5.2-10813-g88785b7fa74a - first fail: v5.3-rc1-10-gd2a561ae1961)

Boot Failure Detected:

arm64:
    defconfig:
        gcc-8:
            apq8016-sbc: 1 failed lab

---
For more info write to <info@kernelci.org>

^ permalink raw reply

* linusw/for-next build: 5 builds: 0 failed, 5 passed, 13 warnings (gpio-v5.3-3-20-g6926e30f09db)
From: kernelci.org bot @ 2019-08-07 17:04 UTC (permalink / raw)
  To: linux-gpio, fellows

linusw/for-next build: 5 builds: 0 failed, 5 passed, 13 warnings (gpio-v5.3-3-20-g6926e30f09db)

Full Build Summary: https://kernelci.org/build/linusw/branch/for-next/kernel/gpio-v5.3-3-20-g6926e30f09db/

Tree: linusw
Branch: for-next
Git Describe: gpio-v5.3-3-20-g6926e30f09db
Git Commit: 6926e30f09db0b77f5a3689c662d96ff85ef1a2a
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Built: 5 unique architectures

Warnings Detected:

arc:
    nsim_hs_defconfig (gcc-8): 2 warnings

arm64:

arm:
    multi_v7_defconfig (gcc-8): 6 warnings

mips:
    32r2el_defconfig (gcc-8): 3 warnings

riscv:
    defconfig (gcc-8): 2 warnings


Warnings summary:

    7    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'

================================================================================

Detailed per-defconfig build reports:

--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-8) — PASS, 0 errors, 3 warnings, 0 section mismatches

Warnings:
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]

--------------------------------------------------------------------------------
defconfig (riscv, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches

Warnings:
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]

--------------------------------------------------------------------------------
defconfig (arm64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches

--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-8) — PASS, 0 errors, 6 warnings, 0 section mismatches

Warnings:
    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value

--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches

Warnings:
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]

---
For more info write to <info@kernelci.org>

^ permalink raw reply

* linusw/devel boot: 49 boots: 1 failed, 48 passed (v5.3-rc1-18-g40b0bcd3e0e2)
From: kernelci.org bot @ 2019-08-07 16:42 UTC (permalink / raw)
  To: linux-gpio, fellows

linusw/devel boot: 49 boots: 1 failed, 48 passed (v5.3-rc1-18-g40b0bcd3e0e2)

Full Boot Summary: https://kernelci.org/boot/all/job/linusw/branch/devel/kernel/v5.3-rc1-18-g40b0bcd3e0e2/
Full Build Summary: https://kernelci.org/build/linusw/branch/devel/kernel/v5.3-rc1-18-g40b0bcd3e0e2/

Tree: linusw
Branch: devel
Git Describe: v5.3-rc1-18-g40b0bcd3e0e2
Git Commit: 40b0bcd3e0e258cff3382717fb287f8be161a398
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Tested: 35 unique boards, 14 SoC families, 3 builds out of 6

Boot Regressions Detected:

arm64:

    defconfig:
        gcc-8:
          apq8016-sbc:
              lab-mhart: failing since 8 days (last pass: v5.2-10808-g9637d517347e - first fail: v5.3-rc1-5-ga299726da44f)

Boot Failure Detected:

arm64:
    defconfig:
        gcc-8:
            apq8016-sbc: 1 failed lab

---
For more info write to <info@kernelci.org>

^ permalink raw reply

* linusw/fixes boot: 49 boots: 1 failed, 46 passed with 2 untried/unknown (gpio-v5.3-3-1-g29c778ca612b)
From: kernelci.org bot @ 2019-08-07 16:17 UTC (permalink / raw)
  To: linux-gpio, fellows

linusw/fixes boot: 49 boots: 1 failed, 46 passed with 2 untried/unknown (gpio-v5.3-3-1-g29c778ca612b)

Full Boot Summary: https://kernelci.org/boot/all/job/linusw/branch/fixes/kernel/gpio-v5.3-3-1-g29c778ca612b/
Full Build Summary: https://kernelci.org/build/linusw/branch/fixes/kernel/gpio-v5.3-3-1-g29c778ca612b/

Tree: linusw
Branch: fixes
Git Describe: gpio-v5.3-3-1-g29c778ca612b
Git Commit: 29c778ca612b3462529fdf3f094843dbf4778c27
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Tested: 35 unique boards, 14 SoC families, 3 builds out of 6

Boot Regressions Detected:

arm64:

    defconfig:
        gcc-8:
          apq8016-sbc:
              lab-mhart: failing since 8 days (last pass: v5.2-10813-g88785b7fa74a - first fail: v5.3-rc1-4-gd95da993383c)
          sun50i-h5-libretech-all-h3-cc:
              lab-baylibre: new failure (last pass: v5.3-rc1-4-gd95da993383c)

Boot Failure Detected:

arm64:
    defconfig:
        gcc-8:
            apq8016-sbc: 1 failed lab

---
For more info write to <info@kernelci.org>

^ permalink raw reply

* linusw/devel build: 6 builds: 0 failed, 6 passed, 13 warnings (v5.3-rc1-18-g40b0bcd3e0e2)
From: kernelci.org bot @ 2019-08-07 15:57 UTC (permalink / raw)
  To: linux-gpio, fellows

linusw/devel build: 6 builds: 0 failed, 6 passed, 13 warnings (v5.3-rc1-18-g40b0bcd3e0e2)

Full Build Summary: https://kernelci.org/build/linusw/branch/devel/kernel/v5.3-rc1-18-g40b0bcd3e0e2/

Tree: linusw
Branch: devel
Git Describe: v5.3-rc1-18-g40b0bcd3e0e2
Git Commit: 40b0bcd3e0e258cff3382717fb287f8be161a398
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Built: 6 unique architectures

Warnings Detected:

arc:
    nsim_hs_defconfig (gcc-8): 2 warnings

arm64:

arm:
    multi_v7_defconfig (gcc-8): 6 warnings

mips:
    32r2el_defconfig (gcc-8): 3 warnings

riscv:
    defconfig (gcc-8): 2 warnings

x86_64:


Warnings summary:

    7    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'

================================================================================

Detailed per-defconfig build reports:

--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-8) — PASS, 0 errors, 3 warnings, 0 section mismatches

Warnings:
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]

--------------------------------------------------------------------------------
defconfig (riscv, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches

Warnings:
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]

--------------------------------------------------------------------------------
defconfig (arm64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches

--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-8) — PASS, 0 errors, 6 warnings, 0 section mismatches

Warnings:
    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value

--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches

Warnings:
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]

--------------------------------------------------------------------------------
x86_64_defconfig (x86_64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches

---
For more info write to <info@kernelci.org>

^ permalink raw reply

* linusw/fixes build: 6 builds: 0 failed, 6 passed, 13 warnings (gpio-v5.3-3-1-g29c778ca612b)
From: kernelci.org bot @ 2019-08-07 15:33 UTC (permalink / raw)
  To: linux-gpio, fellows

linusw/fixes build: 6 builds: 0 failed, 6 passed, 13 warnings (gpio-v5.3-3-1-g29c778ca612b)

Full Build Summary: https://kernelci.org/build/linusw/branch/fixes/kernel/gpio-v5.3-3-1-g29c778ca612b/

Tree: linusw
Branch: fixes
Git Describe: gpio-v5.3-3-1-g29c778ca612b
Git Commit: 29c778ca612b3462529fdf3f094843dbf4778c27
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/
Built: 6 unique architectures

Warnings Detected:

arc:
    nsim_hs_defconfig (gcc-8): 2 warnings

arm64:

arm:
    multi_v7_defconfig (gcc-8): 6 warnings

mips:
    32r2el_defconfig (gcc-8): 3 warnings

riscv:
    defconfig (gcc-8): 2 warnings

x86_64:


Warnings summary:

    7    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
    1    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'

================================================================================

Detailed per-defconfig build reports:

--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-8) — PASS, 0 errors, 3 warnings, 0 section mismatches

Warnings:
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]

--------------------------------------------------------------------------------
defconfig (riscv, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches

Warnings:
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]

--------------------------------------------------------------------------------
defconfig (arm64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches

--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-8) — PASS, 0 errors, 6 warnings, 0 section mismatches

Warnings:
    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:129.4-18: Warning (reg_format): /mdio-bus-mux/mdio@200:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
    arch/arm/boot/dts/bcm47094-linksys-panamera.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #address-cells value
    arch/arm/boot/dts/bcm47094-linksys-panamera.dts:128.22-132.5: Warning (avoid_default_addr_size): /mdio-bus-mux/mdio@200: Relying on default #size-cells value

--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-8) — PASS, 0 errors, 2 warnings, 0 section mismatches

Warnings:
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]
    <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]

--------------------------------------------------------------------------------
x86_64_defconfig (x86_64, gcc-8) — PASS, 0 errors, 0 warnings, 0 section mismatches

---
For more info write to <info@kernelci.org>

^ permalink raw reply

* Re: [PATCH 1/4 v1] gpio: Add support for hierarchical IRQ domains
From: Marc Zyngier @ 2019-08-07 15:00 UTC (permalink / raw)
  To: Linus Walleij, Masahiro Yamada
  Cc: open list:GPIO SUBSYSTEM, Bartosz Golaszewski, Thomas Gleixner,
	Lina Iyer, Jon Hunter, Sowjanya Komatineni, Bitan Biswas,
	linux-tegra, David Daney, Brian Masney, Thierry Reding
In-Reply-To: <CACRpkdYbTjQR6dDsy3WJ1w89Yyo=qfSgTheaYX8MHW5uE321sA@mail.gmail.com>

On 07/08/2019 15:43, Linus Walleij wrote:
> Hi Masahiro,
> 
> On Thu, Jul 18, 2019 at 1:12 PM Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>> On Mon, Jun 24, 2019 at 10:25 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> 
>>> +static int gpiochip_hierarchy_irq_domain_alloc(struct irq_domain *d,
>>> +                                              unsigned int irq,
>>> +                                              unsigned int nr_irqs,
>>> +                                              void *data)
>>> +{
>>> +       struct gpio_chip *gc = d->host_data;
>>> +       irq_hw_number_t hwirq;
>>> +       unsigned int type = IRQ_TYPE_NONE;
>>> +       struct irq_fwspec *fwspec = data;
>>> +       int ret;
>>> +       int i;
>>
>> We always expect nr_irqs is 1.
>>
>> As gpio-uniphier.c, you can error out with WARN_ON
>> if nr_irqs != 1
> 
> Hm, yes I am pretty sure it is always 1.
> 
> But I'd like to defer changing this until/if Marc changes
> the signature of the function to not pass nr_irqs anymore.
> I try to design for the current prototype because I don't
> know how e.g. ACPI works with respect to this.

nr_irqs is only here for one single case: PCI Multi-MSI, where we have
to allocate a bunch of contiguous hwirqs. In all other cases, nr_irqs is
always 1.

So yes, you can safely assume nr_irqs == 1, and WARN_ON otherwise.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply


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