lp:~diwic/alsa-driver/snd-firewire-improve

Created by David Henningsson on 2014-04-11 and last modified on 2021-01-28

Takashi Sakamoto's firewire drivers

Get this branch:
bzr branch lp:~diwic/alsa-driver/snd-firewire-improve

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
David Henningsson
Project:
ALSA driver
Status:
Development

Import details

Import Status: Reviewed

This branch is an import of the HEAD branch of the Git repository at https://github.com/takaswie/snd-firewire-improve.git.

The next import is scheduled to run in 1 hour.

Last successful import was 4 hours ago.

Import started 4 hours ago on izar and finished 4 hours ago taking 10 seconds — see the log
Import started 10 hours ago on alnitak and finished 10 hours ago taking 10 seconds — see the log
Import started 16 hours ago on alnitak and finished 16 hours ago taking 10 seconds — see the log
Import started 22 hours ago on alnitak and finished 22 hours ago taking 10 seconds — see the log
Import started on 2021-03-08 on alnitak and finished on 2021-03-08 taking 10 seconds — see the log
Import started on 2021-03-07 on izar and finished on 2021-03-07 taking 10 seconds — see the log
Import started on 2021-03-07 on alnitak and finished on 2021-03-07 taking 10 seconds — see the log
Import started on 2021-03-07 on izar and finished on 2021-03-07 taking 10 seconds — see the log
Import started on 2021-03-07 on izar and finished on 2021-03-07 taking 10 seconds — see the log
Import started on 2021-03-06 on izar and finished on 2021-03-06 taking 10 seconds — see the log

Recent revisions

1436. By Takashi Sakamoto on 2021-01-28

ALSA: bebob: remove an unnecessary condition in hwdep_read()

Drivers in ALSA firewire stack supports eventing to userspace
applications via ALSA hwdep interface. All of the drivers supports stream
lock events. Some of them supports their unique events according to
specification of target device.

ALSA bebob driver supports the stream lock event only. In the case, it's
enough to check condition only in loop with process blocking. However,
current implementation check it again after breaking the loop.

This commit removes the redundant check.

Reported-by: Dan Carpenter <email address hidden>
Reported-by: Christophe JAILLET <email address hidden>
Signed-off-by: Takashi Sakamoto <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>

1435. By Dan Carpenter <email address hidden> on 2021-01-28

ALSA: fireface: remove unnecessary condition in hwdep_read()

Smatch complains that "count" is not clamped when "ff->dev_lock_changed"
and it leads to an information leak. Fortunately, that's not actually
possible and the condition can be deleted.

Signed-off-by: Dan Carpenter <email address hidden>
Acked-by: Takashi Sakamoto <email address hidden>
Link: https://lore.kernel.org/r/YA6n6I8EcNAO5ZFs@mwanda
Signed-off-by: Takashi Iwai <email address hidden>

1434. By Dan Carpenter <email address hidden> on 2021-01-28

ALSA: oxfw: remove an unnecessary condition in hwdep_read()

Smatch complains that "count" isn't clamped properly and
"oxfw->dev_lock_changed" is false then it leads to an information
leak. But it turns out that "oxfw->dev_lock_changed" is always
set and the condition can be removed.

Signed-off-by: Dan Carpenter <email address hidden>
Acked-by: Takashi Sakamoto <email address hidden>
Link: https://lore.kernel.org/r/YA6ntkBxT/4DJ4YK@mwanda
Signed-off-by: Takashi Iwai <email address hidden>

1433. By Takashi Sakamoto on 2021-01-28

ALSA: dice: add support for Lexicon I-ONIX FW810s

I-ONIX FW810s was shipped in Lexicon brand of HARMAN International
industries, Inc 2009. The model uses TCD2220 ASIC as its communication
engine. TCAT general protocol is supported, its extension isn't.

This patch adds support for the model with hard-coded stream formats.

$ python3 ~/git/linux-firewire-utils/src/crpp < /sys/bus/firewire/devices/fw1/config_rom
               ROM header and bus information block
               -----------------------------------------------------------------
400 04042b91 bus_info_length 4, crc_length 4, crc 11153
404 31333934 bus_name "1394"
408 e0008102 irmc 1, cmc 1, isc 1, bmc 0, cyc_clk_acc 0, max_rec 8 (512)
40c 000fd720 company_id 000fd7 |
410 007d7ecf device_id 20007d7ecf | EUI-64 000fd720007d7ecf

               root directory
               -----------------------------------------------------------------
414 00064c2d directory_length 6, crc 19501
418 03000fd7 vendor
41c 8100000a --> descriptor leaf at 444
420 17000001 model
424 8100000d --> descriptor leaf at 458
428 0c0087c0 node capabilities per IEEE 1394
42c d1000001 --> unit directory at 430

               unit directory at 430
               -----------------------------------------------------------------
430 000438f2 directory_length 4, crc 14578
434 12000fd7 specifier id
438 13000001 version
43c 17000001 model
440 8100000d --> descriptor leaf at 474

               descriptor leaf at 444
               -----------------------------------------------------------------
444 000489d5 leaf_length 4, crc 35285
448 00000000 textual descriptor
44c 00000000 minimal ASCII
450 4c657869 "Lexi"
454 636f6e00 "con"

               descriptor leaf at 458
               -----------------------------------------------------------------
458 0006594b leaf_length 6, crc 22859
45c 00000000 textual descriptor
460 00000000 minimal ASCII
464 492d4f4e "I-ON"
468 49585f46 "IX_F"
46c 57383130 "W810"
470 53000000 "S"

               descriptor leaf at 474
               -----------------------------------------------------------------
474 0006594b leaf_length 6, crc 22859
478 00000000 textual descriptor
47c 00000000 minimal ASCII
480 492d4f4e "I-ON"
484 49585f46 "IX_F"
488 57383130 "W810"
48c 53000000 "S"

Signed-off-by: Takashi Sakamoto <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>

1432. By Takashi Sakamoto on 2021-01-28

treewide: Add SPDX license identifier - Makefile/Kconfig

Add SPDX license identifiers to all Make/Kconfig files which:

 - Have no license information of any form

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>

1431. By Geert Uytterhoeven <email address hidden> on 2021-01-13

ALSA: firewire-tascam: Fix integer overflow in midi_port_work()

As snd_fw_async_midi_port.consume_bytes is unsigned int, and
NSEC_PER_SEC is 1000000000L, the second multiplication in

    port->consume_bytes * 8 * NSEC_PER_SEC / 31250

always overflows on 32-bit platforms, truncating the result. Fix this
by precalculating "NSEC_PER_SEC / 31250", which is an integer constant.

Note that this assumes port->consume_bytes <= 16777.

Fixes: 531f471834227d03 ("ALSA: firewire-lib/firewire-tascam: localize async midi port")
Reviewed-by: Takashi Sakamoto <email address hidden>
Signed-off-by: Geert Uytterhoeven <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>

1430. By Geert Uytterhoeven <email address hidden> on 2021-01-13

ALSA: fireface: Fix integer overflow in transmit_midi_msg()

As snd_ff.rx_bytes[] is unsigned int, and NSEC_PER_SEC is 1000000000L,
the second multiplication in

    ff->rx_bytes[port] * 8 * NSEC_PER_SEC / 31250

always overflows on 32-bit platforms, truncating the result. Fix this
by precalculating "NSEC_PER_SEC / 31250", which is an integer constant.

Note that this assumes ff->rx_bytes[port] <= 16777.

Fixes: 19174295788de77d ("ALSA: fireface: add transaction support")
Reviewed-by: Takashi Sakamoto <email address hidden>
Signed-off-by: Geert Uytterhoeven <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>

1429. By Joe Perches on 2021-01-13

ALSA: Convert strlcpy to strscpy when return value is unused

strlcpy is deprecated. see: Documentation/process/deprecated.rst

Change the calls that do not use the strlcpy return value to the
preferred strscpy.

Done with cocci script:

@@
expression e1, e2, e3;
@@

- strlcpy(
+ strscpy(
 e1, e2, e3);

This cocci script leaves the instances where the return value is
used unchanged.

After this patch, sound/ has 3 uses of strlcpy() that need to be
manually inspected for conversion and changed one day.

$ git grep -w strlcpy sound/
sound/usb/card.c: len = strlcpy(card->longname, s, sizeof(card->longname));
sound/usb/mixer.c: return strlcpy(buf, p->name, buflen);
sound/usb/mixer.c: return strlcpy(buf, p->names[index], buflen);

Miscellenea:

o Remove trailing whitespace in conversion of sound/core/hwdep.c

Link: https://lore.kernel<email address hidden>/

Signed-off-by: Joe Perches <email address hidden>
Acked-by: Mark Brown <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>

1428. By Dan Carpenter <email address hidden> on 2020-12-10

ALSA: firewire: Clean up a locking issue in copy_resp_to_buf()

The spin_lock/unlock_irq() functions cannot be nested. The problem is
that presumably we would want the IRQs to be re-enabled on the second
call the spin_unlock_irq() but instead it will be enabled at the first
call so IRQs will be enabled earlier than expected.

In this situation the copy_resp_to_buf() function is only called from
one function and it is called with IRQs disabled. We can just use
the regular spin_lock/unlock() functions.

Fixes: 555e8a8f7f14 ("ALSA: fireworks: Add command/response functionality into hwdep interface")
Signed-off-by: Dan Carpenter <email address hidden>
Acked-by: Takashi Sakamoto <email address hidden>
Cc: <email address hidden>
Link: https://lore.kernel.org/r/20201113101241.GB168908@mwanda
Signed-off-by: Takashi Iwai <email address hidden>

1427. By Kaixu Xia <email address hidden> on 2020-12-10

ALSA: firewire: fix comparison to bool warning

Fix the following coccicheck warning:

./sound/firewire/amdtp-stream.h:273:6-19: WARNING: Comparison to bool

Reported-by: Tosk Robot <email address hidden>
Signed-off-by: Kaixu Xia <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
This branch contains Public information 
Everyone can see this information.