diff options
author | Andy Walls <awalls@radix.net> | 2008-09-28 20:46:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:37:14 -0400 |
commit | d267d85101c509020a12686b96cbd179deaf4ecd (patch) | |
tree | 1a016966d11efb400ca310cd5726478053cd00a0 /drivers/media/video/cx18/cx18-driver.h | |
parent | 7f9876785276ac7f8606f8bf53a3dae4c10b8adb (diff) |
V4L/DVB (9110): cx18: Add default behavior of checking and retrying PCI MMIO accesses
cx18: Add default behavior of checking and retrying PCI MMIO accesses.
The concept of checking and retrying PCI MMIO accesses for better reliability
in older motherboards was suggested by Steve Toth <stoth@linuxtv.org>. This
change implements MMIO retries and the retry_mmio module parameter that is
enabled by default. Limited experiments have shown this is more reliable than
the mmio_ndelay parameter. mmio_ndelay has insignificant effect with retries
enabled.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-driver.h')
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h index 66cb748875c7..80f5f563d4fc 100644 --- a/drivers/media/video/cx18/cx18-driver.h +++ b/drivers/media/video/cx18/cx18-driver.h | |||
@@ -171,6 +171,7 @@ | |||
171 | 171 | ||
172 | #define CX18_MAX_PGM_INDEX (400) | 172 | #define CX18_MAX_PGM_INDEX (400) |
173 | 173 | ||
174 | extern int cx18_retry_mmio; /* enable check & retry of mmio accesses */ | ||
174 | extern int cx18_debug; | 175 | extern int cx18_debug; |
175 | 176 | ||
176 | 177 | ||
@@ -344,6 +345,13 @@ struct cx18_i2c_algo_callback_data { | |||
344 | int bus_index; /* 0 or 1 for the cx23418's 1st or 2nd I2C bus */ | 345 | int bus_index; /* 0 or 1 for the cx23418's 1st or 2nd I2C bus */ |
345 | }; | 346 | }; |
346 | 347 | ||
348 | #define CX18_MAX_MMIO_RETRIES 10 | ||
349 | |||
350 | struct cx18_mmio_stats { | ||
351 | atomic_t retried_write[CX18_MAX_MMIO_RETRIES+1]; | ||
352 | atomic_t retried_read[CX18_MAX_MMIO_RETRIES+1]; | ||
353 | }; | ||
354 | |||
347 | /* Struct to hold info about cx18 cards */ | 355 | /* Struct to hold info about cx18 cards */ |
348 | struct cx18 { | 356 | struct cx18 { |
349 | int num; /* board number, -1 during init! */ | 357 | int num; /* board number, -1 during init! */ |
@@ -433,6 +441,9 @@ struct cx18 { | |||
433 | u32 gpio_val; | 441 | u32 gpio_val; |
434 | struct mutex gpio_lock; | 442 | struct mutex gpio_lock; |
435 | 443 | ||
444 | /* Statistics */ | ||
445 | struct cx18_mmio_stats mmio_stats; | ||
446 | |||
436 | /* v4l2 and User settings */ | 447 | /* v4l2 and User settings */ |
437 | 448 | ||
438 | /* codec settings */ | 449 | /* codec settings */ |