Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933842AbbDQPrU (ORCPT ); Fri, 17 Apr 2015 11:47:20 -0400 Received: from mail-bn1bon0130.outbound.protection.outlook.com ([157.56.111.130]:23616 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933310AbbDQPrS (ORCPT ); Fri, 17 Apr 2015 11:47:18 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; Message-ID: <55312AF7.7070504@freescale.com> Date: Fri, 17 Apr 2015 08:47:03 -0700 From: York Sun User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: CC: , , , Subject: Re: Need some guidance on i2c-ocores driver References: <55304D8E.8070204@freescale.com> In-Reply-To: <55304D8E.8070204@freescale.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [192.88.168.49] X-ClientProxiedBy: DM2PR10CA0014.namprd10.prod.outlook.com (25.160.213.24) To BY2PR03MB158.namprd03.prod.outlook.com (10.242.36.15) X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB158;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB159; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1;SFV:NSPM;SFS:(10019020)(6049001)(6009001)(24454002)(52034003)(54094003)(51704005)(479174004)(377454003)(377424004)(86362001)(77096005)(36756003)(42186005)(4001350100001)(54356999)(99136001)(65816999)(87266999)(50986999)(76176999)(65956001)(65806001)(66066001)(2950100001)(77156002)(62966003)(92566002)(47776003)(83506001)(110136001)(19580405001)(80316001)(87976001)(33656002)(2351001)(40100003)(19580395003)(122386002)(46102003)(23676002)(64126003)(50466002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR03MB158;H:[10.214.82.182];FPR:;SPF:None;MLV:sfv;LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:BY2PR03MB158;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB158; X-Forefront-PRVS: 0549E6FD50 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2015 15:47:09.8020 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB158 X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3013 Lines: 77 Resend to LKML Lee, This question is actually more about MFD. Can you point me to the possible causes for my failure below? Thanks. York On 04/16/2015 05:02 PM, York Sun wrote: > Julia and other experts, > > I am seeking for help on my device driver. > > I am working on a module driver for a FPGA design with open core I2C controller > memory-mapped to BAR2. I have searched up and down and found only one driver > (drivers/mfd/timberdale.c) with similar implementation. Following timberdale > driver, I am able to load the driver, but blocked by devm_ioremap_resource(). It > is always in conflict with my BAR2. I wonder if I did something wrong. Here is > the flow I tracked so far. (By the way, I am using an older kernel 3.12. The new > 4.0 kernel crashes when booting on my platform. I plan to move to newer kernel > later). > > mfd_add_devices() > | > |--mfd_add_device() > | > |--platform_device_add() > | > |--insert_resource() /* this passed */ > | | > | |--insert_resource_conflict() > | > |--device_add() > | > |--bus_probe_device() > | > |--devm_ioremap_resource() > | > |--devm_request_mem_region() > | > |--__request_region() /* this always conflicts */ > | > |--__request_resource() > > My driver is called RedStone DMA. Here is my debug output > >> root@p1022ds:~# insmod redstone_mfd.ko >> RedStone DMA 0002:05:00.0: pci_enable_device() successful >> RedStone DMA 0002:05:00.0: MSI-X init successful >> York kernel: Calling devm_ioremap_resource() >> York kernel kernel/resource.c __request_region 977: conflict=[??? 0xc00080000-0xc00087fff flags 0x80000000] >> ocores-i2c ocores-i2c: can't request region for resource [mem 0xc00086000-0xc0008601f] >> ocores-i2c: probe of ocores-i2c failed with error -16 >> RedStone DMA 0002:05:00.0: BAR[0] 0x0000000c00000000-0x0000000c0007ffff flags 0x0014220c, length 524288 >> RedStone DMA 0002:05:00.0: BAR[1] 0x0000000000000000-0x0000000000000000 flags 0x00000000, length 0 >> RedStone DMA 0002:05:00.0: BAR[2] 0x0000000c00080000-0x0000000c00087fff flags 0x00040200, length 32768 >> RedStone DMA 0002:05:00.0: BAR[3] 0x0000000000000000-0x0000000000000000 flags 0x00000000, length 0 >> RedStone DMA 0002:05:00.0: BAR[4] 0x0000000000000000-0x0000000000000000 flags 0x00000000, length 0 >> RedStone DMA 0002:05:00.0: BAR[5] 0x0000000000000000-0x0000000000000000 flags 0x00000000, length 0 >> RedStone DMA 0002:05:00.0: Version 1.4, built on 4-16-15, id 0 >> root@p1022ds:~# > > Can you shed some light on this? > > Thanks. > > York > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/