mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Hancock <hancockrwd@gmail.com>
To: David Brownell <david-b@pacbell.net>
Cc: Greg KH <greg@kroah.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Linux-usb <linux-usb@vger.kernel.org>
Subject: Re: [PATCH 2.6.34] ehci-hcd: add option to enable 64-bit DMA support
Date: Sat, 20 Feb 2010 01:15:36 -0600	[thread overview]
Message-ID: <51f3faa71002192315ia84786eo1138bf9ab3417f2d@mail.gmail.com> (raw)
In-Reply-To: <201002192139.46189.david-b@pacbell.net>

On Fri, Feb 19, 2010 at 11:39 PM, David Brownell <david-b@pacbell.net> wrote:
> On Thursday 18 February 2010, Robert Hancock wrote:
>> >
>> > But we disabled it on purpose, because of problems, do we want those
>> > problems again?
>>
>> AFAICS, it was disabled because of problems with kernel code, not with
>> hardware (and it appears the issue was with the code that detected the
>> expanded DMA mask in the USB device driver code, not the HCD driver).
>> CCing David Brownell who may know more.
>
> That's a good summary of the high points.  Testing was potentially an
> issue, but it never quite got that far.  So I have no idea if there are
> systems where EHCI advertises 64-bit DMA support but that support is
> broken (e.g. "Yet Another Hardware Mechanism MS-Windows Ignores", so that
> only Linux would ever trip over the relevant BIOS breakage).

According to one Microsoft page I saw, Windows XP did not implement
the 64-bit addressing feature in EHCI. I haven't found any information
on whether any newer Windows versions do or not.

>
> I won't attempt to go into details, but I recall a few basic issues:
>
>  * Not all clients or implementors of the "dma mask" mechanism agreed
>   on what it was supposed to achieve.  Few, for example, really used
>   it as a mask ... and it rarely affects allocation of buffers that
>   will later get used for DMA.
>
>  * Confusing semantics for the various types of DMA restriction which
>   hardware may impose, and upper layers in driver stacks would thus
>   need (in some cases) to cope with.

I think this is pretty well nailed down at this point. I suspect the
confusion partly comes from the expectation that driver code should be
able to use dma_supported to test a particular mask against what a
device had been configured for. This function is really meant for use
in arch code, not for drivers. It's supposed to indicate if it's legal
to set a device's mask to the given value, not whether a given DMA
mask is compatible with the previously set mask. Calling this on a
device that arch code doesn't know about (like a USB device) will
quite likely give a non-useful result or possibly even blow up. If a
driver needs to check a device's mask, it can just check against it
directly.

>
>  * How to pass such restrictions up the driver stack ... as for example
>   that NETIF_* flag.  ISTR there was some block layer issue too, but
>   at this remove I can't remember any details at all.  (If networking
>   and the block layer can use 64-bit DMA, I can't imagine many other
>   subsystems would deliver wins as big.)  For example, how would one
>   pass up the knowledge that a driver for a particular USB peripheral
>   across a few hubs) can do DMA to/from address 0x1234567890abcdef, but
>   the same driver can't do that for an otherwise identical peripheral
>   connected through a different HCD?

I think this logic is also in place, for the most part. The DMA mask
from the HCD appears to be propagated into the USB device, and then
into the interface objects. For usb-storage, the SCSI layer
automatically sets the bounce limit based on the device passed into
it, so the right thing gets done. The networking layer seems like it
would need explicit handling in the drivers - I think basically a
check if the device interface's DMA mask was set to DMA_BIT_MASK(64)
and if so, set the HIGHDMA flag.

>
>  * There were probably a few PCI-specific issues too.  I don't think
>   at that time there were many users of 64-bit DMA which weren't
>   specific to PCI.  Wanting to use the generic DMA calls for such
>   stuff wasn't really done back then.  But ... the USB stack uses
>   the generic calls, and drivers sitting on top of usbcore (and its
>   tightly coupled HCDs) will never issue PCI-specific calls, since
>   they need to work on systems that don't even have PCI.
>
> I basically think that if the controller can do 64-bit DMA, it should
> be enabling it by default ... assuming the software stack can handle
> that.  (What would be the benefit of adding needless restrictions,
> and making systems needlessly apply bounce buffering.)  So while I'd
> like to see the 64-bit DMA working, it should IMO be done without any
> options to cause trouble/confusion.
>
> But at that time it wasn't straightforward to manage 64-bit DMA except
> in the very lowest level PCI drivers.  That is, EHCI could do it ...
> but driver layers on top of it had no good way to do their part.  For
> example, when they manage DMA mappings themselves.)
>
> - Dave
>
>

  reply	other threads:[~2010-02-20  7:15 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-18  3:10 Robert Hancock
2010-02-18  4:26 ` Greg KH
2010-02-18  5:13   ` Robert Hancock
2010-02-18  5:22     ` Greg KH
2010-02-19  0:33       ` Robert Hancock
2010-02-19  0:47         ` Greg KH
2010-02-19  3:46           ` Robert Hancock
2010-02-19  3:54             ` Greg KH
2010-02-20  1:30               ` Robert Hancock
2010-02-20  4:26                 ` Greg KH
2010-02-20  5:39         ` David Brownell
2010-02-20  7:15           ` Robert Hancock [this message]
2010-02-20  8:07             ` David Brownell
2010-02-20 18:13               ` Robert Hancock
2010-02-23  6:48             ` Yuhong Bao
2010-02-24  0:26               ` Robert Hancock
2010-02-25  2:28                 ` Tejun Heo
2010-02-25  2:41                   ` Yuhong Bao
2010-02-25  2:58                     ` Tejun Heo
2010-02-25  3:15                   ` Yuhong Bao
2010-02-25  3:29                     ` Tejun Heo
2010-02-25  4:03                       ` Oliver Neukum
2010-02-25  5:25                         ` Tejun Heo
2010-02-25 16:14                           ` Greg KH
2010-02-25 23:15                             ` Robert Hancock
2010-02-25 23:25                               ` Greg KH
2010-02-26  7:01                                 ` Oliver Neukum
2010-02-24  3:53     ` SB600 64-bit DMA BIOS misconfiguration (formerly RE: [PATCH 2.6.34] ehci-hcd: add option to enable 64-bit DMA support) Yuhong Bao
2010-02-24  4:30       ` Robert Hancock
2010-02-24  4:33         ` Yuhong Bao
2010-02-24 13:30         ` Huang, Shane
2010-02-23  6:28 ` [PATCH 2.6.34] ehci-hcd: add option to enable 64-bit DMA support Yuhong Bao

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=51f3faa71002192315ia84786eo1138bf9ab3417f2d@mail.gmail.com \
    --to=hancockrwd@gmail.com \
    --cc=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®