From patchwork Tue Aug 18 12:18:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rajashekhara, Sudhakar" X-Patchwork-Id: 31555 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 41FA0B708C for ; Tue, 18 Aug 2009 22:23:05 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1MdNfY-0003lS-JZ; Tue, 18 Aug 2009 12:20:04 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1MdNfQ-0003Rh-OP for linux-mtd@lists.infradead.org; Tue, 18 Aug 2009 12:20:01 +0000 Received: from dflp53.itg.ti.com ([128.247.5.6]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n7ICJakd018201; Tue, 18 Aug 2009 07:19:41 -0500 Received: from tidmzi-ftp.india.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with SMTP id n7ICJXNc016910; Tue, 18 Aug 2009 07:19:34 -0500 (CDT) Received: from symphonyindia.ti.com (symphony-ftp [192.168.247.11]) by tidmzi-ftp.india.ext.ti.com (Postfix) with SMTP id BCC113886B; Tue, 18 Aug 2009 17:46:39 +0530 (IST) Received: from symx0096290 (symx0096290.tigoc.com [192.168.247.120]) by symphonyindia.ti.com (8.13.1/8.12.10) with ESMTP id n7ICCwTV030962; Tue, 18 Aug 2009 17:43:00 +0530 From: "Sudhakar Rajashekhara" To: "'Andrew Morton'" References: <1250613244-25447-1-git-send-email-sudhakar.raj@ti.com> <20090818011930.765d4895.akpm@linux-foundation.org> <00df01ca1fe7$60d5c810$22815830$@raj@ti.com> <20090818024908.90f528e1.akpm@linux-foundation.org> In-Reply-To: <20090818024908.90f528e1.akpm@linux-foundation.org> Subject: RE: [PATCH] [MTD] driver/Makefile: Initialize "mtd" and "spi" before "net" Date: Tue, 18 Aug 2009 17:48:06 +0530 Message-ID: <011101ca1ffd$f15ab100$d4101300$@raj@ti.com> MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acof6FRC+GNa/ZFJTRia5EcRpviFhgAEy7bA Content-Language: en-us X-Spam-Score: 1.2 (+) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 MSGID_MULTIPLE_AT Message-ID contains multiple '@' characters Cc: david-b@pacbell.net, dwmw2@infradead.org, davinci-linux-open-source@linux.davincidsp.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org On Tue, Aug 18, 2009 at 15:19:08, Andrew Morton wrote: > On Tue, 18 Aug 2009 15:06:35 +0530 "Sudhakar Rajashekhara" wrote: > > > On Tue, Aug 18, 2009 at 13:49:30, Andrew Morton wrote: > > > On Tue, 18 Aug 2009 12:34:04 -0400 Sudhakar Rajashekhara wrote: > > > > > > > On TI's da850/omap-l138 EVM, MAC address is stored in SPI flash. > > > > > > > > This patch changes the initialization sequence of the drivers by > > > > moving mtd and spi ahead of net in drivers/Makefile thereby > > > > enabling da850/omap-l138 ethernet driver to read the MAC address > > > > while booting. > > > > > > > > Signed-off-by: Sudhakar Rajashekhara > > > > --- > > > > drivers/Makefile | 4 ++-- > > > > 1 files changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/Makefile b/drivers/Makefile index > > > > bc4205d..2a1d41f 100644 > > > > --- a/drivers/Makefile > > > > +++ b/drivers/Makefile > > > > @@ -42,6 +42,8 @@ obj-y += macintosh/ > > > > obj-$(CONFIG_IDE) += ide/ > > > > obj-$(CONFIG_SCSI) += scsi/ > > > > obj-$(CONFIG_ATA) += ata/ > > > > +obj-$(CONFIG_MTD) += mtd/ > > > > +obj-$(CONFIG_SPI) += spi/ > > > > obj-y += net/ > > > > obj-$(CONFIG_ATM) += atm/ > > > > obj-$(CONFIG_FUSION) += message/ > > > > @@ -50,8 +52,6 @@ obj-y += ieee1394/ > > > > obj-$(CONFIG_UIO) += uio/ > > > > obj-y += cdrom/ > > > > obj-y += auxdisplay/ > > > > -obj-$(CONFIG_MTD) += mtd/ > > > > -obj-$(CONFIG_SPI) += spi/ > > > > obj-$(CONFIG_PCCARD) += pcmcia/ > > > > obj-$(CONFIG_DIO) += dio/ > > > > obj-$(CONFIG_SBUS) += sbus/ > > > > > > That isn't a particularly maintainable way of fixing this, > > > especially as there are no comments in that Makefile to prevent > > > someone from rebreaking it in the future. > > > > > > A better fix would be to use suitably prioritised initcalls - see > > > include/linux/init.h around line 187. > > > > > > > Currently mtd, spi and net subsystems are initialized with module_init. > > If I change the way in which these sub-systems are initialized, then > > I'll be breaking the support for these sub-systems to work as modules. > > In what way? > Now I got what you were saying. I was able to get the EMAC driver initialize later than spi and mtd by using late_initcall. With this change EMAC works as module as well. The patch looks as below: === I'll submit this patch to netdev list. Thanks, Sudhakar === diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 12fd446..5e6652b 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -2817,7 +2817,7 @@ static int __init davinci_emac_init(void) { return platform_driver_register(&davinci_emac_driver); } -module_init(davinci_emac_init); +late_initcall(davinci_emac_init); /** * davinci_emac_exit: EMAC driver module exit