Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/qdio: clarify handler logic for qdio_handle_activate_check()

qdio_handle_activate_check() tries to re-use one of the queue-specific
handlers to report that the ACTIVATE ccw has been terminated. But the
logic to select that handler is overly complex - in practice both
qdio drivers have at least one Input Queue, so we never take the other
paths.

Make things more obvious by removing this unused code, and clearly
spelling out that we re-use the Input Handler for generic error
reporting. This also paves the way for a world without queue-specific
error handlers.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

authored by

Julian Wiedmann and committed by
Heiko Carstens
513251fe 0a86cdcb

+14 -15
+1 -1
arch/s390/include/asm/qdio.h
··· 312 312 * @qib_rflags: rflags to set 313 313 * @no_input_qs: number of input queues 314 314 * @no_output_qs: number of output queues 315 - * @input_handler: handler to be called for input queues 315 + * @input_handler: handler to be called for input queues, and device-wide errors 316 316 * @output_handler: handler to be called for output queues 317 317 * @irq_poll: Data IRQ polling handler 318 318 * @scan_threshold: # of in-use buffers that triggers scan on output queue
+1
drivers/s390/cio/qdio.h
··· 240 240 241 241 struct qdio_ssqd_desc ssqd_desc; 242 242 void (*orig_handler) (struct ccw_device *, unsigned long, struct irb *); 243 + qdio_handler_t (*error_handler); 243 244 244 245 int perf_stat_enabled; 245 246
+11 -14
drivers/s390/cio/qdio_main.c
··· 654 654 unsigned long intparm, int cstat, 655 655 int dstat) 656 656 { 657 - struct qdio_q *q; 657 + unsigned int first_to_check = 0; 658 658 659 659 DBF_ERROR("%4x ACT CHECK", irq_ptr->schid.sch_no); 660 660 DBF_ERROR("intp :%lx", intparm); 661 661 DBF_ERROR("ds: %2x cs:%2x", dstat, cstat); 662 662 663 - if (irq_ptr->nr_input_qs) { 664 - q = irq_ptr->input_qs[0]; 665 - } else if (irq_ptr->nr_output_qs) { 666 - q = irq_ptr->output_qs[0]; 667 - } else { 668 - dump_stack(); 669 - goto no_handler; 670 - } 663 + /* zfcp wants this: */ 664 + if (irq_ptr->nr_input_qs) 665 + first_to_check = irq_ptr->input_qs[0]->first_to_check; 671 666 672 - q->handler(irq_ptr->cdev, QDIO_ERROR_ACTIVATE, 0, q->first_to_check, 673 - 0, irq_ptr->int_parm); 674 - no_handler: 667 + irq_ptr->error_handler(irq_ptr->cdev, QDIO_ERROR_ACTIVATE, 0, 668 + first_to_check, 0, irq_ptr->int_parm); 675 669 qdio_set_state(irq_ptr, QDIO_IRQ_STATE_STOPPED); 676 670 /* 677 671 * In case of z/VM LGR (Live Guest Migration) QDIO recovery will happen. ··· 990 996 init_data->no_output_qs > irq_ptr->max_output_qs) 991 997 return -EINVAL; 992 998 993 - if ((init_data->no_input_qs && !init_data->input_handler) || 994 - (init_data->no_output_qs && !init_data->output_handler)) 999 + /* Needed as error_handler: */ 1000 + if (!init_data->input_handler) 1001 + return -EINVAL; 1002 + 1003 + if (init_data->no_output_qs && !init_data->output_handler) 995 1004 return -EINVAL; 996 1005 997 1006 if (!init_data->input_sbal_addr_array ||
+1
drivers/s390/cio/qdio_setup.c
··· 362 362 irq_ptr->debugfs_dev = NULL; 363 363 irq_ptr->sch_token = irq_ptr->perf_stat_enabled = 0; 364 364 irq_ptr->state = QDIO_IRQ_STATE_INACTIVE; 365 + irq_ptr->error_handler = init_data->input_handler; 365 366 366 367 irq_ptr->int_parm = init_data->int_parm; 367 368 irq_ptr->nr_input_qs = init_data->no_input_qs;