Bug 9146 - (patch queued)ioremap() failure should be handled
Summary: (patch queued)ioremap() failure should be handled
Status: RESOLVED CODE_FIX
Alias: None
Product: v4l-dvb
Classification: Unclassified
Component: cx88 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Alan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-12 03:58 UTC by Theerud Lawtrakul
Modified: 2009-04-08 09:55 UTC (History)
0 users

See Also:
Kernel Version: 2.6.23
Subsystem:
Regression: No
Bisected commit-id:


Attachments
quick patch to cx88-cards.c (858 bytes, text/plain)
2007-10-12 04:12 UTC, Theerud Lawtrakul
Details
configurable mmio size patch (2.95 KB, text/plain)
2007-10-12 04:28 UTC, Theerud Lawtrakul
Details

Description Theerud Lawtrakul 2007-10-12 03:58:14 UTC
Most recent kernel where this bug did not occur:
Distribution:
Hardware Environment:
Software Environment:
Problem Description:
When there are so many cx88 devices present in a system (in my case, a 8-chip cx88 based tv card), ioremap() can fail after a couple devices got registered and not enough space left for mapping.

Steps to reproduce:
Comment 1 Theerud Lawtrakul 2007-10-12 04:12:10 UTC
Created attachment 13125 [details]
quick patch to cx88-cards.c

This should prevent kernel oops. However, it only left me with 6 useable video devices from a 8-chip card. I notice that request_mem_region() asks for the whole MMIO space, which is 32M each in my case. This is quite a lot when you have so many cx88 devices. I worked around by replacing pci_resource_len() with some value around 2-4MB and I can even have 16 chips (2 cards) running together (change CX88_MAXBOARDS to 16, of course). So I think requesting the whole mmio region is overkill, maybe a configurable mmio size via modparams or defaulting to a saner value would be nice.
Comment 2 Theerud Lawtrakul 2007-10-12 04:28:27 UTC
Created attachment 13126 [details]
configurable mmio size patch

add mmio_size module params, with previous ioremap() fix
Comment 3 Alan 2009-03-24 09:28:00 UTC
Queued a fix for the ioremap case and for the kmalloc as well

Note You need to log in before you can comment on or make changes to this bug.