Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2427073ybg; Fri, 5 Jun 2020 13:45:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNy6sCiSjShGmoO+rXQd9QSIyw02IeerPDqhKqASskAAJM/QJYuzow0a4DiDzqZp9rMreD X-Received: by 2002:a05:6402:52:: with SMTP id f18mr11232898edu.7.1591389922305; Fri, 05 Jun 2020 13:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591389922; cv=none; d=google.com; s=arc-20160816; b=CGuucfWWp5NkzBt/mzrrP8bAzenskZUcD81d+/muLp0OVjc1qKoKg/CIYepLPYV6+K zxD+AALJYDumMwh02g793/IvcDtnWfcepfeZH38RgbZ5uQepB7sbNavhMBbnZC3l0ZB4 8jELG1JFispeGTmqBjPY/tRY41q+iM8lJKO5lTujJd/G4Kgt3nr3WUUqfoLM+mxWKSBY tsL11/Rljk9pxuNDWtznAQObKNAFg4ovRPlROKQyZWkqg+DwGin5cVCDoT/W3nJYlh3O u8ftYUdkCEuFl/GjXbbrlvZ6bX74z4ahjf7lojRDhiYJiSpqeCsJ9XJHRb1zyxwm1hHH pfEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=I2jwp5Jdt1LwRP60G2WA0yRjCJZkBybyWS8pPFid5o4=; b=KQXpDqVD/+yoY8L8NagVLuROHB79o5TY3b9keoa0h1NniiqkrwQ2xVomJaSjmyfvzX QWz42TcVwnfYEni8VlXfotwyo95wlbnfBTy1mIr2Y1RF4G1CXbviEOPkiTYhU8Lap+AO NfayRnfj2L46nT+ioY/GSvY4IHfVZTf8ni8+hfJ8ZnuMBu/7n6wpdMB8pF6W3oG7kMRA 3ouXcIodQWrDa1R+hlFb+lrgFatORX6AHiZv5Webege/JK5QEU2w1/pUrCu7Mw5a6Zum xPzPR2YkxMn11K55twTLVZ/cKWUgpLbti7YwXCMNoASWusC4yx/cc4Q1yKeNWFUoDUne QyHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jDx3+OJh; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si4147707ejx.291.2020.06.05.13.44.38; Fri, 05 Jun 2020 13:45:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jDx3+OJh; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728294AbgFEUo1 (ORCPT + 99 others); Fri, 5 Jun 2020 16:44:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728130AbgFEUo1 (ORCPT ); Fri, 5 Jun 2020 16:44:27 -0400 Received: from mail-vk1-xa44.google.com (mail-vk1-xa44.google.com [IPv6:2607:f8b0:4864:20::a44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD051C08C5C3 for ; Fri, 5 Jun 2020 13:44:25 -0700 (PDT) Received: by mail-vk1-xa44.google.com with SMTP id f126so2534844vkb.13 for ; Fri, 05 Jun 2020 13:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I2jwp5Jdt1LwRP60G2WA0yRjCJZkBybyWS8pPFid5o4=; b=jDx3+OJhfpVTwFya+TZjWK2jUysWhkvbRJyh7c3/1rOwDGPDNPTVdSIpYywZ24+j/x F5vQ2NOVL6kr42+PCigk4+QIbY6QU5fPWhzYQhXDR2tPW7D0eghgxD4yktVCypPN4pw0 ynuzSaCDghrGXktlXHFJ4QsHsahY9UC7tfrrw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I2jwp5Jdt1LwRP60G2WA0yRjCJZkBybyWS8pPFid5o4=; b=iAcqO+iop20OPK5Obwe9va3ZuVgZq5nJSkaX3IOJgHRsvte3EKw0uC+e8Wnvbw7T43 rudWlD7WSn5LbINCdAKGsVgdNC7i1srokApsJd8GkbVEujxW/opHKt00KMShlLSsZNr+ dnZfNpWc3/tPNB6zIZQeuMMSd2tJgl0Rxp+ZI3GtORrld5bkN/ni3SRmJtuneayoOq9M EMGa6q6iUA0uaELfsFFdVux01QaTRkalclNBN7PTH8IoNjEnmbTZRjqJuwwnnY7Sf5ZW nIlWvgrlzvEF2p3EilW9HftIvBeboosXtGxtf3nj/iWv07z9HjNU8p1R0T//Zv/STJTn nuvA== X-Gm-Message-State: AOAM532VMbGeJ+cU87AYm7wn6QkKWolBAeaSRXcSE6IOB9PQFi906KSv 6Wt+waxy31ga8evmV5F/ZeJQD3kjx/t6asarKJyDGw== X-Received: by 2002:a1f:abc9:: with SMTP id u192mr9001738vke.17.1591389864762; Fri, 05 Jun 2020 13:44:24 -0700 (PDT) MIME-Version: 1.0 References: <20200605184611.252218-1-mka@chromium.org> <20200605114552.1.I7bcad9d672455473177ddbc7db08cc1adcdee1dc@changeid> In-Reply-To: <20200605114552.1.I7bcad9d672455473177ddbc7db08cc1adcdee1dc@changeid> From: Abhishek Pandit-Subedi Date: Fri, 5 Jun 2020 13:44:10 -0700 Message-ID: Subject: Re: [PATCH 1/3] Bluetooth: hci_qca: Only remove TX clock vote after TX is completed To: Matthias Kaehlcke Cc: Marcel Holtmann , Johan Hedberg , Bluez mailing list , Rocky Liao , Zijun Hu , LKML , Balakrishna Godavarthi , Claire Chang Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi, On Fri, Jun 5, 2020 at 11:46 AM Matthias Kaehlcke wrote: > > qca_suspend() removes the vote for the UART TX clock after > writing an IBS sleep request to the serial buffer. This is > not a good idea since there is no guarantee that the request > has been sent at this point. Instead remove the vote after > successfully entering IBS sleep. This also fixes the issue > of the vote being removed in case of an aborted suspend due > to a failure of entering IBS sleep. > > Fixes: 41d5b25fed0a0 ("Bluetooth: hci_qca: add PM support") > Signed-off-by: Matthias Kaehlcke > --- > > drivers/bluetooth/hci_qca.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c > index ece9f91cc3deb..b1d82d32892e9 100644 > --- a/drivers/bluetooth/hci_qca.c > +++ b/drivers/bluetooth/hci_qca.c > @@ -2083,8 +2083,6 @@ static int __maybe_unused qca_suspend(struct device *dev) > > qca->tx_ibs_state = HCI_IBS_TX_ASLEEP; > qca->ibs_sent_slps++; > - > - qca_wq_serial_tx_clock_vote_off(&qca->ws_tx_vote_off); > break; > > case HCI_IBS_TX_ASLEEP: > @@ -2112,8 +2110,10 @@ static int __maybe_unused qca_suspend(struct device *dev) > qca->rx_ibs_state == HCI_IBS_RX_ASLEEP, > msecs_to_jiffies(IBS_BTSOC_TX_IDLE_TIMEOUT_MS)); > > - if (ret > 0) > + if (ret > 0) { > + qca_wq_serial_tx_clock_vote_off(&qca->ws_tx_vote_off); > return 0; > + } > > if (ret == 0) > ret = -ETIMEDOUT; > -- > 2.27.0.278.ge193c7cf3a9-goog > I checked the order of calls and it looks correct per commit message. Reviewed-by: Abhishek Pandit-Subedi