From: Andy Burns <linux-dvb@adslpipe.co.uk>
To: Linux DVB List <linux-dvb@linuxtv.org>
Subject: [linux-dvb] saa7134 ioremap() problem
Date: Tue, 01 Jul 2008 18:53:19 +0100 [thread overview]
Message-ID: <486A6F0F.7090507@adslpipe.co.uk> (raw)
I have been using the saa7134.ko and saa7134_dvb.ko drivers for years as
part of my mythtv system, working very nicely.
Now I am trying to use xen to virtualise my mythtv-backend, with PCI
passthrough of the tuner to the virtual machine, everything hasn't gone
smoothly, but I believe I have found an issue within the driver which
would have gone un-noticed on a bare-metal machine, yet which causes a
problem under xen.
Here is what lspci -vvv shows for my card
08:01.0 Multimedia controller: Philips Semiconductors SAA7130 Video
Broadcast Decoder (rev 01)
Subsystem: Compro Technology, Inc. Videomate DVB-T200
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 64 (21000ns min, 8000ns max)
Interrupt: pin A routed to IRQ 17
Region 0: Memory at febffc00 (32-bit, non-prefetchable) [size=1K]
Capabilities: [40] Power Management version 1
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Kernel modules: saa7134
Notice the MMIO area is 1K in size, but within the driver, it requests
mapping of a 4K area, rather than 1K.
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.25.y.git;a=blob;f=drivers/media/video/saa7134/saa7134-core.c;h=58ab163fdbd74e628e60655ea05c5d3bea611599;hb=HEAD#l998
Obviously the kernel will have to round the start/end addresses to the
nearest 4K boundaries as this is the granularity of page mapping, but if
the request is too large to begin with it attempts to map two pages,
straddling the card's physical address range, this works on a physical
machine, but fails under xen due to more rigourous checking/enforcement
of permissions.
I have rebuilt the driver module using 0x400 instead of 0x1000 for the
ioremap() size and the driver then loads, instead of failing (I still
have an interrupt problem but will follow that up separately).
If you'd like to follow the discussion I've been having on the xen-devel
list, Keir Fraser should be able to answer questions on why this fails
under xen far better than I can.
http://lists.xensource.com/archives/html/xen-devel/2008-07/msg00004.html
Could you comment on whether you'd accept a patch for this?
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
next reply other threads:[~2008-07-01 17:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-01 17:53 Andy Burns [this message]
2008-07-02 14:52 ` [linux-dvb] [PATCH] Shrink saa7134 mmio mapped size Andy Burns
2008-07-02 15:12 ` Matthias Schwarzott
2008-07-02 15:35 ` Andy Burns
2008-07-02 15:50 ` Andy Burns
2008-07-02 20:39 ` hermann pitton
2008-07-02 21:00 ` Andy Burns
2008-07-03 23:09 ` hermann pitton
-- strict thread matches above, loose matches on Subject: below --
2008-09-27 13:26 [linux-dvb] saa7134 ioremap() problem Nick Fisk
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=486A6F0F.7090507@adslpipe.co.uk \
--to=linux-dvb@adslpipe.co.uk \
--cc=linux-dvb@linuxtv.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