From patchwork Mon Mar 5 18:02:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 130736 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2973746lja; Mon, 5 Mar 2018 10:02:40 -0800 (PST) X-Google-Smtp-Source: AG47ELu/aDlKlCkbftg04o23CE1Bd85UBMo1yblL7fTIHR0mt2tG2/bvsKagqSE9AQfwswdUqTbG X-Received: by 10.101.68.82 with SMTP id e18mr12776846pgq.329.1520272960060; Mon, 05 Mar 2018 10:02:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520272960; cv=none; d=google.com; s=arc-20160816; b=CX3/5y1VTfWZI3BQ6+pv+/Du/qln3i+qCC/n45oJ7JSb7xhDT9ShcZLYBrRpTPea5e UAodZZZhtIUzq767FWu4m/q3DgoqK3IaB9QypUvCTA7Gnly9ttoAG09JoJSHAFFORHPy 9JNOcyrkAqQAkGfz6jnODj9VoTaclzgi3CPLQg4V9Nod0yfszOIvBpuGRNAF2d78VQ4H HcGiKp0oJAvtjQwNP91XrhmDsn2DpGHReb+aaR7ZTnK4VOqKEuWw+rYOCrPAJYcB0RvQ Ht+3Tp0T2Rvjz4HhQn4c1Ys/Um4gTYnHUCeqIUSXQl7FQ77jOjt2TRREncE/yyAd96C+ +RJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=PQj+2wojEDnvOxBdpFRPj1yGyDUw6juMDAI2NrQ0Xcw=; b=Mui3uAwdP2YHlyJ649NOBBQSlz02mFaFy9MUT3NWFO8p+rw/ms93yXQmFZzMj2QhVi wZIhN9roEFxWSuM7ogmdzcespdV0mQjgiVCV4h+Rsv4jbIwEH0IL2BxKNI+mq7Usb5hd BWONkJK7pvRvO++x6WC6FJVhZwHTbClVAE1tZrsk6D/YfRxY20TjbrdGPZsEfcD4Mkmx Vhoo9ZqhQpp7wjEMmQfa97hHpSfN7or7Zr44mhkovoNBgteejcRgdAMmWMgzo0t2hiBZ H4RNZuMfVCoEBeyspife24ZTuiDiCgTyKrs3Au9RjBFcOJmvhr0VJA2B555Nv5dU0IzR xDTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RCa3F08L; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (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 h12-v6si9599996pls.270.2018.03.05.10.02.39; Mon, 05 Mar 2018 10:02:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RCa3F08L; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752719AbeCESCj (ORCPT + 1 other); Mon, 5 Mar 2018 13:02:39 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33547 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752063AbeCESCi (ORCPT ); Mon, 5 Mar 2018 13:02:38 -0500 Received: by mail-wr0-f195.google.com with SMTP id v18so17589031wrv.0 for ; Mon, 05 Mar 2018 10:02:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=cZ8zGfMiNbc+UpcQxmw4Odgw50swvQA/sqJZuKqg1go=; b=RCa3F08L7sGLtpvk7c56SnOsGEbSLiONsYuRdQEezGpnBJ2JBgTcsIxJ7oTq6g5I+q ghDd8n8kJttYQ8J/aR5GWco7rXBsoxo5mRLj+H1Z9/LmTBwk8Ay4sTmz3wiEh66yR0ui xnfG5mCFSMQ3zfdW9gh/MUC6rTq5sUmjxS9d4= 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; bh=cZ8zGfMiNbc+UpcQxmw4Odgw50swvQA/sqJZuKqg1go=; b=k/YFE4q8exUkrYXJAmmsPH7ed+VIo244dXS0ZOMCwwezPxujJ0WQ+C90O2zLoUQEm7 NcFivYPsPK8i1mE0x/fbcya8OKFFKlP8qZ9M+GKcs4NO6t2HeCG/qzGzc73RQb/OKjcj bboJc7lHQVJIal19GTUvSgwg1uDYcEK3xZhDvayLd58rnO7cMO/nrm7oum+2wNyVa6pk FeK3c6AwFfyOV38S0sA7d18PMr2yfhxpY2gnxpK5v9eZDOItudGoYTCEuJ/d6paZjU54 51dkS/twy12jcpXqcv44JE+jLsbHe1IgyZXsOe5NyP6h1i4N3q6U2yi4mjUz4lYmM2OU r86w== X-Gm-Message-State: APf1xPBNu52Y48pT9Gb1ckAWAHcoR8sB5exzPR1UZDmqYy0qfT2l3L+M xnHxwEZNZEUvLOG3in0Uh1WxXQ== X-Received: by 10.223.185.24 with SMTP id k24mr14654274wrf.83.1520272957309; Mon, 05 Mar 2018 10:02:37 -0800 (PST) Received: from lpoulain-ThinkPad-T470p.home ([2a01:cb19:8349:a800:6119:1bd8:ec54:44dc]) by smtp.gmail.com with ESMTPSA id f3sm10697790wre.72.2018.03.05.10.02.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Mar 2018 10:02:36 -0800 (PST) From: Loic Poulain To: marcel@holtmann.org, johan.hedberg@gmail.com Cc: linux-bluetooth@vger.kernel.org, stefan.wahren@i2se.com, Loic Poulain Subject: [PATCH] Bluetooth: hci_bcm: use gpiod cansleep version Date: Mon, 5 Mar 2018 19:02:35 +0100 Message-Id: <1520272955-5023-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Some GPIO controller drivers request sleepable context and so can't be accessed from IRQ context. Using gpiod_set/get_value accessors with such controller leads to a kernel warning since they are reserved for atomic context (according to the documentation). Use the postfixed _cansleep version instead, indicating that context is safe for sleeping if necessary. Note that this is the case here since we never toggle the gpio neither from IRQ nor from a spinlocked section. Signed-off-by: Loic Poulain --- drivers/bluetooth/hci_bcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 0438a64..bb5b006 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -903,13 +903,13 @@ static inline int bcm_apple_get_resources(struct bcm_device *dev) static int bcm_gpio_set_device_wakeup(struct bcm_device *dev, bool awake) { - gpiod_set_value(dev->device_wakeup, awake); + gpiod_set_value_cansleep(dev->device_wakeup, awake); return 0; } static int bcm_gpio_set_shutdown(struct bcm_device *dev, bool powered) { - gpiod_set_value(dev->shutdown, powered); + gpiod_set_value_cansleep(dev->shutdown, powered); return 0; }