From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Tejas Joglekar <Tejas.Joglekar@synopsys.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
John Youn <John.Youn@synopsys.com>
Subject: Re: [RFC PATCH 1/4] usb: xhci: Synopsys xHC consolidate TRBs
Date: Tue, 17 Mar 2020 10:48:46 +0200 [thread overview]
Message-ID: <497332d3-88ff-da43-d7e5-c897935abf41@linux.intel.com> (raw)
In-Reply-To: <cb3b73da-d7f2-3bbc-f822-6a9ca4edc3d4@synopsys.com>
>> As this is extremely rare (never reported in a real use case)
>> I'd keep this as simple as possible. Allocate one bounce buffer when needed, and copy all.
>> If memory allocation fails (unlikely) print a warning, then we immediately know what to fix.
>>
>> We are talking about sizes where 16 sg entries have in total 1024 bytes of data.
>>
> Ok, I agree.
>> ehci-tegra.c does something related to what you want. It replaces
>> urb->transfer_buffer with a dma aligned bounce buffer.
>>
> I tried this (in hcd.c) and it seems to be working with my tests. I want to override the
> unmap_urb_for_dma() and map_urb_for_dma() and keep all other things same as xhci driver.
> I thought to use xhci_driver_override for doing this instead of creating a whole new glue
> driver. Would that be ok ?
There is already support that allows host controller drivers to override the default
usb_hcd_map_urb_for_dma() and usb_hcd_unmap_urb_for_dma() functions.
see comments in include/linux/usb/hcd.h struct hc_driver
We recently added xhci_map_urb_for_dma() override to support Immediate Data Transfers (IDT),
I think your quirk will fit nicely there. It can be after the IDT check as your quirk is not
needed if IDT is used (one trb with up to 8 bytes of data).
you will probably need to add a xhci_unmap_urb_for_dma() callback.
-Mathias
next prev parent reply other threads:[~2020-03-17 8:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-20 13:38 [RFC PATCH 0/4] Add logic to consolidate TRBs for Synopsys xHC Tejas Joglekar
2019-12-20 13:39 ` [RFC PATCH 1/4] usb: xhci: Synopsys xHC consolidate TRBs Tejas Joglekar
2020-01-02 9:08 ` David Laight
2020-01-03 16:44 ` Mathias Nyman
2020-02-07 17:17 ` Tejas Joglekar
2020-02-12 15:04 ` Mathias Nyman
2020-02-14 8:36 ` Tejas Joglekar
2020-03-03 10:24 ` Tejas Joglekar
2020-03-03 14:47 ` Mathias Nyman
2020-03-16 17:09 ` Tejas Joglekar
2020-03-17 8:48 ` Mathias Nyman [this message]
2019-12-20 13:39 ` [RFC PATCH 2/4] usb: dwc3: Add device property consolidate-trbs Tejas Joglekar
2019-12-20 13:40 ` [RFC PATCH 3/4] usb: xhci: Set quirk for XHCI_CONSOLIDATE_TRBS Tejas Joglekar
2019-12-20 13:40 ` [RFC PATCH 4/4] dt-bindings: usb: Add snps,consolidate-trbs & consolidate-trbs Tejas Joglekar
2020-01-08 15:19 ` Rob Herring
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=497332d3-88ff-da43-d7e5-c897935abf41@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=John.Youn@synopsys.com \
--cc=Tejas.Joglekar@synopsys.com \
--cc=linux-usb@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).