From patchwork Tue May 29 16:37:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Escande X-Patchwork-Id: 10436433 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A0D1601C7 for ; Tue, 29 May 2018 16:37:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BFAA28A17 for ; Tue, 29 May 2018 16:37:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EA4B28A2A; Tue, 29 May 2018 16:37:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED56C289F9 for ; Tue, 29 May 2018 16:37:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964830AbeE2QhX (ORCPT ); Tue, 29 May 2018 12:37:23 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:40007 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935569AbeE2QhW (ORCPT ); Tue, 29 May 2018 12:37:22 -0400 Received: by mail-wr0-f195.google.com with SMTP id l41-v6so26648034wre.7 for ; Tue, 29 May 2018 09:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfert-encoding; bh=RE7PqRC3lXT+nqAp4XZBO7PTxmTTiNQXj/OwpppOguU=; b=V/SSqctrdgRLveNP/cV4Up5+JvGHEsmoQVU/Tsx91zFgMw4DdAOAedWacoX2nKMDRb wK1Gaanl5BJN17gWi2h7lJkFkv0PFNKbiFAfqdrprW4AqMSUjhL6MxFERSJ52FV6acDt GNycZ22kdD4ZTdjjsesTZMUS4qbpi8iG5qwBA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfert-encoding; bh=RE7PqRC3lXT+nqAp4XZBO7PTxmTTiNQXj/OwpppOguU=; b=fkfGkmFHnr4/YSWu3mOZPN/QRTY9xv7kZgpJPlA1ea5yLw4l/5QlXYa/8nUHKCA0oQ LCXsGiqacmKu4i9DQmfV8FPJK7OkZZi3CqgAlXDflOsojbN7dVHotPryhSBOOzWrlBWD WfiwadT5NyZdgVSFCZgEBB+9C0Yn9n8MGNyyi4jBWFyRemee0Z3lAUNhvydneD5k9Joz MAilZkkGSvopFkrjt6h31hPHMw/J70az5vFCKP9L6TwA/E7jeKBeah3eV1il1KyTgsHh wxI2Ap6dcJLrHU+xgiINjZEX+aKr8dq/6nki/XsNl81MJIhfloRIYxS31JxfW8wBot/+ LwIA== X-Gm-Message-State: ALKqPwdCOtEjf/6YrRwyGLTeoX170jVjxDW0CF1AcG2QV3G0Qp019AYZ 9sbM4EMmRwrgkhq7UmjZThpcjg== X-Google-Smtp-Source: AB8JxZrW9MHRteXO4r7WMYDnm7klk2sZwYB6GUYY60jJk7Xu3Wr1KyjwBi2hfe/O19KUeWFfM3AWyA== X-Received: by 2002:adf:e8c3:: with SMTP id k3-v6mr12591742wrn.182.1527611841103; Tue, 29 May 2018 09:37:21 -0700 (PDT) Received: from localhost.localdomain (aig34-1-88-167-228-121.fbx.proxad.net. [88.167.228.121]) by smtp.gmail.com with ESMTPSA id d3-v6sm10658069wri.24.2018.05.29.09.37.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 May 2018 09:37:20 -0700 (PDT) From: Thierry Escande To: Marcel Holtmann , Johan Hedberg Cc: Bjorn Andersson , linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Bluetooth: hci_qca: Fix "Sleep inside atomic section" warning Date: Tue, 29 May 2018 18:37:16 +0200 Message-Id: <20180529163716.3886-1-thierry.escande@linaro.org> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Transfert-Encoding: 8bit Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes the following warning during boot: do not call blocking ops when !TASK_RUNNING; state=1 set at [<(ptrval)>] qca_setup+0x194/0x750 [hci_uart] WARNING: CPU: 2 PID: 1878 at kernel/sched/core.c:6135 __might_sleep+0x7c/0x88 In qca_set_baudrate(), the current task state is set to TASK_UNINTERRUPTIBLE before going to sleep for 300ms. It was then restored to TASK_INTERRUPTIBLE. This patch sets the current task state back to TASK_RUNNING instead. Signed-off-by: Thierry Escande --- drivers/bluetooth/hci_qca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index f05382b5a65d..51790dd02afb 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -910,7 +910,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate) */ set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(msecs_to_jiffies(BAUDRATE_SETTLE_TIMEOUT_MS)); - set_current_state(TASK_INTERRUPTIBLE); + set_current_state(TASK_RUNNING); return 0; }