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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 6FAA0C11D00 for ; Thu, 20 Feb 2020 23:00:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C7E1206F4 for ; Thu, 20 Feb 2020 23:00:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729313AbgBTXAz (ORCPT ); Thu, 20 Feb 2020 18:00:55 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:59950 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727135AbgBTXAy (ORCPT ); Thu, 20 Feb 2020 18:00:54 -0500 Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id CC0CD15BCCC54; Thu, 20 Feb 2020 15:00:53 -0800 (PST) Date: Thu, 20 Feb 2020 15:00:51 -0800 (PST) Message-Id: <20200220.150051.2170993471455503146.davem@davemloft.net> To: alexandre.belloni@bootlin.com Cc: nicolas.ferre@microchip.com, linux@armlinux.org.uk, antoine.tenart@bootlin.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net v2] net: macb: Properly handle phylink on at91rm9200 From: David Miller In-Reply-To: <20200219141551.5152-1-alexandre.belloni@bootlin.com> References: <20200219141551.5152-1-alexandre.belloni@bootlin.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 20 Feb 2020 15:00:54 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexandre Belloni Date: Wed, 19 Feb 2020 15:15:51 +0100 > at91ether_init was handling the phy mode and speed but since the switch to > phylink, the NCFGR register got overwritten by macb_mac_config(). The issue > is that the RM9200_RMII bit and the MACB_CLK_DIV32 field are cleared > but never restored as they conflict with the PAE, GBE and PCSSEL bits. > > Add new capability to differentiate between EMAC and the other versions of > the IP and use it to set and avoid clearing the relevant bits. > > Also, this fixes a NULL pointer dereference in macb_mac_link_up as the EMAC > doesn't use any rings/bufffers/queues. > > Fixes: 7897b071ac3b ("net: macb: convert to phylink") > Signed-off-by: Alexandre Belloni Applied and queued up for -stable, thanks.