aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2008-04-25sata_mv: simplify request/response queue handlingMark Lord
Try and simplify handling of the request/response queues. Maintain the cached copies of queue indexes in a fully-masked state, rather than having each use of them have to do the masking. Split off handling of a single crpb response into a separate function, to reduce complexity in the main mv_process_crpb_entries() routine. Ignore the rarely-valid error bits from the crpb status field, as we already handle that information in mv_err_intr(). For now, preserve the rest of the original logic. A later patch will deal with fixing that separately. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25sata_mv: simplify freeze/thaw bit-shift calculationsMark Lord
Introduce the MV_PORT_TO_SHIFT_AND_HARDPORT() macro, to centralize/simplify various scattered bits of logic for calculating bit shifts and the like. Some of the places that do this get it wrong, too, so consolidating the algorithm at one place will help keep the code correct. For now, we use the new macro in mv_eh_{freeze,thaw}. A subsequent patch will re-use this in the interrupt handlers Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25sata_mv mask all interrupt coalescing bitsMark Lord
Ignore *all* interrupt coalescing bits on all controllers, not just some of each. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25sata_mv more cosmeticsMark Lord
More cosmetic cleanups prior to the interrupt/error handling logic changes. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25ata_piix: add Asus Eee 701 controller to short cable listDan McGee
The drive is directly soldered to the controller, so there is no cable at all. Remove the 40-wire assumption so the drive can operate at max speed. Before patch: $ dd if=/dev/sda of=/dev/null bs=2M count=64 iflag=direct 134217728 bytes (134 MB) copied, 5.29612 s, 25.3 MB/s After patch: $ dd if=/dev/sda of=/dev/null bs=2M count=64 iflag=direct 134217728 bytes (134 MB) copied, 3.94955 s, 34.0 MB/s Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25libata-eh set tf flags in NCQ EH result_tfMark Lord
Fix mis-reporting of NCQ errors by ensuring that result_tf->flags is properly initialized in libata-eh. This allows ata_gen_ata_sense() to report the failed block number correctly to SCSI after a media error during NCQ. This patch may also be a candidate for backporting to earlier kernels. Without this fix, SCSI will fail I/O on the entire request rather than just the bad sector. That can be bad for a request that was merged from many independent read reads from different tasks. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25make sata_set_spd_needed() staticAdrian Bunk
sata_set_spd_needed() can now become static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25make sata_print_link_status() staticAdrian Bunk
sata_print_link_status() can now become static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25libata-acpi.c: remove unneeded #if'sAdrian Bunk
These #if's are unneeded since they: - did anyway not handle the CONFIG_ACPI_DOCK_MODULE case correctly and - this is already handled in include/acpi/acpi_drivers.h and - it's now correctly handled in kconfig. Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25sata_nv: make hardreset return -EAGAIN on successTejun Heo
sata_nv hardreset can't classify but was left out while unifying follow-up SRST request mechanism[1]. This caused detection failures on those controllers. Fix it. Reported and bisected by Roland Dreier, Petr Vandrovec and Marc Dionne. Thanks guys. [1] 305d2a1ab137d11d573319c315748a87060fe82d Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Roland Dreier <rdreier@cisco.com> Cc: Petr Vandrovec <vandrove@vc.cvut.cz> Cc: Marc Dionne <marc.c.dionne@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25ahci: retry enabling AHCI a few times before spitting out WARN_ON()Tejun Heo
Some chips need AHCI_EN set more than once to actually set it. Try a few times before giving up and spitting out WARN_ON(). Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Peer Chen <pchen@nvidia.com> Cc: Volker Armin Hemmann <volker.armin.hemmann@tu-clausthal.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25libata: make WARN_ON conditions in ata_sff_hsm_move() more strictTejun Heo
WARN_ON()'s in ata_hsm_move() was too liberal and got triggerred when it shouldn't (e.g. hotplug events at the right moment). As the HSM only deals with device errors and state machine violations, make it check only against them. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Mark Lord <liml@rtr.ca> Cc: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25ATA/IDE: fix platform driver hotplug/coldplugKay Sievers
Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable ATA and IDE platform drivers, to re-enable auto loading. NOTE: both ata/pata_platform.c and ide/legacy/ide_platform.c claim to provide "the" platform_pata driver, and there's no build-time mutual exclusion mechanism. This means that configs which enable both drivers will make some trouble when hotplugging... [dbrownell@users.sourceforge.net: more drivers, registration fixes] Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Tejun Heo <htejun@gmail.com> Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-24sata_sis: SCR accessors return -EINVAL when requested SCR isn't availableTejun Heo
sis_scr_cfg_read() can't access SError and was incorrectly returning -1 instead of -EINVAL. This went unnoticed because SError used to be cleared in @postreset() and it didn't care about how scr_read() failed but commit ac371987 moved SError clearing into sata_link_resume() and SCR access failure other than -EINVAL is considered an error condition and exposes the incorrect return value bug as detection failure. Fix it. Also, scsi_scr_cfg_write() was incorrectly returning 0 after it ignored the request to write to SError. Make it also return -EINVAL. This was bisected and reported by Patrick McHardy. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Patrick McHardy <kaber@trash.net> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-24libata: functions with definition should not be externHarvey Harrison
Noticed by sparse drivers/ata/libata-core.c:3380:12: warning: function 'ata_wait_after_reset' with external linkage has definition Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-24Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-fixes * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-fixes: "make namespacecheck" fixes x86: fix compilation error in VisWS x86: voyager fix x86: Drop duplicate from setup.c intel-iommu.c: dma ops fix
2008-04-24intel-iommu.c: dma ops fixIngo Molnar
Stephen Rothwell noticed that: Commit 2be621498d461b63ca6124f86e3b9582e1a8e722 ("x86: dma-ops on highmem fix") in Linus' tree introduced a new warning (noticed in the x86_64 allmodconfig build of linux-next): drivers/pci/intel-iommu.c:2240: warning: initialization from incompatible pointer type Which points at an instance of map_single that needs updating. Fix it to the new prototype. Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-24Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvbLinus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (452 commits) V4L/DVB (7731): tuner-xc2028: fix signal strength calculus V4L/DVB (7730): tuner-xc2028: Fix SCODE load for MTS firmwares V4L/DVB (7729): Fix VIDIOCGAP corruption in ivtv V4L/DVB (7728): tea5761: bugzilla #10462: tea5761 autodetection code were broken V4L/DVB (7726): cx23885: Enable cx23417 support on the HVR1800 V4L/DVB (7725): cx23885: Add generic cx23417 hardware encoder support V4L/DVB (7723): pvrusb2: Clean up input selection list generation in V4L interface V4L/DVB (7722): pvrusb2: Implement FM radio support for Gotview USB2.0 DVD 2 V4L/DVB (7721): pvrusb2: Restructure cx23416 firmware loading to have a common exit point V4L/DVB (7720): pvrusb2: Fix bad error code on cx23416 firmware load failure V4L/DVB (7719): pvrusb2: Implement input selection enforcement V4L/DVB (7718): pvrusb2-dvb: update Kbuild selections V4L/DVB (7717): pvrusb2-dvb: add DVB-T support for Hauppauge pvrusb2 model 73xxx V4L/DVB (7716): pvrusb2: clean up global functions V4L/DVB (7715): pvrusb2: Clean out all use of __FUNCTION__ V4L/DVB (7714): pvrusb2: Fix hang on module removal V4L/DVB (7713): pvrusb2: Implement cleaner DVB kernel thread shutdown V4L/DVB (7712): pvrusb2: Close connect/disconnect race V4L/DVB (7711): pvrusb2: Fix race on module unload V4L/DVB (7710): pvrusb2: Implement critical digital streaming quirk for onair devices ...
2008-04-24V4L/DVB (7731): tuner-xc2028: fix signal strength calculusMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7730): tuner-xc2028: Fix SCODE load for MTS firmwaresMauro Carvalho Chehab
There are different tables for MTS firmwares. This should be taken into account while selecting the proper firmware. While at tuner-xc2028.h, improve some comments. Thanks to Edward J. Sheldrake <ejs1920@yahoo.co.uk> for helping to diagnose such troubles with PAL/I standard. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7729): Fix VIDIOCGAP corruption in ivtvAlan Cox
Frank Bennett reported that ivtv was causing skype to crash. With help from one of their developers he showed it was a kernel problem. VIDIOCGCAP copies a name into a fixed length buffer - ivtv uses names that are too long and does not truncate them so corrupts a few bytes of the app data area. Possibly the names also want trimming but for now this should fix the corruption case. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7728): tea5761: bugzilla #10462: tea5761 autodetection code were brokenMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7726): cx23885: Enable cx23417 support on the HVR1800Steven Toth
cx23885: Enable cx23417 support on the HVR1800 Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7725): cx23885: Add generic cx23417 hardware encoder supportSteven Toth
cx23885: Add generic cx23417 hardware encoder support. Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7723): pvrusb2: Clean up input selection list generation in V4L ↵Mike Isely
interface Change how list of possible pvrusb2 inputs is generated to include only those interfaces that make sense for the interface instance. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7722): pvrusb2: Implement FM radio support for Gotview USB2.0 DVD 2Mike Isely
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7721): pvrusb2: Restructure cx23416 firmware loading to have a ↵Mike Isely
common exit point Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7720): pvrusb2: Fix bad error code on cx23416 firmware load failureMike Isely
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7719): pvrusb2: Implement input selection enforcementMike Isely
In the pvrusb2 driver, different interfaces (e.g. V4L, DVB) have Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7718): pvrusb2-dvb: update Kbuild selectionsMichael Krufky
These changes are required with the addition of digital television support for the Hauppauge HVR1900 & HVR1950, the OnAir Creator and Sasem USB HDTV Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7717): pvrusb2-dvb: add DVB-T support for Hauppauge pvrusb2 model 73xxxMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7716): pvrusb2: clean up global functionsAdrian Bunk
This patch contains the following cleanups: - make the following needlessly global function static: - pvr2_hdw_set_cur_freq() - #if 0 the following unused global functions: - pvr2_hdw_get_state_name() - pvr2_hdw_get_debug_info_unlocked() - pvr2_hdw_get_debug_info_locked() Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7715): pvrusb2: Clean out all use of __FUNCTION__Mike Isely
Apparently the kernel developers no longer consider it proper etiquette to use __FUNCTION__; everyone must instead use __func__ (even though it breaks with older compilers). And worse still, actual effort is being expended to sweep this change throughout the kernel source tree. Don't these people have better things to do? So... Completely clean out all use of __FUNCTION__ from the pvrusb2 driver (it was just in the sysfs interface). I'm not going to use __func__ either. So there. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7714): pvrusb2: Fix hang on module removalMike Isely
The pvrusb2 driver was getting had by this scenario: 1. Task A calls kthread_stop() for task B. 2. Before exiting, then Task B calls kthread_stop() for task C. The problem is, kthread_stop() wants to allocate an internal resource to itself (i.e. acquire a lock), which won't be released until kthread_stop() returns. But kthread_stop() won't return until task B is dead. But task B won't die until it finishes its call to kthread_stop() for task C, and that will block waiting on the resource already allocated inside task A. Deadlock. With the pvrusb2 driver, task A is the caller to pvr_exit(), task B is the control thread run inside of pvrusb2-context.c, and task C is any worker thread run inside of pvrusb2-hdw.c. This problem got introduced by the previous threading setup change, which was itself an attempt to fix a module tear-down race (which it actually did fix). The lesson here is that a task being waited on as part of a kthread_stop() simply cannot be allow to also issue a kthread_stop() - or we make sure not to issue the enclosing kthread_stop() until we know that the inner kthread_stop() has completed first. The solution for the pvrusb2 driver is some hackish code which changes the main control thread tear down into a two step process. This then makes it possible to delay issuing the kthread_stop() on the control thread until after we know that everything has been torn down first. (And yes, we really need that kthread_stop() because it's the only way to safely guarantee that a module-referencing kernel thread has safely returned back out of the module before we finally remove the module.) Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7713): pvrusb2: Implement cleaner DVB kernel thread shutdownMike Isely
Earlier fix to handle DVB feed thread aborts was overly-aggressive. We can take better advantage of what kthread_stop() can do. This change simplifies things. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7712): pvrusb2: Close connect/disconnect raceMike Isely
If a disconnect happens before initialization is completed, the pvrusb2 driver can accidentally touch dangling pointers. The whole initialization function must be protected by the big_lock, and once inside that lock, the initialization function should abort if it is discovered that a disconnect has already taken place. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7711): pvrusb2: Fix race on module unloadMike Isely
The pvrusb2 driver - for basically forever - was not enforcing a proper module tear-down. Kernel threads are used inside the driver and all must be gone before the module can be safely removed. This changeset reimplements a chunk of pvrusb2-context.c to enforce this correctly. Unfortunately this is not a simple fix. The new implementation also cuts back on kernel thread usage; instead of there being 1 control thread per instance now it's just 1 control thread shared by all instances. (By dropping to a single thread then the module exit function can block on its shutdown and the thread itself can monitor and cleanly shut down all of the other instances first.) Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7710): pvrusb2: Implement critical digital streaming quirk for ↵Mike Isely
onair devices Implement timed measurement of encoder operation for the first time it is run. This allows the driver to note when the encoder has been run successfully for at least 1/4 second. On top of that implement various bits to ensure that the encoder has been run once before digital streaming for OnAir devices. This is done via several core state machine tweaks. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7709): pvrusb2: New device attribute for encoder usage in digital modeMike Isely
Some tuners seem to not work in digital mode unless the encoder is healthy. Implement a device attribute to represent this flag and modify the core state machines to enforce this requirement. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7708): pvrusb2-dvb: Fix stuck thread on streaming abortMike Isely
If the device fails to stream, the feed thread will block forever waiting for buffers. But while in this state it was not looking for an exit condition from the driver DVB interface. This caused the thread to jam. Implement a new stop flag (which will be set appropriately) to tell the thread to stop. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7707): pvrusb2-dvb: add atsc/qam support for Hauppauge pvrusb2 ↵Michael Krufky
model 750xx Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7706): pvrusb2: create a separate pvr2_device_desc structure for ↵Michael Krufky
751xx models Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7705): pvrusb2: Enable OnAir digital operationMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7704): pvrusb2: Fix slop involving use of struct which might not be ↵Mike Isely
defined When the DVB interface is not compiled, the pvr2_dvb_props struct is not available - so it really should be ifdef'ed out as well. This didn't cause an error because in this context its usage was as an opaque pointer. But it really shouldn't be present at all if DVB is not enabled. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7703): pvrusb2: Fix minor problem involving ARRAY_SIZE confusionMike Isely
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7702): pvrusb2: Rework USB streaming start/stop executionMike Isely
The commands to start / stop USB streaming for an analog device are fairly standard, owing to the fact that all supported devices apparently started from the same common reference design. However with digital mode, the commands seem to vary by vendor. This change makes that variance more explicit. It also cleans up a related problem for OnAir devices which prevented digital mode from working at all. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7701): pvrusb2: Centralize handling of simple FX2 commandsMike Isely
Numerous places in the driver need to issue simple commands to the FX2 microcontroller (e.g. only 1 or 2 bytes, no reply needed). Previously each place that did this, had to take lock, set up a central buffer, and call the function to perform the handshake. This change puts these steps into a single spot. This also has the effect of removing the need to mess with the control lock from numerous places in the code. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7700): pvrusb2: Make FX2 command codes unsigned constantsMike Isely
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7699): pvrusb2: Implement statistics for USB I/O performance / trackingMike Isely
Implement a mechanism in the pvrusb2 driver for gathering statistics on the stream buffering, including bytes transferred, buffers handled, buffers in flight, etc. This is useful for debugging certain classes of streaming issues and for determining if the buffer pool size is generally correct for the driver. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-24V4L/DVB (7698): pvrusb2: Remove never-reached break statements (trivial)Mike Isely
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>