Commit 7079060f authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart

parents 3f00d3e8 0a1cc0b6
...@@ -389,6 +389,7 @@ static struct pci_device_id agp_ali_pci_table[] = { ...@@ -389,6 +389,7 @@ static struct pci_device_id agp_ali_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_ali_pci_table); MODULE_DEVICE_TABLE(pci, agp_ali_pci_table);
static struct pci_driver agp_ali_pci_driver = { static struct pci_driver agp_ali_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-ali", .name = "agpgart-ali",
.id_table = agp_ali_pci_table, .id_table = agp_ali_pci_table,
.probe = agp_ali_probe, .probe = agp_ali_probe,
......
...@@ -94,19 +94,16 @@ static int amd_create_gatt_pages(int nr_tables) ...@@ -94,19 +94,16 @@ static int amd_create_gatt_pages(int nr_tables)
int retval = 0; int retval = 0;
int i; int i;
tables = kmalloc((nr_tables + 1) * sizeof(struct amd_page_map *), tables = kzalloc((nr_tables + 1) * sizeof(struct amd_page_map *),GFP_KERNEL);
GFP_KERNEL);
if (tables == NULL) if (tables == NULL)
return -ENOMEM; return -ENOMEM;
memset (tables, 0, sizeof(struct amd_page_map *) * (nr_tables + 1));
for (i = 0; i < nr_tables; i++) { for (i = 0; i < nr_tables; i++) {
entry = kmalloc(sizeof(struct amd_page_map), GFP_KERNEL); entry = kzalloc(sizeof(struct amd_page_map), GFP_KERNEL);
if (entry == NULL) { if (entry == NULL) {
retval = -ENOMEM; retval = -ENOMEM;
break; break;
} }
memset (entry, 0, sizeof(struct amd_page_map));
tables[i] = entry; tables[i] = entry;
retval = amd_create_page_map(entry); retval = amd_create_page_map(entry);
if (retval != 0) if (retval != 0)
...@@ -518,6 +515,7 @@ static struct pci_device_id agp_amdk7_pci_table[] = { ...@@ -518,6 +515,7 @@ static struct pci_device_id agp_amdk7_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_amdk7_pci_table); MODULE_DEVICE_TABLE(pci, agp_amdk7_pci_table);
static struct pci_driver agp_amdk7_pci_driver = { static struct pci_driver agp_amdk7_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-amdk7", .name = "agpgart-amdk7",
.id_table = agp_amdk7_pci_table, .id_table = agp_amdk7_pci_table,
.probe = agp_amdk7_probe, .probe = agp_amdk7_probe,
......
...@@ -703,6 +703,7 @@ static struct pci_device_id agp_amd64_pci_table[] = { ...@@ -703,6 +703,7 @@ static struct pci_device_id agp_amd64_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_amd64_pci_table); MODULE_DEVICE_TABLE(pci, agp_amd64_pci_table);
static struct pci_driver agp_amd64_pci_driver = { static struct pci_driver agp_amd64_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-amd64", .name = "agpgart-amd64",
.id_table = agp_amd64_pci_table, .id_table = agp_amd64_pci_table,
.probe = agp_amd64_probe, .probe = agp_amd64_probe,
......
...@@ -118,14 +118,12 @@ static int ati_create_gatt_pages(int nr_tables) ...@@ -118,14 +118,12 @@ static int ati_create_gatt_pages(int nr_tables)
int retval = 0; int retval = 0;
int i; int i;
tables = kmalloc((nr_tables + 1) * sizeof(ati_page_map *), tables = kzalloc((nr_tables + 1) * sizeof(ati_page_map *),GFP_KERNEL);
GFP_KERNEL);
if (tables == NULL) if (tables == NULL)
return -ENOMEM; return -ENOMEM;
memset(tables, 0, sizeof(ati_page_map *) * (nr_tables + 1));
for (i = 0; i < nr_tables; i++) { for (i = 0; i < nr_tables; i++) {
entry = kmalloc(sizeof(ati_page_map), GFP_KERNEL); entry = kzalloc(sizeof(ati_page_map), GFP_KERNEL);
if (entry == NULL) { if (entry == NULL) {
while (i>0) { while (i>0) {
kfree (tables[i-1]); kfree (tables[i-1]);
...@@ -136,7 +134,6 @@ static int ati_create_gatt_pages(int nr_tables) ...@@ -136,7 +134,6 @@ static int ati_create_gatt_pages(int nr_tables)
retval = -ENOMEM; retval = -ENOMEM;
break; break;
} }
memset(entry, 0, sizeof(ati_page_map));
tables[i] = entry; tables[i] = entry;
retval = ati_create_page_map(entry); retval = ati_create_page_map(entry);
if (retval != 0) break; if (retval != 0) break;
...@@ -524,6 +521,7 @@ static struct pci_device_id agp_ati_pci_table[] = { ...@@ -524,6 +521,7 @@ static struct pci_device_id agp_ati_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_ati_pci_table); MODULE_DEVICE_TABLE(pci, agp_ati_pci_table);
static struct pci_driver agp_ati_pci_driver = { static struct pci_driver agp_ati_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-ati", .name = "agpgart-ati",
.id_table = agp_ati_pci_table, .id_table = agp_ati_pci_table,
.probe = agp_ati_probe, .probe = agp_ati_probe,
......
...@@ -222,12 +222,12 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge) ...@@ -222,12 +222,12 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge)
struct agp_bridge_data *agp_alloc_bridge(void) struct agp_bridge_data *agp_alloc_bridge(void)
{ {
struct agp_bridge_data *bridge = kmalloc(sizeof(*bridge), GFP_KERNEL); struct agp_bridge_data *bridge;
bridge = kzalloc(sizeof(*bridge), GFP_KERNEL);
if (!bridge) if (!bridge)
return NULL; return NULL;
memset(bridge, 0, sizeof(*bridge));
atomic_set(&bridge->agp_in_use, 0); atomic_set(&bridge->agp_in_use, 0);
atomic_set(&bridge->current_memory_agp, 0); atomic_set(&bridge->current_memory_agp, 0);
......
...@@ -219,7 +219,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge) ...@@ -219,7 +219,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge)
efficeon_private.l1_table[index] = page; efficeon_private.l1_table[index] = page;
value = virt_to_gart(page) | pati | present | index; value = virt_to_gart((unsigned long *)page) | pati | present | index;
pci_write_config_dword(agp_bridge->dev, pci_write_config_dword(agp_bridge->dev,
EFFICEON_ATTPAGE, value); EFFICEON_ATTPAGE, value);
...@@ -429,6 +429,7 @@ static struct pci_device_id agp_efficeon_pci_table[] = { ...@@ -429,6 +429,7 @@ static struct pci_device_id agp_efficeon_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_efficeon_pci_table); MODULE_DEVICE_TABLE(pci, agp_efficeon_pci_table);
static struct pci_driver agp_efficeon_pci_driver = { static struct pci_driver agp_efficeon_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-efficeon", .name = "agpgart-efficeon",
.id_table = agp_efficeon_pci_table, .id_table = agp_efficeon_pci_table,
.probe = agp_efficeon_probe, .probe = agp_efficeon_probe,
......
...@@ -189,13 +189,12 @@ static int agp_create_segment(struct agp_client *client, struct agp_region *regi ...@@ -189,13 +189,12 @@ static int agp_create_segment(struct agp_client *client, struct agp_region *regi
struct agp_segment *user_seg; struct agp_segment *user_seg;
size_t i; size_t i;
seg = kmalloc((sizeof(struct agp_segment_priv) * region->seg_count), GFP_KERNEL); seg = kzalloc((sizeof(struct agp_segment_priv) * region->seg_count), GFP_KERNEL);
if (seg == NULL) { if (seg == NULL) {
kfree(region->seg_list); kfree(region->seg_list);
region->seg_list = NULL; region->seg_list = NULL;
return -ENOMEM; return -ENOMEM;
} }
memset(seg, 0, (sizeof(struct agp_segment_priv) * region->seg_count));
user_seg = region->seg_list; user_seg = region->seg_list;
for (i = 0; i < region->seg_count; i++) { for (i = 0; i < region->seg_count; i++) {
...@@ -332,14 +331,11 @@ static struct agp_controller *agp_create_controller(pid_t id) ...@@ -332,14 +331,11 @@ static struct agp_controller *agp_create_controller(pid_t id)
{ {
struct agp_controller *controller; struct agp_controller *controller;
controller = kmalloc(sizeof(struct agp_controller), GFP_KERNEL); controller = kzalloc(sizeof(struct agp_controller), GFP_KERNEL);
if (controller == NULL) if (controller == NULL)
return NULL; return NULL;
memset(controller, 0, sizeof(struct agp_controller));
controller->pid = id; controller->pid = id;
return controller; return controller;
} }
...@@ -540,12 +536,10 @@ static struct agp_client *agp_create_client(pid_t id) ...@@ -540,12 +536,10 @@ static struct agp_client *agp_create_client(pid_t id)
{ {
struct agp_client *new_client; struct agp_client *new_client;
new_client = kmalloc(sizeof(struct agp_client), GFP_KERNEL); new_client = kzalloc(sizeof(struct agp_client), GFP_KERNEL);
if (new_client == NULL) if (new_client == NULL)
return NULL; return NULL;
memset(new_client, 0, sizeof(struct agp_client));
new_client->pid = id; new_client->pid = id;
agp_insert_client(new_client); agp_insert_client(new_client);
return new_client; return new_client;
...@@ -709,11 +703,10 @@ static int agp_open(struct inode *inode, struct file *file) ...@@ -709,11 +703,10 @@ static int agp_open(struct inode *inode, struct file *file)
if (minor != AGPGART_MINOR) if (minor != AGPGART_MINOR)
goto err_out; goto err_out;
priv = kmalloc(sizeof(struct agp_file_private), GFP_KERNEL); priv = kzalloc(sizeof(struct agp_file_private), GFP_KERNEL);
if (priv == NULL) if (priv == NULL)
goto err_out_nomem; goto err_out_nomem;
memset(priv, 0, sizeof(struct agp_file_private));
set_bit(AGP_FF_ALLOW_CLIENT, &priv->access_flags); set_bit(AGP_FF_ALLOW_CLIENT, &priv->access_flags);
priv->my_pid = current->pid; priv->my_pid = current->pid;
......
...@@ -105,12 +105,10 @@ struct agp_memory *agp_create_memory(int scratch_pages) ...@@ -105,12 +105,10 @@ struct agp_memory *agp_create_memory(int scratch_pages)
{ {
struct agp_memory *new; struct agp_memory *new;
new = kmalloc(sizeof(struct agp_memory), GFP_KERNEL); new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL);
if (new == NULL) if (new == NULL)
return NULL; return NULL;
memset(new, 0, sizeof(struct agp_memory));
new->key = agp_get_key(); new->key = agp_get_key();
if (new->key < 0) { if (new->key < 0) {
...@@ -414,7 +412,8 @@ static void agp_v2_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_ ...@@ -414,7 +412,8 @@ static void agp_v2_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
u32 tmp; u32 tmp;
if (*requested_mode & AGP2_RESERVED_MASK) { if (*requested_mode & AGP2_RESERVED_MASK) {
printk(KERN_INFO PFX "reserved bits set in mode 0x%x. Fixed.\n", *requested_mode); printk(KERN_INFO PFX "reserved bits set (%x) in mode 0x%x. Fixed.\n",
*requested_mode & AGP2_RESERVED_MASK, *requested_mode);
*requested_mode &= ~AGP2_RESERVED_MASK; *requested_mode &= ~AGP2_RESERVED_MASK;
} }
...@@ -492,7 +491,8 @@ static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_ ...@@ -492,7 +491,8 @@ static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
u32 tmp; u32 tmp;
if (*requested_mode & AGP3_RESERVED_MASK) { if (*requested_mode & AGP3_RESERVED_MASK) {
printk(KERN_INFO PFX "reserved bits set in mode 0x%x. Fixed.\n", *requested_mode); printk(KERN_INFO PFX "reserved bits set (%x) in mode 0x%x. Fixed.\n",
*requested_mode & AGP3_RESERVED_MASK, *requested_mode);
*requested_mode &= ~AGP3_RESERVED_MASK; *requested_mode &= ~AGP3_RESERVED_MASK;
} }
......
...@@ -227,10 +227,9 @@ static int i460_configure (void) ...@@ -227,10 +227,9 @@ static int i460_configure (void)
*/ */
if (I460_IO_PAGE_SHIFT > PAGE_SHIFT) { if (I460_IO_PAGE_SHIFT > PAGE_SHIFT) {
size = current_size->num_entries * sizeof(i460.lp_desc[0]); size = current_size->num_entries * sizeof(i460.lp_desc[0]);
i460.lp_desc = kmalloc(size, GFP_KERNEL); i460.lp_desc = kzalloc(size, GFP_KERNEL);
if (!i460.lp_desc) if (!i460.lp_desc)
return -ENOMEM; return -ENOMEM;
memset(i460.lp_desc, 0, size);
} }
return 0; return 0;
} }
...@@ -366,13 +365,12 @@ static int i460_alloc_large_page (struct lp_desc *lp) ...@@ -366,13 +365,12 @@ static int i460_alloc_large_page (struct lp_desc *lp)
} }
map_size = ((I460_KPAGES_PER_IOPAGE + BITS_PER_LONG - 1) & -BITS_PER_LONG)/8; map_size = ((I460_KPAGES_PER_IOPAGE + BITS_PER_LONG - 1) & -BITS_PER_LONG)/8;
lp->alloced_map = kmalloc(map_size, GFP_KERNEL); lp->alloced_map = kzalloc(map_size, GFP_KERNEL);
if (!lp->alloced_map) { if (!lp->alloced_map) {
free_pages((unsigned long) lpage, order); free_pages((unsigned long) lpage, order);
printk(KERN_ERR PFX "Out of memory, we're in trouble...\n"); printk(KERN_ERR PFX "Out of memory, we're in trouble...\n");
return -ENOMEM; return -ENOMEM;
} }
memset(lp->alloced_map, 0, map_size);
lp->paddr = virt_to_gart(lpage); lp->paddr = virt_to_gart(lpage);
lp->refcount = 0; lp->refcount = 0;
...@@ -619,6 +617,7 @@ static struct pci_device_id agp_intel_i460_pci_table[] = { ...@@ -619,6 +617,7 @@ static struct pci_device_id agp_intel_i460_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_intel_i460_pci_table); MODULE_DEVICE_TABLE(pci, agp_intel_i460_pci_table);
static struct pci_driver agp_intel_i460_pci_driver = { static struct pci_driver agp_intel_i460_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-intel-i460", .name = "agpgart-intel-i460",
.id_table = agp_intel_i460_pci_table, .id_table = agp_intel_i460_pci_table,
.probe = agp_intel_i460_probe, .probe = agp_intel_i460_probe,
......
...@@ -1824,6 +1824,7 @@ static struct pci_device_id agp_intel_pci_table[] = { ...@@ -1824,6 +1824,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_intel_pci_table); MODULE_DEVICE_TABLE(pci, agp_intel_pci_table);
static struct pci_driver agp_intel_pci_driver = { static struct pci_driver agp_intel_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-intel", .name = "agpgart-intel",
.id_table = agp_intel_pci_table, .id_table = agp_intel_pci_table,
.probe = agp_intel_probe, .probe = agp_intel_probe,
......
...@@ -398,6 +398,7 @@ static struct pci_device_id agp_nvidia_pci_table[] = { ...@@ -398,6 +398,7 @@ static struct pci_device_id agp_nvidia_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_nvidia_pci_table); MODULE_DEVICE_TABLE(pci, agp_nvidia_pci_table);
static struct pci_driver agp_nvidia_pci_driver = { static struct pci_driver agp_nvidia_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-nvidia", .name = "agpgart-nvidia",
.id_table = agp_nvidia_pci_table, .id_table = agp_nvidia_pci_table,
.probe = agp_nvidia_probe, .probe = agp_nvidia_probe,
......
...@@ -289,6 +289,8 @@ static int __devinit agp_sgi_init(void) ...@@ -289,6 +289,8 @@ static int __devinit agp_sgi_init(void)
j = 0; j = 0;
list_for_each_entry(info, &tioca_list, ca_list) { list_for_each_entry(info, &tioca_list, ca_list) {
struct list_head *tmp; struct list_head *tmp;
if (list_empty(info->ca_devices))
continue;
list_for_each(tmp, info->ca_devices) { list_for_each(tmp, info->ca_devices) {
u8 cap_ptr; u8 cap_ptr;
pdev = pci_dev_b(tmp); pdev = pci_dev_b(tmp);
......
...@@ -332,6 +332,7 @@ static struct pci_device_id agp_sis_pci_table[] = { ...@@ -332,6 +332,7 @@ static struct pci_device_id agp_sis_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_sis_pci_table); MODULE_DEVICE_TABLE(pci, agp_sis_pci_table);
static struct pci_driver agp_sis_pci_driver = { static struct pci_driver agp_sis_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-sis", .name = "agpgart-sis",
.id_table = agp_sis_pci_table, .id_table = agp_sis_pci_table,
.probe = agp_sis_probe, .probe = agp_sis_probe,
......
...@@ -102,19 +102,17 @@ static int serverworks_create_gatt_pages(int nr_tables) ...@@ -102,19 +102,17 @@ static int serverworks_create_gatt_pages(int nr_tables)
int retval = 0; int retval = 0;
int i; int i;
tables = kmalloc((nr_tables + 1) * sizeof(struct serverworks_page_map *), tables = kzalloc((nr_tables + 1) * sizeof(struct serverworks_page_map *),
GFP_KERNEL); GFP_KERNEL);
if (tables == NULL) { if (tables == NULL)
return -ENOMEM; return -ENOMEM;
}
memset(tables, 0, sizeof(struct serverworks_page_map *) * (nr_tables + 1));
for (i = 0; i < nr_tables; i++) { for (i = 0; i < nr_tables; i++) {
entry = kmalloc(sizeof(struct serverworks_page_map), GFP_KERNEL); entry = kzalloc(sizeof(struct serverworks_page_map), GFP_KERNEL);
if (entry == NULL) { if (entry == NULL) {
retval = -ENOMEM; retval = -ENOMEM;
break; break;
} }
memset(entry, 0, sizeof(struct serverworks_page_map));
tables[i] = entry; tables[i] = entry;
retval = serverworks_create_page_map(entry); retval = serverworks_create_page_map(entry);
if (retval != 0) break; if (retval != 0) break;
...@@ -244,13 +242,27 @@ static int serverworks_fetch_size(void) ...@@ -244,13 +242,27 @@ static int serverworks_fetch_size(void)
*/ */
static void serverworks_tlbflush(struct agp_memory *temp) static void serverworks_tlbflush(struct agp_memory *temp)
{ {
unsigned long timeout;
writeb(1, serverworks_private.registers+SVWRKS_POSTFLUSH); writeb(1, serverworks_private.registers+SVWRKS_POSTFLUSH);
while (readb(serverworks_private.registers+SVWRKS_POSTFLUSH) == 1) timeout = jiffies + 3*HZ;
while (readb(serverworks_private.registers+SVWRKS_POSTFLUSH) == 1) {
cpu_relax(); cpu_relax();
if (time_after(jiffies, timeout)) {
printk(KERN_ERR PFX "TLB post flush took more than 3 seconds\n");
break;
}
}
writel(1, serverworks_private.registers+SVWRKS_DIRFLUSH); writel(1, serverworks_private.registers+SVWRKS_DIRFLUSH);
while(readl(serverworks_private.registers+SVWRKS_DIRFLUSH) == 1) timeout = jiffies + 3*HZ;
while (readl(serverworks_private.registers+SVWRKS_DIRFLUSH) == 1) {
cpu_relax(); cpu_relax();
if (time_after(jiffies, timeout)) {
printk(KERN_ERR PFX "TLB Dir flush took more than 3 seconds\n");
break;
}
}
} }
static int serverworks_configure(void) static int serverworks_configure(void)
...@@ -533,6 +545,7 @@ static struct pci_device_id agp_serverworks_pci_table[] = { ...@@ -533,6 +545,7 @@ static struct pci_device_id agp_serverworks_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_serverworks_pci_table); MODULE_DEVICE_TABLE(pci, agp_serverworks_pci_table);
static struct pci_driver agp_serverworks_pci_driver = { static struct pci_driver agp_serverworks_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-serverworks", .name = "agpgart-serverworks",
.id_table = agp_serverworks_pci_table, .id_table = agp_serverworks_pci_table,
.probe = agp_serverworks_probe, .probe = agp_serverworks_probe,
......
...@@ -658,6 +658,7 @@ static struct pci_device_id agp_uninorth_pci_table[] = { ...@@ -658,6 +658,7 @@ static struct pci_device_id agp_uninorth_pci_table[] = {
MODULE_DEVICE_TABLE(pci, agp_uninorth_pci_table); MODULE_DEVICE_TABLE(pci, agp_uninorth_pci_table);
static struct pci_driver agp_uninorth_pci_driver = { static struct pci_driver agp_uninorth_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-uninorth", .name = "agpgart-uninorth",
.id_table = agp_uninorth_pci_table, .id_table = agp_uninorth_pci_table,
.probe = agp_uninorth_probe, .probe = agp_uninorth_probe,
......
...@@ -518,6 +518,7 @@ MODULE_DEVICE_TABLE(pci, agp_via_pci_table); ...@@ -518,6 +518,7 @@ MODULE_DEVICE_TABLE(pci, agp_via_pci_table);
static struct pci_driver agp_via_pci_driver = { static struct pci_driver agp_via_pci_driver = {
.owner = THIS_MODULE,
.name = "agpgart-via", .name = "agpgart-via",
.id_table = agp_via_pci_table, .id_table = agp_via_pci_table,
.probe = agp_via_probe, .probe = agp_via_probe,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment