linux: Make failure to iopl non-fatal

We load the driver list, then enable I/O, then call driver probe based
on whether I/O enable succeeded.  That's bad, because the loaded
security policy might forbid port access.  We happen to treat that as
fatal for some reason, which means even drivers that don't need I/O
access (like kms and fbdev) don't get the chance to run.  Facepalm.

How about we just make that non-fatal instead, that sounds like a much
better plan.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2012-06-26 13:15:45 -04:00
parent 048674a6ae
commit d88fb00d79

View File

@ -510,11 +510,8 @@ static Bool
hwEnableIO(void)
{
if (ioperm(0, 1024, 1) || iopl(3)) {
if (errno == ENODEV)
ErrorF("xf86EnableIOPorts: no I/O ports found\n");
else
FatalError("xf86EnableIOPorts: failed to set IOPL"
" for I/O (%s)\n", strerror(errno));
ErrorF("xf86EnableIOPorts: failed to set IOPL for I/O (%s)\n",
strerror(errno));
return FALSE;
}
#if !defined(__alpha__)