mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: York Sun <yorksun@freescale.com>
To: <lee.jones@linaro.org>
Cc: <Julia.Lawall@lip6.fr>, <linux-i2c@vger.kernel.org>,
	<wolfram@the-dreams.de>, <linux-kernel@vger.kernel.org>
Subject: Re: Need some guidance on i2c-ocores driver
Date: Fri, 17 Apr 2015 08:47:03 -0700	[thread overview]
Message-ID: <55312AF7.7070504@freescale.com> (raw)
In-Reply-To: <55304D8E.8070204@freescale.com>

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
> 

       reply	other threads:[~2015-04-17 15:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <55304D8E.8070204@freescale.com>
2015-04-17 15:47 ` York Sun [this message]
2015-04-20  6:42   ` Lee Jones
2015-04-20 16:24     ` York Sun
2015-04-20 18:16       ` Lee Jones
2015-04-20 18:31         ` York Sun
2015-04-21  7:35           ` Lee Jones
2015-05-06 21:41             ` Why isn't IRQ shared for i2c-ocore York Sun
2015-05-07  7:01               ` Lee Jones
2015-05-07 14:46                 ` York Sun
2015-05-08  6:47                 ` Geert Uytterhoeven
2015-05-08  6:57                   ` Lee Jones
2015-05-08  7:07                     ` Geert Uytterhoeven
2015-05-08  7:27                       ` Lee Jones
2015-05-08  8:03                         ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55312AF7.7070504@freescale.com \
    --to=yorksun@freescale.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=lee.jones@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wolfram@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome