aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStefan Raspl <raspl@linux.vnet.ibm.com>2012-11-18 21:46:50 -0500
committerDavid S. Miller <davem@davemloft.net>2012-11-19 14:19:00 -0500
commit18af5c1797156879bf18d545c745637eebb234e8 (patch)
tree6dfe95809e2923b36674e34b0df7e2c77b4fb18c /drivers
parent395672e098d3094388b6204a8c80958d9212dbb4 (diff)
qeth: Remove BUG_ONs
Remove BUG_ONs or convert to WARN_ON_ONCE/WARN_ONs since a failure within a networking device driver is no reason to shut down the entire machine. Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Reviewed-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/net/qeth_core_main.c14
-rw-r--r--drivers/s390/net/qeth_l2_main.c3
-rw-r--r--drivers/s390/net/qeth_l3_main.c7
3 files changed, 10 insertions, 14 deletions
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index b904c8c7bc1d..638a57f4d8a1 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -383,7 +383,7 @@ static inline void qeth_cleanup_handled_pending(struct qeth_qdio_out_q *q,
383 qeth_release_skbs(c); 383 qeth_release_skbs(c);
384 384
385 c = f->next_pending; 385 c = f->next_pending;
386 BUG_ON(head->next_pending != f); 386 WARN_ON_ONCE(head->next_pending != f);
387 head->next_pending = c; 387 head->next_pending = c;
388 kmem_cache_free(qeth_qdio_outbuf_cache, f); 388 kmem_cache_free(qeth_qdio_outbuf_cache, f);
389 } else { 389 } else {
@@ -415,13 +415,12 @@ static inline void qeth_qdio_handle_aob(struct qeth_card *card,
415 buffer = (struct qeth_qdio_out_buffer *) aob->user1; 415 buffer = (struct qeth_qdio_out_buffer *) aob->user1;
416 QETH_CARD_TEXT_(card, 5, "%lx", aob->user1); 416 QETH_CARD_TEXT_(card, 5, "%lx", aob->user1);
417 417
418 BUG_ON(buffer == NULL);
419
420 if (atomic_cmpxchg(&buffer->state, QETH_QDIO_BUF_PRIMED, 418 if (atomic_cmpxchg(&buffer->state, QETH_QDIO_BUF_PRIMED,
421 QETH_QDIO_BUF_IN_CQ) == QETH_QDIO_BUF_PRIMED) { 419 QETH_QDIO_BUF_IN_CQ) == QETH_QDIO_BUF_PRIMED) {
422 notification = TX_NOTIFY_OK; 420 notification = TX_NOTIFY_OK;
423 } else { 421 } else {
424 BUG_ON(atomic_read(&buffer->state) != QETH_QDIO_BUF_PENDING); 422 WARN_ON_ONCE(atomic_read(&buffer->state) !=
423 QETH_QDIO_BUF_PENDING);
425 atomic_set(&buffer->state, QETH_QDIO_BUF_IN_CQ); 424 atomic_set(&buffer->state, QETH_QDIO_BUF_IN_CQ);
426 notification = TX_NOTIFY_DELAYED_OK; 425 notification = TX_NOTIFY_DELAYED_OK;
427 } 426 }
@@ -1131,7 +1130,7 @@ static void qeth_release_skbs(struct qeth_qdio_out_buffer *buf)
1131 notify_general_error = 1; 1130 notify_general_error = 1;
1132 1131
1133 /* release may never happen from within CQ tasklet scope */ 1132 /* release may never happen from within CQ tasklet scope */
1134 BUG_ON(atomic_read(&buf->state) == QETH_QDIO_BUF_IN_CQ); 1133 WARN_ON_ONCE(atomic_read(&buf->state) == QETH_QDIO_BUF_IN_CQ);
1135 1134
1136 skb = skb_dequeue(&buf->skb_list); 1135 skb = skb_dequeue(&buf->skb_list);
1137 while (skb) { 1136 while (skb) {
@@ -2400,7 +2399,7 @@ static int qeth_alloc_qdio_buffers(struct qeth_card *card)
2400 card->qdio.out_qs[i]->queue_no = i; 2399 card->qdio.out_qs[i]->queue_no = i;
2401 /* give outbound qeth_qdio_buffers their qdio_buffers */ 2400 /* give outbound qeth_qdio_buffers their qdio_buffers */
2402 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) { 2401 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) {
2403 BUG_ON(card->qdio.out_qs[i]->bufs[j] != NULL); 2402 WARN_ON(card->qdio.out_qs[i]->bufs[j] != NULL);
2404 if (qeth_init_qdio_out_buf(card->qdio.out_qs[i], j)) 2403 if (qeth_init_qdio_out_buf(card->qdio.out_qs[i], j))
2405 goto out_freeoutqbufs; 2404 goto out_freeoutqbufs;
2406 } 2405 }
@@ -3565,7 +3564,7 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,
3565 if (queue->bufstates && 3564 if (queue->bufstates &&
3566 (queue->bufstates[bidx].flags & 3565 (queue->bufstates[bidx].flags &
3567 QDIO_OUTBUF_STATE_FLAG_PENDING) != 0) { 3566 QDIO_OUTBUF_STATE_FLAG_PENDING) != 0) {
3568 BUG_ON(card->options.cq != QETH_CQ_ENABLED); 3567 WARN_ON_ONCE(card->options.cq != QETH_CQ_ENABLED);
3569 3568
3570 if (atomic_cmpxchg(&buffer->state, 3569 if (atomic_cmpxchg(&buffer->state,
3571 QETH_QDIO_BUF_PRIMED, 3570 QETH_QDIO_BUF_PRIMED,
@@ -3579,7 +3578,6 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,
3579 QETH_CARD_TEXT(queue->card, 5, "aob"); 3578 QETH_CARD_TEXT(queue->card, 5, "aob");
3580 QETH_CARD_TEXT_(queue->card, 5, "%lx", 3579 QETH_CARD_TEXT_(queue->card, 5, "%lx",
3581 virt_to_phys(buffer->aob)); 3580 virt_to_phys(buffer->aob));
3582 BUG_ON(bidx < 0 || bidx >= QDIO_MAX_BUFFERS_PER_Q);
3583 if (qeth_init_qdio_out_buf(queue, bidx)) { 3581 if (qeth_init_qdio_out_buf(queue, bidx)) {
3584 QETH_CARD_TEXT(card, 2, "outofbuf"); 3582 QETH_CARD_TEXT(card, 2, "outofbuf");
3585 qeth_schedule_recovery(card); 3583 qeth_schedule_recovery(card);
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 83849c290337..73195553f84b 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -411,7 +411,7 @@ static int qeth_l2_process_inbound_buffer(struct qeth_card *card,
411 unsigned int len; 411 unsigned int len;
412 412
413 *done = 0; 413 *done = 0;
414 BUG_ON(!budget); 414 WARN_ON_ONCE(!budget);
415 while (budget) { 415 while (budget) {
416 skb = qeth_core_get_next_skb(card, 416 skb = qeth_core_get_next_skb(card,
417 &card->qdio.in_q->bufs[card->rx.b_index], 417 &card->qdio.in_q->bufs[card->rx.b_index],
@@ -973,7 +973,6 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
973 int rc = 0; 973 int rc = 0;
974 enum qeth_card_states recover_flag; 974 enum qeth_card_states recover_flag;
975 975
976 BUG_ON(!card);
977 mutex_lock(&card->discipline_mutex); 976 mutex_lock(&card->discipline_mutex);
978 mutex_lock(&card->conf_mutex); 977 mutex_lock(&card->conf_mutex);
979 QETH_DBF_TEXT(SETUP, 2, "setonlin"); 978 QETH_DBF_TEXT(SETUP, 2, "setonlin");
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index e4171a944b94..6e5eef01e667 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1939,7 +1939,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
1939 __u16 magic; 1939 __u16 magic;
1940 1940
1941 *done = 0; 1941 *done = 0;
1942 BUG_ON(!budget); 1942 WARN_ON_ONCE(!budget);
1943 while (budget) { 1943 while (budget) {
1944 skb = qeth_core_get_next_skb(card, 1944 skb = qeth_core_get_next_skb(card,
1945 &card->qdio.in_q->bufs[card->rx.b_index], 1945 &card->qdio.in_q->bufs[card->rx.b_index],
@@ -3334,7 +3334,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
3334 int rc = 0; 3334 int rc = 0;
3335 enum qeth_card_states recover_flag; 3335 enum qeth_card_states recover_flag;
3336 3336
3337 BUG_ON(!card);
3338 mutex_lock(&card->discipline_mutex); 3337 mutex_lock(&card->discipline_mutex);
3339 mutex_lock(&card->conf_mutex); 3338 mutex_lock(&card->conf_mutex);
3340 QETH_DBF_TEXT(SETUP, 2, "setonlin"); 3339 QETH_DBF_TEXT(SETUP, 2, "setonlin");
@@ -3715,9 +3714,9 @@ static void qeth_l3_unregister_notifiers(void)
3715{ 3714{
3716 3715
3717 QETH_DBF_TEXT(SETUP, 5, "unregnot"); 3716 QETH_DBF_TEXT(SETUP, 5, "unregnot");
3718 BUG_ON(unregister_inetaddr_notifier(&qeth_l3_ip_notifier)); 3717 WARN_ON(unregister_inetaddr_notifier(&qeth_l3_ip_notifier));
3719#ifdef CONFIG_QETH_IPV6 3718#ifdef CONFIG_QETH_IPV6
3720 BUG_ON(unregister_inet6addr_notifier(&qeth_l3_ip6_notifier)); 3719 WARN_ON(unregister_inet6addr_notifier(&qeth_l3_ip6_notifier));
3721#endif /* QETH_IPV6 */ 3720#endif /* QETH_IPV6 */
3722} 3721}
3723 3722