hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/kernel/irq/proc.c
....@@ -100,10 +100,6 @@
100100 return 0;
101101 }
102102
103
-#ifndef is_affinity_mask_valid
104
-#define is_affinity_mask_valid(val) 1
105
-#endif
106
-
107103 int no_irq_affinity;
108104 static int irq_affinity_proc_show(struct seq_file *m, void *v)
109105 {
....@@ -158,17 +154,12 @@
158154 if (err)
159155 goto free_cpumask;
160156
161
- if (!is_affinity_mask_valid(new_value)) {
162
- err = -EINVAL;
163
- goto free_cpumask;
164
- }
165
-
166157 /*
167158 * Do not allow disabling IRQs completely - it's a too easy
168159 * way to make the system unusable accidentally :-) At least
169
- * one online CPU still has to be targeted.
160
+ * one active CPU still has to be targeted.
170161 */
171
- if (!cpumask_intersects(new_value, cpu_online_mask)) {
162
+ if (!cpumask_intersects(new_value, cpu_active_mask)) {
172163 /*
173164 * Special case for empty set - allow the architecture code
174165 * to set default SMP affinity.
....@@ -207,20 +198,20 @@
207198 return single_open(file, irq_affinity_list_proc_show, PDE_DATA(inode));
208199 }
209200
210
-static const struct file_operations irq_affinity_proc_fops = {
211
- .open = irq_affinity_proc_open,
212
- .read = seq_read,
213
- .llseek = seq_lseek,
214
- .release = single_release,
215
- .write = irq_affinity_proc_write,
201
+static const struct proc_ops irq_affinity_proc_ops = {
202
+ .proc_open = irq_affinity_proc_open,
203
+ .proc_read = seq_read,
204
+ .proc_lseek = seq_lseek,
205
+ .proc_release = single_release,
206
+ .proc_write = irq_affinity_proc_write,
216207 };
217208
218
-static const struct file_operations irq_affinity_list_proc_fops = {
219
- .open = irq_affinity_list_proc_open,
220
- .read = seq_read,
221
- .llseek = seq_lseek,
222
- .release = single_release,
223
- .write = irq_affinity_list_proc_write,
209
+static const struct proc_ops irq_affinity_list_proc_ops = {
210
+ .proc_open = irq_affinity_list_proc_open,
211
+ .proc_read = seq_read,
212
+ .proc_lseek = seq_lseek,
213
+ .proc_release = single_release,
214
+ .proc_write = irq_affinity_list_proc_write,
224215 };
225216
226217 #ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
....@@ -254,11 +245,6 @@
254245 if (err)
255246 goto out;
256247
257
- if (!is_affinity_mask_valid(new_value)) {
258
- err = -EINVAL;
259
- goto out;
260
- }
261
-
262248 /*
263249 * Do not allow disabling IRQs completely - it's a too easy
264250 * way to make the system unusable accidentally :-) At least
....@@ -282,12 +268,12 @@
282268 return single_open(file, default_affinity_show, PDE_DATA(inode));
283269 }
284270
285
-static const struct file_operations default_affinity_proc_fops = {
286
- .open = default_affinity_open,
287
- .read = seq_read,
288
- .llseek = seq_lseek,
289
- .release = single_release,
290
- .write = default_affinity_write,
271
+static const struct proc_ops default_affinity_proc_ops = {
272
+ .proc_open = default_affinity_open,
273
+ .proc_read = seq_read,
274
+ .proc_lseek = seq_lseek,
275
+ .proc_release = single_release,
276
+ .proc_write = default_affinity_write,
291277 };
292278
293279 static int irq_node_proc_show(struct seq_file *m, void *v)
....@@ -378,7 +364,7 @@
378364 #ifdef CONFIG_SMP
379365 /* create /proc/irq/<irq>/smp_affinity */
380366 proc_create_data("smp_affinity", 0644, desc->dir,
381
- &irq_affinity_proc_fops, irqp);
367
+ &irq_affinity_proc_ops, irqp);
382368
383369 /* create /proc/irq/<irq>/affinity_hint */
384370 proc_create_single_data("affinity_hint", 0444, desc->dir,
....@@ -386,7 +372,7 @@
386372
387373 /* create /proc/irq/<irq>/smp_affinity_list */
388374 proc_create_data("smp_affinity_list", 0644, desc->dir,
389
- &irq_affinity_list_proc_fops, irqp);
375
+ &irq_affinity_list_proc_ops, irqp);
390376
391377 proc_create_single_data("node", 0444, desc->dir, irq_node_proc_show,
392378 irqp);
....@@ -437,7 +423,7 @@
437423 {
438424 #ifdef CONFIG_SMP
439425 proc_create("irq/default_smp_affinity", 0644, NULL,
440
- &default_affinity_proc_fops);
426
+ &default_affinity_proc_ops);
441427 #endif
442428 }
443429
....@@ -499,7 +485,7 @@
499485
500486 rcu_read_lock();
501487 desc = irq_to_desc(i);
502
- if (!desc)
488
+ if (!desc || irq_settings_is_hidden(desc))
503489 goto outsparse;
504490
505491 if (desc->kstat_irqs)