From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9471C48BD6 for ; Thu, 27 Jun 2019 13:13:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 910712084B for ; Thu, 27 Jun 2019 13:13:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="kbVfFFQH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726587AbfF0NNc (ORCPT ); Thu, 27 Jun 2019 09:13:32 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:36832 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbfF0NNc (ORCPT ); Thu, 27 Jun 2019 09:13:32 -0400 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:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=fm7wk5NOwsV3tSIIRbW+oTp2HaLpDSjgRQD483H4QqU=; b=kbVfFFQHklhJKy0JHlX5AToJlk y+5q9OgDYo565asgVUAA1WFm4XXHfa4HrsqJJJztyLuvfqGB9gkrV7ak7MDHRYEyVVI3WGkdgjvNc yX8gmVr3/yQ56I+gUvohCX0QdzB7v6LM8lBZd1FRuS4stq31y1IWo0AcQpOyiHU+YEdY=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hgUDM-0008AZ-0W; Thu, 27 Jun 2019 15:13:24 +0200 Date: Thu, 27 Jun 2019 15:13:23 +0200 From: Andrew Lunn To: Baruch Siach Cc: Vivien Didelot , netdev@vger.kernel.org Subject: Re: [PATCH] net: dsa: mv88e6xxx: wait after reset deactivation Message-ID: <20190627131323.GA31189@lunn.ch> References: <92655572ed0c232b490967bed1245d121cc5a299.1561609786.git.baruch@tkos.co.il> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <92655572ed0c232b490967bed1245d121cc5a299.1561609786.git.baruch@tkos.co.il> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Jun 27, 2019 at 07:29:46AM +0300, Baruch Siach wrote: > Add a 1ms delay after reset deactivation. Otherwise the chip returns > bogus ID value. This is observed with 88E6390 (Peridot) chip. > > Signed-off-by: Baruch Siach > --- > drivers/net/dsa/mv88e6xxx/chip.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c > index f4e2db44ad91..549f528f216c 100644 > --- a/drivers/net/dsa/mv88e6xxx/chip.c > +++ b/drivers/net/dsa/mv88e6xxx/chip.c > @@ -4910,6 +4910,7 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev) > err = PTR_ERR(chip->reset); > goto out; > } > + mdelay(1); > > err = mv88e6xxx_detect(chip); > if (err) Hi Baruch So your switch is held in reset by default, by the bootloader? So you need to take it out of reset in order to detect it. Yes, this makes sense. However, please use usleep_range(10000, 20000), and only do this if the GPIO is valid. Thanks Andrew