Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1553791imj; Fri, 8 Feb 2019 03:30:22 -0800 (PST) X-Google-Smtp-Source: AHgI3IY1QnQoElelkRXoFQwSAYQLI20kmMvbMfB/VzfZN0oibe2UUGKAU0P7gUUbKR1CxWJw62QI X-Received: by 2002:a62:4d81:: with SMTP id a123mr22245736pfb.122.1549625421612; Fri, 08 Feb 2019 03:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549625421; cv=none; d=google.com; s=arc-20160816; b=esRubgUUE6ckdyujevGVjOJ3svreh8lLMoaOr2X+MdJkT1cXNIMf/0XnNcpP5oRhDY jpWZngxU+qTvJgZdfpUcUFsCGtVkU9yjui1x9QDeYr+5g2ztNJaHv2ajfSKdw8vpXUWr Ns+F9ppZdoQW/+kbtby4geKoUd89WLKghLhHsrHkhO6n9ka2XpieyMpVtbSdxlUEqNIn CIH1932+6BlNGUqTR6Q0jMYTAULUWE7avbD+MeMdMo4TDKnL3w2YjvCgFMK4Efz8h8XB EEgziDvEPibUp6dYLotcgzkShUBVF6nlTYs8ORV90IBxqaiPL04sILZpkUvkwyEXqY6S pbpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=HGzvHnNfCkbD9HiE6oB+g14lGZLuNB9ZAn/E7+lLLbs=; b=x6Pivn6lqI/JLRggIXVdeMVIPzSMNNvrUkZvS7GCJiXIYOz/ZYwiOv+s7/2903UHQA v/stSlTjBYQByuLtooCFNdvrpBqcUr6U11K4682K5n4xLGLgzmXhmliINYmAWkXjeMic teyICbdDDSq3haknTfIhWXzDvR6FnQGXWpar1CXZGEyBceH+pKV26rcxd1Gj5l55ASKB TY7aJX5S087C4ds3dugYMwFz8wsZOwLGhT0heUR6mzeNEa8jxe/Nj3ZhIvKQgKLP4k1s SsHOEcdTVounmSKr0UjrM5MzOIIJQn6XdjoWNCdOn+CZ5qScXiKqnRav/EN4v2px9taw 10Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Nh0lM93U; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si1693835pgl.484.2019.02.08.03.30.04; Fri, 08 Feb 2019 03:30:21 -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=@ti.com header.s=ti-com-17Q1 header.b=Nh0lM93U; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbfBHLaA (ORCPT + 99 others); Fri, 8 Feb 2019 06:30:00 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:47074 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726465AbfBHL37 (ORCPT ); Fri, 8 Feb 2019 06:29:59 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x18BTr3g110425; Fri, 8 Feb 2019 05:29:53 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1549625393; bh=HGzvHnNfCkbD9HiE6oB+g14lGZLuNB9ZAn/E7+lLLbs=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=Nh0lM93UNTpWWMtfhdxGoBuptZTdZu7gazTdJ5g42ijxXimDxxI8xyKBX+r/UmWZ4 L7KzC8XdcUrEB/r0/+Afzsa6h10cyL4NCGenZU1NeUdAGAxkN274c3jO6UM1YaqsDT XnHfwvrddq+VET69MSHTCt2LdLDOMViy6cb1q234= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x18BTra8113898 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 8 Feb 2019 05:29:53 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 8 Feb 2019 05:29:52 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Fri, 8 Feb 2019 05:29:52 -0600 Received: from [172.24.190.172] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x18BTnEa007496; Fri, 8 Feb 2019 05:29:49 -0600 Subject: Re: [PATCH 5/8] usb: ohci-da8xx: add vbus and overcurrent gpios To: Bartosz Golaszewski , Kevin Hilman , Alan Stern , Greg Kroah-Hartman CC: , , , Linus Walleij , Bartosz Golaszewski References: <20190205102546.29457-1-brgl@bgdev.pl> <20190205102546.29457-6-brgl@bgdev.pl> From: Sekhar Nori Message-ID: Date: Fri, 8 Feb 2019 16:59:48 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190205102546.29457-6-brgl@bgdev.pl> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bartosz, On 05/02/19 3:55 PM, Bartosz Golaszewski wrote: > +static irqreturn_t ohci_da8xx_oc_handler(int irq, void *data) > +{ > + struct da8xx_ohci_hcd *da8xx_ohci = data; > + > + if (gpiod_get_value_cansleep(da8xx_ohci->oc_gpio)) > + gpiod_set_value_cansleep(da8xx_ohci->vbus_gpio, 0); > + > + return IRQ_HANDLED; > +} Its pretty strange to see gpiod_get_value_cansleep() being called from irq context, although I agree right now it uses SoC GPIOs so it should actually never sleep. Isn't it better to use gpiod_get_value() instead so you get a warning on incorrect usage? Thanks, Sekhar