summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2020-06-10 05:37:41 +0200
committerPeter Chen <peter.chen@nxp.com>2020-06-10 05:37:41 +0200
commit38145ed12ed9935377fec40e0c3f50fbdda1e148 (patch)
tree17fdfe4aed05e9a7c8a3b98a7cb2204d3e311599 /drivers/usb
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (diff)
downloadlinux-38145ed12ed9935377fec40e0c3f50fbdda1e148.tar.xz
linux-38145ed12ed9935377fec40e0c3f50fbdda1e148.zip
usb: chipidea: udc: fix the ENDIAN issue
Fix the ENDIAN issue when assign dTD entry. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/chipidea/udc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index db0cfde0cc3c..ff9de91d98ca 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -473,9 +473,10 @@ static void ci_add_buffer_entry(struct td_node *node, struct scatterlist *s)
int empty_td_slot_index = (CI_MAX_BUF_SIZE - node->td_remaining_size)
/ CI_HDRC_PAGE_SIZE;
int i;
+ u32 token;
- node->ptr->token +=
- cpu_to_le32(sg_dma_len(s) << __ffs(TD_TOTAL_BYTES));
+ token = le32_to_cpu(node->ptr->token) + (sg_dma_len(s) << __ffs(TD_TOTAL_BYTES));
+ node->ptr->token = cpu_to_le32(token);
for (i = empty_td_slot_index; i < TD_PAGE_COUNT; i++) {
u32 page = (u32) sg_dma_address(s) +