From a0729eb408f161c647545e677982190e95947988 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 13 Mar 2004 21:49:48 -0800 Subject: [PATCH] move consistent_dma_mask to the generic device From: James Bottomley pci_dev.consistent_dma_mask was introduced to get around problems in the IA64 Altix machine. Now, we have a use for it in x86: the aacraid needs coherent memory in a 31 bit address range (2GB). Unfortunately, x86 is converted to the dma model, so it can't see the pci_dev by the time coherent memory is allocated. The solution to all of this is to move pci_dev.consistent_dma_mask to dev.coherent_dma_mask and make x86 use it in the dma_alloc_coherent() calls. This should allow me to make the aacraid set the coherent mask instead of using it's current dma_mask juggling. --- include/linux/device.h | 6 ++++++ include/linux/pci.h | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'include/linux') diff --git a/include/linux/device.h b/include/linux/device.h index aef6b2f8836e..28e101a77070 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -285,6 +285,12 @@ struct device { detached from its driver. */ u64 *dma_mask; /* dma mask (if dma'able device) */ + u64 coherent_dma_mask;/* Like dma_mask, but for + alloc_coherent mappings as + not all hardware supports + 64 bit addresses for consistent + allocations such descriptors. */ + struct list_head dma_pools; /* dma pools (if dma'ble) */ void (*release)(struct device * dev); diff --git a/include/linux/pci.h b/include/linux/pci.h index eb594a816bec..3f2b4949a65e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -393,11 +393,6 @@ struct pci_dev { this if your device has broken DMA or supports 64-bit transfers. */ - u64 consistent_dma_mask;/* Like dma_mask, but for - pci_alloc_consistent mappings as - not all hardware supports - 64 bit addresses for consistent - allocations such descriptors. */ u32 current_state; /* Current operating state. In ACPI-speak, this is D0-D3, D0 being fully functional, and D3 being off. */ -- cgit v1.2.3 From 51fb5c51c254d76860019dce937fc981b2e64cd2 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 13 Mar 2004 21:49:59 -0800 Subject: [PATCH] s390: update for altered page_state structure From: Olaf Hering This patch is needed on s390. --- arch/s390/appldata/appldata_mem.c | 15 +++++++++++---- include/linux/page-flags.h | 3 +++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'include/linux') diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c index fdf29bfbad3c..b91608f81b59 100644 --- a/arch/s390/appldata/appldata_mem.c +++ b/arch/s390/appldata/appldata_mem.c @@ -54,7 +54,9 @@ struct appldata_mem_data { u64 freeswap; /* free swap space */ // New in 2.6 --> - u64 pgalloc; /* page allocations */ + u64 pgalloc_high; /* page allocations */ + u64 pgalloc_normal; + u64 pgalloc_dma; u64 pgfault; /* page faults (major+minor) */ u64 pgmajfault; /* page faults (major only) */ // <-- New in 2.6 @@ -69,7 +71,9 @@ static inline void appldata_debug_print(struct appldata_mem_data *mem_data) P_DEBUG("pgpgout = %8lu KB\n", mem_data->pgpgout); P_DEBUG("pswpin = %8lu Pages\n", mem_data->pswpin); P_DEBUG("pswpout = %8lu Pages\n", mem_data->pswpout); - P_DEBUG("pgalloc = %8lu \n", mem_data->pgalloc); + P_DEBUG("pgalloc_high = %8lu \n", mem_data->pgalloc_high); + P_DEBUG("pgalloc_normal = %8lu \n", mem_data->pgalloc_normal); + P_DEBUG("pgalloc_dma = %8lu \n", mem_data->pgalloc_dma); P_DEBUG("pgfault = %8lu \n", mem_data->pgfault); P_DEBUG("pgmajfault = %8lu \n", mem_data->pgmajfault); P_DEBUG("sharedram = %8lu KB\n", mem_data->sharedram); @@ -105,11 +109,14 @@ static void appldata_get_mem_data(void *data) mem_data->pgpgout = ps.pgpgout >> 1; mem_data->pswpin = ps.pswpin; mem_data->pswpout = ps.pswpout; - mem_data->pgalloc = ps.pgalloc; + mem_data->pgalloc_high = ps.pgalloc_high; + mem_data->pgalloc_normal = ps.pgalloc_normal; + mem_data->pgalloc_dma = ps.pgalloc_dma; mem_data->pgfault = ps.pgfault; mem_data->pgmajfault = ps.pgmajfault; -P_DEBUG("pgalloc = %lu, pgfree = %lu\n", ps.pgalloc, ps.pgfree); +P_DEBUG("pgalloc_high = %lu, pgalloc_normal = %lu, pgalloc_dma = %lu, pgfree = %lu\n", + ps.pgalloc_high, ps.pgalloc_normal, ps.pgalloc_dma, ps.pgfree); si_meminfo(&val); mem_data->sharedram = val.sharedram; diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index f58c9e68d3d8..b8b743c3a951 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -80,6 +80,9 @@ /* * Global page accounting. One instance per CPU. Only unsigned longs are * allowed. + * + * NOTE: if this structure is changed then mm/page_alloc.c and + * arch/s390/appldata/appldata_mem.c must be updated accordingly */ struct page_state { unsigned long nr_dirty; /* Dirty writeable pages */ -- cgit v1.2.3