linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 10/17] tty/serial: st-asc: drop the use of IRQF_NO_SUSPEND
       [not found] <1442850433-5903-1-git-send-email-sudeep.holla@arm.com>
@ 2015-09-21 15:47 ` Sudeep Holla
  2015-09-21 15:47 ` [PATCH 12/17] ARM: OMAP2+: remove misuse of IRQF_NO_SUSPEND flag Sudeep Holla
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Sudeep Holla @ 2015-09-21 15:47 UTC (permalink / raw)
  To: linux-arm-kernel

These drivers doesn't claim the serial device to be wakeup source. Even
if it is, it needs to use enable_irq_wake or other related PM wakeup
APIs to enable it.

This patch removes yet another misuse of IRQF_NO_SUSPEND.

Cc: Srinivas Kandagatla <srinivas.kandagatla@gmail.com>
Cc: Maxime Coquelin <maxime.coquelin@st.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-arm-kernel at lists.infradead.org
Cc: kernel at stlinux.com
Cc: linux-serial at vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/tty/serial/st-asc.c      | 2 +-
 drivers/tty/serial/stm32-usart.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index d625664ce1b5..2d78cb3627ae 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -430,7 +430,7 @@ static void asc_break_ctl(struct uart_port *port, int break_state)
  */
 static int asc_startup(struct uart_port *port)
 {
-	if (request_irq(port->irq, asc_interrupt, IRQF_NO_SUSPEND,
+	if (request_irq(port->irq, asc_interrupt, 0,
 			asc_port_name(port), port)) {
 		dev_err(port->dev, "cannot allocate irq.\n");
 		return -ENODEV;
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index e3de9c6d2226..f89d1f79be18 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -322,8 +322,7 @@ static int stm32_startup(struct uart_port *port)
 	u32 val;
 	int ret;
 
-	ret = request_irq(port->irq, stm32_interrupt, IRQF_NO_SUSPEND,
-			  name, port);
+	ret = request_irq(port->irq, stm32_interrupt, 0, name, port);
 	if (ret)
 		return ret;
 
-- 
1.9.1

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

* [PATCH 12/17] ARM: OMAP2+: remove misuse of IRQF_NO_SUSPEND flag
       [not found] <1442850433-5903-1-git-send-email-sudeep.holla@arm.com>
  2015-09-21 15:47 ` [PATCH 10/17] tty/serial: st-asc: drop the use of IRQF_NO_SUSPEND Sudeep Holla
@ 2015-09-21 15:47 ` Sudeep Holla
  2015-10-12 20:20   ` Tony Lindgren
  2015-09-21 15:47 ` [PATCH 14/17] media: st-rc: " Sudeep Holla
  2015-09-21 15:47 ` [PATCH 17/17] mfd : ab8500/db8500: fix the abuse of IRQF_NO_SUSPEND Sudeep Holla
  3 siblings, 1 reply; 14+ messages in thread
From: Sudeep Holla @ 2015-09-21 15:47 UTC (permalink / raw)
  To: linux-arm-kernel

The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
be left enabled so as to allow them to work as expected during the
suspend-resume cycle, but doesn't guarantee that it will wake the system
from a suspended state, enable_irq_wake is recommended to be used for
the wakeup.

This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
enable_irq_wake instead.

Cc: Tony Lindgren <tony@atomide.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: linux-omap at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 arch/arm/mach-omap2/mux.c    | 4 ++--
 arch/arm/mach-omap2/pm34xx.c | 9 ++++-----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 176eef6ef338..12012bef8e63 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -810,13 +810,13 @@ int __init omap_mux_late_init(void)
 		return 0;
 
 	ret = request_irq(omap_prcm_event_to_irq("io"),
-		omap_hwmod_mux_handle_irq, IRQF_SHARED | IRQF_NO_SUSPEND,
+		omap_hwmod_mux_handle_irq, IRQF_SHARED,
 			"hwmod_io", omap_mux_late_init);
 
 	if (ret)
 		pr_warn("mux: Failed to setup hwmod io irq %d\n", ret);
 
-	return 0;
+	return enable_irq_wake(omap_prcm_event_to_irq("io"));
 }
 
 static void __init omap_mux_package_fixup(struct omap_mux *p,
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 87b98bf92366..4b7ac7cd633a 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -472,23 +472,22 @@ int __init omap3_pm_init(void)
 	prcm_setup_regs();
 
 	ret = request_irq(omap_prcm_event_to_irq("wkup"),
-		_prcm_int_handle_wakeup, IRQF_NO_SUSPEND, "pm_wkup", NULL);
+		_prcm_int_handle_wakeup, 0, "pm_wkup", NULL);
 
 	if (ret) {
 		pr_err("pm: Failed to request pm_wkup irq\n");
 		goto err1;
 	}
+	enable_irq_wake(omap_prcm_event_to_irq("wkup"));
 
 	/* IO interrupt is shared with mux code */
 	ret = request_irq(omap_prcm_event_to_irq("io"),
-		_prcm_int_handle_io, IRQF_SHARED | IRQF_NO_SUSPEND, "pm_io",
-		omap3_pm_init);
-	enable_irq(omap_prcm_event_to_irq("io"));
-
+		_prcm_int_handle_io, IRQF_SHARED, "pm_io", omap3_pm_init);
 	if (ret) {
 		pr_err("pm: Failed to request pm_io irq\n");
 		goto err2;
 	}
+	enable_irq_wake(omap_prcm_event_to_irq("io"));
 
 	ret = pwrdm_for_each(pwrdms_setup, NULL);
 	if (ret) {
-- 
1.9.1

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

* [PATCH 14/17] media: st-rc: remove misuse of IRQF_NO_SUSPEND flag
       [not found] <1442850433-5903-1-git-send-email-sudeep.holla@arm.com>
  2015-09-21 15:47 ` [PATCH 10/17] tty/serial: st-asc: drop the use of IRQF_NO_SUSPEND Sudeep Holla
  2015-09-21 15:47 ` [PATCH 12/17] ARM: OMAP2+: remove misuse of IRQF_NO_SUSPEND flag Sudeep Holla
@ 2015-09-21 15:47 ` Sudeep Holla
  2015-10-19 17:40   ` Sudeep Holla
  2015-09-21 15:47 ` [PATCH 17/17] mfd : ab8500/db8500: fix the abuse of IRQF_NO_SUSPEND Sudeep Holla
  3 siblings, 1 reply; 14+ messages in thread
From: Sudeep Holla @ 2015-09-21 15:47 UTC (permalink / raw)
  To: linux-arm-kernel

The device is set as wakeup capable using proper wakeup API but the
driver misuses IRQF_NO_SUSPEND to set the interrupt as wakeup source
which is incorrect.

This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
enable_irq_wake instead.

Cc: Srinivas Kandagatla <srinivas.kandagatla@gmail.com>
Cc: Maxime Coquelin <maxime.coquelin@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: kernel at stlinux.com
Cc: linux-media at vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/media/rc/st_rc.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
index 37d040158dff..1fa0c9d1c508 100644
--- a/drivers/media/rc/st_rc.c
+++ b/drivers/media/rc/st_rc.c
@@ -16,6 +16,7 @@
 #include <linux/reset.h>
 #include <media/rc-core.h>
 #include <linux/pinctrl/consumer.h>
+#include <linux/pm_wakeirq.h>
 
 struct st_rc_device {
 	struct device			*dev;
@@ -190,6 +191,9 @@ static void st_rc_hardware_init(struct st_rc_device *dev)
 static int st_rc_remove(struct platform_device *pdev)
 {
 	struct st_rc_device *rc_dev = platform_get_drvdata(pdev);
+
+	dev_pm_clear_wake_irq(&pdev->dev);
+	device_init_wakeup(&pdev->dev, false);
 	clk_disable_unprepare(rc_dev->sys_clock);
 	rc_unregister_device(rc_dev->rdev);
 	return 0;
@@ -298,22 +302,22 @@ static int st_rc_probe(struct platform_device *pdev)
 	rdev->map_name = RC_MAP_LIRC;
 	rdev->input_name = "ST Remote Control Receiver";
 
-	/* enable wake via this device */
-	device_set_wakeup_capable(dev, true);
-	device_set_wakeup_enable(dev, true);
-
 	ret = rc_register_device(rdev);
 	if (ret < 0)
 		goto clkerr;
 
 	rc_dev->rdev = rdev;
 	if (devm_request_irq(dev, rc_dev->irq, st_rc_rx_interrupt,
-			IRQF_NO_SUSPEND, IR_ST_NAME, rc_dev) < 0) {
+			     0, IR_ST_NAME, rc_dev) < 0) {
 		dev_err(dev, "IRQ %d register failed\n", rc_dev->irq);
 		ret = -EINVAL;
 		goto rcerr;
 	}
 
+	/* enable wake via this device */
+	device_init_wakeup(dev, true);
+	dev_pm_set_wake_irq(dev, rc_dev->irq);
+
 	/**
 	 * for LIRC_MODE_MODE2 or LIRC_MODE_PULSE or LIRC_MODE_RAW
 	 * lircd expects a long space first before a signal train to sync.
-- 
1.9.1

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

* [PATCH 17/17] mfd : ab8500/db8500: fix the abuse of IRQF_NO_SUSPEND
       [not found] <1442850433-5903-1-git-send-email-sudeep.holla@arm.com>
                   ` (2 preceding siblings ...)
  2015-09-21 15:47 ` [PATCH 14/17] media: st-rc: " Sudeep Holla
@ 2015-09-21 15:47 ` Sudeep Holla
  2015-09-21 23:20   ` Lee Jones
  3 siblings, 1 reply; 14+ messages in thread
From: Sudeep Holla @ 2015-09-21 15:47 UTC (permalink / raw)
  To: linux-arm-kernel

The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
be left enabled so as to allow them to work as expected during the
suspend-resume cycle, but doesn't guarantee that it will wake the system
from a suspended state, enable_irq_wake is recommended to be used for
the wakeup.

This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
enable_irq_wake instead.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/mfd/ab8500-core.c        | 11 +++++++++--
 drivers/mfd/ab8500-debugfs.c     |  2 +-
 drivers/mfd/ab8500-gpadc.c       | 15 +++++++++++----
 drivers/mfd/db8500-prcmu.c       | 24 +++++++++++++++++-------
 drivers/power/ab8500_btemp.c     |  6 ++++--
 drivers/power/ab8500_charger.c   |  6 ++++--
 drivers/power/ab8500_fg.c        |  9 ++++++---
 drivers/thermal/db8500_thermal.c |  5 ++---
 drivers/usb/phy/phy-ab8500-usb.c | 10 ++++++----
 9 files changed, 60 insertions(+), 28 deletions(-)

Hi Linus,

This just compile tested and need proper testing as the changes are more
invasive compared to other patches in the series. Any review/testing
is much appreciated.

Regards,
Sudeep

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index fefbe4cfa61d..640c1854c953 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -435,6 +435,13 @@ static int ab8500_irq_set_type(struct irq_data *data, unsigned int type)
 	return 0;
 }
 
+static int ab8500_irq_set_wake(struct irq_data *data, unsigned int on)
+{
+	struct ab8500 *ab8500 = irq_data_get_irq_chip_data(data);
+
+	return irq_set_irq_wake(ab8500->irq, on);
+}
+
 static struct irq_chip ab8500_irq_chip = {
 	.name			= "ab8500",
 	.irq_bus_lock		= ab8500_irq_lock,
@@ -443,6 +450,7 @@ static struct irq_chip ab8500_irq_chip = {
 	.irq_disable		= ab8500_irq_mask,
 	.irq_unmask		= ab8500_irq_unmask,
 	.irq_set_type		= ab8500_irq_set_type,
+	.irq_set_wake		= ab8500_irq_set_wake,
 };
 
 static void update_latch_offset(u8 *offset, int i)
@@ -1744,8 +1752,7 @@ static int ab8500_probe(struct platform_device *pdev)
 		return ret;
 
 	ret = devm_request_threaded_irq(&pdev->dev, ab8500->irq, NULL,
-			ab8500_hierarchical_irq,
-			IRQF_ONESHOT | IRQF_NO_SUSPEND,
+			ab8500_hierarchical_irq, IRQF_ONESHOT,
 			"ab8500", ab8500);
 	if (ret)
 		return ret;
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 0236cd7cdce4..9a2c37041b9e 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -2885,7 +2885,7 @@ static ssize_t ab8500_subscribe_write(struct file *file,
 	}
 
 	err = request_threaded_irq(user_val, NULL, ab8500_debug_handler,
-				   IRQF_SHARED | IRQF_NO_SUSPEND | IRQF_ONESHOT,
+				   IRQF_SHARED | IRQF_ONESHOT,
 				   "ab8500-debug", &dev->kobj);
 	if (err < 0) {
 		pr_info("request_threaded_irq failed %d, %lu\n",
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
index c51c1b188d64..69a8122a334f 100644
--- a/drivers/mfd/ab8500-gpadc.c
+++ b/drivers/mfd/ab8500-gpadc.c
@@ -948,7 +948,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
 	if (gpadc->irq_sw >= 0) {
 		ret = request_threaded_irq(gpadc->irq_sw, NULL,
 			ab8500_bm_gpadcconvend_handler,
-			IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
+			IRQF_SHARED | IRQF_ONESHOT,
 			"ab8500-gpadc-sw",
 			gpadc);
 		if (ret < 0) {
@@ -962,7 +962,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
 	if (gpadc->irq_hw >= 0) {
 		ret = request_threaded_irq(gpadc->irq_hw, NULL,
 			ab8500_bm_gpadcconvend_handler,
-			IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
+			IRQF_SHARED | IRQF_ONESHOT,
 			"ab8500-gpadc-hw",
 			gpadc);
 		if (ret < 0) {
@@ -994,6 +994,9 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
 	pm_runtime_set_active(gpadc->dev);
 	pm_runtime_enable(gpadc->dev);
 
+	enable_irq_wake(gpadc->irq_sw);
+	enable_irq_wake(gpadc->irq_hw);
+
 	ab8500_gpadc_read_calibration_data(gpadc);
 	list_add_tail(&gpadc->node, &ab8500_gpadc_list);
 	dev_dbg(gpadc->dev, "probe success\n");
@@ -1015,10 +1018,14 @@ static int ab8500_gpadc_remove(struct platform_device *pdev)
 	/* remove this gpadc entry from the list */
 	list_del(&gpadc->node);
 	/* remove interrupt  - completion of Sw ADC conversion */
-	if (gpadc->irq_sw >= 0)
+	if (gpadc->irq_sw >= 0) {
+		disable_irq_wake(gpadc->irq_sw);
 		free_irq(gpadc->irq_sw, gpadc);
-	if (gpadc->irq_hw >= 0)
+	}
+	if (gpadc->irq_hw >= 0) {
+		disable_irq_wake(gpadc->irq_hw);
 		free_irq(gpadc->irq_hw, gpadc);
+	}
 
 	pm_runtime_get_sync(gpadc->dev);
 	pm_runtime_disable(gpadc->dev);
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index e6e4bacb09ee..d568ecd66f7e 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -266,6 +266,7 @@ static struct {
 } fw_info;
 
 static struct irq_domain *db8500_irq_domain;
+static int prcmu_irq;
 
 /*
  * This vector maps irq numbers to the bits in the bit field used in
@@ -2599,12 +2600,20 @@ static void noop(struct irq_data *d)
 {
 }
 
+static int prcmu_irq_set_wake(struct irq_data *data, unsigned int on)
+{
+	int *irq = irq_data_get_irq_chip_data(data);
+
+	return irq_set_irq_wake(*irq, on);
+}
+
 static struct irq_chip prcmu_irq_chip = {
 	.name		= "prcmu",
 	.irq_disable	= prcmu_irq_mask,
 	.irq_ack	= noop,
 	.irq_mask	= prcmu_irq_mask,
 	.irq_unmask	= prcmu_irq_unmask,
+	.irq_set_wake	= prcmu_irq_set_wake,
 };
 
 static __init char *fw_project_name(u32 project)
@@ -2652,6 +2661,7 @@ static __init char *fw_project_name(u32 project)
 static int db8500_irq_map(struct irq_domain *d, unsigned int virq,
 				irq_hw_number_t hwirq)
 {
+	irq_set_chip_data(virq, d->host_data);
 	irq_set_chip_and_handler(virq, &prcmu_irq_chip,
 				handle_simple_irq);
 
@@ -2669,7 +2679,7 @@ static int db8500_irq_init(struct device_node *np)
 
 	db8500_irq_domain = irq_domain_add_simple(
 		np, NUM_PRCMU_WAKEUPS, 0,
-		&db8500_irq_ops, NULL);
+		&db8500_irq_ops, &prcmu_irq);
 
 	if (!db8500_irq_domain) {
 		pr_err("Failed to create irqdomain\n");
@@ -3134,7 +3144,7 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct prcmu_pdata *pdata = dev_get_platdata(&pdev->dev);
-	int irq = 0, err = 0;
+	int err = 0;
 	struct resource *res;
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu");
@@ -3166,14 +3176,14 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
 	/* Clean up the mailbox interrupts after pre-kernel code. */
 	writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR);
 
-	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
+	prcmu_irq = platform_get_irq(pdev, 0);
+	if (prcmu_irq <= 0) {
 		dev_err(&pdev->dev, "no prcmu irq provided\n");
-		return irq;
+		return prcmu_irq;
 	}
 
-	err = request_threaded_irq(irq, prcmu_irq_handler,
-	        prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL);
+	err = request_threaded_irq(prcmu_irq, prcmu_irq_handler,
+				   prcmu_irq_thread_fn, 0, "prcmu", NULL);
 	if (err < 0) {
 		pr_err("prcmu: Failed to allocate IRQ_DB8500_PRCMU1.\n");
 		return err;
diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c
index 8f8044e1acf3..ab838b35c7be 100644
--- a/drivers/power/ab8500_btemp.c
+++ b/drivers/power/ab8500_btemp.c
@@ -1032,6 +1032,7 @@ static int ab8500_btemp_remove(struct platform_device *pdev)
 	/* Disable interrupts */
 	for (i = 0; i < ARRAY_SIZE(ab8500_btemp_irq); i++) {
 		irq = platform_get_irq_byname(pdev, ab8500_btemp_irq[i].name);
+		disable_irq_wake(irq);
 		free_irq(irq, di);
 	}
 
@@ -1149,14 +1150,14 @@ static int ab8500_btemp_probe(struct platform_device *pdev)
 	for (i = 0; i < ARRAY_SIZE(ab8500_btemp_irq); i++) {
 		irq = platform_get_irq_byname(pdev, ab8500_btemp_irq[i].name);
 		ret = request_threaded_irq(irq, NULL, ab8500_btemp_irq[i].isr,
-			IRQF_SHARED | IRQF_NO_SUSPEND,
-			ab8500_btemp_irq[i].name, di);
+			IRQF_SHARED, ab8500_btemp_irq[i].name, di);
 
 		if (ret) {
 			dev_err(di->dev, "failed to request %s IRQ %d: %d\n"
 				, ab8500_btemp_irq[i].name, irq, ret);
 			goto free_irq;
 		}
+		enable_irq_wake(irq);
 		dev_dbg(di->dev, "Requested %s IRQ %d: %d\n",
 			ab8500_btemp_irq[i].name, irq, ret);
 	}
@@ -1175,6 +1176,7 @@ static int ab8500_btemp_probe(struct platform_device *pdev)
 	/* We also have to free all successfully registered irqs */
 	for (i = i - 1; i >= 0; i--) {
 		irq = platform_get_irq_byname(pdev, ab8500_btemp_irq[i].name);
+		disable_irq_wake(irq);
 		free_irq(irq, di);
 	}
 free_btemp_wq:
diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c
index e388171f4e58..734fe43181ab 100644
--- a/drivers/power/ab8500_charger.c
+++ b/drivers/power/ab8500_charger.c
@@ -3406,6 +3406,7 @@ static int ab8500_charger_remove(struct platform_device *pdev)
 	/* Disable interrupts */
 	for (i = 0; i < ARRAY_SIZE(ab8500_charger_irq); i++) {
 		irq = platform_get_irq_byname(pdev, ab8500_charger_irq[i].name);
+		disable_irq_wake(irq);
 		free_irq(irq, di);
 	}
 
@@ -3680,14 +3681,14 @@ static int ab8500_charger_probe(struct platform_device *pdev)
 	for (i = 0; i < ARRAY_SIZE(ab8500_charger_irq); i++) {
 		irq = platform_get_irq_byname(pdev, ab8500_charger_irq[i].name);
 		ret = request_threaded_irq(irq, NULL, ab8500_charger_irq[i].isr,
-			IRQF_SHARED | IRQF_NO_SUSPEND,
-			ab8500_charger_irq[i].name, di);
+			IRQF_SHARED, ab8500_charger_irq[i].name, di);
 
 		if (ret != 0) {
 			dev_err(di->dev, "failed to request %s IRQ %d: %d\n"
 				, ab8500_charger_irq[i].name, irq, ret);
 			goto free_irq;
 		}
+		enable_irq_wake(irq);
 		dev_dbg(di->dev, "Requested %s IRQ %d: %d\n",
 			ab8500_charger_irq[i].name, irq, ret);
 	}
@@ -3721,6 +3722,7 @@ static int ab8500_charger_probe(struct platform_device *pdev)
 	/* We also have to free all successfully registered irqs */
 	for (i = i - 1; i >= 0; i--) {
 		irq = platform_get_irq_byname(pdev, ab8500_charger_irq[i].name);
+		disable_irq_wake(irq);
 		free_irq(irq, di);
 	}
 put_usb_phy:
diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
index 3830dade5d69..8f0193e7c42c 100644
--- a/drivers/power/ab8500_fg.c
+++ b/drivers/power/ab8500_fg.c
@@ -3168,14 +3168,14 @@ static int ab8500_fg_probe(struct platform_device *pdev)
 	for (i = 0; i < ARRAY_SIZE(ab8500_fg_irq_th); i++) {
 		irq = platform_get_irq_byname(pdev, ab8500_fg_irq_th[i].name);
 		ret = request_irq(irq, ab8500_fg_irq_th[i].isr,
-				  IRQF_SHARED | IRQF_NO_SUSPEND,
-				  ab8500_fg_irq_th[i].name, di);
+				  IRQF_SHARED, ab8500_fg_irq_th[i].name, di);
 
 		if (ret != 0) {
 			dev_err(di->dev, "failed to request %s IRQ %d: %d\n",
 				ab8500_fg_irq_th[i].name, irq, ret);
 			goto free_irq;
 		}
+		enable_irq_wake(irq);
 		dev_dbg(di->dev, "Requested %s IRQ %d: %d\n",
 			ab8500_fg_irq_th[i].name, irq, ret);
 	}
@@ -3183,7 +3183,7 @@ static int ab8500_fg_probe(struct platform_device *pdev)
 	/* Register threaded interrupt handler */
 	irq = platform_get_irq_byname(pdev, ab8500_fg_irq_bh[0].name);
 	ret = request_threaded_irq(irq, NULL, ab8500_fg_irq_bh[0].isr,
-				IRQF_SHARED | IRQF_NO_SUSPEND | IRQF_ONESHOT,
+				IRQF_SHARED | IRQF_ONESHOT,
 			ab8500_fg_irq_bh[0].name, di);
 
 	if (ret != 0) {
@@ -3191,6 +3191,7 @@ static int ab8500_fg_probe(struct platform_device *pdev)
 			ab8500_fg_irq_bh[0].name, irq, ret);
 		goto free_irq;
 	}
+	enable_irq_wake(irq);
 	dev_dbg(di->dev, "Requested %s IRQ %d: %d\n",
 		ab8500_fg_irq_bh[0].name, irq, ret);
 
@@ -3233,9 +3234,11 @@ static int ab8500_fg_probe(struct platform_device *pdev)
 	/* We also have to free all registered irqs */
 	for (i = 0; i < ARRAY_SIZE(ab8500_fg_irq_th); i++) {
 		irq = platform_get_irq_byname(pdev, ab8500_fg_irq_th[i].name);
+		disable_irq_wake(irq);
 		free_irq(irq, di);
 	}
 	irq = platform_get_irq_byname(pdev, ab8500_fg_irq_bh[0].name);
+	disable_irq_wake(irq);
 	free_irq(irq, di);
 free_inst_curr_wq:
 	destroy_workqueue(di->fg_wq);
diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c
index 652acd8fbe48..27b534374d29 100644
--- a/drivers/thermal/db8500_thermal.c
+++ b/drivers/thermal/db8500_thermal.c
@@ -423,8 +423,7 @@ static int db8500_thermal_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_threaded_irq(&pdev->dev, low_irq, NULL,
-		prcmu_low_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT,
-		"dbx500_temp_low", pzone);
+		prcmu_low_irq_handler, IRQF_ONESHOT, "dbx500_temp_low", pzone);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to allocate temp low irq.\n");
 		goto out_unlock;
@@ -438,7 +437,7 @@ static int db8500_thermal_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_threaded_irq(&pdev->dev, high_irq, NULL,
-		prcmu_high_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT,
+		prcmu_high_irq_handler, IRQF_ONESHOT,
 		"dbx500_temp_high", pzone);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to allocate temp high irq.\n");
diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c
index 0c912d3950a5..425bb4e171e7 100644
--- a/drivers/usb/phy/phy-ab8500-usb.c
+++ b/drivers/usb/phy/phy-ab8500-usb.c
@@ -1179,12 +1179,13 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
 		}
 		err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 				ab8500_usb_link_status_irq,
-				IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
+				IRQF_SHARED | IRQF_ONESHOT,
 				"usb-link-status", ab);
 		if (err < 0) {
 			dev_err(ab->dev, "request_irq failed for link status irq\n");
 			return err;
 		}
+		enable_irq_wake(irq);
 	}
 
 	if (ab->flags & AB8500_USB_FLAG_USE_ID_WAKEUP_IRQ) {
@@ -1195,12 +1196,12 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
 		}
 		err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 				ab8500_usb_disconnect_irq,
-				IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
-				"usb-id-fall", ab);
+				IRQF_SHARED | IRQF_ONESHOT, "usb-id-fall", ab);
 		if (err < 0) {
 			dev_err(ab->dev, "request_irq failed for ID fall irq\n");
 			return err;
 		}
+		enable_irq_wake(irq);
 	}
 
 	if (ab->flags & AB8500_USB_FLAG_USE_VBUS_DET_IRQ) {
@@ -1211,12 +1212,13 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
 		}
 		err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 				ab8500_usb_disconnect_irq,
-				IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
+				IRQF_SHARED | IRQF_ONESHOT,
 				"usb-vbus-fall", ab);
 		if (err < 0) {
 			dev_err(ab->dev, "request_irq failed for Vbus fall irq\n");
 			return err;
 		}
+		enable_irq_wake(irq);
 	}
 
 	return 0;
-- 
1.9.1

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

* [PATCH 17/17] mfd : ab8500/db8500: fix the abuse of IRQF_NO_SUSPEND
  2015-09-21 15:47 ` [PATCH 17/17] mfd : ab8500/db8500: fix the abuse of IRQF_NO_SUSPEND Sudeep Holla
@ 2015-09-21 23:20   ` Lee Jones
  2015-09-22 10:04     ` Sudeep Holla
  0 siblings, 1 reply; 14+ messages in thread
From: Lee Jones @ 2015-09-21 23:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 21 Sep 2015, Sudeep Holla wrote:

> The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
> be left enabled so as to allow them to work as expected during the
> suspend-resume cycle, but doesn't guarantee that it will wake the system
> from a suspended state, enable_irq_wake is recommended to be used for
> the wakeup.
> 
> This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
> enable_irq_wake instead.
> 
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/mfd/ab8500-core.c        | 11 +++++++++--
>  drivers/mfd/ab8500-debugfs.c     |  2 +-
>  drivers/mfd/ab8500-gpadc.c       | 15 +++++++++++----
>  drivers/mfd/db8500-prcmu.c       | 24 +++++++++++++++++-------
>  drivers/power/ab8500_btemp.c     |  6 ++++--
>  drivers/power/ab8500_charger.c   |  6 ++++--
>  drivers/power/ab8500_fg.c        |  9 ++++++---
>  drivers/thermal/db8500_thermal.c |  5 ++---
>  drivers/usb/phy/phy-ab8500-usb.c | 10 ++++++----
>  9 files changed, 60 insertions(+), 28 deletions(-)

Is there a reason for bundling the changes in all of these subsystems
together into a single patch?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH 17/17] mfd : ab8500/db8500: fix the abuse of IRQF_NO_SUSPEND
  2015-09-21 23:20   ` Lee Jones
@ 2015-09-22 10:04     ` Sudeep Holla
  2015-09-22 21:03       ` Lee Jones
  0 siblings, 1 reply; 14+ messages in thread
From: Sudeep Holla @ 2015-09-22 10:04 UTC (permalink / raw)
  To: linux-arm-kernel



On 22/09/15 00:20, Lee Jones wrote:
> On Mon, 21 Sep 2015, Sudeep Holla wrote:
>
>> The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
>> be left enabled so as to allow them to work as expected during the
>> suspend-resume cycle, but doesn't guarantee that it will wake the system
>> from a suspended state, enable_irq_wake is recommended to be used for
>> the wakeup.
>>
>> This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
>> enable_irq_wake instead.
>>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Cc: linux-arm-kernel at lists.infradead.org
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>> ---
>>   drivers/mfd/ab8500-core.c        | 11 +++++++++--
>>   drivers/mfd/ab8500-debugfs.c     |  2 +-
>>   drivers/mfd/ab8500-gpadc.c       | 15 +++++++++++----
>>   drivers/mfd/db8500-prcmu.c       | 24 +++++++++++++++++-------
>>   drivers/power/ab8500_btemp.c     |  6 ++++--
>>   drivers/power/ab8500_charger.c   |  6 ++++--
>>   drivers/power/ab8500_fg.c        |  9 ++++++---
>>   drivers/thermal/db8500_thermal.c |  5 ++---
>>   drivers/usb/phy/phy-ab8500-usb.c | 10 ++++++----
>>   9 files changed, 60 insertions(+), 28 deletions(-)
>
> Is there a reason for bundling the changes in all of these subsystems
> together into a single patch?
>

No, I understand this needs to be split. Since I was not 100% confident
about this change, I wanted LinusW to review and provide feedback and
gets things working before I can split this changes. I must have added
RFC, but usually it gets ignored :)

Regards,
Sudeep

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

* [PATCH 17/17] mfd : ab8500/db8500: fix the abuse of IRQF_NO_SUSPEND
  2015-09-22 10:04     ` Sudeep Holla
@ 2015-09-22 21:03       ` Lee Jones
  2015-09-23  9:44         ` Sudeep Holla
  0 siblings, 1 reply; 14+ messages in thread
From: Lee Jones @ 2015-09-22 21:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 22 Sep 2015, Sudeep Holla wrote:
> On 22/09/15 00:20, Lee Jones wrote:
> >On Mon, 21 Sep 2015, Sudeep Holla wrote:
> >
> >>The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
> >>be left enabled so as to allow them to work as expected during the
> >>suspend-resume cycle, but doesn't guarantee that it will wake the system
> >>from a suspended state, enable_irq_wake is recommended to be used for
> >>the wakeup.
> >>
> >>This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
> >>enable_irq_wake instead.
> >>
> >>Cc: Linus Walleij <linus.walleij@linaro.org>
> >>Cc: linux-arm-kernel at lists.infradead.org
> >>Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> >>---
> >>  drivers/mfd/ab8500-core.c        | 11 +++++++++--
> >>  drivers/mfd/ab8500-debugfs.c     |  2 +-
> >>  drivers/mfd/ab8500-gpadc.c       | 15 +++++++++++----
> >>  drivers/mfd/db8500-prcmu.c       | 24 +++++++++++++++++-------
> >>  drivers/power/ab8500_btemp.c     |  6 ++++--
> >>  drivers/power/ab8500_charger.c   |  6 ++++--
> >>  drivers/power/ab8500_fg.c        |  9 ++++++---
> >>  drivers/thermal/db8500_thermal.c |  5 ++---
> >>  drivers/usb/phy/phy-ab8500-usb.c | 10 ++++++----
> >>  9 files changed, 60 insertions(+), 28 deletions(-)
> >
> >Is there a reason for bundling the changes in all of these subsystems
> >together into a single patch?
> >
> 
> No, I understand this needs to be split. Since I was not 100% confident
> about this change, I wanted LinusW to review and provide feedback and
> gets things working before I can split this changes. I must have added
> RFC, but usually it gets ignored :)

Best if Linus reviews the correct patch-set.  Please split and
resubmit.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH 17/17] mfd : ab8500/db8500: fix the abuse of IRQF_NO_SUSPEND
  2015-09-22 21:03       ` Lee Jones
@ 2015-09-23  9:44         ` Sudeep Holla
  0 siblings, 0 replies; 14+ messages in thread
From: Sudeep Holla @ 2015-09-23  9:44 UTC (permalink / raw)
  To: linux-arm-kernel



On 22/09/15 22:03, Lee Jones wrote:
> On Tue, 22 Sep 2015, Sudeep Holla wrote:
>> On 22/09/15 00:20, Lee Jones wrote:
>>> On Mon, 21 Sep 2015, Sudeep Holla wrote:
>>>
>>>> The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
>>>> be left enabled so as to allow them to work as expected during the
>>>> suspend-resume cycle, but doesn't guarantee that it will wake the system
>>> >from a suspended state, enable_irq_wake is recommended to be used for
>>>> the wakeup.
>>>>
>>>> This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
>>>> enable_irq_wake instead.
>>>>
>>>> Cc: Linus Walleij <linus.walleij@linaro.org>
>>>> Cc: linux-arm-kernel at lists.infradead.org
>>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>>> ---
>>>>   drivers/mfd/ab8500-core.c        | 11 +++++++++--
>>>>   drivers/mfd/ab8500-debugfs.c     |  2 +-
>>>>   drivers/mfd/ab8500-gpadc.c       | 15 +++++++++++----
>>>>   drivers/mfd/db8500-prcmu.c       | 24 +++++++++++++++++-------
>>>>   drivers/power/ab8500_btemp.c     |  6 ++++--
>>>>   drivers/power/ab8500_charger.c   |  6 ++++--
>>>>   drivers/power/ab8500_fg.c        |  9 ++++++---
>>>>   drivers/thermal/db8500_thermal.c |  5 ++---
>>>>   drivers/usb/phy/phy-ab8500-usb.c | 10 ++++++----
>>>>   9 files changed, 60 insertions(+), 28 deletions(-)
>>>
>>> Is there a reason for bundling the changes in all of these subsystems
>>> together into a single patch?
>>>
>>
>> No, I understand this needs to be split. Since I was not 100% confident
>> about this change, I wanted LinusW to review and provide feedback and
>> gets things working before I can split this changes. I must have added
>> RFC, but usually it gets ignored :)
>
> Best if Linus reviews the correct patch-set.  Please split and
> resubmit.
>
Sure, but would like to get some feedback before I proceed just to
ensure my understanding is correct.

Regards,
Sudeep

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

* [PATCH 12/17] ARM: OMAP2+: remove misuse of IRQF_NO_SUSPEND flag
  2015-09-21 15:47 ` [PATCH 12/17] ARM: OMAP2+: remove misuse of IRQF_NO_SUSPEND flag Sudeep Holla
@ 2015-10-12 20:20   ` Tony Lindgren
  2015-10-12 20:28     ` Tony Lindgren
  0 siblings, 1 reply; 14+ messages in thread
From: Tony Lindgren @ 2015-10-12 20:20 UTC (permalink / raw)
  To: linux-arm-kernel

* Sudeep Holla <sudeep.holla@arm.com> [150921 08:52]:
> The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
> be left enabled so as to allow them to work as expected during the
> suspend-resume cycle, but doesn't guarantee that it will wake the system
> from a suspended state, enable_irq_wake is recommended to be used for
> the wakeup.
> 
> This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
> enable_irq_wake instead.

Applying into omap-for-v4.4/cleanup thanks.

Tony

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

* [PATCH 12/17] ARM: OMAP2+: remove misuse of IRQF_NO_SUSPEND flag
  2015-10-12 20:20   ` Tony Lindgren
@ 2015-10-12 20:28     ` Tony Lindgren
  2015-10-13 10:42       ` Sudeep Holla
  0 siblings, 1 reply; 14+ messages in thread
From: Tony Lindgren @ 2015-10-12 20:28 UTC (permalink / raw)
  To: linux-arm-kernel

* Tony Lindgren <tony@atomide.com> [151012 13:27]:
> * Sudeep Holla <sudeep.holla@arm.com> [150921 08:52]:
> > The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
> > be left enabled so as to allow them to work as expected during the
> > suspend-resume cycle, but doesn't guarantee that it will wake the system
> > from a suspended state, enable_irq_wake is recommended to be used for
> > the wakeup.
> > 
> > This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
> > enable_irq_wake instead.
> 
> Applying into omap-for-v4.4/cleanup thanks.

Actually I don't think this does the right thing. The interrupts
in the $subject patch are in the always on powerdomain, and we really
want them to be excluded from the suspend.

So not applying without further explanations.

Regards,

Tony

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

* [PATCH 12/17] ARM: OMAP2+: remove misuse of IRQF_NO_SUSPEND flag
  2015-10-12 20:28     ` Tony Lindgren
@ 2015-10-13 10:42       ` Sudeep Holla
  2015-10-13 14:53         ` Tony Lindgren
  0 siblings, 1 reply; 14+ messages in thread
From: Sudeep Holla @ 2015-10-13 10:42 UTC (permalink / raw)
  To: linux-arm-kernel



On 12/10/15 21:28, Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [151012 13:27]:
>> * Sudeep Holla <sudeep.holla@arm.com> [150921 08:52]:
>>> The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
>>> be left enabled so as to allow them to work as expected during the
>>> suspend-resume cycle, but doesn't guarantee that it will wake the system
>>> from a suspended state, enable_irq_wake is recommended to be used for
>>> the wakeup.
>>>
>>> This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
>>> enable_irq_wake instead.
>>
>> Applying into omap-for-v4.4/cleanup thanks.
>
> Actually I don't think this does the right thing. The interrupts
> in the $subject patch are in the always on powerdomain, and we really

Agreed

> want them to be excluded from the suspend.
>

OK but what's wrong with this patch. At-least the name suggest it's a
wakeup interrupt. And using IRQF_NO_SUSPEND for the wakeup interrupt is
simply wrong.

> So not applying without further explanations.
>

But I don't understand the real need for IRQF_NO_SUSPEND over wakeup APIs ?

-- 
Regards,
Sudeep

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

* [PATCH 12/17] ARM: OMAP2+: remove misuse of IRQF_NO_SUSPEND flag
  2015-10-13 10:42       ` Sudeep Holla
@ 2015-10-13 14:53         ` Tony Lindgren
  2015-10-13 15:20           ` Sudeep Holla
  0 siblings, 1 reply; 14+ messages in thread
From: Tony Lindgren @ 2015-10-13 14:53 UTC (permalink / raw)
  To: linux-arm-kernel

* Sudeep Holla <sudeep.holla@arm.com> [151013 03:46]:
> 
> 
> On 12/10/15 21:28, Tony Lindgren wrote:
> >* Tony Lindgren <tony@atomide.com> [151012 13:27]:
> >>* Sudeep Holla <sudeep.holla@arm.com> [150921 08:52]:
> >>>The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
> >>>be left enabled so as to allow them to work as expected during the
> >>>suspend-resume cycle, but doesn't guarantee that it will wake the system
> >>>from a suspended state, enable_irq_wake is recommended to be used for
> >>>the wakeup.
> >>>
> >>>This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
> >>>enable_irq_wake instead.
> >>
> >>Applying into omap-for-v4.4/cleanup thanks.
> >
> >Actually I don't think this does the right thing. The interrupts
> >in the $subject patch are in the always on powerdomain, and we really
> 
> Agreed
> 
> >want them to be excluded from the suspend.
> >
> 
> OK but what's wrong with this patch. At-least the name suggest it's a
> wakeup interrupt. And using IRQF_NO_SUSPEND for the wakeup interrupt is
> simply wrong.

Hmm so if we have a separate always on irq controller for the wake-up events
and we want to keep it always on and exclude it from any suspend related
things.. Why would we not use IRQF_NO_SUSPEND on it?

Above you say "The IRQF_NO_SUSPEND flag is used to identify the interrupts
that should be left enabled so as to allow them to work as expected during
the suspend-resume cycle..." and that's exactly what we want to do here :)

For the dedicated wake-up interrupts, we have separate registers to enable
and disable them. The $subject irq is the shared interrupt that allows
making use of the pin specific wake-up interrupts, and for those yes we
are using enable_irq_wake().

> >So not applying without further explanations.
> >
> 
> But I don't understand the real need for IRQF_NO_SUSPEND over wakeup APIs ?

Because in the $subject case we just want to always keep it on and
never suspend it. It's unrelated to the wakeup APIs at least for the
omap related SoCs.

Regards,

Tony

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

* [PATCH 12/17] ARM: OMAP2+: remove misuse of IRQF_NO_SUSPEND flag
  2015-10-13 14:53         ` Tony Lindgren
@ 2015-10-13 15:20           ` Sudeep Holla
  0 siblings, 0 replies; 14+ messages in thread
From: Sudeep Holla @ 2015-10-13 15:20 UTC (permalink / raw)
  To: linux-arm-kernel



On 13/10/15 15:53, Tony Lindgren wrote:
> * Sudeep Holla <sudeep.holla@arm.com> [151013 03:46]:
>>
>>
>> On 12/10/15 21:28, Tony Lindgren wrote:
>>> * Tony Lindgren <tony@atomide.com> [151012 13:27]:
>>>> * Sudeep Holla <sudeep.holla@arm.com> [150921 08:52]:
>>>>> The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
>>>>> be left enabled so as to allow them to work as expected during the
>>>>> suspend-resume cycle, but doesn't guarantee that it will wake the system
>>>> >from a suspended state, enable_irq_wake is recommended to be used for
>>>>> the wakeup.
>>>>>
>>>>> This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
>>>>> enable_irq_wake instead.
>>>>
>>>> Applying into omap-for-v4.4/cleanup thanks.
>>>
>>> Actually I don't think this does the right thing. The interrupts
>>> in the $subject patch are in the always on powerdomain, and we really
>>
>> Agreed
>>
>>> want them to be excluded from the suspend.
>>>
>>
>> OK but what's wrong with this patch. At-least the name suggest it's a
>> wakeup interrupt. And using IRQF_NO_SUSPEND for the wakeup interrupt is
>> simply wrong.
>
> Hmm so if we have a separate always on irq controller for the wake-up events
> and we want to keep it always on and exclude it from any suspend related
> things.. Why would we not use IRQF_NO_SUSPEND on it?
>
> Above you say "The IRQF_NO_SUSPEND flag is used to identify the interrupts
> that should be left enabled so as to allow them to work as expected during
> the suspend-resume cycle..." and that's exactly what we want to do here :)
>

OK if these interrupts meet that criteria to use IRQF_NO_SUSPEND, then
it should be fine, my earlier argument was based on the assumption that
it's just another wakeup interrupt.

> For the dedicated wake-up interrupts, we have separate registers to enable
> and disable them. The $subject irq is the shared interrupt that allows
> making use of the pin specific wake-up interrupts, and for those yes we
> are using enable_irq_wake().
>

If it's already take care, then fine. I am just hunting all the misuse
of IRQF_NO_SUSPEND flag especially as wakeup source and fixing them

>>> So not applying without further explanations.
>>>
>>
>> But I don't understand the real need for IRQF_NO_SUSPEND over wakeup APIs ?
>
> Because in the $subject case we just want to always keep it on and
> never suspend it. It's unrelated to the wakeup APIs at least for the
> omap related SoCs.
>

OK, understood now. Thanks

--
Regards,
Sudeep

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

* [PATCH 14/17] media: st-rc: remove misuse of IRQF_NO_SUSPEND flag
  2015-09-21 15:47 ` [PATCH 14/17] media: st-rc: " Sudeep Holla
@ 2015-10-19 17:40   ` Sudeep Holla
  0 siblings, 0 replies; 14+ messages in thread
From: Sudeep Holla @ 2015-10-19 17:40 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 21/09/15 16:47, Sudeep Holla wrote:
> The device is set as wakeup capable using proper wakeup API but the
> driver misuses IRQF_NO_SUSPEND to set the interrupt as wakeup source
> which is incorrect.
>
> This patch removes the use of IRQF_NO_SUSPEND flags replacing it with
> enable_irq_wake instead.
>
> Cc: Srinivas Kandagatla <srinivas.kandagatla@gmail.com>
> Cc: Maxime Coquelin <maxime.coquelin@st.com>
> Cc: Patrice Chotard <patrice.chotard@st.com>
> Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

Can you pick couple of these media patches ?

-- 
Regards,
Sudeep

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

end of thread, other threads:[~2015-10-19 17:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1442850433-5903-1-git-send-email-sudeep.holla@arm.com>
2015-09-21 15:47 ` [PATCH 10/17] tty/serial: st-asc: drop the use of IRQF_NO_SUSPEND Sudeep Holla
2015-09-21 15:47 ` [PATCH 12/17] ARM: OMAP2+: remove misuse of IRQF_NO_SUSPEND flag Sudeep Holla
2015-10-12 20:20   ` Tony Lindgren
2015-10-12 20:28     ` Tony Lindgren
2015-10-13 10:42       ` Sudeep Holla
2015-10-13 14:53         ` Tony Lindgren
2015-10-13 15:20           ` Sudeep Holla
2015-09-21 15:47 ` [PATCH 14/17] media: st-rc: " Sudeep Holla
2015-10-19 17:40   ` Sudeep Holla
2015-09-21 15:47 ` [PATCH 17/17] mfd : ab8500/db8500: fix the abuse of IRQF_NO_SUSPEND Sudeep Holla
2015-09-21 23:20   ` Lee Jones
2015-09-22 10:04     ` Sudeep Holla
2015-09-22 21:03       ` Lee Jones
2015-09-23  9:44         ` Sudeep Holla

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).