14 Jul, 2008

1 commit

  • This is a functionally equivalent replacement of the current reference
    counting of struct fw_card instances. It only converts it to common
    idioms as suggested by Kristian Høgsberg:
    - struct kref replaces atomic_t as the counter.
    - wait_for_completion is used to wait for all card users to complete.

    BTW, it may make sense to count card->flush_timer and card->work as
    card users too.

    Signed-off-by: Stefan Richter

    Stefan Richter
     

19 Apr, 2008

1 commit


18 Apr, 2008

3 commits

  • Trivial change to replace more meaningless (to the untrained eye) hex
    values with defined CSR constants.

    Signed-off-by: Jarod Wilson
    Signed-off-by: Stefan Richter

    Jarod Wilson
     
  • When a device changes its configuration ROM, it announces this with a
    bus reset. firewire-core has to check which node initiated a bus reset
    and whether any unit directories went away or were added on this node.

    Tested with an IOI FWB-IDE01AB which has its link-on bit set if bus
    power is available but does not respond to ROM read requests if self
    power is off. This implements
    - recognition of the units if self power is switched on after fw-core
    gave up the initial attempt to read the config ROM,
    - shutdown of the units when self power is switched off.

    Also tested with a second PC running Linux/ieee1394. When the eth1394
    driver is inserted and removed on that node, fw-core now notices the
    addition and removal of the IPv4 unit on the ieee1394 node.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • read_bus_info_block() is repeatedly called by workqueue jobs.
    These will step on each others toes eventually if there are multiple
    workqueue threads, and we end up with corrupt config ROM images.

    Signed-off-by: Stefan Richter

    Stefan Richter
     

02 Mar, 2008

1 commit

  • "modprobe firewire-ohci; sleep .1; modprobe -r firewire-ohci" used to
    result in crashes like this:

    BUG: unable to handle kernel paging request at ffffffff8807b455
    IP: []
    PGD 203067 PUD 207063 PMD 7c170067 PTE 0
    Oops: 0010 [1] PREEMPT SMP
    CPU 0
    Modules linked in: i915 drm cpufreq_ondemand acpi_cpufreq freq_table applesmc input_polldev led_class coretemp hwmon eeprom snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss button thermal processor sg snd_hda_intel snd_pcm snd_timer snd snd_page_alloc sky2 i2c_i801 rtc [last unloaded: crc_itu_t]
    Pid: 9, comm: events/0 Not tainted 2.6.25-rc2 #3
    RIP: 0010:[] []
    RSP: 0018:ffff81007dcdde88 EFLAGS: 00010246
    RAX: ffff81007dc95040 RBX: ffff81007dee5390 RCX: 0000000000005e13
    RDX: 0000000000008c8b RSI: 0000000000000001 RDI: ffff81007dee5388
    RBP: ffff81007dc5eb40 R08: 0000000000000002 R09: ffffffff8022d05c
    R10: ffffffff8023b34c R11: ffffffff8041a353 R12: ffff81007dee5388
    R13: ffffffff8807b455 R14: ffffffff80593bc0 R15: 0000000000000000
    FS: 0000000000000000(0000) GS:ffffffff8055a000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
    CR2: ffffffff8807b455 CR3: 0000000000201000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process events/0 (pid: 9, threadinfo ffff81007dcdc000, task ffff81007dc95040)
    Stack: ffffffff8023b396 ffffffff88082524 0000000000000000 ffffffff8807d9ae
    ffff81007dc5eb40 ffff81007dc9dce0 ffff81007dc5eb40 ffff81007dc5eb80
    ffff81007dc9dce0 ffffffffffffffff ffffffff8023be87 0000000000000000
    Call Trace:
    [] ? run_workqueue+0xdf/0x1df
    [] ? worker_thread+0xd8/0xe3
    [] ? autoremove_wake_function+0x0/0x2e
    [] ? worker_thread+0x0/0xe3
    [] ? kthread+0x47/0x74
    [] ? trace_hardirqs_on_thunk+0x35/0x3a
    [] ? child_rip+0xa/0x12
    [] ? restore_args+0x0/0x3d
    [] ? kthreadd+0x14c/0x171
    [] ? kthreadd+0x14c/0x171
    [] ? kthread+0x0/0x74
    [] ? child_rip+0x0/0x12

    Code: Bad RIP value.
    RIP []
    RSP
    CR2: ffffffff8807b455
    ---[ end trace c7366c6657fe5bed ]---

    Note that this crash happened _after_ firewire-core was unloaded. The
    shared workqueue tried to run firewire-core's device initialization jobs
    or similar jobs.

    The fix makes sure that firewire-ohci and hence firewire-core is not
    unloaded before all device shutdown jobs have been completed. This is
    determined by the count of device initializations minus device releases.

    Also skip useless retries in the node initialization job if the node is
    to be shut down.

    Signed-off-by: Stefan Richter
    Signed-off-by: Jarod Wilson

    Stefan Richter
     

16 Feb, 2008

2 commits

  • This should help to interpret user reports. E.g. one can look up the
    vendor OUI (first three bytes of the GUID) and thus tell what is what.

    Also simplifies the math in the GUID sysfs attribute.

    Signed-off-by: Stefan Richter
    Signed-off-by: Jarod Wilson

    Stefan Richter
     
  • There is a race between shutdown and creation of devices: fw-core may
    attempt to add a device with the same name of an already existing
    device. http://bugzilla.kernel.org/show_bug.cgi?id=9828

    Impact of the bug: Happens rarely (when shutdown of a device coincides
    with creation of another), forces the user to unplug and replug the new
    device to get it working.

    The fix is obvious: Free the minor number *after* instead of *before*
    device_unregister(). This requires to take an additional reference of
    the fw_device as long as the IDR tree points to it.

    And while we are at it, we fix an additional race condition:
    fw_device_op_open() took its reference of the fw_device a little bit too
    late, hence was in danger to access an already invalid fw_device.

    Signed-off-by: Stefan Richter

    Stefan Richter
     

31 Jan, 2008

2 commits

  • read_rom() obtained a fresh new fw_device.generation for each read
    transaction. Hence it was able to continue reading in the middle of the
    ROM even if a bus reset happened. However the device may have modified
    the ROM during the reset. We would end up with a corrupt fetched ROM
    image then.

    Although all of this is quite unlikely, it is not impossible.
    Therefore we now restart reading the ROM if the bus generation changed.

    Note, the memory barrier in read_rom() is still necessary according to
    tests by Jarod Wilson, despite of the ->generation access being moved up
    in the call chain.

    Signed-off-by: Stefan Richter

    This is essentially what I've been beating on locally, and I've yet to hit
    another config rom read failure with it.

    Signed-off-by: Jarod Wilson

    Stefan Richter
     
  • fw_device.node_id and fw_device.generation are accessed without mutexes.
    We have to ensure that all readers will get to see node_id updates
    before generation updates.

    Fixes an inability to recognize devices after "giving up on config rom",
    https://bugzilla.redhat.com/show_bug.cgi?id=429950

    Signed-off-by: Stefan Richter

    Reviewed by Nick Piggin .

    Verified to fix 'giving up on config rom' issues on multiple system and
    drive combinations that were previously affected.

    Signed-off-by: Jarod Wilson
    Signed-off-by: Kristian Høgsberg

    Stefan Richter
     

13 Oct, 2007

1 commit

  • This changes the uevent buffer functions to use a struct instead of a
    long list of parameters. It does no longer require the caller to do the
    proper buffer termination and size accounting, which is currently wrong
    in some places. It fixes a known bug where parts of the uevent
    environment are overwritten because of wrong index calculations.

    Many thanks to Mathieu Desnoyers for finding bugs and improving the
    error handling.

    Signed-off-by: Kay Sievers
    Cc: Mathieu Desnoyers
    Cc: Cornelia Huck
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

10 Jul, 2007

1 commit

  • Use a speed probe to determine the speed over 1394b buses and of nodes
    which report a link speed less than their PHY speed.

    Log the effective maximum speed of newly created nodes in dmesg.

    Also, read the config ROM (except bus info block) at the maximum speed
    rather than S100. This isn't a real optimization though because we
    still only use quadlet read requests for the entire ROM.

    The patch also adds support for S1600 and S3200, although such hardware
    does not exist yet.

    Signed-off-by: Stefan Richter
    Signed-off-by: Kristian Høgsberg

    Stefan Richter
     

11 May, 2007

2 commits


27 Apr, 2007

2 commits


18 Apr, 2007

1 commit


29 Mar, 2007

2 commits


22 Mar, 2007

3 commits


21 Mar, 2007

3 commits


10 Mar, 2007

15 commits