Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2881940imu; Mon, 19 Nov 2018 07:31:18 -0800 (PST) X-Google-Smtp-Source: AJdET5e/GO8toLAlf5nzjpDpwnuoJybrmcl+0p+XPLXQgqa1oD/+cyxu1Tqdk3Z/79NwYGct0pHF X-Received: by 2002:a17:902:104:: with SMTP id 4-v6mr23328065plb.184.1542641478033; Mon, 19 Nov 2018 07:31:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542641478; cv=none; d=google.com; s=arc-20160816; b=rXm8QclVx1hdOt3HBRZdVVhiE3M7Vu9lVIH7yywcrgarOtG2UQsnhBCK2o7maU2B/S cPpU+GjcRHKgPA6ljDc4dNT9yJGQ1TcMOszUxinIKbabxlrhOI8cftxEFe9T+CDIPui0 eiGcSYMZAJL9PPBZEGCrU+PG62Pr45UhH/9cELSVJve8VL6bmOiOQfvWX9ryKXtpOy0R zp4efmo+v2ycV7zpGlWIPtbMjF4B5zA54M0JIBU5JVR/IMX/PkEG+n8L57kVcmiVDAP3 iCIisJbjhtrz9iRZEFpBqvOCsofem6+XuCOrF9sG7eOXjhAR/xT14CCz2QLEpZl+/dEu pU8A== 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=CgSBa2lOOWltF0vvpytwhnaY/O6GLg6OyNRbAYC/q90=; b=jqJBjBJRUtXwB9zb0+0WfKXN2Fn79sUtBLIwcBnP24vKmkrSwU7yYym0OrQIbmIhQ/ YaXWyMrOpYkBg8dDH13tpSxWcRC3C7Im/Cyg6XU7AwCPIY/lS4vUG1r8Kh8IC+aoavA1 uNMdDGl3fBE5reOHkJpdelWLe8s2rwMXiqd23hiSE7f0KuSHkfTJaD+yj+H8GaStdrAF aIorEwhvLUc54mtqctURwqVyTkgtB2gjL+s2q6fGUjmOQ8158LvIbebf6OMPxPHF0HpW P0ySCMg3BW/FnCKQGS3GfpRze6feES6BlmqiWKE20Zkqoz//n3DAkmn3f9eZJ6x+d5ZQ jCpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=KIAf2P88; 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 a2si39495153pgm.154.2018.11.19.07.31.02; Mon, 19 Nov 2018 07:31:17 -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=KIAf2P88; 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 S1729857AbeKTBw3 (ORCPT + 99 others); Mon, 19 Nov 2018 20:52:29 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:40609 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729746AbeKTBw3 (ORCPT ); Mon, 19 Nov 2018 20:52:29 -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=CgSBa2lOOWltF0vvpytwhnaY/O6GLg6OyNRbAYC/q90=; b=KIAf2P88fbDaFwJsDABF85Rw1tDmNPrYd7zpawDgrgPznldH9ZO70COPXGKsKzKO0Av1VzqBawhQE+uO4GdJl1AtiYli5Di3nZbPxsygOnEP2+rpPrm+dUCWFXblxJJVmHqtwO6ZBGgkGQbqTT0WvDHa3OA1pFal/Lu66pVRcOU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1gOlTS-0007n1-6r; Mon, 19 Nov 2018 16:28:30 +0100 Date: Mon, 19 Nov 2018 16:28:30 +0100 From: Andrew Lunn To: Andreas Schwab Cc: Quentin Schulz , davem@davemloft.net, f.fainelli@gmail.com, allan.nielsen@microchip.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com, linux-riscv@lists.infradead.org Subject: Re: [PATCH net-next v3 1/6] net: phy: mscc: migrate to phy_select/restore_page functions Message-ID: <20181119152830.GE26852@lunn.ch> References: <20181008100728.24959-1-quentin.schulz@bootlin.com> <20181008100728.24959-2-quentin.schulz@bootlin.com> <20181119151057.GC26852@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Mon, Nov 19, 2018 at 04:13:10PM +0100, Andreas Schwab wrote: > On Nov 19 2018, Andrew Lunn wrote: > > > On Mon, Nov 19, 2018 at 03:57:17PM +0100, Andreas Schwab wrote: > >> On Okt 08 2018, Quentin Schulz wrote: > >> > >> > The Microsemi PHYs have multiple banks of registers (called pages). > >> > Registers can only be accessed from one page, if we need a register from > >> > another page, we need to switch the page and the registers of all other > >> > pages are not accessible anymore. > >> > > >> > Basically, to read register 5 from page 0, 1, 2, etc., you do the same > >> > phy_read(phydev, 5); but you need to set the desired page beforehand. > >> > > >> > In order to guarantee that two concurrent functions do not change the > >> > page, we need to do some locking per page. This can be achieved with the > >> > use of phy_select_page and phy_restore_page functions but phy_write/read > >> > calls in-between those two functions shall be replaced by their > >> > lock-free alternative __phy_write/read. > >> > > >> > Let's migrate this driver to those functions. > >> > >> This has some serious locking problem. > > > > Hi Andreas > > > > Could you be more specific. Are you getting a deadlock? A WARN_ON? > > See the stack trace. That's where it hangs. So you never said it hangs. The stacktrace helps, but a description of what actually happens also helps. And i expect Quentin has booted this code lots of times and not had a hang. So some hits how to reproduce it would also help. Maybe your kernel config? I'm interested because he is using the core mdio locking primitives. If those are broken, i want to know. Thanks Andrew