From patchwork Wed Nov 29 09:52:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13472578 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="GPWHTggJ" Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5704619AB; Wed, 29 Nov 2023 01:53:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701251578; x=1701856378; i=wahrenst@gmx.net; bh=lOJ3u0uO6yLMNgD1lUKLeIxcnfV1jb5Ow4YD+RbTpq4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=GPWHTggJrPqK6z2LAqgWkssJVXx2eq8hedeNVeeQPMH8v8/Oig7IJXLPraYeEujO DZ4uJdhkly2iP1RJaTQOC4PltIjlCUDB5VCuY+3Bbc9Y0zGbj+Oc/RvJdPL2lXbXF QlIXX08BBQfaGfhFusqw/zOQX9S2OI8R6uRA0SU/9xWXlvgfm/MsjhEpDuwcfsHIX GzTy0PAemSlKlBURwTVswW3p5SgRRFmvKUiouXPJ1UQgRmkWe4zIJr5onx66scA5I yu+xBoFOlqj7bVevwJvE8JPVMgpdGp70RtUqT3WEc3aJ3M+NLICTZjVoW5PwOBQOR R/ATeF/Y3RVJVh+oOA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MuUj2-1rPX9U2zn0-00rXPc; Wed, 29 Nov 2023 10:52:58 +0100 From: Stefan Wahren To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Lino Sanfilippo , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH V2 1/3] qca_debug: Prevent crash on TX ring changes Date: Wed, 29 Nov 2023 10:52:39 +0100 Message-Id: <20231129095241.31302-2-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129095241.31302-1-wahrenst@gmx.net> References: <20231129095241.31302-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:DQcEDKN8Pru9xYX/nc5RIlq7/xpDxrqzO6bhFi1vBbIP5H8jRaL 4pyjc9S1feN0qqW0SjBfJyK9Glm8+AGugk4m6RKFaJRYKY6Ydzi6WkYpfAB0EIPW1spQvts xAmczwZ5g82VNXY2Q5w+BWVGvNaJmnwW5/P4v/PcoeF/iE9sW2jg722+g8v15mQXHOZmPuI Yu5s3ni62SqNCOPUJ26hg== UI-OutboundReport: notjunk:1;M01:P0:RAHTY6FOATY=;+pZCDRGEKoR3buvj1/Fh9X2TeO2 aUlbCk7n6XvZsEqPuj/yJs47d4pb032eNDqBVmXPJ/IxoYI1d2LGYfHXqbO6YfA8mpPbl/LxV 5sVPWFJttTjEUv4cIuTnDGvs5BGPlQYNAtf+OeQDQKmdD6pdx71AZ5pPVbx859uEmh+LZA1jM MvT9cLqLPvo88tnc5vjT+/POYy33HXm2o0DFYMKy14WSAMxSfAyngH7FU/6KOqB9nxwusLZuZ hn59Cxce1Ck9A0sP3yGpO4mvdC8QCyEl5E/UdpENLL4wEdGgRlrhWMqNQK6EQ9GiU4bj3RYg6 WthxENua3c4IcU6w7YOY61u+8rhgWWDJDcZ51p6AHdWbMXmfHBwirCDXeif9zKIdrqVGKvcGe E2UfcAUiqFp9erKj3DIrqweGQa18RN3d7uaE8A6XAAtO531ON4zPMYYbtkMLJmoumnuOhTIq1 dlf9hLt2WGToclrwLIDNzhFLl8ObrkSA1VFWeu/6n8rxwfV4qIXHCuTqHTd4/eadz0sE2ucat pxJesj+Ny8NffycOYrQD0fCcFhlO8h3eYnW9SS/asA0+Ce8RZjCRpZghVX5Vk5l/MZetveMfh HRg1DWE/5vzoi0glIf8gzpEaiq/+a0Gq7r71L94FHtb1c58MgfluH/Piwe4YQFjC7Ws0lYZmG s9JFxO7n4VTr5Y+JaBXiI4S9zqccFkqoPCouUZsxLuQl1ky4UNYv/cXHZU6hEpJ9xuSazlv8M XKaz6HiThbDtsgYkZSMMvXlwfTT5jfjqWnNKj+c0lG55JkWPvRDet39+E4u55NM7oa7qW1Xg5 aOwqFgvyU6R6oRfP8R+AilTLdksMjBR9kxdjiCB0sgphk2RVtHyviJVmxFKjtqDqtacHMWwRG JEsCNN4vqyKDnvnq8FvOtlaJoOjttSPEMHwASdUsvx+V2+qr8ZHDzg8FFNHZvGLWjaHXBWkTu 6aN/1w== X-Patchwork-Delegate: kuba@kernel.org The qca_spi driver stop and restart the SPI kernel thread (via ndo_stop & ndo_open) in case of TX ring changes. This is a big issue because it allows userspace to prevent restart of the SPI kernel thread (via signals). A subsequent change of TX ring wrongly assume a valid spi_thread pointer which result in a crash. So prevent this by stopping the network queue and temporary park the SPI thread. Because this could happen during transmission we also need to call qcaspi_flush_tx_ring(). Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000") Signed-off-by: Stefan Wahren --- drivers/net/ethernet/qualcomm/qca_debug.c | 17 ++++++++++++----- drivers/net/ethernet/qualcomm/qca_spi.c | 7 ++++++- drivers/net/ethernet/qualcomm/qca_spi.h | 2 ++ 3 files changed, 20 insertions(+), 6 deletions(-) -- 2.34.1 diff --git a/drivers/net/ethernet/qualcomm/qca_debug.c b/drivers/net/ethernet/qualcomm/qca_debug.c index 6f2fa2a42770..9777dbb17ac2 100644 --- a/drivers/net/ethernet/qualcomm/qca_debug.c +++ b/drivers/net/ethernet/qualcomm/qca_debug.c @@ -263,22 +263,29 @@ qcaspi_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring, struct kernel_ethtool_ringparam *kernel_ring, struct netlink_ext_ack *extack) { - const struct net_device_ops *ops = dev->netdev_ops; struct qcaspi *qca = netdev_priv(dev); + bool queue_active = !netif_queue_stopped(dev); if ((ring->rx_pending) || (ring->rx_mini_pending) || (ring->rx_jumbo_pending)) return -EINVAL; - if (netif_running(dev)) - ops->ndo_stop(dev); + if (queue_active) + netif_stop_queue(dev); + if (qca->spi_thread) + kthread_park(qca->spi_thread); + + qcaspi_flush_tx_ring(qca); qca->txr.count = max_t(u32, ring->tx_pending, TX_RING_MIN_LEN); qca->txr.count = min_t(u16, qca->txr.count, TX_RING_MAX_LEN); - if (netif_running(dev)) - ops->ndo_open(dev); + if (qca->spi_thread) + kthread_unpark(qca->spi_thread); + + if (queue_active) + netif_wake_queue(dev); return 0; } diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c index bec723028e96..78317b85ad30 100644 --- a/drivers/net/ethernet/qualcomm/qca_spi.c +++ b/drivers/net/ethernet/qualcomm/qca_spi.c @@ -467,7 +467,7 @@ qcaspi_tx_ring_has_space(struct tx_ring *txr) * call from the qcaspi_spi_thread. */ -static void +void qcaspi_flush_tx_ring(struct qcaspi *qca) { int i; @@ -580,6 +580,11 @@ qcaspi_spi_thread(void *data) netdev_info(qca->net_dev, "SPI thread created\n"); while (!kthread_should_stop()) { set_current_state(TASK_INTERRUPTIBLE); + if (kthread_should_park()) { + kthread_parkme(); + continue; + } + if ((qca->intr_req == qca->intr_svc) && !qca->txr.skb[qca->txr.head]) schedule(); diff --git a/drivers/net/ethernet/qualcomm/qca_spi.h b/drivers/net/ethernet/qualcomm/qca_spi.h index 3067356106f0..95d7306e58e9 100644 --- a/drivers/net/ethernet/qualcomm/qca_spi.h +++ b/drivers/net/ethernet/qualcomm/qca_spi.h @@ -107,4 +107,6 @@ struct qcaspi { u16 burst_len; }; +void qcaspi_flush_tx_ring(struct qcaspi *qca); + #endif /* _QCA_SPI_H */ From patchwork Wed Nov 29 09:52:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13472576 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="rmofMkO4" Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 324C79D; Wed, 29 Nov 2023 01:53:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701251579; x=1701856379; i=wahrenst@gmx.net; bh=CAfQ6z6CnJM474hEi1aalNvFeonVgV0OpFBez2lL1H4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=rmofMkO4p0wzNk0fWkURIwZWGRsf/gHHLy6+V5kG7pwvi88rffTNq8PdEuLNOzkl aLzT1DX3Nw+tnIOY8kxE9rDD5lOicyQxNKNAlwatep8qSQe88uphFvIxhzG//0mBC Vr1QGA7qZsVL/WWgQPZv6F+AN3iwC+/3eg3jsXBDrsLTfQw19zzhnxVuux0CD4DLy O2d0ATEuH7sYN6wptosoAhLmii597/6s4b1wG8qN19MpmxtuWefcgvtCQPUB9yP/J otFV3JmSZHOWjMbZ9hVt8xt7oLXxnAHTN1HPcsy3xstSKnca9JQ9stkKUPWKqJS9e IOWJOgH86AcU9UTrwA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MDysg-1qyPsd0F7s-009zU6; Wed, 29 Nov 2023 10:52:59 +0100 From: Stefan Wahren To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Lino Sanfilippo , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH V2 2/3] qca_debug: Fix ethtool -G iface tx behavior Date: Wed, 29 Nov 2023 10:52:40 +0100 Message-Id: <20231129095241.31302-3-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129095241.31302-1-wahrenst@gmx.net> References: <20231129095241.31302-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:GQI267fAT2PuVVzt7gfEUhpw+qz5zCsYdHETtuuHnDCcooy3Saz C1tG+VZZrLv/CszX6rBXQePyguAUCfOm4Q2OJS76Zy8qaNqKVbEUvA1pA/0UdC4H1u6ohF6 VEuH5+hPvF12MTVWMpE8EKBUYrLVlLfjq7wKD9xEgYTuI/5CIaPl+hCaPFCJG/pgVZnJ9EU TqpR1dRdnVzmRFhTgN8Ng== UI-OutboundReport: notjunk:1;M01:P0:Si+6HpenhpA=;qbObQ8smblnE9ryU95oJ1c2VNxz DDrTCODZABrdzOGiVtXFzz+INes1IJBTFBX6Y0P9jGq/fcv6Q55WtlaTJtXxhXWRO015pCDc4 QevX3NZWCV88cz1KXQhmvvXflQLqWzZJ6W0lSM57gmnrUhIQFapl8vk+OK6CR7OJVVhjZ5Fji dYXkFnQFGzbtHkywlqr+F5BKSJWm771Eaq/wibPQvejSpsK99wfTKRK2plDGWkK96tA0GLp9S 8J7G4a/MJmDiA80RUqECBiEZzgK+KSbn0Dvwl2XRqPi1mKZm5z8wwV9NiBARzsfrJHYvIyhUX HX0RmceKL3Yc/WNuc5btK9zzVpC4Oyc+cKTVF0wS7brIT1aBKtdVcgSPgTyI03nwvncpMls5S dVzFd8mPZjXlCL2D3ghhhuLOa7BD/pT3ey1U8a7RC3+8Z95qoy6S9NqdlbUBRM8hcCZU56a5S xOGhXThqWlBLV52cp78Udu0yCti7v14NmPPP7qiz6wVibtpHA6++NBqRDgzbwTAhEdkSxfrnS nEp1eyKkwfP0FzNZdD8Eygq6MO8a8ij87k6VTNGsOyLgkVqSm0AkSZHkoNN/C3OddwH2XDvs5 zUFPiqXHfF8odpRjfGra5jGKw5eE8TOOTJWYp66xkakznjW3HQxpqK1bfOL5VDvN12jQR6g2r CqQ6hDSn2UhzX36wvu0ZqhFOhG8/xC+2oUCBfskYgSrFMm0LgQzJRk1woB1lNouyE30uLMQdS 064q9y2hq/6ag3WNZAOIb+HDSfZ6dplQGQwnseuLu/VwHkeBHoxREOzqvs60p0m35cgVJjW9U 92LTHprZyj2Ho8GoFUqyxeVIuClYyTQ+X5HU6Wg6nBH88qsKmwqiT6pQj5FW4sTzEFnTXhctO cLk8+db9QwL4wIUdztpe/uKYGEsEFqzMrqxtchiOd+z0vRmwVZz1QU/MpLC3ZG+Bm/+tpl9Jq Foou7w== X-Patchwork-Delegate: kuba@kernel.org After calling ethtool -g it was not possible to adjust the TX ring size again: # ethtool -g eth1 Ring parameters for eth1: Pre-set maximums: RX: 4 RX Mini: n/a RX Jumbo: n/a TX: 10 Current hardware settings: RX: 4 RX Mini: n/a RX Jumbo: n/a TX: 10 # ethtool -G eth1 tx 8 netlink error: Invalid argument The reason for this is that the readonly setting rx_pending get initialized and after that the range check in qcaspi_set_ringparam() fails regardless of the provided parameter. So fix this by accepting the exposed RX defaults. Instead of adding another magic number better use a new define here. Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000") Suggested-by: Paolo Abeni Signed-off-by: Stefan Wahren --- drivers/net/ethernet/qualcomm/qca_debug.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.34.1 diff --git a/drivers/net/ethernet/qualcomm/qca_debug.c b/drivers/net/ethernet/qualcomm/qca_debug.c index 9777dbb17ac2..c84a1271857e 100644 --- a/drivers/net/ethernet/qualcomm/qca_debug.c +++ b/drivers/net/ethernet/qualcomm/qca_debug.c @@ -30,6 +30,8 @@ #define QCASPI_MAX_REGS 0x20 +#define QCASPI_RX_MAX_FRAMES 4 + static const u16 qcaspi_spi_regs[] = { SPI_REG_BFR_SIZE, SPI_REG_WRBUF_SPC_AVA, @@ -252,9 +254,9 @@ qcaspi_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring, { struct qcaspi *qca = netdev_priv(dev); - ring->rx_max_pending = 4; + ring->rx_max_pending = QCASPI_RX_MAX_FRAMES; ring->tx_max_pending = TX_RING_MAX_LEN; - ring->rx_pending = 4; + ring->rx_pending = QCASPI_RX_MAX_FRAMES; ring->tx_pending = qca->txr.count; } @@ -266,7 +268,7 @@ qcaspi_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring, struct qcaspi *qca = netdev_priv(dev); bool queue_active = !netif_queue_stopped(dev); - if ((ring->rx_pending) || + if (ring->rx_pending != QCASPI_RX_MAX_FRAMES || (ring->rx_mini_pending) || (ring->rx_jumbo_pending)) return -EINVAL; From patchwork Wed Nov 29 09:52:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13472577 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="QknhoD+2" Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDD5619A6; Wed, 29 Nov 2023 01:53:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701251579; x=1701856379; i=wahrenst@gmx.net; bh=vies0F8Jg1t++keNUgRX+FOgBZdRHEdkEZpAqz4PZbo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=QknhoD+2hkn2qzX8nZoE3bSo9ITWr63co889q863jTS7usC8Y3fjFUmnOTQqVq53 T/8/Xi2o6rY6X2vNuDMWyleR6CpzqqFbvsjetf538hicdsrEeyUNyfM2aelbc1qfA H+tVd+IDj8As/aftvVQWYHRN8uKiJC71ELiAHM6nZMzY3gP2P2iyTpTPD45qxP0H5 FLv4nJjRp8+sxZAc8fhdyzSEjEuyoWkfsi4olmeHlAhsbr4SMfY28G0oVw+dZpVFy 7u18nD2GvxnnwrIzEFdtGHy1VKktGYmPS0u3pZh5DPzZ3/1BSnR6nYyDvXcloN12b WnyBA08r3lSDskC44g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MZktZ-1qkTl61Xrb-00WjGH; Wed, 29 Nov 2023 10:52:59 +0100 From: Stefan Wahren To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Lino Sanfilippo , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH V2 3/3] qca_spi: Fix reset behavior Date: Wed, 29 Nov 2023 10:52:41 +0100 Message-Id: <20231129095241.31302-4-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231129095241.31302-1-wahrenst@gmx.net> References: <20231129095241.31302-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:z4/zh7el0YVAthtFzRf7pWbtQi6p4Rxm5tDQSr9kgPCtd5kJpFS CI/7pNcuDiVwPVRsKTmfj1gqDuCOxHtVkj2AwggxLiVzXSTyShFbdhk0TluiDlDc4ChPa0O AN3YgY3bwZhUbmRNUfA1gsUGQrNL30WRj9Ikme7BTFqhXJS2eDLYzz2PCHyvB6eHF63bbyc NGlzmp+ch9+LKlr2nb9jA== UI-OutboundReport: notjunk:1;M01:P0:+zZhfyPFhgc=;Fif8m7WzyJ9ywa0VouETtbfU2Be 4pkUG2z4lNKnqUuJ6YpLI3EiOWqz5m9y54NJk2XpMJAlXneZG4bOw6aahw8FPCrnkZjoxY0Pb E5iIE79qu0HTX7EMZClj2imp4hxEuGoj2E8q18X1zSa4PZgtJy+sLh313PQC/DZ2uuGrdYEOe 4+zRloIDvz+vfl9AK7YzdagQGf1FxKeB1xkChnbJCT0cHPXnYxH5v8hzYlvFRQ8OgjtMClUES fWOdL1Fx7gfsnW/ir3W7nyLCmc+La2QYowTltXxEWDa/LhUQfmR0Tm1WmZTbel+dVfxlmjnGB WlbKkQOr2IFaxgaCiuifK4ob0C5TNvsJOuLF7zCtGt4rV5EaDstARFqNuccloO8J6DaHhELQr LW9Fj6EDsKGJQCLCL+fkmLpgVbGpAphhtOrYhULNgwjpyxcwAUvf+Ed0CHT/Vs1zCXuEZM5yC 7tYRKQqQW+nhGeV7IcJ4lsNSBsN0PYWOKrBrio6JFEasu5gVCvA4lP/Q8k6IPNtdAxw+RTzZY 6ApahbnNjheECaofBJ8m4/PSwXRqcBysZuiCF2wqtvQTK0lhROV5jmgdVJBT/6XohHCtx7cOY lqREh0e8/gY6o4ugYKCxlkcPUoeWlPWkGfZOtTYTY989550sWBU3L0bMFhI+m7RleseVbhQR/ V9+X6ckS1TaOAKrjurm3Se1kegAn8Yy822fAcQmcSiBcUgf72N0m4m500OQrqweFvPp5ehXfV oH1V+smvPdNS/Hnsi2Bboir1Go0C10809veoOKr6s3dKMZ1k9dOei+cOsNvw7Qf4/VQlvVm/u hHz1PRVucUDWTBedpdtKDI5jUtGagJW+BNEecKb1WNtIgopv5Mr3Yaij53Wy+FxU0nAkOlGHc ecGrcjtrtg1sqOV98OFNgo/wgRIZ4fghLhOE8B1WSQQ4JnK/KehwYpR6lTHTg+Ts4E1WbE98H MtSnnA== X-Patchwork-Delegate: kuba@kernel.org In case of a reset triggered by the QCA7000 itself, the behavior of the qca_spi driver was not quite correct: - in case of a pending RX frame decoding the drop counter must be incremented and decoding state machine reseted - also the reset counter must always be incremented regardless of sync state Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000") Signed-off-by: Stefan Wahren --- drivers/net/ethernet/qualcomm/qca_spi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.34.1 diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c index 78317b85ad30..0fe2e24a42b2 100644 --- a/drivers/net/ethernet/qualcomm/qca_spi.c +++ b/drivers/net/ethernet/qualcomm/qca_spi.c @@ -613,11 +613,17 @@ qcaspi_spi_thread(void *data) if (intr_cause & SPI_INT_CPU_ON) { qcaspi_qca7k_sync(qca, QCASPI_EVENT_CPUON); + /* Frame decoding in progress */ + if (qca->frm_handle.state != qca->frm_handle.init) + qca->net_dev->stats.rx_dropped++; + + qcafrm_fsm_init_spi(&qca->frm_handle); + qca->stats.device_reset++; + /* not synced. */ if (qca->sync != QCASPI_SYNC_READY) continue; - qca->stats.device_reset++; netif_wake_queue(qca->net_dev); netif_carrier_on(qca->net_dev); }