Bug 9146

Summary: (patch queued)ioremap() failure should be handled
Product: v4l-dvb Reporter: Theerud Lawtrakul (theerud)
Component: cx88Assignee: Alan (alan)
Status: RESOLVED CODE_FIX    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.23 Subsystem:
Regression: No Bisected commit-id:
Attachments: quick patch to cx88-cards.c
configurable mmio size patch

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