Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758308AbbDXRZQ (ORCPT ); Fri, 24 Apr 2015 13:25:16 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:36089 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756179AbbDXRZL (ORCPT ); Fri, 24 Apr 2015 13:25:11 -0400 Message-ID: <553A7C73.7040002@cogentembedded.com> Date: Fri, 24 Apr 2015 20:25:07 +0300 From: Sergei Shtylyov Organization: Cogent Embedded User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Florian Fainelli , David Miller , vivien.didelot@savoirfairelinux.com CC: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com Subject: Re: [PATCH] net: mdio-gpio: support access that may sleep References: <1429722414-18173-1-git-send-email-vivien.didelot@savoirfairelinux.com> <20150424.110455.2117537129018647564.davem@davemloft.net> <553A67B2.3040400@gmail.com> In-Reply-To: <553A67B2.3040400@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1214 Lines: 31 On 04/24/2015 06:56 PM, Florian Fainelli wrote: >>> Some systems using mdio-gpio may use gpio on message based busses, which >>> require sleeping (e.g. gpio from an I2C I/O expander). >>> Since this driver does not use IRQ handler, it is safe to use the >>> _cansleep suffixed gpio accessors. >>> Signed-off-by: Vivien Didelot >> Since this is down underneath the layer of an MII bus, you cannot >> universally say that these routines are always called in a sleepable >> context. >> The PHY layer, and the driver itself above that, might call these >> routines from timers, interruptes etc. > The PHY library calls these routines from its state machine workqueue > for that reason, or from process context (when invoked via ethtool > ioctl). The only special case is phy_mac_interrupt() which is callable > from interrupt context, It is not (as we have discussed recently) -- cancel_work_sync() may sleep. WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/