- May 18, 2010
-
-
Peter Hurley authored
fw_core_handle_response() was not properly clearing tlabel_mask. This was resulting in premature tlabel exhaustion. Signed-off-by:
Peter Hurley <phurley@charter.net> This fixes an omission in 2.6.31-rc1 commit 1e626fdc "firewire: core: use more outbound tlabels" which prevented to really use 64 instead of 32 transaction labels, as soon as split transactions occurred that had their AR-resp tasklet run after the AT-req tasklet. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Apr 19, 2010
-
-
Clemens Ladisch authored
If one request is so long-lived that it does not get a response before the following 63 requests, its bit in tlabel_mask is still set when the next request tries to allocate a transaction label for that number. In this state, while the first request is not completed or timed out, no new requests can be submitted. To fix this, skip over any label still in use, and do not error out unless we have entirely run out of labels. Signed-off-by:
Clemens Ladisch <clemens@ladisch.de> Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Feb 20, 2010
-
-
Stefan Richter authored
The current implementation of Bus_Time read access was buggy since it did not ensure that Bus_Time.second_count_hi and second_count_lo came from the same 128 seconds period. Reported-by:
Håkan Johansson <f96hajo@chalmers.se> Instead of a fix, remove Bus_Time register support altogether. The spec requires all cycle master capable nodes to implement this (all Linux nodes are cycle master capable) while it also says that it "may" be initialized by the bus manager or by the IRM standing in for a bus manager. (Neither Linux' firewire-core nor ieee1394 nodemgr implement this.) Since we cannot rely on Bus_Time having been initialized by a bus manager, it is better to return an error instead of a nonsensical value on a read request to Bus_Time. Alternatively, we could fix the Bus_Time read integrity bug _and_ implement (a) cycle master's write support of the register as well as (b) bus manager's Bus_Time initialization service, i.e. preservation of the Bus_Time when the cycle master node of a bus changes. However, that would be quite some code for a feature that is unreliable to begin with and very likely unused in practice. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Dec 29, 2009
-
-
Clemens Ladisch authored
Control of more than one AV/C device at once --- e.g. camcorders, tape decks, audio devices, TV tuners --- failed or worked only unreliably, depending on driver implementation. This affected kernelspace and userspace drivers alike and was caused by firewire-core's inability to accept multiple registrations of FCP listeners. The fix allows multiple address handlers to be registered for the FCP command and response registers. When a request for these registers is received, all handlers are invoked, and the Firewire response is generated by the core and not by any handler. The cdev API does not change, i.e., userspace is still expected to send a response for FCP requests; this response is silently ignored. Signed-off-by:
Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (changelog, rebased, whitespace)
-
- Oct 31, 2009
-
-
Stefan Richter authored
I was told that there are obscure architectures with non-coherent DMA which may DMA-map to bus address 0. We shall not use 0 as a magic number of uninitialized bus address variables. The packet->payload_length > 0 test cannot be used either (except in at_context_queue_packet) because local requests are not DMA-mapped regardless of payload_length. Hence add a state flag to struct fw_packet. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
In the code path which creates request packets, clearly mark a switch branch which must never be reached with a WARN. In the code path which creates response packets, replace a BUG by a friendlier to debug WARN. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Oct 14, 2009
-
-
Stefan Richter authored
The Topology Map of the local node was created in CPU byte order, then a temporary big endian copy was created to compute the CRC, and when a read request to the Topology Map arrived it had to be converted to big endian byte order again. We now generate it in big endian byte order in the first place. This also rids us of 1000 bytes stack usage in tasklet context. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Sep 12, 2009
-
-
Stefan Richter authored
This register is 1 kBytes large. Adjust topology_map.length to prevent registration of other response handlers in this region and to make sure that we respond to requests to the upper half of the register. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Jun 14, 2009
-
-
Stefan Richter authored
Tlabel is a 6 bits wide datum. Wrap it after 63 rather than 31 for more safety against transaction label exhaustion and potential responders' transaction layer bugs. (As noted by Guus Sliepen, this change requires an expansion of tlabel_mask to 64 bits.) Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Jun 05, 2009
-
-
Stefan Richter authored
The source files of firewire-core, firewire-ohci, firewire-sbp2, i.e. "drivers/firewire/fw-*.c" are renamed to "drivers/firewire/core-*.c", "drivers/firewire/ohci.c", "drivers/firewire/sbp2.c". The old fw- prefix was redundant to the directory name. The new core- prefix distinguishes the files according to which driver they belong to. This change comes a little late, but still before further firewire drivers are added as anticipated RSN. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
The three header files of firewire-core, i.e. "drivers/firewire/fw-device.h", "drivers/firewire/fw-topology.h", "drivers/firewire/fw-transaction.h", are replaced by "drivers/firewire/core.h", "include/linux/firewire.h". The latter includes everything which a firewire high-level driver (like firewire-sbp2) needs besides linux/firewire-constants.h, while core.h contains the rest which is needed by firewire-core itself and by low- level drivers (card drivers) like firewire-ohci. High-level drivers can now also reside outside of drivers/firewire without having to add drivers/firewire to the header file search path in makefiles. At least the firedtv driver will be such a driver. I also considered to spread the contents of core.h over several files, one for each .c file where the respective implementation resides. But it turned out that most core .c files will end up including most of the core .h files. Also, the combined core.h isn't unreasonably big, and it will lose more of its contents to linux/firewire.h anyway soon when more firewire drivers are added. (IP-over-1394, firedtv, and there are plans for one or two more.) Furthermore, fw-ohci.h is renamed to ohci.h. The name of core.h and ohci.h is chosen with regard to name changes of the .c files in a follow-up change. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
Include required headers which were only indirectly included. Remove unused includes and an unused constant. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Mar 24, 2009
-
-
Stefan Richter authored
All callers inserted NULL and 0 here. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
This changes the as yet unreleased FW_CDEV_IOC_SEND_STREAM_PACKET ioctl to generate an fw_cdev_event_response event just like the other two ioctls for asynchronous request transmission do. This way, clients get feedback on successful or unsuccessful transmission. This also adds input validation for length, tag, channel, sy, speed. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Jay Fenlason authored
Allow userspace and other firewire drivers (fw-ipv4 I'm looking at you!) to send Asynchronous Transmit Streams as described in 7.8.3 of release 1.1 of the 1394 Open Host Controller Interface Specification. Signed-off-by:
Jay Fenlason <fenlason@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (tweaks)
-
Stefan Richter authored
It's called "payload" rather than "data" almost everywhere in fw-transaction.c. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
type function_name(parameters); is nice to look at but was not used consistently. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
"ret" is the new "retval". Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
This code never changes. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
Like before my commit 1415d918, fw_core_add_address_handler() does not align the address region now. Instead the caller is required to pass valid parameters. Since one of the callers of fw_core_add_address_handler() is the cdev userspace interface, we now check for valid input. If the client is buggy, we give it a hint with -EINVAL. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Jan 04, 2009
-
-
Stefan Richter authored
Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Dec 10, 2008
-
-
Stefan Richter authored
There is a DMA map/ unmap imbalance whenever a block write request packet is sent and then dequeued with ohci_cancel_packet. The latter may happen frequently if the AR resp tasklet is executed before the AT req tasklet for the same transaction. Add the missing dma_unmap_single. This fixes https://bugzilla.redhat.com/show_bug.cgi?id=475156 Reported-by: Emmanuel Kowalski Tested-by: Emmanuel Kowalski Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Oct 15, 2008
-
-
Jay Fenlason authored
Share code between fw_send_request + wait_for_completion callers. Signed-off-by:
Jay Fenlason <fenlason@redhat.com> Addendum: Removes an unnecessary struct and an ununsed retry loop. Calls it fw_run_transaction() instead of fw_send_request_sync(). Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de> Acked-by:
Kristian Høgsberg <krh@redhat.com>
-
- Jul 25, 2008
-
-
Stefan Richter authored
Use only statically allocated data for PHY config packet transmission. With the previous incarnation, some data wouldn't be freed if the packet transmit callback was never called. A theoretical drawback now is that, in PCs with more than one card, card A may complete() for a waiter on card B. But this is highly unlikely and its impact not serious. Bus manager B may reset bus B before the PHY config went out, but the next phy config on B should be fine. However, with a timeout of 100ms, this situation is close to impossible. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Jul 14, 2008
-
-
Stefan Richter authored
- better name for a function argument - removal of a local variable which became unnecessary after "fully initialize fw_transaction before marking it pending" Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
In theory, card->flush_timer could already access a transaction between fw_send_request()'s spin_unlock_irqrestore and the rest of what happens in fw_send_request(). This would happen if the process which sends the request is preempted and put to sleep right after spin_unlock_irqrestore for longer than 100ms. Therefore we fill in everything in struct fw_transaction at which the flush_timer might look at before we lift the lock. To do: Ensure that the timer does not pick up the transaction before the time of the AT request event plus split transaction timeout. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
Contrary to a comment in the source, request->ack of a broadcast write request can be ACK_PENDING. Hence the existing check is insufficient. Debug dmesg before: AR spd 0 tl 00, ffc0 -> ffff, ack_pending , QW req, fffff0000234 = ffffffff AT spd 0 tl 00, ffff -> ffc0, ack_complete, W resp And the requesting node (linux1394) reports an unsolicited response. Debug dmesg after: AR spd 0 tl 00, ffc0 -> ffff, ack_pending , QW req, fffff0000234 = ffffffff Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
See IEEE 1394a clause 8.3.2.3.11. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Jun 18, 2008
-
-
Stefan Richter authored
If the low-level driver failed to initialize a card properly without noticing it, fw-core was blocked indefinitely when trying to send a PHY config packet. This hung up the events kernel thread, e.g. locked up keyboard input. https://bugzilla.redhat.com/show_bug.cgi?id=444694 https://bugzilla.redhat.com/show_bug.cgi?id=446763 This problem was introduced between 2.6.25 and 2.6.26-rc1 by commit 2a0a2590 "firewire: wait until PHY configuration packet was transmitted (fix bus reset loop)". The solution is to wait with timeout. I tested it with 7 different working controllers and 1 non-working controller. On the working ones, the packet callback complete()s usually --- but not always --- before a timeout of 10ms. Hence I chose a safer timeout of 100ms. On the few tests with the non-working controller ALi M5271, PHY config packet transmission always timed out so far. (Fw-ohci needs to be fixed for this controller independently of this deadline fix. Often the core doesn't even attempt to send a phy config because not even self ID reception works.) Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
BUG() at this place is wrong. (Unless if the low level driver would already do higher-level input validation of incoming request headers.) Invalid incoming requests or bugs in the controller which corrupt the AR-req buffer needlessly crashed the box because this is run in tasklet context. Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Apr 18, 2008
-
-
Matthew Wilcox authored
None of these files use any of the functionality promised by asm/semaphore.h. It's possible that they rely on it dragging in some unrelated header file, but I can't build all these files, so we'll have fix any build failures as they come up. Signed-off-by:
Matthew Wilcox <willy@linux.intel.com>
-
Adrian Bunk authored
This patch contains the following cleanups: - #if 0 the following unused structs: - fw-transaction.c:fw_low_memory_region - fw-transaction.c:fw_private_region - fw-transaction.c:fw_csr_region - fw-transaction.c:fw_unit_space_region - remove the following unused EXPORT_SYMBOL's: - fw-card.c:fw_core_add_descriptor - fw-card.c:fw_core_remove_descriptor - fw-iso.c:fw_iso_context_create - fw-iso.c:fw_iso_context_destroy - fw-iso.c:fw_iso_context_start - fw-iso.c:fw_iso_context_queue - fw-iso.c:fw_iso_context_stop Signed-off-by:
Adrian Bunk <bunk@kernel.org> Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Stefan Richter authored
We now exit fw_send_phy_config /after/ the PHY config packet has been transmitted, instead of before. A subsequent fw_core_initiate_bus_reset will therefore not overlap with the transmission. This is meant to make the send PHY config packet + reset bus routine more deterministic. Fixes bus reset loop and eventual panic with - VIA VT6307 + IOGEAR hub + Unibrain Fire-i camera http://bugzilla.kernel.org/show_bug.cgi?id=10128 - JMicron card Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by:
Jarod Wilson <jwilson@redhat.com>
-
Jarod Wilson authored
for code efficiency. Signed-off-by:
Jarod Wilson <jwilson@redhat.com> Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Jarod Wilson authored
Trivial change to replace more meaningless (to the untrained eye) hex values with defined CSR constants. Signed-off-by:
Jarod Wilson <jwilson@redhat.com> Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
- Mar 20, 2008
-
-
Stefan Richter authored
This fixes a use-after-free bug in the handling of split transactions. The AT DMA handler of the request was occasionally executed after the AR DMA handler of the response. The AT DMA handler then accessed an already freed packet. Reported by Johannes Berg. http://bugzilla.kernel.org/show_bug.cgi?id=9617 Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de> Tested-by:
Johannes Berg <johannes@sipsolutions.net> Signed-off-by:
Jarod Wilson <jwilson@redhat.com>
-
- Mar 13, 2008
-
-
Stefan Richter authored
Kills warnings from 'make C=1 CHECKFLAGS="-D__CHECK_ENDIAN__" modules': drivers/firewire/fw-transaction.c:771:10: warning: incorrect type in assignment (different base types) drivers/firewire/fw-transaction.c:771:10: expected unsigned int [unsigned] [usertype] <noident> drivers/firewire/fw-transaction.c:771:10: got restricted unsigned int [usertype] <noident> drivers/firewire/fw-transaction.h:93:10: warning: incorrect type in assignment (different base types) drivers/firewire/fw-transaction.h:93:10: expected unsigned int [unsigned] [usertype] <noident> drivers/firewire/fw-transaction.h:93:10: got restricted unsigned int [usertype] <noident> drivers/firewire/fw-ohci.c:1490:8: warning: restricted degrades to integer drivers/firewire/fw-ohci.c:1490:35: warning: restricted degrades to integer drivers/firewire/fw-ohci.c:1516:5: warning: cast to restricted type Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by:
Jarod Wilson <jwilson@redhat.com>
-
- Jan 30, 2008
-
-
Jarod Wilson authored
Replace an unnecessary subtraction with a bitwise AND when determining the value of ext_tcode in fw_fill_transaction() to save a cpu cycle or two in a somewhat critical path. Signed-off-by:
Jarod Wilson <jwilson@redhat.com> Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-
Rabin Vincent authored
Fix extraction of the source node id from the packet header. Signed-off-by:
Rabin Vincent <rabin@rab.in> Signed-off-by:
Stefan Richter <stefanr@s5r6.in-berlin.de>
-