Age | Commit message (Collapse) | Author |
|
From: Andy Walls <awalls@radix.net>
cx18: cx18_writel_expect() should not declare success on a PCI read error.
This removes the potential for cx18_write*_expect() calls to not
accomplish a PCI write successfully as expected. The CX18-AV core uses the
*expect() calls often and this may be the source of intermittent audio
problems and standands switching problems.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
For kernels earlier than 2.6.22, we can't cancel work, so we have to flush the
work queue to completion before destroying it.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Change to per CX23418 device work queues for deferrable work handling.
Needed to support 2.6.22 and earlier kernels that can't selectively cancel
work orders. Also will provide slightly better performance on SMP systems.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Quiet a sometimes common warning that often has benign consequences.
No one probably cares that the firmware took forever to ack our command, as
they always seem to succeed whether or not the firmware acks it in a reasonable
amount of time.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
Update the version number due to significant changes in the way the
mailboxes and interrupts are handled.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
Add copyright attribution for files modified by awalls in 2008
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Adjust outgoing mailbox timeouts and remove statistics logging.
This saves some wasted storage in struct cx18 for each card. Cutting
the outgoing mailbox timeouts in half from the previous value appears to
be safe with MythTV. Got rid of interrupted case code path after
a wait uninterruptable returns.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
Restore buffers that have fallen out of the transfer rotation, and check
for coherent mailbox data when processing a stale mailbox.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
Remove unnecessary MMIO accesses in time critical irq handling path. Also
ensured that the mailbox ack field is read in last, so we know for sure if we
have a stale mailbox or not on receipt.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Streamline cx18-io[ch] wrappers and enforce MMIO retry strategy so that
write retries always occur and read retries never occur (as they never help).
Remove MMIO statistics logging to speed up MMIO accesses. Deprecate & ignore
retry_mmio and mmio_ndelay module parameters, to essentially force
retry_mmio=1 and mmio_ndelay=0.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Propagate staleness of mailbox and mdl ack data to work handler to let
the work handler know that the data from the encoder may not be coherent.
Allows for smarter handling of buffers in future, to deal with MDLs that fall
out of rotation due to irq handler being late in collecting mailbox and mdl ack
info.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
Convert the per stream queue spinlocks into mutexes. All queue
manipulation happens via the work queue or system calls into the driver, and
not in an interrupt context. This reduces the amout of time the cx18 driver
keeps interrupts disabled.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
Change to singlethreaded global work queue thread for deferable work,
instead of the kernel default multithreaded work queue. This ensures
execution of deferable work is always in the proper order, so caputred buffers
don't get reordered.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
A major rewrite of interrupt handling for incoming mailbox processing, to split
the timing critical steps from the the deferrable steps as the sending XPU on
the CX23418 will time out and overwrite our incoming mailboxes rather quickly.
Setup a pool of work "order forms" for the irq handler to send jobs to the new
work handler routine which uses the kernel default work queue to do the
deferrable work. Started optimizing some of the cx18-io calls as they are now
the low hanging fruit for recoving microseconds back from the timeline.
Future optimizations will get rid of mmio read retries, mmio stats logging, and
combine smaller functions in the irq path into the larger ones to save ~2 us
each.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
|
|
From: Andy Walls <awalls@radix.net>
If APU firmware file read failed, the jump vector to the APU was undefined and
the APU would be started executing garbage. Fix uninitialized variable to be
an infinite loop for the APU, but also bail out before even starting the APU.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
When the CX23418 CPU unit sent out an ack interrupt to the linux driver, it
also received that interrupt and cleared the flag before the linux driver could
see what the interrupt was for. This fix prevents the CPU from receiving an
IRQ for it's own outgoing ack's to the linux driver. This fix is critical now
that the linux driver doesn't poll but relies on these ack interrupts.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
Use the APU fw start address from rom file instead of a hardcoded entry vector.
Fixed cx18_setup_page() calls to use the correct APU image load addresses.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
All waits for cx18 mailbox API commands are now uninterruptable. Added
code to collect mailbox ack statistics. Tweaked timeouts based on collected
stats and video vertical frame and field rates.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Improve handling of outgoing mailboxes detected to be busy. When
encountering a busy mailbox, sleep instead of polling, and wait for interrupt or
timeout. If the mailbox is still busy, force it free. When sending commands,
make sure we never create a situation where we mark the mailbox busy upon
sending, and ensure we always have a method to cleanly recover from a busy
mailbox.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
Driver interrupt and mailbox handling has change significantly.
Time for a roll to v1.0.2.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
Add mutexes to ensure exclusive access for outgoing driver to CX23418 mailboxes.
Also wait on a waitq for mailbox acknowledgement from the CX23418 instead of
polling.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Use default kernel work queue; fix streaming flag for work handler.
Eliminate cx18 specific work queue and use the kernel default work queue.
Fixed the F_STREAMING_FLAG for the TS stream so cx18_dvb_work_handler()
can know when it is not safe to send MDLs to the firmware.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Move DVB buffer transfer handling from irq handler to work_queue thread.
In order to properly lock the epu2cpu mailbox for driver to CX23418 commands,
the DVB/TS buffer handling needs to be moved from the IRQ handler and IRQ
context to a work queue. This work_queue implmentation is strikingly similar
to the ivtv implementation - for better or worse.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Use correct Mailbox IRQ Ack values and misc IRQ handling cleanup.
The SCB field definitions for Ack IRQ's for mailboxes were inconsistent with
the bitmasks being loaded into those SCB fields and the SW2 Ack IRQ handling
logic. Renamed fields in SCB to make things consistent and did misc IRQ
handling cleanups: removing legacy ivtv dma_reg_lock, HPU IRQ flags, etc.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Fix PLL freq computation for debug display.
The code to compute the PLL freq from register values was storing an
intermediate 56 bit result in a 32 bit type, causing a nonsense value to
be displayed.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Reduce number of mmio read retries to improve performance. Experiments
have shown 2 things: read retries never improve the result of a suspect mmio
read from the CX23418 (the result stays all 0xff's), and that most of the
suspected read failures are actually proper reads of values that should be
all 0xff's. This change reduces the number of read retries and keeps the
count separate from write retries.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Fix write retries for registers that always change - part 3.
Fix the io for the rest of the registers that will often not read back the
value just written. Modified register readback checks to make sure the
intended effect was achieved without constantly rewriting the registers.
The one outstanding register remaining is 0xc72014 CX18_AUDIO_ENABLE, whose
behavior on writes I have yet to determine.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Mark CX18_CPU_DE_RELEASE_MDL as a slow API call.
Give the encoder time to complete the MDL release before destroying the
encoder internal task. This avoids an encoder lockup on the next digital
capture and error messages about buffers being returned for an inactive
encoder task handle.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Fix write retries for registers that always change - part 2.
Some registers, especially interrupt related ones, will never read
back the value just written. Modified interrupt register readback
checks to make sure the intended effect was achieved.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Disable write retries for registers that always change - part 1.
Interrupt related registers will likely not read back the value we just wrote.
Disable retries for these registers for now to avoid accidently discarding
interrupts. More intelligent read back verification criteria are needed for
these and other registers (e.g. GPIO line registers), which will be addressed in
subsequent changes.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Remove redundant block scope variable in cx18_probe() to eliminate sparse
build warning.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Author: Harvey Harrison <harvey.harrison@gmail.com>
byteorder: remove direct includes of linux/byteorder/swab[b].h
A consolidated implementation will provide this generically through
asm/byteorder, remove direct includes to avoid breakage when the
changeover to the new implementation occurs.
kernel-sync:
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
|
|
From: Andy Walls <awalls@radix.net>
Changes to let error return codes bubble up to the user visible
error message on card initialization. A number of them were being remapped to
ENOMEM when no memory or array resource shortage existed. That hampered
diagnosis of user trouble reports.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Add __iomem address space qualifier to cx18_log_*_retries() addr
argument to clean up sparse build warnings.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
On error exit, the cx18_probe() function did not use the proper entry in
cx18_cards[] with kfree() when card init failed; leaking memory.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Hans Verkuil <hverkuil@xs4all.nl>
Suggested by Martin Dauskardt. This is conform what the other drivers do.
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Fix warning message for DMA done notification for inactive stream. The
warning message would always gripe that the radio stream was to blame, which
was misleading and wrong (/dev/radioN nodes never transfer data).
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Add entries for the Leadtek PVR2100 and Toshiba Qosmio DVB-T/Analog
capture cards. Both cards are hybrids cards, but no digital capture
functionality has been added yet. These entries are a first guess at the card
entries to get analog working, given the information available. Terry Wu
<terrywu at leadtek.com.tw> provided a pointer to information for the PVR2100.
Martin Juhl <mj at casalogic.dk>, an owner of the Toshiba DVB-T/Analog tuner
card, provided the DDR timing information from his Windows inf file.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Hans Verkuil <hverkuil@xs4all.nl>
The v4l core creates four different video devices (video, vbi, radio, vtx)
and each has its own range of minor numbers. However, modern devices keep
increasing the number of devices that they need so a maximum of 64 video
devices will not be enough in the future. In addition this scheme makes
it very hard to add new device types.
This patch disconnects the kernel number allocation (e.g. video0, video1,
etc.) from the actual minor number (just pick the first free minor).
This allows for much more flexibility in the future. However, it does
require the use of udev. For those who cannot use udev a new CONFIG option
was created that changes the allocation scheme back to the old behavior.
Thanks to Greg KH for suggesting this approach during the 2008 LPC.
In addition, several bugs were fixed in the ivtv and cx18 drivers: these
drivers try to allocate specific kernel numbers but that scheme contained
a bug which caused what should have been e.g. video17 to appear as e.g.
video2.
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Up the version to 1.0.1. This will make it easy to tell if retries
of MMIO access are implemented or not in trouble reports. First course of
action for I2C and other initialization problem reports will be to have user
upgrade to v1.0.1 of driver.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Andy Walls <awalls@radix.net>
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.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Michael Krufky <mkrufky@linuxtv.org>
Priority: normal
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
|
|
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
|
|
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
|
|
From: Andy Walls <awalls@radix.net>
cx18: Set mmio throttling delay default to 0 nsec. Not doing so makes analog
tuner audio not work on some mahcines.
Priority: high
Signed-off-by: Andy Walls <awalls@radix.net>
|
|
From: Hans Verkuil <hverkuil@xs4all.nl>
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
From: Hans Verkuil <hverkuil@xs4all.nl>
It was possible to set out-of-bounds windows sizes, this is now
fixed.
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
From: Hans Verkuil <hverkuil@xs4all.nl>
Earlier fixes to get the tuner audio working correctly broke the audio
on the Compro VideoMate H900 cards. This is now fixed.
Priority: high
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
|