Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752822AbbDTRz5 (ORCPT ); Mon, 20 Apr 2015 13:55:57 -0400 Received: from mail-bn1bon0116.outbound.protection.outlook.com ([157.56.111.116]:42358 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752013AbbDTRzw (ORCPT ); Mon, 20 Apr 2015 13:55:52 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; Message-ID: <55352839.70905@freescale.com> Date: Mon, 20 Apr 2015 09:24:25 -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: Lee Jones CC: , , , Subject: Re: Need some guidance on i2c-ocores driver References: <55304D8E.8070204@freescale.com> <55312AF7.7070504@freescale.com> <20150420064231.GE3447@x1> In-Reply-To: <20150420064231.GE3447@x1> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [192.88.168.50] X-ClientProxiedBy: BLUPR05CA0056.namprd05.prod.outlook.com (10.141.20.26) 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:BY2PR03MB347; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1;SFV:NSPM;SFS:(10019020)(6049001)(6009001)(51704005)(479174004)(377454003)(62966003)(92566002)(77096005)(36756003)(47776003)(65956001)(4001350100001)(42186005)(86362001)(66066001)(87976001)(2950100001)(83506001)(50986999)(110136001)(77156002)(117636001)(40100003)(76176999)(46102003)(54356999)(65816999)(50466002)(64126003)(23676002)(62816006);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR03MB158;H:[10.214.82.223];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: 05529C6FDB X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2015 16:24:32.3023 (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: 1603 Lines: 44 On 04/19/2015 11:42 PM, Lee Jones wrote: > On Fri, 17 Apr 2015, York Sun wrote: > >> Resend to LKML >> >> Lee, >> >> This question is actually more about MFD. Can you point me to the possible >> causes for my failure below? > > It's hard to tell exactly without code, but it looks like you're > trying to allocate overlapping memory regions. Double check all of > your addresses. For DT you need to take a look at your 'reg' > properties, for traditional platform data it's best to grep for > IORESOURCE_MEM. > Lee, It _is_ overlapping. How could it not be? The resource for the I2C is mapped to BAR2. So the resource is overlapping with BAR2. It is alway the case, isn't it? What I don't understand is how MFD works with the resources if it is guaranteed overlapping. Did I get something wrong? Look at the reference code I took, drivers/mfd/timberdale.c, when mfd_add_devices() is called, it uses &dev->resource as the base. So the BAR will be the parent. Check the code in mfd-core.c, mfd_add_device(), if ((cell->resources[r].flags & IORESOURCE_MEM) && mem_base) { res[r].parent = mem_base; res[r].start = mem_base->start + cell->resources[r].start; res[r].end = mem_base->start + cell->resources[r].end; } So the MFD resource is within its parent. When later the device driver request a region, will it get conflict with the parent? 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/