Skip to content

Commit d829208

Browse files
committed
Merge tag 'sound-4.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Takashi writes: "sound fixes for 4.19-rc5 here comes a collection of various fixes, mostly for stable-tree or regression fixes. Two relatively high LOCs are about the (rather simple) conversion of uapi integer types in topology API, and a regression fix about HDMI hotplug notification on AMD HD-audio. The rest are all small individual fixes like ASoC Intel Skylake race condition, minor uninitialized page leak in emu10k1 ioctl, Firewire audio error paths, and so on." * tag 'sound-4.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (33 commits) ALSA: fireworks: fix memory leak of response buffer at error path ALSA: oxfw: fix memory leak of discovered stream formats at error path ALSA: oxfw: fix memory leak for model-dependent data at error path ALSA: bebob: fix memory leak for M-Audio FW1814 and ProjectMix I/O at error path ALSA: hda - Enable runtime PM only for discrete GPU ALSA: oxfw: fix memory leak of private data ALSA: firewire-tascam: fix memory leak of private data ALSA: firewire-digi00x: fix memory leak of private data sound: don't call skl_init_chip() to reset intel skl soc sound: enable interrupt after dma buffer initialization Revert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation" ALSA: emu10k1: fix possible info leak to userspace on SNDRV_EMU10K1_IOCTL_INFO ASoC: cs4265: fix MMTLR Data switch control ASoC: AMD: Ensure reset bit is cleared before configuring ALSA: fireface: fix memory leak in ff400_switch_fetching_mode() ALSA: bebob: use address returned by kmalloc() instead of kernel stack for streaming DMA mapping ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER ASoC: rsnd: adg: care clock-frequency size ASoC: uniphier: change status to orphan ASoC: rsnd: fixup not to call clk_get/set under non-atomic ...
2 parents eb9a29f + 196f4ee commit d829208

File tree

36 files changed

+314
-128
lines changed

36 files changed

+314
-128
lines changed

MAINTAINERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13449,9 +13449,8 @@ F: drivers/i2c/busses/i2c-synquacer.c
1344913449
F: Documentation/devicetree/bindings/i2c/i2c-synquacer.txt
1345013450

1345113451
SOCIONEXT UNIPHIER SOUND DRIVER
13452-
M: Katsuhiro Suzuki <[email protected]>
1345313452
L: [email protected] (moderated for non-subscribers)
13454-
S: Maintained
13453+
S: Orphan
1345513454
F: sound/soc/uniphier/
1345613455

1345713456
SOEKRIS NET48XX LED SUPPORT

drivers/gpu/vga/vga_switcheroo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ static void vga_switcheroo_enable(void)
215215
return;
216216

217217
client->id = ret | ID_BIT_AUDIO;
218+
if (client->ops->gpu_bound)
219+
client->ops->gpu_bound(client->pdev, ret);
218220
}
219221

220222
vga_switcheroo_debugfs_init(&vgasr_priv);

include/linux/vga_switcheroo.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,18 @@ struct vga_switcheroo_handler {
133133
* @can_switch: check if the device is in a position to switch now.
134134
* Mandatory. The client should return false if a user space process
135135
* has one of its device files open
136+
* @gpu_bound: notify the client id to audio client when the GPU is bound.
136137
*
137138
* Client callbacks. A client can be either a GPU or an audio device on a GPU.
138139
* The @set_gpu_state and @can_switch methods are mandatory, @reprobe may be
139140
* set to NULL. For audio clients, the @reprobe member is bogus.
141+
* OTOH, @gpu_bound is only for audio clients, and not used for GPU clients.
140142
*/
141143
struct vga_switcheroo_client_ops {
142144
void (*set_gpu_state)(struct pci_dev *dev, enum vga_switcheroo_state);
143145
void (*reprobe)(struct pci_dev *dev);
144146
bool (*can_switch)(struct pci_dev *dev);
147+
void (*gpu_bound)(struct pci_dev *dev, enum vga_switcheroo_client_id);
145148
};
146149

147150
#if defined(CONFIG_VGA_SWITCHEROO)

include/sound/hdaudio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus);
412412
void snd_hdac_bus_stop_cmd_io(struct hdac_bus *bus);
413413
void snd_hdac_bus_enter_link_reset(struct hdac_bus *bus);
414414
void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus);
415+
int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset);
415416

416417
void snd_hdac_bus_update_rirb(struct hdac_bus *bus);
417418
int snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status,

include/sound/soc-dapm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
407407
int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
408408
void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card);
409409
int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
410+
struct snd_soc_pcm_runtime *rtd,
410411
const struct snd_soc_pcm_stream *params,
411412
unsigned int num_params,
412413
struct snd_soc_dapm_widget *source,

include/uapi/sound/skl-tplg-interface.h

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#ifndef __HDA_TPLG_INTERFACE_H__
1111
#define __HDA_TPLG_INTERFACE_H__
1212

13+
#include <linux/types.h>
14+
1315
/*
1416
* Default types range from 0~12. type can range from 0 to 0xff
1517
* SST types start at higher to avoid any overlapping in future
@@ -143,10 +145,10 @@ enum skl_module_param_type {
143145
};
144146

145147
struct skl_dfw_algo_data {
146-
u32 set_params:2;
147-
u32 rsvd:30;
148-
u32 param_id;
149-
u32 max;
148+
__u32 set_params:2;
149+
__u32 rsvd:30;
150+
__u32 param_id;
151+
__u32 max;
150152
char params[0];
151153
} __packed;
152154

@@ -163,68 +165,68 @@ enum skl_tuple_type {
163165
/* v4 configuration data */
164166

165167
struct skl_dfw_v4_module_pin {
166-
u16 module_id;
167-
u16 instance_id;
168+
__u16 module_id;
169+
__u16 instance_id;
168170
} __packed;
169171

170172
struct skl_dfw_v4_module_fmt {
171-
u32 channels;
172-
u32 freq;
173-
u32 bit_depth;
174-
u32 valid_bit_depth;
175-
u32 ch_cfg;
176-
u32 interleaving_style;
177-
u32 sample_type;
178-
u32 ch_map;
173+
__u32 channels;
174+
__u32 freq;
175+
__u32 bit_depth;
176+
__u32 valid_bit_depth;
177+
__u32 ch_cfg;
178+
__u32 interleaving_style;
179+
__u32 sample_type;
180+
__u32 ch_map;
179181
} __packed;
180182

181183
struct skl_dfw_v4_module_caps {
182-
u32 set_params:2;
183-
u32 rsvd:30;
184-
u32 param_id;
185-
u32 caps_size;
186-
u32 caps[HDA_SST_CFG_MAX];
184+
__u32 set_params:2;
185+
__u32 rsvd:30;
186+
__u32 param_id;
187+
__u32 caps_size;
188+
__u32 caps[HDA_SST_CFG_MAX];
187189
} __packed;
188190

189191
struct skl_dfw_v4_pipe {
190-
u8 pipe_id;
191-
u8 pipe_priority;
192-
u16 conn_type:4;
193-
u16 rsvd:4;
194-
u16 memory_pages:8;
192+
__u8 pipe_id;
193+
__u8 pipe_priority;
194+
__u16 conn_type:4;
195+
__u16 rsvd:4;
196+
__u16 memory_pages:8;
195197
} __packed;
196198

197199
struct skl_dfw_v4_module {
198200
char uuid[SKL_UUID_STR_SZ];
199201

200-
u16 module_id;
201-
u16 instance_id;
202-
u32 max_mcps;
203-
u32 mem_pages;
204-
u32 obs;
205-
u32 ibs;
206-
u32 vbus_id;
207-
208-
u32 max_in_queue:8;
209-
u32 max_out_queue:8;
210-
u32 time_slot:8;
211-
u32 core_id:4;
212-
u32 rsvd1:4;
213-
214-
u32 module_type:8;
215-
u32 conn_type:4;
216-
u32 dev_type:4;
217-
u32 hw_conn_type:4;
218-
u32 rsvd2:12;
219-
220-
u32 params_fixup:8;
221-
u32 converter:8;
222-
u32 input_pin_type:1;
223-
u32 output_pin_type:1;
224-
u32 is_dynamic_in_pin:1;
225-
u32 is_dynamic_out_pin:1;
226-
u32 is_loadable:1;
227-
u32 rsvd3:11;
202+
__u16 module_id;
203+
__u16 instance_id;
204+
__u32 max_mcps;
205+
__u32 mem_pages;
206+
__u32 obs;
207+
__u32 ibs;
208+
__u32 vbus_id;
209+
210+
__u32 max_in_queue:8;
211+
__u32 max_out_queue:8;
212+
__u32 time_slot:8;
213+
__u32 core_id:4;
214+
__u32 rsvd1:4;
215+
216+
__u32 module_type:8;
217+
__u32 conn_type:4;
218+
__u32 dev_type:4;
219+
__u32 hw_conn_type:4;
220+
__u32 rsvd2:12;
221+
222+
__u32 params_fixup:8;
223+
__u32 converter:8;
224+
__u32 input_pin_type:1;
225+
__u32 output_pin_type:1;
226+
__u32 is_dynamic_in_pin:1;
227+
__u32 is_dynamic_out_pin:1;
228+
__u32 is_loadable:1;
229+
__u32 rsvd3:11;
228230

229231
struct skl_dfw_v4_pipe pipe;
230232
struct skl_dfw_v4_module_fmt in_fmt[MAX_IN_QUEUE];

sound/firewire/bebob/bebob.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ do_registration(struct work_struct *work)
263263
error:
264264
mutex_unlock(&devices_mutex);
265265
snd_bebob_stream_destroy_duplex(bebob);
266+
kfree(bebob->maudio_special_quirk);
267+
bebob->maudio_special_quirk = NULL;
266268
snd_card_free(bebob->card);
267269
dev_info(&bebob->unit->device,
268270
"Sound card registration failed: %d\n", err);

sound/firewire/bebob/bebob_maudio.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,38 +96,42 @@ int snd_bebob_maudio_load_firmware(struct fw_unit *unit)
9696
struct fw_device *device = fw_parent_device(unit);
9797
int err, rcode;
9898
u64 date;
99-
__le32 cues[3] = {
100-
cpu_to_le32(MAUDIO_BOOTLOADER_CUE1),
101-
cpu_to_le32(MAUDIO_BOOTLOADER_CUE2),
102-
cpu_to_le32(MAUDIO_BOOTLOADER_CUE3)
103-
};
99+
__le32 *cues;
104100

105101
/* check date of software used to build */
106102
err = snd_bebob_read_block(unit, INFO_OFFSET_SW_DATE,
107103
&date, sizeof(u64));
108104
if (err < 0)
109-
goto end;
105+
return err;
110106
/*
111107
* firmware version 5058 or later has date later than "20070401", but
112108
* 'date' is not null-terminated.
113109
*/
114110
if (date < 0x3230303730343031LL) {
115111
dev_err(&unit->device,
116112
"Use firmware version 5058 or later\n");
117-
err = -ENOSYS;
118-
goto end;
113+
return -ENXIO;
119114
}
120115

116+
cues = kmalloc_array(3, sizeof(*cues), GFP_KERNEL);
117+
if (!cues)
118+
return -ENOMEM;
119+
120+
cues[0] = cpu_to_le32(MAUDIO_BOOTLOADER_CUE1);
121+
cues[1] = cpu_to_le32(MAUDIO_BOOTLOADER_CUE2);
122+
cues[2] = cpu_to_le32(MAUDIO_BOOTLOADER_CUE3);
123+
121124
rcode = fw_run_transaction(device->card, TCODE_WRITE_BLOCK_REQUEST,
122125
device->node_id, device->generation,
123126
device->max_speed, BEBOB_ADDR_REG_REQ,
124-
cues, sizeof(cues));
127+
cues, 3 * sizeof(*cues));
128+
kfree(cues);
125129
if (rcode != RCODE_COMPLETE) {
126130
dev_err(&unit->device,
127131
"Failed to send a cue to load firmware\n");
128132
err = -EIO;
129133
}
130-
end:
134+
131135
return err;
132136
}
133137

@@ -290,10 +294,6 @@ snd_bebob_maudio_special_discover(struct snd_bebob *bebob, bool is1814)
290294
bebob->midi_output_ports = 2;
291295
}
292296
end:
293-
if (err < 0) {
294-
kfree(params);
295-
bebob->maudio_special_quirk = NULL;
296-
}
297297
mutex_unlock(&bebob->mutex);
298298
return err;
299299
}

sound/firewire/digi00x/digi00x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ static void dg00x_free(struct snd_dg00x *dg00x)
4949
fw_unit_put(dg00x->unit);
5050

5151
mutex_destroy(&dg00x->mutex);
52+
kfree(dg00x);
5253
}
5354

5455
static void dg00x_card_free(struct snd_card *card)

sound/firewire/fireface/ff-protocol-ff400.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ static int ff400_switch_fetching_mode(struct snd_ff *ff, bool enable)
146146
{
147147
__le32 *reg;
148148
int i;
149+
int err;
149150

150151
reg = kcalloc(18, sizeof(__le32), GFP_KERNEL);
151152
if (reg == NULL)
@@ -163,9 +164,11 @@ static int ff400_switch_fetching_mode(struct snd_ff *ff, bool enable)
163164
reg[i] = cpu_to_le32(0x00000001);
164165
}
165166

166-
return snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST,
167-
FF400_FETCH_PCM_FRAMES, reg,
168-
sizeof(__le32) * 18, 0);
167+
err = snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST,
168+
FF400_FETCH_PCM_FRAMES, reg,
169+
sizeof(__le32) * 18, 0);
170+
kfree(reg);
171+
return err;
169172
}
170173

171174
static void ff400_dump_sync_status(struct snd_ff *ff,

sound/firewire/fireworks/fireworks.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ do_registration(struct work_struct *work)
301301
snd_efw_transaction_remove_instance(efw);
302302
snd_efw_stream_destroy_duplex(efw);
303303
snd_card_free(efw->card);
304+
kfree(efw->resp_buf);
305+
efw->resp_buf = NULL;
304306
dev_info(&efw->unit->device,
305307
"Sound card registration failed: %d\n", err);
306308
}

sound/firewire/oxfw/oxfw.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ static void oxfw_free(struct snd_oxfw *oxfw)
130130

131131
kfree(oxfw->spec);
132132
mutex_destroy(&oxfw->mutex);
133+
kfree(oxfw);
133134
}
134135

135136
/*
@@ -207,6 +208,7 @@ static int detect_quirks(struct snd_oxfw *oxfw)
207208
static void do_registration(struct work_struct *work)
208209
{
209210
struct snd_oxfw *oxfw = container_of(work, struct snd_oxfw, dwork.work);
211+
int i;
210212
int err;
211213

212214
if (oxfw->registered)
@@ -269,7 +271,15 @@ static void do_registration(struct work_struct *work)
269271
snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->rx_stream);
270272
if (oxfw->has_output)
271273
snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream);
274+
for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; ++i) {
275+
kfree(oxfw->tx_stream_formats[i]);
276+
oxfw->tx_stream_formats[i] = NULL;
277+
kfree(oxfw->rx_stream_formats[i]);
278+
oxfw->rx_stream_formats[i] = NULL;
279+
}
272280
snd_card_free(oxfw->card);
281+
kfree(oxfw->spec);
282+
oxfw->spec = NULL;
273283
dev_info(&oxfw->unit->device,
274284
"Sound card registration failed: %d\n", err);
275285
}

sound/firewire/tascam/tascam.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ static void tscm_free(struct snd_tscm *tscm)
9393
fw_unit_put(tscm->unit);
9494

9595
mutex_destroy(&tscm->mutex);
96+
kfree(tscm);
9697
}
9798

9899
static void tscm_card_free(struct snd_card *card)

0 commit comments

Comments
 (0)