dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

17 Commits

Author SHA1 Message Date
Alexey Khoroshilov f3033aecf2 [media] dib9000: implement error handling for DibAcquireLock
DibAcquireLock() is implemented as mutex_lock_interruptible()
but the driver does not handle unsuccessful locking.
As a result it may lead to unlock of an unheld mutex.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:36:24 -03:00
Alexey Khoroshilov 9bb24a7e49 [media] dib9000: fix explicit lock mismatches
There are several error paths, where &state->platform.risc.mem_mbx_lock
is not unlocked. The patch fixes it.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:36:17 -03:00
Mauro Carvalho Chehab 7581e61d8d [media] dvb: Remove ops->info.type from frontends
Now that this field is deprecated, and core generates it for
DVBv3 calls, remove it from the drivers.

It also adds .delsys on the few drivers where this were missed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 17:30:34 -02:00
Mauro Carvalho Chehab 7c61d80a9b [media] dvb: don't require a parameter for get_frontend
Just like set_frontend, use the dvb cache properties for get_frontend.
This is more consistent, as both functions are now symetric. Also,
at the places get_frontend is called, it makes sense to update the
cache.

Most of this patch were generated by this small perl script:

	while (<>) { $file .= $_; }
	if ($file =~ m/\.get_frontend\s*=\s*([\d\w_]+)/) {
		my $get = $1;
		$file =~ s/($get)(\s*\([^\,\)]+)\,\s*struct\s+dtv_frontend_properties\s*\*\s*([_\d\w]+)\)\s*\{/\1\2)\n{\n\tstruct dtv_frontend_properties *\3 = &fe->dtv_property_cache;/g;
	}
	print $file;

Of course, the changes at dvb_frontend.[ch] were made by hand,
as well as the changes on a few other places, where get_frontend()
is called internally inside the driver.

On some places, get_frontend() were just a void function. Those
occurrences were removed, as the DVB core handles such cases.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 10:28:23 -02:00
Mauro Carvalho Chehab f20b12ecb4 [media] dib9000: get rid of unused dvb_frontend_parameters
This parameter is passed as NULL, and it is never used. Just
remove it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 09:17:05 -02:00
Mauro Carvalho Chehab 9e9c5bf73f [media] dib9000: Get rid of the remaining DVBv3 legacy stuff
dib9000 is almost ok, with regards to the usage of DVBv5 parameters.
It has just a few stuff using the old way, at set_frontend.

Replace them by the DVBv5 way, and add the delivery system.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 09:16:14 -02:00
Mauro Carvalho Chehab 759e236c5f [media] dib9000: remove unused parameters
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 09:15:45 -02:00
Mauro Carvalho Chehab a689e3657d [media] dvb-core: add support for a DVBv5 get_frontend() callback
Creates a DVBv5 get_frontend call, renaming the DVBv3 one to
get_frontend_legacy(), while not all frontends are converted.

After the conversion for all drivers, get_frontend_legacy()
will be removed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 09:10:49 -02:00
Mauro Carvalho Chehab bc9cd2736b [media] Rename set_frontend fops to set_frontend_legacy
Passing DVBv3 parameters to set_frontend is not fun, as the
core doesn't have any way to know if the driver is using the
v3 or v5 parameters. So, rename the callback and add a new
one to allow distinguish between a mixed v3/v5 paramenter call
from a pure v5 call.

After having all frontends to use the new way, the legacy
call can be removed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 09:09:43 -02:00
Dan Carpenter 2f4cf2c3a9 [media] dib9000: release a lock on error
This lock should be released as well on the error path.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Patrick Boettcher <Patrick.Boettcher@dibcom.fr>
Cc: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-30 13:32:56 -03:00
Dan Carpenter 2f098cb1c8 [media] dib9000: return error code on failure
The ret = -EIO needs to be before the goto.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03 13:08:20 -03:00
Patrick Boettcher 79fcce3230 [media] DiBcom: protect the I2C bufer access
This patch protects the I2C buffer access in order to manage concurrent
access. This protection is done using mutex.
Furthermore, for the dib9000, if a pid filtering command is
received during the tuning, this pid filtering command is delayed to
avoid any concurrent access issue.

Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Florian Mickler <florian@mickler.org>
Cc: stable@kernel.org
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <Patrick.Boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 09:25:15 -03:00
Olivier Grenie 5a0deeed57 [media] DiBxxxx: get rid of DMA buffer on stack
This patch removes the remaining on-stack buffer for USB DMA transfer.
This patch also reduces the stack memory usage.

Cc: stable@kernel.org
Cc: Florian Mickler <florian@mickler.org>
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20 09:30:52 -03:00
Jesper Juhl 451a51b218 [media] DVB, DiB9000: Fix leak in dib9000_attach()
If the second memory allocation in dib9000_attach() fails, we'll leak the
memory allocated by the first.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20 09:28:45 -03:00
Dan Carpenter b00aff6a36 [media] dib9000: fix return type in dib9000_mbx_send_attr()
dib9000_mbx_send_attr() returns an int.  It doesn't work to save
negative error codes in an unsigned char, so I've made "ret" an int
type.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:32:39 -03:00
Olivier Grenie b4d6046e84 [media] DiBxxxx: Codingstype updates
This patchs fix several conding-style violations.

Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:43 -03:00
Olivier Grenie dd316c6bac [media] DIB9000: initial support added
This patchs add initial support for the DiB9000-device. This
demodulator is firmware-driven.

Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:41 -03:00