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=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,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 CF452C43441 for ; Mon, 19 Nov 2018 15:29:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A388D206BB for ; Mon, 19 Nov 2018 15:29:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="U85CkOjZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="fSbYMA8Y"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="KIAf2P88" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A388D206BB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lunn.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ehl9wbtoWZVAvYxj9joRl2zqgLVMIntCTqbUqbCZchg=; b=U85CkOjZcLEuVJ 4XyGdBTNxsp+4t52tfyBesu+CuV2M/SPo0e+N01KkG5D2WvZYviliBmVZ177UwZVuq2I8XubHwgnp AGLQ9tbBskd73Ae0lL0PemnvIhVjC9mfybUzHSlpP2s+oEa0acwBsG24SU5jqbHnjSUHBrDK1MWEf y8H30kp5KVdMw+hl1+FM9h1TcCFDgAy9VfyeDPaD3XQcZoYPOduLrHXLeqh+jAY8xk5ArxYnNolfs 5vAGYQhxXSB8K9tOfpaHOENPEsF5FLQWbfavlBooW7yklSHafu4haQDvqVOj7u6CXrMkPSOF5QSqp n1+HCJ5BOipxXZoZ000g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOlTo-0008V7-BH; Mon, 19 Nov 2018 15:28:52 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOlTm-0008Uz-Jc for linux-riscv@bombadil.infradead.org; Mon, 19 Nov 2018 15:28:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=CgSBa2lOOWltF0vvpytwhnaY/O6GLg6OyNRbAYC/q90=; b=fSbYMA8Y9wyjJ4SCDC0Yl3Ono FQxfFY2c8pYVCzdqkKby2fw+b4G3SX8n3a2sQ1j+p8UmwVHeA810Xy7AEtKuXRxIKkqxBF6ywqIvS XoPBgPm/+8rdxULsby8NgHoPDgxWUbSkpv85a7YlUFgnnGRoPe1N9kL4fjl7bvURI4TEiFcFe6Pek uHYGHTbHK9JI94MyjI722/d3yMrz/6gIuRCpD7KIfieRiMD2L+6BM/wG9lm+xCbSPZVdH6FuWGO7W WXIeLcBEGjsUu0DGNPVu28PmS2L9nHDB5B9MKJFVVWnbvzMFw6JVLQ4pdBg0tkXAt3s8fprnHZ43S CWrxZMcaw==; Received: from vps0.lunn.ch ([185.16.172.187]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOlTi-0006BJ-Ho for linux-riscv@lists.infradead.org; Mon, 19 Nov 2018 15:28:48 +0000 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181119_152846_613212_FBB06AE5 X-CRM114-Status: GOOD ( 22.71 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, f.fainelli@gmail.com, Quentin Schulz , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, allan.nielsen@microchip.com, thomas.petazzoni@bootlin.com, linux-riscv@lists.infradead.org, davem@davemloft.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org Message-ID: <20181119152830.G9QTZpQ4MaHa7tdYKJlYfshhJntra1bTt0TxmKuHYzw@z> 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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv