This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] Linux/AM3352:AM335x c_can 禁用所有中断失败

Guru**** 2540720 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/600203/linux-am3352-am335x-c_can-disable-all-interrupts-fail

器件型号:AM3352

工具/软件:Linux

请参阅 SDK7.0
【问题描述】

Step1、c_can 逐一发送 帧、但没有接收器。

Step2、反复调用函数 c_CAN_close (c_CAN.c)和函数 c_CAN_open。  许多次之后、下面发生了奇怪的事情:

程序运行: c_CAN_Close (1216)-> c_CAN_Close (1222)-> c_CAN_STOP (758)-> c_CAN_ISR (1156)-> c_CAN_ISR (1164)-> c_CAN_ISR (1164)-> c_CAN_ISR (1156)-> c_CAN_ISR (1164)-> c_ISR_1156 (cCAN)-> CAN_ISR (1164)

所有中断被禁用、但调用 c_CAN_ISR 时没有停止、原因是什么?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    抱歉! 错过照片。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    计划:

    1216静态 int c_CAN_close (struct net_device *dev)
    1217{
    1218struct c_co_priv_priv* priv= netdev_priv(dev);
    1219.
    1220netif_stop_queue (dev);
    1221NAPI_DISABLE (&priv->NAPI);
    1222c_CAN_stop (dev);
    1223FREE_IRQ (DEV->IRQ、DEV);
    1224close_candev (dev);
    1225.
    1226c_CAN_RESET_ram (priv, false);
    1227c_CAN_pm_runtime_put _sync (privc);
    1228.
    1229CAN_LED_EVENT (DEV、CAN_LED_EVENT_STOP);
    1230
    1231返回0;
    1232}

    0752静态空 c_CAN_stop (struct net_device *dev)
    0753{
    0754struct c_CAN_priv* priv= netdev_priv(开发);
    075
    0756/*禁用所有中断*/
    0757c_CAN_enable_all_interrupts (privc、disable_all_interrupts);
    0758.
    0759/*将状态设置为已停止*/
    0760priv->CAN.state = CAN_State_Stopped;
    0761}

    1156静态 irqreturn_t c_CAN_ISR (int IRQ、void *dev_id)
    1157{
    1158struct net_device *dev =(struct net_device *) dev_id;
    1159struct c_co_priv_priv* priv= netdev_priv(dev);
    1160
    1161priv->irqstatus = priv->read_reg (priv, C_CAN_INT_REG);
    1162如果(!priv->irqstatus)
    1163{
    1164. 返回 IRQ_NONE;
    1165}
    1166.
    1167/*禁用所有中断并调度 NAPI */
    1168c_CAN_enable_all_interrupts (privc、disable_all_interrupts);
    1169NAPI_SCHEDUT(&U)->NAPI);
    1170 ltrace(priv->irqstatus);
    1171返回 IRQ_Handled;
    1172}
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    这已在以下 e2e 线程中进行了重复发布和处理:

    e2e.ti.com/.../601094

    此致、
    帕维尔