public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Zajicek <santiago@crfreenet.org>
To: David Miller <davem@davemloft.net>
Cc: hpa@zytor.com, dh.herrmann@gmail.com,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	plagnioj@jcrosoft.com, tomi.valkeinen@ti.com,
	Ondrej Zary <linux@rainbow-software.org>
Subject: Re: [PATCH] fbdev: suppress warning when assigning vga-save/restore base
Date: Mon, 5 Aug 2013 22:29:55 +0200	[thread overview]
Message-ID: <20130805202955.GH22789@localhost> (raw)
In-Reply-To: <20130804.185146.1621476659301936865.davem@davemloft.net>

On Sun, Aug 04, 2013 at 06:51:46PM -0700, David Miller wrote:
> From: "H. Peter Anvin" <hpa@zytor.com>
> Date: Sun, 04 Aug 2013 10:33:46 -0700
> 
> > Anyone who can dig backwards and summarize?  In other words:
> > 
> > Where in the current code do we stuff a physical address in a pointer,
> > or a virtual address into a non-pointer?
> 
> The VGA register accessors try to accomodate iomem and ioport
> accesses.
> 
> If they are given a non-NULL iomem pointer 'regbase' they use
> iomem accesses, otherwise they do direct ISA port poking.
> 
> And yes the drivers in question are making some brash assumptions.
> I suspect they should be using ioremap() or similar.

Well, these drivers were written without MMIO (port IO only with NULL
instead of 'vgabase' for VGA register accessors). They were converted in
patches 94c322c30bd14ae6cdd369cb4a1f94c5c3809ac9,
f8645933513c65ac55f23c63b2649097289795c6 and a few others (from David
Miller) to potentially use MMIO by using 'vgabase' instead of NULL:

 pcibios_bus_to_resource(dev, &vga_res, &bus_reg);
 par->state.vgabase = (void __iomem *) vga_res.start;

How this could even work? AFAIK these cards have to be explicitly programmed
to enable MMIO (which was not done in the patches). These patches claim that
it is for multi-domain PCI. I would guess that vgabase is NULL in common
configurations but if it is non-NULL, it probably wouldn't work, unless
there is some hardware magic that transparently converts MMIO (from CPU PoV)
to port IO (from card/PCI PoV).

Note that there are some later patches (86c0f043a737dadf034a4e6f29aefb074f4a1146)
from Ondrej Zary that independently enable MMIO, but they use par->mmio
field instead of par->state.vgabase .

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."

  reply	other threads:[~2013-08-05 20:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-04 17:25 [PATCH] fbdev: suppress warning when assigning vga-save/restore base David Herrmann
2013-08-04 17:33 ` H. Peter Anvin
2013-08-05  1:51   ` David Miller
2013-08-05 20:29     ` Ondrej Zajicek [this message]
2013-08-05 21:02       ` H. Peter Anvin
2013-08-05 21:14         ` H. Peter Anvin
2013-08-05 22:29       ` David Miller
2014-02-10 11:23 ` Tomi Valkeinen
2014-02-10 11:32   ` David Herrmann

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=20130805202955.GH22789@localhost \
    --to=santiago@crfreenet.org \
    --cc=davem@davemloft.net \
    --cc=dh.herrmann@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rainbow-software.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=tomi.valkeinen@ti.com \
    /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