Re: [patch 00/37] PNP resource_table cleanups, v2

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Bjorn Helgaas <bjorn.helgaas@...>
Cc: Rene Herman <rene.herman@...>, Len Brown <lenb@...>, <linux-acpi@...>, <linux-kernel@...>, Adam Belay <ambx1@...>, Li Shaohua <shaohua.li@...>, Matthieu Castet <castet.matthieu@...>, Thomas Renninger <trenn@...>, Jaroslav Kysela <perex@...>, Andrew Morton <akpm@...>
Date: Thursday, April 3, 2008 - 11:54 am

On 02-04-08 23:35, Bjorn Helgaas wrote:


Oh well, PC hardware...


Yes, it should. I checked the ISAPnP specification and it explicitly fixes 
bit 31 at 0 (and defines the "compressed ASCII" as 5 bits). Given what you 
describe you probably don't have a good place to stash a comment but with 6 
bits being non-spec something like "appease broken ISAPnP hardware" would 
probably be good.


No, you didn't, is fine.


Yes, as far as I'm aware the actual value is of no consequence. The size is 
not a setable parameter; to hardware they're only base address registers, It 
used to be kept simply at -1 (in an unsigned sort of way) and as far as I'm 
aware, we're also not interested yet at this level.

However, now that you made me look closer and in context -- there's actually 
a possibly somewhat serious problem here.

isapnp_read_resources() stores the resources as read from the hardware at 
the index in the table that matches the actual index in the hardware and 
isapnp_set_resources() stores them back into those same hardware indices.

Now by using pnp_add_foo_resource() which just scans for the first _UNSET 
resource, the resources might not end up in the same linear position in 
table/list if intermediate resources were unset in hardware (!ret). A 
subsequent isapnp_set_resources() would them restore the value to the wrong 
hardware index.

The IORESOURCE_ flags currently reserve too few bits (IORESOURCE_BITS,  8) 
to be able to store the hardware index: IORESOURCE_MEM and IORESOURCE_DMA 
need 2 and 1 respectively and there are 1 and 0 available respectively. It's 
ofcourse possible to hijack a few more bits in IORESOURCE_ flags but you're 
turning this into a list. I suppose the idea is to make it a simple list of 
struct resource, but perhaps a resource-private "driver_data" sort of field 
comes in handy for more than this already? Swiping more of IORESOURCE_ is a 
bit ugly...

In any case, I missed this, but ISAPnP is still (at least in principle) 
broken with the current set therefore.


Will do.

Rene.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/37] PNP resource_table cleanups, v2, Bjorn Helgaas, (Tue Apr 1, 11:16 am)
Re: [patch 00/37] PNP resource_table cleanups, v2, Rene Herman, (Tue Apr 1, 7:43 pm)
Re: [patch 00/37] PNP resource_table cleanups, v2, Bjorn Helgaas, (Wed Apr 2, 5:35 pm)
Re: [patch 00/37] PNP resource_table cleanups, v2, Rene Herman, (Thu Apr 3, 11:54 am)
Re: [patch 00/37] PNP resource_table cleanups, v2, Bjorn Helgaas, (Thu May 1, 4:47 pm)
Re: [patch 00/37] PNP resource_table cleanups, v2, Rene Herman, (Sun May 4, 10:14 am)
Re: [patch 00/37] PNP resource_table cleanups, v2, Rene Herman, (Sun May 4, 10:19 am)
Re: [patch 00/37] PNP resource_table cleanups, v2, Bjorn Helgaas, (Mon May 5, 10:48 am)
Re: [patch 00/37] PNP resource_table cleanups, v2, Bjorn Helgaas, (Thu Apr 3, 12:43 pm)
Re: [patch 00/37] PNP resource_table cleanups, v2, Rene Herman, (Thu Apr 3, 1:12 pm)
Re: [patch 00/37] PNP resource_table cleanups, v2, Rene Herman, (Thu Apr 3, 3:29 pm)