s390/qeth: fixes 2018-03-20
Subsystems (4)
cover s390/qeth: fixes 2018-03-20
Hi Dave,
Please apply one final set of qeth patches for 4.16.
All of these fix long-standing bugs, so please queue them up for -stable as well.
Thank you,
Julian
Julian Wiedmann (4):
s390/qeth: free netdevice when removing a card s390/qeth: when thread completes, wake up all waiters s390/qeth: lock read device while queueing next buffer s390/qeth: on channel error, reject further cmd requests
drivers/s390/net/qeth_core_main.c | 21 +++++++++++++++------ drivers/s390/net/qeth_l2_main.c | 2 +- drivers/s390/net/qeth_l3_main.c | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-)
Signature · 1 line
2.13.5
PATCH 1/4 s390/qeth: free netdevice when removing a card
On removal, a qeth card's netdevice is currently not properly freed because the call chain looks as follows:
qeth_core_remove_device(card)
lx_remove_device(card) unregister_netdev(card->dev) card->dev = NULL !!! qeth_core_free_card(card) if (card->dev) !!! free_netdev(card->dev)
Fix it by free'ing the netdev straight after unregistering. This also fixes the sysfs-driven layer switch case (qeth_dev_layer2_store()), where the need to free the current netdevice was not considered at all.
Note that free_netdev() takes care of the netif_napi_del() for us too.
--- drivers/s390/net/qeth_core_main.c | 2 -- drivers/s390/net/qeth_l2_main.c | 2 +- drivers/s390/net/qeth_l3_main.c | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-)
drivers/s390/net/qeth_core_main.c +0 -2
@@ -5087,8 +5087,6 @@ static void qeth_core_free_card(struct qeth_card *card)QETH_DBF_HEX (SETUP ,2 , &card,sizeof (void *));qeth_clean_channel (&card->read);qeth_clean_channel (&card->write); -if (card->dev) -free_netdev (card->dev);qeth_free_qdio_buffers (card);unregister_service_level (&card->qeth_service_level);kfree (card);
drivers/s390/net/qeth_l2_main.c +1 -1
@@ -915,8 +915,8 @@ static void qeth_l2_remove_device(struct ccwgroup_device *cgdev)qeth_l2_set_offline (cgdev);if (card->dev) { -netif_napi_del (&card->napi);unregister_netdev (card->dev); +free_netdev (card->dev); card->dev =NULL ; }return ;
drivers/s390/net/qeth_l3_main.c +1 -1
@@ -2865,8 +2865,8 @@ static void qeth_l3_remove_device(struct ccwgroup_device *cgdev)qeth_l3_set_offline (cgdev);if (card->dev) { -netif_napi_del (&card->napi);unregister_netdev (card->dev); +free_netdev (card->dev); card->dev =NULL ; }
Signature · 1 line
2.13.5
PATCH 2/4 s390/qeth: when thread completes, wake up all waiters
In reply to Julian Wiedmannqeth_wait_for_threads() is potentially called by multiple users, make sure to notify all of them after qeth_clear_thread_running_bit() adjusted the thread_running_mask. With no timeout, callers would otherwise stall.
--- drivers/s390/net/qeth_core_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/qeth_core_main.c +1 -1
@@ -960,7 +960,7 @@ void qeth_clear_thread_running_bit(struct qeth_card *card, unsigned long thread)spin_lock_irqsave (&card->thread_mask_lock, flags); card->thread_running_mask &= ~thread;spin_unlock_irqrestore (&card->thread_mask_lock, flags); -wake_up (&card->wait_q); +wake_up_all (&card->wait_q); }EXPORT_SYMBOL_GPL (qeth_clear_thread_running_bit);
Signature · 1 line
2.13.5
PATCH 3/4 s390/qeth: lock read device while queueing next buffer
In reply to Julian WiedmannFor calling ccw_device_start(), issue_next_read() needs to hold the device's ccwlock.
This is satisfied for the IRQ handler path (where qeth_irq() gets called under the ccwlock), but we need explicit locking for the initial call by the MPC initialization.
--- drivers/s390/net/qeth_core_main.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/s390/net/qeth_core_main.c +13 -3
@@ -527,8 +527,7 @@ static inline int qeth_is_cq(struct qeth_card *card, unsigned int queue) queue == card->qdio.no_in_queues -1 ; } - -static int qeth_issue_next_read (struct qeth_card *card) +static int __qeth_issue_next_read (struct qeth_card *card) {int rc;struct qeth_cmd_buffer *iob;
@@ -559,6 +558,17 @@ static int qeth_issue_next_read(struct qeth_card *card)return rc; } +static int qeth_issue_next_read (struct qeth_card *card) +{ +int ret; + +spin_lock_irq (get_ccwdev_lock (CARD_RDEV (card))); + ret =__qeth_issue_next_read (card); +spin_unlock_irq (get_ccwdev_lock (CARD_RDEV (card))); + +return ret; +} +static struct qeth_reply *qeth_alloc_reply (struct qeth_card *card) {struct qeth_reply *reply;
@@ -1182,7 +1192,7 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm,return ;if (channel == &card->read && channel->state ==CH_STATE_UP ) -qeth_issue_next_read (card); +__qeth_issue_next_read (card); iob = channel->iob; index = channel->buf_no;
Signature · 1 line
2.13.5
PATCH 4/4 s390/qeth: on channel error, reject further cmd requests
In reply to Julian WiedmannWhen the IRQ handler determines that one of the cmd IO channels has failed and schedules recovery, block any further cmd requests from being submitted. The request would inevitably stall, and prevent the recovery from making progress until the request times out.
This sort of error was observed after Live Guest Relocation, where the pending IO on the READ channel intentionally gets terminated to kick-start recovery. Simultaneously the guest executed SIOCETHTOOL, triggering qeth to issue a QUERY CARD INFO command. The command then stalled in the inoperabel WRITE channel.
--- drivers/s390/net/qeth_core_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/s390/net/qeth_core_main.c +1 -0
@@ -1174,6 +1174,7 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, } rc =qeth_get_problem (cdev, irb);if (rc) { + card->read_or_write_problem =1 ;qeth_clear_ipacmd_list (card);qeth_schedule_recovery (card); goto out;
Signature · 1 line
2.13.5
David Miller
maintainerFrom: Julian Wiedmann <[email protected]>
Date: Tue, 20 Mar 2018 07:59:11 +0100
Quoted 3 lines
Please apply one final set of qeth patches for 4.16.
All of these fix long-standing bugs, so please queue them up for -stable as well.
Series applied and queued up for -stable, thank you.