Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

ehci_hcd map_single: unable to map unsafe buffer on a stan..

 
   Soft32 Home -> Linux -> Ports PowerPC -> ARM RSS
Next:  ehci_hcd map_single: unable to map unsafe buffer ..  
Author Message
David & Anne-Sophie

External


Since: Sep 10, 2007
Posts: 3



(Msg. 1) Posted: Mon Sep 10, 2007 6:20 pm
Post subject: ehci_hcd map_single: unable to map unsafe buffer on a standard NSLU2
Archived from groups: linux>debian>ports>arm (more info?)

Hello all,
I am trying to use my hybrid USB tuner on my NSLU2.
Tuner=Terratec cinergy XS
Driver=http://mcentral.de/wiki/index.php/Em2880
I plugged it directly to the DISK-2 connector. On DISK-1 there is a USB
hard-disk that contains the filesystems.

The driver compiles fine on the standard debian etch kernel, and loads
perfectly.
I just did a minor patch of this driver around a udelay(2500); ->
udelay(2000);udelay(500); (2500 is a too big value for the ARM
architecture, see bad_udelay).

When I try tzap to activate the dvb-t stream, I get those errors:
ehci_hcd 0000:00:01.2: alloc_safe_buffer: could not alloc dma memory
(size=36096)
ehci_hcd 0000:00:01.2: map_single: unable to map unsafe buffer ffc2c000!
many times (I think one per USB packet).
And the tuner does not stream anything...

I did not modify anything in the NSLU2 (neither RAM or frequency), just
upgraded to debian etch arm architecture following the nslu2-linux.org
tutorials.
Do you know what it means and how to solve the issue?
Do not hesitate to ask for specific information.

Thanks!
Cheers,
David.
David.houard RemoveThis @free.fr


--
To UNSUBSCRIBE, email to debian-arm-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Login to vote
Riku Voipio

External


Since: Nov 19, 2006
Posts: 106



(Msg. 2) Posted: Mon Sep 10, 2007 7:00 pm
Post subject: Re: ehci_hcd map_single: unable to map unsafe buffer on a standard NSLU2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mon, Sep 10, 2007 at 06:09:20PM +0200, David & Anne-Sophie wrote:
> I am trying to use my hybrid USB tuner on my NSLU2.
> Tuner=Terratec cinergy XS
> Driver=http://mcentral.de/wiki/index.php/Em2880
> I plugged it directly to the DISK-2 connector. On DISK-1 there is a USB
> hard-disk that contains the filesystems.

> When I try tzap to activate the dvb-t stream, I get those errors:
> ehci_hcd 0000:00:01.2: alloc_safe_buffer: could not alloc dma memory
> (size=36096)
> ehci_hcd 0000:00:01.2: map_single: unable to map unsafe buffer ffc2c000!
> many times (I think one per USB packet).
> And the tuner does not stream anything...

> Do you know what it means and how to solve the issue?

This seems more like a driver and/or kernel issue, than debian/arm
specific issue. You might want to approach Em2880 developers first
for pointers.


--
To UNSUBSCRIBE, email to debian-arm-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Login to vote
David & Anne-Sophie

External


Since: Sep 10, 2007
Posts: 3



(Msg. 3) Posted: Mon Sep 10, 2007 7:10 pm
Post subject: Re: ehci_hcd map_single: unable to map unsafe buffer on a standard NSLU2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Riku Voipio a écrit :
> On Mon, Sep 10, 2007 at 06:09:20PM +0200, David & Anne-Sophie wrote:
>
>> I am trying to use my hybrid USB tuner on my NSLU2.
>> Tuner=Terratec cinergy XS
>> Driver=http://mcentral.de/wiki/index.php/Em2880
>> I plugged it directly to the DISK-2 connector. On DISK-1 there is a USB
>> hard-disk that contains the filesystems.
>>
>
>
>> When I try tzap to activate the dvb-t stream, I get those errors:
>> ehci_hcd 0000:00:01.2: alloc_safe_buffer: could not alloc dma memory
>> (size=36096)
>> ehci_hcd 0000:00:01.2: map_single: unable to map unsafe buffer ffc2c000!
>> many times (I think one per USB packet).
>> And the tuner does not stream anything...
>>
>
>
>> Do you know what it means and how to solve the issue?
>>
>
> This seems more like a driver and/or kernel issue, than debian/arm
> specific issue. You might want to approach Em2880 developers first
> for pointers.
>
>
>
But, i try this driver on a PC with ubuntu and it works very well ?


--
To UNSUBSCRIBE, email to debian-arm-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Login to vote
Lennart Sorensen

External


Since: Apr 05, 2007
Posts: 250



(Msg. 4) Posted: Mon Sep 10, 2007 8:20 pm
Post subject: Re: ehci_hcd map_single: unable to map unsafe buffer on a standard NSLU2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mon, Sep 10, 2007 at 07:05:25PM +0200, David & Anne-Sophie wrote:
> But, i try this driver on a PC with ubuntu and it works very well ?

Working on a PC does not mean the driver is correct. On a PC physical
addresses match the kernel's point of view in general, while on the arm
everything goes through interesting mappings, which make is essential
for the driver to correctly use readX/writeX calls along with ioremap
calls. Any attemps to directly access anything will fail on the arm
while it almost always works on a PC. Not sure quite how that might
impact a USB device, but even there the driver has to do DMA setup with
corrected addresses, which again is not necesary on a PC but is on the
arm.

--
Len Sorensen


--
To UNSUBSCRIBE, email to debian-arm-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Login to vote
David & Anne-Sophie

External


Since: Sep 10, 2007
Posts: 3



(Msg. 5) Posted: Mon Sep 10, 2007 8:50 pm
Post subject: Re: ehci_hcd map_single: unable to map unsafe buffer on a standard NSLU2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Lennart Sorensen a écrit :
> On Mon, Sep 10, 2007 at 07:05:25PM +0200, David & Anne-Sophie wrote:
>
>> But, i try this driver on a PC with ubuntu and it works very well ?
>>
>
> Working on a PC does not mean the driver is correct. On a PC physical
> addresses match the kernel's point of view in general, while on the arm
> everything goes through interesting mappings, which make is essential
> for the driver to correctly use readX/writeX calls along with ioremap
> calls. Any attemps to directly access anything will fail on the arm
> while it almost always works on a PC. Not sure quite how that might
> impact a USB device, but even there the driver has to do DMA setup with
> corrected addresses, which again is not necesary on a PC but is on the
> arm.
>
> --
> Len Sorensen
>
>
>
Ok, I will transfert your information to the developper of the driver
and i will keep you in front.


--
To UNSUBSCRIBE, email to debian-arm-REQUEST.TakeThisOut@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.TakeThisOut@lists.debian.org
Back to top
Login to vote
Lennart Sorensen

External


Since: Apr 05, 2007
Posts: 250



(Msg. 6) Posted: Mon Sep 10, 2007 9:10 pm
Post subject: Re: ehci_hcd map_single: unable to map unsafe buffer on a standard NSLU2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mon, Sep 10, 2007 at 08:48:39PM +0200, David & Anne-Sophie wrote:
> Ok, I will transfert your information to the developper of the driver
> and i will keep you in front.

If the driver wasn't using some version control system I had never heard
of I might even have looked at the code a bit. Smile

--
Len Sorensen


--
To UNSUBSCRIBE, email to debian-arm-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Login to vote
Lennart Sorensen

External


Since: Apr 05, 2007
Posts: 250



(Msg. 7) Posted: Mon Sep 10, 2007 10:50 pm
Post subject: Re: ehci_hcd map_single: unable to map unsafe buffer on a standard NSLU2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mon, Sep 10, 2007 at 10:06:03PM +0200, David & Anne-Sophie wrote:
> Sorry, I forgot something. The driver is in the directory :
> linux/drivers/media/video/em28xx

I assume you are running the tuner connected directly to the nslu2 right
and not through a hub? It does after all say it requires a lot of
dedicated bandwidth to run.

I wonder how much CPU it takes to handle that kind of traffic.

--
Len Sorensen


--
To UNSUBSCRIBE, email to debian-arm-REQUEST.DeleteThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.DeleteThis@lists.debian.org
Back to top
Login to vote
Thierry Merle

External


Since: May 29, 2007
Posts: 9



(Msg. 8) Posted: Tue Sep 11, 2007 2:00 pm
Post subject: Re: ehci_hcd map_single: unable to map unsafe buffer on a standard NSLU2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Lennart Sorensen wrote:
>
> On Mon, Sep 10, 2007 at 10:06:03PM +0200, David & Anne-Sophie wrote:
>> Sorry, I forgot something. The driver is in the directory :
>> linux/drivers/media/video/em28xx
>
> I assume you are running the tuner connected directly to the nslu2 right
> and not through a hub? It does after all say it requires a lot of
> dedicated bandwidth to run.
>
> I wonder how much CPU it takes to handle that kind of traffic.
>
> --
> Len Sorensen
>
>
> --
> To UNSUBSCRIBE, email to debian-arm-REQUEST.RemoveThis@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster.RemoveThis@lists.debian.org
>
>
>

Hello,
I am using a Terratec Cinergy T2 USB tuner on my 266MHz NSLU2.
When I am recording a DVB-T stream, it takes around 33% CPU (zapdvb process,
the tool I use to record) but surprisingly, my NSLU2 is much less responsive
for other tasks (big latencies for ssh, fetchmail, imap and other things
that run on my box).
Nevertheless, the recorded file contains the entire stream (video is fluid).
Do you think this is a CPU related problem?

Regards,
Thierry
--
View this message in context: http://www.nabble.com/ehci_hcd--map_single%3A-unable-to-map-unsafe-buf...-on-a-s
Sent from the debian-arm mailing list archive at Nabble.com.


--
To UNSUBSCRIBE, email to debian-arm-REQUEST.RemoveThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.RemoveThis@lists.debian.org
Back to top
Login to vote
Lennart Sorensen

External


Since: Apr 05, 2007
Posts: 250



(Msg. 9) Posted: Tue Sep 11, 2007 3:10 pm
Post subject: Re: ehci_hcd map_single: unable to map unsafe buffer on a standard NSLU2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, Sep 11, 2007 at 04:53:41AM -0700, Thierry Merle wrote:
> I am using a Terratec Cinergy T2 USB tuner on my 266MHz NSLU2.
> When I am recording a DVB-T stream, it takes around 33% CPU (zapdvb process,
> the tool I use to record) but surprisingly, my NSLU2 is much less responsive
> for other tasks (big latencies for ssh, fetchmail, imap and other things
> that run on my box).
> Nevertheless, the recorded file contains the entire stream (video is fluid).
> Do you think this is a CPU related problem?

Isn't DVB-T mpeg? That would be a lot less work than a raw captured tv
signal (the driver in question mentioned needing 170MBit per second on
the USB port per tuner, which sounds like an awful lot more data than an
mpeg stream would generate). That would need much more bandwidth from
the cpu, and if the cpu now has to compress the video it would take
quite a lot of cpu. Even the disk access to write 170MBit/s starts to
add up, especially since the disk is almost certainly on another USB
port. I am assuming your tuner has hardware encoding to mpeg or that it
is receiving an existing mpeg stream from some other DVB device.

So yes I could see it being simply a CPU issue.

--
Len Sorensen


--
To UNSUBSCRIBE, email to debian-arm-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Login to vote
Thierry Merle

External


Since: May 29, 2007
Posts: 9



(Msg. 10) Posted: Sun Sep 30, 2007 8:30 am
Post subject: Re: ehci_hcd map_single: unable to map unsafe buffer on a standard NSLU2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Lennart Sorensen a écrit :
> On Tue, Sep 11, 2007 at 04:53:41AM -0700, Thierry Merle wrote:
>
>> I am using a Terratec Cinergy T2 USB tuner on my 266MHz NSLU2.
>> When I am recording a DVB-T stream, it takes around 33% CPU (zapdvb process,
>> the tool I use to record) but surprisingly, my NSLU2 is much less responsive
>> for other tasks (big latencies for ssh, fetchmail, imap and other things
>> that run on my box).
>> Nevertheless, the recorded file contains the entire stream (video is fluid).
>> Do you think this is a CPU related problem?
>>
>
> Isn't DVB-T mpeg? That would be a lot less work than a raw captured tv
> signal (the driver in question mentioned needing 170MBit per second on
> the USB port per tuner, which sounds like an awful lot more data than an
> mpeg stream would generate). That would need much more bandwidth from
> the cpu, and if the cpu now has to compress the video it would take
> quite a lot of cpu. Even the disk access to write 170MBit/s starts to
> add up, especially since the disk is almost certainly on another USB
> port. I am assuming your tuner has hardware encoding to mpeg or that it
> is receiving an existing mpeg stream from some other DVB device.
>
> So yes I could see it being simply a CPU issue.
>
> --
> Len Sorensen
>
>
>
Right, DVB-T mpeg-2 TS for both cinergyT2 and em28xx based tuners.
To inform you the current state of the investigation:
- I wired a serial-to-usb cable to get the serial console (I used a
DKU-5 data cable containing a ark3116 chip, works perfectly for this
usage, and very cheap).
- by lowering the number of URB allocated in em28xx, I succeeded in
going further... to another bug Smile
I have now the following error on console, so frequently that the NSLU2
cannot respond to any sollicitation (need to hard-shutdown it) :
BUG: warning at arch/arm/mm/consistent.c:363/dma_free_coherent()
BUG: warning at arch/arm/mm/consistent.c:363/dma_free_coherent()
BUG: warning at arch/arm/mm/consistent.c:363/dma_free_coherent()
[...]
This warning is caused by: WARN_ON(irqs_disabled()); in dma_free_coherent.
The function comment says: * Must not be called with IRQs disabled.
I suggested that a dma_free_coherent has been indirectly called in a
critical section...
So we need to analyze that with the em28xx maintainer that does his best
to help me with the poor information I can give to him.

Thierry



--
To UNSUBSCRIBE, email to debian-arm-REQUEST.RemoveThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.RemoveThis@lists.debian.org
Back to top
Login to vote
Thierry Merle

External


Since: May 29, 2007
Posts: 9



(Msg. 11) Posted: Sat Oct 20, 2007 2:20 pm
Post subject: Re: ehci_hcd map_single: unable to map unsafe buffer on a standard NSLU2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thierry Merle a écrit :
> Lennart Sorensen a écrit :
>> On Tue, Sep 11, 2007 at 04:53:41AM -0700, Thierry Merle wrote:
>>
>>> I am using a Terratec Cinergy T2 USB tuner on my 266MHz NSLU2.
>>> When I am recording a DVB-T stream, it takes around 33% CPU (zapdvb
>>> process,
>>> the tool I use to record) but surprisingly, my NSLU2 is much less
>>> responsive
>>> for other tasks (big latencies for ssh, fetchmail, imap and other
>>> things
>>> that run on my box).
>>> Nevertheless, the recorded file contains the entire stream (video is
>>> fluid).
>>> Do you think this is a CPU related problem?
>>>
>>
>> Isn't DVB-T mpeg? That would be a lot less work than a raw captured tv
>> signal (the driver in question mentioned needing 170MBit per second on
>> the USB port per tuner, which sounds like an awful lot more data than an
>> mpeg stream would generate). That would need much more bandwidth from
>> the cpu, and if the cpu now has to compress the video it would take
>> quite a lot of cpu. Even the disk access to write 170MBit/s starts to
>> add up, especially since the disk is almost certainly on another USB
>> port. I am assuming your tuner has hardware encoding to mpeg or that it
>> is receiving an existing mpeg stream from some other DVB device.
>>
>> So yes I could see it being simply a CPU issue.
>>
>> --
>> Len Sorensen
>>
>>
>>
> Right, DVB-T mpeg-2 TS for both cinergyT2 and em28xx based tuners.
> To inform you the current state of the investigation:
> - I wired a serial-to-usb cable to get the serial console (I used a
> DKU-5 data cable containing a ark3116 chip, works perfectly for this
> usage, and very cheap).
> - by lowering the number of URB allocated in em28xx, I succeeded in
> going further... to another bug Smile
> I have now the following error on console, so frequently that the NSLU2
> cannot respond to any sollicitation (need to hard-shutdown it) :
> BUG: warning at arch/arm/mm/consistent.c:363/dma_free_coherent()
> BUG: warning at arch/arm/mm/consistent.c:363/dma_free_coherent()
> BUG: warning at arch/arm/mm/consistent.c:363/dma_free_coherent()
> [...]
> This warning is caused by: WARN_ON(irqs_disabled()); in
> dma_free_coherent.
> The function comment says: * Must not be called with IRQs disabled.
> I suggested that a dma_free_coherent has been indirectly called in a
> critical section...
> So we need to analyze that with the em28xx maintainer that does his best
> to help me with the poor information I can give to him.
>
> Thierry
>
>
>
Hello,
I proposed a patch on the linux-arm ML (you will find at the end of this
message) to correct the dma_free_coherent calls when IRQ are disabled.
This allows the tuner to tune frequencies without kernel freezes, but
the streaming is corrupted, I need to investigate on this now.
This patches the kernel, the dmabounce part; this corrects a very rare
bug I think, so nobody commented it yet.
Do someone encountered a kernel freeze on the NSLU2 using a USB device?

Cheers,
Thierry

--- linux-source-2.6.22.orig/arch/arm/common/dmabounce.c 2007-10-12 21:51:54.000000000 +0200
+++ linux-source-2.6.22/arch/arm/common/dmabounce.c 2007-10-10 19:16:36.000000000 +0200
@@ -29,7 +29,7 @@
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include <linux/list.h>
-
+#include <linux/interrupt.h>
#include <asm/cacheflush.h>

#undef STATS
@@ -51,6 +51,7 @@ struct safe_buffer {
int direction;

/* safe buffer info */
+ struct device *dev;
struct dmabounce_pool *pool;
void *safe;
dma_addr_t safe_dma_addr;
@@ -125,6 +126,7 @@ alloc_safe_buffer(struct dmabounce_devic
return NULL;
}

+ buf->dev = device_info->dev;
buf->ptr = ptr;
buf->size = size;
buf->direction = dir;
@@ -180,6 +182,39 @@ find_safe_buffer(struct dmabounce_device
return rb;
}

+/* The free safe buffer part. dma_free_coherent cannot be called irq disabled.
+ To cope with that, a tasklet (do_free) does the job upon request */
+static DEFINE_SPINLOCK(buflock);
+static LIST_HEAD(buffers);
+
+static void do_free(unsigned long ignored)
+{
+ spin_lock_irq(&buflock);
+ while (!list_empty(&buffers)) {
+ struct safe_buffer *buf;
+
+ buf = list_entry(buffers.next,
+ struct safe_buffer,
+ node);
+ list_del(&buf->node);
+ spin_unlock_irq(&buflock);
+
+ if (buf->pool)
+ dma_pool_free(buf->pool->pool, buf->safe, buf->safe_dma_addr);
+ else
+ dma_free_coherent(buf->dev, buf->size, buf->safe,
+ buf->safe_dma_addr);
+
+ kfree(buf);
+
+ spin_lock_irq(&buflock);
+
+ }
+ spin_unlock_irq(&buflock);
+}
+
+static DECLARE_TASKLET(deferred_free, do_free, 0);
+
static inline void
free_safe_buffer(struct dmabounce_device_info *device_info, struct safe_buffer *buf)
{
@@ -193,13 +228,12 @@ free_safe_buffer(struct dmabounce_device

write_unlock_irqrestore(&device_info->lock, flags);

- if (buf->pool)
- dma_pool_free(buf->pool->pool, buf->safe, buf->safe_dma_addr);
- else
- dma_free_coherent(device_info->dev, buf->size, buf->safe,
- buf->safe_dma_addr);
+ /* pass the safe buffer to the tasklet */
+ spin_lock_irqsave(&buflock, flags);
+ list_add_tail(&buf->node, &buffers);
+ tasklet_schedule(&deferred_free);
+ spin_unlock_irqrestore(&buflock, flags);

- kfree(buf);
}

/* ************************************************** */


--
To UNSUBSCRIBE, email to debian-arm-REQUEST.DeleteThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.DeleteThis@lists.debian.org
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Unable to compile kernel to completion - I've been building the kernel on a slug. It seems to be unable to build to completion. I get odd errors such as this:...

WARNING: YOU ATTEMPTED TO SEND A VIRUS - This is an automatic message from the Mercyhurst College email system. The Declude Virus software on the Mercyhurst..

{CH-620} Help Desk Submission - Thank you for submitting a support request. A summary of your request is below: ..

WARNING: YOU ATTEMPTED TO SEND A VIRUS - This is an automatic message from the Mercyhurst College email system. The Declude Virus software on the Mercyhurst..

Regarding your PayPal Visa request (KMM13899334V33577L0KM) - Thank you for contacting us. Because your privacy is important to us, we ask that all correspondence be directed to us....

automated response - Sorry but I am out of the office. I will return on Monday August 25th. Thank you, George Boulton -- To UNSUBSCRIBE,...
       Soft32 Home -> Linux -> Ports PowerPC -> ARM All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA



[ Contact us | Terms of Service/Privacy Policy ]