Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4141116imm; Tue, 29 May 2018 23:14:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJFjhBps8pXyhhrS8241ME/vPLkVyN3OKuZHYUXwE+ZvwJk0X1Gp0hZstfu1OEDGEyqpuyf X-Received: by 2002:a17:902:a60d:: with SMTP id u13-v6mr1566192plq.40.1527660858220; Tue, 29 May 2018 23:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527660858; cv=none; d=google.com; s=arc-20160816; b=P9QNhrdSSyzNZb4zYnwmJaABkv7MeBruSR/IQuJML56T9sau62YfqSC4o4SKO7Rxs8 wu4UKjlEYI5h2balkQRVAb1m6KyFVI+89tm3x48BCYzHX28ew+PBkTf0sHJMoIYAaeNb WBbissE4T1zOeIUT3Bm119wHgFD8JosWImuaB+FyUOJqFCx20jgLS6ftxyToZdj5mgJT EMLhCZdoT5V/LVZoD4CkdCps+jnGlqKsqEhepHYPWywqSNz639JNyf92Rk32oXqMobqb IzjeLUtJlUymVat/onDBVhZGfNZE/0Z3wttlDp7ABngfiDMSqd+zrDkjUf0gFnCbvopu C1bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:arc-authentication-results; bh=JQttYqFdtn1FWB5hFYFP6FgjpSvaFzazTU96sKWRWsY=; b=zppdBgmfTEs0r9ESgOuAm5metIbpHCk+Es6CUA4fHaVNMSzbfGsTbkGpcYIqggbn1q XA5wJMKAXtrT9sLTXiiK7EGoA+86ftqkW91GQibegs6ijH16db0cj/xkaG/XPl//y7uS iLFYolEgmX6ZIMuwx0EEtCbwJ503W1xZcpi8RF1Newifjct94WzleiuWHcSv+KCQUFo+ +oDxqrFcTF7k/33uty/xLy9RhmwZc/KKDr7ACcmPjr7G+4DMEh0D/Oqq66H9tIKff704 qwPPxcSjouEFkNb+ezBnde0301907GLfd4eINQmYm0GtqBegGIo3pBbkyK8aV5EQhBcg ON2Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f68-v6si3452914pgc.475.2018.05.29.23.14.03; Tue, 29 May 2018 23:14:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935959AbeE3GNl convert rfc822-to-8bit (ORCPT + 99 others); Wed, 30 May 2018 02:13:41 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:44729 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935202AbeE3GNi (ORCPT ); Wed, 30 May 2018 02:13:38 -0400 Received: from marcel-macpro.fritz.box (p5B3D2CDF.dip0.t-ipconnect.de [91.61.44.223]) by mail.holtmann.org (Postfix) with ESMTPSA id D5018CEEB9; Wed, 30 May 2018 08:20:14 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: [PATCH] Bluetooth: hci_qca: Fix "Sleep inside atomic section" warning From: Marcel Holtmann In-Reply-To: <20180529163716.3886-1-thierry.escande@linaro.org> Date: Wed, 30 May 2018 08:13:35 +0200 Cc: Johan Hedberg , Bjorn Andersson , BlueZ development , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <20180529163716.3886-1-thierry.escande@linaro.org> To: Thierry Escande X-Mailer: Apple Mail (2.3445.6.18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thierry, > 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(-) patch has been applied to bluetooth-next tree. > 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); > However wouldn’t it better to use msleep or similar instead of open coding it with schedule_timeout? Regards Marcel