> -----Original Message----- > From: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> > Sent: 2019年11月12日 19:34 > To: Joakim Zhang <qiangqing.zhang@xxxxxxx>; sean@xxxxxxxxxx; > linux-can@xxxxxxxxxxxxxxx > Subject: Re: Wake up issue about Flexcan driver in v5.4 kernel > > On 11/12/19 12:02 PM, Joakim Zhang wrote: > >> I suggest to set a flag in the suspend handler and evaluate the flag > >> in the interrupt handler. If the flag is set, we have to ignore the timestamp. > > > > Not quite understand, could you explain more? Thanks 😉 > > With a wakeup to IRQ latency higher than the time stamp counter overflow > time we cannot rely on the timestamps of the CAN frames in the first IRQ > handler run after wakeup. > > My proposal is to set a flag in the suspend handler, e.g. > priv->ignore_timestamp = true; > > For now make a copy of > can_rx_offload_irq_offload_timestamp() > call it > can_rx_offload_irq_offload_ignore_timestamp() > replace > __skb_queue_add_sort(&skb_queue, skb, can_rx_offload_compare); by > skb_queue_tail(&offload->skb_queue, skb); > > In the IRQ handler, check if the flag is set, call > can_rx_offload_irq_offload_ignore_timestamp() > and unset the flag. > > Check if that helps. Hi Marc, This can work at my side. Thanks. The reason is that PCIe link training in the DWC PCIe noirq_resume consumed more than 1s. can: flexcan: fix deadlock when using self wakeup can: flexcan: add LPSR mode support for i.MX7D This patch set has been pending for a long time, could you please review it? After that, I can send a patch to fix his issue on the top of it. Best Regards, Joakim Zhang > Marc > > -- > Pengutronix e.K. | Marc Kleine-Budde | > Embedded Linux | https://www.pengutronix.de | > Vertretung West/Dortmund | Phone: +49-231-2826-924 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |