From patchwork Sun Feb 16 19:20:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 204745 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=-9.6 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_GIT autolearn=unavailable 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 7670FC7619C for ; Sun, 16 Feb 2020 19:21:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52ACE20857 for ; Sun, 16 Feb 2020 19:21:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=goldelico.com header.i=@goldelico.com header.b="Zq0exAHU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728049AbgBPTVg (ORCPT ); Sun, 16 Feb 2020 14:21:36 -0500 Received: from mo4-p04-ob.smtp.rzone.de ([81.169.146.178]:13562 "EHLO mo4-p04-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbgBPTVJ (ORCPT ); Sun, 16 Feb 2020 14:21:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1581880867; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=oqhgP+NtrwgBX56WD4djyrk4OHTirbJ1JPDtLAAIn4U=; b=Zq0exAHUW7mN6WAgqTWaIq3IQcsNs7q0p4lBZJ6SBxPmw74FuqNLXMt5k18mNJLBw3 u2vjKRTMYRVgIO5WX+iO8qLwNkDOwzL4aoKxovy3GaaRqA9B2BBS7gaWJCw0vcOovu2p 1CWIFviuiPz+xB0RcxzR9wq0N5ia56TySgJ959kbW2jLiFqRHGnNDoEW+Ic7hTwjia15 8JbAtUYXlB8GRQqv0jnYc7rBvDrOoWNVz7eLBpP3sHpLmR/uXG0N+9N0HR7USwEupWaC thBmKdbDb33YA8BbRYKAug8KyclWaU1RB/zMAymtk4u7tpR8gR3njKUxHfNjQ+uj9RU0 T34w== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o1OAA2UNf2M0OoPPevMB" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 46.1.12 DYNA|AUTH) with ESMTPSA id U06217w1GJKwJlg (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sun, 16 Feb 2020 20:20:58 +0100 (CET) From: "H. Nikolaus Schaller" To: PrasannaKumar Muralidharan , Paul Cercueil , Mathieu Malaterre , Srinivas Kandagatla , Rob Herring , Mark Rutland , Ralf Baechle , Paul Burton , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Jonathan Cameron , "H. Nikolaus Schaller" , Krzysztof Kozlowski , Kees Cook , Andi Kleen , Geert Uytterhoeven Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com Subject: [RFC v3 9/9] MIPS: CI20 defconfig: DEMO HACK: make DM9000 a module Date: Sun, 16 Feb 2020 20:20:51 +0100 Message-Id: <71ea739c7be432da356b4d3f7dca8b7658f3d2fb.1581880851.git.hns@goldelico.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org It appears that reading the ethernet mac address from NVMEM, i.e. through the jz4780-efuse driver, requires the jz4780-efuse driver to be up and running before the dm9000 driver is probed. This is because there is a registration mechanism for nvmem devices and consumers scan the global table. If the provider has not yet been registered, the required matching entry is not found and the consumer assumes there is no nvram. In the case of the dm9000 it will not wait but assign a random MAC address. It appears that if the dm9000 is configured into the kernel binary, it will be probed first and the correct sequence is broken. If it is a module (or even both), the way deferred probing works seems to serialize properly. So this hack is for demo purposes only and makes the dm9000 probing being delayed. A proper solution is to make sure the jz4780-efuse driver is probed earlier than the dm9000 driver (or mac address lookup). Signed-off-by: H. Nikolaus Schaller --- arch/mips/configs/ci20_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig index 614dc18211bc..1d3d1d9b62bc 100644 --- a/arch/mips/configs/ci20_defconfig +++ b/arch/mips/configs/ci20_defconfig @@ -59,7 +59,7 @@ CONFIG_MTD_UBI_FASTMAP=y CONFIG_NETDEVICES=y # CONFIG_NET_VENDOR_ARC is not set # CONFIG_NET_VENDOR_BROADCOM is not set -CONFIG_DM9000=y +CONFIG_DM9000=m CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL=y # CONFIG_NET_VENDOR_INTEL is not set # CONFIG_NET_VENDOR_MARVELL is not set