Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8479622imu; Thu, 15 Nov 2018 12:15:47 -0800 (PST) X-Google-Smtp-Source: AJdET5dZxWt9K9jCQyaL7+UfqxJcurVjn8AnQQsc6rskPy+Lt2Xx4SAwQHoDQQymTWYrEacT8TPG X-Received: by 2002:a63:e84c:: with SMTP id a12mr7032424pgk.241.1542312947049; Thu, 15 Nov 2018 12:15:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542312947; cv=none; d=google.com; s=arc-20160816; b=NJuNVNtho5FFj2ya/riVzIDcciYc2xNID49P86WXBUrdKG1Mpyjy5Wmk/uXyWuJYPv gaXDZBcSkLi4xjbpbMLYJ9khILJIahYgoyC2wWGR3yBQTLG+nkYtRCcmh3c2504U2rlB jDG7Pvn4Wh7OO70f+nUv0fRBlUEsub4zxdGsd2getA9gJXTxzCAWVbgAPJnVdJRKxpFR R0sXDHqM/qd8pIo4kTd2KKTxA7r/L/0sm9NWThBM4QZrH+j7QyEcYevwq9hDFbIwlYSo M9VRH3gtnxv49DLSLzquN/9s5we8pkRFe4oo+e3aQQgN4deyIx1SgwzAw2w9WlNPJ5RA raUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fSGfgKaQR3+VNuCpmAQk+/qqVKIU6He0zp4tJUZiEGg=; b=nAWt/BCHXyorO1qS7qFTQBSZ5OEUs/dNVi689yH8NmFk4taIJ87zIYCr08xeqnB/Gd 4Y+eHDk5qNxrpQszipoC6FWmJRIqhDnIK9cEC0nG1KCX/Q3h/JZPfdGVn8Z8jhtwQ5ov nHaQBEPrUGpO4X1UTOTXsuTsnTM1RkMKIS5Q5fXSiiFpPaBv2OzC7HBnm8Oy3BPq4C3Y 69a+RqwivX0UGu0OsgweYbJezRiEGofSF1Kxxr6H/l+8/NKB8iKK9OanjiSazmX2GxZz NC0S2UDh3Gp9h3vGvDP0KXWdlCZtJD1IYRXJ/T0azurPzpgr5oPWBaCIjY4fzE/VpM7y 3Cgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=pmYHwEcG; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si25068440pgc.448.2018.11.15.12.15.30; Thu, 15 Nov 2018 12:15:47 -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=@lunn.ch header.s=20171124 header.b=pmYHwEcG; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388994AbeKPGVx (ORCPT + 99 others); Fri, 16 Nov 2018 01:21:53 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:36473 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbeKPGVx (ORCPT ); Fri, 16 Nov 2018 01:21:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=fSGfgKaQR3+VNuCpmAQk+/qqVKIU6He0zp4tJUZiEGg=; b=pmYHwEcGRGw800jexc8oj6BtMPRm3RyHbU0wSGVkneXnAdFYNj4V2JUROAMPWRzdK+HTMP8eqKsqPrOe5X8LBfcVSLGjrj5wBokjx8czvy8bssWtRYhGIDqyTrH0xXslyUVFmkFesi6CVQmjTIf4kaMR13bFvoQ1Yt3LXfDKCmg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1gNO09-0000QA-4j; Thu, 15 Nov 2018 21:12:33 +0100 Date: Thu, 15 Nov 2018 21:12:33 +0100 From: Andrew Lunn To: Martin Schiller Cc: sergei.shtylyov@cogentembedded.com, f.fainelli@gmail.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5] net: phy: mdio-gpio: Fix working over slow can_sleep GPIOs Message-ID: <20181115201233.GE32274@lunn.ch> References: <20181114061703.11026-1-ms@dev.tdt.de> <20181115052428.8133-1-ms@dev.tdt.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181115052428.8133-1-ms@dev.tdt.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 15, 2018 at 06:24:28AM +0100, Martin Schiller wrote: > Up until commit 7e5fbd1e0700 ("net: mdio-gpio: Convert to use gpiod > functions where possible"), the _cansleep variants of the gpio_ API was > used. After that commit and the change to gpiod_ API, the _cansleep() > was dropped. This then results in WARN_ON() when used with GPIO > devices which do sleep. Add back the _cansleep() to avoid this. > > Fixes: 7e5fbd1e0700 ("net: mdio-gpio: Convert to use gpiod functions where possible") > Signed-off-by: Martin Schiller > --- > v5: > - reworked commit message > - added "Fixes:" tag > - based on DaveM net tree instead of mainline Hi Martin Thanks for these changes. We are much closer now. > @@ -162,6 +162,10 @@ static int mdio_gpio_probe(struct platform_device *pdev) > if (ret) > return ret; > > + if (gpiod_cansleep(bitbang->mdc) || gpiod_cansleep(bitbang->mdio) || > + gpiod_cansleep(bitbang->mdo)) > + dev_warn(&pdev->dev, "Slow GPIO pins might wreak havoc into MDIO bus timing"); > + I talked with Florian about this. We would like this hunk of the patch dropped 1) For a patch which is going to stable, it does not fit. It does not actually fix anything. 2) I'm not sure it has any value. The hardware has been designed like that. There is nothing which can be done about it. Printing a message is not going to help users. Andrew