From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [BUG] cannot access IO ports in CMI8738 sound chip.
Date: Mon, 21 Jan 2008 09:37:03 +0000 [thread overview]
Message-ID: <20080121093703.GA20646@linux-sh.org> (raw)
In-Reply-To: <20080121.152550.68560038.matsu@igel.co.jp>
On Mon, Jan 21, 2008 at 04:39:04PM +0900, Katsuya MATSUBARA wrote:
> [ 0.305614] Autoconfig PCI channel 0x8c22001c
> [ 0.310461] Scanning bus 00, I/O 0xfe240000:0xfe280000, Mem 0xfd000000:0xfe000000
> [ 0.318774] 00:00.0 Class 0401: 13f6:0111 (rev 10)
> [ 0.324051] I/O at 0xfe240000 [size=0x100]
> [ 0.329356] 00:01.0 Class 0200: 10ec:8139 (rev 10)
> [ 0.334619] I/O at 0xfe240100 [size=0x100]
> [ 0.339911] Mem at 0xfd000000 [size=0x100]
> [ 0.345214] 00:02.0 Class 0607: 104c:ac55 (rev 01)
> [ 0.350470] CARDBUS Bridge: primary\0, secondary\x01
> [ 0.356192] PCI Autoconfig: Found CardBus bridge, device 2 function 0
> [ 0.363240] Mem at 0xfd001000 [size=0x1000]
> [ 0.368611] Scanning sub bus 01, I/O 0xfe240200, Mem 0xfd002000
> [ 0.375162] Back to bus 00, sub_bus is 1
> [ 0.379501] 00:02.1 Class 0607: 104c:ac55 (rev 01)
> [ 0.384758] CARDBUS Bridge: primary\0, secondary\x02
> [ 0.390480] PCI Autoconfig: Found CardBus bridge, device 2 function 1
> [ 0.397526] Mem at 0xfd003000 [size=0x1000]
> [ 0.402923] Scanning sub bus 02, I/O 0xfe240204, Mem 0xfd004000
> [ 0.409474] Back to bus 00, sub_bus is 2
> [ 0.413821] 00:03.0 Class 0200: 10ec:8139 (rev 10)
> [ 0.419112] I/O at 0xfe240300 [size=0x100]
> [ 0.424373] Mem at 0xfd005000 [size=0x100]
[snip]
> [ 1.203222] PCI: Device 0000:00:01.0 not available because of resource collisions
> [ 1.222452] Trying to free nonexistent resource <0000000000002000-00000000000020ff>
> [ 1.242071] Trying to free nonexistent resource <0000000000000000-00000000000000ff>
> [ 1.261898] 8139too: probe of 0000:00:01.0 failed with error -22
> [ 1.274109] PCI: Device 0000:00:03.0 not available because of resource collisions
> [ 1.295385] Trying to free nonexistent resource <0000000000000000-00000000000000ff>
> [ 1.317670] Trying to free nonexistent resource <0000000000000000-00000000000000ff>
> [ 1.340581] 8139too: probe of 0000:00:03.0 failed with error -22
On Mon, Jan 21, 2008 at 06:18:16PM +0900, Katsuya MATSUBARA wrote:
> In the current kernel, pci_enable_device() get an errror
> with the following message;
>
> "PCI: Device .. not available because of resource collisions."
>
> pcibios_enable_device() in arch/sh/drivers/pci/pci.c shows
> the message if dev->resource[]->start is 0.
> In the case of my CMI8738 driver code, the failure of
> updating the BAR causes the condition.
Apparently we're having a bit of a miscommunication. Either the BAR
values are sane or they aren't. If the initial BAR values that are
reported in that scan are sane, then you can disable the BAR update like
the Dreamcast does, and pass the existing values down.
If you can handle the BARs being updated, then you should not enable
this, and you should let pci-auto find sane mappings for you. If you have
to have fixed BARs, then you need to make sure your board specific fixup
code does the right thing when doing device fixups. Presently this is not
implemented for R2D, as it was assumed that we could update the BAR
values in a reasonable fashion.
Regardless, your driver always has to use pci_iomap() for getting at the
BAR itself. sound/pci/cmipci.c presently does not. Your board-specific
I/O base change seems to be specifically to compensate for the fact that
a driver hasn't performed a remap on the resource start.
next prev parent reply other threads:[~2008-01-21 9:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-21 6:25 [BUG] cannot access IO ports in CMI8738 sound chip Katsuya MATSUBARA
2008-01-21 6:41 ` Paul Mundt
2008-01-21 7:39 ` Katsuya MATSUBARA
2008-01-21 7:52 ` Paul Mundt
2008-01-21 8:04 ` Katsuya MATSUBARA
2008-01-21 8:35 ` Paul Mundt
2008-01-21 9:18 ` Katsuya MATSUBARA
2008-01-21 9:37 ` Paul Mundt [this message]
2008-01-30 5:27 ` Katsuya MATSUBARA
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=20080121093703.GA20646@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=linux-sh@vger.kernel.org \
/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