All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] s390/qeth: updates 2020-03-06
@ 2020-03-06  8:13 Julian Wiedmann
  2020-03-06  8:13 ` [PATCH net-next 1/2] s390/qdio: add tighter controls for IRQ polling Julian Wiedmann
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Julian Wiedmann @ 2020-03-06  8:13 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, linux-s390, Heiko Carstens, Ursula Braun, Julian Wiedmann

Hi Dave,

please apply the following patch series for qeth to netdev's net-next
tree.

Just a small update to take care of a regression wrt to IRQ handling in
net-next, reported by Qian Cai. The fix needs some qdio layer changes,
so you will find Vasily's Acked-by in that patch.

Thanks,
Julian

Julian Wiedmann (2):
  s390/qdio: add tighter controls for IRQ polling
  s390/qeth: remove VNICC callback parameter struct

 drivers/s390/cio/qdio_setup.c     | 11 +++++++++--
 drivers/s390/net/qeth_core_main.c |  5 ++---
 drivers/s390/net/qeth_l2_main.c   | 29 ++++-------------------------
 3 files changed, 15 insertions(+), 30 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next 1/2] s390/qdio: add tighter controls for IRQ polling
  2020-03-06  8:13 [PATCH net-next 0/2] s390/qeth: updates 2020-03-06 Julian Wiedmann
@ 2020-03-06  8:13 ` Julian Wiedmann
  2020-03-06  8:13 ` [PATCH net-next 2/2] s390/qeth: remove VNICC callback parameter struct Julian Wiedmann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Julian Wiedmann @ 2020-03-06  8:13 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, linux-s390, Heiko Carstens, Ursula Braun,
	Julian Wiedmann, Qian Cai

Once the call to qdio_establish() has completed, qdio is free to deliver
data IRQs to the device driver's IRQ poll handler.

For qeth (the only qdio driver that currently uses IRQ polling) this is
problematic, since the IRQs can arrive before its NAPI instance is
even registered. Calling napi_schedule() from qeth_qdio_start_poll()
then crashes in various nasty ways.

Until recently qeth checked for IFF_UP to drop such early interrupts,
but that's fragile as well since it doesn't enforce any ordering.

Fix this properly by bringing up the qdio device in IRQS_DISABLED mode,
and have the driver explicitly opt-in to receive data IRQs.
qeth does so from qeth_open(), which kick-starts a NAPI poll and then
calls qdio_start_irq() from qeth_poll().

Also add a matching qdio_stop_irq() in qeth_stop() to switch the qdio
dataplane back into a disabled state.

Fixes: 3d35dbe6224e ("s390/qeth: don't check for IFF_UP when scheduling napi")
CC: Qian Cai <cai@lca.pw>
Reported-by: Qian Cai <cai@lca.pw>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Acked-by: Vasily Gorbik <gor@linux.ibm.com>
---
 drivers/s390/cio/qdio_setup.c     | 11 +++++++++--
 drivers/s390/net/qeth_core_main.c |  5 ++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/s390/cio/qdio_setup.c b/drivers/s390/cio/qdio_setup.c
index e115623b86b2..66e4bdca9d89 100644
--- a/drivers/s390/cio/qdio_setup.c
+++ b/drivers/s390/cio/qdio_setup.c
@@ -224,8 +224,15 @@ static void setup_queues(struct qdio_irq *irq_ptr,
 		setup_queues_misc(q, irq_ptr, qdio_init->input_handler, i);
 
 		q->is_input_q = 1;
-		q->u.in.queue_start_poll = qdio_init->queue_start_poll_array ?
-				qdio_init->queue_start_poll_array[i] : NULL;
+		if (qdio_init->queue_start_poll_array &&
+		    qdio_init->queue_start_poll_array[i]) {
+			q->u.in.queue_start_poll =
+				qdio_init->queue_start_poll_array[i];
+			set_bit(QDIO_QUEUE_IRQS_DISABLED,
+				&q->u.in.queue_irq_state);
+		} else {
+			q->u.in.queue_start_poll = NULL;
+		}
 
 		setup_storage_lists(q, irq_ptr, input_sbal_array, i);
 		input_sbal_array += QDIO_MAX_BUFFERS_PER_Q;
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index fdc50543ce9a..37c17ad8ee25 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -6582,9 +6582,6 @@ int qeth_open(struct net_device *dev)
 
 	QETH_CARD_TEXT(card, 4, "qethopen");
 
-	if (qdio_stop_irq(CARD_DDEV(card), 0) < 0)
-		return -EIO;
-
 	card->data.state = CH_STATE_UP;
 	netif_tx_start_all_queues(dev);
 
@@ -6634,6 +6631,8 @@ int qeth_stop(struct net_device *dev)
 	}
 
 	napi_disable(&card->napi);
+	qdio_stop_irq(CARD_DDEV(card), 0);
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(qeth_stop);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next 2/2] s390/qeth: remove VNICC callback parameter struct
  2020-03-06  8:13 [PATCH net-next 0/2] s390/qeth: updates 2020-03-06 Julian Wiedmann
  2020-03-06  8:13 ` [PATCH net-next 1/2] s390/qdio: add tighter controls for IRQ polling Julian Wiedmann
@ 2020-03-06  8:13 ` Julian Wiedmann
  2020-03-06 18:44 ` [PATCH net-next 0/2] s390/qeth: updates 2020-03-06 Jakub Kicinski
  2020-03-10  1:16 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Julian Wiedmann @ 2020-03-06  8:13 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, linux-s390, Heiko Carstens, Ursula Braun, Julian Wiedmann

After recent cleanups this is just a complicated wrapper around an u32*.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
---
 drivers/s390/net/qeth_l2_main.c | 29 ++++-------------------------
 1 file changed, 4 insertions(+), 25 deletions(-)

diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 9972d96820f3..0bf5e7133229 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -1567,23 +1567,11 @@ static int qeth_l2_vnicc_makerc(struct qeth_card *card, u16 ipa_rc)
 	return rc;
 }
 
-/* generic VNICC request call back control */
-struct _qeth_l2_vnicc_request_cbctl {
-	struct {
-		union{
-			u32 *sup_cmds;
-			u32 *timeout;
-		};
-	} result;
-};
-
 /* generic VNICC request call back */
 static int qeth_l2_vnicc_request_cb(struct qeth_card *card,
 				    struct qeth_reply *reply,
 				    unsigned long data)
 {
-	struct _qeth_l2_vnicc_request_cbctl *cbctl =
-		(struct _qeth_l2_vnicc_request_cbctl *) reply->param;
 	struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data;
 	struct qeth_ipacmd_vnicc *rep = &cmd->data.vnicc;
 	u32 sub_cmd = cmd->data.vnicc.hdr.sub_command;
@@ -1596,9 +1584,9 @@ static int qeth_l2_vnicc_request_cb(struct qeth_card *card,
 	card->options.vnicc.cur_chars = rep->vnicc_cmds.enabled;
 
 	if (sub_cmd == IPA_VNICC_QUERY_CMDS)
-		*cbctl->result.sup_cmds = rep->data.query_cmds.sup_cmds;
+		*(u32 *)reply->param = rep->data.query_cmds.sup_cmds;
 	else if (sub_cmd == IPA_VNICC_GET_TIMEOUT)
-		*cbctl->result.timeout = rep->data.getset_timeout.timeout;
+		*(u32 *)reply->param = rep->data.getset_timeout.timeout;
 
 	return 0;
 }
@@ -1639,7 +1627,6 @@ static int qeth_l2_vnicc_query_chars(struct qeth_card *card)
 static int qeth_l2_vnicc_query_cmds(struct qeth_card *card, u32 vnic_char,
 				    u32 *sup_cmds)
 {
-	struct _qeth_l2_vnicc_request_cbctl cbctl;
 	struct qeth_cmd_buffer *iob;
 
 	QETH_CARD_TEXT(card, 2, "vniccqcm");
@@ -1650,10 +1637,7 @@ static int qeth_l2_vnicc_query_cmds(struct qeth_card *card, u32 vnic_char,
 
 	__ipa_cmd(iob)->data.vnicc.data.query_cmds.vnic_char = vnic_char;
 
-	/* prepare callback control */
-	cbctl.result.sup_cmds = sup_cmds;
-
-	return qeth_send_ipa_cmd(card, iob, qeth_l2_vnicc_request_cb, &cbctl);
+	return qeth_send_ipa_cmd(card, iob, qeth_l2_vnicc_request_cb, sup_cmds);
 }
 
 /* VNICC enable/disable characteristic request */
@@ -1677,7 +1661,6 @@ static int qeth_l2_vnicc_getset_timeout(struct qeth_card *card, u32 vnicc,
 					u32 cmd, u32 *timeout)
 {
 	struct qeth_vnicc_getset_timeout *getset_timeout;
-	struct _qeth_l2_vnicc_request_cbctl cbctl;
 	struct qeth_cmd_buffer *iob;
 
 	QETH_CARD_TEXT(card, 2, "vniccgst");
@@ -1692,11 +1675,7 @@ static int qeth_l2_vnicc_getset_timeout(struct qeth_card *card, u32 vnicc,
 	if (cmd == IPA_VNICC_SET_TIMEOUT)
 		getset_timeout->timeout = *timeout;
 
-	/* prepare callback control */
-	if (cmd == IPA_VNICC_GET_TIMEOUT)
-		cbctl.result.timeout = timeout;
-
-	return qeth_send_ipa_cmd(card, iob, qeth_l2_vnicc_request_cb, &cbctl);
+	return qeth_send_ipa_cmd(card, iob, qeth_l2_vnicc_request_cb, timeout);
 }
 
 /* set current VNICC flag state; called from sysfs store function */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] s390/qeth: updates 2020-03-06
  2020-03-06  8:13 [PATCH net-next 0/2] s390/qeth: updates 2020-03-06 Julian Wiedmann
  2020-03-06  8:13 ` [PATCH net-next 1/2] s390/qdio: add tighter controls for IRQ polling Julian Wiedmann
  2020-03-06  8:13 ` [PATCH net-next 2/2] s390/qeth: remove VNICC callback parameter struct Julian Wiedmann
@ 2020-03-06 18:44 ` Jakub Kicinski
  2020-03-10  1:16 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2020-03-06 18:44 UTC (permalink / raw)
  To: Julian Wiedmann
  Cc: David Miller, netdev, linux-s390, Heiko Carstens, Ursula Braun

On Fri,  6 Mar 2020 09:13:09 +0100 Julian Wiedmann wrote:
> Hi Dave,
> 
> please apply the following patch series for qeth to netdev's net-next
> tree.
> 
> Just a small update to take care of a regression wrt to IRQ handling in
> net-next, reported by Qian Cai. The fix needs some qdio layer changes,
> so you will find Vasily's Acked-by in that patch.

Reviewed-by: Jakub Kicinski <kuba@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] s390/qeth: updates 2020-03-06
  2020-03-06  8:13 [PATCH net-next 0/2] s390/qeth: updates 2020-03-06 Julian Wiedmann
                   ` (2 preceding siblings ...)
  2020-03-06 18:44 ` [PATCH net-next 0/2] s390/qeth: updates 2020-03-06 Jakub Kicinski
@ 2020-03-10  1:16 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2020-03-10  1:16 UTC (permalink / raw)
  To: jwi; +Cc: netdev, linux-s390, heiko.carstens, ubraun

From: Julian Wiedmann <jwi@linux.ibm.com>
Date: Fri,  6 Mar 2020 09:13:09 +0100

> please apply the following patch series for qeth to netdev's net-next
> tree.
> 
> Just a small update to take care of a regression wrt to IRQ handling in
> net-next, reported by Qian Cai. The fix needs some qdio layer changes,
> so you will find Vasily's Acked-by in that patch.

Series applied, thank you.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-10  1:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06  8:13 [PATCH net-next 0/2] s390/qeth: updates 2020-03-06 Julian Wiedmann
2020-03-06  8:13 ` [PATCH net-next 1/2] s390/qdio: add tighter controls for IRQ polling Julian Wiedmann
2020-03-06  8:13 ` [PATCH net-next 2/2] s390/qeth: remove VNICC callback parameter struct Julian Wiedmann
2020-03-06 18:44 ` [PATCH net-next 0/2] s390/qeth: updates 2020-03-06 Jakub Kicinski
2020-03-10  1:16 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.