diff options
author | Len Brown <len.brown@intel.com> | 2005-08-15 16:07:26 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-08-15 16:07:26 -0400 |
commit | 09d92002718edf8ef284ec3726247acc83efbbe0 (patch) | |
tree | 54fe60e08833214565562ce0e9cefa21c92f95e3 | |
parent | cb220c1af49644786944c549518b491d4c654030 (diff) | |
parent | 3edea4833a1efcd43e1dff082bc8001fdfe74b34 (diff) |
Merge from-linus to-akpm
-rw-r--r-- | arch/x86_64/kernel/smpboot.c | 2 | ||||
-rw-r--r-- | drivers/acpi/motherboard.c | 2 | ||||
-rw-r--r-- | drivers/char/mem.c | 12 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 1 | ||||
-rw-r--r-- | drivers/scsi/dc395x.c | 48 | ||||
-rw-r--r-- | drivers/video/fbmem.c | 4 | ||||
-rw-r--r-- | drivers/video/intelfb/intelfbdrv.c | 50 | ||||
-rw-r--r-- | drivers/w1/w1.c | 2 | ||||
-rw-r--r-- | fs/cifs/CHANGES | 6 | ||||
-rw-r--r-- | fs/cifs/cifssmb.c | 3 | ||||
-rw-r--r-- | fs/cifs/misc.c | 1 | ||||
-rw-r--r-- | fs/inotify.c | 2 | ||||
-rw-r--r-- | fs/namei.c | 3 | ||||
-rw-r--r-- | fs/reiserfs/namei.c | 3 | ||||
-rw-r--r-- | include/asm-i386/pci.h | 4 | ||||
-rw-r--r-- | include/asm-sh/unistd.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/pci.h | 4 | ||||
-rw-r--r-- | include/linux/fsnotify.h | 6 | ||||
-rw-r--r-- | include/linux/inotify.h | 4 | ||||
-rw-r--r-- | include/linux/netpoll.h | 20 | ||||
-rw-r--r-- | include/linux/skbuff.h | 2 | ||||
-rw-r--r-- | net/core/dev.c | 9 | ||||
-rw-r--r-- | net/core/netpoll.c | 63 |
23 files changed, 143 insertions, 110 deletions
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index 6e4807d64d46..b15761ff4101 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c | |||
@@ -334,7 +334,7 @@ static void __cpuinit tsc_sync_wait(void) | |||
334 | { | 334 | { |
335 | if (notscsync || !cpu_has_tsc) | 335 | if (notscsync || !cpu_has_tsc) |
336 | return; | 336 | return; |
337 | sync_tsc(boot_cpu_id); | 337 | sync_tsc(0); |
338 | } | 338 | } |
339 | 339 | ||
340 | static __init int notscsync_setup(char *s) | 340 | static __init int notscsync_setup(char *s) |
diff --git a/drivers/acpi/motherboard.c b/drivers/acpi/motherboard.c index e10fb4f842b1..e928e8c2c6ec 100644 --- a/drivers/acpi/motherboard.c +++ b/drivers/acpi/motherboard.c | |||
@@ -42,7 +42,7 @@ ACPI_MODULE_NAME("acpi_motherboard") | |||
42 | */ | 42 | */ |
43 | #define IS_RESERVED_ADDR(base, len) \ | 43 | #define IS_RESERVED_ADDR(base, len) \ |
44 | (((len) > 0) && ((base) > 0) && ((base) + (len) < IO_SPACE_LIMIT) \ | 44 | (((len) > 0) && ((base) > 0) && ((base) + (len) < IO_SPACE_LIMIT) \ |
45 | && ((base) + (len) > 0x1000)) | 45 | && ((base) + (len) > PCIBIOS_MIN_IO)) |
46 | /* | 46 | /* |
47 | * Clearing the flag (IORESOURCE_BUSY) allows drivers to use | 47 | * Clearing the flag (IORESOURCE_BUSY) allows drivers to use |
48 | * the io ports if they really know they can use it, while | 48 | * the io ports if they really know they can use it, while |
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 42187381506b..850a78c9c4bc 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -261,7 +261,11 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma) | |||
261 | 261 | ||
262 | static int mmap_kmem(struct file * file, struct vm_area_struct * vma) | 262 | static int mmap_kmem(struct file * file, struct vm_area_struct * vma) |
263 | { | 263 | { |
264 | unsigned long long val; | 264 | unsigned long pfn; |
265 | |||
266 | /* Turn a kernel-virtual address into a physical page frame */ | ||
267 | pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT; | ||
268 | |||
265 | /* | 269 | /* |
266 | * RED-PEN: on some architectures there is more mapped memory | 270 | * RED-PEN: on some architectures there is more mapped memory |
267 | * than available in mem_map which pfn_valid checks | 271 | * than available in mem_map which pfn_valid checks |
@@ -269,10 +273,10 @@ static int mmap_kmem(struct file * file, struct vm_area_struct * vma) | |||
269 | * | 273 | * |
270 | * RED-PEN: vmalloc is not supported right now. | 274 | * RED-PEN: vmalloc is not supported right now. |
271 | */ | 275 | */ |
272 | if (!pfn_valid(vma->vm_pgoff)) | 276 | if (!pfn_valid(pfn)) |
273 | return -EIO; | 277 | return -EIO; |
274 | val = (u64)vma->vm_pgoff << PAGE_SHIFT; | 278 | |
275 | vma->vm_pgoff = __pa(val) >> PAGE_SHIFT; | 279 | vma->vm_pgoff = pfn; |
276 | return mmap_mem(file, vma); | 280 | return mmap_mem(file, vma); |
277 | } | 281 | } |
278 | 282 | ||
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 5e5d2c3c7ce4..b82fd15d0891 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3789,6 +3789,7 @@ e1000_netpoll(struct net_device *netdev) | |||
3789 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3789 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3790 | disable_irq(adapter->pdev->irq); | 3790 | disable_irq(adapter->pdev->irq); |
3791 | e1000_intr(adapter->pdev->irq, netdev, NULL); | 3791 | e1000_intr(adapter->pdev->irq, netdev, NULL); |
3792 | e1000_clean_tx_irq(adapter); | ||
3792 | enable_irq(adapter->pdev->irq); | 3793 | enable_irq(adapter->pdev->irq); |
3793 | } | 3794 | } |
3794 | #endif | 3795 | #endif |
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 929170dcd3cb..600ba1202864 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c | |||
@@ -183,7 +183,7 @@ | |||
183 | * cross a page boundy. | 183 | * cross a page boundy. |
184 | */ | 184 | */ |
185 | #define SEGMENTX_LEN (sizeof(struct SGentry)*DC395x_MAX_SG_LISTENTRY) | 185 | #define SEGMENTX_LEN (sizeof(struct SGentry)*DC395x_MAX_SG_LISTENTRY) |
186 | #define VIRTX_LEN (sizeof(void *) * DC395x_MAX_SG_LISTENTRY) | 186 | |
187 | 187 | ||
188 | struct SGentry { | 188 | struct SGentry { |
189 | u32 address; /* bus! address */ | 189 | u32 address; /* bus! address */ |
@@ -235,7 +235,6 @@ struct ScsiReqBlk { | |||
235 | u8 sg_count; /* No of HW sg entries for this request */ | 235 | u8 sg_count; /* No of HW sg entries for this request */ |
236 | u8 sg_index; /* Index of HW sg entry for this request */ | 236 | u8 sg_index; /* Index of HW sg entry for this request */ |
237 | u32 total_xfer_length; /* Total number of bytes remaining to be transfered */ | 237 | u32 total_xfer_length; /* Total number of bytes remaining to be transfered */ |
238 | void **virt_map; | ||
239 | unsigned char *virt_addr; /* Virtual address of current transfer position */ | 238 | unsigned char *virt_addr; /* Virtual address of current transfer position */ |
240 | 239 | ||
241 | /* | 240 | /* |
@@ -1022,14 +1021,14 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb, | |||
1022 | reqlen, cmd->request_buffer, cmd->use_sg, | 1021 | reqlen, cmd->request_buffer, cmd->use_sg, |
1023 | srb->sg_count); | 1022 | srb->sg_count); |
1024 | 1023 | ||
1024 | srb->virt_addr = page_address(sl->page); | ||
1025 | for (i = 0; i < srb->sg_count; i++) { | 1025 | for (i = 0; i < srb->sg_count; i++) { |
1026 | u32 seglen = (u32)sg_dma_len(sl + i); | 1026 | u32 busaddr = (u32)sg_dma_address(&sl[i]); |
1027 | sgp[i].address = (u32)sg_dma_address(sl + i); | 1027 | u32 seglen = (u32)sl[i].length; |
1028 | sgp[i].address = busaddr; | ||
1028 | sgp[i].length = seglen; | 1029 | sgp[i].length = seglen; |
1029 | srb->total_xfer_length += seglen; | 1030 | srb->total_xfer_length += seglen; |
1030 | srb->virt_map[i] = kmap(sl[i].page); | ||
1031 | } | 1031 | } |
1032 | srb->virt_addr = srb->virt_map[0]; | ||
1033 | sgp += srb->sg_count - 1; | 1032 | sgp += srb->sg_count - 1; |
1034 | 1033 | ||
1035 | /* | 1034 | /* |
@@ -1976,7 +1975,6 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left) | |||
1976 | int segment = cmd->use_sg; | 1975 | int segment = cmd->use_sg; |
1977 | u32 xferred = srb->total_xfer_length - left; /* bytes transfered */ | 1976 | u32 xferred = srb->total_xfer_length - left; /* bytes transfered */ |
1978 | struct SGentry *psge = srb->segment_x + srb->sg_index; | 1977 | struct SGentry *psge = srb->segment_x + srb->sg_index; |
1979 | void **virt = srb->virt_map; | ||
1980 | 1978 | ||
1981 | dprintkdbg(DBG_0, | 1979 | dprintkdbg(DBG_0, |
1982 | "sg_update_list: Transfered %i of %i bytes, %i remain\n", | 1980 | "sg_update_list: Transfered %i of %i bytes, %i remain\n", |
@@ -2016,16 +2014,16 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left) | |||
2016 | 2014 | ||
2017 | /* We have to walk the scatterlist to find it */ | 2015 | /* We have to walk the scatterlist to find it */ |
2018 | sg = (struct scatterlist *)cmd->request_buffer; | 2016 | sg = (struct scatterlist *)cmd->request_buffer; |
2019 | idx = 0; | ||
2020 | while (segment--) { | 2017 | while (segment--) { |
2021 | unsigned long mask = | 2018 | unsigned long mask = |
2022 | ~((unsigned long)sg->length - 1) & PAGE_MASK; | 2019 | ~((unsigned long)sg->length - 1) & PAGE_MASK; |
2023 | if ((sg_dma_address(sg) & mask) == (psge->address & mask)) { | 2020 | if ((sg_dma_address(sg) & mask) == (psge->address & mask)) { |
2024 | srb->virt_addr = virt[idx] + (psge->address & ~PAGE_MASK); | 2021 | srb->virt_addr = (page_address(sg->page) |
2022 | + psge->address - | ||
2023 | (psge->address & PAGE_MASK)); | ||
2025 | return; | 2024 | return; |
2026 | } | 2025 | } |
2027 | ++sg; | 2026 | ++sg; |
2028 | ++idx; | ||
2029 | } | 2027 | } |
2030 | 2028 | ||
2031 | dprintkl(KERN_ERR, "sg_update_list: sg_to_virt failed\n"); | 2029 | dprintkl(KERN_ERR, "sg_update_list: sg_to_virt failed\n"); |
@@ -2151,7 +2149,7 @@ static void data_out_phase0(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb, | |||
2151 | DC395x_read32(acb, TRM_S1040_DMA_CXCNT)); | 2149 | DC395x_read32(acb, TRM_S1040_DMA_CXCNT)); |
2152 | } | 2150 | } |
2153 | /* | 2151 | /* |
2154 | * calculate all the residue data that not yet transfered | 2152 | * calculate all the residue data that not yet tranfered |
2155 | * SCSI transfer counter + left in SCSI FIFO data | 2153 | * SCSI transfer counter + left in SCSI FIFO data |
2156 | * | 2154 | * |
2157 | * .....TRM_S1040_SCSI_COUNTER (24bits) | 2155 | * .....TRM_S1040_SCSI_COUNTER (24bits) |
@@ -3269,7 +3267,6 @@ static void pci_unmap_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb) | |||
3269 | struct scsi_cmnd *cmd = srb->cmd; | 3267 | struct scsi_cmnd *cmd = srb->cmd; |
3270 | enum dma_data_direction dir = cmd->sc_data_direction; | 3268 | enum dma_data_direction dir = cmd->sc_data_direction; |
3271 | if (cmd->use_sg && dir != PCI_DMA_NONE) { | 3269 | if (cmd->use_sg && dir != PCI_DMA_NONE) { |
3272 | int i; | ||
3273 | /* unmap DC395x SG list */ | 3270 | /* unmap DC395x SG list */ |
3274 | dprintkdbg(DBG_SG, "pci_unmap_srb: list=%08x(%05x)\n", | 3271 | dprintkdbg(DBG_SG, "pci_unmap_srb: list=%08x(%05x)\n", |
3275 | srb->sg_bus_addr, SEGMENTX_LEN); | 3272 | srb->sg_bus_addr, SEGMENTX_LEN); |
@@ -3279,8 +3276,6 @@ static void pci_unmap_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb) | |||
3279 | dprintkdbg(DBG_SG, "pci_unmap_srb: segs=%i buffer=%p\n", | 3276 | dprintkdbg(DBG_SG, "pci_unmap_srb: segs=%i buffer=%p\n", |
3280 | cmd->use_sg, cmd->request_buffer); | 3277 | cmd->use_sg, cmd->request_buffer); |
3281 | /* unmap the sg segments */ | 3278 | /* unmap the sg segments */ |
3282 | for (i = 0; i < srb->sg_count; i++) | ||
3283 | kunmap(virt_to_page(srb->virt_map[i])); | ||
3284 | pci_unmap_sg(acb->dev, | 3279 | pci_unmap_sg(acb->dev, |
3285 | (struct scatterlist *)cmd->request_buffer, | 3280 | (struct scatterlist *)cmd->request_buffer, |
3286 | cmd->use_sg, dir); | 3281 | cmd->use_sg, dir); |
@@ -3327,7 +3322,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, | |||
3327 | 3322 | ||
3328 | if (cmd->use_sg) { | 3323 | if (cmd->use_sg) { |
3329 | struct scatterlist* sg = (struct scatterlist *)cmd->request_buffer; | 3324 | struct scatterlist* sg = (struct scatterlist *)cmd->request_buffer; |
3330 | ptr = (struct ScsiInqData *)(srb->virt_map[0] + sg->offset); | 3325 | ptr = (struct ScsiInqData *)(page_address(sg->page) + sg->offset); |
3331 | } else { | 3326 | } else { |
3332 | ptr = (struct ScsiInqData *)(cmd->request_buffer); | 3327 | ptr = (struct ScsiInqData *)(cmd->request_buffer); |
3333 | } | 3328 | } |
@@ -4262,9 +4257,8 @@ static void adapter_sg_tables_free(struct AdapterCtlBlk *acb) | |||
4262 | const unsigned srbs_per_page = PAGE_SIZE/SEGMENTX_LEN; | 4257 | const unsigned srbs_per_page = PAGE_SIZE/SEGMENTX_LEN; |
4263 | 4258 | ||
4264 | for (i = 0; i < DC395x_MAX_SRB_CNT; i += srbs_per_page) | 4259 | for (i = 0; i < DC395x_MAX_SRB_CNT; i += srbs_per_page) |
4265 | kfree(acb->srb_array[i].segment_x); | 4260 | if (acb->srb_array[i].segment_x) |
4266 | 4261 | kfree(acb->srb_array[i].segment_x); | |
4267 | vfree(acb->srb_array[0].virt_map); | ||
4268 | } | 4262 | } |
4269 | 4263 | ||
4270 | 4264 | ||
@@ -4280,12 +4274,9 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb) | |||
4280 | int srb_idx = 0; | 4274 | int srb_idx = 0; |
4281 | unsigned i = 0; | 4275 | unsigned i = 0; |
4282 | struct SGentry *ptr; | 4276 | struct SGentry *ptr; |
4283 | void **virt_array; | ||
4284 | 4277 | ||
4285 | for (i = 0; i < DC395x_MAX_SRB_CNT; i++) { | 4278 | for (i = 0; i < DC395x_MAX_SRB_CNT; i++) |
4286 | acb->srb_array[i].segment_x = NULL; | 4279 | acb->srb_array[i].segment_x = NULL; |
4287 | acb->srb_array[i].virt_map = NULL; | ||
4288 | } | ||
4289 | 4280 | ||
4290 | dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages); | 4281 | dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages); |
4291 | while (pages--) { | 4282 | while (pages--) { |
@@ -4306,19 +4297,6 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb) | |||
4306 | ptr + (i * DC395x_MAX_SG_LISTENTRY); | 4297 | ptr + (i * DC395x_MAX_SG_LISTENTRY); |
4307 | else | 4298 | else |
4308 | dprintkl(KERN_DEBUG, "No space for tmsrb SG table reserved?!\n"); | 4299 | dprintkl(KERN_DEBUG, "No space for tmsrb SG table reserved?!\n"); |
4309 | |||
4310 | virt_array = vmalloc((DC395x_MAX_SRB_CNT + 1) * DC395x_MAX_SG_LISTENTRY * sizeof(void*)); | ||
4311 | |||
4312 | if (!virt_array) { | ||
4313 | adapter_sg_tables_free(acb); | ||
4314 | return 1; | ||
4315 | } | ||
4316 | |||
4317 | for (i = 0; i < DC395x_MAX_SRB_CNT + 1; i++) { | ||
4318 | acb->srb_array[i].virt_map = virt_array; | ||
4319 | virt_array += DC395x_MAX_SG_LISTENTRY; | ||
4320 | } | ||
4321 | |||
4322 | return 0; | 4300 | return 0; |
4323 | } | 4301 | } |
4324 | 4302 | ||
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index d2e19f6dd72c..4ff853fbe0be 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -628,7 +628,7 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) | |||
628 | int | 628 | int |
629 | fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) | 629 | fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) |
630 | { | 630 | { |
631 | int err; | 631 | int err, flags = info->flags; |
632 | 632 | ||
633 | if (var->activate & FB_ACTIVATE_INV_MODE) { | 633 | if (var->activate & FB_ACTIVATE_INV_MODE) { |
634 | struct fb_videomode mode1, mode2; | 634 | struct fb_videomode mode1, mode2; |
@@ -682,7 +682,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) | |||
682 | !list_empty(&info->modelist)) | 682 | !list_empty(&info->modelist)) |
683 | err = fb_add_videomode(&mode, &info->modelist); | 683 | err = fb_add_videomode(&mode, &info->modelist); |
684 | 684 | ||
685 | if (!err && info->flags & FBINFO_MISC_USEREVENT) { | 685 | if (!err && (flags & FBINFO_MISC_USEREVENT)) { |
686 | struct fb_event event; | 686 | struct fb_event event; |
687 | 687 | ||
688 | info->flags &= ~FBINFO_MISC_USEREVENT; | 688 | info->flags &= ~FBINFO_MISC_USEREVENT; |
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 298bc9cd99e7..a112a1786855 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
@@ -583,23 +583,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
583 | return -ENODEV; | 583 | return -ENODEV; |
584 | } | 584 | } |
585 | 585 | ||
586 | /* Map the fb and MMIO regions */ | ||
587 | dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache | ||
588 | (dinfo->aperture.physical, dinfo->aperture.size); | ||
589 | if (!dinfo->aperture.virtual) { | ||
590 | ERR_MSG("Cannot remap FB region.\n"); | ||
591 | cleanup(dinfo); | ||
592 | return -ENODEV; | ||
593 | } | ||
594 | dinfo->mmio_base = | ||
595 | (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, | ||
596 | INTEL_REG_SIZE); | ||
597 | if (!dinfo->mmio_base) { | ||
598 | ERR_MSG("Cannot remap MMIO region.\n"); | ||
599 | cleanup(dinfo); | ||
600 | return -ENODEV; | ||
601 | } | ||
602 | |||
603 | /* Get the chipset info. */ | 586 | /* Get the chipset info. */ |
604 | dinfo->pci_chipset = pdev->device; | 587 | dinfo->pci_chipset = pdev->device; |
605 | 588 | ||
@@ -630,9 +613,15 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
630 | dinfo->accel = 0; | 613 | dinfo->accel = 0; |
631 | } | 614 | } |
632 | 615 | ||
616 | if (MB(voffset) < stolen_size) | ||
617 | offset = (stolen_size >> 12); | ||
618 | else | ||
619 | offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; | ||
620 | |||
633 | /* Framebuffer parameters - Use all the stolen memory if >= vram */ | 621 | /* Framebuffer parameters - Use all the stolen memory if >= vram */ |
634 | if (ROUND_UP_TO_PAGE(stolen_size) >= MB(vram)) { | 622 | if (ROUND_UP_TO_PAGE(stolen_size) >= ((offset << 12) + MB(vram))) { |
635 | dinfo->fb.size = ROUND_UP_TO_PAGE(stolen_size); | 623 | dinfo->fb.size = ROUND_UP_TO_PAGE(stolen_size); |
624 | dinfo->fb.offset = 0; | ||
636 | dinfo->fbmem_gart = 0; | 625 | dinfo->fbmem_gart = 0; |
637 | } else { | 626 | } else { |
638 | dinfo->fb.size = MB(vram); | 627 | dinfo->fb.size = MB(vram); |
@@ -663,11 +652,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
663 | return -ENODEV; | 652 | return -ENODEV; |
664 | } | 653 | } |
665 | 654 | ||
666 | if (MB(voffset) < stolen_size) | ||
667 | offset = (stolen_size >> 12); | ||
668 | else | ||
669 | offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; | ||
670 | |||
671 | /* set the mem offsets - set them after the already used pages */ | 655 | /* set the mem offsets - set them after the already used pages */ |
672 | if (dinfo->accel) { | 656 | if (dinfo->accel) { |
673 | dinfo->ring.offset = offset + gtt_info.current_memory; | 657 | dinfo->ring.offset = offset + gtt_info.current_memory; |
@@ -682,6 +666,26 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
682 | + (dinfo->cursor.size >> 12); | 666 | + (dinfo->cursor.size >> 12); |
683 | } | 667 | } |
684 | 668 | ||
669 | /* Map the fb and MMIO regions */ | ||
670 | /* ioremap only up to the end of used aperture */ | ||
671 | dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache | ||
672 | (dinfo->aperture.physical, (dinfo->fb.offset << 12) | ||
673 | + dinfo->fb.size); | ||
674 | if (!dinfo->aperture.virtual) { | ||
675 | ERR_MSG("Cannot remap FB region.\n"); | ||
676 | cleanup(dinfo); | ||
677 | return -ENODEV; | ||
678 | } | ||
679 | |||
680 | dinfo->mmio_base = | ||
681 | (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, | ||
682 | INTEL_REG_SIZE); | ||
683 | if (!dinfo->mmio_base) { | ||
684 | ERR_MSG("Cannot remap MMIO region.\n"); | ||
685 | cleanup(dinfo); | ||
686 | return -ENODEV; | ||
687 | } | ||
688 | |||
685 | /* Allocate memories (which aren't stolen) */ | 689 | /* Allocate memories (which aren't stolen) */ |
686 | if (dinfo->accel) { | 690 | if (dinfo->accel) { |
687 | if (!(dinfo->gtt_ring_mem = | 691 | if (!(dinfo->gtt_ring_mem = |
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 8a9c42822502..0bbf029b1ef1 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -593,7 +593,7 @@ void w1_search(struct w1_master *dev, w1_slave_found_callback cb) | |||
593 | * Return 0 - device(s) present, 1 - no devices present. | 593 | * Return 0 - device(s) present, 1 - no devices present. |
594 | */ | 594 | */ |
595 | if (w1_reset_bus(dev)) { | 595 | if (w1_reset_bus(dev)) { |
596 | dev_info(&dev->dev, "No devices present on the wire.\n"); | 596 | dev_dbg(&dev->dev, "No devices present on the wire.\n"); |
597 | break; | 597 | break; |
598 | } | 598 | } |
599 | 599 | ||
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index dab4774ee7bb..3196d4c4eed3 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES | |||
@@ -1,3 +1,9 @@ | |||
1 | Version 1.35 | ||
2 | ------------ | ||
3 | Add writepage performance improvements. Fix path name conversions | ||
4 | for long filenames on mounts which were done with "mapchars" mount option | ||
5 | specified. | ||
6 | |||
1 | Version 1.34 | 7 | Version 1.34 |
2 | ------------ | 8 | ------------ |
3 | Fix error mapping of the TOO_MANY_LINKS (hardlinks) case. | 9 | Fix error mapping of the TOO_MANY_LINKS (hardlinks) case. |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 3c628bf667a5..0db0b313d715 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -2602,6 +2602,9 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon, | |||
2602 | if(name_len < PATH_MAX) { | 2602 | if(name_len < PATH_MAX) { |
2603 | memcpy(pSMB->ResumeFileName, psrch_inf->presume_name, name_len); | 2603 | memcpy(pSMB->ResumeFileName, psrch_inf->presume_name, name_len); |
2604 | byte_count += name_len; | 2604 | byte_count += name_len; |
2605 | /* 14 byte parm len above enough for 2 byte null terminator */ | ||
2606 | pSMB->ResumeFileName[name_len] = 0; | ||
2607 | pSMB->ResumeFileName[name_len+1] = 0; | ||
2605 | } else { | 2608 | } else { |
2606 | rc = -EINVAL; | 2609 | rc = -EINVAL; |
2607 | goto FNext2_err_exit; | 2610 | goto FNext2_err_exit; |
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 072b4ee8c53e..20ae4153f791 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -611,6 +611,7 @@ cifsConvertToUCS(__le16 * target, const char *source, int maxlen, | |||
611 | src_char = source[i]; | 611 | src_char = source[i]; |
612 | switch (src_char) { | 612 | switch (src_char) { |
613 | case 0: | 613 | case 0: |
614 | target[j] = 0; | ||
614 | goto ctoUCS_out; | 615 | goto ctoUCS_out; |
615 | case ':': | 616 | case ':': |
616 | target[j] = cpu_to_le16(UNI_COLON); | 617 | target[j] = cpu_to_le16(UNI_COLON); |
diff --git a/fs/inotify.c b/fs/inotify.c index 27ebcac5e07f..868901b1e779 100644 --- a/fs/inotify.c +++ b/fs/inotify.c | |||
@@ -402,7 +402,7 @@ static struct inotify_watch *create_watch(struct inotify_device *dev, | |||
402 | return ERR_PTR(ret); | 402 | return ERR_PTR(ret); |
403 | } | 403 | } |
404 | 404 | ||
405 | dev->last_wd = ret; | 405 | dev->last_wd = watch->wd; |
406 | watch->mask = mask; | 406 | watch->mask = mask; |
407 | atomic_set(&watch->count, 0); | 407 | atomic_set(&watch->count, 0); |
408 | INIT_LIST_HEAD(&watch->d_list); | 408 | INIT_LIST_HEAD(&watch->d_list); |
diff --git a/fs/namei.c b/fs/namei.c index 57046d98a746..b85f158aef0c 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2216,7 +2216,8 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
2216 | error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry); | 2216 | error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry); |
2217 | if (!error) { | 2217 | if (!error) { |
2218 | const char *new_name = old_dentry->d_name.name; | 2218 | const char *new_name = old_dentry->d_name.name; |
2219 | fsnotify_move(old_dir, new_dir, old_name, new_name, is_dir, new_dentry->d_inode); | 2219 | fsnotify_move(old_dir, new_dir, old_name, new_name, is_dir, |
2220 | new_dentry->d_inode, old_dentry->d_inode); | ||
2220 | } | 2221 | } |
2221 | fsnotify_oldname_free(old_name); | 2222 | fsnotify_oldname_free(old_name); |
2222 | 2223 | ||
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index a20bbc1642dc..3549067c42d9 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -593,6 +593,9 @@ static int new_inode_init(struct inode *inode, struct inode *dir, int mode) | |||
593 | */ | 593 | */ |
594 | inode->i_uid = current->fsuid; | 594 | inode->i_uid = current->fsuid; |
595 | inode->i_mode = mode; | 595 | inode->i_mode = mode; |
596 | /* Make inode invalid - just in case we are going to drop it before | ||
597 | * the initialization happens */ | ||
598 | INODE_PKEY(inode)->k_objectid = 0; | ||
596 | 599 | ||
597 | if (dir->i_mode & S_ISGID) { | 600 | if (dir->i_mode & S_ISGID) { |
598 | inode->i_gid = dir->i_gid; | 601 | inode->i_gid = dir->i_gid; |
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h index 2cbab30734d6..78c85985aee3 100644 --- a/include/asm-i386/pci.h +++ b/include/asm-i386/pci.h | |||
@@ -18,9 +18,11 @@ extern unsigned int pcibios_assign_all_busses(void); | |||
18 | #define pcibios_scan_all_fns(a, b) 0 | 18 | #define pcibios_scan_all_fns(a, b) 0 |
19 | 19 | ||
20 | extern unsigned long pci_mem_start; | 20 | extern unsigned long pci_mem_start; |
21 | #define PCIBIOS_MIN_IO 0x4000 | 21 | #define PCIBIOS_MIN_IO 0x1000 |
22 | #define PCIBIOS_MIN_MEM (pci_mem_start) | 22 | #define PCIBIOS_MIN_MEM (pci_mem_start) |
23 | 23 | ||
24 | #define PCIBIOS_MIN_CARDBUS_IO 0x4000 | ||
25 | |||
24 | void pcibios_config_init(void); | 26 | void pcibios_config_init(void); |
25 | struct pci_bus * pcibios_scan_root(int bus); | 27 | struct pci_bus * pcibios_scan_root(int bus); |
26 | 28 | ||
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index 245447081f0d..4e7701d6d23c 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h | |||
@@ -406,7 +406,7 @@ register long __sc6 __asm__ ("r6") = (long) arg3; \ | |||
406 | register long __sc7 __asm__ ("r7") = (long) arg4; \ | 406 | register long __sc7 __asm__ ("r7") = (long) arg4; \ |
407 | register long __sc0 __asm__ ("r0") = (long) arg5; \ | 407 | register long __sc0 __asm__ ("r0") = (long) arg5; \ |
408 | register long __sc1 __asm__ ("r1") = (long) arg6; \ | 408 | register long __sc1 __asm__ ("r1") = (long) arg6; \ |
409 | __asm__ __volatile__ ("trapa #0x15" \ | 409 | __asm__ __volatile__ ("trapa #0x16" \ |
410 | : "=z" (__sc0) \ | 410 | : "=z" (__sc0) \ |
411 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \ | 411 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \ |
412 | "r" (__sc3), "r" (__sc1) \ | 412 | "r" (__sc3), "r" (__sc1) \ |
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h index 9c4527eb55e2..eeb3088a1c9e 100644 --- a/include/asm-x86_64/pci.h +++ b/include/asm-x86_64/pci.h | |||
@@ -22,9 +22,11 @@ extern unsigned int pcibios_assign_all_busses(void); | |||
22 | extern int no_iommu, force_iommu; | 22 | extern int no_iommu, force_iommu; |
23 | 23 | ||
24 | extern unsigned long pci_mem_start; | 24 | extern unsigned long pci_mem_start; |
25 | #define PCIBIOS_MIN_IO 0x4000 | 25 | #define PCIBIOS_MIN_IO 0x1000 |
26 | #define PCIBIOS_MIN_MEM (pci_mem_start) | 26 | #define PCIBIOS_MIN_MEM (pci_mem_start) |
27 | 27 | ||
28 | #define PCIBIOS_MIN_CARDBUS_IO 0x4000 | ||
29 | |||
28 | void pcibios_config_init(void); | 30 | void pcibios_config_init(void); |
29 | struct pci_bus * pcibios_scan_root(int bus); | 31 | struct pci_bus * pcibios_scan_root(int bus); |
30 | extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value); | 32 | extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value); |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 602c305c8585..03b8e7932b83 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -21,7 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | 22 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, |
23 | const char *old_name, const char *new_name, | 23 | const char *old_name, const char *new_name, |
24 | int isdir, struct inode *target) | 24 | int isdir, struct inode *target, struct inode *source) |
25 | { | 25 | { |
26 | u32 cookie = inotify_get_cookie(); | 26 | u32 cookie = inotify_get_cookie(); |
27 | 27 | ||
@@ -41,6 +41,10 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
41 | inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL); | 41 | inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL); |
42 | inotify_inode_is_dead(target); | 42 | inotify_inode_is_dead(target); |
43 | } | 43 | } |
44 | |||
45 | if (source) { | ||
46 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL); | ||
47 | } | ||
44 | } | 48 | } |
45 | 49 | ||
46 | /* | 50 | /* |
diff --git a/include/linux/inotify.h b/include/linux/inotify.h index a40c2bf0408e..93bb3afe646b 100644 --- a/include/linux/inotify.h +++ b/include/linux/inotify.h | |||
@@ -35,6 +35,7 @@ struct inotify_event { | |||
35 | #define IN_CREATE 0x00000100 /* Subfile was created */ | 35 | #define IN_CREATE 0x00000100 /* Subfile was created */ |
36 | #define IN_DELETE 0x00000200 /* Subfile was deleted */ | 36 | #define IN_DELETE 0x00000200 /* Subfile was deleted */ |
37 | #define IN_DELETE_SELF 0x00000400 /* Self was deleted */ | 37 | #define IN_DELETE_SELF 0x00000400 /* Self was deleted */ |
38 | #define IN_MOVE_SELF 0x00000800 /* Self was moved */ | ||
38 | 39 | ||
39 | /* the following are legal events. they are sent as needed to any watch */ | 40 | /* the following are legal events. they are sent as needed to any watch */ |
40 | #define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */ | 41 | #define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */ |
@@ -56,7 +57,8 @@ struct inotify_event { | |||
56 | */ | 57 | */ |
57 | #define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ | 58 | #define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ |
58 | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ | 59 | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ |
59 | IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF) | 60 | IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \ |
61 | IN_MOVE_SELF) | ||
60 | 62 | ||
61 | #ifdef __KERNEL__ | 63 | #ifdef __KERNEL__ |
62 | 64 | ||
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index bcd0ac33f592..5ade54a78dbb 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | #include <linux/netdevice.h> | 10 | #include <linux/netdevice.h> |
11 | #include <linux/interrupt.h> | 11 | #include <linux/interrupt.h> |
12 | #include <linux/rcupdate.h> | ||
12 | #include <linux/list.h> | 13 | #include <linux/list.h> |
13 | 14 | ||
14 | struct netpoll; | 15 | struct netpoll; |
@@ -26,6 +27,7 @@ struct netpoll { | |||
26 | struct netpoll_info { | 27 | struct netpoll_info { |
27 | spinlock_t poll_lock; | 28 | spinlock_t poll_lock; |
28 | int poll_owner; | 29 | int poll_owner; |
30 | int tries; | ||
29 | int rx_flags; | 31 | int rx_flags; |
30 | spinlock_t rx_lock; | 32 | spinlock_t rx_lock; |
31 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ | 33 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ |
@@ -60,25 +62,31 @@ static inline int netpoll_rx(struct sk_buff *skb) | |||
60 | return ret; | 62 | return ret; |
61 | } | 63 | } |
62 | 64 | ||
63 | static inline void netpoll_poll_lock(struct net_device *dev) | 65 | static inline void *netpoll_poll_lock(struct net_device *dev) |
64 | { | 66 | { |
67 | rcu_read_lock(); /* deal with race on ->npinfo */ | ||
65 | if (dev->npinfo) { | 68 | if (dev->npinfo) { |
66 | spin_lock(&dev->npinfo->poll_lock); | 69 | spin_lock(&dev->npinfo->poll_lock); |
67 | dev->npinfo->poll_owner = smp_processor_id(); | 70 | dev->npinfo->poll_owner = smp_processor_id(); |
71 | return dev->npinfo; | ||
68 | } | 72 | } |
73 | return NULL; | ||
69 | } | 74 | } |
70 | 75 | ||
71 | static inline void netpoll_poll_unlock(struct net_device *dev) | 76 | static inline void netpoll_poll_unlock(void *have) |
72 | { | 77 | { |
73 | if (dev->npinfo) { | 78 | struct netpoll_info *npi = have; |
74 | dev->npinfo->poll_owner = -1; | 79 | |
75 | spin_unlock(&dev->npinfo->poll_lock); | 80 | if (npi) { |
81 | npi->poll_owner = -1; | ||
82 | spin_unlock(&npi->poll_lock); | ||
76 | } | 83 | } |
84 | rcu_read_unlock(); | ||
77 | } | 85 | } |
78 | 86 | ||
79 | #else | 87 | #else |
80 | #define netpoll_rx(a) 0 | 88 | #define netpoll_rx(a) 0 |
81 | #define netpoll_poll_lock(a) | 89 | #define netpoll_poll_lock(a) 0 |
82 | #define netpoll_poll_unlock(a) | 90 | #define netpoll_poll_unlock(a) |
83 | #endif | 91 | #endif |
84 | 92 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 0061c9470482..948527e42a60 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -255,7 +255,7 @@ struct sk_buff { | |||
255 | nohdr:1; | 255 | nohdr:1; |
256 | /* 3 bits spare */ | 256 | /* 3 bits spare */ |
257 | __u8 pkt_type; | 257 | __u8 pkt_type; |
258 | __u16 protocol; | 258 | __be16 protocol; |
259 | 259 | ||
260 | void (*destructor)(struct sk_buff *skb); | 260 | void (*destructor)(struct sk_buff *skb); |
261 | #ifdef CONFIG_NETFILTER | 261 | #ifdef CONFIG_NETFILTER |
diff --git a/net/core/dev.c b/net/core/dev.c index 52a3bf7ae177..faf59b02c4bf 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1696,7 +1696,8 @@ static void net_rx_action(struct softirq_action *h) | |||
1696 | struct softnet_data *queue = &__get_cpu_var(softnet_data); | 1696 | struct softnet_data *queue = &__get_cpu_var(softnet_data); |
1697 | unsigned long start_time = jiffies; | 1697 | unsigned long start_time = jiffies; |
1698 | int budget = netdev_budget; | 1698 | int budget = netdev_budget; |
1699 | 1699 | void *have; | |
1700 | |||
1700 | local_irq_disable(); | 1701 | local_irq_disable(); |
1701 | 1702 | ||
1702 | while (!list_empty(&queue->poll_list)) { | 1703 | while (!list_empty(&queue->poll_list)) { |
@@ -1709,10 +1710,10 @@ static void net_rx_action(struct softirq_action *h) | |||
1709 | 1710 | ||
1710 | dev = list_entry(queue->poll_list.next, | 1711 | dev = list_entry(queue->poll_list.next, |
1711 | struct net_device, poll_list); | 1712 | struct net_device, poll_list); |
1712 | netpoll_poll_lock(dev); | 1713 | have = netpoll_poll_lock(dev); |
1713 | 1714 | ||
1714 | if (dev->quota <= 0 || dev->poll(dev, &budget)) { | 1715 | if (dev->quota <= 0 || dev->poll(dev, &budget)) { |
1715 | netpoll_poll_unlock(dev); | 1716 | netpoll_poll_unlock(have); |
1716 | local_irq_disable(); | 1717 | local_irq_disable(); |
1717 | list_del(&dev->poll_list); | 1718 | list_del(&dev->poll_list); |
1718 | list_add_tail(&dev->poll_list, &queue->poll_list); | 1719 | list_add_tail(&dev->poll_list, &queue->poll_list); |
@@ -1721,7 +1722,7 @@ static void net_rx_action(struct softirq_action *h) | |||
1721 | else | 1722 | else |
1722 | dev->quota = dev->weight; | 1723 | dev->quota = dev->weight; |
1723 | } else { | 1724 | } else { |
1724 | netpoll_poll_unlock(dev); | 1725 | netpoll_poll_unlock(have); |
1725 | dev_put(dev); | 1726 | dev_put(dev); |
1726 | local_irq_disable(); | 1727 | local_irq_disable(); |
1727 | } | 1728 | } |
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index c327c9edadc5..a1a9a7abff50 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #define MAX_UDP_CHUNK 1460 | 33 | #define MAX_UDP_CHUNK 1460 |
34 | #define MAX_SKBS 32 | 34 | #define MAX_SKBS 32 |
35 | #define MAX_QUEUE_DEPTH (MAX_SKBS / 2) | 35 | #define MAX_QUEUE_DEPTH (MAX_SKBS / 2) |
36 | #define MAX_RETRIES 20000 | ||
36 | 37 | ||
37 | static DEFINE_SPINLOCK(skb_list_lock); | 38 | static DEFINE_SPINLOCK(skb_list_lock); |
38 | static int nr_skbs; | 39 | static int nr_skbs; |
@@ -248,14 +249,14 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) | |||
248 | int status; | 249 | int status; |
249 | struct netpoll_info *npinfo; | 250 | struct netpoll_info *npinfo; |
250 | 251 | ||
251 | repeat: | 252 | if (!np || !np->dev || !netif_running(np->dev)) { |
252 | if(!np || !np->dev || !netif_running(np->dev)) { | ||
253 | __kfree_skb(skb); | 253 | __kfree_skb(skb); |
254 | return; | 254 | return; |
255 | } | 255 | } |
256 | 256 | ||
257 | /* avoid recursion */ | ||
258 | npinfo = np->dev->npinfo; | 257 | npinfo = np->dev->npinfo; |
258 | |||
259 | /* avoid recursion */ | ||
259 | if (npinfo->poll_owner == smp_processor_id() || | 260 | if (npinfo->poll_owner == smp_processor_id() || |
260 | np->dev->xmit_lock_owner == smp_processor_id()) { | 261 | np->dev->xmit_lock_owner == smp_processor_id()) { |
261 | if (np->drop) | 262 | if (np->drop) |
@@ -265,30 +266,37 @@ repeat: | |||
265 | return; | 266 | return; |
266 | } | 267 | } |
267 | 268 | ||
268 | spin_lock(&np->dev->xmit_lock); | 269 | do { |
269 | np->dev->xmit_lock_owner = smp_processor_id(); | 270 | npinfo->tries--; |
271 | spin_lock(&np->dev->xmit_lock); | ||
272 | np->dev->xmit_lock_owner = smp_processor_id(); | ||
270 | 273 | ||
271 | /* | 274 | /* |
272 | * network drivers do not expect to be called if the queue is | 275 | * network drivers do not expect to be called if the queue is |
273 | * stopped. | 276 | * stopped. |
274 | */ | 277 | */ |
275 | if (netif_queue_stopped(np->dev)) { | 278 | if (netif_queue_stopped(np->dev)) { |
279 | np->dev->xmit_lock_owner = -1; | ||
280 | spin_unlock(&np->dev->xmit_lock); | ||
281 | netpoll_poll(np); | ||
282 | udelay(50); | ||
283 | continue; | ||
284 | } | ||
285 | |||
286 | status = np->dev->hard_start_xmit(skb, np->dev); | ||
276 | np->dev->xmit_lock_owner = -1; | 287 | np->dev->xmit_lock_owner = -1; |
277 | spin_unlock(&np->dev->xmit_lock); | 288 | spin_unlock(&np->dev->xmit_lock); |
278 | 289 | ||
279 | netpoll_poll(np); | 290 | /* success */ |
280 | goto repeat; | 291 | if(!status) { |
281 | } | 292 | npinfo->tries = MAX_RETRIES; /* reset */ |
282 | 293 | return; | |
283 | status = np->dev->hard_start_xmit(skb, np->dev); | 294 | } |
284 | np->dev->xmit_lock_owner = -1; | ||
285 | spin_unlock(&np->dev->xmit_lock); | ||
286 | 295 | ||
287 | /* transmit busy */ | 296 | /* transmit busy */ |
288 | if(status) { | ||
289 | netpoll_poll(np); | 297 | netpoll_poll(np); |
290 | goto repeat; | 298 | udelay(50); |
291 | } | 299 | } while (npinfo->tries > 0); |
292 | } | 300 | } |
293 | 301 | ||
294 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | 302 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len) |
@@ -349,15 +357,11 @@ static void arp_reply(struct sk_buff *skb) | |||
349 | unsigned char *arp_ptr; | 357 | unsigned char *arp_ptr; |
350 | int size, type = ARPOP_REPLY, ptype = ETH_P_ARP; | 358 | int size, type = ARPOP_REPLY, ptype = ETH_P_ARP; |
351 | u32 sip, tip; | 359 | u32 sip, tip; |
352 | unsigned long flags; | ||
353 | struct sk_buff *send_skb; | 360 | struct sk_buff *send_skb; |
354 | struct netpoll *np = NULL; | 361 | struct netpoll *np = NULL; |
355 | 362 | ||
356 | spin_lock_irqsave(&npinfo->rx_lock, flags); | ||
357 | if (npinfo->rx_np && npinfo->rx_np->dev == skb->dev) | 363 | if (npinfo->rx_np && npinfo->rx_np->dev == skb->dev) |
358 | np = npinfo->rx_np; | 364 | np = npinfo->rx_np; |
359 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); | ||
360 | |||
361 | if (!np) | 365 | if (!np) |
362 | return; | 366 | return; |
363 | 367 | ||
@@ -639,9 +643,11 @@ int netpoll_setup(struct netpoll *np) | |||
639 | if (!npinfo) | 643 | if (!npinfo) |
640 | goto release; | 644 | goto release; |
641 | 645 | ||
646 | npinfo->rx_flags = 0; | ||
642 | npinfo->rx_np = NULL; | 647 | npinfo->rx_np = NULL; |
643 | npinfo->poll_lock = SPIN_LOCK_UNLOCKED; | 648 | npinfo->poll_lock = SPIN_LOCK_UNLOCKED; |
644 | npinfo->poll_owner = -1; | 649 | npinfo->poll_owner = -1; |
650 | npinfo->tries = MAX_RETRIES; | ||
645 | npinfo->rx_lock = SPIN_LOCK_UNLOCKED; | 651 | npinfo->rx_lock = SPIN_LOCK_UNLOCKED; |
646 | } else | 652 | } else |
647 | npinfo = ndev->npinfo; | 653 | npinfo = ndev->npinfo; |
@@ -718,9 +724,16 @@ int netpoll_setup(struct netpoll *np) | |||
718 | npinfo->rx_np = np; | 724 | npinfo->rx_np = np; |
719 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); | 725 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); |
720 | } | 726 | } |
727 | |||
728 | /* fill up the skb queue */ | ||
729 | refill_skbs(); | ||
730 | |||
721 | /* last thing to do is link it to the net device structure */ | 731 | /* last thing to do is link it to the net device structure */ |
722 | ndev->npinfo = npinfo; | 732 | ndev->npinfo = npinfo; |
723 | 733 | ||
734 | /* avoid racing with NAPI reading npinfo */ | ||
735 | synchronize_rcu(); | ||
736 | |||
724 | return 0; | 737 | return 0; |
725 | 738 | ||
726 | release: | 739 | release: |