1. 31 Jan, 2008 2 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86 · 62326650
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86:
        alpha: fix x86.git merge build error
        ia64: on UP percpu variables are not small memory model
        x86: fix arch/x86/kernel/test_nx.c modular build bug
        s390: use generic percpu linux-2.6.git
        POWERPC: use generic per cpu
        ia64: use generic percpu
        SPARC64: use generic percpu
        percpu: change Kconfig to HAVE_SETUP_PER_CPU_AREA
        modules: fold percpu_modcopy into module.c
        x86: export copy_from_user_ll_nocache[_nozero]
        x86: fix duplicated TIF on 64-bit
      62326650
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 · 94ed294c
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (26 commits)
        firewire: fw-sbp2: Use sbp2 device-provided mgt orb timeout for logins
        firewire: fw-sbp2: increase login orb reply timeout, fix "failed to login"
        firewire: replace subtraction with bitwise and
        firewire: fw-core: react on bus resets while the config ROM is being fetched
        firewire: enforce access order between generation and node ID, fix "giving up on config rom"
        firewire: fw-cdev: use device generation, not card generation
        firewire: fw-sbp2: use device generation, not card generation
        firewire: fw-sbp2: try to increase reconnect_hold (speed up reconnection)
        firewire: fw-sbp2: skip unnecessary logout
        firewire vs. ieee1394: clarify MAINTAINERS
        firewire: fw-ohci: Dynamically allocate buffers for DMA descriptors
        firewire: fw-ohci: CycleTooLong interrupt management
        firewire: Fix extraction of source node id
        firewire: fw-ohci: Bug fixes for packet-per-buffer support
        firewire: fw-ohci: Fix for dualbuffer three-or-more buffers
        firewire: fw-sbp2: remove unused misleading macro
        firewire: fw-sbp2: prepare for s/g chaining
        firewire: fw-sbp2: refactor workq and kref handling
        ieee1394: ohci1394: don't schedule IT tasklets on IR events
        ieee1394: sbp2: raise default transfer size limit
        ...
      94ed294c
  2. 30 Jan, 2008 38 commits
    • Linus Torvalds's avatar
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus · d145c725
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (27 commits)
        lguest: use __PAGE_KERNEL instead of _PAGE_KERNEL
        lguest: Use explicit includes rateher than indirect
        lguest: get rid of lg variable assignments
        lguest: change gpte_addr header
        lguest: move changed bitmap to lg_cpu
        lguest: move last_pages to lg_cpu
        lguest: change last_guest to last_cpu
        lguest: change spte_addr header
        lguest: per-vcpu lguest pgdir management
        lguest: make pending notifications per-vcpu
        lguest: makes special fields be per-vcpu
        lguest: per-vcpu lguest task management
        lguest: replace lguest_arch with lg_cpu_arch.
        lguest: make registers per-vcpu
        lguest: make emulate_insn receive a vcpu struct.
        lguest: map_switcher_in_guest() per-vcpu
        lguest: per-vcpu interrupt processing.
        lguest: per-vcpu lguest timers
        lguest: make hypercalls use the vcpu struct
        lguest: make write() operation smp aware
        ...
      
      Manual conflict resolved (maybe even correctly, who knows) in
      drivers/lguest/x86/core.c
      d145c725
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6 · 44c3b591
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6:
        security: compile capabilities by default
        selinux: make selinux_set_mnt_opts() static
        SELinux: Add warning messages on network denial due to error
        SELinux: Add network ingress and egress control permission checks
        NetLabel: Add auditing to the static labeling mechanism
        NetLabel: Introduce static network labels for unlabeled connections
        SELinux: Allow NetLabel to directly cache SIDs
        SELinux: Enable dynamic enable/disable of the network access checks
        SELinux: Better integration between peer labeling subsystems
        SELinux: Add a new peer class and permissions to the Flask definitions
        SELinux: Add a capabilities bitmap to SELinux policy version 22
        SELinux: Add a network node caching mechanism similar to the sel_netif_*() functions
        SELinux: Only store the network interface's ifindex
        SELinux: Convert the netif code to use ifindex values
        NetLabel: Add IP address family information to the netlbl_skbuff_getattr() function
        NetLabel: Add secid token support to the NetLabel secattr struct
        NetLabel: Consolidate the LSM domain mapping/hashing locks
        NetLabel: Cleanup the LSM domain hash functions
        NetLabel: Remove unneeded RCU read locks
      44c3b591
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6 · 3b470ac4
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6:
        PPC: Fix powerpc vio_find_name to not use devices_subsys
        Driver core: add bus_find_device_by_name function
        Module: check to see if we have a built in module with the same name
        x86: fix runtime error in arch/x86/kernel/cpu/mcheck/mce_amd_64.c
        Driver core: Fix up build when CONFIG_BLOCK=N
      3b470ac4
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm · 2c57ee6f
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (249 commits)
        KVM: Move apic timer migration away from critical section
        KVM: Put kvm_para.h include outside __KERNEL__
        KVM: Fix unbounded preemption latency
        KVM: Initialize the mmu caches only after verifying cpu support
        KVM: MMU: Fix dirty page setting for pages removed from rmap
        KVM: Portability: Move kvm_fpu to asm-x86/kvm.h
        KVM: x86 emulator: Only allow VMCALL/VMMCALL trapped by #UD
        KVM: MMU: Merge shadow level check in FNAME(fetch)
        KVM: MMU: Move kvm_free_some_pages() into critical section
        KVM: MMU: Switch to mmu spinlock
        KVM: MMU: Avoid calling gfn_to_page() in mmu_set_spte()
        KVM: Add kvm_read_guest_atomic()
        KVM: MMU: Concurrent guest walkers
        KVM: Disable vapic support on Intel machines with FlexPriority
        KVM: Accelerated apic support
        KVM: local APIC TPR access reporting facility
        KVM: Print data for unimplemented wrmsr
        KVM: MMU: Add cache miss statistic
        KVM: MMU: Coalesce remote tlb flushes
        KVM: Expose ioapic to ia64 save/restore APIs
        ...
      2c57ee6f
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm · f389e9fc
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm: (21 commits)
        dlm: static initialization improvements
        dlm: clean ups
        dlm: Sanity check namelen before copying it
        dlm: keep cached master rsbs during recovery
        dlm: change error message to debug
        dlm: fix possible use-after-free
        dlm: limit dir lookup loop
        dlm: reject normal unlock when lock is waiting for lookup
        dlm: validate messages before processing
        dlm: reject messages from non-members
        dlm: another call to confirm_master in receive_request_reply
        dlm: recover locks waiting for overlap replies
        dlm: clear ast_type when removing from astqueue
        dlm: use fixed errno values in messages
        dlm: swap bytes for rcom lock reply
        dlm: align midcomms message buffer
        dlm: close othercons
        dlm: use dlm prefix on alloc and free functions
        dlm: don't print common non-errors
        dlm: proper prototypes
        ...
      f389e9fc
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 · 2419505a
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (21 commits)
        [SCSI] Revert "[SCSI] aacraid: fib context lock for management ioctls"
        [SCSI] bsg: copy the cmd_type field to the subordinate request for bidi
        [SCSI] handle scsi_init_queue failure properly
        [SCSI] destroy scsi_bidi_sdb_cache in scsi_exit_queue
        [SCSI] scsi_debug: add XDWRITEREAD_10 support
        [SCSI] scsi_debug: add bidi data transfer support
        [SCSI] scsi_debug: add get_data_transfer_info helper function
        [SCSI] remove use_sg_chaining
        [SCSI] bidirectional: fix up for the new blk_end_request code
        [SCSI] bidirectional command support
        [SCSI] implement scsi_data_buffer
        [SCSI] tgt: use scsi_init_io instead of scsi_alloc_sgtable
        [SCSI] aic7xxx: fix warnings with CONFIG_PM disabled
        [SCSI] aic79xx: fix warnings with CONFIG_PM disabled
        [SCSI] aic7xxx: fix ahc_done check SCB_ACTIVE for tagged transactions
        [SCSI] sgiwd93: use cached memory access to make driver work on IP28
        [SCSI] zfcp: fix sense_buffer access bug
        [SCSI] ncr53c8xx: fix sense_buffer access bug
        [SCSI] aic79xx: fix sense_buffer access bug
        [SCSI] hptiop: fix sense_buffer access bug
        ...
      2419505a
    • Randy Dunlap's avatar
      docbook: fix block api fatal error · caf03feb
      Randy Dunlap authored
      Fix docbook fatal error:
      docproc: linux-2.6.24-git8/block/ll_rw_blk.c: No such file or directory
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      caf03feb
    • Randy Dunlap's avatar
      docbook: fix drivers/base/class warning · a63ca8f6
      Randy Dunlap authored
      Fix kernel-doc empty line warning:
      Warning(linux-2.6.24-git8//drivers/base/class.c:866): bad line:
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a63ca8f6
    • Thomas Gleixner's avatar
      alpha: fix x86.git merge build error · c18d1250
      Thomas Gleixner authored
      a5a19c63 removed the include of
      asm/pgalloc.h from asm-generic/tlb.h. That works fine on most
      architectures, but broke ALPHA.
      
      Fixup ALPHA by adding the include to asm-alpha/tlbflush.h
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c18d1250
    • Ingo Molnar's avatar
      ia64: on UP percpu variables are not small memory model · ab6e14b7
      Ingo Molnar authored
      Tony says:
      
      | The CONFIG_SMP=n path in ia64 makes quite radical changes ... rather
      | than putting all the per-cpu stuff into the top 64K of address space
      | and providing a per-cpu TLB mapping for that range to a different
      | physical address ... it just makes all the per-cpu stuff link as ordinary
      | variables in .data.
      
      the new generic percpu code got confused about this as PER_CPU_ATTRIBUTES
      was defined even on UP, so it picked up that small memory model - which
      was not possible to get linked. The right fix is to only define that
      on SMP. This resolved the build failures in my cross-compiling environment.
      
      also link these variables into the .percpu section even on UP - some
      assembly code has offset dependencies. (such as GET_IA64_MCA_DATA() in
      arch/ia64/kernel/mca_asm.S)
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Acked-by: default avatarTony Luck <tony.luck@intel.com>
      ab6e14b7
    • Ingo Molnar's avatar
      x86: fix arch/x86/kernel/test_nx.c modular build bug · 18fbef9e
      Ingo Molnar authored
      fix this modular build bug:
      
      >   CC [M]  arch/x86/kernel/test_nx.o
      > {standard input}: Assembler messages:
      > {standard input}:58: Error: cannot represent relocation type BFD_RELOC_64
      > {standard input}:59: Error: cannot represent relocation type BFD_RELOC_64
      > make[2]: *** [arch/x86/kernel/test_nx.o] Error 1
      > make[1]: *** [arch/x86/kernel] Error 2
      Reported-by: default avatarAdrian Bunk <bunk@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      18fbef9e
    • travis@sgi.com's avatar
      s390: use generic percpu linux-2.6.git · f0343474
      travis@sgi.com authored
      Change s390 percpu.h to use asm-generic/percpu.h
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Acked-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f0343474
    • travis@sgi.com's avatar
      POWERPC: use generic per cpu · 56f90205
      travis@sgi.com authored
      Powerpc has a way to determine the address of the per cpu area of the
      currently executing processor via the paca and the array of per cpu
      offsets is avoided by looking up the per cpu area from the remote
      paca's (copying x86_64).
      
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Acked-by: default avatarOlof Johansson <olof@lixom.net>
      Tested-by: default avatarGeoff Levand <geoffrey.levand@am.sony.com>
      56f90205
    • travis@sgi.com's avatar
      ia64: use generic percpu · 05991bef
      travis@sgi.com authored
      ia64 has a special processor specific mapping that can be used to locate the
      offset for the current per cpu area.
      
      Cc: linux-ia64@vger.kernel.org
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Acked-by: default avatarTony Luck <tony.luck@intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      05991bef
    • travis@sgi.com's avatar
      SPARC64: use generic percpu · 3afc6202
      travis@sgi.com authored
      Sparc64 has a way of providing the base address for the per cpu area of the
      currently executing processor in a global register.
      
      Sparc64 also provides a way to calculate the address of a per cpu area
      from a base address instead of performing an array lookup.
      
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      3afc6202
    • travis@sgi.com's avatar
      percpu: change Kconfig to HAVE_SETUP_PER_CPU_AREA · 988c388a
      travis@sgi.com authored
      Change:
      	config ARCH_SETS_UP_PER_CPU_AREA
      to:
      	config HAVE_SETUP_PER_CPU_AREA
      
      Cc: Andi Kleen <ak@suse.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Cc: linuxppc-dev@ozlabs.org
      Cc: linux-ia64@vger.kernel.org
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      988c388a
    • travis@sgi.com's avatar
      modules: fold percpu_modcopy into module.c · 6ddfee0e
      travis@sgi.com authored
      percpu_modcopy() is defined multiple times in arch files. However, the only
      user is module.c. Put a static definition into module.c and remove
      the definitions from the arch files.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      6ddfee0e
    • Andrew Morton's avatar
      x86: export copy_from_user_ll_nocache[_nozero] · 914c8269
      Andrew Morton authored
      Cc: Neil Brown <neilb@cse.unsw.edu.au>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      914c8269
    • Mathieu Desnoyers's avatar
      x86: fix duplicated TIF on 64-bit · 4bc408a5
      Mathieu Desnoyers authored
      commit 7e991604
      and commit eee3af4a
      
      Both use the same TIF number (25) in thread_info_64.h.
      
      This patch changes the TIF ids.
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      4bc408a5
    • Jarod Wilson's avatar
      firewire: fw-sbp2: Use sbp2 device-provided mgt orb timeout for logins · 384170da
      Jarod Wilson authored
      To be more compliant with section 7.4.8 of the SBP-2 specification,
      use the mgt_ORB_timeout specified in the SBP-2 device's config rom
      for login ORB attempts (though with some sanity checks). A happy
      side-effect is that certain device and controller combinations that
      sometimes take more than 20 seconds to get synced up (like my laptop
      with just about any SBP-2 device) now function more reliably.
      Signed-off-by: default avatarJarod Wilson <jwilson@redhat.com>
      Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (silenced sparse)
      384170da
    • Jarod Wilson's avatar
      firewire: fw-sbp2: increase login orb reply timeout, fix "failed to login" · a4c379c1
      Jarod Wilson authored
      Increase (and rename) the login orb reply timeout value to 20s
      to match that of the old firewire stack. 2s simply didn't give
      many devices enough time to spin up and reply.
      
      Fixes inability to recognize some devices.
      Failure mode was "orb reply timed out"/"failed to login".
      Signed-off-by: default avatarJarod Wilson <jwilson@redhat.com>
      Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (style, comments, changelog)
      a4c379c1
    • Jarod Wilson's avatar
      firewire: replace subtraction with bitwise and · 8f9f963e
      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: default avatarJarod Wilson <jwilson@redhat.com>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      8f9f963e
    • Stefan Richter's avatar
      firewire: fw-core: react on bus resets while the config ROM is being fetched · f8d2dc39
      Stefan Richter authored
      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: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      
      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: default avatarJarod Wilson <jwilson@redhat.com>
      f8d2dc39
    • Stefan Richter's avatar
      firewire: enforce access order between generation and node ID, fix "giving up on config rom" · b5d2a5e0
      Stefan Richter authored
      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=429950Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      
      Reviewed by Nick Piggin <nickpiggin@yahoo.com.au>.
      
      Verified to fix 'giving up on config rom' issues on multiple system and
      drive combinations that were previously affected.
      Signed-off-by: default avatarJarod Wilson <jwilson@redhat.com>
      Signed-off-by: default avatarKristian Høgsberg <krh@redhat.com>
      b5d2a5e0
    • Stefan Richter's avatar
      firewire: fw-cdev: use device generation, not card generation · cf5a56ac
      Stefan Richter authored
      We have to use the fw_device.generation here, not the fw_card.generation,
      because the generation must never be newer than the node ID when we emit
      a transaction.  This cannot be guaranteed with fw_card.generation.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      
      Verified in concert with subsequent memory barriers patch to fix 'giving
      up on config rom' issues on multiple system and drive combinations that
      were previously affected.
      Signed-off-by: default avatarJarod Wilson <jwilson@redhat.com>
      cf5a56ac
    • Stefan Richter's avatar
      firewire: fw-sbp2: use device generation, not card generation · 5a8a1bcd
      Stefan Richter authored
      There was a small window where a login or reconnect job could use an
      already updated card generation with an outdated node ID.  We have to
      use the fw_device.generation here, not the fw_card.generation, because
      the generation must never be newer than the node ID when we emit a
      transaction.  This cannot be guaranteed with fw_card.generation.
      
      Furthermore, the target's and initiator's node IDs can be obtained from
      fw_device and fw_card.  Dereferencing their underlying topology objects
      is not necessary.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      
      Verified in concert with subsequent memory barriers patch to fix 'giving
      up on config rom' issues on multiple system and drive combinations that
      were previously affected.
      Signed-off-by: default avatarJarod Wilson <jwilson@redhat.com>
      5a8a1bcd
    • Stefan Richter's avatar
      firewire: fw-sbp2: try to increase reconnect_hold (speed up reconnection) · 14dc992a
      Stefan Richter authored
      Ask the target to grant 4 seconds instead of the standard and minimum of
      1 second window after bus reset for reconnection.  This accelerates
      reconnection if there are more than one targets on the bus:  If a login
      and inquiry to one target blocks the fw-sbp2 workqueue for more than 1s
      after bus reset, we now still can reconnect to the other target.
      
      Before that, fw-sbp2's reconnect attempts would be rejected with "error
      status: 0:9" (function rejected), and fw-sbp2 would finally re-login.
      All those futile reconnect attemps cost extra time until the target
      which needs re-login is ready for I/O again.
      
      The reconnect timeout field in the login ORB doesn't have to be honored
      by the target though.  I found that we could get up to
        - allegedly 32768s from an old OXFW911 firmware
        - 256s from LSI bridges
        - 4s from OXUF922 and OXFW912 bridges,
        - 2s from TI bridges,
        - only the standard 1s from Initio and Prolific bridges and from
          Apple OpenFirmware in target mode.
      
      We just try to get 4 seconds which already covers the case of a few
      HDDs on the same bus quite nicely.
      
      A minor drawback occurs in the following (rare and impractical) border
      case:
        - two initiators are there, initiator 1 holds an exclusive login to
          a target,
        - initiator 1 goes off the bus,
        - target refuses login attempts from initiator 2 until reconnect_hold
          seconds after bus reset.
      
      An alternative approach to the issue at hand would be to parallelize
      fw-sbp2's reconnect and login work.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Acked-by: default avatarJarod Wilson <jwilson@redhat.com>
      14dc992a
    • Stefan Richter's avatar
      firewire: fw-sbp2: skip unnecessary logout · 4dccd020
      Stefan Richter authored
      Don't attempt to send a logout ORB if the target was already unplugged
      or had its link switched off.  If two targets are attached, this
      enhances the chance to quickly reconnect to the remaining target when
      one target is plugged out.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Acked-by: default avatarJarod Wilson <jwilson@redhat.com>
      4dccd020
    • Stefan Richter's avatar
      firewire vs. ieee1394: clarify MAINTAINERS · f148e20c
      Stefan Richter authored
      Maintainers like to receive less mail, and submitters like to have to Cc
      less recipients.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      f148e20c
    • David Moore's avatar
      firewire: fw-ohci: Dynamically allocate buffers for DMA descriptors · fe5ca634
      David Moore authored
      Previously, the fw-ohci driver used fixed-length buffers for storing
      descriptors for isochronous receive DMA programs.  If an application
      (such as libdc1394) generated a DMA program that was too large, fw-ohci
      would reach the limit of its fixed-sized buffer and return an error to
      userspace.
      
      This patch replaces the fixed-length ring-buffer with a linked-list of
      page-sized buffers.  Additional buffers can be dynamically allocated and
      appended to the list when necessary.  For a particular context, buffers
      are kept around after use and reused as necessary, so there is no
      allocation taking place after the DMA program is generated for the first
      time.
      
      In addition, the buffers it uses are coherent for DMA so there is no
      syncing required before and after writes.  This syncing wasn't properly
      done in the previous version of the code.
      
      -
      
      This is the fourth version of my patch that replaces a fixed-length
      buffer for DMA descriptors with a dynamically allocated linked-list of
      buffers.
      
      As we discovered with the last attempt, new context programs are
      sometimes queued from interrupt context, making it unacceptable to call
      tasklet_disable() from context_get_descriptors().
      
      This version of the patch uses ohci->lock for all locking needs instead
      of tasklet_disable/enable.  There is a new requirement that
      context_get_descriptors() be called while holding ohci->lock.  It was
      already held for the AT context, so adding the requirement for the iso
      context did not seem particularly onerous.  In addition, this has the
      side benefit of allowing iso queue to be safely called from concurrent
      user-space threads, which previously was not safe.
      Signed-off-by: default avatarDavid Moore <dcm@acm.org>
      Signed-off-by: default avatarKristian Høgsberg <krh@redhat.com>
      Signed-off-by: default avatarJarod Wilson <jwilson@redhat.com>
      
      -
      
      Fixes the following issues:
        - Isochronous reception stopped prematurely if an application used a
          larger buffer.  (Reproduced with coriander.)
        - Isochronous reception stopped after one or a few frames on VT630x
          in OHCI 1.0 mode.  (Fixes reception in coriander, but dvgrab still
          doesn't work with these chips.)
      
      Patch update: struct member alignment, whitespace nits
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      fe5ca634
    • Stefan Richter's avatar
      firewire: fw-ohci: CycleTooLong interrupt management · bb9f2206
      Stefan Richter authored
      The firewire-ohci driver so far lacked the ability to resume cycle
      master duty after that condition happened, as added to ohci1394 in Linux
      2.6.18 by commit 57fdb58f.  This ports
      this patch to fw-ohci.
      
      The "cycle too long" condition has been seen in practice
        - with IIDC cameras if a mode with packets too large for a speed is
          chosen,
        - sporadically when capturing DV on a VIA VT6306 card with ohci1394/
          ieee1394/ raw1394/ dvgrab 2.
          https://bugzilla.redhat.com/show_bug.cgi?id=415841#c7
      (This does not fix Fedora bug 415841.)
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      bb9f2206
    • Rabin Vincent's avatar
      firewire: Fix extraction of source node id · 478b233e
      Rabin Vincent authored
      Fix extraction of the source node id from the packet header.
      Signed-off-by: default avatarRabin Vincent <rabin@rab.in>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      478b233e
    • David Moore's avatar
      firewire: fw-ohci: Bug fixes for packet-per-buffer support · bcee893c
      David Moore authored
      This patch corrects a number of bugs in the current OHCI 1.0
      packet-per-buffer support:
      
      1. Correctly deal with payloads that cross a page boundary.  The
      previous version would not split the descriptor at such a boundary,
      potentially corrupting unrelated memory.
      
      2. Allow user-space to specify multiple packets per struct
      fw_cdev_iso_packet in the same way that dual-buffer allows.  This is
      signaled by header_length being a multiple of header_size.  This
      multiple determines the number of packets.  The payload size allocated
      per packet is determined by dividing the total payload size by the
      number of packets.
      
      3. Make sync support work properly for packet-per-buffer.
      
      I have tested this patch with libdc1394 by forcing my OHCI 1.1
      controller to use the packet-per-buffer support instead of dual-buffer.
      
      I would greatly appreciate testing by those who have a DV devices and
      other types of iso streamers to make sure I didn't cause any
      regressions.
      
      Stefan, with this patch, I'm hoping that libdc1394 will work with all
      your OHCI 1.0 controllers now.
      
      The one bit of future work that remains for packet-per-buffer support is
      the automatic compaction of short payloads that I discussed with
      Kristian.
      Signed-off-by: default avatarDavid Moore <dcm@acm.org>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      bcee893c
    • David Moore's avatar
      firewire: fw-ohci: Fix for dualbuffer three-or-more buffers · 0642b657
      David Moore authored
      This patch fixes the problem where different OHCI 1.1 controllers behave
      differently when a received iso packet straddles three or more buffers
      when using the dual-buffer receive mode.  Two changes are made in order
      to handle this situation:
      
      1. The packet sync DMA descriptor is given a non-zero header length and
      non-zero payload length.  This is because zero-payload descriptors are
      not discussed in the OHCI 1.1 specs and their behavior is thus
      undefined.  Instead we use a header size just large enough for a single
      header and a payload length of 4 bytes for this first descriptor.
      
      2. As we process received packets in the context's tasklet, read the
      packet length out of the headers.  Keep track of the running total of
      the packet length as "excess_bytes", so we can ignore any descriptors
      where no packet starts or ends.  These descriptors may not have had
      their first_res_count or second_res_count fields updated by the
      controller so we cannot rely on those values.
      
      The main drawback of this patch is that the excess_bytes value might get
      "out of sync" with the packet descriptors if something strange happens
      to the DMA program.  I'm not if such a thing could ever happen, but I
      appreciate any suggestions in making it more robust.
      
      Also, the packet-per-buffer support may need a similar fix to deal with
      issue 1, but I haven't done any work on that yet.
      
      Stefan, I'm hoping that with this patch, all your OHCI 1.1 controllers
      will work properly with an unmodified version of libdc1394.
      Signed-off-by: default avatarDavid Moore <dcm@acm.org>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      0642b657
    • Stefan Richter's avatar
      firewire: fw-sbp2: remove unused misleading macro · 4b11ea96
      Stefan Richter authored
      SBP2_MAX_SECTORS is nowhere used in fw-sbp2.
      It merely got copied over from sbp2 where it played a role in the past.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      4b11ea96
    • Stefan Richter's avatar
      b7811da2
    • Stefan Richter's avatar
      firewire: fw-sbp2: refactor workq and kref handling · 285838eb
      Stefan Richter authored
      This somewhat reduces the size of firewire-sbp2.ko.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      285838eb