Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2426932rwb; Sun, 2 Oct 2022 23:49:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5U65KJ/n8X1UnzGd90/ZLreRQgvLwFJfLbStcTtgkdGNbUeQfRqCn7Bvywa1NTJmE5AQbk X-Received: by 2002:a17:902:c950:b0:17c:2248:11b1 with SMTP id i16-20020a170902c95000b0017c224811b1mr16627553pla.165.1664779767348; Sun, 02 Oct 2022 23:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664779767; cv=none; d=google.com; s=arc-20160816; b=juidLyGaKBjL6wFE9rTm5yInrn+3SEkk0wLf1bOn9rrcEM7epAbBHGDa8O5V3yjyL/ Za5SkM9IHoFT9igEQQjAuTjbqyy0UzPZuiJ72IfCIguXON9GXAEP3uktAsPR0v6BtTHf lacKXQde/rDXRp8SQ7tj7/YaVrYOvobYdoNDG7cUdlCalufnHjuHWPRVqj59KHDJYIkl Qp3z7CbcKGjv5/pHwE0g3UV2SdGx9psdUHdAhrbB3OGfvn9O+dE7RSrsiJBeasnvhNux h5oNMY6qxnKBeiQ7Af83J+KduTrO34lm/uX3XBFREMrSL9cgHx4ROOhyGq2RQoyaLwVl UUKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=Ty6R4BXCadda5sz5aRNL2oGr1YBQkwHrPTo4Oxf5+bw=; b=kwbu5sE28sSuGF1YhzbY7q0DIthDCf3D0epuB6htRGdHVLXeU+yeY4uxXnDOqUP24E w7SVTw0HXH3KUz1qhrrJWP1cmvmvDG0t7mvE6s+uR1u8JmBXsXFwGKmmH1ZBstwDglfW DBD7NS+ZPsCwUWFfI9nn+34yMfFi1R1oIhSNEGkTWwc0terWvQV1N6wO+vlIdlF/Pi5A t8EzXonTWJFcwQIAghKiExdJQDQC/sBIzCmFT7BIjQWluFgqu/YkM+uluOJiXIBSl1sJ IzJkLF7Wviwl9EWdBLbcNNEgus+FJ9O2KtzLR5RNCkfrGRrR/KrpTi6f1dOTFEUnRZ1C ceCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=edV42xKP; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l191-20020a6388c8000000b00451c1c27cebsi654879pgd.492.2022.10.02.23.48.59; Sun, 02 Oct 2022 23:49:27 -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=@intel.com header.s=Intel header.b=edV42xKP; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229477AbiJCGkC (ORCPT + 99 others); Mon, 3 Oct 2022 02:40:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbiJCGj5 (ORCPT ); Mon, 3 Oct 2022 02:39:57 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E91727677 for ; Sun, 2 Oct 2022 23:39:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664779191; x=1696315191; h=from:to:cc:subject:date:message-id; bh=zKbCsV8FsK7XyhtNsIia4tqJ6rL2B+znEEbn6dzgKUk=; b=edV42xKPyALKGBCfAYm6j44HJUwKMsZuOf5l9qcLYExtjcRSuoxiKhsh RNicQHYpmZhF50gVTdH+2QbVzNDuoqu4O66JcEJXguPu8GwCR2mATRrK+ kJgYaR09szKpjd+E00h1rEUg6FW3DhDW6WpxqkYzpOaaHEYNoDiOPjAMM FiIGVZHkttixLH886jui/ZFKFjIqymq1IxXdwgKHrEOyXO8qOSdSSnrQD GeKm91UVRYJE939NqmlC0c7ddHOjx4ZEfi7iX58F0DXgHQLOuJv0sKCus rQjjxBrNWSwPF/A3pLFzyeBMv60ryocADFtfVxq7Hl+pKlyUvM5DRs9Vh Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10488"; a="388850894" X-IronPort-AV: E=Sophos;i="5.93,364,1654585200"; d="scan'208";a="388850894" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2022 23:39:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10488"; a="618627097" X-IronPort-AV: E=Sophos;i="5.93,364,1654585200"; d="scan'208";a="618627097" Received: from intel-lenovo-legion-y540-15irh-pg0.iind.intel.com ([10.224.186.95]) by orsmga007.jf.intel.com with ESMTP; 02 Oct 2022 23:39:48 -0700 From: Kiran K To: linux-bluetooth@vger.kernel.org Cc: ravishankar.srivatsa@intel.com, Chethan Tumkur Narayan , Kiran K Subject: [PATCH v1] btusb: Avoid reset of ISOC endpoint alt settings to zero Date: Mon, 3 Oct 2022 12:18:36 +0530 Message-Id: <20221003064836.11414-1-kiran.k@intel.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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: Chethan Tumkur Narayan In case of suspend/resume and HCI_RESET (BT On and Off), ISOC endpoint set to alt setting 0 when no SCO connection exists. This patch shall avoid resetting of ISOC endpoint to alt setting to 0. Signed-off-by: Chethan Tumkur Narayan Signed-off-by: Kiran K --- drivers/bluetooth/btusb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 271963805a38..ebfec6d8573f 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -1981,10 +1981,11 @@ static void btusb_work(struct work_struct *work) if (btusb_switch_alt_setting(hdev, new_alts) < 0) bt_dev_err(hdev, "set USB alt:(%d) failed!", new_alts); } else { - clear_bit(BTUSB_ISOC_RUNNING, &data->flags); usb_kill_anchored_urbs(&data->isoc_anchor); - __set_isoc_interface(hdev, 0); + if (test_and_clear_bit(BTUSB_ISOC_RUNNING, &data->flags)) + __set_isoc_interface(hdev, 0); + if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags)) usb_autopm_put_interface(data->isoc ? data->isoc : data->intf); } -- 2.17.1