Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp768557pxu; Mon, 23 Nov 2020 03:48:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsQ8LbvrNvR1GEs+2vQBynEz+CUAnmK2OKox/o6VtdmOrtBbxQ1icDsEl3jeF5UjaZPUo4 X-Received: by 2002:a17:906:824a:: with SMTP id f10mr45614609ejx.167.1606132090437; Mon, 23 Nov 2020 03:48:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606132090; cv=none; d=google.com; s=arc-20160816; b=txam9dzyL1+gma0s/BQ7y8NL/9P1oVYfN/7WD0Omulxs+odZV4aBISBqUJWP9LrWSw /KfU2od/LmqUP9ejU0jSaWwpddk1om+32XVHPdR2qwZXffyILr3fUFv5GCatI0ADe+vP ezwGEZw5m+qXvww2fqtW3aAwPy5Gd4Gx8pCKvNz+yuxsAn0dsfdeVRCL82CmNfnUS3Ha qXNd3Fy3lVbS8hDXL+lUXFhinkX/VhCczgCzxfGzrp0+6xkl6QqhrsSqkQPp9NMQoxcu YQ6OGdjeqqiQDh8Gfx+W8Ug4Xv42FpwlEIn9JirFS+3cxDxZwTqbLutzJdUKgijfLLRK KVVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=ctzyO630UK/LwwKDIiJBNNkpcwcJq2aLlF7TuXKDLRE=; b=eGQlFmBgdv+dIxRPMa/ebFfe3dvHFavJBhzCeI8Ep58S5yAIQQK7sDsZzyiX6c+mQx JbjHT7/JU+nZGpZ8cg2IHp80Vs8fQT2+j+bPTKJPdKqyNbhrbzlVgiZD6JS2PmsR7GQ6 e7v38ZlZo5jeW0emD2oOc0+tHQ9LDRnBJjOCKuWhmwl0vcMhMnFMs8Bu2v4t45GaFNro vtRRaUyjRPRAddCSgaEAYaShFOCPW3RgmlyE+Yz4Kq/CgEWxg4m0fNTdbZ+EAVK44oJy VzjJWGrfza3mK1I0uXSngoNgZh84umRtSU1D2QZQSPf0VNBy5I1hpBF3gRPNyGAHbTvQ EcEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c6si6754612edq.224.2020.11.23.03.47.47; Mon, 23 Nov 2020 03:48:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729008AbgKWLqH convert rfc822-to-8bit (ORCPT + 99 others); Mon, 23 Nov 2020 06:46:07 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:50105 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728769AbgKWLqG (ORCPT ); Mon, 23 Nov 2020 06:46:06 -0500 Received: from marcel-macbook.holtmann.net (unknown [37.83.193.87]) by mail.holtmann.org (Postfix) with ESMTPSA id 869A3CECCF; Mon, 23 Nov 2020 12:53:15 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.21\)) Subject: Re: [PATCH 0/3] Bluetooth: Power down controller when suspending From: Marcel Holtmann In-Reply-To: <20201118234352.2138694-1-abhishekpandit@chromium.org> Date: Mon, 23 Nov 2020 12:46:02 +0100 Cc: BlueZ development , chromeos-bluetooth-upstreaming@chromium.org, mcchou@chromium.org, danielwinkler@chromium.org, "David S. Miller" , Johan Hedberg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski Content-Transfer-Encoding: 8BIT Message-Id: <7235CD4E-963C-4BCB-B891-62494AD7F10D@holtmann.org> References: <20201118234352.2138694-1-abhishekpandit@chromium.org> To: Abhishek Pandit-Subedi X-Mailer: Apple Mail (2.3654.20.0.2.21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Abhishek, > This patch series adds support for a quirk that will power down the > Bluetooth controller when suspending and power it back up when resuming. > > On Marvell SDIO Bluetooth controllers (SD8897 and SD8997), we are seeing > a large number of suspend failures with the following log messages: > > [ 4764.773873] Bluetooth: hci_cmd_timeout() hci0 command 0x0c14 tx timeout > [ 4767.777897] Bluetooth: btmrvl_enable_hs() Host sleep enable command failed > [ 4767.777920] Bluetooth: btmrvl_sdio_suspend() HS not actived, suspend failed! > [ 4767.777946] dpm_run_callback(): pm_generic_suspend+0x0/0x48 returns -16 > [ 4767.777963] call mmc2:0001:2+ returned -16 after 4882288 usecs > > The daily failure rate with this signature is quite significant and > users are likely facing this at least once a day (and some unlucky users > are likely facing it multiple times a day). > > Given the severity, we'd like to power off the controller during suspend > so the driver doesn't need to take any action (or block in any way) when > suspending and power on during resume. This will break wake-on-bt for > users but should improve the reliability of suspend. > > We don't want to force all users of MVL8897 and MVL8997 to encounter > this behavior if they're not affected (especially users that depend on > Bluetooth for keyboard/mouse input) so the new behavior is enabled via > module param. We are limiting this quirk to only Chromebooks (i.e. > laptop). Chromeboxes will continue to have the old behavior since users > may depend on BT HID to wake and use the system. I don’t have a super great feeling with this change. So historically only hciconfig hci0 up/down was doing a power cycle of the controller and when adding the mgmt interface we moved that to the mgmt interface. In addition we added a special case of power up via hdev->setup. We never had an intention that the kernel otherwise can power up/down the controller as it pleases. Can we ask Marvell first to investigate why this is fundamentally broken with their hardware? Since what you are proposing is a pretty heavy change that might has side affects. For example the state machine for the mgmt interface has no concept of a power down/up from the kernel. It is all triggered by bluetoothd. I am careful here since the whole power up/down path is already complicated enough. Regards Marcel