From patchwork Wed Dec 6 14:12:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13481859 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="ORYVHon7" Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5794ED66; Wed, 6 Dec 2023 06:13:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701871976; x=1702476776; i=wahrenst@gmx.net; bh=KLwqFYpRFPrNX4+hxxfvye3azsZxr+QOjeo8aacDXMw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=ORYVHon7PvB0TORAdKqmSliNClCCeXrd0QoefZyi2yHoxn2lp0inxltQx2n2PGaf 4vL0/tfuCqMQwHm8YeeR7LrpdUyT+YvW67wiVIpZAm3hq1L5JSkdKzy07NJb8s3+6 hEfpIn6DJ8z9xfkyLgtVoqMA9u2qaAEujx4x5S/oigxKwqGvz8J7lKr8/f1T10bU9 vhJREa9AIrqNYoxxFG9eU7PmrMRci5vSOTOfiO6KdrPv8Qyn3XrZoHG9DydGtk4jF AeS6zVkGGgJW40JduDpinUQKmQv7uhaZPMewXeyexEp7O8rWBVxFtW1O8hDzt/yZX 6of84D5J31DLVyPGBg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MUGe1-1qlPX12FHP-00RE0A; Wed, 06 Dec 2023 15:12:56 +0100 From: Stefan Wahren To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH V3 1/3] qca_debug: Prevent crash on TX ring changes Date: Wed, 6 Dec 2023 15:12:20 +0100 Message-Id: <20231206141222.52029-2-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206141222.52029-1-wahrenst@gmx.net> References: <20231206141222.52029-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:0dVexsRIOyjNyXmqRuYjuFC3b1Z3BoCBKtglIXiLxK1Z6AJxoxz 11nWnsMnyIDobaml5nc/1jH82xUqsNaRRPYAxW1Ai2IyLHdCdqtuf7n3j8boJ2XiZRKQen2 g1uhCClzoGqG0G3WjTJJtZt847H7HUpCuIWdaO601YunGRbqoD+b0xfmJX9enPqqNdycNwX vOeeaAprNTLIa27JL+jdw== UI-OutboundReport: notjunk:1;M01:P0:P0UWt59LhLw=;zavL8m2zI44NfAdtkEjTC9VcMSZ rV/1Kig2FVfk1x+0KgsHDa8e3ysbNe9ALNbssWmsIsy2AJ7PEIF9zH+Y5/+fMyKvmpn6xUaV0 8e/xsjiKCeqks2Tnmvf1vsFhuk+wLF9tSLMjaAPvkGI5vzpZ2IJwhkVVWaj34562+4CK7ljm5 WDAJpPm8wAiTd7dCO/ON/5GfM8j+jPT81thywci1GgJqxFrgL56FnaYGL8ItdJPCsRz9J1VP6 mpV78FQcLS9VUpf+HTIYhFwCz1HYdHhQPrp1bc+9qAbkTtwHvF0WBjbbsDao95PKGGnYevWR0 Xfy5VfsHYQw+RtFdG4BMH8m/7mz7ec11omBZoT5H38wgtZEW1rKnnco49fPmWv5pDCALLDviD PBvdsgzgVbXdqMzTtk1sHV7aIwhW+6GJoaDEo6LPvyxPh+lgELCJFyOAvFsJdlJ77BoPHn23a MINDeEtfpe4v12YiKKc/cn60jHJMG029F2XaUmxpEHu3aGs/cJwlNJ/9ziZQP8fX21W+hCjOZ R4xTwakhmimDRUhu/hpO+awHLPYOdK4pp5/A/uaIdr5x9qvTEWCZZgS/JDiscbrP4x7hxx7Cx jWyqLJnxvY/xY7lrtU2Sll1LG0q9TyYdPT7KmVdobqf2Uri5YEF7MwLj9bc02Y1lUG/DAePx0 PMp+Dp7mLG73u6DUZsDqAz6ginLX58QwAB9GipG35N3z5bDH4Jws9tM7xm3DN935gM+LpQ5du nNuW90Xd6FMH7dXDm1GMphLnYmZCVuTO7zjr7svlry6uHOH2m/8BAke9KwFocHGcY4xbX5lBd C12oH3xkU+A4ZCyLP9dlhiURJ17oAhbqXPdidM/rM2vPRHFJ771xsC172zSbl8B9QqlNBeqIz RnSMxD1HwFEXmM+P6bkDCrdDZJ/0FHQSikQeAZOZZjLD9/JYRIsNNfV/+vrLb5+W3Ct+zwVAO lk5GVHtEUD8gksYOvhxvz6FV/KM= 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 traffic handling and temporary park the SPI thread. Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000") Signed-off-by: Stefan Wahren --- drivers/net/ethernet/qualcomm/qca_debug.c | 9 ++++----- drivers/net/ethernet/qualcomm/qca_spi.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) -- 2.34.1 diff --git a/drivers/net/ethernet/qualcomm/qca_debug.c b/drivers/net/ethernet/qualcomm/qca_debug.c index 6f2fa2a42770..a5445252b0c4 100644 --- a/drivers/net/ethernet/qualcomm/qca_debug.c +++ b/drivers/net/ethernet/qualcomm/qca_debug.c @@ -263,7 +263,6 @@ 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); if ((ring->rx_pending) || @@ -271,14 +270,14 @@ qcaspi_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring, (ring->rx_jumbo_pending)) return -EINVAL; - if (netif_running(dev)) - ops->ndo_stop(dev); + if (qca->spi_thread) + kthread_park(qca->spi_thread); 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); return 0; } diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c index bec723028e96..b0fad69bb755 100644 --- a/drivers/net/ethernet/qualcomm/qca_spi.c +++ b/drivers/net/ethernet/qualcomm/qca_spi.c @@ -580,6 +580,18 @@ 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()) { + netif_tx_disable(qca->net_dev); + netif_carrier_off(qca->net_dev); + qcaspi_flush_tx_ring(qca); + kthread_parkme(); + if (qca->sync == QCASPI_SYNC_READY) { + netif_carrier_on(qca->net_dev); + netif_wake_queue(qca->net_dev); + } + continue; + } + if ((qca->intr_req == qca->intr_svc) && !qca->txr.skb[qca->txr.head]) schedule(); From patchwork Wed Dec 6 14:12:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13481860 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="fhpsqh//" Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33CC4D64; Wed, 6 Dec 2023 06:13:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701871977; x=1702476777; i=wahrenst@gmx.net; bh=t+f1UAgVS82IAxHkQg45rYdv3HCZesbwHcYQR49U1yA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=fhpsqh//DmRe51w/WhxGzgfDAwtWvu6SHZpm3I+aFBQuTbDVIONOPIAWmpZEdTbh gHS1oCDMmwhjR+Fp60IzIA+drhzBKasL5gF5zbBCYQyu6EocBbmLtOnrJqA/mL0K2 2NOTyDSUGG7YTQfLgeEDhwzgD9GmIth2tXbw4sfWDAPzdYLUc1Ln+bhrXurSeR7Pb ZzS8KtOO3UDJx/nyrjNbl+RPRZdJJ/EZRLuhlB3gQWlK8Wv8apQzQ9Y/OrtryE/cN iXrKgoO2xsm9oysCske6IgLzXMMomNDflIOLVYLk0XKnu/ALFAf6WHlKURNahZbiL Yfea6aPt6AmzvKeORg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MtfJd-1rWY7z3UQZ-00v6lK; Wed, 06 Dec 2023 15:12:56 +0100 From: Stefan Wahren To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH V3 2/3] qca_debug: Fix ethtool -G iface tx behavior Date: Wed, 6 Dec 2023 15:12:21 +0100 Message-Id: <20231206141222.52029-3-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206141222.52029-1-wahrenst@gmx.net> References: <20231206141222.52029-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:36FELgj58zhnj9meTzWv5UNr4ht+VcW2xPTn1NS6lRPF5yKk3M/ r+NuO+ANLp744TAqiAYURQXc5Y2UO/gcQ5l4vYvcV74WUkE5ZvEoV/QycDSTPWYTJHRzVSn A3Emy114Ey7I7Dz/H7UjWymfuBiK3gE5LB/IKnE8VJ+RVo4XsBwByOCXpk8MXrrXilAnG/Y oJlNrRW64py1cqP8ZmXqg== UI-OutboundReport: notjunk:1;M01:P0:deRqzXBwFwo=;NxG2xNoVGLrOFMC2+iMbaJOMFZf vfKnZyrighxPEze1v9oFpvFyplcmMjtKe/DJHVY19h5chkH2Btl+Mi618VE+Fwdtk/1kOpfsS oqVdB8Z4X2MNgmBu/KUZlNpBi2T41UBjER6pmGpB3I3Hl3wSlLK0iHIK9x1JgybpvzIAfO7gj AWkpEf5cRrbuW6e29GKNT2+dTxao2pFs1ldbXwKPZFT6yQGPYNLdlMIta+40wjtupbiEt/TZ4 HpJ5i7tU2sTcZEbKKSDEsMEVh5gDmJe53sb1XNXrq6lggQuJKr0LRZNH1dFVfz0DHeap481mE L8HkQpuSYfSzeAN+oXXTyV/f0toq+WkGsb+9WAccJYvI5ohLwNQpA/u6JSrnSPdUrftcKwg22 j65NbE3867LaZRK5BldLAKyvTyROISOhLmT0/hAiVv2kouFBIqXQ5QUem230t+CEkh6to0fmc KPZOkTs9tksn5weqflWsiYqDklGyGPBNgws3L1bxXtyKUlhE7BnJeMZ1O87F11xJjlGV5WUdC DEwwX5pmlHHQghrxya+azQYafWsIAtQcQ/Xe/NlqhJNNAYJ8G388dWF0ePmfuI4Jy9mNPOjpT H1rf9gIZ3AqmgWR+VuASVm0fnL+pVy/UltwetL6DU/Bj6ixjPOiFZXZPD1nJTNxsCji7aL0NW uNL6CudETiftfnNq8UiUnDzOaCXzPD1Y1RpjXp82QUx9JwAk/FYdhyoxeqWjzndqWMZNuP8Ed lgGDZXqtim3o2o2iKyULMYeg9TJl+SfH/oTw/IkPfbE9W2qMA0qoW9V0HMA4yG01JEwQltO+k y331nYJ4f2oPrlgAHJsLpako/HnQkKI8Te/a7YiK4KGfUcERVGyNqMVJtlAxeGuj74Y5wnUOQ t8K6nEMy7XZIJfdPAQhWxawdZ99gaX3BTugBUxNc4pqSDsnfBr8QkbeLAkJF63AQk0EENamEs +qqtjJgAjTr5bKue043HAG06QNI= 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 a5445252b0c4..1822f2ad8f0d 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; } @@ -265,7 +267,7 @@ qcaspi_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring, { struct qcaspi *qca = netdev_priv(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 Dec 6 14:12:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13481858 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="nMnbgVzJ" Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65B20D4D; Wed, 6 Dec 2023 06:13:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701871977; x=1702476777; i=wahrenst@gmx.net; bh=NFHFy7MUTsIivLLoDazvEvqOotBAQMt162fTOKvGnW4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=nMnbgVzJ5g9k4NhkelmRDBlz7WbjnM9nwn6xE0e14EZ/q3E9Ei7DaCfStDJ9GYZt 31EiwRZAPvGw3l/L5qCTeh8v99do6bY6w2MeH+Q/PwUdzoV4lQ1t/UTm+PLOPDj21 qeWee1MS66gJVwfUe70QgFolQ3bfk5RxBPkf4anY4x6uQGQHF3jrGnrPeTgYsIdm3 UgsU+9OiQT5d7eg0ZVlXx2XsdiXSLd59wti3V7kKasN23KKElVCEwRCz0OL8MNoQh cXHnJL7Dc3GJq0MUUXw43ZasY1BGtP8k1zc4QqWKMmyayFTHPNUV72Q8XD7aCkIjr uhvfATbjwRnVAugMLg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MpDJd-1ravrC0Kh5-00qlAk; Wed, 06 Dec 2023 15:12:57 +0100 From: Stefan Wahren To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH V3 3/3] qca_spi: Fix reset behavior Date: Wed, 6 Dec 2023 15:12:22 +0100 Message-Id: <20231206141222.52029-4-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206141222.52029-1-wahrenst@gmx.net> References: <20231206141222.52029-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:+XSWkDgLG6Ts7yg8IvwWWOfQQgwbt2PKtQsWdmvBvK1QXPcSrZT 1p591gcydajuLH8DrU1WjNiXNHLADPCAbus6Od/+vKBDjMcm5F63uskiGZ0CRIQuk/TDgWC jVPI02amPtfrp7Ds6sA84eJosQ/hULL3wmDPO1+l1wymxvZyTcJkeGWMe/GVWjxrs5YXTTS TOEq8SJl/CyZ9BgfZXg2Q== UI-OutboundReport: notjunk:1;M01:P0:6rEvhQ21+Mc=;zuh1M4W3sztlsJGyKeR50nIJMhR IBuGi2ieIugsooP/gypPY5lnP9S0dabGARRPLBU4rsc9NVEyRQuMJTmHz60EbmUPo9iKqhj2v i3glTa/EeYft4myDbmMozzzV2SusrNzwGZ5GVv1YWIFBWwMmwiqnqbccwzM2uBHsCM+j3jwT4 QfbaczjA4da7s7SPL4Fi/ZHRU6q76CFYtkcNPl9SP2O9Y8O42K4EfYlRApb7vXJLYzvgI1oK0 Y/vw3HwLYVaY8yQAY2/VfSdqWXMQcV1SEeuzqgdXgrO8O2qXn6B9o9VMYAxtGsse/qa8KECd6 KZEDH4/VQJ6Vf494E+QrK6aPWY56KFVgB+ji/y5N9DQrq4wgaacHLvxoMOzGVOFNmLTmlI9cm JA0XVyfsZXOhK6QWhJBXS9UuCDqSzzxwRovA/WiDCQAb1fF49WzTyqKvC3FY1VWd7wkR7uWPE 92nWxpFl/Z6cDkjcypkKZuxQuPn2M0Af+JO3Q63JLe+dwdp720P4wnBSEbcyHPaefUuEz97lB dBl5bNKy5syueHx/6tNIvJdEgnTfeD3Mb3jgHkYFgda9u3FLzBCQm9T0O8yXjy45sv2aqTTRe EEsedw353HgoDZPMNFjRMN0Ca7q3DnpyUlMS/SwG+a7Jr/FVunshN1FD21Z8pp033ScHBQ2HF 0YN2pGX5gF3FkQsiaUlZ1rxgYLZoMT5ZghoKfaQ7HCOVMDIQ6XPhaV7+7zq6yXKwkhnejM31i 7ahQ+ytiwZqRL1wuwHAgCsezMrA9ajKQ8vBObrnkzn1US8l0Vmwf7AH824nYj97PJNoRLgSm7 VFRYiznSpL/GEorZCoz2Cx2LOBFevGCPTtrXyuvDx+3VK4BLdzvjp0xQT9o4mwzOYO92YkSzm GQBqlW+1CKZKJpfPWSzP2RSVAZuO+FtSbi5ITglfACrv++hWwtwLvEarojoTlte1rOUPIqd8N 1AvvEukd2c69QVIDb+B0DFLJG/c= 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 b0fad69bb755..5f3c11fb3fa2 100644 --- a/drivers/net/ethernet/qualcomm/qca_spi.c +++ b/drivers/net/ethernet/qualcomm/qca_spi.c @@ -620,11 +620,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); }