Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1315553lqp; Fri, 22 Mar 2024 11:07:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUmpjG7J8bAMkDiNMDBRjAdu/rUG6HPn4kb2OvEUSPoUBcDQgFAG30/4VgcFADFjk/rkAFjaA5nDtyuFfhzSITUxMi3Ks+xG1co5Rm+ig== X-Google-Smtp-Source: AGHT+IECgATC21uh34tH081CNJPS33Vmw5cyxFUVWN3X2mHoGTRpjsy8fhG+Lwl/65rfBNMLXXXQ X-Received: by 2002:a05:6808:2915:b0:3c3:b347:15c9 with SMTP id ev21-20020a056808291500b003c3b34715c9mr431534oib.23.1711130852114; Fri, 22 Mar 2024 11:07:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711130852; cv=pass; d=google.com; s=arc-20160816; b=WOtutZDK/Xsg267KxJEVI+LrndQKDjozvIeBHRwVvyoFDSKh3O9vUuhc9QQZzDyB3u oOx/3ejnfjrQIXfGI01MhccF8ZB11bJq+p3N9aAC23hzg7oCp3pQ9UblfvSFei+I7fUB 7pYl5MeFod879Aaz9JbGBtFQ1uHKgEt3/PSEIhie/Br9f/nYEwO8BsIpp7PQiTzg12kT aCugw2PwOWGbhR8M48pgcmfWLz2gNFTelw00jArlEJrdOvqpAKSStSYjEWMch+D0sVDr 5t1aa5fMDQCPiid2ahzYn3yxkZYXea9D2AnlQt+Au/pZmOTaTPa1mcufAqHsNYtqBaA1 ZKGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=cW2mt37Z/a+Rt6EHEHmz1Gi6tbwi2vJAaXQEKqVoAMk=; fh=Rnhs6RdP7RH//zTstNpVQqrLGj6DhI7X8yY5upPL2gc=; b=n2FlYpF5ueVEDFdAO5EWwRqSlIpqCgpGX9G0toBSPt3v1SBTRbrFGZYjCKQKf72d0v 0wvb+CkkLa+crZb+CVa3vVJk+UHZVdIj18ggnnh8WZzrsBJVbeWZqzZY4MTVKKi1LdcY lM+F1vSQlaqn96G384qpYhY3VyVyrZdlXOytVfqN781VYe+U8kdC9c7Y7J71S1oX9fzu xw+V3pCshGWZkCg3iYXPXk3SR1WPPjSNXQOBHrICIhml9KJU5idyybKUMnY175ZOwHaE sGniAff8MjQqHMGVoskM4HxKZZuxoyUImgKSGBKfCxNJ928CFx75V8WQi2DGHcBoJ3bx Zy0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=eQ3QSUwr; arc=pass (i=1 spf=pass spfdomain=126.com dkim=pass dkdomain=126.com dmarc=pass fromdomain=126.com); spf=pass (google.com: domain of linux-bluetooth+bounces-2704-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2704-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gb13-20020a05622a598d00b00430ef644d5csi95046qtb.275.2024.03.22.11.07.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 11:07:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-2704-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=eQ3QSUwr; arc=pass (i=1 spf=pass spfdomain=126.com dkim=pass dkdomain=126.com dmarc=pass fromdomain=126.com); spf=pass (google.com: domain of linux-bluetooth+bounces-2704-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2704-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DCBF01C23996 for ; Fri, 22 Mar 2024 18:06:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B1CA6216F; Fri, 22 Mar 2024 18:06:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b="eQ3QSUwr" X-Original-To: linux-bluetooth@vger.kernel.org Received: from m16.mail.126.com (m16.mail.126.com [117.135.210.7]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32A386216D for ; Fri, 22 Mar 2024 18:06:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711130804; cv=none; b=bopcpkQnISV9nwh9PZYQAA1rNhTrkIto1c2TMLg66zSqOfCfnrkyud4ANFgK21zsQUmQx4RufJqoO+xg2sVpv/tSm0nTWT4lOjGe6FyeB6PqCN/+ql9KntRJk+kvSENcWcc6097njNm400yfNHsj1eAsRfo/VkaBjW/i4shpcLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711130804; c=relaxed/simple; bh=ZDi1gAA0yqJ2zl+yKEq9CaHTbFhf5PPE7V2a+4KIbnU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uBQnS3f8vgVka1pnaWAZol4LFfyG3Vn3EvtileZsJr3Nz+QxRedSJtCJjxMzwKrSHmgGsULBsnHloLTMbUD/7BtTXfcNCs9eMkQwwM2c3WCObQ7qmzHS+qIaWB7ViI2Pm35mf+4HGHvJUgoYQsrlgiF598ENj5jqAxZrIphLpa8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com; spf=pass smtp.mailfrom=126.com; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b=eQ3QSUwr; arc=none smtp.client-ip=117.135.210.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=126.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Message-ID:Date:MIME-Version:Subject:From: Content-Type; bh=cW2mt37Z/a+Rt6EHEHmz1Gi6tbwi2vJAaXQEKqVoAMk=; b=eQ3QSUwryqFDkAo9jq/GuEqwdIIZwIQj3gzXsvdB6Hoa+KEYHJKm15ePsPZrGP aqkVNzWs/cLmGQEl0jmuEDQI5sNVPAsjGBBponEwchZm9cXUWCrbLqKYRhwGyvOJ Z22Z/0BZfue+c2BX5t3Tz/Y7jCO4z9wwhaBJWnPAkYULE= Received: from [192.168.50.76] (unknown [58.22.7.114]) by gzga-smtp-mta-g0-3 (Coremail) with SMTP id _____wD3XySgyP1lg1AXAQ--.37525S2; Sat, 23 Mar 2024 02:06:27 +0800 (CST) Message-ID: <0078fcaa-180b-47e9-991a-6f18d920f4b0@126.com> Date: Sat, 23 Mar 2024 02:06:24 +0800 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH BlueZ] avctp: Remove redundant UUID checks and additions Content-Language: en-GB To: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, Xiao Yao References: <20240322143830.1476938-1-xiaokeqinhealth@126.com> From: Yao Xiao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wD3XySgyP1lg1AXAQ--.37525S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7CrWDKF1rGF4rZF1fJr17GFg_yoW8Zry7pF yYgFyUJFWkKr15ta4avF18uryaq3yUAr95WrZ5tw4jkwn3GryYqFyktr1Fqa4UursFkw4F vrWUGF92vwsIv3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UKsj8UUUUU= X-CM-SenderInfo: 50ld0yhhtl0xhhdo3xa6rslhhfrp/1tbimgSp1WVLafX+oAABsP Hi, 在 2024/3/22 23:28, Luiz Augusto von Dentz 写道: > Hi, > > On Fri, Mar 22, 2024 at 2:39 PM Xiao Yao wrote: >> From: Xiao Yao >> >> --- >> profiles/audio/avctp.c | 6 ------ >> 1 file changed, 6 deletions(-) >> >> diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c >> index 8ad146df1..6199ee951 100644 >> --- a/profiles/audio/avctp.c >> +++ b/profiles/audio/avctp.c >> @@ -1597,12 +1597,6 @@ static void avctp_confirm_cb(GIOChannel *chan, gpointer data) >> if (session == NULL) >> return; >> >> - if (btd_device_get_service(device, AVRCP_REMOTE_UUID) == NULL) >> - btd_device_add_uuid(device, AVRCP_REMOTE_UUID); >> - >> - if (btd_device_get_service(device, AVRCP_TARGET_UUID) == NULL) >> - btd_device_add_uuid(device, AVRCP_TARGET_UUID); > Patch description makes no sense to me, this code is adding the UUIDs > of AVCTP if the device over its PSM because at this point perhaps SDP > discovery is not complete. In the scenario encountered, the SDP service discovery has already been completed, with the SDP record only containing AVRCP_REMOTE_UUID. At this point, the device is added support for AVRCP_TARGET_UUID, which leads to the following code being executed:   controller_init(session);     //avrcp.c:controller_init() 0x55bcdbd690 version 0x0000     session->controller = controller; However, avrcp_set_volume relies on session->controller, erroneously issuing the AVRCP_SET_ABSOLUTE_VOLUME command. Perhaps add a check to verify that SDP discovery has completed before adding the UUID? Additionally, there is another concern: is it appropriate to add support for both AVRCP_REMOTE_UUID and AVRCP_TARGET_UUID before the completion of SDP? if one of the UUIDs is not supported,how should it be handled? > >> switch (psm) { >> case AVCTP_CONTROL_PSM: >> avctp_control_confirm(session, chan, device); >> -- >> 2.34.1 >> >> >