summaryrefslogtreecommitdiffstats
path: root/0001-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch
diff options
context:
space:
mode:
authorJustin M. Forbes <jforbes@fedoraproject.org>2020-06-30 09:24:22 -0500
committerJustin M. Forbes <jforbes@fedoraproject.org>2020-06-30 09:24:22 -0500
commitd176dfce22f5ead7a6018edb69757bc8840cc008 (patch)
treeaa15398098e0f20a9fb643441ec8443b2ffd6328 /0001-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch
parent61b5e2fd06a4be7134afb1cd363002e015123f7f (diff)
downloadkernel-d176dfce22f5ead7a6018edb69757bc8840cc008.tar.gz
kernel-d176dfce22f5ead7a6018edb69757bc8840cc008.tar.xz
kernel-d176dfce22f5ead7a6018edb69757bc8840cc008.zip
kernel-5.8.0-0.rc3.20200630git7c30b859a947.1
* Tue Jun 30 2020 Fedora Kernel Team <kernel-team@fedoraproject.org> [5.8.0-0.rc3.20200630git7c30b859a947.1] - 7c30b859a947 rebase - Updated changelog for the release based on v5.8-rc3 (Fedora Kernel Team) Resolves: rhbz# Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
Diffstat (limited to '0001-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch')
-rw-r--r--0001-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch62
1 files changed, 31 insertions, 31 deletions
diff --git a/0001-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch b/0001-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch
index 0bcfb99b9..4d7bef554 100644
--- a/0001-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch
+++ b/0001-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch
@@ -30,25 +30,25 @@ index 8cffa84c9650..6c4e3675601a 100644
struct rmi_data *hdata = hid_get_drvdata(hdev);
struct rmi_device *rmi_dev = hdata->xport.rmi_dev;
- unsigned long flags;
-
+
if (!(test_bit(RMI_STARTED, &hdata->flags)))
return 0;
-
+
- local_irq_save(flags);
-
rmi_set_attn_data(rmi_dev, data[1], &data[2], size - 2);
-
+
- generic_handle_irq(hdata->rmi_irq);
-
- local_irq_restore(flags);
-
return 1;
}
-
+
@@ -592,56 +585,6 @@ static const struct rmi_transport_ops hid_rmi_ops = {
.reset = rmi_hid_reset,
};
-
+
-static void rmi_irq_teardown(void *data)
-{
- struct rmi_data *hdata = data;
@@ -103,9 +103,9 @@ index 8cffa84c9650..6c4e3675601a 100644
{
struct rmi_data *data = NULL;
@@ -714,18 +657,11 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
-
+
mutex_init(&data->page_mutex);
-
+
- ret = rmi_setup_irq_domain(hdev);
- if (ret) {
- hid_err(hdev, "failed to allocate IRQ domain\n");
@@ -114,26 +114,26 @@ index 8cffa84c9650..6c4e3675601a 100644
-
if (data->device_flags & RMI_DEVICE_HAS_PHYS_BUTTONS)
rmi_hid_pdata.f30_data.disable = true;
-
+
data->xport.dev = hdev->dev.parent;
data->xport.pdata = rmi_hid_pdata;
- data->xport.pdata.irq = data->rmi_irq;
data->xport.proto_name = "hid";
data->xport.ops = &hid_rmi_ops;
-
+
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 258d5fe3d395..f7298e3dc8f3 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -182,34 +182,47 @@ void rmi_set_attn_data(struct rmi_device *rmi_dev, unsigned long irq_status,
attn_data.data = fifo_data;
-
+
kfifo_put(&drvdata->attn_fifo, attn_data);
+
+ schedule_work(&drvdata->attn_work);
}
EXPORT_SYMBOL_GPL(rmi_set_attn_data);
-
+
-static irqreturn_t rmi_irq_fn(int irq, void *dev_id)
+static void attn_callback(struct work_struct *work)
{
@@ -144,7 +144,7 @@ index 258d5fe3d395..f7298e3dc8f3 100644
+ attn_work);
struct rmi4_attn_data attn_data = {0};
int ret, count;
-
+
count = kfifo_get(&drvdata->attn_fifo, &attn_data);
- if (count) {
- *(drvdata->irq_status) = attn_data.irq_status;
@@ -152,7 +152,7 @@ index 258d5fe3d395..f7298e3dc8f3 100644
- }
+ if (!count)
+ return;
-
+
- ret = rmi_process_interrupt_requests(rmi_dev);
+ *(drvdata->irq_status) = attn_data.irq_status;
+ drvdata->attn_data = attn_data;
@@ -162,14 +162,14 @@ index 258d5fe3d395..f7298e3dc8f3 100644
- rmi_dbg(RMI_DEBUG_CORE, &rmi_dev->dev,
+ rmi_dbg(RMI_DEBUG_CORE, &drvdata->rmi_dev->dev,
"Failed to process interrupt request: %d\n", ret);
-
+
- if (count) {
- kfree(attn_data.data);
- drvdata->attn_data.data = NULL;
- }
+ kfree(attn_data.data);
+ drvdata->attn_data.data = NULL;
-
+
if (!kfifo_is_empty(&drvdata->attn_fifo))
- return rmi_irq_fn(irq, dev_id);
+ schedule_work(&drvdata->attn_work);
@@ -184,7 +184,7 @@ index 258d5fe3d395..f7298e3dc8f3 100644
+ if (ret)
+ rmi_dbg(RMI_DEBUG_CORE, &rmi_dev->dev,
+ "Failed to process interrupt request: %d\n", ret);
-
+
return IRQ_HANDLED;
}
@@ -217,7 +230,6 @@ static irqreturn_t rmi_irq_fn(int irq, void *dev_id)
@@ -194,20 +194,20 @@ index 258d5fe3d395..f7298e3dc8f3 100644
- struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
int irq_flags = irq_get_trigger_type(pdata->irq);
int ret;
-
+
@@ -235,8 +247,6 @@ static int rmi_irq_init(struct rmi_device *rmi_dev)
return ret;
}
-
+
- data->enabled = true;
-
return 0;
}
-
+
@@ -886,23 +896,27 @@ void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake)
if (data->enabled)
goto out;
-
+
- enable_irq(irq);
- data->enabled = true;
- if (clear_wake && device_may_wakeup(rmi_dev->xport->dev)) {
@@ -227,7 +227,7 @@ index 258d5fe3d395..f7298e3dc8f3 100644
+ "Failed to disable irq for wake: %d\n",
+ retval);
+ }
-
+
- /*
- * Call rmi_process_interrupt_requests() after enabling irq,
- * otherwise we may lose interrupt on edge-triggered systems.
@@ -245,12 +245,12 @@ index 258d5fe3d395..f7298e3dc8f3 100644
+ } else {
+ data->enabled = true;
+ }
-
+
out:
mutex_unlock(&data->enabled_mutex);
@@ -922,20 +936,22 @@ void rmi_disable_irq(struct rmi_device *rmi_dev, bool enable_wake)
goto out;
-
+
data->enabled = false;
- disable_irq(irq);
- if (enable_wake && device_may_wakeup(rmi_dev->xport->dev)) {
@@ -283,21 +283,21 @@ index 258d5fe3d395..f7298e3dc8f3 100644
+ kfree(attn_data.data);
+ }
}
-
+
out:
@@ -981,6 +997,8 @@ static int rmi_driver_remove(struct device *dev)
irq_domain_remove(data->irqdomain);
data->irqdomain = NULL;
-
+
+ cancel_work_sync(&data->attn_work);
+
rmi_f34_remove_sysfs(rmi_dev);
rmi_free_function_list(rmi_dev);
-
+
@@ -1219,9 +1237,15 @@ static int rmi_driver_probe(struct device *dev)
}
}
-
+
- retval = rmi_irq_init(rmi_dev);
- if (retval < 0)
- goto err_destroy_functions;
@@ -310,7 +310,7 @@ index 258d5fe3d395..f7298e3dc8f3 100644
+ data->enabled = true;
+
+ INIT_WORK(&data->attn_work, attn_callback);
-
+
if (data->f01_container->dev.driver) {
/* Driver already bound, so enable ATTN now. */
diff --git a/include/linux/rmi.h b/include/linux/rmi.h
@@ -318,13 +318,13 @@ index 7b22366d0065..307a651b2755 100644
--- a/include/linux/rmi.h
+++ b/include/linux/rmi.h
@@ -363,6 +363,7 @@ struct rmi_driver_data {
-
+
struct rmi4_attn_data attn_data;
DECLARE_KFIFO(attn_fifo, struct rmi4_attn_data, 16);
+ struct work_struct attn_work;
};
-
+
int rmi_register_transport_device(struct rmi_transport_dev *xport);
--
-2.25.4
+2.26.2