Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3582302imm; Tue, 29 May 2018 09:38:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp3Sgr8np3ro0P0Jc2M8+mmOd0GbLFzPTTpJLQHRqgcgYCvc3COIwLji0Ea6m4xusIhyUye X-Received: by 2002:a63:7b1e:: with SMTP id w30-v6mr14428130pgc.249.1527611885766; Tue, 29 May 2018 09:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527611885; cv=none; d=google.com; s=arc-20160816; b=KEBstFijyh3GHkYVkma0ado2DAB1jo4tlx+5lGYvR3hVKE4NfywbfB4S5JC+gGf9Dt +X4PDHY9ece22AtCWn9dTO7P0Onysp/DuPAv58Oximq3Ot7MeDFWaDOmODkA3HNovOBI 5tRf8DeHOnrmwxTicIKcIUFG47psbRnd8APFOImq0+LJSzHydJ6XHeuOoujxzEKla55O NbMne9cLZz8UYiUQFK3Py2m4Ge0GrG+x7C0AtNvygJ7rS2zkBtHorWwQ+Y8ycI2VTF4s UOmFy7XBkaMThB0Jg1TSkdiS5dyVvn+1rUnemosDoqya3/YS7/JBQfQRXq0BPjFDza8x ZuUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfert-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=RE7PqRC3lXT+nqAp4XZBO7PTxmTTiNQXj/OwpppOguU=; b=eeMYeKxex/vWtTkgFeiO9tkQFpwk2cJMYtBDSSPykqnXkergx7oJawM5EFcDj4o07L d6DWbq/yM4xbofVa4Bm8AewBZwwKO0FLiBQnjwY2kzwKKUN0YKQblRaXDr5vw2VTOiei zlGLl4ByYrCHDc36wCdp/HM6lSqDfD7SwRLmg5xMyBX8xUcKFzRtCVeeHr3ZDi5SxDSd 6zGZFtfYlMEfMwLB/bwijqAl2DN810TGd86djXuXSxnSMrq290OkthnEoWFwxEUoed/D tHz1AS8o1lS5EiNkVj9ZsJ8NGsAh/LhuxyDnD2FjIcdp54I1jDpDHd3/fpOigdKLouTk KcVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V/SSqctr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1-v6si14919638pgv.580.2018.05.29.09.37.51; Tue, 29 May 2018 09:38:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V/SSqctr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965085AbeE2QhY (ORCPT + 99 others); Tue, 29 May 2018 12:37:24 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:37037 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935486AbeE2QhW (ORCPT ); Tue, 29 May 2018 12:37:22 -0400 Received: by mail-wr0-f196.google.com with SMTP id i12-v6so26635058wrc.4 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=UsfBTHMoRTQfwN01Iy7H7k46g6D3OGfeYvLukzO8enHv/evE3HUhbPcmqSpMmk87Qp /JtrAWzv0fw4uiVsocRSZ/Us8UXWmBMrSQUq6qj9C5RY8HainQ2w4gzIFaQan2hrGffK 2FvBsUgdnb8WqiaXTyQLhz1er3mfFaH3NmgmLAQILyJTF2K4SpLxg10Zy/xhMqtQPrcG cqPnwlv5JJXJgVhfTcfGZfpC63S5lIGZopMbf8y/M9BBqHE3iJ8kdJBQ5W2LgjnufG/t WPiGQZ1mbfIhqyYj915bieANOINiHaTGxGKxK9Pl1I434JZLx1WqxOPZKrU0UNYr7Z82 pbrw== X-Gm-Message-State: ALKqPwdCkI/7hBQjblMa8h+9/arilly2ip3MIb8VI4ISU51OuQABY8xg oY1G4zzt1y9VWw7okRl8/UnMmA== 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-Type: text/plain; charset = "utf-8" Content-Transfert-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.14.1