mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	ALSA: usb-audio: workaround for iface reset issue
The recently introduced sample rate validation code seems causing a
problem on some devices; namely, after performing this, the bus gets
screwed and it influences even on other USB devices.
As a quick workaround, perform it only for the necessary devices;
currently MOTU devices are known to need the valid altset checks, so
filter out other devices.
Fixes: 93db51d06b ("ALSA: usb-audio: Check valid altsetting at parsing rates for UAC2/3")
Reported-by: Jamie Heilman <jamie@audible.transient.net>
BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1178203
Link: https://lore.kernel.org/r/20210123155842.22652-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
			
			
This commit is contained in:
		
							parent
							
								
									23b53d4417
								
							
						
					
					
						commit
						fe773b8711
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		| 
						 | 
					@ -466,6 +466,17 @@ static int validate_sample_rate_table_v2v3(struct snd_usb_audio *chip,
 | 
				
			||||||
	unsigned int nr_rates;
 | 
						unsigned int nr_rates;
 | 
				
			||||||
	int i, err;
 | 
						int i, err;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* performing the rate verification may lead to unexpected USB bus
 | 
				
			||||||
 | 
						 * behavior afterwards by some unknown reason.  Do this only for the
 | 
				
			||||||
 | 
						 * known devices.
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						switch (USB_ID_VENDOR(chip->usb_id)) {
 | 
				
			||||||
 | 
						case 0x07fd: /* MOTU */
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							return 0; /* don't perform the validation as default */
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	table = kcalloc(fp->nr_rates, sizeof(*table), GFP_KERNEL);
 | 
						table = kcalloc(fp->nr_rates, sizeof(*table), GFP_KERNEL);
 | 
				
			||||||
	if (!table)
 | 
						if (!table)
 | 
				
			||||||
		return -ENOMEM;
 | 
							return -ENOMEM;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue