Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4002383imu; Mon, 28 Jan 2019 15:08:43 -0800 (PST) X-Google-Smtp-Source: ALg8bN4GoTfak0+Gv3evE0eDAuyyAPRNuSWecIkWNz8E6PwXaLEZYq89mzBBPzKlwlsvaFemrefg X-Received: by 2002:a62:938f:: with SMTP id r15mr23612692pfk.27.1548716923528; Mon, 28 Jan 2019 15:08:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548716923; cv=none; d=google.com; s=arc-20160816; b=DM/uFUXtqnjmK1UyHhqG0p86wdGDD1QX4TOCD2aCNwTpaiuYvJoq0rRzhmER7c3yAw RBTg+l14pNgo3pj5+o83tZlqPkKm7Vp/6cgLT4UQiuoOlkAqKlDXJbFak3jj+2WaRBKL VQBWlqzbqWUL3WaApgKIPDXovLnHu9uj6zwxbvPUU97tPq5e+vxL0akCvJ/OrRtv36Vp JvsoSEqBCv84cDHwLFe0DhM6DaNYpNtmFlQ4pKkQQTidQGpU8t5vcWyFzH/H5nPfxWg2 GZ/MKcUTPrOO/k4is4z3NaiOS4YF4y6Kgil4QFI0mbzTaGf1GoYsPt1Up6W8y9wIaOgS yhMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=lwKhytqdSAhh74l4TzMqfP4Or8eaBXB950S9OHzkc0s=; b=FumUU/2OjA884HlPd911nRU0J8MfY2hSrSn3QxDRSoU38tBfWvJ5/1Nze7bErVxYr/ snJIIUg8hLEluOT/+vXkYi9xIwdNpCceQu/2GmESf0p+JxqGQJOarYvl8rWYpIZWgnsl Sk+JfULvPltZtESnclfL9awT3gV2a2fVaEI2Qm5qBwTpnclbZVgwjx4UvxImCqkXVcXV PSZACwRzoc2ZiXFlO8wx4O66znkEzzCthSnVShJdI3LDUT/AcC/Sa1QYC9gbWHF/NCyI zu7h1tT1rX+RP7dwqk3dVG9JwpXtAShZV7znpmOG0UDjnabCswYq2O1+wYoCoe8+0gXd p50A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KCCKGmF8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si25927018pgl.503.2019.01.28.15.08.27; Mon, 28 Jan 2019 15:08:43 -0800 (PST) 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=@google.com header.s=20161025 header.b=KCCKGmF8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727006AbfA1XIQ (ORCPT + 99 others); Mon, 28 Jan 2019 18:08:16 -0500 Received: from mail-vs1-f74.google.com ([209.85.217.74]:36873 "EHLO mail-vs1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbfA1XIP (ORCPT ); Mon, 28 Jan 2019 18:08:15 -0500 Received: by mail-vs1-f74.google.com with SMTP id c201so8494959vsd.4 for ; Mon, 28 Jan 2019 15:08:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=lwKhytqdSAhh74l4TzMqfP4Or8eaBXB950S9OHzkc0s=; b=KCCKGmF8aO7ZSI8NwYcn68SMn1tmPlJkMkdkOmWBhHRNYZPohEgcBIyA1Ib/i0UtGA kJFFzZ2yPtngF/uDbUqhe3yo/lbWag9LCDv2kt0m57hBlFM5pgLcOnQJkmnoRm4PgC+N oO5Z0a/B077bI9jMIymGA9jQw6D59l0cAKMJ0He9a51yKs8EUZg7RMdLLw+enCKEwMx8 AQWKF3teFej6UyNRa39cJSrC3SERXSjvmVabXg18u0KErJ0A/zuIkUkn7cTOdbIRKOBY kSI+LtRm/tuakDLpy4yMPZK3gcnV/m74QhoR3rH4BM5AMPCgy10+l5ZC12wIn4KCdqCg 0I0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=lwKhytqdSAhh74l4TzMqfP4Or8eaBXB950S9OHzkc0s=; b=GKQnnroS4EkRjLYaTdKVTvdwpMk8fAvwSW7b2ewvDK25BALV4+F/TznovbtrGizaCZ 5ybwumKuSX6vDAw0GpfXtqE23MVF8hYJpzXN0wOq0WrDrTIdEdB5KjVQl8mkBDtmvl+y 5Skd/5R0WN5Dly/F3LcvMo4Hgq2REgkcpV2zPS1WQ0n0XQ887MAlJc9WGlpvYjREt2ij ZOQLoA1oC4N5dVrEv/0upAakPlYaZiy/knsR40VFMvHteJYu4mW0D2uONlyGl31+kMwU ZCRmRlnPynt/R8KM7/pyr4mBsHTChWYBFH5gr1PZeYOirtOqNdxXG+yGbgrxbg3xp/HS RUxg== X-Gm-Message-State: AHQUAuYy/e4VJKfqLXvcyNZKMtL+Itm0MvcSGH77NO5kj3FQEpaBIvz1 ijk6xyR4x7UuWisGh3fEZ5DJgG5sbxvL X-Received: by 2002:a67:410b:: with SMTP id o11mr1308840vsa.8.1548716894717; Mon, 28 Jan 2019 15:08:14 -0800 (PST) Date: Mon, 28 Jan 2019 15:08:09 -0800 Message-Id: <20190128230809.173975-1-rajatja@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.20.1.495.gaa96b0ce6b-goog Subject: [PATCH] Bluetooth: btusb: btusb_intel_cmd_timeout: use sleeping functions From: Rajat Jain To: Marcel Holtmann , Johan Hedberg , Dmitry Torokhov , Rajat Jain , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Cc: rajatxjain@gmail.com, dtor@google.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The btusb_intel_cmd_timeout() is called from workqueue contexts, so use the helper functions that can sleep. Signed-off-by: Rajat Jain diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 5de0c2e59b97..9a890b2a7ee1 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -523,9 +523,9 @@ static void btusb_intel_cmd_timeout(struct hci_dev *hdev) } bt_dev_err(hdev, "Initiating HW reset via gpio"); - gpiod_set_value(reset_gpio, 1); - mdelay(100); - gpiod_set_value(reset_gpio, 0); + gpiod_set_value_cansleep(reset_gpio, 1); + msleep(100); + gpiod_set_value_cansleep(reset_gpio, 0); } static inline void btusb_free_frags(struct btusb_data *data) -- 2.20.1.495.gaa96b0ce6b-goog