lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9deea5fb-f94b-a525-59f5-4390f9286ed6@quicinc.com>
Date:   Wed, 18 Oct 2023 17:59:15 -0700
From:   Wesley Cheng <quic_wcheng@...cinc.com>
To:     Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        <mathias.nyman@...el.com>, <gregkh@...uxfoundation.org>,
        <lgirdwood@...il.com>, <broonie@...nel.org>, <perex@...ex.cz>,
        <tiwai@...e.com>, <agross@...nel.org>, <andersson@...nel.org>,
        <konrad.dybcio@...aro.org>, <robh+dt@...nel.org>,
        <krzysztof.kozlowski+dt@...aro.org>, <conor+dt@...nel.org>,
        <srinivas.kandagatla@...aro.org>, <bgoswami@...cinc.com>,
        <Thinh.Nguyen@...opsys.com>
CC:     <linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <alsa-devel@...a-project.org>, <linux-arm-msm@...r.kernel.org>,
        <devicetree@...r.kernel.org>
Subject: Re: [PATCH v9 27/34] ALSA: usb-audio: qcom: Populate PCM and USB chip
 information

Hi Pierre,

On 10/17/2023 3:41 PM, Pierre-Louis Bossart wrote:
> 
> 
> On 10/17/23 15:01, Wesley Cheng wrote:
>> Currently, only the index to the USB SND card array is passed to the USB
>> backend.  Pass through more information, specifically the USB SND card
>> number and the number of PCM devices available.  This allows for the DPCM
>> backend to determine what USB resources are available during situations,
>> such as USB audio offloading.
>>
>> Signed-off-by: Wesley Cheng <quic_wcheng@...cinc.com>
>> ---
>>   sound/usb/qcom/qc_audio_offload.c | 21 ++++++++++++++++++---
>>   1 file changed, 18 insertions(+), 3 deletions(-)
>>
>> diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c
>> index bd6b84f72c74..ae74098b41f5 100644
>> --- a/sound/usb/qcom/qc_audio_offload.c
>> +++ b/sound/usb/qcom/qc_audio_offload.c
>> @@ -173,6 +173,21 @@ enum usb_qmi_audio_format {
>>   	USB_QMI_PCM_FORMAT_U32_BE,
>>   };
>>   
>> +static int usb_qmi_get_pcm_num(struct snd_usb_audio *chip, int direction)
>> +{
>> +	struct snd_usb_substream *subs = NULL;
>> +	struct snd_usb_stream *as;
>> +	int count = 0;
>> +
>> +	list_for_each_entry(as, &chip->pcm_list, list) {
>> +		subs = &as->substream[direction];
>> +		if (subs->ep_num)
>> +			count++;
>> +	}
>> +
>> +	return count;
>> +}
>> +
>>   static enum usb_qmi_audio_device_speed_enum_v01
>>   get_speed_info(enum usb_device_speed udev_speed)
>>   {
>> @@ -1592,6 +1607,8 @@ static void qc_usb_audio_offload_probe(struct snd_usb_audio *chip)
>>   
>>   	sdev->card_idx = chip->card->number;
>>   	sdev->chip_idx = chip->index;
>> +	sdev->num_playback = usb_qmi_get_pcm_num(chip, 0);
>> +	sdev->num_capture = usb_qmi_get_pcm_num(chip, 1);
>>   	uadev[chip->card->number].sdev = sdev;
>>   
>>   	uaudio_qdev->last_card_num = chip->card->number;
>> @@ -1706,10 +1723,8 @@ static void qc_usb_audio_offload_disconnect(struct snd_usb_audio *chip)
>>   	mutex_unlock(&chip->mutex);
>>   
>>   	atomic_dec(&uaudio_qdev->qdev_in_use);
>> -	if (!atomic_read(&uaudio_qdev->qdev_in_use)) {
>> -		snd_soc_usb_disconnect(usb_get_usb_backend(udev));
> 
> this also feels like a patch split issue, removing this
> snd_soc_usb_disconnect() has nothing to do with the "populate PCM and
> USB chip information" ?
> 

Will fix this.

Thanks
Wesley Cheng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ