Commit 18af5c17 authored by Stefan Raspl's avatar Stefan Raspl Committed by David S. Miller

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: default avatarStefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: default avatarFrank Blaschka <frank.blaschka@de.ibm.com>
Reviewed-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 395672e0
...@@ -383,7 +383,7 @@ static inline void qeth_cleanup_handled_pending(struct qeth_qdio_out_q *q, ...@@ -383,7 +383,7 @@ static inline void qeth_cleanup_handled_pending(struct qeth_qdio_out_q *q,
qeth_release_skbs(c); qeth_release_skbs(c);
c = f->next_pending; c = f->next_pending;
BUG_ON(head->next_pending != f); WARN_ON_ONCE(head->next_pending != f);
head->next_pending = c; head->next_pending = c;
kmem_cache_free(qeth_qdio_outbuf_cache, f); kmem_cache_free(qeth_qdio_outbuf_cache, f);
} else { } else {
...@@ -415,13 +415,12 @@ static inline void qeth_qdio_handle_aob(struct qeth_card *card, ...@@ -415,13 +415,12 @@ static inline void qeth_qdio_handle_aob(struct qeth_card *card,
buffer = (struct qeth_qdio_out_buffer *) aob->user1; buffer = (struct qeth_qdio_out_buffer *) aob->user1;
QETH_CARD_TEXT_(card, 5, "%lx", aob->user1); QETH_CARD_TEXT_(card, 5, "%lx", aob->user1);
BUG_ON(buffer == NULL);
if (atomic_cmpxchg(&buffer->state, QETH_QDIO_BUF_PRIMED, if (atomic_cmpxchg(&buffer->state, QETH_QDIO_BUF_PRIMED,
QETH_QDIO_BUF_IN_CQ) == QETH_QDIO_BUF_PRIMED) { QETH_QDIO_BUF_IN_CQ) == QETH_QDIO_BUF_PRIMED) {
notification = TX_NOTIFY_OK; notification = TX_NOTIFY_OK;
} else { } else {
BUG_ON(atomic_read(&buffer->state) != QETH_QDIO_BUF_PENDING); WARN_ON_ONCE(atomic_read(&buffer->state) !=
QETH_QDIO_BUF_PENDING);
atomic_set(&buffer->state, QETH_QDIO_BUF_IN_CQ); atomic_set(&buffer->state, QETH_QDIO_BUF_IN_CQ);
notification = TX_NOTIFY_DELAYED_OK; notification = TX_NOTIFY_DELAYED_OK;
} }
...@@ -1131,7 +1130,7 @@ static void qeth_release_skbs(struct qeth_qdio_out_buffer *buf) ...@@ -1131,7 +1130,7 @@ static void qeth_release_skbs(struct qeth_qdio_out_buffer *buf)
notify_general_error = 1; notify_general_error = 1;
/* release may never happen from within CQ tasklet scope */ /* release may never happen from within CQ tasklet scope */
BUG_ON(atomic_read(&buf->state) == QETH_QDIO_BUF_IN_CQ); WARN_ON_ONCE(atomic_read(&buf->state) == QETH_QDIO_BUF_IN_CQ);
skb = skb_dequeue(&buf->skb_list); skb = skb_dequeue(&buf->skb_list);
while (skb) { while (skb) {
...@@ -2400,7 +2399,7 @@ static int qeth_alloc_qdio_buffers(struct qeth_card *card) ...@@ -2400,7 +2399,7 @@ static int qeth_alloc_qdio_buffers(struct qeth_card *card)
card->qdio.out_qs[i]->queue_no = i; card->qdio.out_qs[i]->queue_no = i;
/* give outbound qeth_qdio_buffers their qdio_buffers */ /* give outbound qeth_qdio_buffers their qdio_buffers */
for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) { for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) {
BUG_ON(card->qdio.out_qs[i]->bufs[j] != NULL); WARN_ON(card->qdio.out_qs[i]->bufs[j] != NULL);
if (qeth_init_qdio_out_buf(card->qdio.out_qs[i], j)) if (qeth_init_qdio_out_buf(card->qdio.out_qs[i], j))
goto out_freeoutqbufs; goto out_freeoutqbufs;
} }
...@@ -3565,7 +3564,7 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev, ...@@ -3565,7 +3564,7 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,
if (queue->bufstates && if (queue->bufstates &&
(queue->bufstates[bidx].flags & (queue->bufstates[bidx].flags &
QDIO_OUTBUF_STATE_FLAG_PENDING) != 0) { QDIO_OUTBUF_STATE_FLAG_PENDING) != 0) {
BUG_ON(card->options.cq != QETH_CQ_ENABLED); WARN_ON_ONCE(card->options.cq != QETH_CQ_ENABLED);
if (atomic_cmpxchg(&buffer->state, if (atomic_cmpxchg(&buffer->state,
QETH_QDIO_BUF_PRIMED, QETH_QDIO_BUF_PRIMED,
...@@ -3579,7 +3578,6 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev, ...@@ -3579,7 +3578,6 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,
QETH_CARD_TEXT(queue->card, 5, "aob"); QETH_CARD_TEXT(queue->card, 5, "aob");
QETH_CARD_TEXT_(queue->card, 5, "%lx", QETH_CARD_TEXT_(queue->card, 5, "%lx",
virt_to_phys(buffer->aob)); virt_to_phys(buffer->aob));
BUG_ON(bidx < 0 || bidx >= QDIO_MAX_BUFFERS_PER_Q);
if (qeth_init_qdio_out_buf(queue, bidx)) { if (qeth_init_qdio_out_buf(queue, bidx)) {
QETH_CARD_TEXT(card, 2, "outofbuf"); QETH_CARD_TEXT(card, 2, "outofbuf");
qeth_schedule_recovery(card); qeth_schedule_recovery(card);
......
...@@ -411,7 +411,7 @@ static int qeth_l2_process_inbound_buffer(struct qeth_card *card, ...@@ -411,7 +411,7 @@ static int qeth_l2_process_inbound_buffer(struct qeth_card *card,
unsigned int len; unsigned int len;
*done = 0; *done = 0;
BUG_ON(!budget); WARN_ON_ONCE(!budget);
while (budget) { while (budget) {
skb = qeth_core_get_next_skb(card, skb = qeth_core_get_next_skb(card,
&card->qdio.in_q->bufs[card->rx.b_index], &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,7 +973,6 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
int rc = 0; int rc = 0;
enum qeth_card_states recover_flag; enum qeth_card_states recover_flag;
BUG_ON(!card);
mutex_lock(&card->discipline_mutex); mutex_lock(&card->discipline_mutex);
mutex_lock(&card->conf_mutex); mutex_lock(&card->conf_mutex);
QETH_DBF_TEXT(SETUP, 2, "setonlin"); QETH_DBF_TEXT(SETUP, 2, "setonlin");
......
...@@ -1939,7 +1939,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card, ...@@ -1939,7 +1939,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
__u16 magic; __u16 magic;
*done = 0; *done = 0;
BUG_ON(!budget); WARN_ON_ONCE(!budget);
while (budget) { while (budget) {
skb = qeth_core_get_next_skb(card, skb = qeth_core_get_next_skb(card,
&card->qdio.in_q->bufs[card->rx.b_index], &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,7 +3334,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
int rc = 0; int rc = 0;
enum qeth_card_states recover_flag; enum qeth_card_states recover_flag;
BUG_ON(!card);
mutex_lock(&card->discipline_mutex); mutex_lock(&card->discipline_mutex);
mutex_lock(&card->conf_mutex); mutex_lock(&card->conf_mutex);
QETH_DBF_TEXT(SETUP, 2, "setonlin"); QETH_DBF_TEXT(SETUP, 2, "setonlin");
...@@ -3715,9 +3714,9 @@ static void qeth_l3_unregister_notifiers(void) ...@@ -3715,9 +3714,9 @@ static void qeth_l3_unregister_notifiers(void)
{ {
QETH_DBF_TEXT(SETUP, 5, "unregnot"); QETH_DBF_TEXT(SETUP, 5, "unregnot");
BUG_ON(unregister_inetaddr_notifier(&qeth_l3_ip_notifier)); WARN_ON(unregister_inetaddr_notifier(&qeth_l3_ip_notifier));
#ifdef CONFIG_QETH_IPV6 #ifdef CONFIG_QETH_IPV6
BUG_ON(unregister_inet6addr_notifier(&qeth_l3_ip6_notifier)); WARN_ON(unregister_inet6addr_notifier(&qeth_l3_ip6_notifier));
#endif /* QETH_IPV6 */ #endif /* QETH_IPV6 */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment