aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-10 14:35:36 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-10 14:35:36 -0500
commit4ba24fef3eb3b142197135223b90ced2f319cd53 (patch)
treea20c125b27740ec7b4c761b11d801108e1b316b2 /kernel/irq/manage.c
parent47c1ffb2b6b630894e9a16442611c056ab21c057 (diff)
parent98a4a59ee31a12105a2b84f5b8b515ac2cb208ef (diff)
Merge branch 'next' into for-linus
Prepare first round of input updates for 3.20.
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 3dc6a61bf06a..80692373abd6 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -183,6 +183,7 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
183 ret = chip->irq_set_affinity(data, mask, force); 183 ret = chip->irq_set_affinity(data, mask, force);
184 switch (ret) { 184 switch (ret) {
185 case IRQ_SET_MASK_OK: 185 case IRQ_SET_MASK_OK:
186 case IRQ_SET_MASK_OK_DONE:
186 cpumask_copy(data->affinity, mask); 187 cpumask_copy(data->affinity, mask);
187 case IRQ_SET_MASK_OK_NOCOPY: 188 case IRQ_SET_MASK_OK_NOCOPY:
188 irq_set_thread_affinity(desc); 189 irq_set_thread_affinity(desc);
@@ -382,14 +383,8 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask)
382} 383}
383#endif 384#endif
384 385
385void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend) 386void __disable_irq(struct irq_desc *desc, unsigned int irq)
386{ 387{
387 if (suspend) {
388 if (!desc->action || (desc->action->flags & IRQF_NO_SUSPEND))
389 return;
390 desc->istate |= IRQS_SUSPENDED;
391 }
392
393 if (!desc->depth++) 388 if (!desc->depth++)
394 irq_disable(desc); 389 irq_disable(desc);
395} 390}
@@ -401,7 +396,7 @@ static int __disable_irq_nosync(unsigned int irq)
401 396
402 if (!desc) 397 if (!desc)
403 return -EINVAL; 398 return -EINVAL;
404 __disable_irq(desc, irq, false); 399 __disable_irq(desc, irq);
405 irq_put_desc_busunlock(desc, flags); 400 irq_put_desc_busunlock(desc, flags);
406 return 0; 401 return 0;
407} 402}
@@ -442,20 +437,8 @@ void disable_irq(unsigned int irq)
442} 437}
443EXPORT_SYMBOL(disable_irq); 438EXPORT_SYMBOL(disable_irq);
444 439
445void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume) 440void __enable_irq(struct irq_desc *desc, unsigned int irq)
446{ 441{
447 if (resume) {
448 if (!(desc->istate & IRQS_SUSPENDED)) {
449 if (!desc->action)
450 return;
451 if (!(desc->action->flags & IRQF_FORCE_RESUME))
452 return;
453 /* Pretend that it got disabled ! */
454 desc->depth++;
455 }
456 desc->istate &= ~IRQS_SUSPENDED;
457 }
458
459 switch (desc->depth) { 442 switch (desc->depth) {
460 case 0: 443 case 0:
461 err_out: 444 err_out:
@@ -497,7 +480,7 @@ void enable_irq(unsigned int irq)
497 KERN_ERR "enable_irq before setup/request_irq: irq %u\n", irq)) 480 KERN_ERR "enable_irq before setup/request_irq: irq %u\n", irq))
498 goto out; 481 goto out;
499 482
500 __enable_irq(desc, irq, false); 483 __enable_irq(desc, irq);
501out: 484out:
502 irq_put_desc_busunlock(desc, flags); 485 irq_put_desc_busunlock(desc, flags);
503} 486}
@@ -618,6 +601,7 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned int irq,
618 601
619 switch (ret) { 602 switch (ret) {
620 case IRQ_SET_MASK_OK: 603 case IRQ_SET_MASK_OK:
604 case IRQ_SET_MASK_OK_DONE:
621 irqd_clear(&desc->irq_data, IRQD_TRIGGER_MASK); 605 irqd_clear(&desc->irq_data, IRQD_TRIGGER_MASK);
622 irqd_set(&desc->irq_data, flags); 606 irqd_set(&desc->irq_data, flags);
623 607
@@ -1218,6 +1202,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
1218 new->irq = irq; 1202 new->irq = irq;
1219 *old_ptr = new; 1203 *old_ptr = new;
1220 1204
1205 irq_pm_install_action(desc, new);
1206
1221 /* Reset broken irq detection when installing new handler */ 1207 /* Reset broken irq detection when installing new handler */
1222 desc->irq_count = 0; 1208 desc->irq_count = 0;
1223 desc->irqs_unhandled = 0; 1209 desc->irqs_unhandled = 0;
@@ -1228,7 +1214,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
1228 */ 1214 */
1229 if (shared && (desc->istate & IRQS_SPURIOUS_DISABLED)) { 1215 if (shared && (desc->istate & IRQS_SPURIOUS_DISABLED)) {
1230 desc->istate &= ~IRQS_SPURIOUS_DISABLED; 1216 desc->istate &= ~IRQS_SPURIOUS_DISABLED;
1231 __enable_irq(desc, irq, false); 1217 __enable_irq(desc, irq);
1232 } 1218 }
1233 1219
1234 raw_spin_unlock_irqrestore(&desc->lock, flags); 1220 raw_spin_unlock_irqrestore(&desc->lock, flags);
@@ -1336,6 +1322,8 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id)
1336 /* Found it - now remove it from the list of entries: */ 1322 /* Found it - now remove it from the list of entries: */
1337 *action_ptr = action->next; 1323 *action_ptr = action->next;
1338 1324
1325 irq_pm_remove_action(desc, action);
1326
1339 /* If this was the last handler, shut down the IRQ line: */ 1327 /* If this was the last handler, shut down the IRQ line: */
1340 if (!desc->action) { 1328 if (!desc->action) {
1341 irq_shutdown(desc); 1329 irq_shutdown(desc);