Skip to contentSkip to conversation

spmi: pmic-arb: select IRQ_DOMAIN_HIERARCHY in Kconfig

PATCH Applied Brian Masney 5 participants 10 messages Feb 14, 2019

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 spmi: pmic-arb: select IRQ_DOMAIN_HIERARCHY in Kconfig

Select IRQ_DOMAIN_HIERARCHY for pmic-arb in Kconfig since this driver uses the version 2 IRQ interfaces. IRQ_DOMAIN_HIERARCHY selects IRQ_DOMAIN, so it can be removed from here.

---
This addresses a build failure found by make randconfig in linux-next:
https://lore.kernel.org/lkml/[email protected]/

 drivers/spmi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spmi/Kconfig +1 -1
index 0d3b70b3bda8..d48ed7c2c6c4 100644
@@ -12,7 +12,7 @@ if SPMI
 
 config SPMI_MSM_PMIC_ARB
 	tristate "Qualcomm MSM SPMI Controller (PMIC Arbiter)"
-	select IRQ_DOMAIN
+	select IRQ_DOMAIN_HIERARCHY
 	depends on ARCH_QCOM || COMPILE_TEST
 	depends on HAS_IOMEM
 	default ARCH_QCOM
Signature · 1 line
2.17.2
#1 lore raw

PATCH 2/3 mfd: pm8xxx: select IRQ_DOMAIN_HIERARCHY in Kconfig

Select IRQ_DOMAIN_HIERARCHY for pm8xxx in Kconfig since this driver uses the version 2 IRQ interfaces. IRQ_DOMAIN_HIERARCHY selects IRQ_DOMAIN, so it can be removed from here.

---
Linus: For your ib-qcom-ssbi branch.

 drivers/mfd/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/Kconfig +1 -1
index c9ffe8efcbb6..8f316a820b38 100644
@@ -927,7 +927,7 @@ config UCB1400_CORE
 config MFD_PM8XXX
 	tristate "Qualcomm PM8xxx PMIC chips driver"
 	depends on (ARM || HEXAGON || COMPILE_TEST)
-	select IRQ_DOMAIN
+	select IRQ_DOMAIN_HIERARCHY
 	select MFD_CORE
 	select REGMAP
 	help
Signature · 1 line
2.17.2
#2 lore raw

Re: [PATCH -next 2/3] mfd: pm8xxx: select IRQ_DOMAIN_HIERARCHY in Kconfig

Quoted 7 lines · Brian Masney

Select IRQ_DOMAIN_HIERARCHY for pm8xxx in Kconfig since this driver uses the version 2 IRQ interfaces. IRQ_DOMAIN_HIERARCHY selects IRQ_DOMAIN, so it can be removed from here.

---
Linus: For your ib-qcom-ssbi branch.

OK applied it there (might fold it in with the original patch, let's see).

Yours,
Linus Walleij

Acked-by
#3 lore raw

Re: [PATCH -next 2/3] mfd: pm8xxx: select IRQ_DOMAIN_HIERARCHY in Kconfig

Quoted 11 lines · Linus Walleij
Quoted 7 lines · Brian Masney

Select IRQ_DOMAIN_HIERARCHY for pm8xxx in Kconfig since this driver uses the version 2 IRQ interfaces. IRQ_DOMAIN_HIERARCHY selects IRQ_DOMAIN, so it can be removed from here.

---
Linus: For your ib-qcom-ssbi branch.

OK applied it there (might fold it in with the original patch, let's see).

Ah, we're applying patches from different SS without Acks now? ;)

FWIW:

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw

Re: [PATCH -next 2/3] mfd: pm8xxx: select IRQ_DOMAIN_HIERARCHY in Kconfig

Quoted 7 lines · Lee Jones
Quoted 6 lines · Linus Walleij
Quoted 4 lines · Brian Masney

Select IRQ_DOMAIN_HIERARCHY for pm8xxx in Kconfig since this driver uses the version 2 IRQ interfaces. IRQ_DOMAIN_HIERARCHY selects IRQ_DOMAIN, so it can be removed from here.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

---
Linus: For your ib-qcom-ssbi branch.

OK applied it there (might fold it in with the original patch, let's see).

Ah, we're applying patches from different SS without Acks now? ;)

Yeah when fixing onelined bugs I tend to do that sometimes, usually better to ask forgiveness than permission if -next is broken.

Quoted 3 lines

FWIW:

OK folding it in!

Yours,
Linus Walleij

#5 lore raw

PATCH 3/3 qcom: ssbi-gpio: correct boundary conditions in pm8xxx_domain_translate

In reply to Brian Masney

SSBI GPIOs are numbered 1..ngpio, so the boundary check in pm8xxx_domain_translate() is off by one. This patch corrects that check.

---
Originally found by Bjorn Andersson in spmi-gpio.

Linus: For your ib-qcom-ssbi branch.

 drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +2 -1
index 84a232450000..10575d6e2ba5 100644
@@ -710,7 +710,8 @@ static int pm8xxx_domain_translate(struct irq_domain *domain,
 	struct pm8xxx_gpio *pctrl = container_of(domain->host_data,
 						 struct pm8xxx_gpio, chip);
 
-	if (fwspec->param_count != 2 || fwspec->param[0] >= pctrl->chip.ngpio)
+	if (fwspec->param_count != 2 || fwspec->param[0] < 1 ||
+	    fwspec->param[0] > pctrl->chip.ngpio)
 		return -EINVAL;
 
 	*hwirq = fwspec->param[0] - PM8XXX_GPIO_PHYSICAL_OFFSET;
Signature · 1 line
2.17.2
#6 lore raw

Re: [PATCH -next 3/3] qcom: ssbi-gpio: correct boundary conditions in pm8xxx_domain_translate

Quoted 8 lines · Brian Masney

SSBI GPIOs are numbered 1..ngpio, so the boundary check in pm8xxx_domain_translate() is off by one. This patch corrects that check.

---
Originally found by Bjorn Andersson in spmi-gpio.

Linus: For your ib-qcom-ssbi branch.

Thanks applied it there!

This small bug stuff is sorting itself out nicely :) Less stuff to deal with in the -rc phase.

Yours,
Linus Walleij

#7 lore raw

Re: [PATCH -next 3/3] qcom: ssbi-gpio: correct boundary conditions in pm8xxx_domain_translate

In reply to Brian Masney
Quoted 17 lines · Brian Masney

SSBI GPIOs are numbered 1..ngpio, so the boundary check in pm8xxx_domain_translate() is off by one. This patch corrects that check.

---
Originally found by Bjorn Andersson in spmi-gpio.

Linus: For your ib-qcom-ssbi branch.

 drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +0 -0
index 84a232450000..10575d6e2ba5 100644

drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c static int pm8xxx_domain_translate(struct irq_domain *domain, · line 717

Quoted 9 lines
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +2 -1
@@ -710,7 +710,8 @@ static int pm8xxx_domain_translate(struct irq_domain *domain,
 	struct pm8xxx_gpio *pctrl = container_of(domain->host_data,
 						 struct pm8xxx_gpio, chip);
 
-	if (fwspec->param_count != 2 || fwspec->param[0] >= pctrl->chip.ngpio)
+	if (fwspec->param_count != 2 || fwspec->param[0] < 1 ||
+	    fwspec->param[0] > pctrl->chip.ngpio)
 		return -EINVAL;
 
 	*hwirq = fwspec->param[0] - PM8XXX_GPIO_PHYSICAL_OFFSET;

I would write (using the wrap-around behavior for unsigned int)

	if (fwspec->param_count != 2 || fwspec->param[0] - 1 >= pctrl->chip.ngpio)
		return -EINVAL;

Regards.

Acked-by on v1 1/3
#8 lore raw
In reply to Brian Masney
Quoted 5 lines · Brian Masney

Select IRQ_DOMAIN_HIERARCHY for pmic-arb in Kconfig since this driver uses the version 2 IRQ interfaces. IRQ_DOMAIN_HIERARCHY selects IRQ_DOMAIN, so it can be removed from here.

Thanks.

Quoted 21 lines

---
This addresses a build failure found by make randconfig in linux-next:
https://lore.kernel.org/lkml/[email protected]/

 drivers/spmi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spmi/Kconfig +1 -1
index 0d3b70b3bda8..d48ed7c2c6c4 100644
@@ -12,7 +12,7 @@ if SPMI
 
 config SPMI_MSM_PMIC_ARB
 	tristate "Qualcomm MSM SPMI Controller (PMIC Arbiter)"
-	select IRQ_DOMAIN
+	select IRQ_DOMAIN_HIERARCHY
 	depends on ARCH_QCOM || COMPILE_TEST
 	depends on HAS_IOMEM
 	default ARCH_QCOM
Signature · 1 line
~Randy
#9 lore raw
In reply to Brian Masney
Quoted 5 lines · Brian Masney

Select IRQ_DOMAIN_HIERARCHY for pmic-arb in Kconfig since this driver uses the version 2 IRQ interfaces. IRQ_DOMAIN_HIERARCHY selects IRQ_DOMAIN, so it can be removed from here.

Patch applied on the devel branch with Randy's tags!

Yours,
Linus Walleij