diff options
author | Dong Aisheng <aisheng.dong@freescale.com> | 2015-10-31 16:32:09 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@freescale.com> | 2015-11-02 10:58:20 +0800 |
commit | 43c2f4fc4f3a2612d95bc195326d4d00e5769b8c (patch) | |
tree | 617abe1f388f815ded3df4212de8c7e837a824a8 | |
parent | ad51d112314bf70ea2c9d805444ae664f1dd214a (diff) |
MLK-11794 bcmdhd: prevent driver to use scatter list DMA if host not support
Current driver will meet the following warning on MX6SL platform which does
not support ADMA.
It is caused by the driver is using fixed scatter gather DMA not matter whether
the host supports or not. Then the host without ADMA capability will warning
if found the DMA sg_count is non-1.
Change the driver a bit to avoid multi DMA scatter list if found the
host->max_segs is only 1 to fix the issue.
root@imx6slevk:~# udhcpc -i wlan0
udhcpc (v1.23.1) started
Sending discover...
Sending select for 192.168.1.11...
Lease of 192.168.1.11 obtained, lease time 86400
/etc/udhcpc.d/50default: Adding DNS 192.168.1.1
root@imx6slevk:~# ------------[ cut here ]------------
WARNING: CPU: 0 PID: 954 at /home/jenkins/jobs/Standalone-X11_with_mfgtools/workspace/temp_build_dir/build_fsl-imx-internal-x11/tmp/work-shared/imx6slevk/kernel-source/drivers/mmc/host/sdhci.c:839 sdhci_send_command+0xc64/0xd10()
Modules linked in: bcmdhd evbug [last unloaded: bcmdhd]
CPU: 0 PID: 954 Comm: dhd_dpc Tainted: G W 3.14.52-1.1.0_ga+g76946e8 #1
[<80014a68>] (unwind_backtrace) from [<80011758>] (show_stack+0x10/0x14)
[<80011758>] (show_stack) from [<80720180>] (dump_stack+0x7c/0xbc)
[<80720180>] (dump_stack) from [<80031df8>] (warn_slowpath_common+0x70/0x8c)
[<80031df8>] (warn_slowpath_common) from [<80031eb0>] (warn_slowpath_null+0x1c/0x24)
[<80031eb0>] (warn_slowpath_null) from [<804d5d2c>] (sdhci_send_command+0xc64/0xd10)
[<804d5d2c>] (sdhci_send_command) from [<804d74e8>] (sdhci_request+0xc0/0x1f0)
[<804d74e8>] (sdhci_request) from [<804c218c>] (__mmc_start_req+0x60/0x84)
[<804c218c>] (__mmc_start_req) from [<804c25a4>] (mmc_wait_for_req+0x10/0x20)
[<804c25a4>] (mmc_wait_for_req) from [<7f27ff6c>] (sdioh_request_packet_chain+0x368/0x400 [bcmdhd])
[<7f27ff6c>] (sdioh_request_packet_chain [bcmdhd]) from [<7f280da4>] (sdioh_request_buffer+0x124/0x294 [bcmdhd])
[<7f280da4>] (sdioh_request_buffer [bcmdhd]) from [<7f27f6dc>] (bcmsdh_send_buf+0x94/0x108 [bcmdhd])
[<7f27f6dc>] (bcmsdh_send_buf [bcmdhd]) from [<7f28e98c>] (dhd_bcmsdh_send_buf.constprop.25+0x80/0x220 [bcmdhd])
[<7f28e98c>] (dhd_bcmsdh_send_buf.constprop.25 [bcmdhd]) from [<7f28f454>] (dhdsdio_txpkt.constprop.24+0x928/0xa2c [bcmdhd])
[<7f28f454>] (dhdsdio_txpkt.constprop.24 [bcmdhd]) from [<7f28f6b0>] (dhdsdio_sendfromq+0x158/0x3c4 [bcmdhd])
[<7f28f6b0>] (dhdsdio_sendfromq [bcmdhd]) from [<7f2913d4>] (dhdsdio_dpc+0x2e8/0x1034 [bcmdhd])
[<7f2913d4>] (dhdsdio_dpc [bcmdhd]) from [<7f24a270>] (dhd_dpc_thread+0xe8/0x124 [bcmdhd])
[<7f24a270>] (dhd_dpc_thread [bcmdhd]) from [<8004ca6c>] (kthread+0xcc/0xe4)
[<8004ca6c>] (kthread) from [<8000e500>] (ret_from_fork+0x14/0x34)
Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
-rw-r--r-- | drivers/net/wireless/bcmdhd/dhd_sdio.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/wireless/bcmdhd/dhd_sdio.c b/drivers/net/wireless/bcmdhd/dhd_sdio.c index c7f587c8320c..4b628e94234b 100644 --- a/drivers/net/wireless/bcmdhd/dhd_sdio.c +++ b/drivers/net/wireless/bcmdhd/dhd_sdio.c @@ -24,6 +24,10 @@ * $Id: dhd_sdio.c 506047 2014-10-02 12:43:31Z $ */ +#include <linux/mmc/host.h> +#include <linux/mmc/card.h> +#include <linux/mmc/sdio_func.h> + #include <typedefs.h> #include <osl.h> #include <bcmsdh.h> @@ -53,6 +57,7 @@ #include <sbsdpcmdev.h> #include <bcmsdpcm.h> #include <bcmsdbus.h> +#include <bcmsdh_sdmmc.h> #include <proto/ethernet.h> #include <proto/802.1d.h> @@ -1737,6 +1742,9 @@ static int dhdsdio_txpkt_preprocess(dhd_bus_t *bus, void *pkt, int chan, int txs uint32 swhdr_offset; bool alloc_new_pkt = FALSE; uint8 sdpcm_hdrlen = bus->txglom_enable ? SDPCM_HDRLEN_TXGLOM : SDPCM_HDRLEN; + sdioh_info_t *sd = bus->sdh->sdioh; + struct sdio_func *sdio_func = sd->func[0]; + struct mmc_host *host = sdio_func->card->host; *new_pkt = NULL; osh = bus->dhd->osh; @@ -1814,7 +1822,7 @@ static int dhdsdio_txpkt_preprocess(dhd_bus_t *bus, void *pkt, int chan, int txs * Use the padding packet to avoid memory copy if applicable, * otherwise, just allocate a new pkt. */ - if (bus->pad_pkt) { + if (bus->pad_pkt && (host->max_segs > 1)) { *pad_pkt_len = chain_tail_padding; bus->tx_tailpad_chain++; } else { |