.. | .. |
---|
31 | 31 | cpulist_parse(str, irq_default_affinity); |
---|
32 | 32 | /* |
---|
33 | 33 | * Set at least the boot cpu. We don't want to end up with |
---|
34 | | - * bugreports caused by random comandline masks |
---|
| 34 | + * bugreports caused by random commandline masks |
---|
35 | 35 | */ |
---|
36 | 36 | cpumask_set_cpu(smp_processor_id(), irq_default_affinity); |
---|
37 | 37 | return 1; |
---|
.. | .. |
---|
288 | 288 | if (irq_kobj_base) { |
---|
289 | 289 | /* |
---|
290 | 290 | * Continue even in case of failure as this is nothing |
---|
291 | | - * crucial. |
---|
| 291 | + * crucial and failures in the late irq_sysfs_init() |
---|
| 292 | + * cannot be rolled back. |
---|
292 | 293 | */ |
---|
293 | 294 | if (kobject_add(&desc->kobj, irq_kobj_base, "%d", irq)) |
---|
294 | 295 | pr_warn("Failed to add kobject for irq %d\n", irq); |
---|
| 296 | + else |
---|
| 297 | + desc->istate |= IRQS_SYSFS; |
---|
295 | 298 | } |
---|
296 | 299 | } |
---|
297 | 300 | |
---|
298 | 301 | static void irq_sysfs_del(struct irq_desc *desc) |
---|
299 | 302 | { |
---|
300 | 303 | /* |
---|
301 | | - * If irq_sysfs_init() has not yet been invoked (early boot), then |
---|
302 | | - * irq_kobj_base is NULL and the descriptor was never added. |
---|
303 | | - * kobject_del() complains about a object with no parent, so make |
---|
304 | | - * it conditional. |
---|
| 304 | + * Only invoke kobject_del() when kobject_add() was successfully |
---|
| 305 | + * invoked for the descriptor. This covers both early boot, where |
---|
| 306 | + * sysfs is not initialized yet, and the case of a failed |
---|
| 307 | + * kobject_add() invocation. |
---|
305 | 308 | */ |
---|
306 | | - if (irq_kobj_base) |
---|
| 309 | + if (desc->istate & IRQS_SYSFS) |
---|
307 | 310 | kobject_del(&desc->kobj); |
---|
308 | 311 | } |
---|
309 | 312 | |
---|