Commit graph

80628 commits

Author SHA1 Message Date
Hans de Goede d02134ddb6 V4L/DVB (13999): gspca_ov519: remove non functioning contrast control for ov764x sensor
gspca_ov519: remove non functioning contrast control for ov764x sensor

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:40 -03:00
Hans de Goede 035d3a3d3f V4L/DVB (13998): gscpa_ov519: Fix 320x240 on ov519 + ov7648
Differentiate between ov7640 and ov7648 and handle the ov7648 320x240
on the ov519 bridge specially to fix r and b being swapped.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:40 -03:00
Hans de Goede 859cc4700e V4L/DVB (13997): gspca_ov519: differentiate ov7620 and ov7620ae and fix 640x480 on the 7620
Michael Deegan <michael@ucc.gu.uwa.edu.au>, has reported issues with
using 640x480 mode on his ov518+ webcam. The fix for this breaks things
on my ov518+ cam (Trust 320 Sp@cecam), this patch thus adds differentiation
in the driver between the OV7620 sensor his cam has and the OV7620AE sensor
my cam has, and then only changes the init sequence for the ov518+ +
OV7620 combo which was not working for Michael.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:39 -03:00
Hans de Goede 388a6d5416 V4L/DVB (13996): gspca_stv0680: Fix streaming on vga cameras
Streaming of VGA stv0680 based cams (instead of CIF ones) failed, because
we were using the wrong control pipe for certain commands, this patch fixes
this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:39 -03:00
Hans de Goede 98184f78fc V4L/DVB (13995): gspca_ov519: mark led on eyetoy II as inverted
Mark led on eyetoy II as inverted, I have the feeling the led needs to
be inverted for all 519 based cams (iow we got the set led code wrong), but
lets just deal with this one cam at a time to avoid breaking currently
working cams.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:39 -03:00
Hans de Goede ab269d300e V4L/DVB (13994): gscpa_stv0680: Fix camera initialization on hotplug
stv0680 cameras currently only work when already plugged in when the system
boots (or when manually re-loading the driver after boot). This patch fixes
this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:39 -03:00
Theodore Kilgore 5bdd00b93e V4L/DVB (13992): gspca_sn9c2028: New gspca subdriver
New gspca subdriver adding support for SN9C2028 dual-mode cameras.

Signed-off-by: Theodore Kilgore <kilgota@banach.math.auburn.edu>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:39 -03:00
Theodore Kilgore 70136081fc V4L/DVB (13991): gspca_mr973010a: Fix cif type 1 cameras not streaming on UHCI controllers
If you read the mail to Oliver Neukum on the linux-usb list, then you know
that I found a cure for the mysterious problem that the MR97310a CIF "type
1" cameras have been freezing up and refusing to stream if hooked up to a
machine with a UHCI controller.

Namely, the cure is that if the camera is an mr97310a CIF type 1 camera, you
have to send it 0xa0, 0x00. Somehow, this is a timing reset command, or
such. It un-blocks whatever was previously stopping the CIF type 1 cameras
from working on the UHCI-based machines.

Signed-off-by: Theodore Kilgore <kilgota@auburn.edu>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:38 -03:00
Arvo Järve 225ee0ca19 V4L/DVB (13989): [TDA8261] Fix TDA8261 I2C read bug
The TDA8261 driver would crash when reading more than a byte as described.

ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff
[ 8.430350] KNC1-2: MAC addr = 00:09:d6:65:2d:91
[ 8.610008] saa7146 (1) saa7146_i2c_writeout [irq]: timed out waiting for end of xfer
[ 8.734457] stb0899_attach: Attaching STB0899
[ 8.768481] tda8261_attach: Attaching TDA8261 8PSK/QPSK tuner
[ 8.768485] DVB: registering adapter 2 frontend 0 (STB0899 Multistandard)...

Once I launch scan-s2:
scan-s2 -vvvv -a 2 -s 1 -l UNIVERSAL /usr/share/dvb/dvb-s/Hotbird-13.0E

I see the following via dmesg:

[ 435.040017] saa7146 (1) saa7146_i2c_writeout [irq]: timed out waiting for end of xfer
[ 435.778648] tda8261_get_bandwidth: Bandwidth=40000000
[ 435.781781] tda8261_get_bandwidth: Bandwidth=40000000
[ 435.783311] tda8261_set_state: Step size=1, Divider=1000, PG=0x793 (1939)
[ 435.783512] tda8261_set_state: Waiting to Phase LOCK
[ 435.810134] tda8261_get_status: Tuner Phase Locked
[ 435.810137] tda8261_set_state: Tuner Phase locked: status=1
[ 435.810139] tda8261_set_frequency: Frequency=1939000
[ 435.810141] tda8261_get_frequency: Frequency=7574
[ 435.830008] tda8261_get_bandwidth: Bandwidth=40000000
[ 436.402814] tda8261_get_bandwidth: Bandwidth=40000000
[ 436.405946] tda8261_get_bandwidth: Bandwidth=40000000
[ 436.407458] general protection fault: 0000 [#1] SMP
[ 436.407527] last sysfs file: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
[ 436.407560] CPU 0
[ 436.407601] Modules linked in: tda8261 stb0899 dvb_pll mt352 lnbp21 budget_av saa7146_vv snd_hda_codec_realtek videodev stv0299 v4l1_compat coretemp snd_hda_intel v4l2_compat_ioctl32 i915 videobuf_dma_sg b2c2_flexcop_pci snd_hda_codec budget_ci videobuf_core b2c2_flexcop ir_common w83627ehf drm snd_hwdep cx24123 budget_core hwmon_vid snd_pcm cx24113 dvb_core iptable_filter snd_timer i2c_algo_bit ip_tables saa7146 s5h1420 snd ttpci_eeprom soundcore intel_agp video serio_raw pcspkr lp snd_page_alloc x_tables output parport pata_it8213 e1000e
[ 436.408757] Pid: 1410, comm: kdvb-ad-2-fe-0 Not tainted 2.6.31-14-server #48-Ubuntu C2SBC-Q
[ 436.408818] RIP: 0010:[<ffffffffa00241a1>] [<ffffffffa00241a1>] tda8261_set_state+0x51/0x250 [tda8261]
[ 436.408903] RSP: 0018:ffff88013649bc70 EFLAGS: 00010283
[ 436.408945] RAX: 00000000000f1748 RBX: ffff880138870680 RCX: 0000000000000018
[ 436.408990] RDX: ffff88013649bcd0 RSI: 0000000000000001 RDI: ffff880135273010
[ 436.409035] RBP: ffff88013649bcc0 R08: 0000000000000001 R09: 0000000000000002
[ 436.409081] R10: ffff88013649bc40 R11: 0000000055555556 R12: 00000000001d9638
[ 436.409126] R13: 38ffffffa0261568 R14: 0000000000000000 R15: ffff880135273010
[ 436.409172] FS: 0000000000000000(0000) GS:ffff880028022000(0000) knlGS:0000000000000000
[ 436.409232] CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
[ 436.409274] CR2: 00007fff925e4cd8 CR3: 000000013642a000 CR4: 00000000000406f0
[ 436.409320] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 436.409365] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 436.409411] Process kdvb-ad-2-fe-0 (pid: 1410, threadinfo ffff88013649a000, task ffff88013658ad60)
[ 436.409473] Stack:
[ 436.409508] ffff880136ee2af1 00000000bcd5d166 ffff000200000068 0000000035273000
[ 436.409608] <0> 0000000000000001 ffff880135273000 ffffffffa0265260 00003473bc000000
[ 436.409758] <0> 0000000000000000 ffff88013a4e05e0 ffff88013649bd00 ffffffffa025f133
[ 436.409938] Call Trace:
[ 436.409978] [<ffffffffa025f133>] tda8261_set_frequency+0x23/0x70 [budget_av]
[ 436.410027] [<ffffffffa026ed09>] ? stb0899_i2c_gate_ctrl+0x49/0xf0 [stb0899]
[ 436.410074] [<ffffffffa026e259>] ? stb0899_write_reg+0x19/0x20 [stb0899]
[ 436.410121] [<ffffffffa02716e2>] stb0899_dvbs_algo+0x3a2/0x13c8 [stb0899]
[ 436.410170] [<ffffffff813cdd0d>] ? i2c_transfer+0xbd/0x100
[ 436.410215] [<ffffffffa026e13c>] ? stb0899_write_regs+0xac/0x1b0 [stb0899]
[ 436.410262] [<ffffffffa026f239>] stb0899_search+0x489/0x750 [stb0899]
[ 436.410308] [<ffffffff8107d153>] ? down_interruptible+0x33/0x60
[ 436.410360] [<ffffffffa00c34ec>] dvb_frontend_thread+0x57c/0x720 [dvb_core]
[ 436.410407] [<ffffffff81078620>] ? autoremove_wake_function+0x0/0x40
[ 436.410457] [<ffffffffa00c2f70>] ? dvb_frontend_thread+0x0/0x720 [dvb_core]
[ 436.410504] [<ffffffff81078236>] kthread+0xa6/0xb0
[ 436.410547] [<ffffffff810130aa>] child_rip+0xa/0x20
[ 436.410589] [<ffffffff81078190>] ? kthread+0x0/0xb0
[ 436.410631] [<ffffffff810130a0>] ? child_rip+0x0/0x20
[ 436.410672] Code: 00 03 00 00 4c 8b 6b 10 c7 45 cc 00 00 00 00 0f 84 e8 01 00 00 44 8b 22 41 8d 84 24 10 81 f1 ff 3d 80 4f 12 00 0f 87 af 01 00 00 <41> 8b 75 04 31 d2 48 c7 c7 d8 46 02 a0 89 f0 8b 0c 85 f0 45 02
[ 436.411950] RIP [<ffffffffa00241a1>] tda8261_set_state+0x51/0x250 [tda8261]
[ 436.412015] RSP <ffff88013649bc70>
[ 436.412064] ---[ end trace c1d7ae4d9e05c51b ]---

Signed-off-by: Arvo Järve <arvo@softshark.ee>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:38 -03:00
Oliver Endriss d8b5a8e449 V4L/DVB (13988): [STV090x] Configuration parameters adc1_range, adc2_range, tuner_bbgain
Add parameters adc1_range, adc2_range and tuner_bbgain to the config struct.
Defaults: adc1_range = adc2_range = 2Vpp, tuner_bbgain = 10db

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:38 -03:00
Oliver Endriss 41894b9700 V4L/DVB (13987): [STV090x] Quit processing if the tuner did not lock
Exit stv090x_algo() if the tuner did not lock. This might happen due to
missing signal or invalid/incomplete tuning parameters.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:38 -03:00
Oliver Endriss 2c1f750ba3 V4L/DVB (13986): [STV090x] Disable I2C gate on error
The I2C gate must also be disabled, if a tuner command failed.
Otherwise the tuner mutex would be locked forever.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:38 -03:00
Andreas Regel 76b9ef9795 V4L/DVB (13985): [STV090x] reset mclk and dev_ver of internal structure after allocating
When mclk is not 0 then it will never be set to the correct value and
the Demodulator will not work.

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:38 -03:00
Andreas Regel 93e32cdafb V4L/DVB (13984): [BUDGET] Use a tuner clock output divider of 2 for TT S2-1600.
This gives the STV090x and improved clock signal (rectangle instead of sine).

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:37 -03:00
Andreas Regel ca108b39a7 V4L/DVB (13983): [STV6110x] add clk_div member to stv6110x_config structure
Using clk_div member of stv6110x_config structure the tuner's clock
output divider can be configured. It is set in stv6110x_attach.

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:37 -03:00
Andreas Regel 9045e72944 V4L/DVB (13982): [STV090x] setup master clock in stv090x_init instead of stv090x_setup.
This is needed when clock input is driven from tuner and an output
divider different from 1 is used.

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:37 -03:00
Andreas Regel ec2d3a62ef V4L/DVB (13981): [STV6110x] Add a local register map for each instance of the driver.
Before there was used a static register map that could lead to issues
when there are are multiple adapters with the STV6110(A).

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:36 -03:00
Andreas Regel 0c3f9fd807 V4L/DVB (13980): [STV6110x] Added function stv6110x_write_regs
The function stv6110x_write_regs is used to write several registers at once.

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:36 -03:00
Andreas Regel f91e59cb5e V4L/DVB (13979): [STV090x] Added possibility to set a fixed TS output clock.
This could be useful for p.e. Common Interface applications where data rate is limited.

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:36 -03:00
Andreas Regel c369b7c282 V4L/DVB (13978): [STV090x] set FE_HAS_SIGNAL flag in stv090x_read_status when locked.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:36 -03:00
Andreas Regel 729cbafaca V4L/DVB (13977): [STV090x] Test for valid frequency before starting to tune
Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:36 -03:00
Andreas Regel 96506a5086 V4L/DVB (13976): [STV090x] Added mutex protection around tuner I2C access.
With this change it is possible to have the same I2C address for both tuners.

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:36 -03:00
Andreas Regel 97f7a2ae1a V4L/DVB (13975): [STV090x] Added internal structure with shared settings and data.
As the STV0900 features two demodulation paths in one chip there is
some information used by both instances of the driver when used in
dual mode. This information is now shared in an internal structure
referenced by I2C adapter and address.

Do initialisation of the demodulator only once when used in dual mode.
Moved global mutex demod_lock to internal structure.
Moved dev_ver and mclk to internal structure.
Removed unused tuner_refclk from stv090x_state.

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:36 -03:00
Andreas Regel b79c6df705 V4L/DVB (13974): [STV090x] Fix locking reliabilty issues in automatic mode.
In automatic S/S2 detection mode, locking of a DVB-S transponder could
fail when coming from a DVB-S2 transponder. This change fixes the issue
by first disabling DVB-S and DVB-S2 mode before enabling it again.

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:36 -03:00
Abylay Ospan ceb59cf068 V4L/DVB (13936): 22-kHz set_tone fix for NetUP Dual DVB-S2-CI card
22-kHz tone can be driven in two ways:
1. LNBH24 can produce 22kHz continuous tone when TEN=1 ( 22 KHz tone output is
always activated ).
2. LNBH24 can reproduce 22kHz tone timings from DSQIN or EXTM pin's when TEN=0.
From LNBH24 datasheet:
"In order to improve design flexibility an external tone input pin is
available (EXTM). The EXTM is a Logic input pin which activates the 22 kHz
tone output, on the VoTX pin, by using the LNBH24 integrated tone generator
(similar to the DSQIN pin function). In fact, the output tone waveform
characteristics will always be internally controlled by the LNBH24 tone
generator and the EXTM signal will be used as a timing control for DiSEqC tone
data encoding on the VoTX output."

In NetUP Dual DVB-S2-CI card 22kHz tone timings on EXTM pin produced by
STV0900 demod:
.set_tone  = stv0900_set_tone

redefine to "set_tone = lnbp21_set_tone" is not correct for "NetUP Dual
DVB-S2-CI card".

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:35 -03:00
Jean-Francois Moine c52af79916 V4L/DVB (13916): gspca - ov534/ov534_9: Split the ov534 subdriver.
The two sensors ov772x and ov965x have too much differences.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:35 -03:00
Jean-Francois Moine de2d1549c2 V4L/DVB (13869): gspca - sn9c20x: Cleanup code.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:35 -03:00
Peter Huewe 310b26286e V4L/DVB (13947): add __init/__exit macros to drivers/media/dvb/bt8xx/bt878.c
Trivial patch which adds the __init/__exit macros to the module_init/
module_exit functions of

drivers/media/dvb/bt8xx/bt878.c

Please have a look at the small patch and either pull it through
your tree, or please ack' it so Jiri can pull it through the trivial
tree.

Patch against linux-next-tree, 22. Dez 08:38:18 CET 2009
but also present in linus tree.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:35 -03:00
Joe Perches 42a39e0592 V4L/DVB (13969): frontends/si21xx.c: Remove #define TRUE/FALSE, use bool
And a little code refactoring/neatening around the removals

Reduces object size a little bit:

new:
$ size drivers/media/dvb/frontends/si21xx.o
   text	   data	    bss	    dec	    hex	filename
   8984	     56	   1816	  10856	   2a68	drivers/media/dvb/frontends/si21xx.o
old:
$ size drivers/media/dvb/frontends/si21xx.o
   text	   data	    bss	    dec	    hex	filename
   9084	     56	   1792	  10932	   2ab4	drivers/media/dvb/frontends/si21xx.o

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:35 -03:00
Jiri Slaby e34d375aa6 V4L/DVB (13968): cx18, fix potential null dereference
Stanse found a potential null dereference in cx18_dvb_start_feed
and cx18_dvb_stop_feed. There is a check for stream being NULL,
but it is dereferenced earlier. Move the dereference after the
check.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reviewed-by: Andy Walls <awalls@radix.net>
Acked-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:35 -03:00
Alexander Beregalov 8231152f74 V4L/DVB: ir: fix memory leak
Free ir_dev before exit.
Found by cppcheck.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:35 -03:00
Jiri Slaby 78b06e0201 V4L/DVB (13965): zl10039, jump to error on error
Stanse found an unreachable statement in zl10039_attach. There is
a `break' followed by `goto error'. Remove that break, so that it
can handle the error.

Cc: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:35 -03:00
Jiri Slaby a570fb6eec V4L/DVB (13964): tuner-core, fix memory leak
Stanse found a memory leak in tuner_probe. It is not freed/assigned
on all paths. Fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:34 -03:00
Jiri Slaby b46d37e61f V4L/DVB (13963): siano, fix memory leak
Stanse found a memory leak in smscore_gpio_configure. buffer is not
freed/assigned on all paths. Fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:34 -03:00
Roel Kluin ad695510bf V4L/DVB (12930): Wrong variable tested
The return of saa7164_i2caddr_to_reglen() was not tested.

Cc: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:34 -03:00
Francesco Lavra 19f48cb105 V4L/DVB (13961): em28xx-dvb: fix memleak in dvb_fini()
this patch fixes a memory leak which occurs when an em28xx card with DVB
extension is unplugged or its DVB extension driver is unloaded. In
dvb_fini(), dev->dvb must be freed before being set to NULL, as is done
in dvb_init() in case of error.
Note that this bug is also present in the latest stable kernel release.

Signed-off-by: Francesco Lavra <francescolavra@interfree.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:34 -03:00
hartleys be39515758 V4L/DVB (13959): cx23885/cx23885-dvb.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:34 -03:00
hartleys 2714b3b9be V4L/DVB (13958): tveeprom.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:34 -03:00
Francesco Lavra 9714d587f1 V4L/DVB (13957): IR: Fix sysfs attributes declaration
This patch fixes the declaration of the sysfs attributes for IR's, which
must be a NULL-terminated array of struct attribute *.
Without this patch, my machine crashes when inserting a DVB card.

Signed-off-by: Francesco Lavra <francescolavra@interfree.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:34 -03:00
Dan Carpenter 211635654c V4L/DVB (13956): fix weird array index in zl10036.c
I was initially concerned about the weird array index (the 2 bumps
into the next row of the array).  Matthias Schwarzott look at the
datasheet and it turns out it should be zl10036_init_tab[1][0] |= 0x01;

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:34 -03:00
Julia Lawall 3557aa4f7d V4L/DVB (13954): Correct NULL test
Test the just-allocated value for NULL rather than some other value.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
identifier f;
@@

f(...) { <+... return NULL; ...+> }

@@
expression *x;
expression y;
identifier r.f;
statement S;
@@

x = f(...);
(
if ((x) == NULL) S
|
if (
-   y
+   x
       == NULL)
 S
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:33 -03:00
Stefan Richter b2ad41f9ef V4L/DVB (13953): firedtv: add missing NULL pointer check
If there is ever going to be a FireDTV or FloppyDTV firmware which does
not provide a minimal ASCII textual descriptor for Model_Id --- or if
the descriptor is provided indirectly in a descriptor directory ---
the ieee1394 variant of the device probe of firedtv would dereference a
NULL pointer.  The firewire variant of firedtv's device probe is not
affected.

The fix makes sure that such an unexpected firmware is safely recognized
by fdtv_alloc as an unknown firmware.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:33 -03:00
Tobias Klauser f0ecba96e7 V4L/DVB (13952): gspca: Storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature.

Cc: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:33 -03:00
Tobias Klauser 9d68e8de9f V4L/DVB (13951): rj54n1cb0: Storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:33 -03:00
Tobias Klauser 7b2d3983f2 V4L/DVB (13950): usb-friio: Storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:33 -03:00
Julia Lawall 21ead03bdd V4L/DVB (13949): Move a dereference below a NULL test
If the NULL test is necessary, then the dereference should be moved below
the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E
      when != i
  if (E == NULL) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:33 -03:00
Julia Lawall ed0ee8e1fb V4L/DVB (13948): radio: Correct use after free
It is not clear how to share the unlock in the case where the structure
containing the lock has to be freed.  So the unlock is now duplicated, with
one copy moved before the free.  The unlock label furthermore is no longer
useful and is thus deleted.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,e;
identifier f;
iterator I;
statement S;
@@

*kfree(x);
... when != &x
    when != x = e
    when != I(x,...) S
*x->f
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:33 -03:00
Alexey Dobriyan e0572325d2 V4L/DVB (13946): proc_fops: convert av7110
Drop S_IRUGO, proc entry doesn't contain read hooks.
Drop S_IFREG, simply unnecessary.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:33 -03:00
Dmitri Belimov 9c6f97a023 V4L/DVB (13945): Add lost config and PCI ID for card of Beholder
Add lost configuration for our TV card.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:32 -03:00
Roel Kluin 7de0b8739f V4L/DVB (13944): vivi: Fix test of unsigned in vivi_create_instance()
video_nr is unsigned so the test did not work.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:32 -03:00
Roel Kluin f2e6c6ad02 V4L/DVB: use correct size in put_v4l2_window32()
Although these sizes may be the same it is better to calculate the size of
the source, than the destiny.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:32 -03:00
Devin Heitmueller 66d9cbad53 V4L/DVB (13932): em28xx: add PAL support for VBI
Make the VBI support work for PAL standards in addition to NTSC.

This work was sponsored by EyeMagnet Limited.

Thanks go out to Andy Walls for providing a CD containing test PAL/VBI captures
and to Steven Toth for providing a PVR-350 to do signal generation with.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:32 -03:00
Devin Heitmueller 6a2071006b V4L/DVB (13930): dib0700: rework IR logic for firmware 1.20
When firmware 1.20 was introduced, the dib0700 switched from a polling model
using a USB control message, to the messages being delivered on a USB bulk
pipe.  The code I originally added would do a blocking read on the pipe with a
50ms timeout.  Because the dvb-usb-remote code makes use of the global
workqueue, this resulted in the global workqueue being blocked 50% of the
time.  Also, the synchronous urb_bulk_msg() call would burn excess CPU time
(reflected as an abnormal increase in the system's load average when devices
were connected).

Rework the logic so that we now setup an asynchronous callback on the bulk
pipe, so that we now only handle RC data when it arrives on the pipe.  Note
that we provide a stub function for the RC polling callback so that we can
continue to leverage the shared code in dvb-usb-rc for the setting up of the
input device.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:32 -03:00
Jean-Francois Moine eac8f5fa5f V4L/DVB (13927): gspca - sonixj: Fix bad video mode for all webcams.
The bug was introduced when adding the sensor adcm1700.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:32 -03:00
Jean-Francois Moine cdf955cd8e V4L/DVB (13926): gspca - pac7302: Fix a random USB error.
When loading the register 0x49 of the page 3, the usb_control_msg() sometimes
fails with error -71 or -62.
This change skips loading the register 0x48.

Tested-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:32 -03:00
Jean-Francois Moine b7a597d110 V4L/DVB (13925): gspca - main: Change the check of the USB video interface.
Some webcams have many interfaces with the same interface class, so the
previous interface check did not work.
The new code checks if the interface number is zero or the only one.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:32 -03:00
Jean-Francois Moine 6f081264f8 V4L/DVB (13924): gspca - sunplus: Optimize and remove unused sequences.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:31 -03:00
Jean-Francois Moine 509245171a V4L/DVB (13923): gspca - zc3xx: Simplify code.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:31 -03:00
Jean-Francois Moine 77880ba333 V4L/DVB (13922): gspca - zc3xx: Switch off the LED on resume.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:31 -03:00
Jean-Francois Moine a20622f0f5 V4L/DVB (13921): gspca - zc3xx: Remove unuseful register write.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:31 -03:00
Jean-Francois Moine 56af5efca5 V4L/DVB (13920): gspca - zc3xx: Let default sharpness for sensor pas202b.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:31 -03:00
Jean-Francois Moine 1eed40aeb4 V4L/DVB (13919): gspca - zc3xx: Fix hdcs2020 probe.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:31 -03:00
Jean-Francois Moine 1cb6d7b156 V4L/DVB (13918): gspca - zc3xx: Rename the USB sequences.
The new names tell the image resolution: 'Scale' is the smaller image.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:31 -03:00
Jean-Francois Moine 47c8339237 V4L/DVB (13917): gspca - zc3xx: Cleanup code.
- update copyright and module author
- change __u8/16 to u8/16
- set unsigned the sd sensor
- initialize the controls by macros

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:31 -03:00
Mauro Carvalho Chehab 5599678c70 V4L/DVB (13915): em28xx: fix a typo on RC6 modes
Thanks to: Devin Heitmueller <dheitmueller@kernellabs.com> for double
checking it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:30 -03:00
Andy Walls f05b7f5ee1 V4L/DVB (13913): saa7127: Add support for generating SECAM output for the SAA712[89] chips
This change fixes up saa7127_s_std() generate SECAM out, if the user has
requested a 50 Hz video standard set that only contains a request for SECAM
standards and not PAL.  Only the SAA712[89] chips can generate SECAM, the
SAA712[67] chips cannot.

I was unclear on the burst start and end values - I couldn't figure out
the units - so I left them the same as for the PAL systems.

A the video decoders on both a PVR-350 (SAA7115) and an HVR-1600 (CX23418)
identify the SECAM signal generated by a SAA7129 with this patch as SECAM.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:30 -03:00
Sergey Bolshakov a8073119d6 V4L/DVB (13912): cx18: Fix tuner reset pin in card entry for the Leadtek PVR2100
Fix the "xceive_pin" setting from "15" to "1" for the PVR2100 -- the same as
the PVR3100H.  This properly resets the XC2028 tuner on the PVR2100.

Sergey's original email report:

Hi.
Seems cx18 module has incorrect .xceive_pin value for card,
as i see lots of i2c errors in dmesg from xc2028.
i'm using 2.6.32.2, my hardware is:

00:09.0 Multimedia video controller [0400]: Conexant Systems, Inc. CX23418
Single-Chip MPEG-2 Encoder with Integrated Analog Video/Broadcast Audio Decoder
[14f1:5b7a]
        Subsystem: LeadTek Research Inc. Device [107d:6f27]
        Flags: bus master, medium devsel, latency 64, IRQ 17
        Memory at f0000000 (32-bit, non-prefetchable) [size=64M]
        Capabilities: [44] Vital Product Data
        Capabilities: [4c] Power Management version 2
        Kernel driver in use: cx18
        Kernel modules: cx18

Following fixes this problem for me, the rest seems working:

Reported-by: Sergey Bolshakov <sbolshakov@altlinux.ru>
Tested-by: Sergey Bolshakov <sbolshakov@altlinux.ru>
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:30 -03:00
Andy Walls 5ada57732a V4L/DVB (13910): cx18: Fix set indextable command to properly select I/P/B index entries
The CX18_CPU_SET_INDEXTABLE command was being called with the wrong number
of arguments causing the index table frame type selection mask to be set wrong.
Now the IDX stream properly sends entries for I, P, and B frames.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:30 -03:00
Andy Walls 9bff2d6171 V4L/DVB (13909): cx18: Clean up dead code from ivtv once used for IDX processing
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:30 -03:00
Andy Walls 82acdc84cc V4L/DVB (13908): cx18: Add initial working VIDIOC_G_ENC_INDEX ioctl() support
VIDIOC_G_ENC_INDEX support see the light of day.
Some notes:
1. With default capture parameters, the CX23418 seems to transfer 192 index
entries (4.5 kB worth) at 10 second intervals.

2. Index streams don't seem to be supported for MPEG 2 TS streams

3. The index entries seem to claim every frame is a B-Frame.  Possible
firmware bug.

4. The cx18 driver does not try to capture an index stream when inserting
sliced VBI into the MPEg stream as the offsets would need fixup.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:30 -03:00
Andy Walls ef99179710 V4L/DVB (13907): cx18: Perform automatic rotation of very old, unread IDX buffers
According to the v4l2 spec, very old MPEG index entries needs to be discarded
in favor of newer index entries.  This change ensures the firmware always has
buffers for index entries at the expense of the oldest unread buffers.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:30 -03:00
Andy Walls 79f3e96018 V4L/DVB (13906): cx18: Start IDX streams automatically as an internal associated stream
This change starts the IDX stream along with the MPG stream as an internal
use (only) stream much like the VBI stream can be started as an internal use
stream for inserting sliced VBI packets.

The IDX stream is not started automatically with an MPEG strem if the IDX
stream is disabled (no buffers allocated) or if sliced VBI insertion is being
performed by the cx18 driver.  The cx18 driver doing sliced VBI insertion
makes the offsets in the IDX stream inaccurate for the final MPEG stream
presented to user space.  Since fixing the IDX offsets ourselves is not easy
and we cannot easily do what ivtv does to fix the offsets, we'll make sliced
VBI insertion and MPEG Index capture mutually exclusive for now.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:30 -03:00
Andy Walls e46c54a87e V4L/DVB (13905): cx18: Allow MPEG index streams to be started and stopped internally
This change allows the IDX stream to be started and stopped as any other
stream even though it has no associated device node.  This is needed for
cx18 driver internal use.

Also always tell the CX23418 to generate index entries when an analog capture
starts and the IDX stream has had buffers allocated (i.e. is enabled).

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:29 -03:00
Andy Walls 7b1dde0331 V4L/DVB (13904): cx18: Fix TS and IDX stream buffer memory leak on module unload
Fix a long standing memory leak of stream buffers for streams that did not
have a struct video_device allocated: namely the TS and IDX streams.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:29 -03:00
Andy Walls 540bab93b7 V4L/DVB (13903): cx18: Encapsulate check for a stream being enabled into an inline function
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:29 -03:00
Andy Walls efc0b127b2 V4L/DVB (13902): cx18: Update MPEG Index stream buffers module option processing
Update the module options related to INDEX stream buffer allocation.  A single
CX2341[5678] index entry is only 24 bytes.  Large buffers for the IDX stream
will prevent the CX23418 from transferring index data over at all.  Buffers
of around 1.5 kB or 64 index entries seem to be just fine.  We'll default to
63 buffers/MDLs as that is the firmware limit per stream and IDX stream buffers
are not high rate.  There is no reason on earth to allocate the previous 1 MB
default of buffer space for the IDX stream.

This is in anticipation of implementing the G_ENC_INDEX ioctl() in the cx18
driver.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:29 -03:00
Marton Nemeth 7e64dc4c4d V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant.
The ctrls field of struct sd_desc is declared as const
in gspca.h. It is worth to initialize the content also with
constant values.

Signed-off-by: Marton Nemeth <nm127@freemail.hu>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:29 -03:00
Márton Németh aabcdfb65b V4L/DVB (13898): gspca - some subdrivers: Make sd_desc const.
The function callbacks in sd_desc are defined at compile time and
they do not change at runtime. Make the sd_desc initializations const.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:29 -03:00
Jean-Francois Moine 52a9d3ef00 V4L/DVB (13897): gspca - main: Check the interface class at probe time.
The USB video interface was checked as having the number zero, but
some webcams have other values. The test is now done on the interface
class which may be either 255 (vendor spec) or 0 (class per interface).

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:29 -03:00
Jean-Francois Moine 38719d45f9 V4L/DVB (13896): gspca - zc3xx: Adjust the pas202b exchanges.
- adapt the start sequences from the info file of the ms-win driver
  of the webcams 046d:08a2/046d:08aa (lvWIMv.inf)
- disable the brightness for this sensor

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:28 -03:00
Jean-Francois Moine fd18046fff V4L/DVB (13895): gspca - zc3xx: Fix the contrast control.
The previous calculation gave bad gamma tables.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:28 -03:00
Jean-Francois Moine 878b35aedb V4L/DVB (13894): gspca - sonixj: Add more controls.
- sharpness
- brightness for adcm1700
- adjust brightness/exposure for adcm1700
- add some comments

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:28 -03:00
Jean-Francois Moine 83c94a1863 V4L/DVB (13893): gspca - vc032x: Change the sensor of 046d:0892 and 046d:0896.
- new sensor POxxxx (unknown ID)
- no probe
- new controls
- table for the disabled controls

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:28 -03:00
Jean-Francois Moine 219f3027a8 V4L/DVB (13892): gspca - vc032x: Add the H and V flip controls for sensor mi1320.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:28 -03:00
Jean-Francois Moine ff1cf40812 V4L/DVB (13891): gspca - vc032x: Fix bad probe of the sensor mi1320.
- have 2 tables for sensor probe
- with the same ID, the sensor mi1320 is found with the bridge vc0321,
        the sensor mi1320_soc with the bridge vc0323
- add some comments

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:28 -03:00
Antoine Jacquet 08135ba238 V4L/DVB (13885): zr364xx: fix support for Aiptek DV T300
Added a new initialization method for Aiptek DV T300.
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=13708

Tested-by: Hámorszky Balázs <balihb@gmail.com>
Signed-off-by: Antoine Jacquet <royale@zerezo.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:28 -03:00
Erik Andrén 969cc9264b V4L/DVB (13883): gspca - m5602: Be less verbose during sensor probe
Currently all probed sensor types are emitted in the kernel log, generating unnecessary noise. Be less verbose and only report what sensor is found (if any)

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:28 -03:00
Erik Andrén 6a1b262fac V4L/DVB (13881): gspca - stv06xx: Clean up the dump bridge function
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:27 -03:00
Mauro Carvalho Chehab fb8253baa0 V4L/DVB (13879): dvb_frontend: report what ioctl were called on debug mode
When printing that an iocl were called, report the ioctl number.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:27 -03:00
Mauro Carvalho Chehab 639544d78c V4L/DVB (13878): dvb_frontend: Print dump on get after filling the data
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:27 -03:00
Jean-Francois Moine 64677573a2 V4L/DVB (13872): gspca - sonixj: Add sensor adcm1700 and webcam 0c45:614a.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:27 -03:00
Jean-Francois Moine 0a71d9cec2 V4L/DVB (13871): gspca - benq: New subdriver for camera 04a5:3035.
Tested-by: Francesco Lavra <francescolavra@interfree.it>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:27 -03:00
Jean-Francois Moine d754a6ca9a V4L/DVB (13870): gspca - zc3xx: Bad detection of sensor HV7131R(c).
The webcam 0ac8:303b may have the sensors HV7131B or HV7131R(c).
This changeset checks the HV7131 type.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:27 -03:00
Luis Maia 658604ec9c V4L/DVB (13867): gspca - zc3xx: Add one more chipset ID of tas5130K.
This ID was found in a webcam 0ac8:301b.

Signed-off-by: Luis Maia <lmaia@royalhat.org>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:27 -03:00
Jean-Francois Moine 47aaca961f V4L/DVB (13866): gspca - main: Add the cam flag 'no_urb_create'.
This flag permits subdrivers to create specific transfer URBs.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:27 -03:00
Jean-Francois Moine db870875c0 V4L/DVB (13865): gspca - main: Optimize code.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:26 -03:00
Mauro Carvalho Chehab 3205e4fe0d V4L/DVB (13856): ir-keytable: simplify and avoid a warning
/home/v4l/buildtest/v4l-dvb-master/v4l/ir-keytable.c: In function 'ir_setkeycode':
/home/v4l/buildtest/v4l-dvb-master/v4l/ir-keytable.c:190: warning: 'newkeymap' may be used uninitialized in this function

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:26 -03:00
Mauro Carvalho Chehab b4622c14a1 V4L/DVB (13848): smsdvb: Add the proper status for IsRfLocked
Now, if RF is locked but demod is not locked, it will report:
>>> tuning status == 0x03

This happens, for example, if the device is on DVB-T, and the video
standard is ISDB-T.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:26 -03:00
Mauro Carvalho Chehab 25f9461a03 V4L/DVB (13847): smsdvb: Remove a wrong debug message
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:26 -03:00
Mauro Carvalho Chehab 5eb23975b4 V4L/DVB (13846): smsdvb: Properly implement stats for both DVB and ISDB-T
After taking a look at the driver's history and doing some tests with
DVB and ISDB-T, it was noticed that the stats were incomplete, for
ISDB-T, and weren't working for DVB.

Fixed the code and added a debug code to print the complete stats at
dmesg. This debug is useful to improve the stats of this driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:26 -03:00
Mauro Carvalho Chehab 643e15a0f4 V4L/DVB (13845): smsdvb: Fix the frequency switch that broke with v5 API conversion
Bandwidth is in Hz, not in kHz.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:26 -03:00
Mauro Carvalho Chehab e85c97a050 V4L/DVB (13844): smsdvb: Properly report the Delivery System
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:26 -03:00
Mauro Carvalho Chehab 910ef763c1 V4L/DVB (13843): dib8000: Properly report Delivery System as SYS_ISDBT
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:26 -03:00
Mauro Carvalho Chehab cf4fab720c V4L/DVB (13842): smsdvb: Convert it to use DVB API v5 (S2API)
Based on a patch originally written by Michael Krufky <mkrufky@linuxtv.org>
for a preliminar S2API spec.

The patch were ported to the S2API and had the ISDB-T API additions to
honor the auto mode, while keep allowing manual tuning.

Tested with both the original dvb-apps and the new dvb-apps-isdbt scan,
that uses a different channel.conf and uses S2API with ISDB-T extensions.

Thanks-to: Michael Krufky <mkrufky@linuxtv.org> for his first version
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:25 -03:00
Mauro Carvalho Chehab 67ae1d26bd V4L/DVB (13841): smsdvb: Make stats to work
Siano series of patches seemed to cause a regression on reporting DTV
statistics. Due to that, signal indication weren't received, preventing
applications like scan to work.

Tested with ISDB-T signals and got the same scan result as with a
dib0700/dib8000 device.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:25 -03:00
Michael Krufky dcb0c53331 V4L/DVB (13840): smsusb: Add ISDB-T firmware for Hauppauge WinTV-Nova-T-MiniStick
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:25 -03:00
Michael Krufky 6b26fcea51 V4L/DVB (13839): smsdvb: add ISDB-T as DVB-T tuning support hack
Activate ISDB-T mode using module option default_mode=6.

hack: use 4 lower bits in frequency for segment number

[mchehab@redhat.com: fix merge conflicts and CodingStyle]
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:25 -03:00
David Wong c245c75c41 V4L/DVB (13838): atbm8830: use AGC setting from config
Improves ATBM8830 reception by using per card AGC configuration rather
than register default.

Signed-off-by: David T. L. Wong <davidtlwong@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:25 -03:00
Mauro Carvalho Chehab 8719cfdb4a V4L/DVB (13833): ir-core: some functions can be static
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:25 -03:00
Daniel Ritz 68f194e027 V4L/DVB (13830): uvcvideo: add another YUYV format GUID for iSight cameras
For some unknown reason, on a MacBookPro5,3 the iSight sometimes report
a different video format GUID. This patch add the other (wrong) GUID to
the format table, making the iSight work always w/o other problems.

What it should report: 32595559-0000-0010-8000-00aa00389b71
What it often reports: 32595559-0000-0010-8000-000000389b71

Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:25 -03:00
Laurent Pinchart 73de3592c0 V4L/DVB (13828): uvcvideo: Make the quirks module parameter override the built-in quirks
The quirks module parameter is or'ed with the built-in quirks for the
device being probed. This make it impossible to disable a built-in quirk
without recompiling the driver.

Replace the built-in quirks with the quirks module parameter instead of
or'ing the values.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:25 -03:00
Laurent Pinchart 310fe52461 V4L/DVB (13827): uvcvideo: Switch to a monotonic clock for V4L2 buffers timestamps
The realtime clock provided by do_gettimeofday() is affected by time
jumps caused by NTP or DST. Furthermore, preliminary investigation
showed that SMP systems the realtime clock is based on the CPU TSC,
and those could get slightly out of sync, resulting in jitter in the
timestamps depending on which processor handles the USB interrupts.

Instead of the realtime clock, use a monotonic high resolution clock to
timestamp the buffer. As this could in theory introduce a regression
with some userspace applications expecting a realtime clock timestamp,
add a module parameter to switch back to the realtime clock.

Thanks to Paulo Assis for pointing out and investigating the issue.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:24 -03:00
Mauro Carvalho Chehab 0f7ff39532 V4L/DVB (13825): ir-core: Don't OOPS if IR device props is not defined
As currently most drivers don't define ir_dev->props, we shouldn't assume
that this field is defined.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:24 -03:00
Igor M. Liplianin cd79d33e16 V4L/DVB (13818): Add Prof 7500 DVB-S2 USB card
The card based on stv0903 demod, stb6100 tuner.

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:24 -03:00
Jean-Francois Moine d41592a2a2 V4L/DVB (13815): gspca - sunplus: Add webcam 052b:1507.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:24 -03:00
Mauro Carvalho Chehab 971e8298de V4L/DVB (13680): ir: use unsigned long instead of enum
When preparing the linux-next patches, I got those errors:

include/media/ir-core.h:29: warning: left shift count >= width of type
In file included from include/media/ir-common.h:29,
                 from drivers/media/video/ir-kbd-i2c.c:50:
drivers/media/video/ir-kbd-i2c.c: In function ‘ir_probe’:
drivers/media/video/ir-kbd-i2c.c:324: warning: left shift count >= width of type

Unfortunately, enum is 32 bits on i386. As we define IR_TYPE_OTHER as 1<<63,
it won't work on non 64 bits arch.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:24 -03:00
Mauro Carvalho Chehab 3f831107ed V4L/DVB (13641): Properly update the driver representation for the protocol
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:24 -03:00
Mauro Carvalho Chehab eecee32ac2 V4L/DVB (13639): ir-sysfs: Properly protect rc_tab changes with a lock
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:24 -03:00
Mauro Carvalho Chehab d4b778d368 V4L/DVB (13638): ir-core: documment missed functions
While here, change ir_core_dev_number to be static

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:24 -03:00
Mauro Carvalho Chehab 950b0f5a0b V4L/DVB (13637): em28xx: allow changing keycode table protocol
Experimental patch to allow changing the IR protocol. Currently, it support
changing between RC-5 and NEC protocols.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:23 -03:00
Mauro Carvalho Chehab 09b01b90eb V4L/DVB (13636): ir-core: add method to change IR protocol
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:23 -03:00
Mauro Carvalho Chehab 53f870228d V4L/DVB (13635): ir-core: Implement protocol table type reading
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:23 -03:00
Mauro Carvalho Chehab e93854da88 V4L/DVB (13634): ir-core: allow passing IR device parameters to ir-core
Adds an structure to ir_input_register to contain IR device characteristics,
like supported protocols and a callback to handle protocol event changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:23 -03:00
Mauro Carvalho Chehab 4714eda877 V4L/DVB (13633): ir-core: create a new class for remote controllers
Add sysfs skeleton to export remote controller information via
/sys/class/irrcv.

For now, the code doesn't do much. It just exports an attribute that
is meant to  report and control the IR protocol used by the keytable.
However, the callbacks for this new attribute weren't set yet.

Also, it lacks symlinks to the used event interface.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26 15:10:23 -03:00
Linus Torvalds a4a47bc03f Lower USB storage settling delay to something more reasonable
The five-second delay can be rather annoying, and makes the system
appear much less responsive when you connect a USB drive.

It's also not entirely clear that it is needed - the settling delay has
at least historically been an issue on some Apple iPods, for example,
and some devices have been reported to need even more than the old 5s
delay.

But before we penalize them all, let's see how bad it really is.  Some
of the reasons for long delays seem to be actual historical kernel bugs
that should probably never have been papered over with a delay in the
first place (there's a Ubuntu bug report for 2.6.20 about a NULL pointer
dereference unless 'delay_use' is 8 or more, for example).

It also looks like some distros have already shipped with delay_use=0,
so the five second default may well be totally historical.

In other words: "Let's see if anybody screams".

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-02-26 10:03:22 -08:00
Linus Torvalds 6ebdc661b6 Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: (41 commits)
  of: remove undefined request_OF_resource & release_OF_resource
  of/sparc: Remove sparc-local declaration of allnodes and devtree_lock
  of: move definition of of_chosen into common code.
  of: remove unused extern reference to devtree_lock
  of: put default string compare and #a/s-cell values into common header
  of/flattree: Don't assume HAVE_LMB
  of: protect linux/of.h with CONFIG_OF
  proc_devtree: fix THIS_MODULE without module.h
  of: Remove old and misplaced function declarations
  of/flattree: Make the kernel accept ePAPR style phandle information
  of/flattree: endian-convert members of boot_param_header
  of: assume big-endian properties, adding conversions where necessary
  of: use __be32 for cell value accessors
  of/flattree: use OF_ROOT_NODE_{SIZE,ADDR}_CELLS DEFAULT for fdt parsing
  of/flattree: use callback to setup initrd from /chosen
  proc_devtree: include linux/of.h
  of: make set_node_proc_entry private to proc_devtree.c
  of: include linux/proc_fs.h
  of/flattree: merge early_init_dt_scan_memory() common code
  of: add 'of_' prefix to machine_is_compatible()
  ...
2010-02-25 15:38:37 -08:00
Linus Torvalds d7930c9ef9 Merge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6
* 'next-spi' of git://git.secretlab.ca/git/linux-2.6: (31 commits)
  spi: Correct SPI clock frequency setting in spi_mpc8xxx
  spi/spi_s3c64xx.c: Fix continuation line formats
  spi/dw_spi: Fix dw_spi_mmio to depend on HAVE_CLK
  spi/dw_spi: Allow dw_spi.c to be a module
  spi/dw_spi: mmio code style fixups
  Memory-mapped dw_spi driver
  spi/dw_spi: fix missing export of dw_spi_remove_host
  spi/dw_spi: conditional transfer mode changes
  spi/dw_spi: remove conditional from 'poll_transfer'.
  spi/dw_spi: fixed a spelling typo in a warning message.
  spi/dw_spi: add return value to empty mrst_spi_debugfs_init()
  spi/dw_spi: enable platform specific chipselect.
  spi/dw_spi: add a FIFO depth detection
  spi/dw_spi: fix __init/__devinit section mismatch
  spi: xilinx_spi: Fix up I/O routine wrapping bogosity.
  spi/spi_imx: add device information by switching pr_debug() to dev_dbg()
  spi: update MSIOF includes
  spi/dw_spi: refine the IRQ mode working flow
  spi/dw_spi: add a missed dw_spi_remove_host() in exit sequence
  spi/dw_spi: bug fix in wait_till_not_busy()
  ...
2010-02-25 15:38:03 -08:00
Linus Torvalds a85821fce2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (41 commits)
  HID: usbhid: initialize interface pointers early enough
  HID: extend mask for BUTTON usage page
  HID: hid-ntrig: Single touch mode tap
  HID: hid-ntrig: multitouch cleanup and fix
  HID: n-trig: remove unnecessary tool switching
  HID: hid-ntrig add multi input quirk and clean up
  HID: usbhid: introduce timeout for stuck ctrl/out URBs
  HID: magicmouse: coding style and probe failure fixes
  HID: remove MODULE_VERSION from new drivers
  HID: fix up Kconfig entry for MagicMouse
  HID: add a device driver for the Apple Magic Mouse.
  HID: Export hid_register_report
  HID: Support for MosArt multitouch panel
  HID: add pressure support for the Stantum multitouch panel
  HID: fixed bug in single-touch emulation on the stantum panel
  HID: fix typo in error message
  HID: add mapping for "AL Network Chat" usage
  HID: use multi input quirk for TouchPack touchscreen
  HID: make full-fledged hid-bus drivers properly selectable
  HID: make Wacom modesetting failures non-fatal
  ...
2010-02-25 14:42:39 -08:00
Matthew Garrett 6335e4d566 toshiba_acpi: Add full hotkey support
Calling the ENAB method on Toshiba laptops results in notifications being
sent when laptop hotkeys are pressed.  This patch simply calls that method
and sets up an input device if it's successful.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-02-25 15:20:54 -05:00
Matthew Garrett caeacf59af hp-wmi: Add support for tablet rotation key
The HP touchsmart tablet has a key for rotating the UI from landscape to
portrait. Add support for it.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-02-25 11:50:54 -05:00
Erik Andren cb6a7937f4 dell-laptop: Add another Dell laptop to the DMI whitelist
The Latitude C640 has another variation of dell in its DMI vendor entry.
Add it to the whitelist in order to enjoy the sweet fruits of software
backlight toggling.

Signed-off-by: Erik Andren <erik.andren@gmail.com>
2010-02-25 11:50:53 -05:00
Thadeu Lima de Souza Cascardo 02e77a55f7 classmate-laptop: use a single MODULE_DEVICE_TABLE to get correct aliases
Instead of a MODULE_DEVICE_TABLE for every acpi_driver ids table, we
create a table containing all ids to export to get a module alias for
each one.

This will fix automatic loading of the driver when one of the ACPI
devices is not present (like the accelerometer, which is not present in
some models).

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
2010-02-25 11:50:52 -05:00
Matthew Garrett c6760ac426 dell-laptop: Pay attention to which devices the hardware switch controls
Right now, we assume that the hardware rfkill switch on Dells toggles all
radio devices. In fact, this can be configured in the BIOS and so right
now we may mark a device as hardware killed even when it isn't. Add code
to query the devices controlled by the switch, and use this when
determining the hardware kill state of a radio.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-02-25 11:50:50 -05:00
Stuart Hayes 116ee77b28 dell-laptop: Use buffer with 32-bit physical address
Calls to communicate with system firmware via a SMI (using dcdbas)
need to use a buffer that has a physical address of 4GB or less.
Currently the dell-laptop driver does not guarantee this, and when the
buffer address is higher than 4GB, the address is truncated to 32 bits
and the SMI handler writes to the wrong memory address.

Signed-off-by: Stuart Hayes <stuart_hayes@dell.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
2010-02-25 11:50:49 -05:00
Mario Limonciello e5fefd0c8c dell-laptop: Blacklist machines not supporting dell-laptop
The Mini family doesn't support smbios 17,11 although it reports it does.

Signed-off-by: Mario Limonciello <superm1@ubuntu.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
2010-02-25 11:50:48 -05:00
Mario Limonciello ec1722a214 dell-laptop: Block software state changes when rfkill hard blocked
The "hardware" switch is tied directly to a BIOS interface that will
connect and disconnect the hardware from the bus.

If you use the software interface to request the BIOS to make these
changes, the HW switch will be in an inconsistent state and LEDs may not
reflect the state of the HW.

Signed-off-by: Mario Limonciello <Mario_Limonciello@Dell.com>
2010-02-25 11:50:46 -05:00
Matthew Garrett e551260b23 dell-laptop: Fix small memory leak
da_tokens was not being freed by dell-laptop on unload. Fix that.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-02-25 11:50:44 -05:00
Matthew Garrett facd61d7b7 dell-laptop: Fix platform device unregistration
dell-laptop currently fails to clean up its platform device correctly.
Make sure that it's unregistered.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-02-25 11:50:43 -05:00
Matthew Garrett 814cb8adbe dell-laptop: Update rfkill state on kill switch
The rfkill interface on Dells only sends a notification that the switch
has been changed via the keyboard controller. Add a filter so we can
pick these notifications up and update the rfkill state appropriately.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-02-25 11:50:42 -05:00
Mario Limonciello 493e91433e compal-laptop: Replace sysfs support with rfkill support
This drops the support for manually groking the files in sysfs
to turn on and off the WLAN and BT for Compal laptops in favor
of platform rfkill support.

It has been combined into a single patch to not introduce regressions
in the process of simply adding rfkill support

Signed-off-by: Mario Limonciello <Mario_Limonciello@Dell.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
2010-02-25 11:50:40 -05:00
Mario Limonciello 34325b9d2a compal-laptop: Add support for known Compal made Dell laptops
The following Dell laptops are known to have been manufacturer by Compal
and are supported by the compal-laptop platform driver
 - Mini 9
 - Mini 10
 - Mini 12
 - Mini 10v
 - Inspiron 11z

Signed-off-by: Mario Limonciello <Mario_Limonciello@Dell.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
2010-02-25 11:50:39 -05:00
Jiri Kosina 14ef2b0c02 Merge branches 'upstream', 'raw_report_modifications' and 'apple_magic_mouse' into for-linus
Conflicts:
	drivers/hid/Kconfig
2010-02-25 17:39:16 +01:00
Linus Torvalds 10df38cafc Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (44 commits)
  Add MAINTAINERS entry for virtio_console
  virtio: console: Fill ports' entire in_vq with buffers
  virtio: console: Error out if we can't allocate buffers for control queue
  virtio: console: Add ability to remove module
  virtio: console: Ensure no memleaks in case of unused buffers
  virtio: console: show error message if hvc_alloc fails for console ports
  virtio: console: Add debugfs files for each port to expose debug info
  virtio: console: Add ability to hot-unplug ports
  virtio: console: Handle port hot-plug
  virtio: console: Remove cached data on port close
  virtio: console: Register with sysfs and create a 'name' attribute for ports
  virtio: console: Ensure only one process can have a port open at a time
  virtio: console: Add file operations to ports for open/read/write/poll
  virtio: console: Associate each port with a char device
  virtio: console: Prepare for writing to userspace buffers
  virtio: console: Add a new MULTIPORT feature, support for generic ports
  virtio: console: Introduce a send_buf function for a common path for sending data to host
  virtio: console: Introduce function to hand off data from host to readers
  virtio: console: Separate out find_vqs operation into a different function
  virtio: console: Separate out console init into a new function
  ...
2010-02-25 07:22:59 -08:00
Paul Mundt da64c2a8de clocksource: Fix up a registration/IRQ race in the sh drivers.
All of the SH clocksource drivers follow the scheme that the IRQ is setup
prior to registering the clockevent. The interrupt handler in the
clockevent cases looks to the event handler function pointer being filled
in by the registration code, permitting us to get in to situations where
asserted IRQs step in to the handler before registration has had a chance
to complete and hitting a NULL pointer deref.

In practice this is not an issue for most platforms, but some of them
with fairly special loaders (or that are chain-loading from another
kernel) may enter in to this situation. This fixes up the oops reported
by Rafael on hp6xx.

Reported-and-tested-by: Rafael Ignacio Zurita <rafaelignacio.zurita@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-25 16:37:46 +09:00
Robert Hancock 453d3131ec ahci: disable FPDMA auto-activate optimization on NVIDIA AHCI
Mike Cui reported that his system with an NVIDIA MCP79 (aka MCP7A)
chipset stopped working with 2.6.32. The problem appears to be that
2.6.32 now enables the FPDMA auto-activate optimization in the ahci
driver. The drive works fine with this enabled on an Intel AHCI so
this appears to be a chipset bug.  Since MCP79 is a fairly recent
NVIDIA chipset and we don't have any info on whether any other NVIDIA
chipsets have this issue, disable FPDMA AA optimization on all NVIDIA
AHCI controllers for now.

Should address http://bugzilla.kernel.org/show_bug.cgi?id=14922

Signed-off-by: Robert Hancock <hancockrwd@gmail.com>
While-we-investigate-issue-this-patch-looks-good-to-me-by:
	Prajakta Gudadhe <pgudadhe@nvidia.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Cc: stable@kernel.org
2010-02-24 22:44:48 -05:00
Rafael J. Wysocki cbbc0de700 ACPI: Use GPE reference counting to support shared GPEs
To fix a bug and address the reviewers' comments regarding the ACPI
GPE refcounting patch, do the following additional changes:

o Remove the second argument of acpi_ev_enable_gpe(),
  'write_to_hardware', because it is not necessary any more.

o Add the "bad parameter" test against 'type' in
  acpi_enable_gpe() and acpi_disable_gpe().

o Make acpi_enable_gpe() only check 'status' for runtime GPEs if
  acpi_ev_enable_gpe() was actually called.

o Make acpi_disable_gpe() return 'status' returned by
  acpi_ev_disable_gpe() and fix a bug where ACPI_GPE_TYPE_WAKE
  and ACPI_GPE_TYPE_RUNTIME were exchanged by mistake.

o Add comments explaining why acpi_set_gpe() is used by the ACPI EC
  driver.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-24 14:25:23 -08:00
Amit Shah d693356192 virtio: console: Fill ports' entire in_vq with buffers
Instead of allocating just one buffer for a port's in_vq, fill
the entire in_vq with buffers so the host need not stall while
an application consumes the data and makes the buffer available
again for the host.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:06 +10:30
Amit Shah 22a29eacd2 virtio: console: Error out if we can't allocate buffers for control queue
With MULTIPORT support, the control queue is an integral part of the
functioning of the device. If we can't get any buffers allocated, the
host won't be able to relay important information and the device may not
function as intended.

Ensure 'probe' doesn't succeed until the control queue has at least one
buffer allocated for its ivq.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:04 +10:30
Amit Shah 7177876fea virtio: console: Add ability to remove module
Add the ability to remove the virtio_console module.

This aids debugging.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:04 +10:30
Amit Shah a9cdd48557 virtio: console: Ensure no memleaks in case of unused buffers
If unused data exists in in_vq, ensure we flush that first and then
detach unused buffers, which will ensure all buffers from the in_vq are
removed.

Also ensure we free the buffers after detaching them.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:03 +10:30
Amit Shah 298add723a virtio: console: show error message if hvc_alloc fails for console ports
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:02 +10:30
Amit Shah d99393effd virtio: console: Add debugfs files for each port to expose debug info
This is helpful in examining ports' state.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:01 +10:30
Amit Shah 1f7aa42d16 virtio: console: Add ability to hot-unplug ports
Remove port data; deregister from the hvc core if it's a console port.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:00 +10:30
Amit Shah 7f5d810dac virtio: console: Handle port hot-plug
If the 'nr_ports' variable in the config space is updated to a higher
value, that means new ports have been hotplugged.

Introduce a new workqueue to handle such updates and create new ports.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:58 +10:30
Amit Shah 88f251ac58 virtio: console: Remove cached data on port close
Remove any data that we might have in a port's inbuf when closing a port
or when any data is received when a port is closed.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:57 +10:30
Amit Shah 431edb8a8b virtio: console: Register with sysfs and create a 'name' attribute for ports
The host can set a name for ports so that they're easily discoverable
instead of going by the /dev/vportNpn naming. This attribute will be
placed in /sys/class/virtio-ports/vportNpn/name. udev scripts can then
create symlinks to the port using the name.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:56 +10:30
Amit Shah 3c7969ccb5 virtio: console: Ensure only one process can have a port open at a time
Add a guest_connected field that ensures only one process
can have a port open at a time.

This also ensures we don't have a race when we later add support for
dropping buffers when closing the char dev and buffer caching is turned
off for the particular port.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:55 +10:30
Amit Shah 2030fa496d virtio: console: Add file operations to ports for open/read/write/poll
Allow guest userspace applications to open, read from, write to, poll
the ports via the char dev interface.

When a port gets opened, a notification is sent to the host via a
control message indicating a connection has been established. Similarly,
on closing of the port, a notification is sent indicating disconnection.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:54 +10:30
Amit Shah fb08bd274d virtio: console: Associate each port with a char device
The char device will be used as an interface by applications on the
guest to communicate with apps on the host.

The devices created are placed in /dev/vportNpn where N is the
virtio-console device number and n is the port number for that device.

One dynamic major device number is allocated for each device and minor
numbers are allocated for the ports contained within that device.

The file operation for the char devs will be added in the following
commits.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:53 +10:30
Amit Shah b766ceed5b virtio: console: Prepare for writing to userspace buffers
When ports get advertised as char devices, the buffers will come from
userspace. Equip the fill_readbuf function with the ability to write
to userspace buffers.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:53 +10:30
Amit Shah 17634ba255 virtio: console: Add a new MULTIPORT feature, support for generic ports
This commit adds a new feature, MULTIPORT. If the host supports this
feature as well, the config space has the number of ports defined for
that device. New ports are spawned according to this information.

The config space also has the maximum number of ports that can be
spawned for a particular device. This is useful in initializing the
appropriate number of virtqueues in advance, as ports might be
hot-plugged in later.

Using this feature, generic ports can be created which are not tied to
hvc consoles.

We also open up a private channel between the host and the guest via
which some "control" messages are exchanged for the ports, like whether
the port being spawned is a console port, resizing the console window,
etc.

Next commits will add support for hotplugging and presenting char
devices in /dev/ for bi-directional guest-host communication.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:52 +10:30
Amit Shah f997f00bf8 virtio: console: Introduce a send_buf function for a common path for sending data to host
Adding support for generic ports that will write to userspace will need
some code changes.

Consolidate the write routine into send_buf() and put_chars() now just
calls into the new function.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:51 +10:30
Amit Shah 203baab8ba virtio: console: Introduce function to hand off data from host to readers
In preparation for serving data to userspace (generic ports) as well as
in-kernel users (hvc consoles), separate out the functionality common to
both in a 'fill_readbuf()' function.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:50 +10:30
Amit Shah 2658a79acf virtio: console: Separate out find_vqs operation into a different function
With support for multiple ports, each port will have its own input and
output vqs. Prepare the probe function for this change.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:49 +10:30
Amit Shah cfa6d37925 virtio: console: Separate out console init into a new function
Console ports could be hot-added. Also, with the new multiport support,
a port is identified as a console port only if the host sends a control
message.

Move the console port init into a separate function so it can be invoked
from other places.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:48 +10:30
Amit Shah 4f23c573c0 virtio: console: Separate out console-specific data into a separate struct
Move out console-specific stuff into a separate struct from 'struct
port' as we need to maintain two lists: one for all the ports (which
includes consoles) and one only for consoles since the hvc callbacks
only give us the vtermno.

This makes console handling cleaner.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:47 +10:30
Amit Shah cb06e3676b virtio: console: ensure console size is updated on hvc open
When multiple console support is added, ensure each port's size gets
updated when a new one is opened via hvc.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:45 +10:30
Amit Shah 1c85bf3544 virtio: console: struct ports for multiple ports per device.
Rather than assume a single port, add a 'struct ports_device' which
stores data related to all the ports for that device.

Currently, there's only one port and is hooked up with hvc, but that
will change.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:43 +10:30
Rusty Russell d8a02bd58a virtio: console: remove global var
Now we can use an allocation function to remove our global console variable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:42 +10:30
Amit Shah 38edf58d73 virtio: console: don't assume a single console port.
Keep a list of all ports being used as a console, and provide a lock
and a lookup function.  The hvc callbacks only give us a vterm number,
so we need to map this.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:41 +10:30
Rusty Russell 73954488b1 virtio: console: use vdev->priv to avoid accessing global var.
Part of removing our "one console" assumptions, use vdev->priv to point
to the port (currently == the global console).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:40 +10:30
Amit Shah a3cde44908 virtio: console: introduce a get_inbuf helper to fetch bufs from in_vq
This makes taking locks around the get_buf vq operation easier, as well
as complements the add_inbuf() operation.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:38 +10:30
Amit Shah e27b519807 virtio: console: ensure add_inbuf can work for multiple ports as well
add_inbuf() assumed one port and one inbuf per port. Remove that
assumption.

Also move the function so that put_chars and get_chars are together.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:37 +10:30
Amit Shah fdb9a05455 virtio: console: encapsulate buffer information in a struct
Collect port buffer, used_len, offset fields into a single structure.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:36 +10:30
Rusty Russell 21206ede88 virtio: console: port encapsulation
We are heading towards a multiple-"port" system, so as part of weaning off
globals we encapsulate the information into 'struct port'.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:34 +10:30
Amit Shah f550804ab9 virtio: console: We support only one device at a time
We support only one virtio_console device at a time. If multiple are
found, error out if one is already initialized.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:33 +10:30
Rusty Russell 1dff399616 hvc_console: make the ops pointer const.
This is nicer for modern R/O protection.  And noone needs it non-const, so
constify the callers as well.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: linuxppc-dev@ozlabs.org
2010-02-24 14:22:32 +10:30
Rusty Russell 971f339000 virtio: console: statically initialize virtio_cons
That way, we can make it const as is good kernel style.  We use a separate
indirection for the early console, rather than mugging ops.put_chars.

We rename it hv_ops, too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:31 +10:30
Rusty Russell a23ea92474 virtio: console: comment cleanup
Remove old lguest-style comments.

[Amit: - wingify comments acc. to kernel style
       - indent comments ]

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:30 +10:30
Amit Shah 3b8706240e virtio: Initialize vq->data entries to NULL
vq operations depend on vq->data[i] being NULL to figure out if the vq
entry is in use (since the previous patch).

We have to initialize them to NULL to ensure we don't work with junk
data and trigger false BUG_ONs.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Shirley Ma <xma@us.ibm.com>
2010-02-24 14:22:29 +10:30
Shirley Ma c021eac414 virtio: Add ability to detach unused buffers from vrings
There's currently no way for a virtio driver to ask for unused
buffers, so it has to keep a list itself to reclaim them at shutdown.
This is redundant, since virtio_ring stores that information.  So
add a new hook to do this.

Signed-off-by: Shirley Ma <xma@us.ibm.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:27 +10:30
Christoph Hellwig 69740c8ba8 virtio_blk: add block topology support
Allow reading various alignment values from the config page.  This
allows the guest to much better align I/O requests depending on the
storage topology.

Note that the formats for the config values appear a bit messed up,
but we follow the formats used by ATA and SCSI so they are expected in
the storage world.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:26 +10:30
Michael S. Tsirkin d57ed95da4 virtio: use smp_XX barriers on SMP
virtio is communicating with a virtual "device" that actually runs on
another host processor. Thus SMP barriers can be used to control
memory access ordering.

Where possible, we should use SMP barriers which are more lightweight than
mandatory barriers, because mandatory barriers also control MMIO effects on
accesses through relaxed memory I/O windows (which virtio does not use)
(compare specifically smp_rmb and rmb on x86_64).

We can't just use smp_mb and friends though, because
we must force memory ordering even if guest is UP since host could be
running on another CPU, but SMP barriers are defined to barrier() in
that configuration. So, for UP fall back to mandatory barriers instead.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:25 +10:30
Rusty Russell 97a545ab6c virtio: remove bogus barriers from DEBUG version of virtio_ring.c
With DEBUG defined, we add an ->in_use flag to detect if the caller
invokes two virtio methods in parallel.  The barriers attempt to ensure
timely update of the ->in_use flag.

But they're voodoo: if we need these barriers it implies that the
calling code doesn't have sufficient synchronization to ensure the
code paths aren't invoked at the same time anyway, and we want to
detect it.

Also, adding barriers changes timing, so turning on debug has more
chance of hiding real problems.

Thanks to MST for drawing my attention to this code...

CC: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:24 +10:30
Rusty Russell 169c246a30 virtio: fix balloon without VIRTIO_BALLOON_F_STATS_VQ
When running under qemu-kvm-0.11.0:

	BUG: unable to handle kernel paging request at 56e58955
	...
	Process vballoon (pid: 1297, ti=c7976000 task=c70a6ca0 task.ti=c7
	...
	Call Trace:
	 [<c88253a3>] ? balloon+0x1b3/0x440 [virtio_balloon]
	 [<c041c2d7>] ? schedule+0x327/0x9d0
	 [<c88251f0>] ? balloon+0x0/0x440 [virtio_balloon]
	 [<c014a2d4>] ? kthread+0x74/0x80
	 [<c014a260>] ? kthread+0x0/0x80
	 [<c0103b36>] ? kernel_thread_helper+0x6/0x30

need_stats_update should be zero-initialized.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Adam Litke <agl@us.ibm.com>
2010-02-24 14:22:17 +10:30
Adam Litke 1f34c71afe virtio: Fix scheduling while atomic in virtio_balloon stats
This is a fix for my earlier patch: "virtio: Add memory statistics reporting to
the balloon driver (V4)".

I discovered that all_vm_events() can sleep and therefore stats collection
cannot be done in interrupt context.  One solution is to handle the interrupt
by noting that stats need to be collected and waking the existing vballoon
kthread which will complete the work via stats_handle_request().  Rusty, is
this a saner way of doing business?

There is one issue that I would like a broader opinion on.  In stats_request, I
update vb->need_stats_update and then wake up the kthread.  The kthread uses
vb->need_stats_update as a condition variable.  Do I need a memory barrier
between the update and wake_up to ensure that my kthread sees the correct
value?  My testing suggests that it is not needed but I would like some
confirmation from the experts.

Signed-off-by: Adam Litke <agl@us.ibm.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Anthony Liguori <aliguori@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:14 +10:30
Adam Litke 9564e138b1 virtio: Add memory statistics reporting to the balloon driver (V4)
Changes since V3:
 - Do not do endian conversions as they will be done in the host
 - Report stats that reference a quantity of memory in bytes
 - Minor coding style updates

Changes since V2:
 - Increase stat field size to 64 bits
 - Report all sizes in kb (not pages)
 - Drop anon_pages stat and fix endianness conversion

Changes since V1:
 - Use a virtqueue instead of the device config space

When using ballooning to manage overcommitted memory on a host, a system for
guests to communicate their memory usage to the host can provide information
that will minimize the impact of ballooning on the guests.  The current method
employs a daemon running in each guest that communicates memory statistics to a
host daemon at a specified time interval.  The host daemon aggregates this
information and inflates and/or deflates balloons according to the level of
host memory pressure.  This approach is effective but overly complex since a
daemon must be installed inside each guest and coordinated to communicate with
the host.  A simpler approach is to collect memory statistics in the virtio
balloon driver and communicate them directly to the hypervisor.

This patch enables the guest-side support by adding stats collection and
reporting to the virtio balloon driver.

Signed-off-by: Adam Litke <agl@us.ibm.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (minor fixes)
2010-02-24 14:22:08 +10:30
Jamie Lokier 1f08b833dd Add __devexit_p around reference to virtio_pci_remove
This is needed to compile with CONFIG_VIRTIO_PCI=y,
because virtio_pci_remove is marked __devexit.

Signed-off-by: Jamie Lokier <jamie@shareable.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:04 +10:30
Linus Torvalds 75ef7cdda2 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  net: bug fix for vlan + gro issue
  tc35815: Remove a wrong netif_wake_queue() call which triggers BUG_ON
  cdc_ether: new PID for Ericsson C3607w to the whitelist (resubmit)
  IPv6: better document max_addresses parameter
  MAINTAINERS: update mv643xx_eth maintenance status
  e1000: Fix DMA mapping error handling on RX
  iwlwifi: sanity check before counting number of tfds can be free
  iwlwifi: error checking for number of tfds in queue
  iwlwifi: set HT flags after channel in rxon
2010-02-23 19:44:07 -08:00
Linus Torvalds be64c970f6 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: Be in TS_POLLING state during mwait based C-state entry
  ACPI: Fix regression where _PPC is not read at boot even when ignore_ppc=0
  acer-wmi: Respect current backlight level when loading
2010-02-23 18:15:05 -08:00
Linus Torvalds 34e3f91b4e Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/vmwgfx: Fix queries if no dma buffer thrashing is occuring.
  drm/nv50: fix vram ptes on IGPs to point at stolen system memory
  drm/nv50: fix instmem binding on IGPs to point at stolen system memory
  drm/nv50: improve vram page table construction
  drm/nv50: more efficient clearing of gpu page table entries
  drm/nv50: make nv50_mem_vm_{bind,unbind} operate only on vram
  drm/nouveau: Fix up pre-nv17 analog load detection.
2010-02-23 18:13:34 -08:00
Bjorn Helgaas 7bc5e3f2be x86/PCI: use host bridge _CRS info by default on 2008 and newer machines
The main benefit of using ACPI host bridge window information is that
we can do better resource allocation in systems with multiple host bridges,
e.g., http://bugzilla.kernel.org/show_bug.cgi?id=14183

Sometimes we need _CRS information even if we only have one host bridge,
e.g., https://bugs.launchpad.net/ubuntu/+source/linux/+bug/341681

Most of these systems are relatively new, so this patch turns on
"pci=use_crs" only on machines with a BIOS date of 2008 or newer.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-23 09:43:42 -08:00
Bjorn Helgaas 2fe2abf896 PCI: augment bus resource table with a list
Previously we used a table of size PCI_BUS_NUM_RESOURCES (16) for resources
forwarded to a bus by its upstream bridge.  We've increased this size
several times when the table overflowed.

But there's no good limit on the number of resources because host bridges
and subtractive decode bridges can forward any number of ranges to their
secondary buses.

This patch reduces the table to only PCI_BRIDGE_RESOURCE_NUM (4) entries,
which corresponds to the number of windows a PCI-to-PCI (3) or CardBus (4)
bridge can positively decode.  Any additional resources, e.g., PCI host
bridge windows or subtractively-decoded regions, are kept in a list.

I'd prefer a single list rather than this split table/list approach, but
that requires simultaneous changes to every architecture.  This approach
only requires immediate changes where we set up (a) host bridges with more
than four windows and (b) subtractive-decode P2P bridges, and we can
incrementally change other architectures to use the list.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-23 09:43:37 -08:00
Bjorn Helgaas 89a74ecccd PCI: add pci_bus_for_each_resource(), remove direct bus->resource[] refs
No functional change; this converts loops that iterate from 0 to
PCI_BUS_NUM_RESOURCES through pci_bus resource[] table to use the
pci_bus_for_each_resource() iterator instead.

This doesn't change the way resources are stored; it merely removes
dependencies on the fact that they're in a table.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-23 09:43:31 -08:00
Bjorn Helgaas 2adf75160b PCI: read bridge windows before filling in subtractive decode resources
No functional change; this fills in the bus subtractive decode resources
after reading the bridge window information rather than before.  Also,
print out the subtractive decode resources as we already do for the
positive decode windows.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-23 09:43:25 -08:00
Bjorn Helgaas fa27b2d108 PCI: split up pci_read_bridge_bases()
No functional change; this breaks up pci_read_bridge_bases() into separate
pieces for the I/O, memory, and prefetchable memory windows, similar to how
Yinghai recently split up pci_setup_bridge() in 68e84ff3bdc.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-23 09:43:17 -08:00
David S. Miller 675c60706c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2010-02-23 01:27:05 -08:00
Atsushi Nemoto 662a96bd6f tc35815: Remove a wrong netif_wake_queue() call which triggers BUG_ON
The netif_wake_queue() is called correctly (i.e. only on !txfull
condition) from txdone routine.  So Unconditional call to the
netif_wake_queue() here is wrong.  This might cause calling of
start_xmit routine on txfull state and trigger BUG_ON.

This bug does not happen when NAPI disabled.  After txdone there
must be at least one free tx slot.  But with NAPI, this is not
true anymore and the BUG_ON can hits on heavy load.

In this driver NAPI was enabled on 2.6.33-rc1 so this is
regression from 2.6.32 kernel.

Reported-by: Ralf Roesch <ralf.roesch@rw-gmbh.de>
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-23 01:25:01 -08:00
Torgny Johansson cac43a1b7b cdc_ether: new PID for Ericsson C3607w to the whitelist (resubmit)
This patch adds a new vid/pid to the cdc_ether whitelist.

Device added:
- Ericsson Mobile Broadband variant C3607w

Signed-off-by: Torgny Johansson <torgny.johansson@gmail.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-23 01:25:01 -08:00
Anton Blanchard b5abb028e2 e1000: Fix DMA mapping error handling on RX
Check for error return from pci_map_single/pci_map_page and clean up.

With this and the previous patch the driver was able to handle a significant
percentage of errors (I set the fault injection rate to 10% and could still
download large files at a reasonable speed).

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-23 01:24:59 -08:00
Thomas Hellstrom 4e4ddd4777 drm/vmwgfx: Fix queries if no dma buffer thrashing is occuring.
Intercept query commands and apply relocations to their guest pointers.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-23 15:42:36 +10:00
Dave Airlie f7072e00f0 Merge remote branch 'nouveau/for-airlied' of ../drm-nouveau-next into drm-linus
* 'nouveau/for-airlied' of ../drm-nouveau-next:
  drm/nv50: fix vram ptes on IGPs to point at stolen system memory
  drm/nv50: fix instmem binding on IGPs to point at stolen system memory
  drm/nv50: improve vram page table construction
  drm/nv50: more efficient clearing of gpu page table entries
  drm/nv50: make nv50_mem_vm_{bind,unbind} operate only on vram
  drm/nouveau: Fix up pre-nv17 analog load detection.
2010-02-23 15:42:18 +10:00
Len Brown b2cb9dcb98 Merge branch 'pcc' into release 2010-02-23 00:39:00 -05:00
Len Brown e4f23f66ed Merge branches 'bugzilla-14207' and 'idle' into release 2010-02-23 00:19:48 -05:00
Marcin Slusarz 89f3f21990 efifb: fix framebuffer handoff
Commit 4410f39109 ("fbdev: add support for
handoff from firmware to hw framebuffers") didn't add fb_destroy
operation to efifb.  Fix it and change aperture_size to match size
passed to request_mem_region.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=15151

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Reported-by: Alex Zhavnerchik <alex.vizor@gmail.com>
Tested-by: Alex Zhavnerchik <alex.vizor@gmail.com>
Acked-by: Peter Jones <pjones@redhat.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-02-22 19:50:34 -08:00
Jens Rottmann 115079aad9 geode-mfgpt: restore previous behavior for selecting IRQ
geode-mfgpt: restore previous behavior for selecting IRQ

The MFGPT IRQ used to be, in order of decreasing priority,
 * IRQ supplied by the user as a boot-time parameter,
 * IRQ previously set by the BIOS or another driver,
 * default IRQ given at compile time.

Return to this behavior, which got broken when splitting the
MFGPT/clocksource driver for 2.6.33-rc1.

Signed-off-by: Jens Rottmann <JRottmann@LiPPERTEmbedded.de>
Acked-by: Andres Salomon <dilinger@collabora.co.uk>
Cc: Jordan Crouse <jordan.crouse@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: john stultz <johnstul@us.ibm.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-02-22 19:50:34 -08:00
Ben Skeggs 6c42966768 drm/nv50: fix vram ptes on IGPs to point at stolen system memory
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-02-23 13:50:24 +10:00
Ben Skeggs 76befb8c30 drm/nv50: fix instmem binding on IGPs to point at stolen system memory
This also modifies the unused PRAMIN PT entries to be all zeroes, can't
really recall why I used 9/0 initially, just that it didn't work for
some reason.  It was likely masking a bug elsewhere that's since been
fixed.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-02-23 13:50:21 +10:00
Ben Skeggs 531e77139f drm/nv50: improve vram page table construction
This commit changes nouveau to construct PTEs which look very much like
the ones the binary driver creates.

I presume that filling multiple PTEs identically with length flags and
the physical address of the start of a block of VRAM is a hint to the
memory controller that it need not perform additional page table lookups
for that range of addresses.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-02-23 13:50:03 +10:00
Ben Skeggs 4c27bd339d drm/nv50: more efficient clearing of gpu page table entries
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-02-23 13:49:58 +10:00
Ben Skeggs 66b6ebaccb drm/nv50: make nv50_mem_vm_{bind,unbind} operate only on vram
GART is handled elsewhere, no reason to have the code for it here too.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-02-23 13:41:16 +10:00
Francisco Jerez e7e65caefd drm/nouveau: Fix up pre-nv17 analog load detection.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-02-23 13:41:05 +10:00
Kenji Kaneshige b16694f70c PCIe PME: use pci_pcie_cap()
Use pci_pcie_cap() instead of pci_find_capability() to get PCIe
capability offset. This reduces redundant search in PCI configuration
space.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:21:21 -08:00
Rafael J. Wysocki 6cbf82148f PCI PM: Run-time callbacks for PCI bus type
Introduce run-time PM callbacks for the PCI bus type.  Make the new
callbacks work in analogy with the existing system sleep PM
callbacks, so that the drivers already converted to struct dev_pm_ops
can use their suspend and resume routines for run-time PM without
modifications.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:21:19 -08:00
Kenji Kaneshige 552be54cc4 PCIe PME: use pci_is_pcie()
Use pci_is_pcie() instead of looking at obsolete is_pcie field in
struct pci_dev.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:21:10 -08:00
Rafael J. Wysocki b67ea76172 PCI / ACPI / PM: Platform support for PCI PME wake-up
Although the majority of PCI devices can generate PMEs that in
principle may be used to wake up devices suspended at run time,
platform support is generally necessary to convert PMEs into wake-up
events that can be delivered to the kernel.  If ACPI is used for this
purpose, PME signals generated by a PCI device will trigger the ACPI
GPE associated with the device to generate an ACPI wake-up event that
we can set up a handler for, provided that everything is configured
correctly.

Unfortunately, the subset of PCI devices that have GPEs associated
with them is quite limited.  The devices without dedicated GPEs have
to rely on the GPEs associated with other devices (in the majority of
cases their upstream bridges and, possibly, the root bridge) to
generate ACPI wake-up events in response to PME signals from them.

Add ACPI platform support for PCI PME wake-up:
o Add a framework making is possible to use ACPI system notify
  handlers for run-time PM.
o Add new PCI platform callback ->run_wake() to struct
  pci_platform_pm_ops allowing us to enable/disable the platform to
  generate wake-up events for given device.  Implemet this callback
  for the ACPI platform.
o Define ACPI wake-up handlers for PCI devices and PCI root buses and
  make the PCI-ACPI binding code register wake-up notifiers for all
  PCI devices present in the ACPI tables.
o Add function pci_dev_run_wake() which can be used by PCI drivers to
  check if given device is capable of generating wake-up events at
  run time.

Developed in cooperation with Matthew Garrett <mjg@redhat.com>.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:21:02 -08:00
Rafael J. Wysocki 3f0be67188 ACPI / ACPICA: Multiple system notify handlers per device
Currently it only is possible to install one system notify handler
per namespace node, but this is not enough for PCI run-time power
management, because we need to install power management notifiers for
devices that already have hotplug notifiers installed.  While in
principle this could be handled at the PCI level, that would be
suboptimal due to the way in which the ACPI-based PCI hotplug code is
designed.

For this reason, modify ACPICA so that it is possible to install more
than one system notify handler per namespace node.  Namely, make
acpi_install_notify_handler(), acpi_remove_notify_handler() and
acpi_ev_notify_dispatch() use a list of system notify handler objects
associated with a namespace node.

Make acpi_remove_notify_handler() call acpi_os_wait_events_complete()
upfront to avoid a situation in which concurrent instance of
acpi_remove_notify_handler() removes the handler from under us while
we're waiting for the event queues to flush.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:20:56 -08:00
Rafael J. Wysocki f517709d65 ACPI / PM: Add more run-time wake-up fields
Use the run_wake flag to mark all devices for which run-time wake-up
events may be generated by the platform.  Introduce a new wake-up
flag, always_enabled, for marking devices that should be permanently
enabled to generate run-time events.  Also, introduce a reference
counter for run-wake devices and a function that will initialize all
of the run-time wake-up fields for given device.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Len Brown <len.brown@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:20:51 -08:00
Rafael J. Wysocki 9630bdd9b1 ACPI: Use GPE reference counting to support shared GPEs
ACPI GPEs may map to multiple devices.  The current GPE interface
only provides a mechanism for enabling and disabling GPEs, making
it difficult to change the state of GPEs at runtime without extensive
cooperation between devices.

Add an API to allow devices to indicate whether or not they want
their device's GPE to be enabled for both runtime and wakeup events.

Remove the old GPE type handling entirely, which gets rid of various
quirks, like the implicit disabling with GPE type setting. This
requires a small amount of rework in order to ensure that non-wake
GPEs are enabled by default to preserve existing behaviour.

Based on patches from Matthew Garrett <mjg@redhat.com>.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:20:45 -08:00
Rafael J. Wysocki c39fae1416 PCI PM: Make it possible to force using INTx for PCIe PME signaling
Apparently, some machines may have problems with PCI run-time power
management if MSIs are used for the native PCIe PME signaling.  In
particular, on the MSI Wind U-100 PCIe PME interrupts are not
generated by a PCIe root port after a resume from suspend to RAM, if
the system wake-up was triggered by a PME from the device attached to
this port.  [It doesn't help to free the interrupt on suspend and
request it back on resume, even if that is done along with disabling
the MSI and re-enabling it, respectively.]  However, if INTx
interrupts are used for this purpose on the same machine, everything
works just fine.

For this reason, add a kernel command line switch allowing one to
request that MSIs be not used for the native PCIe PME signaling,
introduce a DMI table allowing us to blacklist machines that need
this switch to be set by default and put the MSI Wind U-100 into this
table.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:20:39 -08:00
Rafael J. Wysocki c7f486567c PCI PM: PCIe PME root port service driver
PCIe native PME detection mechanism is based on interrupts generated
by root ports or event collectors every time a PCIe device sends a
PME message upstream.

Once a PME message has been sent by an endpoint device and received
by its root port (or event collector in the case of root complex
integrated endpoints), the Requester ID from the message header is
registered in the root port's Root Status register.  At the same
time, the PME Status bit of the Root Status register is set to
indicate that there's a PME to handle.  If PCIe PME interrupt is
enabled for the root port, it generates an interrupt once the PME
Status has been set.  After receiving the interrupt, the kernel can
identify the PCIe device that generated the PME using the Requester
ID from the root port's Root Status register. [For details, see PCI
Express Base Specification, Rev. 2.0.]

Implement a driver for the PCIe PME root port service working in
accordance with the above description.

Based on a patch from Shaohua Li <shaohua.li@intel.com>.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:20:31 -08:00
Rafael J. Wysocki 58ff463396 PCI PM: Add function for checking PME status of devices
Add function pci_check_pme_status() that will check the PME status
bit of given device and clear it along with the PME enable bit.  It
will be necessary for PCI run-time power management.

Based on a patch from Shaohua Li <shaohua.li@intel.com>

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:20:24 -08:00
Yinghai Lu 9958610552 PCI: set PCI_PREF_RANGE_TYPE_64 in pci_bridge_check_ranges
Make pci_bridge_check_ranges() store the PCI_PREF_RANGE_TYPE_64 in
addition to IORESOURCE_MEM_64.  Just like pci_read_bridge_bases().

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:25 -08:00
Yinghai Lu 32180e402f PCI: pciehp: second try to get big range for pcie devices
Handle the case where the slot bridge that doesn't get a pre-allocated
resource big enough to handle its child resources..  For example pcie
devices need 256M, but the bridge only gets 2M preallocated.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:25 -08:00
Yinghai Lu 9789ac979b PCI: pciehp: cleanup flow in pciehp_configure_device
Move bus_size_bridges and assign resources out of pciehp_add_bridge()
and do them all together, one time, including slot bridge, to avoid to
calling assign resources several times when there are several bridges
under the slot bridge.  Using pci_assign_unassigned_bridge_resources.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Reviewed-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:24 -08:00
Yinghai Lu 6841ec681a PCI: introduce pci_assign_unassigned_bridge_resources
For use by pciehp.

pci_setup_bridge() will not check enabled for the slot bridge, otherwise
update res is not updated to bridge BAR.  That is, bridge is already
enabled for port service.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Reviewed-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:23 -08:00
Yinghai Lu 977d17bb17 PCI: update bridge resources to get more big ranges in PCI assign unssigned
BIOS separates IO ranges between several IOHs, and on some slots, BIOS assigns
resources to a bridge, but stops assigning resources to the device under that
bridge, because the device needs a big resource.

So:
  1. allocate resources and record the failed device resources
  2. clear the BIOS assigned resources of the parent bridge of failing device
  3. go back and call pci assign unassigned
  4. if it still fails, go up the tree, clear more bridges. and try again

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:22 -08:00
Yinghai Lu d65245c329 PCI: don't shrink bridge resources
When clearing leaf bridge resources, trying to get a big enough one, we
could shrink the bridge if there is no resource under it.  Confirm
against the old resource side to make sure we're increasing the
allocation.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:21 -08:00
Yinghai Lu cd81e1ea1a PCI: reject mmio ranges starting at 0 on pci_bridge read
We already track unassigned resources in struct resource, and this
prevents us from overwriting resource flags and info in the unassigned
case.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:21 -08:00
Yinghai Lu 568ddef873 PCI: add failed_list to pci_bus_assign_resources
This allows us to track failed allocations for later re-trying with
reallocation.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Reviewed-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:20 -08:00
Yinghai Lu 5009b46025 PCI: add pci_bridge_release_resources and pci_bus_release_bridge_resources
We use this in later patches to free resrouce ranges for reassignment in
an effort to support a wider variety of PCI topologies.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Reviewed-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:19 -08:00
Andrew Morton ba02b242bb PCI hotplug: check ioremap() return value in ibmphp_ebda.c
check ioremap() return value.

Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:19 -08:00
Randy Dunlap 939fdc6735 PCI hotplug: fix ibmphp build error
Add header file to fix build error:

drivers/pci/hotplug/ibmphp_hpc.c:135: error: implicit declaration of function 'init_MUTEX'
drivers/pci/hotplug/ibmphp_hpc.c:136: error: implicit declaration of function 'init_MUTEX_LOCKED'
drivers/pci/hotplug/ibmphp_hpc.c:797: error: implicit declaration of function 'down'
drivers/pci/hotplug/ibmphp_hpc.c:807: error: implicit declaration of function 'up'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:18 -08:00
Matthew Wilcox 4fb88c1a28 PCI: Make pci_scan_slot more robust
Yinghai pointed out that the new pci_scan_slot() crashes when called
on an ARI-capable slot that is empty.  Fix this by exiting early from
pci_scan_slot if there is no device in the slot.

Also make next_ari_func() robust against devices not existing in case
the ARI capability is corrupt.  ARI also requires that the devices be
listed in order, so if we find a function listed that is out of order,
stop scanning to prevent loops.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:17 -08:00
Jiri Slaby 0bf01c3c86 PCI: hotplug/cpcihp, fix pci device refcounting
Stanse found an ommitted pci_dev_put on one error path in
cpcihp_generic_init. The path is taken on !dev, but also when
dev->hdr_type != PCI_HEADER_TYPE_BRIDGE. However it omits to
pci_dev_put on the latter.

As it is fine to pass NULL to pci_dev_put, put it in there
uncoditionally.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Scott Murray <scott@spiteful.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:02 -08:00
Tilman Schmidt 41a68a748b PCI: push deprecated pci_find_device() function to last user
The ISDN4Linux HiSax driver family contains the last remaining users
of the deprecated pci_find_device() function. This patch creates a
private copy of that function in HiSax, and removes the now unused
global function together with its controlling configuration option,
CONFIG_PCI_LEGACY.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:01 -08:00
Yinghai Lu 7c9342b8dd PCI: don't dump resource when bus resource flags indicates unused
Don't print out resources without flags to avoid cluttering up the debug
output.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:17:00 -08:00
Yinghai Lu 7cc5997d1d PCI: separate pci_setup_bridge to small functions
This is a good cleanup in itself, and makes it easier to modify specific
resource types in later code.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:16:59 -08:00
Chandru b0fc889c43 PCI hotplug: ibmphp: read the length of ebda and map entire ebda region
ibmphp driver currently maps only 1KB of ebda memory area into kernel address
space during driver initialization. This causes kernel oops when the driver is
modprobe'd and it accesses memory beyond 1KB within ebda segment. The first
byte of ebda segment actually stores the length of the ebda region in
Kilobytes. Hence make use of the length parameter and map the entire ebda
region.

Signed-off-by: Chandru Siddalingappa <chandru@linux.vnet.ibm.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:16:58 -08:00
Jiri Slaby 6fcaf17ac7 PCI hotplug: fix memory leaks
Stanse found a cut&pasted memory leak in pciehp_queue_pushbutton_work
and shpchp_queue_pushbutton_work. info is not freed/assigned on all
paths. Fix that.

Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:16:57 -08:00
Dominik Brodowski 3b7a17fcda resource/PCI: mark struct resource as const
Now that we return the new resource start position, there is no
need to update "struct resource" inside the align function.
Therefore, mark the struct resource as const.

Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:16:57 -08:00
Dominik Brodowski b26b2d494b resource/PCI: align functions now return start of resource
As suggested by Linus, align functions should return the start
of a resource, not void. An update of "res->start" is no longer
necessary.

Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:16:56 -08:00
Rafael J. Wysocki 93177a748b PCI: Clean up build for CONFIG_PCI_QUIRKS unset
Currently, drivers/pci/quirks.c is built unconditionally, but if
CONFIG_PCI_QUIRKS is unset, the only things actually built in this
file are definitions of global variables and empty functions (due to
the #ifdef CONFIG_PCI_QUIRKS embracing all of the code inside the
file).  This is not particularly nice and if someone overlooks
the #ifdef CONFIG_PCI_QUIRKS, build errors are introduced.

To clean that up, move the definitions of the global variables in
quirks.c that are always built to pci.c, move the definitions of
the empty functions (compiled when CONFIG_PCI_QUIRKS is unset) to
headers (additionally make these functions static inline) and modify
drivers/pci/Makefile so that quirks.c is only built if
CONFIG_PCI_QUIRKS is set.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:15:21 -08:00
Jesse Barnes 3804259475 PCI hotplug: remove obsolete usage of get_bus_speed from rpaphp hotplug ops
No longer needed and causes build breakage.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:15:20 -08:00
Matthew Wilcox 9dfd97fe12 PCI: Add support for reporting PCIe 3.0 speeds
Add the 8.0 GT/s speed.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:15:19 -08:00
Matthew Wilcox 45b4cdd57e PCI: Add support for AGP in cur/max bus speed
Take advantage of some gaps in the table to fit in support for AGP speeds.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:15:19 -08:00
Matthew Wilcox 9be60ca049 PCI: Add support for detection of PCIe and PCI-X bus speeds
Both PCIe and PCI-X bridges report their secondary bus speed in their
respective capabilities.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:15:18 -08:00
Matthew Wilcox 3749c51ac6 PCI: Make current and maximum bus speeds part of the PCI core
Move the max_bus_speed and cur_bus_speed into the pci_bus.  Expose the
values through the PCI slot driver instead of the hotplug slot driver.
Update all the hotplug drivers to use the pci_bus instead of their own
data structures.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:15:17 -08:00
Matthew Wilcox 536c8cb49e PCI: Unify pcie_link_speed and pci_bus_speed
These enums must not overlap anyway, since we only have a single
pci_bus_speed_strings array.  Use a single enum, and move it to
pci.h.  Add 'SPEED' to the pcie names to make it clear what they are.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:15:17 -08:00
Matthew Wilcox f07852d644 PCI: Rewrite pci_scan_slot
The Alternate Routing-ID Interpretation capability allows a single device
to have up to 256 functions.  They can be populated sparsely, so the
current technique of scanning every eighth function is not guaranteed
to find them all.  By introducing a 'next_fn' function pointer, we can
use the linked list of functions in the ARI capability to scan all the
functions which exist.

We can then speed up the pci_scan_slot by skipping the scan of subsequent
devfns for PCIe devices which are the direct children of Root Ports or
Downstream Ports.  These devices are only permitted to implement device
0, unless they are ARI devices, in which case they'll be scanned by the
ARI code above.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:15:16 -08:00
Pallipadi, Venkatesh d306ebc286 ACPI: Be in TS_POLLING state during mwait based C-state entry
ACPI deep C-state entry had a long standing bug/missing feature, wherein we were sending
resched IPIs when an idle CPU is in mwait based deep C-state. Only mwait based C1 was using
the write to the monitored address to wake up mwait'ing CPU.

This patch changes the code to retain TS_POLLING bit if we are entering an mwait based
deep C-state.

The patch has been verified to reduce the number of resched IPIs in general and also
improves the performance/power on workloads with low system utilization (i.e., when mwait based
deep C-states are being used).

Fixes "netperf ~50% regression with 2.6.33-rc1, bisect to 1b9508f"
http://marc.info/?l=linux-kernel&m=126441481427331&w=4

Reported-by: Lin Ming <ming.m.lin@intel.com>
Tested-by: Alex Shi <alex.shi@intel.com>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-02-22 13:10:14 -05:00
Linus Torvalds 627fa177a1 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: usbtouchscreen - extend coordinate range for Generaltouch devices
  Input: polldev can cause crash in case when polling disabled
2010-02-22 08:48:06 -08:00
Rafael J. Wysocki 61caf87cb5 i915 / PM: Fix hibernate regression caused by suspend/resume splitting
Commit 84b79f8d28 (drm/i915: Fix crash
while aborting hibernation) attempted to fix a regression introduced
by commit cbda12d77e (drm/i915:
implement new pm ops for i915), but it went too far trying to split
the freeze/suspend and resume/thaw parts of the code.  As a result,
it introduced another regression, which only is visible on some systems.

Fix the problem by merging i915_drm_suspend() with
i915_drm_freeze() and moving some code from i915_resume()
into i915_drm_thaw(), so that intel_opregion_free() and
intel_opregion_init() are also executed in the freeze and thaw code
paths, respectively.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-and-tested-by: Pedro Ribeiro <pedrib@gmail.com>
Tested-by: Tino Keitel <tino.keitel@tikei.de>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-02-22 08:47:14 -08:00
Stanislaw Gruszka a120e912eb iwlwifi: sanity check before counting number of tfds can be free
Check the frame control for ieee80211_is_data_qos() is true before
counting the number of tfds can be free, the tfds_in_queue only
increment when ieee80211_is_data_qos() is true before transmit; so it
should only decrement if the type match.

Remove ieee80211_is_data_qos check for frame_ctrl in tx_resp to avoid
invalid information pass from uCode.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-02-22 11:15:50 -05:00
Wey-Yi Guy a239a8b47c iwlwifi: error checking for number of tfds in queue
When receive reply_tx and ready to decrement the count for number of
tfds in queue, do error checking to prevent error condition and
tfds_in_queue become negative number.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-02-22 11:15:50 -05:00
Roy Yin eb083ba260 Input: usbtouchscreen - extend coordinate range for Generaltouch devices
Generaltouch protocol allows for coordinates in [0, 0xffff] range and
there are devices reporting coordinates as high as 0x7fff so let's update
the driver to reflect that.

Signed-off-by: Roy Yin <yhch@generaltouch.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-02-21 23:02:51 -08:00
Mike Frysinger 3dae93ec3e [WATCHDOG] bfin: fix max timeout calculation
Relying on overflow/wrap around isn't exact because if you wrap far
enough, you get back to "valid" values.

Reported-by: Thorsten Pohlmann <pohlmann@tetronik.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Cc: stable <stable@kernel.org>
2010-02-21 19:16:30 +00:00
Linus Torvalds d0708b9739 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  V4L/DVB: bttv: Move I2C IR initialization
  V4L/DVB: Video : pwc : Fix regression in pwc_set_shutter_speed caused by bad 	constant => sizeof conversion.
  soc-camera: mt9t112: modify exiting conditions from standby mode
  V4L/DVB: cxusb: Select all required frontend and tuner modules
  V4L/DVB: dvb: l64781.ko broken with gcc 4.5
2010-02-20 16:56:09 -08:00
Linus Torvalds cf7ad04300 Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm:
  ARM: allow alignment fault mode to be configured at kernel boot
  ARM: Update mach-types
  ARM: 5951/1: ARM: fix documentation of the PrimeCell bus
  ARM: 5950/1: ARM: Fix build error for arm1026ej-s processor
  MAINTAINERS: fix my e-mail and status for Gemini and FA526
  Gemini: wrong registers used to set reg_level in gpio_set_irq_type()
  ARM: 5944/1: scsi: fix timer setup in fas216.c
  ARM: 5938/1: ARM: L2: export outer_cache_fns
2010-02-20 16:55:05 -08:00
Samu Onkalo d9c4f84699 Input: polldev can cause crash in case when polling disabled
When polled input device is opened and closed and there are no other
users of polled device, the workqueue is created and destroyed in
every open / close operation. It is probable that at some point
dynamic allocation of internal parts of the workqueue cause changes to the
workqueue.

When a work is queued to the workqueue the work struct contains pointers
to the workqueue data. If the workqueue has been changed and the work
has never been queued to the new workqueue, work-struct contains pointers
to the non-existing workqueue. This will cause crash at the work
cancellation during device close since cancellation of a work assumes
that the workqueue exists.

To prevent that, work struct is cleaned up at device close. This keeps
work struct clean for the next use.

Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-02-20 01:23:55 -08:00
Linus Torvalds 4ec62b2b2e Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] megaraid_sas: fix for 32bit apps
  [SCSI] fcoe: Only rmmod fcoe.ko if there are no active connections
  [SCSI] libfcoe: Send port LKA every FIP_VN_KA_PERIOD secs.
  [SCSI] libfc: Don't assume response request present.
  [SCSI] libfc: Fix e_d_tov ns -> ms scaling factor in PLOGI response.
  [SCSI] libfc: call ddp setup for only FCP reads to avoid accessing junk fsp pointer
  [SCSI] iscsi_tcp regression: remove bogus warn on in write path
2010-02-19 19:35:20 -08:00
Linus Torvalds 8386cda3f9 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  sfc: SFE4002/SFN4112F: Widen temperature and voltage tolerances
  sfc: Fix sign of efx_mcdi_poll_reboot() error in efx_mcdi_poll()
  net-sysfs: Use rtnl_trylock in wireless sysfs methods.
  net: Fix sysctl restarts...
2010-02-19 19:34:56 -08:00
Linus Torvalds 65d76fc4b3 Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/radeon: bump the UMS driver version number to indicate rv740 fix
  drm/radeon/kms: free fence IB if it wasn't emited at IB free time
  drm/ttm: fix caching problem on non-PAT systems.
  drm/radeon/rv740: fix backend setup
  drm/radeon/kms: fix shared ddc detection
  drm/radeon/kms/rs600: add connector quirk
  vgaarb: fix "target=default" passing
2010-02-19 19:33:51 -08:00
Ben Hutchings 242cc0547f sfc: SFE4002/SFN4112F: Widen temperature and voltage tolerances
The temperature and voltage limits currently set on these boards are
too conservative and will cause the driver to stop the net device
erroneously in some systems.

Based on a review of the chip datasheets and advice from the designer
of these boards:

- Raise the maximum board temperatures to the specified maximum ambient
  temperatures for their PHYs plus the expected temperature bias of the
  board
- Raise the maximum controller temperature to 90 degrees
- Lower the minimum temperatures to 0 degrees
- Widen the voltage tolerances to at least +/- 10%

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-19 15:50:35 -08:00
Ben Hutchings e0bf54c93a sfc: Fix sign of efx_mcdi_poll_reboot() error in efx_mcdi_poll()
efx_mcdi_poll() uses positive error numbers, matching the MCDI
protocol.  It must negate the result of efx_mcdi_poll_reboot() which
returns the usual negative error numbers.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-19 15:50:35 -08:00
Dave Airlie 635f1a3129 drm/radeon: bump the UMS driver version number to indicate rv740 fix
This lets UMS userspace know the rv740 fix is in. For KMS we can
consider the kernel release to be the v2.0.0 release so we don't need the
bump there.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-20 09:17:18 +10:00
Jerome Glisse 7d404c7b5f drm/radeon/kms: free fence IB if it wasn't emited at IB free time
If at IB free time fence wasn't emited that means the IB wasn't
scheduled because an error occured somewhere, thus we can free
then fence and mark the IB as free.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-20 07:35:18 +10:00
Francisco Jerez f0e2f38bef drm/ttm: fix caching problem on non-PAT systems.
http://bugzilla.kernel.org/show_bug.cgi?id=15328

This fixes a serious regression on AGP/non-PAT systems, where
pages were ending up in the wrong state and slowing down the
whole system.

[airlied: taken this from the bug as the other option is to revert
the change which caused it].

Tested-by: John W. Linville (in bug).
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-20 07:30:15 +10:00
Alex Deucher 6a660f06e8 drm/radeon/rv740: fix backend setup
This patch fixes occlusion queries and rendering errors
on rv740 boards. Hardcoding the backend map is not an optimal
solution, but a better fix is being worked on.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-20 07:28:16 +10:00
Alex Deucher d3932d6c47 drm/radeon/kms: fix shared ddc detection
Just compare the i2c id since the i2c structs
may be slighly different.

Fixes fdo bug 26616.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-20 07:28:06 +10:00
Alex Deucher c86a903836 drm/radeon/kms/rs600: add connector quirk
rs600 board lists DVI port as HDMI.

Fixes fdo bug 26605

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-20 07:28:05 +10:00
Kyle McMartin 2cc9116c2b vgaarb: fix "target=default" passing
Commit 77c1ff3982 fixed the userspace
pointer dereference, but introduced another bug pointed out by Eugene Teo
in RH bug #564264. Instead of comparing the point we were at in the string,
we instead compared the beginning of the string to "default".

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Reported-by: Eugene Teo <eteo@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-02-20 07:28:04 +10:00
Tomas Henzl b3dc1a212e [SCSI] megaraid_sas: fix for 32bit apps
It looks like this patch -

commit 7b2519afa1
Author: Yang, Bo <Bo.Yang@lsi.com>
Date:   Tue Oct 6 14:52:20 2009 -0600

    [SCSI] megaraid_sas: fix 64 bit sense pointer truncation

has caused a problem for 32bit programs with 64bit os -

http://bugzilla.kernel.org/show_bug.cgi?id=15001

fix by converting the user space 32bit pointer to a 64 bit one when
needed.

[jejb: fix up some 64 bit warnings]
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Cc: Bo Yang <Bo.Yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 15:11:53 -06:00
Dan Halperin 5e2f75b899 iwlwifi: set HT flags after channel in rxon
The HT extension channel settings require priv->staging_rxon.channel to be
accurate. However, iwl_set_rxon_ht was being called before iwl_set_rxon_channel
and thus HT40 could be broken unless another call to iwl_mac_config came in.

This problem was recently introduced by "iwlwifi: Fix to set correct ht
configuration"

The particular setting in which I noticed this was monitor mode:

	iwconfig wlan0 mode monitor
	ifconfig wlan0 up
	./iw wlan0 set channel 64 HT40-
	#./iw wlan0 set channel 64 HT40-
	tcpdump -i wlan0 -y IEEE802_11_RADIO

would only catch HT40 packets if I issued the IW command twice.

From visual inspection, iwl_set_rxon_channel does not depend on
iwl_set_rxon_ht, so simply swapping them should be safe and fixes this problem.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-02-19 15:35:29 -05:00
Martin K. Petersen 77c9cfc51b [SCSI] Fix printing of failed 32-byte commands
Having the large CDB allocation logic in sd.c means that
scsi_io_completion does not have access to the command buffer. That in
turn causes garbage to be printed when a 32-byte command fails. Move the
command printing to sd_done where the command buffer is intact.  Clear
the command buffer pointer after the extended CDB has been freed.

Make scsi_print_command ignore commands with NULL CDB pointers to
inhibit printing of garbled command strings.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 11:15:33 -06:00
Martin K. Petersen 8475f688d7 [SCSI] Fix printing of variable length commands
We dereferenced the MAINTENANCE IN array when decoding variable length
commands.  Use the right array.  Also consolidate identical if
statements below.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 11:14:11 -06:00
Bart Van Assche 78d85019ba [SCSI] libsrp: fix bug in ADDITIONAL CDB LENGTH interpretation
Fix a bug in the interpretation of the ADDITIONAL CDB LENGTH (add_cdb_len)
field of SRP_CMD requests. According to the SRP specification, the layout
of this single-byte field is as follows:
* Bits 0 and 1 are reserved.
* Bits 2 to 7 represent the ADDITIONAL CDB LENGTH field, symbolically
  represented as n.
* Still according to the SRP specification, the ADDITIONAL CDB section
  takes 4*n bytes.

Currently libsrp is only used by the ibmvscsi driver. Since the ibmvscsi
driver doesn't support large CDB's, this bug hasn't caused any problems yet.

[jejb: use & ~3 to mask the bits]
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 11:11:07 -06:00
Brian King 22963a37b3 [SCSI] scsi_dh_alua: Add IBM Power Virtual SCSI ALUA device to dev list
Adds IBM Power Virtual SCSI ALUA devices to the ALUA device handler.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:52:54 -06:00
Mike Christie cd4a8814d4 [SCSI] scsi_dh_alua: add netapp to dev list
Newer Netapp target software supports ALUA, so
this patch adds them to the scsi_dev_alua dev list.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:51:47 -06:00
Giridhar Malavali 35b7f0a76b [SCSI] qla2xxx: Update version number to 8.03.02-k1.
Cc: stable@kernel.org
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:47:19 -06:00
Richard Lary 8c1496bda8 [SCSI] qla2xxx: EEH: Restore PCI saved state during pci slot reset.
Cc: stable@kernel.org
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:47:15 -06:00
Andrew Vasquez ae97c91eb1 [SCSI] qla2xxx: Add firmware ETS burst support.
Can be used to balance NIC/FCoE traffic distribution.

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:47:05 -06:00
Andrew Vasquez bb2d52b2fd [SCSI] qla2xxx: Correct loop-resync issues during SNS scans.
Original code could inadvertently skip the post processing of
port information returned from the SNS scan, if any link-flopping
asynchronous-events were received (noticed in FCAL topologies).

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:46:45 -06:00
Andrew Vasquez 715848ca6f [SCSI] qla2xxx: Correct use-after-free issue in terminate_rport_io callback.
The explicit logout (LOGO) issued at the end of the callback will
flush (via normal scsi_cmnd->done()) any outstanding commands
(FCP2) the firmware is holding.  While iterating through the
outstanding_cmnd array in qla2x00_abort_fcport_cmds(), locking
and unlocking of the hardware spinlock, opens-up the driver to
cases where the processed SRB (sp) could be used after the
command completed from interrupt context.

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:46:35 -06:00
Andrew Vasquez 55e5ed273d [SCSI] qla2xxx: Correct EH bus-reset handling.
Target-level resets are unlikely to complete if done after the
bus (LIP/OLS/NOS) has been reset.  Perform target-level resets,
if necessary, prior to hitting the bus.

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:45:02 -06:00
Giridhar Malavali db3ad7f885 [SCSI] qla2xxx: Proper clean-up of BSG requests when request times out.
Fix for BSG request cleanup when the request timesout.
Proper release of driver resources used for BSG request during timeout cleanup.

Cc: stable@kernel.org
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:44:52 -06:00
Sarang Radke 236b0249c2 [SCSI] qla2xxx: Initialize payload receive length in failure path of vendor commands
Since bsg_job->reply->reply_payload_rcv_len is uninitialized
in case of failure, fc-transport triggers a warning for each command
failed.

Cc: stable@kernel.org
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:44:40 -06:00
Darrick J. Wong 455c0d71d4 ACPI: Fix regression where _PPC is not read at boot even when ignore_ppc=0
Earlier, Ingo Molnar posted a patch to make it so that the kernel would avoid
reading _PPC on his broken T60.  Unfortunately, it seems that with Thomas
Renninger's patch last July to eliminate _PPC evaluations when the processor
driver loads, the kernel never actually reads _PPC at all!  This is problematic
if you happen to boot your non-T60 computer in a state where the BIOS _wants_
_PPC to be something other than zero.

So, put the _PPC evaluation back into acpi_processor_get_performance_info if
ignore_ppc isn't 1.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-02-19 01:11:48 -05:00
Carlos Corbacho 6f6ef82cc9 acer-wmi: Respect current backlight level when loading
Set the backlight to use the current brightness when loaded, rather than
always resetting the backlight to maximum brightness.

Fixes kernel bugzilla #14207

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Reported-by: Denis Mukhin <denis_mukhin@yahoo.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-02-19 00:19:26 -05:00
Jean Delvare 2434466432 V4L/DVB: bttv: Move I2C IR initialization
Move I2C IR initialization from just after I2C bus setup to right
before non-I2C IR initialization. This avoids the case where an I2C IR
device is blocking audio support (at least the PV951 suffers from
this). It is also more logical to group IR support together,
regardless of the connectivity.

This fixes bug #15184:
http://bugzilla.kernel.org/show_bug.cgi?id=15184

Signed-off-by: Jean Delvare <khali@linux-fr.org>
CC: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-19 03:19:02 -02:00
Martin Fuzzey 53f68607ca V4L/DVB: Video : pwc : Fix regression in pwc_set_shutter_speed caused by bad constant => sizeof conversion.
Regression was caused by my commit 6b35ca0d3d
which determined message size using sizeof rather than hardcoded constants.

Unfortunately pwc_set_shutter_speed reuses a 2 byte buffer for a one byte
message too so the sizeof was bogus in this case.

All other uses of sizeof checked and are ok.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@kernel.org
Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-19 03:19:02 -02:00
Kuninori Morimoto 2b59125b1b soc-camera: mt9t112: modify exiting conditions from standby mode
This polling is needed if camera is in standby mode, but current exiting
condition is inverted.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-19 03:19:01 -02:00
Ben Hutchings fc4a7f9308 V4L/DVB: cxusb: Select all required frontend and tuner modules
cxusb uses the atbm8830 and lgs8gxx (not lgs8gl5) frontends and the
max2165 tuner, so it needs to select them.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-19 03:19:01 -02:00
Richard Guenther c1db53b366 V4L/DVB: dvb: l64781.ko broken with gcc 4.5
I'm trying to fix it on the GCC side (PR43007), but the module is
quite stupid in using ULL constants to operate on u32 values:

static int apply_frontend_param (struct dvb_frontend* fe, struct
dvb_frontend_parameters *param)
{
...
 static const u32 ppm = 8000;
 u32 spi_bias;
...

 spi_bias *= 1000ULL;
 spi_bias /= 1000ULL + ppm/1000;

which causes current GCC 4.5 to emit calls to __udivdi3 for i?86 again.

This patch fixes this issue.

Signed-off-by: Richard Guenther <rguenther@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
CC: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-19 03:19:01 -02:00
Russell King 2b4f017579 Merge branch 'for-rmk' of git://gitorious.org/linux-gemini/mainline 2010-02-18 23:35:24 +00:00
Guennadi Liakhovetski b857df1acc ARM: 5944/1: scsi: fix timer setup in fas216.c
mod_timer() takes an absolute time and not a delay as its argument.

Cc: <stable@kernel.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-02-18 17:24:21 +00:00
Alan Stern ee37e09d81 [SCSI] fix duplicate removal on error path in scsi_sysfs_add_sdev
This patch (as1335) fixes a bug in scsi_sysfs_add_sdev().  Its callers
always remove the device if anything goes wrong, so it should never
remove the device.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-18 11:06:39 -06:00
Alan Stern d5469119f0 [SCSI] fix refcounting bug in scsi_get_host_dev
This patch (as1334) fixes a bug in scsi_get_host_dev().  It
incorrectly calls get_device() on the new device's target.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-18 10:52:39 -06:00
Alan Stern 75f8ee8e01 [SCSI] fix memory leak in scsi_report_lun_scan
This patch (as1333) fixes a bug in scsi_report_lun_scan().  If a
newly-allocated device can't be used, it should be deleted.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-18 10:52:10 -06:00
Linus Torvalds 83c5aac175 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: add KEY_RFKILL
  Input: i8042 - fix KBC jam during hibernate
2010-02-18 08:31:14 -08:00