Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge/sound upstream 20250102 #5280

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1ae40d5
ALSA: compress_offload: import DMA_BUF namespace
arndb Dec 16, 2024
6018f2f
ALSA: compress_offload: avoid 64-bit get_user()
arndb Dec 16, 2024
f25a51b
ALSA: compress_offload: use safe list iteration in snd_compr_task_seq()
perexg Dec 17, 2024
3d3f43f
ALSA: compress_offload: improve file descriptors installation for dma…
perexg Dec 17, 2024
fa03081
ALSA: memalloc: prefer dma_mapping_error() over explicit address chec…
Dec 19, 2024
42b09e1
ALSA: hdsp: Use str_on_off() and str_yes_no() helper functions
toblux Dec 16, 2024
55853cb
selftests/alsa: Fix circular dependency involving global-timer
zhijianli88 Dec 18, 2024
66a0a2b
ALSA: sh: Fix wrong argument order for copy_from_iter()
tiwai Dec 20, 2024
8cbd01b
Merge tag 'asoc-fix-v6.13-rc3' of https://git.kernel.org/pub/scm/linu…
tiwai Dec 20, 2024
4ebbf89
ALSA: ad1889: Use str_enabled_disabled() helper function
toblux Dec 21, 2024
a5fef9b
soundwire: bus: Move irq mapping cleanup into devres
charleskeepax Dec 5, 2024
6bba2d3
soundwire: add lane field in sdw_port_runtime
bardliao Dec 18, 2024
7533d0d
soundwire: mipi_disco: read lane mapping properties from ACPI
bardliao Dec 18, 2024
b6a2e1b
soundwire: add lane_used_bandwidth in struct sdw_bus
bardliao Dec 18, 2024
f1b3dba
soundwire: stream: set DEPREPARED state earlier
plbossart Dec 18, 2024
fdd1fae
soundwire: generic_bandwidth_allocation: skip DEPREPARED streams
plbossart Dec 18, 2024
8f4e334
Soundwire: add sdw_slave_get_scale_index helper
bardliao Dec 18, 2024
645291c
Soundwire: stream: program BUSCLOCK_SCALE
bardliao Dec 18, 2024
3ddd303
Soundwire: generic_bandwidth_allocation: set frame shape on fly
bardliao Dec 18, 2024
cf44ae3
soundwire: generic_bandwidth_allocation: correct clk_freq check in sd…
bardliao Dec 18, 2024
4a7927d
soundwire: generic_bandwidth_allocation: check required freq accurately
bardliao Dec 18, 2024
7a30292
soundwire: generic_bandwidth_allocation: select data lane
bardliao Dec 18, 2024
366fd59
soundwire: generic_bandwidth_allocation: add lane in sdw_group_params
bardliao Dec 18, 2024
168cdf9
SoundWire: pass stream to compute_params()
bardliao Dec 18, 2024
25befdf
soundwire: generic_bandwidth_allocation: count the bandwidth of activ…
bardliao Dec 18, 2024
74148bb
soundwire: amd: clear wake enable register for power off mode
vijendarmukunda Dec 3, 2024
deb0152
ASoC: SDCA: Add missing header includes
charleskeepax Dec 20, 2024
935cd06
ASoC: SDCA: Clean up error messages
charleskeepax Dec 20, 2024
c36297b
ASoC: SDCA: Add bounds check for function address
charleskeepax Dec 20, 2024
c1ed5eb
ASoC: SDCA: Add missing function type names
charleskeepax Dec 20, 2024
69dcf02
ASoC: SDCA: Split function type patching and function naming
charleskeepax Dec 20, 2024
f03669d
Merge remote-tracking branch 'asoc/for-6.14' into asoc-next
broonie Dec 25, 2024
1d720a2
ALSA: hda/realtek: Add a comment for alc_fixup_inv_dmic()
Dec 23, 2024
1e63e3c
ALSA: AC97: Use str_on_off() helper in snd_ac97_proc_read_main()
toblux Dec 28, 2024
b06a618
ALSA: usb-audio: US16x08: Initialize array before use
TanyaAgarwal25 Dec 29, 2024
6a451e2
ALSA: hda/tas2781: Ignore SUBSYS_ID not found for tas2563 projects
jimxbj-dot Dec 30, 2024
ac9fae7
ALSA: compress_offload: Drop unneeded no_free_ptr()
tiwai Dec 29, 2024
7439b39
ALSA: compress_offload: fix remaining descriptor races in sound/core/…
Dec 29, 2024
0179488
ALSA: seq: oss: Fix races at processing SysEx messages
tiwai Dec 30, 2024
abbff41
Revert "ALSA: ump: Don't enumeration invalid groups for legacy rawmidi"
tiwai Dec 30, 2024
1b2ff63
ALSA: Align the syntax of iov_iter helpers with standard ones
tiwai Dec 30, 2024
7b50991
ALSA hda/realtek: Add quirk for Framework F111:000C
JohnAZoidberg Dec 31, 2024
41d11d6
Merge branch 'for-linus' into for-next
tiwai Dec 31, 2024
20ce9de
ALSA: seq: oss: Send fragmented SysEx messages immediately
tiwai Dec 31, 2024
9001d51
ALSA: seq: Make dependency on UMP clearer
tiwai Jan 1, 2025
23552f6
Merge remote-tracking branch 'takashi/for-next' into sound/upstream-2…
bardliao Jan 2, 2025
15a132e
Merge remote-tracking branch 'soundwire/next' into sound/upstream-202…
bardliao Jan 2, 2025
41dbc03
Merge remote-tracking branch 'regmap/for-next' into sound/upstream-20…
bardliao Jan 2, 2025
006a890
Merge branch 'sound/upstream-20250102' into merge/sound-upstream-2025…
bardliao Jan 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/soundwire/amd_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,7 @@ static int __maybe_unused amd_resume_runtime(struct device *dev)
if (amd_manager->power_mode_mask & AMD_SDW_CLK_STOP_MODE) {
return amd_sdw_clock_stop_exit(amd_manager);
} else if (amd_manager->power_mode_mask & AMD_SDW_POWER_OFF_MODE) {
writel(0x00, amd_manager->acp_mmio + ACP_SW_WAKE_EN(amd_manager->instance));
val = readl(amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL);
if (val) {
val |= AMD_SDW_CLK_RESUME_REQ;
Expand Down
3 changes: 0 additions & 3 deletions drivers/soundwire/bus_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ static int sdw_drv_remove(struct device *dev)

slave->probed = false;

if (slave->prop.use_domain_irq)
sdw_irq_dispose_mapping(slave);

mutex_unlock(&slave->sdw_dev_lock);

if (drv->remove)
Expand Down
12 changes: 8 additions & 4 deletions drivers/soundwire/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ void sdw_irq_delete(struct sdw_bus *bus)
irq_domain_remove(bus->domain);
}

static void sdw_irq_dispose_mapping(void *data)
{
struct sdw_slave *slave = data;

irq_dispose_mapping(irq_find_mapping(slave->bus->domain, slave->dev_num));
}

void sdw_irq_create_mapping(struct sdw_slave *slave)
{
slave->irq = irq_create_mapping(slave->bus->domain, slave->dev_num);
if (!slave->irq)
dev_warn(&slave->dev, "Failed to map IRQ\n");
}

void sdw_irq_dispose_mapping(struct sdw_slave *slave)
{
irq_dispose_mapping(irq_find_mapping(slave->bus->domain, slave->dev_num));
devm_add_action_or_reset(&slave->dev, sdw_irq_dispose_mapping, slave);
}
5 changes: 0 additions & 5 deletions drivers/soundwire/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ int sdw_irq_create(struct sdw_bus *bus,
struct fwnode_handle *fwnode);
void sdw_irq_delete(struct sdw_bus *bus);
void sdw_irq_create_mapping(struct sdw_slave *slave);
void sdw_irq_dispose_mapping(struct sdw_slave *slave);

#else /* CONFIG_IRQ_DOMAIN */

Expand All @@ -34,10 +33,6 @@ static inline void sdw_irq_create_mapping(struct sdw_slave *slave)
{
}

static inline void sdw_irq_dispose_mapping(struct sdw_slave *slave)
{
}

#endif /* CONFIG_IRQ_DOMAIN */

#endif /* __SDW_IRQ_H */
7 changes: 4 additions & 3 deletions include/sound/pcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1532,9 +1532,10 @@ static inline u64 pcm_format_to_bits(snd_pcm_format_t pcm_format)
dev_dbg((pcm)->card->dev, fmt, ##args)

/* helpers for copying between iov_iter and iomem */
int copy_to_iter_fromio(struct iov_iter *itert, const void __iomem *src,
size_t count);
int copy_from_iter_toio(void __iomem *dst, struct iov_iter *iter, size_t count);
size_t copy_to_iter_fromio(const void __iomem *src, size_t bytes,
struct iov_iter *iter) __must_check;
size_t copy_from_iter_toio(void __iomem *dst, size_t bytes,
struct iov_iter *iter) __must_check;

struct snd_pcm_status64 {
snd_pcm_state_t state; /* stream state */
Expand Down
7 changes: 5 additions & 2 deletions include/sound/sdca.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#ifndef __SDCA_H__
#define __SDCA_H__

#include <linux/types.h>
#include <linux/kconfig.h>

struct sdw_slave;

#define SDCA_MAX_FUNCTION_COUNT 8
Expand All @@ -20,9 +23,9 @@ struct sdw_slave;
* @name: human-readable string
*/
struct sdca_function_desc {
u64 adr;
u32 type;
const char *name;
u32 type;
u8 adr;
};

/**
Expand Down
3 changes: 3 additions & 0 deletions include/sound/sdca_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef __SDCA_FUNCTION_H__
#define __SDCA_FUNCTION_H__

#include <linux/bits.h>

/*
* SDCA Function Types from SDCA specification v1.0a Section 5.1.2
* all Function types not described are reserved
Expand Down Expand Up @@ -40,6 +42,7 @@ enum sdca_function_type {
#define SDCA_FUNCTION_TYPE_RJ_NAME "RJ"
#define SDCA_FUNCTION_TYPE_SIMPLE_NAME "SimpleJack"
#define SDCA_FUNCTION_TYPE_HID_NAME "HID"
#define SDCA_FUNCTION_TYPE_IMP_DEF_NAME "ImplementationDefined"

enum sdca_entity0_controls {
SDCA_CONTROL_ENTITY_0_COMMIT_GROUP_MASK = 0x01,
Expand Down
43 changes: 26 additions & 17 deletions sound/core/compress_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ static u64 snd_compr_seqno_next(struct snd_compr_stream *stream)
static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_task *utask)
{
struct snd_compr_task_runtime *task;
int retval;
int retval, fd_i, fd_o;

if (stream->runtime->total_tasks >= stream->runtime->fragments)
return -EBUSY;
Expand All @@ -1039,19 +1039,27 @@ static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_
retval = stream->ops->task_create(stream, task);
if (retval < 0)
goto cleanup;
utask->input_fd = dma_buf_fd(task->input, O_WRONLY|O_CLOEXEC);
if (utask->input_fd < 0) {
retval = utask->input_fd;
/* similar functionality as in dma_buf_fd(), but ensure that both
file descriptors are allocated before fd_install() */
if (!task->input || !task->input->file || !task->output || !task->output->file) {
retval = -EINVAL;
goto cleanup;
}
utask->output_fd = dma_buf_fd(task->output, O_RDONLY|O_CLOEXEC);
if (utask->output_fd < 0) {
retval = utask->output_fd;
fd_i = get_unused_fd_flags(O_WRONLY|O_CLOEXEC);
if (fd_i < 0)
goto cleanup;
fd_o = get_unused_fd_flags(O_RDONLY|O_CLOEXEC);
if (fd_o < 0) {
put_unused_fd(fd_i);
goto cleanup;
}
/* keep dmabuf reference until freed with task free ioctl */
dma_buf_get(utask->input_fd);
dma_buf_get(utask->output_fd);
get_dma_buf(task->input);
get_dma_buf(task->output);
fd_install(fd_i, task->input->file);
fd_install(fd_o, task->output->file);
utask->input_fd = fd_i;
utask->output_fd = fd_o;
list_add_tail(&task->list, &stream->runtime->tasks);
stream->runtime->total_tasks++;
return 0;
Expand All @@ -1069,7 +1077,7 @@ static int snd_compr_task_create(struct snd_compr_stream *stream, unsigned long
return -EPERM;
task = memdup_user((void __user *)arg, sizeof(*task));
if (IS_ERR(task))
return PTR_ERR(no_free_ptr(task));
return PTR_ERR(task);
retval = snd_compr_task_new(stream, task);
if (retval >= 0)
if (copy_to_user((void __user *)arg, task, sizeof(*task)))
Expand Down Expand Up @@ -1130,7 +1138,7 @@ static int snd_compr_task_start_ioctl(struct snd_compr_stream *stream, unsigned
return -EPERM;
task = memdup_user((void __user *)arg, sizeof(*task));
if (IS_ERR(task))
return PTR_ERR(no_free_ptr(task));
return PTR_ERR(task);
retval = snd_compr_task_start(stream, task);
if (retval >= 0)
if (copy_to_user((void __user *)arg, task, sizeof(*task)))
Expand Down Expand Up @@ -1174,18 +1182,18 @@ typedef void (*snd_compr_seq_func_t)(struct snd_compr_stream *stream,
static int snd_compr_task_seq(struct snd_compr_stream *stream, unsigned long arg,
snd_compr_seq_func_t fcn)
{
struct snd_compr_task_runtime *task;
struct snd_compr_task_runtime *task, *temp;
__u64 seqno;
int retval;

if (stream->runtime->state != SNDRV_PCM_STATE_SETUP)
return -EPERM;
retval = get_user(seqno, (__u64 __user *)arg);
if (retval < 0)
return retval;
retval = copy_from_user(&seqno, (__u64 __user *)arg, sizeof(seqno));
if (retval)
return -EFAULT;
retval = 0;
if (seqno == 0) {
list_for_each_entry_reverse(task, &stream->runtime->tasks, list)
list_for_each_entry_safe_reverse(task, temp, &stream->runtime->tasks, list)
fcn(stream, task);
} else {
task = snd_compr_find_task(stream, seqno);
Expand Down Expand Up @@ -1221,7 +1229,7 @@ static int snd_compr_task_status_ioctl(struct snd_compr_stream *stream, unsigned
return -EPERM;
status = memdup_user((void __user *)arg, sizeof(*status));
if (IS_ERR(status))
return PTR_ERR(no_free_ptr(status));
return PTR_ERR(status);
retval = snd_compr_task_status(stream, status);
if (retval >= 0)
if (copy_to_user((void __user *)arg, status, sizeof(*status)))
Expand All @@ -1247,6 +1255,7 @@ void snd_compr_task_finished(struct snd_compr_stream *stream,
}
EXPORT_SYMBOL_GPL(snd_compr_task_finished);

MODULE_IMPORT_NS("DMA_BUF");
#endif /* CONFIG_SND_COMPRESS_ACCEL */

static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
Expand Down
2 changes: 1 addition & 1 deletion sound/core/memalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static void *snd_dma_wc_alloc(struct snd_dma_buffer *dmab, size_t size)
if (!p)
return NULL;
dmab->addr = dma_map_single(dmab->dev.dev, p, size, DMA_BIDIRECTIONAL);
if (dmab->addr == DMA_MAPPING_ERROR) {
if (dma_mapping_error(dmab->dev.dev, dmab->addr)) {
do_free_pages(dmab->area, size, true);
return NULL;
}
Expand Down
41 changes: 26 additions & 15 deletions sound/core/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,43 @@ int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size

if (import_ubuf(ITER_DEST, dst, count, &iter))
return -EFAULT;
return copy_to_iter_fromio(&iter, (const void __iomem *)src, count);
if (copy_to_iter_fromio((const void __iomem *)src, count, &iter) != count)
return -EFAULT;
return 0;
}
EXPORT_SYMBOL(copy_to_user_fromio);

/**
* copy_to_iter_fromio - copy data from mmio-space to iov_iter
* @dst: the destination iov_iter
* @src: the source pointer on mmio
* @count: the data size to copy in bytes
* @dst: the destination iov_iter
*
* Copies the data from mmio-space to iov_iter.
*
* Return: Zero if successful, or non-zero on failure.
* Return: number of bytes to be copied
*/
int copy_to_iter_fromio(struct iov_iter *dst, const void __iomem *src,
size_t count)
size_t copy_to_iter_fromio(const void __iomem *src, size_t count,
struct iov_iter *dst)
{
#if defined(__i386__) || defined(CONFIG_SPARC32)
return copy_to_iter((const void __force *)src, count, dst) == count ? 0 : -EFAULT;
return copy_to_iter((const void __force *)src, count, dst);
#else
char buf[256];
size_t res = 0;

while (count) {
size_t c = count;
if (c > sizeof(buf))
c = sizeof(buf);
memcpy_fromio(buf, (void __iomem *)src, c);
if (copy_to_iter(buf, c, dst) != c)
return -EFAULT;
return res;
count -= c;
src += c;
res += c;
}
return 0;
return res;
#endif
}
EXPORT_SYMBOL(copy_to_iter_fromio);
Expand All @@ -79,37 +84,43 @@ int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size

if (import_ubuf(ITER_SOURCE, (void __user *)src, count, &iter))
return -EFAULT;
return copy_from_iter_toio((void __iomem *)dst, &iter, count);
if (copy_from_iter_toio((void __iomem *)dst, count, &iter) != count)
return -EFAULT;
return 0;
}
EXPORT_SYMBOL(copy_from_user_toio);

/**
* copy_from_iter_toio - copy data from iov_iter to mmio-space
* @dst: the destination pointer on mmio-space
* @src: the source iov_iter
* @count: the data size to copy in bytes
* @src: the source iov_iter
*
* Copies the data from iov_iter to mmio-space.
*
* Return: Zero if successful, or non-zero on failure.
* Return: number of bytes to be copied
*/
int copy_from_iter_toio(void __iomem *dst, struct iov_iter *src, size_t count)
size_t copy_from_iter_toio(void __iomem *dst, size_t count,
struct iov_iter *src)
{
#if defined(__i386__) || defined(CONFIG_SPARC32)
return copy_from_iter((void __force *)dst, count, src) == count ? 0 : -EFAULT;
return copy_from_iter((void __force *)dst, count, src);
#else
char buf[256];
size_t res = 0;

while (count) {
size_t c = count;
if (c > sizeof(buf))
c = sizeof(buf);
if (copy_from_iter(buf, c, src) != c)
return -EFAULT;
return res;
memcpy_toio(dst, buf, c);
count -= c;
dst += c;
res += c;
}
return 0;
return res;
#endif
}
EXPORT_SYMBOL(copy_from_iter_toio);
4 changes: 2 additions & 2 deletions sound/core/seq/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ config SND_SEQ_VIRMIDI

config SND_SEQ_UMP
bool "Support for UMP events"
default y if SND_SEQ_UMP_CLIENT
default SND_UMP
help
Say Y here to enable the support for handling UMP (Universal MIDI
Packet) events via ALSA sequencer infrastructure, which is an
Expand All @@ -71,6 +71,6 @@ config SND_SEQ_UMP
among legacy and UMP clients.

config SND_SEQ_UMP_CLIENT
def_tristate SND_UMP
def_tristate SND_UMP && SND_SEQ_UMP

endif # SND_SEQUENCER
1 change: 0 additions & 1 deletion sound/core/seq/oss/seq_oss_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ struct seq_oss_chinfo {
struct seq_oss_synthinfo {
struct snd_seq_oss_arg arg;
struct seq_oss_chinfo *ch;
struct seq_oss_synth_sysex *sysex;
int nr_voices;
int opened;
int is_midi;
Expand Down
Loading
Loading