i.MX6SoloX Linux 5.4 - fec_main.c : Not updating transmit interrupt status

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX6SoloX Linux 5.4 - fec_main.c : Not updating transmit interrupt status

1,195 Views
parth_shah
Contributor III

Hi,

I am doing a ping between 2 devices based on IMX6SX. After certain point of time it is doing a fec_dump.

After debugging further, it is found out that fec_enet_interrupt() function is getting called only for RX interrupt, and transmit complete interrupt is not set.

#define FEC_ENET_RXF_0 ((uint)0x02000000) /* Full frame received */

static irqreturn_t
fec_enet_interrupt(int irq, void *dev_id)
{
struct net_device *ndev = dev_id;
struct fec_enet_private *fep = netdev_priv(ndev);
uint int_events;
irqreturn_t ret = IRQ_NONE;

int_events = readl(fep->hwp + FEC_IEVENT);
writel(int_events, fep->hwp + FEC_IEVENT);

int_events is always read as 0x2000000.

DTS node:

fec1: ethernet@2188000 {
compatible = "fsl,imx6sx-fec", "fsl,imx6q-fec";
reg = <0x02188000 0x4000>;
interrupt-names = "int0", "pps";
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6SX_CLK_ENET>,
<&clks IMX6SX_CLK_ENET_AHB>,
<&clks IMX6SX_CLK_ENET_PTP>,
<&clks IMX6SX_CLK_ENET_REF>,
<&clks IMX6SX_CLK_ENET_PTP>;
clock-names = "ipg", "ahb", "ptp",
"enet_clk_ref", "enet_out";
fsl,num-tx-queues = <3>;
fsl,num-rx-queues = <3>;
stop-mode = <&gpr 0x10 3>;
fsl,wakeup_irq = <0>;
status = "disabled";
};

@igorpadykov : Any suggestion to debug this.

0 Kudos
5 Replies

1,163 Views
parth_shah
Contributor III

Hi igor,

As of now we do not have i.MX6SX Sabre SD boards.

Any other suggestion to debug this issue.

0 Kudos

1,160 Views
igorpadykov
NXP Employee
NXP Employee

one can look at similar case but for receiver side

https://community.nxp.com/t5/i-MX-Processors/i-MX6-FEC-stops-generating-receive-interrupts/td-p/3030...

 

Best regards
igor

0 Kudos

1,125 Views
parth_shah
Contributor III

Hi igor,

This does not solve the problem with high bandwidth data.

 

0 Kudos

1,148 Views
parth_shah
Contributor III

Hi igor,

Thanks for the suggestion.

I did similar change for transmit queue, I still observe the issue now.

Patch:

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 5038fd15e196..429b0996cc1f 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2265,12 +2265,31 @@ fec_enet_interrupt(int irq, void *dev_id)
return ret;
}

+static void fec_enet_recover_txq (struct fec_enet_private *fep, unsigned int queue_id)
+{
+ int work_bit = (queue_id == 0) ? 2 : ((queue_id == 1) ? 0 : 1);
+ if (readl(fep->tx_queue[queue_id]->bd.reg_desc_active))
+ return;
+
+ fep->work_tx |= (1 << work_bit);
+}
+
+static void fec_enet_recover_txqs(struct fec_enet_private *fep)
+{
+ unsigned int queue_id = 0;
+ for (queue_id = 0; queue_id < fep->num_tx_queues; queue_id++)
+ {
+ fec_enet_recover_txq(fep, queue_id);
+ }
+}
+
static int fec_enet_rx_napi(struct napi_struct *napi, int budget)
{
struct net_device *ndev = napi->dev;
struct fec_enet_private *fep = netdev_priv(ndev);
int pkts;

+ fec_enet_recover_txqs(fep);
pkts = fec_enet_rx(ndev, budget);

fec_enet_tx(ndev);

 

0 Kudos

1,173 Views
igorpadykov
NXP Employee
NXP Employee

Hi Parth

 

one can try to reproduce issue with i.MX6SX Sabre SD boards and compare with custom,

use Demo Images from

https://www.nxp.com/design/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applicat...

 

Best regards
igor

0 Kudos