* [PATCH 1/4] pinctrl-sunxi: various fixes
@ 2014-02-17 21:19 Hans de Goede
2014-02-17 21:19 ` [PATCH 1/4] pinctrl-sunxi: Fix sun5i-a13 port F multiplexing Hans de Goede
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Hans de Goede @ 2014-02-17 21:19 UTC (permalink / raw)
To: linux-arm-kernel
Hi Linus,
Here are 4 fixes for pinctrl-sunxi, the first one was send a long time ago,
but somehow never managed to find its way into 3.14-rc3. An identical patch
to the second one was already send by Chen-Yu Tsai, we both came up with
the same fix separately, it is included merely for completeness. Patches
3 and 4 are new and should speak for themselves.
I believe all of this is stable material. I've neglected to add a CC: stable
myself, if you agree this is stable material please do so.
Thanks & Regards,
Hans
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 1/4] pinctrl-sunxi: Fix sun5i-a13 port F multiplexing 2014-02-17 21:19 [PATCH 1/4] pinctrl-sunxi: various fixes Hans de Goede @ 2014-02-17 21:19 ` Hans de Goede 2014-02-25 8:31 ` Linus Walleij 2014-02-17 21:19 ` [PATCH 2/4] pinctrl-sunxi: Fix hang on gpio irq Hans de Goede ` (2 subsequent siblings) 3 siblings, 1 reply; 11+ messages in thread From: Hans de Goede @ 2014-02-17 21:19 UTC (permalink / raw) To: linux-arm-kernel The correct value for selecting the mmc0 function on port F pins is 2 not 4, as per the data-sheet: http://dl.linux-sunxi.org/A13/A13%20Datasheet%20-%20v1.12%20%282012-03-29%29.pdf Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> --- drivers/pinctrl/pinctrl-sunxi-pins.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-sunxi-pins.h b/drivers/pinctrl/pinctrl-sunxi-pins.h index 6fd8d4d..3d60669 100644 --- a/drivers/pinctrl/pinctrl-sunxi-pins.h +++ b/drivers/pinctrl/pinctrl-sunxi-pins.h @@ -1932,27 +1932,27 @@ static const struct sunxi_desc_pin sun5i_a13_pins[] = { SUNXI_PIN(SUNXI_PINCTRL_PIN_PF0, SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), - SUNXI_FUNCTION(0x4, "mmc0")), /* D1 */ + SUNXI_FUNCTION(0x2, "mmc0")), /* D1 */ SUNXI_PIN(SUNXI_PINCTRL_PIN_PF1, SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), - SUNXI_FUNCTION(0x4, "mmc0")), /* D0 */ + SUNXI_FUNCTION(0x2, "mmc0")), /* D0 */ SUNXI_PIN(SUNXI_PINCTRL_PIN_PF2, SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), - SUNXI_FUNCTION(0x4, "mmc0")), /* CLK */ + SUNXI_FUNCTION(0x2, "mmc0")), /* CLK */ SUNXI_PIN(SUNXI_PINCTRL_PIN_PF3, SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), - SUNXI_FUNCTION(0x4, "mmc0")), /* CMD */ + SUNXI_FUNCTION(0x2, "mmc0")), /* CMD */ SUNXI_PIN(SUNXI_PINCTRL_PIN_PF4, SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), - SUNXI_FUNCTION(0x4, "mmc0")), /* D3 */ + SUNXI_FUNCTION(0x2, "mmc0")), /* D3 */ SUNXI_PIN(SUNXI_PINCTRL_PIN_PF5, SUNXI_FUNCTION(0x0, "gpio_in"), SUNXI_FUNCTION(0x1, "gpio_out"), - SUNXI_FUNCTION(0x4, "mmc0")), /* D2 */ + SUNXI_FUNCTION(0x2, "mmc0")), /* D2 */ /* Hole */ SUNXI_PIN(SUNXI_PINCTRL_PIN_PG0, SUNXI_FUNCTION(0x0, "gpio_in"), -- 1.8.5.3 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 1/4] pinctrl-sunxi: Fix sun5i-a13 port F multiplexing 2014-02-17 21:19 ` [PATCH 1/4] pinctrl-sunxi: Fix sun5i-a13 port F multiplexing Hans de Goede @ 2014-02-25 8:31 ` Linus Walleij 0 siblings, 0 replies; 11+ messages in thread From: Linus Walleij @ 2014-02-25 8:31 UTC (permalink / raw) To: linux-arm-kernel On Mon, Feb 17, 2014 at 10:19 PM, Hans de Goede <hdegoede@redhat.com> wrote: > The correct value for selecting the mmc0 function on port F pins is 2 not 4, > as per the data-sheet: > http://dl.linux-sunxi.org/A13/A13%20Datasheet%20-%20v1.12%20%282012-03-29%29.pdf > > Signed-off-by: Hans de Goede <hdegoede@redhat.com> > Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Patch applied. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/4] pinctrl-sunxi: Fix hang on gpio irq 2014-02-17 21:19 [PATCH 1/4] pinctrl-sunxi: various fixes Hans de Goede 2014-02-17 21:19 ` [PATCH 1/4] pinctrl-sunxi: Fix sun5i-a13 port F multiplexing Hans de Goede @ 2014-02-17 21:19 ` Hans de Goede 2014-02-25 8:33 ` Linus Walleij 2014-02-17 21:19 ` [PATCH 3/4] pinctrl-sunxi: Fix masking when setting irq type Hans de Goede 2014-02-17 21:19 ` [PATCH 4/4] pinctrl-sunxi: Fix interrupt register offset calculation Hans de Goede 3 siblings, 1 reply; 11+ messages in thread From: Hans de Goede @ 2014-02-17 21:19 UTC (permalink / raw) To: linux-arm-kernel Our irq handler was missing chained_irq_enter / exit calls, causing a hard hang as soon as a gpio irq happened. Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- drivers/pinctrl/pinctrl-sunxi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c index 74635cc..cc9bd1b 100644 --- a/drivers/pinctrl/pinctrl-sunxi.c +++ b/drivers/pinctrl/pinctrl-sunxi.c @@ -13,6 +13,7 @@ #include <linux/io.h> #include <linux/clk.h> #include <linux/gpio.h> +#include <linux/irqchip/chained_irq.h> #include <linux/irqdomain.h> #include <linux/module.h> #include <linux/of.h> @@ -665,9 +666,12 @@ static struct irq_chip sunxi_pinctrl_irq_chip = { static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc) { + struct irq_chip *chip = irq_get_chip(irq); struct sunxi_pinctrl *pctl = irq_get_handler_data(irq); const unsigned long reg = readl(pctl->membase + IRQ_STATUS_REG); + chained_irq_enter(chip, desc); + /* Clear all interrupts */ writel(reg, pctl->membase + IRQ_STATUS_REG); @@ -679,6 +683,7 @@ static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc) generic_handle_irq(pin_irq); } } + chained_irq_exit(chip, desc); } static struct of_device_id sunxi_pinctrl_match[] = { -- 1.8.5.3 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/4] pinctrl-sunxi: Fix hang on gpio irq 2014-02-17 21:19 ` [PATCH 2/4] pinctrl-sunxi: Fix hang on gpio irq Hans de Goede @ 2014-02-25 8:33 ` Linus Walleij 0 siblings, 0 replies; 11+ messages in thread From: Linus Walleij @ 2014-02-25 8:33 UTC (permalink / raw) To: linux-arm-kernel On Mon, Feb 17, 2014 at 10:19 PM, Hans de Goede <hdegoede@redhat.com> wrote: > Our irq handler was missing chained_irq_enter / exit calls, causing a > hard hang as soon as a gpio irq happened. > > Signed-off-by: Hans de Goede <hdegoede@redhat.com> I have already applied the identical patch from Chen-Yu Tsai for fixes so dropping this. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 3/4] pinctrl-sunxi: Fix masking when setting irq type 2014-02-17 21:19 [PATCH 1/4] pinctrl-sunxi: various fixes Hans de Goede 2014-02-17 21:19 ` [PATCH 1/4] pinctrl-sunxi: Fix sun5i-a13 port F multiplexing Hans de Goede 2014-02-17 21:19 ` [PATCH 2/4] pinctrl-sunxi: Fix hang on gpio irq Hans de Goede @ 2014-02-17 21:19 ` Hans de Goede 2014-02-18 7:49 ` Maxime Ripard 2014-02-25 8:35 ` Linus Walleij 2014-02-17 21:19 ` [PATCH 4/4] pinctrl-sunxi: Fix interrupt register offset calculation Hans de Goede 3 siblings, 2 replies; 11+ messages in thread From: Hans de Goede @ 2014-02-17 21:19 UTC (permalink / raw) To: linux-arm-kernel Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- drivers/pinctrl/pinctrl-sunxi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c index cc9bd1b..917af0a 100644 --- a/drivers/pinctrl/pinctrl-sunxi.c +++ b/drivers/pinctrl/pinctrl-sunxi.c @@ -583,7 +583,7 @@ static int sunxi_pinctrl_irq_set_type(struct irq_data *d, spin_lock_irqsave(&pctl->lock, flags); regval = readl(pctl->membase + reg); - regval &= ~IRQ_CFG_IRQ_MASK; + regval &= ~(IRQ_CFG_IRQ_MASK << index); writel(regval | (mode << index), pctl->membase + reg); spin_unlock_irqrestore(&pctl->lock, flags); -- 1.8.5.3 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/4] pinctrl-sunxi: Fix masking when setting irq type 2014-02-17 21:19 ` [PATCH 3/4] pinctrl-sunxi: Fix masking when setting irq type Hans de Goede @ 2014-02-18 7:49 ` Maxime Ripard 2014-02-25 8:35 ` Linus Walleij 1 sibling, 0 replies; 11+ messages in thread From: Maxime Ripard @ 2014-02-18 7:49 UTC (permalink / raw) To: linux-arm-kernel Hi, On Mon, Feb 17, 2014 at 10:19:43PM +0100, Hans de Goede wrote: > Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140218/3e77537a/attachment.sig> ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 3/4] pinctrl-sunxi: Fix masking when setting irq type 2014-02-17 21:19 ` [PATCH 3/4] pinctrl-sunxi: Fix masking when setting irq type Hans de Goede 2014-02-18 7:49 ` Maxime Ripard @ 2014-02-25 8:35 ` Linus Walleij 1 sibling, 0 replies; 11+ messages in thread From: Linus Walleij @ 2014-02-25 8:35 UTC (permalink / raw) To: linux-arm-kernel On Mon, Feb 17, 2014 at 10:19 PM, Hans de Goede <hdegoede@redhat.com> wrote: > Signed-off-by: Hans de Goede <hdegoede@redhat.com> Patch applied with Maxime's ACK. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 4/4] pinctrl-sunxi: Fix interrupt register offset calculation 2014-02-17 21:19 [PATCH 1/4] pinctrl-sunxi: various fixes Hans de Goede ` (2 preceding siblings ...) 2014-02-17 21:19 ` [PATCH 3/4] pinctrl-sunxi: Fix masking when setting irq type Hans de Goede @ 2014-02-17 21:19 ` Hans de Goede 2014-02-18 8:05 ` Maxime Ripard 2014-02-25 8:38 ` Linus Walleij 3 siblings, 2 replies; 11+ messages in thread From: Hans de Goede @ 2014-02-17 21:19 UTC (permalink / raw) To: linux-arm-kernel This fixing setting the interrupt type for eints >= 8. Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- drivers/pinctrl/pinctrl-sunxi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-sunxi.h b/drivers/pinctrl/pinctrl-sunxi.h index 01c494f..552b0e9 100644 --- a/drivers/pinctrl/pinctrl-sunxi.h +++ b/drivers/pinctrl/pinctrl-sunxi.h @@ -511,7 +511,7 @@ static inline u32 sunxi_pull_offset(u16 pin) static inline u32 sunxi_irq_cfg_reg(u16 irq) { - u8 reg = irq / IRQ_CFG_IRQ_PER_REG; + u8 reg = irq / IRQ_CFG_IRQ_PER_REG * 0x04; return reg + IRQ_CFG_REG; } @@ -523,7 +523,7 @@ static inline u32 sunxi_irq_cfg_offset(u16 irq) static inline u32 sunxi_irq_ctrl_reg(u16 irq) { - u8 reg = irq / IRQ_CTRL_IRQ_PER_REG; + u8 reg = irq / IRQ_CTRL_IRQ_PER_REG * 0x04; return reg + IRQ_CTRL_REG; } @@ -535,7 +535,7 @@ static inline u32 sunxi_irq_ctrl_offset(u16 irq) static inline u32 sunxi_irq_status_reg(u16 irq) { - u8 reg = irq / IRQ_STATUS_IRQ_PER_REG; + u8 reg = irq / IRQ_STATUS_IRQ_PER_REG * 0x04; return reg + IRQ_STATUS_REG; } -- 1.8.5.3 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/4] pinctrl-sunxi: Fix interrupt register offset calculation 2014-02-17 21:19 ` [PATCH 4/4] pinctrl-sunxi: Fix interrupt register offset calculation Hans de Goede @ 2014-02-18 8:05 ` Maxime Ripard 2014-02-25 8:38 ` Linus Walleij 1 sibling, 0 replies; 11+ messages in thread From: Maxime Ripard @ 2014-02-18 8:05 UTC (permalink / raw) To: linux-arm-kernel On Mon, Feb 17, 2014 at 10:19:44PM +0100, Hans de Goede wrote: > This fixing setting the interrupt type for eints >= 8. > > Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140218/f4608c70/attachment.sig> ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 4/4] pinctrl-sunxi: Fix interrupt register offset calculation 2014-02-17 21:19 ` [PATCH 4/4] pinctrl-sunxi: Fix interrupt register offset calculation Hans de Goede 2014-02-18 8:05 ` Maxime Ripard @ 2014-02-25 8:38 ` Linus Walleij 1 sibling, 0 replies; 11+ messages in thread From: Linus Walleij @ 2014-02-25 8:38 UTC (permalink / raw) To: linux-arm-kernel On Mon, Feb 17, 2014 at 10:19 PM, Hans de Goede <hdegoede@redhat.com> wrote: > This fixing setting the interrupt type for eints >= 8. > > Signed-off-by: Hans de Goede <hdegoede@redhat.com> Patch applied with Maxime's ACK. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-02-25 8:38 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-02-17 21:19 [PATCH 1/4] pinctrl-sunxi: various fixes Hans de Goede 2014-02-17 21:19 ` [PATCH 1/4] pinctrl-sunxi: Fix sun5i-a13 port F multiplexing Hans de Goede 2014-02-25 8:31 ` Linus Walleij 2014-02-17 21:19 ` [PATCH 2/4] pinctrl-sunxi: Fix hang on gpio irq Hans de Goede 2014-02-25 8:33 ` Linus Walleij 2014-02-17 21:19 ` [PATCH 3/4] pinctrl-sunxi: Fix masking when setting irq type Hans de Goede 2014-02-18 7:49 ` Maxime Ripard 2014-02-25 8:35 ` Linus Walleij 2014-02-17 21:19 ` [PATCH 4/4] pinctrl-sunxi: Fix interrupt register offset calculation Hans de Goede 2014-02-18 8:05 ` Maxime Ripard 2014-02-25 8:38 ` Linus Walleij
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).