1. 02 4月, 2009 1 次提交
  2. 01 4月, 2009 1 次提交
  3. 31 3月, 2009 1 次提交
    • A
      proc 2/2: remove struct proc_dir_entry::owner · 99b76233
      Alexey Dobriyan 提交于
      Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
      as correctly noted at bug #12454. Someone can lookup entry with NULL
      ->owner, thus not pinning enything, and release it later resulting
      in module refcount underflow.
      
      We can keep ->owner and supply it at registration time like ->proc_fops
      and ->data.
      
      But this leaves ->owner as easy-manipulative field (just one C assignment)
      and somebody will forget to unpin previous/pin current module when
      switching ->owner. ->proc_fops is declared as "const" which should give
      some thoughts.
      
      ->read_proc/->write_proc were just fixed to not require ->owner for
      protection.
      
      rmmod'ed directories will be empty and return "." and ".." -- no harm.
      And directories with tricky enough readdir and lookup shouldn't be modular.
      We definitely don't want such modular code.
      
      Removing ->owner will also make PDE smaller.
      
      So, let's nuke it.
      
      Kudos to Jeff Layton for reminding about this, let's say, oversight.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=12454Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      99b76233
  4. 28 3月, 2009 3 次提交
    • A
      constify dentry_operations: rest · 3ba13d17
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      3ba13d17
    • I
      ia64: remove some warnings. · 7120569c
      Isaku Yamahata 提交于
      This patch removes the following warnings and related ones.
      Plus some cosmetics.
      
      arch/ia64/kernel/patch.c:112: warning: passing argument 1 of 'paravirt_fc' makes integer from pointer without a cast
      arch/ia64/kernel/patch.c:135: warning: passing argument 1 of 'paravirt_fc' makes integer from pointer without a cast
      arch/ia64/kernel/patch.c:166: warning: passing argument 1 of 'paravirt_fc' makes integer from pointer without a cast
      arch/ia64/kernel/patch.c:202: warning: passing argument 1 of 'paravirt_fc' makes integer from pointer without a cast
      arch/ia64/kernel/patch.c:220: warning: passing argument 1 of 'paravirt_fc' makes integer from pointer without a cast
      Signed-off-by: NIsaku Yamahata <yamahata@valinux.co.jp>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      7120569c
    • J
      [IA64] Fix kstat_this_cpu build breakage · 66f3e6af
      Jes Sorensen 提交于
      arch/ia64/kernel/irq_ia64.c: In function 'ia64_handle_irq':
      arch/ia64/kernel/irq_ia64.c:498: error: 'struct kernel_stat' has no member named 'irqs'
      arch/ia64/kernel/irq_ia64.c:500: error: 'struct kernel_stat' has no member named 'irqs'
      arch/ia64/kernel/irq_ia64.c: In function 'ia64_process_pending_intr':
      arch/ia64/kernel/irq_ia64.c:556: error: 'struct kernel_stat' has no member named 'irqs'
      arch/ia64/kernel/irq_ia64.c:558: error: 'struct kernel_stat' has no member named 'irqs'
      
      Fix build breakage due to recent kstat_this_cpu changes in:
         d7e51e66
         sparseirq: make some func to be used with genirq
      Signed-off-by: NJes Sorensen <jes@sgi.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      66f3e6af
  5. 27 3月, 2009 13 次提交
  6. 24 3月, 2009 1 次提交
  7. 16 3月, 2009 3 次提交
  8. 10 3月, 2009 1 次提交
    • T
      linker script: define __per_cpu_load on all SMP capable archs · 19390c4d
      Tejun Heo 提交于
      Impact: __per_cpu_load available on all SMP capable archs
      
      Percpu now requires three symbols to be defined - __per_cpu_load,
      __per_cpu_start and __per_cpu_end.  There were three archs which
      didn't have it.  Update them as follows.
      
      * powerpc: can use generic PERCPU() macro.  Compile tested for
        powerpc32, compile/boot tested for powerpc64.
      
      * ia64: can use generic PERCPU_VADDR() macro.  __phys_per_cpu_start is
        identical to __per_cpu_load.  Compile tested and symbol table looks
        identical after the change except for the additional __per_cpu_load.
      
      * arm: added explicit __per_cpu_load definition.  Currently uses
        unified .init output section so can't use the generic macro.  Dunno
        whether the unified .init ouput section is required by arch
        peculiarity so I left it alone.  Please break it up and use PERCPU()
        if possible.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Pat Gefre <pfg@sgi.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      19390c4d
  9. 26 2月, 2009 2 次提交
  10. 20 2月, 2009 2 次提交
    • A
      [IA64] Remove redundant cpu_clear() in __cpu_disable path · c0acdea2
      Alex Chiang 提交于
      The second call to cpu_clear() is redundant, as we've already removed
      the CPU from cpu_online_map before calling migrate_platform_irqs().
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NTony Luck <aegl@agluck-desktop.(none)>
      c0acdea2
    • A
      [IA64] Revert "prevent ia64 from invoking irq handlers on offline CPUs" · 66db2e63
      Alex Chiang 提交于
      This reverts commit e7b14036.
      
      Commit e7b14036 removes the targetted disabled CPU from the
      cpu_online_map after calls to migrate_platform_irqs and fixup_irqs.
      
      Paul McKenney states that the reasoning behind the patch was to
      prevent irq handlers from running on CPUs marked offline because:
      
      	RCU happily ignores CPUs that don't have their bits set in
      	cpu_online_map, so if there are RCU read-side critical sections
      	in the irq handlers being run, RCU will ignore them.  If the
      	other CPUs were running, they might sequence through the RCU
      	state machine, which could result in data structures being
      	yanked out from under those irq handlers, which in turn could
      	result in oopses or worse.
      
      Unfortunately, both ia64 functions above look at cpu_online_map to find
      a new CPU to migrate interrupts onto. This means we can potentially
      migrate an interrupt off ourself back to... ourself. Uh oh.
      
      This causes an oops when we finally try to process pending interrupts on
      the CPU we want to disable. The oops results from calling __do_IRQ with
      a NULL pt_regs:
      
      Unable to handle kernel NULL pointer dereference (address 0000000000000040)
      Call Trace:
       [<a000000100016930>] show_stack+0x50/0xa0
                                      sp=e0000009c922fa00 bsp=e0000009c92214d0
       [<a0000001000171a0>] show_regs+0x820/0x860
                                      sp=e0000009c922fbd0 bsp=e0000009c9221478
       [<a00000010003c700>] die+0x1a0/0x2e0
                                      sp=e0000009c922fbd0 bsp=e0000009c9221438
       [<a0000001006e92f0>] ia64_do_page_fault+0x950/0xa80
                                      sp=e0000009c922fbd0 bsp=e0000009c92213d8
       [<a00000010000c7a0>] ia64_native_leave_kernel+0x0/0x270
                                      sp=e0000009c922fc60 bsp=e0000009c92213d8
       [<a0000001000ecdb0>] profile_tick+0xd0/0x1c0
                                      sp=e0000009c922fe30 bsp=e0000009c9221398
       [<a00000010003bb90>] timer_interrupt+0x170/0x3e0
                                      sp=e0000009c922fe30 bsp=e0000009c9221330
       [<a00000010013a800>] handle_IRQ_event+0x80/0x120
                                      sp=e0000009c922fe30 bsp=e0000009c92212f8
       [<a00000010013aa00>] __do_IRQ+0x160/0x4a0
                                      sp=e0000009c922fe30 bsp=e0000009c9221290
       [<a000000100012290>] ia64_process_pending_intr+0x2b0/0x360
                                      sp=e0000009c922fe30 bsp=e0000009c9221208
       [<a0000001000112d0>] fixup_irqs+0xf0/0x2a0
                                      sp=e0000009c922fe30 bsp=e0000009c92211a8
       [<a00000010005bd80>] __cpu_disable+0x140/0x240
                                      sp=e0000009c922fe30 bsp=e0000009c9221168
       [<a0000001006c5870>] take_cpu_down+0x50/0xa0
                                      sp=e0000009c922fe30 bsp=e0000009c9221148
       [<a000000100122610>] stop_cpu+0xd0/0x200
                                      sp=e0000009c922fe30 bsp=e0000009c92210f0
       [<a0000001000e0440>] kthread+0xc0/0x140
                                      sp=e0000009c922fe30 bsp=e0000009c92210c8
       [<a000000100014ab0>] kernel_thread_helper+0xd0/0x100
                                      sp=e0000009c922fe30 bsp=e0000009c92210a0
       [<a00000010000a4c0>] start_kernel_thread+0x20/0x40
                                      sp=e0000009c922fe30 bsp=e0000009c92210a0
      
      I don't like this revert because it is fragile. ia64 is getting lucky
      because we seem to only ever process timer interrupts in this path, but
      if we ever race with an IPI here, we definitely use RCU and have the
      potential of hitting an oops that Paul describes above.
      
      Patching ia64's timer_interrupt() to check for NULL pt_regs is
      insufficient though, as we still hit the above oops.
      
      As a short term solution, I do think that this revert is the right
      answer. The revert hold up under repeated testing (24+ hour test runs)
      with this setup:
      
      	- 8-way rx6600
      	- randomly toggling CPU online/offline state every 2 seconds
      	- running CPU exercisers, memory hog, disk exercisers, and
      	  network stressors
      	- average system load around ~160
      
      In the long term, we really need to figure out why we set pt_regs = NULL
      in ia64_process_pending_intr(). If it turns out that it is unnecessary
      to do so, then we could safely re-introduce e7b14036 (along with some
      other logic to be smarter about migrating interrupts).
      
      One final note: x86 also removes the disabled CPU from cpu_online_map
      and then re-enables interrupts for 1ms, presumably to handle any pending
      interrupts:
      
      arch/x86/kernel/irq_32.c (and irq_64.c):
      cpu_disable_common:
      	[remove cpu from cpu_online_map]
      
      	fixup_irqs():
      		for_each_irq:
      			[break CPU affinities]
      
      		local_irq_enable();
      		mdelay(1);
      		local_irq_disable();
      
      So they are doing implicitly what ia64 is doing explicitly.
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NTony Luck <aegl@agluck-desktop.(none)>
      66db2e63
  11. 16 2月, 2009 1 次提交
    • Y
      [IA64] fix __apci_unmap_table · 970ec1a8
      Yinghai Lu 提交于
      Impact: fix build error
      
      to fix:
      
        tip/arch/ia64/kernel/acpi.c:203: error: conflicting types for '__acpi_unmap_table'
        tip/include/linux/acpi.h:82: error: previous declaration of '__acpi_unmap_table' was here
        tip/arch/ia64/kernel/acpi.c:203: error: conflicting types for '__acpi_unmap_table'
        tip/include/linux/acpi.h:82: error: previous declaration of '__acpi_unmap_table' was here
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      970ec1a8
  12. 09 2月, 2009 1 次提交
    • Y
      acpi/x86: introduce __apci_map_table, v4 · 7d97277b
      Yinghai Lu 提交于
      to prevent wrongly overwriting fixmap that still want to use.
      
      ACPI used to rely on low mappings being all linearly mapped and
      grew a habit: it never really unmapped certain kinds of tables
      after use.
      
      This can cause problems - for example the hypothetical case
      when some spurious access still references it.
      
      v2: remove prev_map and prev_size in __apci_map_table
      v3: let acpi_os_unmap_memory() call early_iounmap too, so remove extral calling to
      early_acpi_os_unmap_memory
      v4: fix typo in one acpi_get_table_with_size calling
      Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
      Acked-by: NLen Brown <len.brown@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7d97277b
  13. 29 1月, 2009 2 次提交
    • F
      IA64: fix VT-d dma_mapping_error · dfb805e8
      FUJITA Tomonori 提交于
      dma_mapping_error is used to see if dma_map_single and dma_map_page
      succeed. IA64 VT-d dma_mapping_error always says that dma_map_single
      is successful even though it could fail. Note that X86 VT-d works
      properly in this regard.
      
      This patch fixes IA64 VT-d dma_mapping_error by adding VT-d's own
      dma_mapping_error() that works for both X86_64 and IA64. VT-d uses
      zero as an error dma address so VT-d's dma_mapping_error returns 1 if
      a passed dma address is zero (as x86's VT-d dma_mapping_error does
      now).
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      dfb805e8
    • F
      IA64: fix swiotlb alloc_coherent for non DMA_64BIT_MASK devices · 97d9800d
      FUJITA Tomonori 提交于
      Before the dma ops unification, IA64 always uses GFP_DMA for
      dma_alloc_coherent like:
      
      #define dma_alloc_coherent(dev, size, handle, gfp)	\
      	platform_dma_alloc_coherent(dev, size, handle, (gfp) | GFP_DMA)
      
      This GFP_DMA enforcement doesn't make sense for IOMMUs since they can
      do address translation to give addresses that devices can access
      to. The IOMMU drivers ignore the zone flag. However, this is still
      necessary for swiotlb since it can't do address translation.
      
      We don't always need to use GFP_DMA for swiotlb. We need GFP_DMA for
      devices incapable of 64bit DMA.
      
      This patch is sorta updated version of:
      
      http://marc.info/?l=linux-kernel&m=122638215612705&w=2Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      97d9800d
  14. 27 1月, 2009 1 次提交
    • F
      IA64: fix compile error on IA64_DIG_VTD · fb446727
      FUJITA Tomonori 提交于
      This moves iommu_detected to arch/ia64/kernel/dma-mapping.c from
      arch/ia64/kernel/pci-swiotlb.c to fix the following error on on
      IA64_DIG_VTD:
      
       arch/ia64/kernel/built-in.o: In function `pci_iommu_init':
       pci-dma.c:(.init.text+0xa021): undefined reference to `iommu_detected'
       pci-dma.c:(.init.text+0xa030): undefined reference to `iommu_detected'
       drivers/built-in.o: In function `detect_intel_iommu':
       (.init.text+0x11c0): undefined reference to `iommu_detected'
       drivers/built-in.o: In function `detect_intel_iommu':
       (.init.text+0x11e1): undefined reference to `iommu_detected'
      
      iommu_detected is used to handle IOMMUs so I guess that
      arch/ia64/kernel/dma-mapping.c is ok (there might be a better place
      for it though).
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fb446727
  15. 17 1月, 2009 2 次提交
  16. 16 1月, 2009 1 次提交
  17. 15 1月, 2009 1 次提交
    • M
      irq: update all arches for new irq_desc, fix · d2287f5e
      Mike Travis 提交于
      Impact: fix build errors
      
      Since the SPARSE IRQS changes redefined how the kstat irqs are
      organized, arch's must use the new accessor function:
      
      	kstat_incr_irqs_this_cpu(irq, DESC);
      
      If CONFIG_SPARSE_IRQS is set, then DESC is a pointer to the
      irq_desc which has a pointer to the kstat_irqs.  If not, then
      the .irqs field of struct kernel_stat is used instead.
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d2287f5e
  18. 14 1月, 2009 1 次提交
  19. 13 1月, 2009 1 次提交
  20. 11 1月, 2009 1 次提交
    • Y
      sparseirq: use kstat_irqs_cpu instead · dee4102a
      Yinghai Lu 提交于
      Impact: build fix
      
      Ingo Molnar wrote:
      
      > tip/arch/blackfin/kernel/irqchip.c: In function 'show_interrupts':
      > tip/arch/blackfin/kernel/irqchip.c:85: error: 'struct kernel_stat' has no member named 'irqs'
      > make[2]: *** [arch/blackfin/kernel/irqchip.o] Error 1
      > make[2]: *** Waiting for unfinished jobs....
      >
      
      So could move kstat_irqs array to irq_desc struct.
      
      (s390, m68k, sparc) are not touched yet, because they don't support genirq
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      dee4102a