11 May, 2011

5 commits

  • firewire-sbp2 already takes care for internal serialization where
    required (ORB list accesses), and it does not use cmd->serial_number
    internally. Hence it is safe to not grab the shost lock around
    queuecommand.

    While we are at housekeeping, drop a redundant struct member:
    sbp2_command_orb.done is set once in a hot path and dereferenced once in
    a hot path. We can as well dereference sbp2_command_orb.cmd->scsi_done
    instead.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • firewire-core manages the following types of work items:

    fw_card.br_work:
    - resets the bus on a card and possibly sends a PHY packet before that
    - does not sleep for long or not at all
    - is scheduled via fw_schedule_bus_reset() by
    - firewire-ohci's pci_probe method
    - firewire-ohci's set_config_rom method, called by kernelspace
    protocol drivers and userspace drivers which add/remove
    Configuration ROM descriptors
    - userspace drivers which use the bus reset ioctl
    - itself if the last reset happened less than 2 seconds ago

    fw_card.bm_work:
    - performs bus management duties
    - usually does not (but may in corner cases) sleep for long
    - is scheduled via fw_schedule_bm_work() by
    - firewire-ohci's self-ID-complete IRQ handler tasklet
    - firewire-core's fw_device.work instances whenever the root node
    device was (successfully or unsuccessfully) discovered,
    refreshed, or rediscovered
    - itself in case of resource allocation failures or in order to
    obey the 125ms bus manager arbitration interval

    fw_device.work:
    - performs node probe, update, shutdown, revival, removal; including
    kernel driver probe, update, shutdown and bus reset notification to
    userspace drivers
    - usually sleeps moderately long, in corner cases very long
    - is scheduled by
    - firewire-ohci's self-ID-complete IRQ handler tasklet via the
    core's fw_node_event
    - firewire-ohci's pci_remove method via core's fw_destroy_nodes/
    fw_node_event
    - itself during retries, e.g. while a node is powering up

    iso_resource.work:
    - accesses registers at the Isochronous Resource Manager node
    - usually does not (but may in corner cases) sleep for long
    - is scheduled via schedule_iso_resource() by
    - the owning userspace driver at addition and removal of the
    resource
    - firewire-core's fw_device.work instances after bus reset
    - itself in case of resource allocation if necessary to obey the
    1000ms reallocation period after bus reset

    fw_card.br_work instances should not, and instances of the others must
    not, be executed in parallel by multiple CPUs -- but were not protected
    against that. Hence allocate a non-reentrant workqueue for them.

    fw_device.work may be used in the memory reclaim path in case of SBP-2
    device updates. Hence we need a workqueue with rescuer and cannot use
    system_nrt_wq.

    Signed-off-by: Stefan Richter
    Reviewed-by: Tejun Heo

    Stefan Richter
     
  • When queueing iso packets, the run time is dominated by the two
    MMIO accesses that set the DMA context's wake bit. Because most
    drivers submit packets in batches, we can save much time by
    removing all but the last wakeup.

    The internal kernel API is changed to require a call to
    fw_iso_context_queue_flush() after a batch of queued packets.
    The user space API does not change, so one call to
    FW_CDEV_IOC_QUEUE_ISO must specify multiple packets to take
    advantage of this optimization.

    In my measurements, this patch reduces the time needed to queue
    fifty skip packets from userspace to one sixth on a 2.5 GHz CPU,
    or to one third at 800 MHz.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     
  • We do not need slab allocations anymore in order to satisfy
    streaming DMA mapping constraints, thanks to commit da28947e7e36
    "firewire: ohci: avoid separate DMA mapping for small AT payloads".

    (Besides, the slab-allocated buffers that firewire-core, firewire-sbp2,
    and firedtv used to provide for 8-byte write and lock requests were
    still not fully portable since they crossed cacheline boundaries or
    shared a cacheline with unrelated CPU-accessed data. snd-firewire-lib
    got this aspect right by using an extra kmalloc/ kfree just for the
    8-byte transaction buffer.)

    This change replaces kmalloc'ed lock transaction scratch buffers in
    firewire-core, firedtv, and snd-firewire-lib by local stack allocations.
    Perhaps the most notable result of the change is simpler locking because
    there is no need to serialize usages of preallocated per-device buffers
    anymore. Also, allocations and deallocations are simpler.

    Signed-off-by: Stefan Richter
    Acked-by: Clemens Ladisch

    Stefan Richter
     
  • in order to pull in changes in drivers/media/dvb/firewire/ and
    sound/firewire/.

    Stefan Richter
     

10 May, 2011

25 commits


09 May, 2011

10 commits