Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1274775pxb; Thu, 24 Mar 2022 16:39:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXt27k58lxsJ1b3QcJPsWUaQUlL2ydBqLnXzviY0B+ES+UbCi9YSxjQFbaiilwl82Lw5YC X-Received: by 2002:a17:903:32ca:b0:154:7cee:7737 with SMTP id i10-20020a17090332ca00b001547cee7737mr8320898plr.173.1648165170273; Thu, 24 Mar 2022 16:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648165170; cv=none; d=google.com; s=arc-20160816; b=Ayusk5GTlaFhEAJbxybXgcKpHV0TQBAGCdwogoLdYPkqoO8dGbAzL5REKqcwTNIbxx cNVlQcAJCvURUz/jggLNjvddlpWmHcFJW9s1t2M1XJX/AjOet4HsDEm85oLjDF2CM1sg VObDN/03J04Oaa1FNaLPae40ee0FeWvefg/pYXnzp5+v1yR2xRXzIi1QbdO7pCR1JoI0 qGgJsBEl1rzL/Vj2npdUZLDEftrrc4baVCf56Zip66Tg8TIv6aEGH958t6LMDaDPsONV n+LRPKzgn+9QFCZL5nerIvtb3dkXr5YUMYsJw7vG4disMT4tN7re8abiGFwK7BGPmsb4 dwuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=TaAuXatjmavn52ASJ9uP9pd0GETblCdz9KR/zoYFrN4=; b=jp70opR+fdUIhUcb4gXFD0MxJhk2r3r8hH4dKUOZzIYDjMbLpprj17WfKLHiYRHaTN gKcZDSAViUiCbmLNVgZPyYJT71v09NvUI0XlOVI3LtLH5ptxxZ9TZ/QLtTe8O3wT4wny e1AFLSnAy/QIbDbBdXfmt1gAWawoiHdeTST7F8Y2eHMxE34U6frYsnxt4qZ70Bq2T4HP QSwSSejgY5K+2k7qBEz6zy3vblNIEjzIwUPGMgf7odeOHkdi2GMOIOGxoRaTWoQOUQWj 0nz8bainKpwWRQGmHJjVtBbtHh8z8KpTb437l2N3C7rmgiwqJ8DHD2+jW3bBmm39w2oE uXXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NxSw7nSl; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z17-20020a634c11000000b003816043f107si776261pga.764.2022.03.24.16.38.59; Thu, 24 Mar 2022 16:39:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NxSw7nSl; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244279AbiCXWTz (ORCPT + 99 others); Thu, 24 Mar 2022 18:19:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbiCXWTz (ORCPT ); Thu, 24 Mar 2022 18:19:55 -0400 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A34727142 for ; Thu, 24 Mar 2022 15:18:21 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id t2so5128281qtw.9 for ; Thu, 24 Mar 2022 15:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=TaAuXatjmavn52ASJ9uP9pd0GETblCdz9KR/zoYFrN4=; b=NxSw7nSlofLN169d772C7Mj0MMoOtHWYMNhtA2RIIuLMfg3dGzm702aETN5pixcZxw OT3qIfGhrczt+2Mv9eYVzht/gWTwxNf2WCS4ZkNfEINHDwBZfmWtcGkLyqo/Z341Vcba ZxTDmPDqB8whAlcYIViZxpW3nBp3J7vaSv3Wa+O/AZkQyjjIG26JBO8aOrcctjhEVn+F RWwRmzU7JW/Qq/MZRI2rS1f2poh+dtls+pD6RSzbL72F7RubF8EZW1dcSPR7EMGpZiti CSZp2djAjaBSh+8D2E69knbQQ7BZEIoZc8gAt1+gBjdW5ihVEJyXrhE9fm8iMDw5WgUx tgeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=TaAuXatjmavn52ASJ9uP9pd0GETblCdz9KR/zoYFrN4=; b=73clagAK1bMi16FnBDdOcRvTPUR8MnA9aeha+dVkeW/IQirVWQA7xKfJ7plV8cS2Sj M00gHVhnxdx7LD5I6FergEwwOQJyMGRFcMRf8fluKW++6eJfpSFZ8F7CW4H7op8k3wVo sVAfQoFw/UKCaPXCx8oxXe8WjbInk0uf35lFBvuKB1X9XYFdp5Xg39NRuJvTBVwaO93y +VPNeDM8/M2v4eDNhMd5X95C3H6P4RlsOjkVG5a/S18xlZX/hZf90koCD327kB8oLHF/ WIRZvJ3V+3AfbHSS5VmpcDSHraFipHL5/tJa6At5DxGSHfEZ5zRKUrF0cD9tL6E2T8DA 4qNQ== X-Gm-Message-State: AOAM533lV4eVrEzrUNqMyDFYG6aHVX7OKOJTGPw+3nD2xUuZ8bwEKmij OidpOYitO54LR7XdAZ0acc5BunAZbuQ= X-Received: by 2002:ac8:5747:0:b0:2e1:e152:f257 with SMTP id 7-20020ac85747000000b002e1e152f257mr6646591qtx.74.1648160300265; Thu, 24 Mar 2022 15:18:20 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id h6-20020a379e06000000b0067b30874b90sm2200907qke.41.2022.03.24.15.18.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 15:18:19 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ] a2dp: Always invalidate the cache if its configuration fails Date: Thu, 24 Mar 2022 15:18:18 -0700 Message-Id: <20220324221818.81338-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz When a configuration had been restored from last_used cache but it fails invalidate it so another sep can be used. Fixes: https://github.com/bluez/bluez/issues/313 --- profiles/audio/a2dp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c index d66c22b2b..c3ac432a7 100644 --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c @@ -872,12 +872,10 @@ static void store_remote_seps(struct a2dp_channel *chan) static void invalidate_remote_cache(struct a2dp_setup *setup, struct avdtp_error *err) { - if (err->category == AVDTP_ERRNO || - err->err.error_code != AVDTP_UNSUPPORTED_CONFIGURATION) + if (err->category == AVDTP_ERRNO) return; - /* Attempt to unregister Remote SEP if configuration - * fails with Unsupported Configuration and it was + /* Attempt to unregister Remote SEP if configuration fails and it was * loaded from cache. */ if (setup->rsep && setup->rsep->from_cache) { -- 2.35.1