1. 15 7月, 2013 1 次提交
    • P
      tile: delete __cpuinit usage from all tile files · 18f894c1
      Paul Gortmaker 提交于
      The __cpuinit type of throwaway sections might have made sense
      some time ago when RAM was more constrained, but now the savings
      do not offset the cost and complications.  For example, the fix in
      commit 5e427ec2 ("x86: Fix bit corruption at CPU resume time")
      is a good example of the nasty type of bugs that can be created
      with improper use of the various __init prefixes.
      
      After a discussion on LKML[1] it was decided that cpuinit should go
      the way of devinit and be phased out.  Once all the users are gone,
      we can then finally remove the macros themselves from linux/init.h.
      
      Note that some harmless section mismatch warnings may result, since
      notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
      are flagged as __cpuinit  -- so if we remove the __cpuinit from
      arch specific callers, we will also get section mismatch warnings.
      As an intermediate step, we intend to turn the linux/init.h cpuinit
      content into no-ops as early as possible, since that will get rid
      of these warnings.  In any case, they are temporary and harmless.
      
      This removes all the arch/tile uses of the __cpuinit macros from
      all C files.  Currently tile does not have any __CPUINIT used in
      assembly files.
      
      [1] https://lkml.org/lkml/2013/5/20/589
      
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      18f894c1
  2. 27 3月, 2013 1 次提交
    • H
      tile: ns2cycles should use __raw_get_cpu_var · 39e8202b
      Henrik Austad 提交于
      ns2cycles use per_cpu variables, and will, eventually, find its way into
      smp_processor_id(). This is not safe in a preemptible kernel;
      preemption should ideally be disabled.
      
      BUG: using smp_processor_id() in preemptible [00000000] code:
      systemd-modules/367
      caller is ns2cycles+0x40/0xb8
      
      Starting stack dump of tid 367, pid 367 (systemd-modules) on cpu 2 at
      cycle 20969956421
       frame 0: 0xfffffff70004b860 dump_stack+0x0/0x20 (sp 0xfffffe407993fa90)
       frame 1: 0xfffffff7006abc28 debug_smp_processor_id+0x1a8/0x1e0 (sp
      0xfffffe407993fa90)
       frame 2: 0xfffffff7004d7b40 ns2cycles+0x40/0xb8 (sp 0xfffffe407993fab8)
       frame 3: 0xfffffff7004dc578 __ndelay+0x38/0x80 (sp 0xfffffe407993fae0)
      
      However, in this case:
      
      - the frequency is the same accross all cores
      - we use the data read-only
      - we do not scale the frequency
      
      Which means that we can use the __raw_get_cpu_var instead.
      Signed-off-by: NHenrik Austad <haustad@cisco.com>
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      39e8202b
  3. 04 6月, 2011 1 次提交
  4. 05 5月, 2011 1 次提交
    • C
      arch/tile: various header improvements for building drivers · 28d71741
      Chris Metcalf 提交于
      This change adds a number of missing headers in asm (fb.h, parport.h,
      serial.h, and vga.h) using the minimal generic versions.
      
      It also adds a number of missing interfaces that showed up as build
      failures when trying to build various drivers not normally included in the
      "tile" distribution: ioremap_wc(), memset_io(), io{read,write}{16,32}be(),
      virt_to_bus(), bus_to_virt(), irq_canonicalize(), __pte(), __pgd(),
      and __pmd().  I also added a cast in virt_to_page() since not all callers
      pass a pointer.
      
      I fixed <asm/stat.h> to properly include a __KERNEL__ guard for the
      __ARCH_WANT_STAT64 symbol, and <asm/swab.h> to use __builtin_bswap32()
      even for our 64-bit architecture, since the same code is produced.
      
      I added an export for get_cycles(), since it's used in some modules.
      
      And I made <arch/spr_def.h> properly include the __KERNEL__ guard,
      even though it's not yet exported, since it likely will be soon.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      28d71741
  5. 02 3月, 2011 1 次提交
    • C
      arch/tile: fix __ndelay etc to work better · 13371731
      Chris Metcalf 提交于
      The current implementations of __ndelay and __udelay call a hypervisor
      service to delay, but the hypervisor service isn't actually implemented
      very well, and the consensus is that Linux should handle figuring this
      out natively and not use a hypervisor service.
      
      By converting nanoseconds to cycles, and then spinning until the
      cycle counter reaches the desired cycle, we get several benefits:
      first, we are sensitive to the actual clock speed; second, we use
      less power by issuing a slow SPR read once every six cycles while
      we delay; and third, we properly handle the case of an interrupt by
      exiting at the target time rather than after some number of cycles.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      13371731
  6. 02 11月, 2010 1 次提交
  7. 13 8月, 2010 1 次提交
    • C
      arch/tile: Use separate, better minsec values for clocksource and sched_clock. · 749dc6f2
      Chris Metcalf 提交于
      We were using the same 5-sec minsec for the clocksource and sched_clock
      that we were using for the clock_event_device.  For the clock_event_device
      that's exactly right since it has a short maximum countdown time.
      But for sched_clock we want to avoid wraparound when converting from
      ticks to nsec over a much longer window, so we force a shift of 10.
      And for clocksource it seems dodgy to use a 5-sec minsec as well, so we
      copy some other platforms and force a shift of 22.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      749dc6f2
  8. 07 7月, 2010 1 次提交
    • C
      arch/tile: Miscellaneous cleanup changes. · 0707ad30
      Chris Metcalf 提交于
      This commit is primarily changes caused by reviewing "sparse"
      and "checkpatch" output on our sources, so is somewhat noisy, since
      things like "printk() -> pr_err()" (or whatever) throughout the
      codebase tend to get tedious to read.  Rather than trying to tease
      apart precisely which things changed due to which type of code
      review, this commit includes various cleanups in the code:
      
      - sparse: Add declarations in headers for globals.
      - sparse: Fix __user annotations.
      - sparse: Using gfp_t consistently instead of int.
      - sparse: removing functions not actually used.
      - checkpatch: Clean up printk() warnings by using pr_info(), etc.;
        also avoid partial-line printks except in bootup code.
        - checkpatch: Use exposed structs rather than typedefs.
        - checkpatch: Change some C99 comments to C89 comments.
      
      In addition, a couple of minor other changes are rolled in
      to this commit:
      
      - Add support for a "raise" instruction to cause SIGFPE, etc., to be raised.
      - Remove some compat code that is unnecessary when we fully eliminate
        some of the deprecated syscalls from the generic syscall ABI.
      - Update the tile_defconfig to reflect current config contents.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      0707ad30
  9. 05 6月, 2010 1 次提交