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

s390/qdio: warn about unexpected SLSB states

The way we produce SBALs to the device (first update q->nr_buf_used,
then update the SLSB) should ensure that we never see some of the
SLSB states when scanning the queue for progress.
So make some noise if we do, this implies a bug in our SBAL tracking.

Also tweak the WARN msg to provide more information.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Julian Wiedmann and committed by
Vasily Gorbik
c920c545 3d6c6f20

+11 -5
+11 -5
drivers/s390/cio/qdio_main.c
··· 503 503 account_sbals_error(q, count); 504 504 return count; 505 505 case SLSB_CU_INPUT_EMPTY: 506 - case SLSB_P_INPUT_NOT_INIT: 507 - case SLSB_P_INPUT_ACK: 508 506 if (q->irq_ptr->perf_stat_enabled) 509 507 q->q_stats.nr_sbal_nop++; 510 508 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in nop:%1d %#02x", 511 509 q->nr, start); 512 510 return 0; 511 + case SLSB_P_INPUT_NOT_INIT: 512 + case SLSB_P_INPUT_ACK: 513 + /* We should never see this state, throw a WARN: */ 513 514 default: 514 - WARN_ON_ONCE(1); 515 + dev_WARN_ONCE(&q->irq_ptr->cdev->dev, 1, 516 + "found state %#x at index %u on queue %u\n", 517 + state, start, q->nr); 515 518 return 0; 516 519 } 517 520 } ··· 719 716 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "out primed:%1d", 720 717 q->nr); 721 718 return 0; 722 - case SLSB_P_OUTPUT_NOT_INIT: 723 719 case SLSB_P_OUTPUT_HALTED: 724 720 return 0; 721 + case SLSB_P_OUTPUT_NOT_INIT: 722 + /* We should never see this state, throw a WARN: */ 725 723 default: 726 - WARN_ON_ONCE(1); 724 + dev_WARN_ONCE(&q->irq_ptr->cdev->dev, 1, 725 + "found state %#x at index %u on queue %u\n", 726 + state, start, q->nr); 727 727 return 0; 728 728 } 729 729 }