[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1908121018430.1659-100000@iolanthe.rowland.org>
Date: Mon, 12 Aug 2019 10:20:07 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Felipe Balbi <felipe.balbi@...ux.intel.com>
cc: Pawel Laszczak <pawell@...ence.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"hdegoede@...hat.com" <hdegoede@...hat.com>,
"heikki.krogerus@...ux.intel.com" <heikki.krogerus@...ux.intel.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"rogerq@...com" <rogerq@...com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"jbergsagel@...com" <jbergsagel@...com>,
"nsekhar@...com" <nsekhar@...com>, "nm@...com" <nm@...com>,
Suresh Punnoose <sureshp@...ence.com>,
"peter.chen@....com" <peter.chen@....com>,
Jayshri Dajiram Pawar <jpawar@...ence.com>,
Rahul Kumar <kurahul@...ence.com>
Subject: RE: [PATCH v9 5/6] usb:cdns3 Add Cadence USB3 DRD Driver
On Mon, 12 Aug 2019, Felipe Balbi wrote:
> I don't understand the intricacies of the coherent API to judge if it's
> a bug in the API itself. In any case, here's where the splat comes from:
>
> void dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
> dma_addr_t dma_handle, unsigned long attrs)
> {
> const struct dma_map_ops *ops = get_dma_ops(dev);
>
> if (dma_release_from_dev_coherent(dev, get_order(size), cpu_addr))
> return;
> /*
> * On non-coherent platforms which implement DMA-coherent buffers via
> * non-cacheable remaps, ops->free() may call vunmap(). Thus getting
> * this far in IRQ context is a) at risk of a BUG_ON() or trying to
> * sleep on some machines, and b) an indication that the driver is
> * probably misusing the coherent API anyway.
> */
> WARN_ON(irqs_disabled());
>
> if (!cpu_addr)
> return;
>
> debug_dma_free_coherent(dev, size, cpu_addr, dma_handle);
> if (dma_is_direct(ops))
> dma_direct_free(dev, size, cpu_addr, dma_handle, attrs);
> else if (ops->free)
> ops->free(dev, size, cpu_addr, dma_handle, attrs);
> }
> EXPORT_SYMBOL(dma_free_attrs);
>
> maybe you're gonna have to fire up a workqueue to free this memory for
> you :-(
>
> Unless someone else has better ideas. Alan, Greg, any ideas?
I don't understand it very well myself, but there have been posts by
some of the DMA maintainers on this topic. Maybe you can try asking
them.
Alan Stern
Powered by blists - more mailing lists