Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp610906pxb; Wed, 27 Jan 2021 16:42:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzN2gBi03mfjBG+AtbJWRcaXVCsHjoU+3KpOi0j02W2G2gooml67h5R6UZRWuWikcqmg5xg X-Received: by 2002:a17:906:409:: with SMTP id d9mr8462200eja.70.1611794567588; Wed, 27 Jan 2021 16:42:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611794567; cv=none; d=google.com; s=arc-20160816; b=yqaSef+VeQS5RoqQJTSYD+hbgZ4l24cjq64fUfyiYPuAX2t+7aUeZfRR23tCBWcHUH z3tbPXOptc9LOuiSxvjIW6I9lnH7rB3/0AyAvWe1hebwZqNQbVahIBQq7TfPZnbayy2L ri2MlZFo11iG7fBYR5UuBNeJKl9e8VHPRNI39ZYrU+j/KcAINApTtPwpC++o8L7a7I+1 soVcQE3RnwgXcgI/Q4EtybxEv/4vaYGtOzMQ5WPbb3oYkIc5tFRbgvEvXqHJWMHaZ3Db d6dr0AZIpU5UO/1SNT4aJPw1Lm1dgQ6EaEG+Tbc+XsYaTQHnLAOwSBN9RP1mdkueBH7g Hr4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=t5Lxw6VympidoyJmMWJodUtnWQ8dd2LkbM2KGoqGZzo=; b=zxYnzQqXn4AxFA2MqpXfvKUVmI90u/JhNOj2ezTV+bx4+bqIjSq9pbcoJHe92KviGj h3CCZwCxy9bixpuWZjvT0F7T3Ng5hlp0DLjAjoZwsZRePZCajIVmVy+v1sfch5Hp+bNw h9HP31Qreid6rJUMvZYja7IKBNyfsgBChgGLBnkNexlL4ttQHvlQH+a8lWCWJfhdJni+ wsT87ZGdZpeQTYh4mQBtm1g9urF+K3Tdt3cz2WrhtGefwgY38sY4RpTNKyhPZ5twjkkV nLZfB59XyUjCh+dfzFCGNAYWBRnw5OrhqpY8J4njkGW8p1jPonSldHl6smuiMwSxYdVR 4eGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=frLYgKOc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si1507008eja.208.2021.01.27.16.42.23; Wed, 27 Jan 2021 16:42:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=frLYgKOc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231947AbhA0Wz4 (ORCPT + 99 others); Wed, 27 Jan 2021 17:55:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:38970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231825AbhA0WzT (ORCPT ); Wed, 27 Jan 2021 17:55:19 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 179EA64DD9; Wed, 27 Jan 2021 22:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611788078; bh=RFMVTbPsJbSB9O0MyrO+zDcpU34HRr63zx+ty6mxMAU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=frLYgKOc19UXPnETTmyUbXtCKwYN9rDS2rTHbdYgq1FQ311cOmgk20xncKOFqQywN pEtvDEtQt61mkS3YipJ7Dtv+kHKjbh/g1gl4D1GrQVi4+TtEDwCrToth83nGwSGVAT eMZPQJxQeJFSF0/n4B/2C3uUF/7AT6Xk1UY63jEZF9FdnQjc0WNIls9W99Ye6/+TYp cPT1rc3rC9C22AW6D5r46L+u7CKqeOPpaEAYeYaZTKIirV3kPGwP6gcDBOpXm2MDSE Z1w3Uto8DKBi/tCvyL2X4PaUPfASgCOfVckSqwCPl0Zr3huPKVuWeem+lHLMXCyjrT jBx9QbuJBfazQ== Date: Wed, 27 Jan 2021 14:54:37 -0800 From: Jakub Kicinski To: Mike Looijmans Cc: Russell King - ARM Linux admin , Andrew Lunn , netdev@vger.kernel.org, "David S. Miller" , Heiner Kallweit , linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: mdiobus: Prevent spike on MDIO bus reset signal Message-ID: <20210127145437.1f5227b5@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20210126073337.20393-1-mike.looijmans@topic.nl> <20210126134937.GI1551@shell.armlinux.org.uk> <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.b4d05392-d8bb-4828-9ac6-5a63736d3625@emailsignatures365.codetwo.com> <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.0d2bd5fa-15cc-4b27-b94e-83614f9e5b38.23e4b566-2e4d-4160-a40f-4bf79ef86f8a@emailsignatures365.codetwo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 Jan 2021 08:08:29 +0100 Mike Looijmans wrote: > > Andrew, I don't get what you're saying. > > > > Here is what happens depending on the pre-existing state of the > > reset signal: > > > > Reset (previously asserted): ~~~|_|~~~~|_______ > > Reset (previously deasserted): _____|~~~~|_______ > > ^ ^ ^ > > A B C > > > > At point A, the low going transition is because the reset line is > > requested using GPIOD_OUT_LOW. If the line is successfully requested, > > the first thing we do is set it high _without_ any delay. This is > > point B. So, a glitch occurs between A and B. > > > > We then fsleep() and finally set the GPIO low at point C. > > > > Requesting the line using GPIOD_OUT_HIGH eliminates the A and B > > transitions. Instead we get: > > > > Reset (previously asserted) : ~~~~~~~~~~|______ > > Reset (previously deasserted): ____|~~~~~|______ > > ^ ^ > > A C > > > > Where A and C are the points described above in the code. Point B > > has been eliminated. > > > > Therefore, to me the patch looks entirely reasonable and correct. > > > Thanks, excellent explanation. > > As a bit of background, we were using a Marvell PHY where the datasheet > states that thou shallt not release the reset within 50 ms of power-up. > A pull-down on the active-low reset was thus added. Looking at the reset > signal with a scope revealed a short spike, visible only because it was > being controlled by an I2C GPIO expander. So it's indeed point "B" that > we wanted to eliminate. This is all useful information - can we roll more of it into the commit message? I'd think that calling out the part and the 50ms value could make things more "concrete" for a reader down the line?