diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-06-20 15:41:10 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-06-20 15:41:10 -0400 |
| commit | d5545fa0056ff2982f8a6419bd9a6ba2674deefd (patch) | |
| tree | f6f4eb4b1d7a4b3b65b2ae58c993bc456facfb45 | |
| parent | 77a189c28b44035ff1b6841df32c43af8a9e8399 (diff) | |
| parent | 9499fe2b340d19ef55c349de794db9d917e7403f (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
ieee1394: Kconfig menu touch-up
firewire: Kconfig menu touch-up
firewire: deadline for PHY config transmission
firewire: fw-ohci: unify printk prefixes
firewire: fill_bus_reset_event needs lock protection
firewire: fw-ohci: write selfIDBufferPtr before LinkControl.rcvSelfID
firewire: fw-ohci: disable PHY packet reception into AR context
firewire: fw-ohci: use of uninitialized data in AR handler
firewire: don't panic on invalid AR request buffer
| -rw-r--r-- | drivers/firewire/Kconfig | 32 | ||||
| -rw-r--r-- | drivers/firewire/fw-cdev.c | 9 | ||||
| -rw-r--r-- | drivers/firewire/fw-ohci.c | 110 | ||||
| -rw-r--r-- | drivers/firewire/fw-transaction.c | 52 | ||||
| -rw-r--r-- | drivers/ieee1394/Kconfig | 118 |
5 files changed, 180 insertions, 141 deletions
diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig index fb4d391810b6..76f26710fc16 100644 --- a/drivers/firewire/Kconfig +++ b/drivers/firewire/Kconfig | |||
| @@ -1,28 +1,26 @@ | |||
| 1 | comment "An alternative FireWire stack is available with EXPERIMENTAL=y" | 1 | comment "A new alternative FireWire stack is available with EXPERIMENTAL=y" |
| 2 | depends on EXPERIMENTAL=n | 2 | depends on EXPERIMENTAL=n |
| 3 | 3 | ||
| 4 | comment "Enable only one of the two stacks, unless you know what you are doing" | ||
| 5 | depends on EXPERIMENTAL | ||
| 6 | |||
| 4 | config FIREWIRE | 7 | config FIREWIRE |
| 5 | tristate "IEEE 1394 (FireWire) support - alternative stack, EXPERIMENTAL" | 8 | tristate "New FireWire stack, EXPERIMENTAL" |
| 6 | depends on EXPERIMENTAL | 9 | depends on EXPERIMENTAL |
| 7 | select CRC_ITU_T | 10 | select CRC_ITU_T |
| 8 | help | 11 | help |
| 9 | This is the "Juju" FireWire stack, a new alternative implementation | 12 | This is the "Juju" FireWire stack, a new alternative implementation |
| 10 | designed for robustness and simplicity. You can build either this | 13 | designed for robustness and simplicity. You can build either this |
| 11 | stack, or the classic stack (the ieee1394 driver, ohci1394 etc.) | 14 | stack, or the old stack (the ieee1394 driver, ohci1394 etc.) or both. |
| 12 | or both. Please read http://wiki.linux1394.org/JujuMigration before | 15 | Please read http://wiki.linux1394.org/JujuMigration before you |
| 13 | you enable the new stack. | 16 | enable the new stack. |
| 14 | 17 | ||
| 15 | To compile this driver as a module, say M here: the module will be | 18 | To compile this driver as a module, say M here: the module will be |
| 16 | called firewire-core. It functionally replaces ieee1394, raw1394, | 19 | called firewire-core. It functionally replaces ieee1394, raw1394, |
| 17 | and video1394. | 20 | and video1394. |
| 18 | 21 | ||
| 19 | NOTE: | ||
| 20 | |||
| 21 | You should only build ONE of the stacks, unless you REALLY know what | ||
| 22 | you are doing. | ||
| 23 | |||
| 24 | config FIREWIRE_OHCI | 22 | config FIREWIRE_OHCI |
| 25 | tristate "Support for OHCI FireWire host controllers" | 23 | tristate "OHCI-1394 controllers" |
| 26 | depends on PCI && FIREWIRE | 24 | depends on PCI && FIREWIRE |
| 27 | help | 25 | help |
| 28 | Enable this driver if you have a FireWire controller based | 26 | Enable this driver if you have a FireWire controller based |
| @@ -33,12 +31,12 @@ config FIREWIRE_OHCI | |||
| 33 | called firewire-ohci. It replaces ohci1394 of the classic IEEE 1394 | 31 | called firewire-ohci. It replaces ohci1394 of the classic IEEE 1394 |
| 34 | stack. | 32 | stack. |
| 35 | 33 | ||
| 36 | NOTE: | 34 | NOTE: |
| 37 | 35 | ||
| 38 | You should only build ohci1394 or firewire-ohci, but not both. | 36 | You should only build either firewire-ohci or the old ohci1394 driver, |
| 39 | If you nevertheless want to install both, you should configure them | 37 | but not both. If you nevertheless want to install both, you should |
| 40 | only as modules and blacklist the driver(s) which you don't want to | 38 | configure them only as modules and blacklist the driver(s) which you |
| 41 | have auto-loaded. Add either | 39 | don't want to have auto-loaded. Add either |
| 42 | 40 | ||
| 43 | blacklist firewire-ohci | 41 | blacklist firewire-ohci |
| 44 | or | 42 | or |
| @@ -60,7 +58,7 @@ config FIREWIRE_OHCI_DEBUG | |||
| 60 | default y | 58 | default y |
| 61 | 59 | ||
| 62 | config FIREWIRE_SBP2 | 60 | config FIREWIRE_SBP2 |
| 63 | tristate "Support for storage devices (SBP-2 protocol driver)" | 61 | tristate "Storage devices (SBP-2 protocol)" |
| 64 | depends on FIREWIRE && SCSI | 62 | depends on FIREWIRE && SCSI |
| 65 | help | 63 | help |
| 66 | This option enables you to use SBP-2 devices connected to a | 64 | This option enables you to use SBP-2 devices connected to a |
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c index dda14015e873..c639915fc3cb 100644 --- a/drivers/firewire/fw-cdev.c +++ b/drivers/firewire/fw-cdev.c | |||
| @@ -205,6 +205,7 @@ fw_device_op_read(struct file *file, | |||
| 205 | return dequeue_event(client, buffer, count); | 205 | return dequeue_event(client, buffer, count); |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | /* caller must hold card->lock so that node pointers can be dereferenced here */ | ||
| 208 | static void | 209 | static void |
| 209 | fill_bus_reset_event(struct fw_cdev_event_bus_reset *event, | 210 | fill_bus_reset_event(struct fw_cdev_event_bus_reset *event, |
| 210 | struct client *client) | 211 | struct client *client) |
| @@ -214,7 +215,6 @@ fill_bus_reset_event(struct fw_cdev_event_bus_reset *event, | |||
| 214 | event->closure = client->bus_reset_closure; | 215 | event->closure = client->bus_reset_closure; |
| 215 | event->type = FW_CDEV_EVENT_BUS_RESET; | 216 | event->type = FW_CDEV_EVENT_BUS_RESET; |
| 216 | event->generation = client->device->generation; | 217 | event->generation = client->device->generation; |
| 217 | smp_rmb(); /* node_id must not be older than generation */ | ||
| 218 | event->node_id = client->device->node_id; | 218 | event->node_id = client->device->node_id; |
| 219 | event->local_node_id = card->local_node->node_id; | 219 | event->local_node_id = card->local_node->node_id; |
| 220 | event->bm_node_id = 0; /* FIXME: We don't track the BM. */ | 220 | event->bm_node_id = 0; /* FIXME: We don't track the BM. */ |
| @@ -274,6 +274,7 @@ static int ioctl_get_info(struct client *client, void *buffer) | |||
| 274 | { | 274 | { |
| 275 | struct fw_cdev_get_info *get_info = buffer; | 275 | struct fw_cdev_get_info *get_info = buffer; |
| 276 | struct fw_cdev_event_bus_reset bus_reset; | 276 | struct fw_cdev_event_bus_reset bus_reset; |
| 277 | struct fw_card *card = client->device->card; | ||
| 277 | unsigned long ret = 0; | 278 | unsigned long ret = 0; |
| 278 | 279 | ||
| 279 | client->version = get_info->version; | 280 | client->version = get_info->version; |
| @@ -299,13 +300,17 @@ static int ioctl_get_info(struct client *client, void *buffer) | |||
| 299 | client->bus_reset_closure = get_info->bus_reset_closure; | 300 | client->bus_reset_closure = get_info->bus_reset_closure; |
| 300 | if (get_info->bus_reset != 0) { | 301 | if (get_info->bus_reset != 0) { |
| 301 | void __user *uptr = u64_to_uptr(get_info->bus_reset); | 302 | void __user *uptr = u64_to_uptr(get_info->bus_reset); |
| 303 | unsigned long flags; | ||
| 302 | 304 | ||
| 305 | spin_lock_irqsave(&card->lock, flags); | ||
| 303 | fill_bus_reset_event(&bus_reset, client); | 306 | fill_bus_reset_event(&bus_reset, client); |
| 307 | spin_unlock_irqrestore(&card->lock, flags); | ||
| 308 | |||
| 304 | if (copy_to_user(uptr, &bus_reset, sizeof(bus_reset))) | 309 | if (copy_to_user(uptr, &bus_reset, sizeof(bus_reset))) |
| 305 | return -EFAULT; | 310 | return -EFAULT; |
| 306 | } | 311 | } |
| 307 | 312 | ||
| 308 | get_info->card = client->device->card->index; | 313 | get_info->card = card->index; |
| 309 | 314 | ||
| 310 | return 0; | 315 | return 0; |
| 311 | } | 316 | } |
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c index 4f02c55f13e1..0b66306af479 100644 --- a/drivers/firewire/fw-ohci.c +++ b/drivers/firewire/fw-ohci.c | |||
| @@ -265,27 +265,25 @@ static void log_irqs(u32 evt) | |||
| 265 | !(evt & OHCI1394_busReset)) | 265 | !(evt & OHCI1394_busReset)) |
| 266 | return; | 266 | return; |
| 267 | 267 | ||
| 268 | printk(KERN_DEBUG KBUILD_MODNAME ": IRQ " | 268 | fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, |
| 269 | "%08x%s%s%s%s%s%s%s%s%s%s%s%s%s\n", | 269 | evt & OHCI1394_selfIDComplete ? " selfID" : "", |
| 270 | evt, | 270 | evt & OHCI1394_RQPkt ? " AR_req" : "", |
| 271 | evt & OHCI1394_selfIDComplete ? " selfID" : "", | 271 | evt & OHCI1394_RSPkt ? " AR_resp" : "", |
| 272 | evt & OHCI1394_RQPkt ? " AR_req" : "", | 272 | evt & OHCI1394_reqTxComplete ? " AT_req" : "", |
| 273 | evt & OHCI1394_RSPkt ? " AR_resp" : "", | 273 | evt & OHCI1394_respTxComplete ? " AT_resp" : "", |
| 274 | evt & OHCI1394_reqTxComplete ? " AT_req" : "", | 274 | evt & OHCI1394_isochRx ? " IR" : "", |
| 275 | evt & OHCI1394_respTxComplete ? " AT_resp" : "", | 275 | evt & OHCI1394_isochTx ? " IT" : "", |
| 276 | evt & OHCI1394_isochRx ? " IR" : "", | 276 | evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "", |
| 277 | evt & OHCI1394_isochTx ? " IT" : "", | 277 | evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "", |
| 278 | evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "", | 278 | evt & OHCI1394_cycle64Seconds ? " cycle64Seconds" : "", |
| 279 | evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "", | 279 | evt & OHCI1394_regAccessFail ? " regAccessFail" : "", |
| 280 | evt & OHCI1394_cycle64Seconds ? " cycle64Seconds" : "", | 280 | evt & OHCI1394_busReset ? " busReset" : "", |
| 281 | evt & OHCI1394_regAccessFail ? " regAccessFail" : "", | 281 | evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt | |
| 282 | evt & OHCI1394_busReset ? " busReset" : "", | 282 | OHCI1394_RSPkt | OHCI1394_reqTxComplete | |
| 283 | evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt | | 283 | OHCI1394_respTxComplete | OHCI1394_isochRx | |
| 284 | OHCI1394_RSPkt | OHCI1394_reqTxComplete | | 284 | OHCI1394_isochTx | OHCI1394_postedWriteErr | |
| 285 | OHCI1394_respTxComplete | OHCI1394_isochRx | | 285 | OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds | |
| 286 | OHCI1394_isochTx | OHCI1394_postedWriteErr | | 286 | OHCI1394_regAccessFail | OHCI1394_busReset) |
| 287 | OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds | | ||
| 288 | OHCI1394_regAccessFail | OHCI1394_busReset) | ||
| 289 | |||
