V4L/DVB: firedtv: do not DMA-map stack addresses
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Wed, 18 Nov 2009 19:02:01 +0000 (16:02 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 26 Feb 2010 18:10:48 +0000 (15:10 -0300)
commit3fb80ef3bc0f2b1008e14f695dcb32415cbacc90
treeaa8942280f3ba48241f531c2302d9efbe69ebcca
parent9420048c6e3ce43b428cb5965ba0d568bc145978
V4L/DVB: firedtv: do not DMA-map stack addresses

This is a portability fix and reduces stack usage.

The DMA mapping API cannot map on-stack addresses, as explained in
Documentation/DMA-mapping.txt.  Convert the two cases of on-stack packet
payload buffers in firedtv (payload of write requests in avc_write and
of lock requests in cmp_lock) to slab-allocated memory.

We use the 512 bytes sized FCP frame buffer in struct firedtv for this
purpose.  Previously it held only incoming FCP responses, now it holds
pending FCP requests and is then overwriten by an FCP response from the
tuner subunit.  Ditto for CMP lock requests and responses.  Accesses to
the payload buffer are serialized by fdtv->avc_mutex.

As a welcome side effect, stack usage of the AV/C transaction functions
is reduced by 512 bytes.

Alas, avc_register_remote_control() is a special case:  It previously
did not wait for a response.  To fit better in with the other FCP
transactions, let it wait for an interim response.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/firewire/firedtv-1394.c
drivers/media/dvb/firewire/firedtv-avc.c
drivers/media/dvb/firewire/firedtv-dvb.c
drivers/media/dvb/firewire/firedtv-fw.c
drivers/media/dvb/firewire/firedtv.h