[PATCH] Set pnp_init_resource_table, pnp_resource_change, pnp_manual_config_dev deprecated



On Fri, 2007-11-30 at 10:32 +0800, Shaohua Li wrote:
On Fri, 2007-11-30 at 03:18 +0100, Rene Herman wrote:
On 29-11-07 10:11, Dave Young wrote:

The pnpacpi rsparser.c report warnings of:
exceeded the max number of IO resources: 24

dmesg|grep exceeded|wc
66 594 3564

Heavens... (added CCs of people who just upped it from 8 -- I suppose the
problem is not new then?)
Properly we should make a bit bigger till Thomas's patch is ready.
Thomas, your patch isn't 2.6.24 staff, right?

Definitely not.
I also wonder how sever this is..., we now at least register 24, we
didn't reserve more than 8 for at least 2 kernel iterations AFAIK.
Another workaround could be:
AFAIK IO resources below 0x100 are (still?) ignored atm.
If they are ignored earlier, at parse time
({pnpbios,pnpacpi}/rsparser.c) and they are not added to the
pnp_resource_table of the device, we would save another maybe 4-6 IO
ports which are ignored anyway.


I don't know how many externally built drivers, which are making use of
this, could still be out there?
What is the general policy for removing such old, rarely used and "being
more a workaround than an interface" exported symbols?

This should be 2.6.24 material:

Mark pnp_init_resource_table, pnp_resource_change, pnp_manual_config_dev deprecated

Thanks to Rene Herman, the remaining calls to those functions got eliminated
in the sound/isa layer recently.
Those functions are a workaround for wrong BIOS pnp information and give
drivers the possibility to override BIOS exported PNP resources.
This can be done through sysfs since 2.6, therefore these functions should
vanish rather soon, as dynamic allocation for PNP resources is depending
on it.

Signed-off-by: Thomas Renninger <trenn@xxxxxxx>

---
include/linux/pnp.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

Index: linux-2.6.24-rc3-mm2/include/linux/pnp.h
===================================================================
--- linux-2.6.24-rc3-mm2.orig/include/linux/pnp.h
+++ linux-2.6.24-rc3-mm2/include/linux/pnp.h
@@ -387,8 +387,8 @@ int pnp_register_dma_resource(struct pnp
int pnp_register_port_resource(struct pnp_option *option,
struct pnp_port *data);
int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data);
-void pnp_init_resource_table(struct pnp_resource_table *table);
-int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
+void __deprecated pnp_init_resource_table(struct pnp_resource_table *table);
+int __deprecated pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
int mode);
int pnp_auto_config_dev(struct pnp_dev *dev);
int pnp_validate_config(struct pnp_dev *dev);
@@ -396,8 +396,8 @@ int pnp_start_dev(struct pnp_dev *dev);
int pnp_stop_dev(struct pnp_dev *dev);
int pnp_activate_dev(struct pnp_dev *dev);
int pnp_disable_dev(struct pnp_dev *dev);
-void pnp_resource_change(struct resource *resource, resource_size_t start,
- resource_size_t size);
+void __deprecated pnp_resource_change(struct resource *resource, resource_size_t start,
+ resource_size_t size);

/* protocol helpers */
int pnp_is_active(struct pnp_dev *dev);
@@ -436,15 +436,15 @@ static inline int pnp_register_irq_resou
static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; }
static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; }
static inline int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data) { return -ENODEV; }
-static inline void pnp_init_resource_table(struct pnp_resource_table *table) { }
-static inline int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; }
+static inline void __deprecated pnp_init_resource_table(struct pnp_resource_table *table) { }
+static inline int __deprecated pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; }
static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_validate_config(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
-static inline void pnp_resource_change(struct resource *resource, resource_size_t start, resource_size_t size) { }
+static inline void __deprecated pnp_resource_change(struct resource *resource, resource_size_t start, resource_size_t size) { }

/* protocol helpers */
static inline int pnp_is_active(struct pnp_dev *dev) { return 0; }


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: ACPIPNP and too large IO resources
    ... you probably have a bridge device that consumes the ... range for downstream PNP devices. ... We might need to consider this patch as ... A patch in -mm kernel correct the parsing of "address resources" of pnpacpi. ...
    (Linux-Kernel)
  • Re: PCI resource problems caused by improper address rounding
    ... resources allocated above 4GB, and that doesn't work very well. ... that patch is not safe. ... region allocator use a window that is in the *middle* of the gap, ... BIOSes *invariably* get resource allocation wrong, ...
    (Linux-Kernel)
  • Re: [PATCH - Resend] PNPACPI: only parse device that have CRS method
    ... mc> this patch blacklist device that don't have CRS method as there are ... with your patch and still does not work. ... resources showed resources but smsc-ircc2 got still no ... declare my ACPI BIOS broken and revert to PNPBIOS on this laptop? ...
    (Linux-Kernel)
  • acpi based pci gap calculation - v3
    ... I don't see this patch being applied in any of the tree yet. ... Then searches the e820 memory space for a gap within these producer resources. ... Allows us to find a gap for the unclaimed pci resources or MMIO resources ...
    (Linux-Kernel)
  • [PATCH] Insert Local and IO APIC(s) into resource map
    ... This patch inserts the Local APIC and IO APICinto the resource tree. ... the insertion until after PCI has allocated its necessary resources. ...
    (Linux-Kernel)