Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757847AbbDXPFJ (ORCPT ); Fri, 24 Apr 2015 11:05:09 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:50890 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756701AbbDXPFF (ORCPT ); Fri, 24 Apr 2015 11:05:05 -0400 Date: Fri, 24 Apr 2015 11:04:55 -0400 (EDT) Message-Id: <20150424.110455.2117537129018647564.davem@davemloft.net> To: vivien.didelot@savoirfairelinux.com Cc: netdev@vger.kernel.org, f.fainelli@gmail.com, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com Subject: Re: [PATCH] net: mdio-gpio: support access that may sleep From: David Miller In-Reply-To: <1429722414-18173-1-git-send-email-vivien.didelot@savoirfairelinux.com> References: <1429722414-18173-1-git-send-email-vivien.didelot@savoirfairelinux.com> X-Mailer: Mew version 6.6 on Emacs 24.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 24 Apr 2015 08:05:04 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1313 Lines: 32 From: Vivien Didelot Date: Wed, 22 Apr 2015 13:06:54 -0400 > 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. In fact, since the whole point of this driver is to provide a specific implementation for programming registers over an MII bus, it's quite rediculuous to say that just because interrupts are not used in this implementation it means that sleeping is always valid. You have to look at all of the (real and potential) users, all the way up into the specific ethernet drivers. Sorry I'm not applying this. -- 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/