SPI事务超时linux设备驱动程序


11

我被困了最后三天。

我正在使用msm8960高通芯片组开发eink设备驱动程序。

Scenario: 在文件中:kernel / arch / arm / mach-msm / devices-8960.c

我无法验证use of spidm_channels" and "spidm_crci"和相应的条目。(msm8960 pro)(从某些参考代码复制)如何验证相应的值start and end是否正确?我有msm的数据表,但找不到任何参考。

为了在文件中创建新的gsbi资源,我添加了以下代码:

static struct resource resources_qup_spi_gsbi9[] = {
    {
            .name   = "spi_base",
            .start  = MSM_GSBI9_QUP_PHYS,
            .end    = MSM_GSBI9_QUP_PHYS + SZ_4K - 1,
            .flags  = IORESOURCE_MEM,
    },
    {
            .name   = "gsbi_base",
            .start  = MSM_GSBI9_PHYS,
            .end    = MSM_GSBI9_PHYS + 4 - 1,
            .flags  = IORESOURCE_MEM,
    },
    {
            .name   = "spi_irq_in",
            .start  = GSBI9_QUP_IRQ,
            .end    = GSBI9_QUP_IRQ,
            .flags  = IORESOURCE_IRQ,
    },
    {
             .name   = "spidm_channels",
            .start  = 3,
            .end    = 4,
            .flags  = IORESOURCE_DMA,
    },
    {
            .name   = "spidm_crci",
            .start  = 12,
            .end    = 13,
            .flags  = IORESOURCE_DMA,
    }, 
};

产生这种怀疑的原因是我们的DMA操作失败,并显示以下错误:from logs:

<6>[    0.764932] wait_for_ready: I/F Ready.^M
<7>[    0.765176] s1d13522_ spi9.0: setup mode 0, 16 bits/w, 51200000 Hz max --> 0^M
<3>[    1.756630] spi_qsd spi_qsd.9: msm_spi_process_transfer: SPI transaction timeout^M

然后,如果我们尝试执行另一个DMA操作,则会出现以下错误:

<3>[    6.773355] s1d13522if_cmd: wait_for_ready: I/F busy bit stuck^M
<7>[    6.775400] s1d13522_ spi9.0: setup mode 0, 16 bits/w, 51200000 Hz max --> 0^M
<4>[    6.775583] ------------[ cut here ]------------^M
<4>[    6.775614] WARNING: at /home/anshul_10605816/hip_mirror_2330_code/kernel        /lib/list_debug.c:32 __list_add+0x58/0x78()^M
<4>[    6.775644] list_add corruption. prev->next should be next (c0d5124c), but was 00100100. (prev=edf643b8).^M
<4>[    6.775675] Modules linked in:^M
<4>[    6.775766] [<c00149b8>] (unwind_backtrace+0x0/0x11c) from [<c007c818>] (warn_slowpath_common+0x4c/0x64)^M
<4>[    6.775827] [<c007c818>] (warn_slowpath_common+0x4c/0x64) from [<c007c8b0>] (warn_slowpath_fmt+0x2c/0x3c)^M
<4>[    6.775888] [<c007c8b0>] (warn_slowpath_fmt+0x2c/0x3c) from [<c02a9538>] (__list_add+0x58/0x78)^M
<4>[    6.775919] [<c02a9538>] (__list_add+0x58/0x78) from [<c001e3d4>] (start_ready_cmd+0x84/0x13c)^M
<4>[    6.775980] [<c001e3d4>] (start_ready_cmd+0x84/0x13c) from [<c001e704>] (msm_dmov_enqueue_cmd_ext_work+0x148/0x284)^M
<4>[    6.776041] [<c001e704>] (msm_dmov_enqueue_cmd_ext_work+0x148/0x284) from [<c0094e0c>] (process_one_work+0x27c/0x484)^M
<4>[    6.776072] [<c0094e0c>] (process_one_work+0x27c/0x484) from [<c0095224>] (worker_thread+0x210/0x3b0)^M
<4>[    6.776133] [<c0095224>] (worker_thread+0x210/0x3b0) from [<c00990c0>] (kthread+0x80/0x8c)^M
<4>[    6.776194] [<c00990c0>] (kthread+0x80/0x8c) from [<c000f108>] (kernel_thread_exit+0x0/0x8)^M
<4>[    6.776224] ---[ end trace da227214a82491b8 ]---^M
<3>[   11.766732] spi_qsd spi_qsd.9: msm_spi_process_transfer: SPI transaction timeout^M

任何帮助将不胜感激。

如果需要更多代码信息,请告诉我。

Answers:


1

资源设置取决于您的平台,而不仅取决于驱动程序。

一个想法可能是先将SPI总线与目标芯片组一起使用之前对其进行验证。我建议使用spidev接口和用户空间代码在总线上发送内容,并在逻辑分析仪或示波器上观察结果。我通常这样做是为了验证新板。

list_add损坏令人怀疑,但此时很难说更多。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.