1. 29 Oct, 2010 40 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-kconfig · b7bdcc47
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-kconfig:
        kconfig: Have streamline_config process menuconfigs too
        kconfig: Fix streamline_config to read multi line deps in Kconfig files
        kconfig: Fix missing declaration of variable $dir in streamline_config.pl
        kconfig: Fix variable name typo %prompts in streamline_config.pl
        kconfig: Make localmodconfig handle environment variables
      b7bdcc47
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · 1840897a
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (34 commits)
        b43: Fix warning at drivers/mmc/core/core.c:237 in mmc_wait_for_cmd
        mac80211: fix failure to check kmalloc return value in key_key_read
        libertas: Fix sd8686 firmware reload
        ath9k: Fix incorrect access of rate flags in RC
        netfilter: xt_socket: Make tproto signed in socket_mt6_v1().
        stmmac: enable/disable rx/tx in the core with a single write.
        net: atarilance - flags should be unsigned long
        netxen: fix kdump
        pktgen: Limit how much data we copy onto the stack.
        net: Limit socket I/O iovec total length to INT_MAX.
        USB: gadget: fix ethernet gadget crash in gether_setup
        fib: Fix fib zone and its hash leak on namespace stop
        cxgb3: Fix panic in free_tx_desc()
        cxgb3: fix crash due to manipulating queues before registration
        8390: Don't oops on starting dev queue
        dccp ccid-2: Stop polling
        dccp: Refine the wait-for-ccid mechanism
        dccp: Extend CCID packet dequeueing interface
        dccp: Return-value convention of hc_tx_send_packet()
        igbvf: fix panic on load
        ...
      1840897a
    • Linus Torvalds's avatar
      d56f84e7
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ecryptfs/ecryptfs-2.6 · 12462f2d
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ecryptfs/ecryptfs-2.6:
        eCryptfs: Print mount_auth_tok_only param in ecryptfs_show_options
        ecryptfs: added ecryptfs_mount_auth_tok_only mount parameter
        ecryptfs: checking return code of ecryptfs_find_auth_tok_for_sig()
        ecryptfs: release keys loaded in ecryptfs_keyring_auth_tok_for_sig()
        eCryptfs: Clear LOOKUP_OPEN flag when creating lower file
        ecryptfs: call vfs_setxattr() in ecryptfs_setxattr()
      12462f2d
    • Valdis.Kletnieks@vt.edu's avatar
      drivers/dma/Kconfig: add part number for Topcliff. · d2df4085
      Valdis.Kletnieks@vt.edu authored
      Product codenames are OK, but once an actual product name is available,
      it should be referenced as well.
      
        http://ark.intel.com/chipset.aspx?familyID=52499Signed-off-by: default avatarValdis Kletnieks <valdis.kletnieks@vt.edu>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d2df4085
    • Greg Kroah-Hartman's avatar
      Staging: dream: remove dream driver and arch from tree · 3414df8c
      Greg Kroah-Hartman authored
      This code is stalled, with no one working on it anymore, and the main
      msm code is now going through the proper channels to get merged
      correctly.
      
      So remove it as it contains a number of kernel information leaks and it
      is doubtful if it even still builds anymore.
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Acked-by: default avatarBryan Huntsman <bryanh@codeaurora.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3414df8c
    • David S. Miller's avatar
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb · 1e431a9d
      Linus Torvalds authored
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
        kgdb,ppc: Individual register get/set for ppc
        kgdbts: prevent re-entry to kgdbts before it unregisters
        debug_core,x86,blackfin: Clean up hw debug disable API
        kdb: Fix early debugging crash regression
        kgdb,arm: fix register dump
        kdb: fix per_cpu command to remove supress mask
        kdb: Add kdb kernel module sample
      1e431a9d
    • Linus Torvalds's avatar
    • Larry Finger's avatar
      b43: Fix warning at drivers/mmc/core/core.c:237 in mmc_wait_for_cmd · 9f2a0fac
      Larry Finger authored
      On module removal, the sdio version of b43 generates the following warning:
      
      [  851.560519] ------------[ cut here ]------------
      [  851.560531] WARNING: at drivers/mmc/core/core.c:237 mmc_wait_for_cmd+0x88/0x90()
      [  851.560534] Hardware name: 20552PG
      [  851.560536] Modules linked in: b43(-) ssb mmc_block binfmt_misc rfcomm sco bnep ppdev l2cap ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp kvm_intel kvm arc4 iwlagn snd_hda_codec_conexant snd_hda_intel snd_hda_codec iwlcore snd_hwdep snd_pcm thinkpad_acpi mac80211 snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq r852 joydev snd_timer sm_common pcmcia nand snd_seq_device cfg80211 sdhci_pci btusb psmouse tpm_tis yenta_socket nand_ids lp snd pcmcia_rsrc nand_ecc bluetooth sdhci tpm pcmcia_core parport mtd snd_page_alloc serio_raw tpm_bios soundcore nvram led_class sha256_generic aes_i586 aes_generic dm_crypt i915 drm_kms_helper drm ahci intel_agp i2c_algo_bit intel_gtt e1000e libahci video agpgart output
      [  851.560620] Pid: 2504, comm: rmmod Not tainted 2.6.36-titan0+ #1
      [  851.560622] Call Trace:
      [  851.560631]  [<c014a102>] warn_slowpath_common+0x72/0xa0
      [  851.560636]  [<c04d94c8>] ? mmc_wait_for_cmd+0x88/0x90
      [  851.560641]  [<c04d94c8>] ? mmc_wait_for_cmd+0x88/0x90
      [  851.560645]  [<c014a152>] warn_slowpath_null+0x22/0x30
      [  851.560649]  [<c04d94c8>] mmc_wait_for_cmd+0x88/0x90
      [  851.560655]  [<c0401585>] ? device_release+0x25/0x80
      [  851.560660]  [<c04df210>] mmc_io_rw_direct_host+0xa0/0x150
      [  851.560665]  [<c04df370>] mmc_io_rw_direct+0x30/0x40
      [  851.560669]  [<c04e06e7>] sdio_disable_func+0x37/0xa0
      [  851.560683]  [<f8dfcb80>] b43_sdio_remove+0x30/0x50 [b43]
      [  851.560687]  [<c04df8cc>] sdio_bus_remove+0x1c/0x60
      [  851.560692]  [<c016d39f>] ? blocking_notifier_call_chain+0x1f/0x30
      [  851.560697]  [<c0404991>] __device_release_driver+0x51/0xb0
      [  851.560701]  [<c0404a7f>] driver_detach+0x8f/0xa0
      [  851.560705]  [<c0403c83>] bus_remove_driver+0x63/0xa0
      [  851.560709]  [<c0405039>] driver_unregister+0x49/0x80
      [  851.560713]  [<c0405039>] ? driver_unregister+0x49/0x80
      [  851.560718]  [<c04dfad7>] sdio_unregister_driver+0x17/0x20
      [  851.560727]  [<f8dfcb42>] b43_sdio_exit+0x12/0x20 [b43]
      [  851.560734]  [<f8dfe76f>] b43_exit+0x17/0x3c [b43]
      [  851.560740]  [<c017fb8d>] sys_delete_module+0x13d/0x200
      [  851.560747]  [<c01fd7d2>] ? do_munmap+0x212/0x300
      [  851.560752]  [<c010311f>] sysenter_do_call+0x12/0x28
      [  851.560757] ---[ end trace 31e14488072d2f7d ]---
      [  851.560759] ------------[ cut here ]------------
      
      The warning is caused by b43 not claiming the device before calling
      sdio_disable_func().
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Reported-by: default avatarArnd Hannemann <arnd@arndnet.de>
      Tested-by: default avatarArnd Hannemann <arnd@arndnet.de>
      Cc: Stable <stable@kernel.org>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      9f2a0fac
    • Jesper Juhl's avatar
      mac80211: fix failure to check kmalloc return value in key_key_read · 520efd1a
      Jesper Juhl authored
      I noticed two small issues in mac80211/debugfs_key.c::key_key_read while
      reading through the code. Patch below.
      
      The key_key_read() function returns ssize_t and the value that's actually
      returned is the return value of simple_read_from_buffer() which also
      returns ssize_t, so let's hold the return value in a ssize_t local
      variable rather than a int one.
      
      Also, memory is allocated dynamically with kmalloc() which can fail, but
      the return value of kmalloc() is not checked, so we may end up operating
      on a null pointer further on. So check for a NULL return and bail out with
      -ENOMEM in that case.
      Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      520efd1a
    • Paul Fox's avatar
      libertas: Fix sd8686 firmware reload · 731b2034
      Paul Fox authored
      For the SD8686, we cannot rely on the scratch register to read the firmware
      load status, because the same register is used for storing RX packet length.
      Broaden the check to account for this.
      
      The module can now be unloaded/reloaded successfully.
      
      Based on the implementation from libertas_tf.
      Signed-off-by: default avatarDaniel Drake <dsd@laptop.org>
      Acked-by: default avatarDan Williams <dcbw@redhat.com>
      Signed-off-by: default avatarSteve deRosier <steve@cozybit.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      731b2034
    • Mohammed Shafi Shajakhan's avatar
      ath9k: Fix incorrect access of rate flags in RC · 4fc4fbd1
      Mohammed Shafi Shajakhan authored
      The index variable to access the rate flags should be obtained from the
      inner loop counter which corresponds to the rate table structure.This
      fixes the invalid rate selection i.e when the supported basic rate is
      invalid on a particular band and also the following warning message.
      Thanks to Raj for finding this out.
      
      Call Trace:
      
       [<ffffffff8104ee4a>] warn_slowpath_common+0x7a/0xb0
      
       [<ffffffff8104ee95>] warn_slowpath_null+0x15/0x20
      
       [<ffffffffa0583c45>] ath_get_rate+0x595/0x5b0 [ath9k]
      
       [<ffffffff811a0636>] ? cpumask_next_and+0x36/0x50
      
       [<ffffffffa0405186>] rate_control_get_rate+0x86/0x160 [mac80211]
      
       [<ffffffffa040dfac>] invoke_tx_handlers+0x81c/0x12d0 [mac80211]
      
       [<ffffffffa040eae9>] ieee80211_tx+0x89/0x2b0 [mac80211]
      
       [<ffffffff812891bc>] ? pskb_expand_head+0x1cc/0x1f0
      
       [<ffffffffa040edc5>] ieee80211_xmit+0xb5/0x1c0 [mac80211]
      
       [<ffffffffa041026f>] ieee80211_tx_skb+0x4f/0x60 [mac80211]
      
       [<ffffffffa03fe016>] ieee80211_send_nullfunc+0x46/0x60 [mac80211]
      
       [<ffffffffa03f91d7>] ieee80211_offchannel_stop_station+0x107/0x150
      [mac80211]
      
       [<ffffffff812891bc>] ? pskb_expand_head+0x1cc/0x1f0
      
       [<ffffffffa040edc5>] ieee80211_xmit+0xb5/0x1c0 [mac80211]
      
       [<ffffffffa041026f>] ieee80211_tx_skb+0x4f/0x60 [mac80211]
      
       [<ffffffffa03fe016>] ieee80211_send_nullfunc+0x46/0x60 [mac80211]
      
       [<ffffffffa03f91d7>] ieee80211_offchannel_stop_station+0x107/0x150
      [mac80211]
      
       [<ffffffffa03f8896>] ieee80211_scan_work+0x146/0x600 [mac80211]
      
       [<ffffffff8133a375>] ? schedule+0x2f5/0x8e0
      
       [<ffffffffa03f8750>] ? ieee80211_scan_work+0x0/0x600 [mac80211]
      
       [<ffffffff81064fcf>] process_one_work+0x10f/0x380
      
       [<ffffffff81066bc2>] worker_thread+0x162/0x340
      
       [<ffffffff81066a60>] ? worker_thread+0x0/0x340
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarMohammed Shafi Shajakhan <mshajakhan@atheros.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      4fc4fbd1
    • Dongdong Deng's avatar
      kgdb,ppc: Individual register get/set for ppc · ff10b88b
      Dongdong Deng authored
      commit 534af108(kgdb,kdb: individual
      register set and and get API) introduce dbg_get_reg/dbg_set_reg API
      for individual register get and set.
      
      This patch implement those APIs for ppc.
      Signed-off-by: default avatarDongdong Deng <dongdong.deng@windriver.com>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      ff10b88b
    • Dongdong Deng's avatar
      kgdbts: prevent re-entry to kgdbts before it unregisters · 4dacd5c0
      Dongdong Deng authored
      The "kgdb_connected" variable of debug_core just indicates whether or
      not kgdbts is connected to the debug_core.  It does not completely
      prevent a script from trying invoke kgdbts again and possibly crashing
      the system (see Call Trace below).
      
      The configured variable in kgtbts can be used instead of
      kgdb_connected instead of kgdb_connected. The cleanup_kgdbts() can
      also be removed because there is no possible way to build kgdbts as a
      kernel module that you could unload with rmmod.
      
      Call Trace:
      -----------------------------------------------------------------
      root:/$ echo kgdbts=V1S1000 > /sys/module/kgdbts/parameters/kgdbts
      kgdb: Unregistered I/O driver kgdbts, debugger disabled.
      ------------[ cut here ]------------
      WARNING: at kernel/debug/debug_core.c:1002
      kgdb_unregister_io_module+0xec/0x100()
      Hardware name: Moon Creek platform
      Modules linked in:
      Pid: 664, comm: sh Not tainted 2.6.34.1-WR4.0.0.0_standard #58
      Call Trace:
       [<c103b1ed>] warn_slowpath_common+0x6d/0xa0
       [<c1079fdc>] ? kgdb_unregister_io_module+0xec/0x100
       [<c1079fdc>] ? kgdb_unregister_io_module+0xec/0x100
       [<c10544e0>] ? param_attr_store+0x0/0x20
       [<c103b235>] warn_slowpath_null+0x15/0x20
       [<c1079fdc>] kgdb_unregister_io_module+0xec/0x100
       [<c124e4ea>] cleanup_kgdbts+0x1a/0x20
       [<c124eced>] param_set_kgdbts_var+0x6d/0xb0
       [<c124ec80>] ? param_set_kgdbts_var+0x0/0xb0
       [<c10544f7>] param_attr_store+0x17/0x20
       [<c105457c>] module_attr_store+0x2c/0x40
       [<c111fe84>] sysfs_write_file+0x94/0xf0
       [<c10d42f6>] vfs_write+0x96/0x130
       [<c111fdf0>] ? sysfs_write_file+0x0/0xf0
       [<c10d44d6>] sys_write+0x46/0xd0
       [<c13bf329>] system_call_done+0x0/0x4
      ---[ end trace 4eb028c6ee43154c ]---
      kgdb: Unregistered I/O driver kgdbts, debugger disabled.
      -----------------------------------------------------------------
      
      [jason.wessel@windriver.com: remove cleanup_kgdbts() ]
      Signed-off-by: default avatarDongdong Deng <dongdong.deng@windriver.com>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      4dacd5c0
    • Dongdong Deng's avatar
      debug_core,x86,blackfin: Clean up hw debug disable API · d7ba979d
      Dongdong Deng authored
      The kgdb_disable_hw_debug() was an architecture specific function for
      disabling all hardware breakpoints on a per cpu basis when entering
      the debug core.
      
      This patch will remove the weak function kdbg_disable_hw_debug() and
      change it into a call back which lives with the rest of hw breakpoint
      call backs in struct kgdb_arch.
      Signed-off-by: default avatarDongdong Deng <dongdong.deng@windriver.com>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      d7ba979d
    • Jason Wessel's avatar
      kdb: Fix early debugging crash regression · 578bd4df
      Jason Wessel authored
      The kdb_current legally be equal to NULL in the early boot of the x86
      arch.  The problem pcan be observed by booting with the kernel arguments:
      
          earlyprintk=vga ekgdboc=kbd kgdbwait
      
      The kdb shell will oops on entry and recursively fault because it
      cannot get past the final stage of shell initialization.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      578bd4df
    • Rabin Vincent's avatar
      kgdb,arm: fix register dump · 834b2964
      Rabin Vincent authored
      DBG_MAX_REG_NUM incorrectly had the number of indices in the GDB regs
      array rather than the number of registers, leading to an oops when the
      "rd" command is used in KDB.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarRabin Vincent <rabin@rab.in>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      834b2964
    • Jason Wessel's avatar
      kdb: fix per_cpu command to remove supress mask · 931ea248
      Jason Wessel authored
      Rusty pointed out that the per_cpu command uses up lots of space on
      the stack and the cpu supress mask is probably not needed.
      
      This patch removes the need for the supress mask as well as fixing up
      the following problems with the kdb per_cpu command:
        * The per_cpu command should allow an address as an argument
        * When you have more data than can be displayed on one screen allow
          the user to break out of the print loop.
      Reported-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      931ea248
    • Jason Wessel's avatar
      kdb: Add kdb kernel module sample · 4aad8f51
      Jason Wessel authored
      Add an example of how to add a dynamic kdb shell command via a kernel
      module.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      4aad8f51
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus · b77d643c
      Linus Torvalds authored
      * 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus: (46 commits)
        ftrace/MIPS: Enable C Version of recordmcount
        ftrace/MIPS: Add module support for C version of recordmcount
        ftrace/MIPS: Add MIPS64 support for C version of recordmcount
        MIPS: Make TASK_SIZE reflect proper size for both 32 and 64 bit processes.
        MIPS: Allow UserLocal on MIPS_R1 processors
        MIPS: Honor L2 bypass bit
        MIPS: Add BMIPS CP0 register definitions
        MIPS: Add BMIPS processor types to Kconfig
        MIPS: Decouple BMIPS CPU support from bcm47xx/bcm63xx SoC code
        MIPS: Add support for hardware performance events (mipsxx)
        MIPS: Perf-events: Add callchain support
        MIPS: add support for hardware performance events (skeleton)
        MIPS: add support for software performance events
        MIPS: define local_xchg from xchg_local to atomic_long_xchg
        MIPS: AR7: Add support for Titan (TNETV10xx) SoC variant
        MIPS: AR7: Initialize GPIO earlier
        MIPS: Add platform device and Kconfig for Octeon USB EHCI / OHCI
        USB: Add EHCI and OHCH glue for OCTEON II SOCs.
        MIPS: Octeon: Add register definitions for EHCI / OHCI USB glue logic.
        MIPS: Octeon: Apply CN63XXP1 errata workarounds.
        ...
      b77d643c
    • Wu Zhangjin's avatar
      ftrace/MIPS: Enable C Version of recordmcount · 64575f91
      Wu Zhangjin authored
      Selects HAVE_C_RECORDMCOUNT to use the C version of the recordmcount
      intead of the old Perl Version of recordmcount.
      Signed-off-by: default avatarWu Zhangjin <wuzhangjin@gmail.com>
      LKML-Reference: <bb99009a9ac79d3f55a8c8bf1c8bd2bc0e1f160e.1288176026.git.wuzhangjin@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      64575f91
    • Wu Zhangjin's avatar
      ftrace/MIPS: Add module support for C version of recordmcount · 412910cd
      Wu Zhangjin authored
      Since MIPS modules' address space differs from the core kernel space, to access
      the _mcount in the core kernel, the kernel functions in modules must use long
      call (-mlong-calls): load the _mcount address into one register and jump to the
      address stored by the register:
      
       c:  3c030000        lui     v1,0x0  <-------->  b label
                 c: R_MIPS_HI16  _mcount
                 c: R_MIPS_NONE  *ABS*
                 c: R_MIPS_NONE  *ABS*
      10:  64630000        daddiu  v1,v1,0
                10: R_MIPS_LO16 _mcount
                10: R_MIPS_NONE *ABS*
                10: R_MIPS_NONE *ABS*
      14:	03e0082d 	move	at,ra
      18:	0060f809 	jalr	v1
      label:
      
      In the old Perl version of recordmcount, we only need to record the position of
      the 1st R_MIPS_HI16 type of _mcount, and later, in ftrace_make_nop(), replace
      the instruction in this position by a "b label" and in ftrace_make_call(),
      replace it back.
      
      But, the default C version of recordmcount records all of the _mcount symbols,
      so, we must filter the 2nd _mcount like the Perl version of recordmcount does.
      
      The C version of recordmcount copes with the symbols before they are linked, So
      It doesn't know the type of the symbols and therefore can not filter the
      symbols as the Perl version of recordmcount does. But as we can see above, the
      2nd _mcount symbols of the long call alawys follows the 1st _mcount symbol of
      the same long call, which means the offset from the 1st to the 2nd is fixed, it
      is 0x10-0xc = 4 here, 4 is the length of the 1st load instruciton, for MIPS has
      fixed length of instructions, this offset is always 4.
      
      And as we know, the _mcount is inserted into the entry of every kernel
      function, the offset between the other _mcount's is expected to be always
      bigger than 4. So, to filter the 2ns _mcount symbol of the long call, we can
      simply check the offset between two _mcount symbols, If it is 4, then, filter
      the 2nd _mcount symbol.
      
      To avoid touching too much code, an 'empty' function fn_is_fake_mcount() is
      added for all of the archs, and the specific archs can override it via chaning
      the function pointer: is_fake_mcount in do_file() with the e_machine. e.g. This
      patch adds MIPS_is_fake_mcount() to override the default fn_is_fake_mcount()
      pointed by is_fake_mcount.
      
      This fn_is_fake_mcount() checks if the _mcount symbol is fake, e.g. the 2nd
      _mcount symbol of the long call is fake, for there are 2 _mcount symbols mapped
      to one real mcount call, so, one of them is fake and must be filtered.
      
      This fn_is_fake_mcount() is called in sift_rel_mcount() after finding the
      _mcount symbols and before adding the _mcount symbol into mrelp, so, it can
      prevent the fake mcount symbol going into the last __mcount_loc table.
      Signed-off-by: default avatarWu Zhangjin <wuzhangjin@gmail.com>
      LKML-Reference: <b866f0138224340a132d31861fa3f9300dee30ac.1288176026.git.wuzhangjin@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      412910cd
    • John Reiser's avatar
      ftrace/MIPS: Add MIPS64 support for C version of recordmcount · a2d49358
      John Reiser authored
      MIPS64 has 'weird' Elf64_Rel.r_info[1,2], which must be used instead of
      the generic Elf64_Rel.r_info, otherwise, the C version of recordmcount
      will not work for "segmentation fault".
      
      Usage of "union mips_r_info" and the functions MIPS64_r_sym() and
      MIPS64_r_info() written by Maciej W. Rozycki <macro@linux-mips.org>
      
      ----
      [1] http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf
      [2] arch/mips/include/asm/module.h
      Tested-by: default avatarWu Zhangjin <wuzhangjin@gmail.com>
      Signed-off-by: default avatarJohn Reiser <jreiser@BitWagon.com>
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      LKML-Reference: <AANLkTinwXjLAYACUfhLYaocHD_vBbiErLN3NjwN8JqSy@mail.gmail.com>
      LKML-Reference: <910dc2d5ae1ed042df4f96815fe4a433078d1c2a.1288176026.git.wuzhangjin@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      a2d49358
    • David Daney's avatar
      MIPS: Make TASK_SIZE reflect proper size for both 32 and 64 bit processes. · 949e51be
      David Daney authored
      The TASK_SIZE macro should reflect the size of a user process virtual
      address space.  Previously for 64-bit kernels, this was not the case.
      The immediate cause of pain was in
      hugetlbfs/inode.c:hugetlb_get_unmapped_area() where 32-bit processes
      trying to mmap a huge page would be served a page with an address
      outside of the 32-bit address range.  But there are other uses of
      TASK_SIZE in the kernel as well that would like an accurate value.
      
      The new definition is nice because it now makes TASK_SIZE and
      TASK_SIZE_OF() yield the same value for any given process.
      
      For 32-bit kernels there should be no change, although I did factor
      out some code in asm/processor.h that became identical for the 32-bit and
      64-bit cases.
      
      __UA_LIMIT is now set to ~((1 << SEGBITS) - 1) for 64-bit kernels.
      This should eliminate the possibility of getting a
      AddressErrorException in the kernel for addresses that pass the
      access_ok() test.
      
      With the patch applied, I can still run o32, n32 and n64 processes,
      and have an o32 shell fork/exec both n32 and n64 processes.
      Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      To: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/1701/
      949e51be
    • Kevin Cernekee's avatar
      MIPS: Allow UserLocal on MIPS_R1 processors · 18d693b3
      Kevin Cernekee authored
      Some MIPS32R1 processors implement UserLocal (RDHWR $29) to accelerate
      programs that make extensive use of thread-local storage.  Therefore,
      setting up the HWRENA register should not depend on cpu_has_mips_r2.
      Signed-off-by: default avatarKevin Cernekee <cernekee@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      18d693b3
    • Kevin Cernekee's avatar
      MIPS: Honor L2 bypass bit · ea31a6b2
      Kevin Cernekee authored
      On many of the newer MIPS32 cores, CP0 CONFIG2 bit 12 (L2B) indicates
      that the L2 cache is disabled and therefore Linux should not attempt
      to use it.
      
      [Ralf: Moved the code added by Kevin's original patch into a separate
      function that can easily be replaced for platforms that need more a
      different probe.]
      Signed-off-by: default avatarKevin Cernekee <cernekee@gmail.com>
      Cc: linux-mips@linux-mips.org>
      Cc: <linux-kernel@vger.kernel.org>
      Patchwork: https://patchwork.linux-mips.org/patch/1723/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      ea31a6b2
    • Kevin Cernekee's avatar
      MIPS: Add BMIPS CP0 register definitions · af231172
      Kevin Cernekee authored
      Signed-off-by: default avatarKevin Cernekee <cernekee@gmail.com>
      Cc: mbizon@freebox.fr
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Tested-by: default avatarFlorian Fainelli <ffainelli@freebox.fr>
      Patchwork: https://patchwork.linux-mips.org/patch/1708/
      Signed-off-by: Ralf Baechle <ralf@linux-mips.org
      af231172
    • Kevin Cernekee's avatar
      MIPS: Add BMIPS processor types to Kconfig · c1c0c461
      Kevin Cernekee authored
      [v2: add "VIPER" marketing name for BMIPS4350]
      
      Add processor feature definitions for BMIPS3300, BMIPS4350, BMIPS4380,
      and BMIPS5000.
      Signed-off-by: default avatarKevin Cernekee <cernekee@gmail.com>
      Cc: mbizon@freebox.fr
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Tested-by: default avatarFlorian Fainelli <ffainelli@freebox.fr>
      Patchwork: https://patchwork.linux-mips.org/patch/1716/
      Signed-off-by: Ralf Baechle <ralf@linux-mips.org
      c1c0c461
    • Kevin Cernekee's avatar
      MIPS: Decouple BMIPS CPU support from bcm47xx/bcm63xx SoC code · 602977b0
      Kevin Cernekee authored
      BMIPS processor cores are used in 50+ different chipsets spread across
      5+ product lines.  In many cases the chipsets do not share the same
      peripheral register layouts, the same register blocks, the same
      interrupt controllers, the same memory maps, or much of anything else.
      
      But, across radically different SoCs that share nothing more than the
      same BMIPS CPU, a few things are still mostly constant:
      
      SMP operations
      Access to performance counters
      DMA cache coherency quirks
      Cache and memory bus configuration
      
      So, it makes sense to treat each BMIPS processor type as a generic
      "building block," rather than tying it to a specific SoC.  This makes it
      easier to support a large number of BMIPS-based chipsets without
      unnecessary duplication of code, and provides the infrastructure needed
      to support BMIPS-proprietary features.
      Signed-off-by: default avatarKevin Cernekee <cernekee@gmail.com>
      Cc: mbizon@freebox.fr
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Tested-by: default avatarFlorian Fainelli <ffainelli@freebox.fr>
      Patchwork: https://patchwork.linux-mips.org/patch/1706/
      Signed-off-by: Ralf Baechle <ralf@linux-mips.org
      602977b0
    • Deng-Cheng Zhu's avatar
      MIPS: Add support for hardware performance events (mipsxx) · 3a9ab99e
      Deng-Cheng Zhu authored
      This patch adds the mipsxx Perf-events support based on the skeleton.
      Generic hardware events and cache events are now fully implemented for
      the 24K/34K/74K/1004K cores. To support other cores in mipsxx (such as
      R10000/SB1), the generic hardware event tables and cache event tables
      need to be filled out. To support other CPUs which have different PMU
      than mipsxx, such as RM9000 and LOONGSON2, the additional files
      perf_event_$cpu.c need to be created.
      
      Raw event is an important part of Perf-events. It helps the user collect
      performance data for events that are not listed as the generic hardware
      events and cache events but ARE supported by the CPU's PMU.
      
      This patch also adds this feature for mipsxx 24K/34K/74K/1004K. For how to
      use it, please refer to processor core software user's manual and the
      comments for mipsxx_pmu_map_raw_event() for more details.
      
      Please note that this is a "precise" implementation, which means the
      kernel will check whether the requested raw events are supported by this
      CPU and which hardware counters can be assigned for them.
      
      To test the functionality of Perf-event, you may want to compile the tool
      "perf" for your MIPS platform. You can refer to the following URL:
      http://www.linux-mips.org/archives/linux-mips/2010-10/msg00126.html
      
      You also need to customize the CFLAGS and LDFLAGS in tools/perf/Makefile
      for your libs, includes, etc.
      
      In case you encounter the boot failure in SMVP kernel on multi-threading
      CPUs, you may take a look at:
      http://www.linux-mips.org/git?p=linux-mti.git;a=commitdiff;h=5460815027d802697b879644c74f0e8365254020Signed-off-by: default avatarDeng-Cheng Zhu <dengcheng.zhu@gmail.com>
      To: linux-mips@linux-mips.org
      Cc: a.p.zijlstra@chello.nl
      Cc: paulus@samba.org
      Cc: mingo@elte.hu
      Cc: acme@redhat.com
      Cc: jamie.iles@picochip.com
      Cc: ddaney@caviumnetworks.com
      Cc: matt@console-pimps.org
      Patchwork: https://patchwork.linux-mips.org/patch/1689/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
       create mode 100644 arch/mips/kernel/perf_event_mipsxx.c
      3a9ab99e
    • Deng-Cheng Zhu's avatar
      MIPS: Perf-events: Add callchain support · 7e788d96
      Deng-Cheng Zhu authored
      Adds callchain support for MIPS Perf-events. For more info on this feature,
      please refer to tools/perf/Documentation/perf-report.txt and
      tools/perf/design.txt.
      
      Currently userspace callchain data is not recorded, because we do not have
      a safe way to do this.
      Signed-off-by: default avatarDeng-Cheng Zhu <dengcheng.zhu@gmail.com>
      Acked-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      To: linux-mips@linux-mips.org
      Cc: a.p.zijlstra@chello.nl
      Cc: paulus@samba.org
      Cc: mingo@elte.hu
      Cc: acme@redhat.com
      Cc: jamie.iles@picochip.com
      Cc: matt@console-pimps.org
      Patchwork: https://patchwork.linux-mips.org/patch/1690/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      7e788d96
    • Deng-Cheng Zhu's avatar
      MIPS: add support for hardware performance events (skeleton) · 14f70012
      Deng-Cheng Zhu authored
      This patch provides the skeleton of the HW perf event support. To enable
      this feature, we can not choose the SMTC kernel; Oprofile should be
      disabled; kernel performance events be selected. Then we can enable it in
      Kernel type menu.
      
      Oprofile for MIPS platforms initializes irq at arch init time. Currently
      we do not change this logic to allow PMU reservation.
      
      If a platform has EIC, we can use the irq base and perf counter irq offset
      defines for the interrupt controller in specific init_hw_perf_events().
      
      Based on this skeleton patch, the 3 different kinds of MIPS PMU, namely,
      mipsxx/loongson2/rm9000, can be supported by adding corresponding lower
      level C files at the bottom. The suggested names of these files are
      perf_event_mipsxx.c/perf_event_loongson2.c/perf_event_rm9000.c. So, for
      example, we can do this by adding "#include perf_event_mipsxx.c" at the
      bottom of perf_event.c.
      
      In addition, PMUs with 64bit counters are also considered in this patch.
      Signed-off-by: default avatarDeng-Cheng Zhu <dengcheng.zhu@gmail.com>
      To: linux-mips@linux-mips.org
      Cc: a.p.zijlstra@chello.nl
      Cc: paulus@samba.org
      Cc: mingo@elte.hu
      Cc: acme@redhat.com
      Cc: jamie.iles@picochip.com
      Cc: ddaney@caviumnetworks.com
      Cc: matt@console-pimps.org
      Patchwork: https://patchwork.linux-mips.org/patch/1688/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      14f70012
    • Deng-Cheng Zhu's avatar
      MIPS: add support for software performance events · 7f788d2d
      Deng-Cheng Zhu authored
      Software events are required as part of the measurable stuff by the
      Linux performance counter subsystem. Here is the list of events added by
      this patch:
      PERF_COUNT_SW_PAGE_FAULTS
      PERF_COUNT_SW_PAGE_FAULTS_MIN
      PERF_COUNT_SW_PAGE_FAULTS_MAJ
      PERF_COUNT_SW_ALIGNMENT_FAULTS
      PERF_COUNT_SW_EMULATION_FAULTS
      Signed-off-by: default avatarDeng-Cheng Zhu <dengcheng.zhu@gmail.com>
      To: linux-mips@linux-mips.org
      Cc: a.p.zijlstra@chello.nl
      Cc: paulus@samba.org
      Cc: mingo@elte.hu
      Cc: acme@redhat.com
      Cc: jamie.iles@picochip.com
      Acked-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      Reviewed-by: default avatarMatt Fleming <matt@console-pimps.org>
      Patchwork: https://patchwork.linux-mips.org/patch/1686/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      7f788d2d
    • Deng-Cheng Zhu's avatar
      MIPS: define local_xchg from xchg_local to atomic_long_xchg · 6dbd9728
      Deng-Cheng Zhu authored
      Perf-events is now using local_t helper functions internally. There is a
      use of local_xchg(). On MIPS, this is defined to xchg_local() which is
      missing in asm/system.h. This patch re-defines local_xchg() in asm/local.h
      to atomic_long_xchg(). Then Perf-events can pass the build.
      Signed-off-by: default avatarDeng-Cheng Zhu <dengcheng.zhu@gmail.com>
      To: linux-mips@linux-mips.org
      Cc: a.p.zijlstra@chello.nl
      Cc: paulus@samba.org
      Cc: mingo@elte.hu
      Cc: acme@redhat.com
      Cc: jamie.iles@picochip.com
      Cc: ddaney@caviumnetworks.com
      Cc: matt@console-pimps.org
      Patchwork: https://patchwork.linux-mips.org/patch/1687/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      6dbd9728
    • Florian Fainelli's avatar
      MIPS: AR7: Add support for Titan (TNETV10xx) SoC variant · 238dd317
      Florian Fainelli authored
      Add support for Titan TNETV1050,1055,1056,1060 variants. This SoC is almost
      completely identical to AR7 except on a few points:
      - a second bank of gpios is available
      - vlynq0 on titan is vlynq1 on ar7
      - different PHY addresses for cpmac0
      
      This SoC can be found on commercial products like the Linksys WRTP54G
      
      Original patch by Xin with improvments by Florian.
      Signed-off-by: default avatarXin Zhen <xlonestar2000@aim.com>
      Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>
      Patchwork: http://patchwork.linux-mips.org/patch/1563/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      ---
      238dd317
    • Florian Fainelli's avatar
      MIPS: AR7: Initialize GPIO earlier · 3bc6968a
      Florian Fainelli authored
      In order to detect the Titan variant, we must initialize GPIOs earlier since
      detection relies on some GPIO values to be set.
      Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>
      Patchwork: http://patchwork.linux-mips.org/patch/1562/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      ---
      3bc6968a
    • David Daney's avatar
      MIPS: Add platform device and Kconfig for Octeon USB EHCI / OHCI · 340fbb8b
      David Daney authored
      Declare that OCTEON reference boards have both OHCI and EHCI.
      
      Add platform devices for the corresponding hardware.
      Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      To: linux-usb@vger.kernel.org
      To: dbrownell@users.sourceforge.net
      Patchwork: http://patchwork.linux-mips.org/patch/1676/Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      340fbb8b
    • David Daney's avatar
      USB: Add EHCI and OHCH glue for OCTEON II SOCs. · 1643accd
      David Daney authored
      The OCTEON II SOC has USB EHCI and OHCI controllers connected directly
      to the internal I/O bus.  This patch adds the necessary 'glue' logic
      to allow ehci-hcd and ohci-hcd drivers to work on OCTEON II.
      
      The OCTEON normally runs big-endian, and the ehci/ohci internal
      registers have host endianness, so we need to select
      USB_EHCI_BIG_ENDIAN_MMIO.
      
      The ehci and ohci blocks share a common clocking and PHY
      infrastructure.  Initialization of the host controller and PHY clocks
      is common between the two and is factored out into the
      octeon2-common.c file.
      
      Setting of USB_ARCH_HAS_OHCI and USB_ARCH_HAS_EHCI is done in
      arch/mips/Kconfig in a following patch.
      Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      To: linux-usb@vger.kernel.org
      To: dbrownell@users.sourceforge.net
      Patchwork: http://patchwork.linux-mips.org/patch/1675/Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      1643accd
    • David Daney's avatar
      MIPS: Octeon: Add register definitions for EHCI / OHCI USB glue logic. · 4169b863
      David Daney authored
      The EHCI and OHCI blocks connection to the I/O bus is controlled by
      these registers.
      Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      To: linux-usb@vger.kernel.org
      To: dbrownell@users.sourceforge.net
      Patchwork: http://patchwork.linux-mips.org/patch/1674/Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
       create mode 100644 arch/mips/include/asm/octeon/cvmx-uctlx-defs.h
      4169b863