1. 13 Oct, 2015 3 commits
  2. 12 Oct, 2015 5 commits
    • Takashi Sakamoto's avatar
      ALSA: firewire-tascam: change device probing processing · 53b3ffee
      Takashi Sakamoto authored
      Currently, this driver picks up model name with be32_to_cpu() macro
      to align characters. This is wrong operation because the result is
      different depending on CPU endiannness.
      
      Additionally, vendor released several versions of firmware for this
      series. It's not better to assign model-dependent information to
      device entry according to the version field.
      
      This commit fixes these bugs. The name of model is picked up correctly
      and used to identify model-dependent information.
      
      Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
      Fixes: c0949b27 ('ALSA: firewire-tascam: add skeleton for TASCAM FireWire series')
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      53b3ffee
    • Takashi Sakamoto's avatar
      ALSA: firewire-tascam: Turn on/off FireWire LED · e65e2cb9
      Takashi Sakamoto authored
      TASCAM FireWire series has some LEDs on its surface. These LEDs can be
      turned on/off by receiving asynchronous transactions to a certain
      address. One of the LEDs is labels as 'FireWire'. It's better to light it
      up when this driver starts to work. Besides, the LED for 'FireWire' is
      turned off at bus reset.
      
      This commit implements this idea.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e65e2cb9
    • Takashi Sakamoto's avatar
      ALSA: firewire-tascam: add support for MIDI functionality · 0db18e7e
      Takashi Sakamoto authored
      In former commits, this driver got functionalities to transfer/receive
      MIDI messages to/from TASCAM FireWire series.
      
      This commit adds some ALSA MIDI ports to enable userspace applications
      to use the functionalities.
      
      I note that this commit doesn't support virtual MIDI ports which console
      models support. A physical controls can be assigned to a certain MIDI
      ports including physical and virtual. But the way is not clear.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      0db18e7e
    • Takashi Sakamoto's avatar
      ALSA: firewire-tascam: add support for outgoing MIDI messages by asynchronous transaction · 3beab0f8
      Takashi Sakamoto authored
      TASCAM FireWire series use asynchronous transaction to receive MIDI
      messages. The transaction should be sent to a certain address.
      
      This commit supports the outgoing MIDI messages. The messages in the
      transaction includes some quirks:
       * One MIDI message is transferred in one quadlet transaction, except for
         system exclusives.
       * MIDI running status is not allowed, thus transactions always include
         status byte.
       * The basic data format is the same as transferring MIDI messages
         supported in previous commit.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      3beab0f8
    • Takashi Sakamoto's avatar
      ALSA: firewire-tascam: add support for incoming MIDI messages by asynchronous transaction · 107cc012
      Takashi Sakamoto authored
      TASCAM FireWire series use asynchronous transaction to transfer MIDI
      messages. The transaction is sent to a registered address.
      
      This commit supports the incoming MIDI messages. The messages in the
      transaction include some quirks:
       * Two quadlets are used for one MIDI message and one timestamp.
       * Usually, the first byte of the first quadlet includes MIDI port and MSB
         4 bit of MIDI status. For system exclusive message, the first byte
         includes MIDI port and 0x04, or 0x07 in the end of the message.
       * The rest of the first quadlet includes MIDI bytes up to 3.
       * Several set of MIDI messages and timestamp can be transferred in one
         block transaction, up to 8 sets.
      
      I note that TASCAM FireWire series ignores ID bytes of system exclusive
      message. When receiving system exclusive messages with ID bytes on physical
      MIDI bus, the series transfers the messages without ID bytes on IEEE 1394
      bus, and vice versa.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      107cc012
  3. 11 Oct, 2015 9 commits
  4. 09 Oct, 2015 6 commits
    • Takashi Sakamoto's avatar
      ALSA: firewire-lib: avoid endless loop to transfer MIDI messages at fatal error · bde3e288
      Takashi Sakamoto authored
      Currently, when asynchronous transactions finish in error state and
      retries, work scheduling and work running also continues. This
      should be canceled at fatal error because it can cause endless loop.
      
      This commit enables to cancel transferring MIDI messages when transactions
      encounter fatal errors. This is achieved by setting error state.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      bde3e288
    • Takashi Sakamoto's avatar
      ALSA: firewire-lib: add throttle for MIDI data rate · ea848b7b
      Takashi Sakamoto authored
      Typically, the target devices have internal buffer to adjust output of
      received MIDI messages for MIDI serial bus, while the capacity of the
      buffer is limited. IEEE 1394 transactions can transfer more MIDI messages
      than MIDI serial bus can. This can cause buffer over flow in device side.
      
      This commit adds throttle to limit MIDI data rate by counting intervals
      between two MIDI messages. Usual MIDI messages consists of two or three
      bytes. This requires 1.302 to 1.953 mili-seconds interval between these
      messages. This commit uses kernel monotonic time service to calculate the
      time of next transaction.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ea848b7b
    • Takashi Sakamoto's avatar
      ALSA: firewire-lib: schedule work again when MIDI substream has rest of MIDI messages · e8a40d9b
      Takashi Sakamoto authored
      Currently, when two MIDI trigger callbacks can be called immediately,
      transactions for the second MIDI messages can be postpone till next trigger
      callback. This is not good for real-time message transmission.
      
      This commit schedules work again at response handling callback if the
      MIDI substream still includes untransferred MIDI messages.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e8a40d9b
    • Takashi Sakamoto's avatar
      ALSA: firewire-lib: add a restriction for a transaction at once · d3ef9cb9
      Takashi Sakamoto authored
      Currently, when waiting for a response, callers can start another
      transaction by scheduling another work. This is not good for error
      processing of transaction, especially the first response is too late.
      
      This commit serialize request/response transactions, by adding one
      boolean member to represent idling state.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d3ef9cb9
    • Takashi Sakamoto's avatar
      ALSA: firewire-lib: add helper functions for asynchronous transactions to transfer MIDI messages · 585d7cba
      Takashi Sakamoto authored
      Some models receive MIDI messages via IEEE 1394 asynchronous transactions.
      In this case, MIDI messages are transferred in fixed-length payload. It's
      nice that firewire-lib module has common helper functions.
      
      This commit implements this idea. Each driver adds
      'struct snd_fw_async_midi_port' in its instance structure. In probing,
      it should call snd_fw_async_midi_port_init() to initialize the
      structure with some parameters such as target address, the length
      of payload in a transaction and a pointer for callback function
      to fill the payload buffer. At 'struct snd_rawmidi_ops.trigger()'
      callback, it should call 'snd_fw_async_midi_port_run()' to start
      transactions. Each driver should ensure that the lifetime of MIDI
      substream continues till calling 'snd_fw_async_midi_port_finish()'.
      
      The helper functions support retries to transferring MIDI messages when
      transmission errors occur. When transactions are successful, the helper
      functions call 'snd_rawmidi_transmit_ack()' internally to consume MIDI
      bytes in the buffer. Therefore, Each driver is expected to use
      'snd_rawmidi_transmit_peek()' to tell the number of bytes to transfer to
      return value of 'fill' callback.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      585d7cba
    • Kosuke Tatsukawa's avatar
      ALSA: seq_oss: fix waitqueue_active without memory barrier in snd-seq-oss · 69447027
      Kosuke Tatsukawa authored
      snd_seq_oss_readq_put_event() seems to be missing a memory barrier which
      might cause the waker to not notice the waiter and miss sending a
      wake_up as in the following figure.
      
          snd_seq_oss_readq_put_event		    snd_seq_oss_readq_wait
      ------------------------------------------------------------------------
      					/* wait_event_interruptible_timeout */
      					 /* __wait_event_interruptible_timeout */
      					  /* ___wait_event */
      					  for (;;) {									 prepare_to_wait_event(&wq, &__wait,
      					    state);
      spin_lock_irqsave(&q->lock, flags);
      if (waitqueue_active(&q->midi_sleep))
      /* The CPU might reorder the test for
         the waitqueue up here, before
         prior writes complete */
      					  if ((q->qlen>0 || q->head==q->tail)
      					  ...
      					  __ret = schedule_timeout(__ret)
      if (q->qlen >= q->maxlen - 1) {
      memcpy(&q->q[q->tail], ev, sizeof(*ev));
      q->tail = (q->tail + 1) % q->maxlen;
      q->qlen++;
      ------------------------------------------------------------------------
      
      There are two other place in sound/core/seq/oss/ which have similar
      code.  The attached patch removes the call to waitqueue_active() leaving
      just wake_up() behind.  This fixes the problem because the call to
      spin_lock_irqsave() in wake_up() will be an ACQUIRE operation.
      
      I found this issue when I was looking through the linux source code
      for places calling waitqueue_active() before wake_up*(), but without
      preceding memory barriers, after sending a patch to fix a similar
      issue in drivers/tty/n_tty.c  (Details about the original issue can be
      found here: https://lkml.org/lkml/2015/9/28/849).
      Signed-off-by: default avatarKosuke Tatsukawa <tatsu@ab.jp.nec.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      69447027
  5. 08 Oct, 2015 2 commits
  6. 07 Oct, 2015 3 commits
  7. 06 Oct, 2015 2 commits
  8. 05 Oct, 2015 3 commits
  9. 04 Oct, 2015 7 commits
    • Takashi Iwai's avatar
      ALSA: hda - Disable power_save_node for IDT 92HD73xx chips · c7e10080
      Takashi Iwai authored
      The recent widget power saving introduced some unavoidable click
      noises on old IDT 92HD73xx chips while it still seems working on the
      compatible new chips.  In the bugzilla, we tried lots of tests and
      workarounds, but they didn't help much.  So, let's disable the feature
      for these specific chips as the least (but safest) fix.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=104981
      Cc: <stable@vger.kernel.org> # v4.1+
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c7e10080
    • Linus Torvalds's avatar
      Linux 4.3-rc4 · 049e6dde
      Linus Torvalds authored
      049e6dde
    • Linus Torvalds's avatar
      Merge branch 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile · 30c44659
      Linus Torvalds authored
      Pull strscpy string copy function implementation from Chris Metcalf.
      
      Chris sent this during the merge window, but I waffled back and forth on
      the pull request, which is why it's going in only now.
      
      The new "strscpy()" function is definitely easier to use and more secure
      than either strncpy() or strlcpy(), both of which are horrible nasty
      interfaces that have serious and irredeemable problems.
      
      strncpy() has a useless return value, and doesn't NUL-terminate an
      overlong result.  To make matters worse, it pads a short result with
      zeroes, which is a performance disaster if you have big buffers.
      
      strlcpy(), by contrast, is a mis-designed "fix" for strlcpy(), lacking
      the insane NUL padding, but having a differently broken return value
      which returns the original length of the source string.  Which means
      that it will read characters past the count from the source buffer, and
      you have to trust the source to be properly terminated.  It also makes
      error handling fragile, since the test for overflow is unnecessarily
      subtle.
      
      strscpy() avoids both these problems, guaranteeing the NUL termination
      (but not excessive padding) if the destination size wasn't zero, and
      making the overflow condition very obvious by returning -E2BIG.  It also
      doesn't read past the size of the source, and can thus be used for
      untrusted source data too.
      
      So why did I waffle about this for so long?
      
      Every time we introduce a new-and-improved interface, people start doing
      these interminable series of trivial conversion patches.
      
      And every time that happens, somebody does some silly mistake, and the
      conversion patch to the improved interface actually makes things worse.
      Because the patch is mindnumbing and trivial, nobody has the attention
      span to look at it carefully, and it's usually done over large swatches
      of source code which means that not every conversion gets tested.
      
      So I'm pulling the strscpy() support because it *is* a better interface.
      But I will refuse to pull mindless conversion patches.  Use this in
      places where it makes sense, but don't do trivial patches to fix things
      that aren't actually known to be broken.
      
      * 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
        tile: use global strscpy() rather than private copy
        string: provide strscpy()
        Make asm/word-at-a-time.h available on all architectures
      30c44659
    • Takashi Sakamoto's avatar
      ALSA: bebob: support Firewire I/O card of Mackie Onyx 1220/1620/1640 · 425a570e
      Takashi Sakamoto authored
      Current ALSA BeBoB drivers has an entry for this model, while the value of
      vendor ID seems to be wrong according to an user's report.
      
      The vendor had released no updated firmware, thus we can judge that this
      model had not changed the content of its config ROM. It's reasonable to fix
      the ID according to the report.
      
      $ ./linux-firewire-utils/src/crpp < /sys/bus/firewire/devices/fw1/config_rom
      
                     ROM header and bus information block
                     -----------------------------------------------------------------
      400  0425720f  bus_info_length 4, crc_length 37, crc 29199
      404  31333934  bus_name "1394"
      408  f0646122  irmc 1, cmc 1, isc 1, bmc 1, pmc 0, cyc_clk_acc 100,
                     max_rec 6 (128), max_rom 1, gen 2, spd 2 (S400)
      40c  00000ff2  company_id 00000f     |
      410  00004697  device_id f200004697  | EUI-64 00000ff200004697
      
                     root directory
                     -----------------------------------------------------------------
      414  000859be  directory_length 8, crc 22974
      418  04000082  hardware version
      41c  0c0083c0  node capabilities per IEEE 1394
      420  03000ff2  vendor
      424  8100000a  --> descriptor leaf at 44c
      428  17010065  model
      42c  8100000d  --> descriptor leaf at 460
      430  13000910  version
      434  d1000001  --> unit directory at 438
      
                     unit directory at 438
                     -----------------------------------------------------------------
      438  0004ccec  directory_length 4, crc 52460
      43c  1200a02d  specifier id: 1394 TA
      440  13010001  version: AV/C
      444  17010065  model
      448  8100000d  --> descriptor leaf at 47c
      
                     descriptor leaf at 44c
                     -----------------------------------------------------------------
      44c  0004152a  leaf_length 4, crc 5418
      450  00000000  textual descriptor
      454  00000000  minimal ASCII
      458  4d61636b  "Mack"
      45c  69650000  "ie"
      
                     descriptor leaf at 460
                     -----------------------------------------------------------------
      460  000612b5  leaf_length 6, crc 4789
      464  00000000  textual descriptor
      468  00000000  minimal ASCII
      46c  4f6e7978  "Onyx"
      470  20466972  " Fir"
      474  65776972  "ewir"
      478  65000000  "e"
      
                     descriptor leaf at 47c
                     -----------------------------------------------------------------
      47c  000612b5  leaf_length 6, crc 4789
      480  00000000  textual descriptor
      484  00000000  minimal ASCII
      488  4f6e7978  "Onyx"
      48c  20466972  " Fir"
      490  65776972  "ewir"
      494  65000000  "e"
      
      $ cat /proc/asound/card3/firewire/firmware
      Manufacturer:   bridgeCo
      Protocol Ver:   1
      Build Ver:      0
      GUID:           0x00000FF200004697
      Model ID:       0x82
      Model Rev:      1
      Firmware Date:  20040430
      Firmware Time:  131527
      Firmware ID:    0x10065
      Firmware Ver:   2320
      Base Addr:      0x20080000
      Max Size:       1572864
      Loader Date:    20040430
      Loader Time:    112036
      Reported-by: default avatarAndrzej Gansiniec <andrzej@gansiniec.pl>
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      425a570e
    • Linus Torvalds's avatar
      Merge tag 'md/4.3-fixes' of git://neil.brown.name/md · 15ecf9a9
      Linus Torvalds authored
      Pull md fixes from Neil Brown:
       "Assorted fixes for md in 4.3-rc.
      
        Two tagged for -stable, and one is really a cleanup to match and
        improve kmemcache interface.
      
      * tag 'md/4.3-fixes' of git://neil.brown.name/md:
        md/bitmap: don't pass -1 to bitmap_storage_alloc.
        md/raid1: Avoid raid1 resync getting stuck
        md: drop null test before destroy functions
        md: clear CHANGE_PENDING in readonly array
        md/raid0: apply base queue limits *before* disk_stack_limits
        md/raid5: don't index beyond end of array in need_this_block().
        raid5: update analysis state for failed stripe
        md: wait for pending superblock updates before switching to read-only
      15ecf9a9
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 0d877081
      Linus Torvalds authored
      Pull MIPS updates from Ralf Baechle:
       "This week's round of MIPS fixes:
         - Fix JZ4740 build
         - Fix fallback to GFP_DMA
         - FP seccomp in case of ENOSYS
         - Fix bootmem panic
         - A number of FP and CPS fixes
         - Wire up new syscalls
         - Make sure BPF assembler objects can properly be disassembled
         - Fix BPF assembler code for MIPS I"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: scall: Always run the seccomp syscall filters
        MIPS: Octeon: Fix kernel panic on startup from memory corruption
        MIPS: Fix R2300 FP context switch handling
        MIPS: Fix octeon FP context switch handling
        MIPS: BPF: Fix load delay slots.
        MIPS: BPF: Do all exports of symbols with FEXPORT().
        MIPS: Fix the build on jz4740 after removing the custom gpio.h
        MIPS: CPS: #ifdef on CONFIG_MIPS_MT_SMP rather than CONFIG_MIPS_MT
        MIPS: CPS: Don't include MT code in non-MT kernels.
        MIPS: CPS: Stop dangling delay slot from has_mt.
        MIPS: dma-default: Fix 32-bit fall back to GFP_DMA
        MIPS: Wire up userfaultfd and membarrier syscalls.
      0d877081
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3e519dde
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "This update contains:
      
         - Fix for a long standing race affecting /proc/irq/NNN
      
         - One line fix for ARM GICV3-ITS counting the wrong data
      
         - Warning silencing in ARM GICV3-ITS.  Another GCC trying to be
           overly clever issue"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/gic-v3-its: Count additional LPIs for the aliased devices
        irqchip/gic-v3-its: Silence warning when its_lpi_alloc_chunks gets inlined
        genirq: Fix race in register_irq_proc()
      3e519dde