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: 137197 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp4272223lji; Tue, 29 May 2018 09:37:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoFDicmIGPvAdyndDoChWaIb7Nm3AVsZcbfyu5nUuQV3nWQ9zOyVQ3CNDjTENpEOg+Qos3t X-Received: by 2002:a62:1397:: with SMTP id 23-v6mr18195651pft.222.1527611847078; Tue, 29 May 2018 09:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527611847; cv=none; d=google.com; s=arc-20160816; b=vke9zldhKgnYC7ocyj7c6sfuQiCoORc47h8Xe5mDEVNevTTlF/cXHNlilheT49bdDN irmQHdmjyBmNcUsRowCp6hy8AJXCss2M+ky2cHUIoxQVmNXIX7IE9MgIUmlHmteeRIBY epuAHbDBhg1i+ZIHNuaCJq0gS8vWSSRfmuM3OzSD2iwtJL48RTZb5DbYBHFnF64zhnmD J91MTmAKZiZIwI7zj+FPN3kunhXDlZdtTVJAOWh1V2PwDmpKDtpeF7xSxRj6jmTJ68gv EnqWOBJgLOnTz2n6PgtTh9tLpjFEqg4IPfmRGo+7LliDCQPhJGmxG2y4TD3yET4rNaaY mPew== 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 o185-v6si26394728pga.274.2018.05.29.09.37.26; Tue, 29 May 2018 09:37:27 -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 S965105AbeE2QhY (ORCPT + 30 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-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(-) -- 2.14.1 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; }