All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH v1 2/4] usb: xhci: xhci_mem_init: Use cpu_to_le64() and not xhci_writeq()
Date: Thu,  2 Jul 2020 10:47:31 +0200	[thread overview]
Message-ID: <20200702084733.2032531-3-sr@denx.de> (raw)
In-Reply-To: <20200702084733.2032531-1-sr@denx.de>

xhci_writeq() makes the CPU->LE swapping only when addressing registers
in the xHCI controller address range and not in the local memory (RAM).
We need to use cpu_to_le64() here to ensure that the conversion is done
correctly.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>
---

 drivers/usb/host/xhci-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index bd959b4093..3b805ecb9e 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -562,7 +562,7 @@ int xhci_mem_init(struct xhci_ctrl *ctrl, struct xhci_hccr *hccr,
 		trb_64 = 0;
 		trb_64 = (uintptr_t)seg->trbs;
 		struct xhci_erst_entry *entry = &ctrl->erst.entries[val];
-		xhci_writeq(&entry->seg_addr, trb_64);
+		entry->seg_addr = cpu_to_le64(trb_64);
 		entry->seg_size = cpu_to_le32(TRBS_PER_SEGMENT);
 		entry->rsvd = 0;
 		seg = seg->next;
-- 
2.27.0

  parent reply	other threads:[~2020-07-02  8:47 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02  8:47 [PATCH v1 0/4] Stefan Roese
2020-07-02  8:47 ` [PATCH v1 1/4] usb: xhci: Add missing endian conversions (cpu_to_leXX / leXX_to_cpu) Stefan Roese
2020-07-16  9:24   ` Stefan Roese
2020-07-16  9:39     ` Bin Meng
2020-07-17  5:15   ` Bin Meng
2020-07-17  9:57     ` Stefan Roese
2020-07-17 11:18   ` Bin Meng
2020-07-17 11:34     ` Stefan Roese
2020-07-17 13:46       ` Bin Meng
2020-07-17 14:04         ` [PATCH v2 " Stefan Roese
2020-07-17 14:14           ` Bin Meng
2020-07-17 18:22             ` Stefan Roese
2020-07-20  1:48               ` Bin Meng
2020-07-21  8:39                 ` Stefan Roese
2020-07-02  8:47 ` Stefan Roese [this message]
2020-07-17  5:24   ` [PATCH v1 2/4] usb: xhci: xhci_mem_init: Use cpu_to_le64() and not xhci_writeq() Bin Meng
2020-07-17 10:04     ` Stefan Roese
2020-07-17 10:09       ` Bin Meng
2020-07-17 10:11         ` Stefan Roese
2020-07-17 10:13           ` Bin Meng
2020-07-17 11:19   ` Bin Meng
2020-07-02  8:47 ` [PATCH v1 3/4] usb: usb-uclass.c: Drop le16_to_cpu() as values are already swapped Stefan Roese
2020-07-17  5:33   ` Bin Meng
2020-07-17 10:08     ` Stefan Roese
2020-07-17 10:11       ` Bin Meng
2020-07-17 11:19   ` Bin Meng
2020-07-02  8:47 ` [PATCH v1 4/4] usb: xhci: Add virt_to_phys() to support mapped platforms Stefan Roese
2020-07-17  5:57   ` Bin Meng
2020-07-17 10:17     ` Stefan Roese
2020-07-17 10:23       ` Bin Meng
2020-07-17 10:28         ` Stefan Roese
2020-07-17 10:29           ` Bin Meng
2020-07-17 10:31             ` Stefan Roese
2020-07-17 11:19   ` Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200702084733.2032531-3-sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.