Greetings,
I am working on a SDIO device driver on imx6sl EVK. I am running Linux3.10.17_ga.
I run into a warning from driver/mmc/host/sdhci.c occasionally. I would appreciate if you would like to share with me on whether you have seen the same warning or you have an idea about what may cause this warning.
Best Regards,
Xinsi Lin
------------[ cut here ]------------
WARNING: at drivers/mmc/host/sdhci.c:854 sdhci_send_command+0xdf0/0xeb4()
Modules linked in: dhd(O) evbug
CPU: 0 PID: 633 Comm: dhd_dpc Tainted: G W O 3.10.17-1.0.0_ga+g232293e #30
[<80013ae0>] (unwind_backtrace+0x0/0xf4) from [<80011504>] (show_stack+0x10/0x14)
[<80011504>] (show_stack+0x10/0x14) from [<800260d0>] (warn_slowpath_common+0x54/0x6c)
[<800260d0>] (warn_slowpath_common+0x54/0x6c) from [<80026184>] (warn_slowpath_null+0x1c/0x24)
[<80026184>] (warn_slowpath_null+0x1c/0x24) from [<80452820>] (sdhci_send_command+0xdf0/0xeb4)
[<80452820>] (sdhci_send_command+0xdf0/0xeb4) from [<80454014>] (sdhci_request+0xc0/0x1ec)
[<80454014>] (sdhci_request+0xc0/0x1ec) from [<8043f920>] (mmc_start_request+0xc4/0xe0)
[<8043f920>] (mmc_start_request+0xc4/0xe0) from [<8043fa54>] (__mmc_start_req+0x60/0x84)
[<8043fa54>] (__mmc_start_req+0x60/0x84) from [<8043fafc>] (mmc_wait_for_req+0x10/0x20)
[<8043fafc>] (mmc_wait_for_req+0x10/0x20) from [<7f024a90>] (sdioh_request_packet_chain+0x31c/0x45c [dhd])
[<7f024a90>] (sdioh_request_packet_chain+0x31c/0x45c [dhd]) from [<7f025b40>] (sdioh_request_buffer+0x118/0x2a8 [dhd])
[<7f025b40>] (sdioh_request_buffer+0x118/0x2a8 [dhd]) from [<7f026908>] (bcmsdh_send_buf+0x84/0x98 [dhd])
[<7f026908>] (bcmsdh_send_buf+0x84/0x98 [dhd]) from [<7f01f1f4>] (dhd_bcmsdh_send_buf.constprop.26+0x64/0x1b0 [dhd])
[<7f01f1f4>] (dhd_bcmsdh_send_buf.constprop.26+0x64/0x1b0 [dhd]) from [<7f01f9b0>] (dhdsdio_txpkt.constprop.25+0x5f0/0x688 [dhd])
[<7f01f9b0>] (dhdsdio_txpkt.constprop.25+0x5f0/0x688 [dhd]) from [<7f01fb68>] (dhdsdio_sendfromq+0x120/0x330 [dhd])
[<7f01fb68>] (dhdsdio_sendfromq+0x120/0x330 [dhd]) from [<7f022d18>] (dhd_bus_dpc+0x5b4/0xc80 [dhd])
[<7f022d18>] (dhd_bus_dpc+0x5b4/0xc80 [dhd]) from [<7f0071c0>] (dhd_dpc_thread+0xd4/0xec [dhd])
[<7f0071c0>] (dhd_dpc_thread+0xd4/0xec [dhd]) from [<8004345c>] (kthread+0xb4/0xb8)
[<8004345c>] (kthread+0xb4/0xb8) from [<8000e118>] (ret_from_fork+0x14/0x3c)
---[ end trace 3a302636f037804c ]---
Hi Xinsi
these warnings are caused by inaccuracies in driver porting, please look below,
so recommended to consult with vendor of that device of such kind of messages
http://e2e.ti.com/support/wireless_connectivity/f/307/p/356133/1250633
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor,
Thank you for your reply. I took a look at the link you provided but it is not the same issue. I took a close look at the code that throw the warning. In the code except below, on the line 842(in my code the same line of code is on line 854), it warns about "sg_cnt!=1". Here I have a question about why there is the restriction of "sg_cnt==1" by the sdhci driver. The im6sl DMA control supports chained sg buffers, right?
826 } else {
827 int sg_cnt;
829 sg_cnt = dma_map_sg(mmc_dev(host->mmc),
831 (data->flags & MMC_DATA_READ) ?
832 DMA_FROM_DEVICE :
833 DMA_TO_DEVICE);
834 if (sg_cnt == 0) {
835 /*
836 * This only happens when someone fed
837 * us an invalid request.
838 */
840 host->flags &= ~SDHCI_REQ_USE_DMA;
841 } else {
843 sdhci_writel(host, sg_dma_address(data->sg),
845 }
846 }
Thanks,
Xinsi Lin
Xinsi,
The warning in line 842 is in the core driver. It's from upstream linux, it's not an FSL addition. The warning is there because the code that follows it processes only a single dma request:
sdhci_writel(host, sg_dma_address(data->sg),
SDHCI_DMA_ADDRESS);
If your driver is returning more than 1 sg, you will need to modify this code to iterate through all of them using the for_each_sg macro. Note that there might be side effects to this. You'd be better off discussing it with the maintainer of the core driver or in its relevant mailing list.
Hi Xinsi
do you have these warnings with unchanged Demo codes ?
L3.10.17_1.0.2_iMX6SL_BUNDLE : i.MX 6Sololite, i.MXSoloEVK Linux Binary Demo
Best regards
igor
Hi Igor,
Yes, I have seen the warning with the kernel image I built from the original untouched source code. On the current image that I used to report the issue, actually I didn't change any logic in the code , I just added some debugging prints.
Cheers,
Xinsi
Hi Xinsi
nevertheless do you have these warnings with prebuilt Demo image,
without building?
L3.10.17_1.0.2_iMX6SL_BUNDLE : i.MX 6Sololite, i.MXSoloEVK Linux Binary Demo
Best regards
igor
I can't do insmod my driver with the pre-build image. the driver has to match the symbol version of kernel. Except for the symbol version, I believe my build image shall be identical logical wise to your pre-built.
Xinsi
Hi Xinsi
so, seems warnings are caused by your driver changes.
Best regards
igor
Hi Igor,
Yes or not. Your SDIO driver is not exercised without my driver. I said earlier in the thread the warning was against using chained sg-buffer. I asked the question before-"Here I have a question about why there is the restriction of "sg_cnt==1" by the sdhci driver. The imx6sl DMA control supports chained sg buffers, right?". Based on imx6sl reference manual, the imx6sl DMA operations support chained sg buffers, I am trying to understand why your sdhci driver warns about using chained sg buffers?
Thanks,
Xinsi
Hi Xinsi
what SDIO chip you are using ?
Not sure that it is possible to give comments on every piece of code
just based on warning messages.
Best regards
igor
Hi Xinsi
what SDIO chip is connected to sdhci1 of imx6sl evk ?
~igor