1. 14 9月, 2018 1 次提交
    • A
      ARC: build: Get rid of toolchain check · 615f6445
      Alexey Brodkin 提交于
      This check is very naive: we simply test if GCC invoked without
      "-mcpu=XXX" has ARC700 define set. In that case we think that GCC
      was built with "--with-cpu=arc700" and has libgcc built for ARC700.
      
      Otherwise if ARC700 is not defined we think that everythng was built
      for ARCv2.
      
      But in reality our life is much more interesting.
      
      1. Regardless of GCC configuration (i.e. what we pass in "--with-cpu"
         it may generate code for any ARC core).
      
      2. libgcc might be built with explicitly specified "--mcpu=YYY"
      
      That's exactly what happens in case of multilibbed toolchains:
       - GCC is configured with default settings
       - All the libs built for many different CPU flavors
      
      I.e. that check gets in the way of usage of multilibbed
      toolchains. And even non-multilibbed toolchains are affected.
      OpenEmbedded also builds GCC without "--with-cpu" because
      each and every target component later is compiled with explicitly
      set "-mcpu=ZZZ".
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      615f6445
  2. 11 9月, 2018 1 次提交
    • V
      ARCv2: build: use mcpu=hs38 iso generic mcpu=archs · 00a99339
      Vineet Gupta 提交于
      helps gcc with better instruction selections such as 64-bit multiply MPYD
      
      before
      ------
      82c34b58 <sched_clock>:
      82c34b58:	ld	r2,[0x83068d00]
      82c34b60:	add_s	r2,r2,0x7530
      82c34b66:	mov_s	r0,0x989680
      82c34b6c:	mpymu	r5,r2,r0
      82c34b70:	mpy	r4,r2,r0
      82c34b74:	mov_s	r0,r4
      82c34b76:	j_s.d	[blink]
      82c34b78:	mov_s	r1,r5
      82c34b7a:	nop_s
      
      after
      ------
      82c34b7c <sched_clock>:
      82c34b7c:	ld	r0,[0x83064d00]
      82c34b84:	add_s	r0,r0,0x7530
      82c34b8a:	mpydu	r0,r0,0x989680
      82c34b92:	j_s	[blink]
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      00a99339
  3. 05 9月, 2018 3 次提交
  4. 01 9月, 2018 2 次提交
  5. 31 8月, 2018 1 次提交
  6. 28 8月, 2018 5 次提交
  7. 24 8月, 2018 1 次提交
  8. 18 8月, 2018 1 次提交
    • S
      mm: convert return type of handle_mm_fault() caller to vm_fault_t · 50a7ca3c
      Souptick Joarder 提交于
      Use new return type vm_fault_t for fault handler.  For now, this is just
      documenting that the function returns a VM_FAULT value rather than an
      errno.  Once all instances are converted, vm_fault_t will become a
      distinct type.
      
      Ref-> commit 1c8f4220 ("mm: change return type to vm_fault_t")
      
      In this patch all the caller of handle_mm_fault() are changed to return
      vm_fault_t type.
      
      Link: http://lkml.kernel.org/r/20180617084810.GA6730@jordon-HP-15-Notebook-PCSigned-off-by: NSouptick Joarder <jrdr.linux@gmail.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: James E.J. Bottomley <jejb@parisc-linux.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      50a7ca3c
  9. 02 8月, 2018 3 次提交
  10. 31 7月, 2018 6 次提交
    • R
      arc: fix type warnings in arc/mm/cache.c · ec837d62
      Randy Dunlap 提交于
      Fix type warnings in arch/arc/mm/cache.c.
      
      ../arch/arc/mm/cache.c: In function 'flush_anon_page':
      ../arch/arc/mm/cache.c:1062:55: warning: passing argument 2 of '__flush_dcache_page' makes integer from pointer without a cast [-Wint-conversion]
        __flush_dcache_page((phys_addr_t)page_address(page), page_address(page));
                                                             ^~~~~~~~~~~~~~~~~~
      ../arch/arc/mm/cache.c:1013:59: note: expected 'long unsigned int' but argument is of type 'void *'
       void __flush_dcache_page(phys_addr_t paddr, unsigned long vaddr)
                                                   ~~~~~~~~~~~~~~^~~~~
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: linux-snps-arc@lists.infradead.org
      Cc: Elad Kanfi <eladkan@mellanox.com>
      Cc: Leon Romanovsky <leonro@mellanox.com>
      Cc: Ofer Levi <oferle@mellanox.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      ec837d62
    • R
      arc: fix build errors in arc/include/asm/delay.h · 2423665e
      Randy Dunlap 提交于
      Fix build errors in arch/arc/'s delay.h:
      - add "extern unsigned long loops_per_jiffy;"
      - add <asm-generic/types.h> for "u64"
      
      In file included from ../drivers/infiniband/hw/cxgb3/cxio_hal.c:32:
      ../arch/arc/include/asm/delay.h: In function '__udelay':
      ../arch/arc/include/asm/delay.h:61:12: error: 'u64' undeclared (first use in this function)
        loops = ((u64) usecs * 4295 * HZ * loops_per_jiffy) >> 32;
                  ^~~
      
      In file included from ../drivers/infiniband/hw/cxgb3/cxio_hal.c:32:
      ../arch/arc/include/asm/delay.h: In function '__udelay':
      ../arch/arc/include/asm/delay.h:63:37: error: 'loops_per_jiffy' undeclared (first use in this function)
        loops = ((u64) usecs * 4295 * HZ * loops_per_jiffy) >> 32;
                                           ^~~~~~~~~~~~~~~
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: linux-snps-arc@lists.infradead.org
      Cc: Elad Kanfi <eladkan@mellanox.com>
      Cc: Leon Romanovsky <leonro@mellanox.com>
      Cc: Ofer Levi <oferle@mellanox.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      2423665e
    • R
      arc: [plat-eznps] fix printk warning in arc/plat-eznps/mtm.c · 9e2ea405
      Randy Dunlap 提交于
      Fix printk format warning in arch/arc/plat-eznps/mtm.c:
      
      In file included from ../include/linux/printk.h:7,
                       from ../include/linux/kernel.h:14,
                       from ../include/linux/list.h:9,
                       from ../include/linux/smp.h:12,
                       from ../arch/arc/plat-eznps/mtm.c:17:
      ../arch/arc/plat-eznps/mtm.c: In function 'set_mtm_hs_ctr':
      ../include/linux/kern_levels.h:5:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long int' [-Wformat=]
       #define KERN_SOH "\001"  /* ASCII Start Of Header */
                        ^~~~~~
      ../include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
       #define KERN_ERR KERN_SOH "3" /* error conditions */
                        ^~~~~~~~
      ../include/linux/printk.h:308:9: note: in expansion of macro 'KERN_ERR'
        printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
               ^~~~~~~~
      ../arch/arc/plat-eznps/mtm.c:166:3: note: in expansion of macro 'pr_err'
         pr_err("** Invalid @nps_mtm_hs_ctr [%d] needs to be [%d:%d] (incl)\n",
         ^~~~~~
      ../arch/arc/plat-eznps/mtm.c:166:40: note: format string is defined here
         pr_err("** Invalid @nps_mtm_hs_ctr [%d] needs to be [%d:%d] (incl)\n",
                                             ~^
                                             %ld
      The hs_ctr variable can just be int instead of long, so also change
      kstrtol() to kstrtoint() and leave the format string as %d.
      
      Also add 2 header files since they are used in mtm.c and we prefer
      not to depend on accidental/indirect #includes.
      
      Cc: linux-snps-arc@lists.infradead.org
      Cc: Ofer Levi <oferle@mellanox.com>
      Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      9e2ea405
    • R
      arc: [plat-eznps] fix data type errors in platform headers · b1f32ce1
      Randy Dunlap 提交于
      Add <linux/types.h> to fix build errors.
      Both ctop.h and <soc/nps/common.h> use u32 types and cause many
      errors.
      
      Examples:
      ../include/soc/nps/common.h:71:4: error: unknown type name 'u32'
          u32 __reserved:20, cluster:4, core:4, thread:4;
      ../include/soc/nps/common.h:76:3: error: unknown type name 'u32'
         u32 value;
      ../include/soc/nps/common.h:124:4: error: unknown type name 'u32'
          u32 base:8, cl_x:4, cl_y:4,
      ../include/soc/nps/common.h:127:3: error: unknown type name 'u32'
         u32 value;
      
      ../arch/arc/plat-eznps/include/plat/ctop.h:83:4: error: unknown type name 'u32'
          u32 gen:1, gdis:1, clk_gate_dis:1, asb:1,
      ../arch/arc/plat-eznps/include/plat/ctop.h:86:3: error: unknown type name 'u32'
         u32 value;
      ../arch/arc/plat-eznps/include/plat/ctop.h:93:4: error: unknown type name 'u32'
          u32 csa:22, dmsid:6, __reserved:3, cs:1;
      ../arch/arc/plat-eznps/include/plat/ctop.h:95:3: error: unknown type name 'u32'
         u32 value;
      
      Cc: linux-snps-arc@lists.infradead.org
      Cc: Ofer Levi <oferle@mellanox.com>
      Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      b1f32ce1
    • O
      ARC: [plat-eznps] Add missing struct nps_host_reg_aux_dpc · 05b466bf
      Ofer Levi 提交于
      Fixing compilation issue caused by missing struct nps_host_reg_aux_dpc
      definition.
      
      Fixes: 3f9cd874 ("ARC: [plat-eznps] avoid toggling of DPC register")
      Reported-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NOfer Levi <oferle@mellanox.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      05b466bf
    • E
      ARC: add SMP_CACHE_BYTES value validate · 386177da
      Eugeniy Paltsev 提交于
      Check that SMP_CACHE_BYTES (and hence ARCH_DMA_MINALIGN) is larger
      or equal to any cache line length by comparing it with values
      previously read from ARC cache BCR registers.
      Signed-off-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      386177da
  11. 28 7月, 2018 2 次提交
    • E
      ARC: dma [non-IOC] setup SMP_CACHE_BYTES and cache_line_size · eb277739
      Eugeniy Paltsev 提交于
      As for today we don't setup SMP_CACHE_BYTES and cache_line_size for
      ARC, so they are set to L1_CACHE_BYTES by default. L1 line length
      (L1_CACHE_BYTES) might be easily smaller than L2 line (which is
      usually the case BTW). This breaks code.
      
      For example this breaks ethernet infrastructure on HSDK/AXS103 boards
      with IOC disabled, involving manual cache flushes
      Functions which alloc and manage sk_buff packet data area rely on
      SMP_CACHE_BYTES define. In the result we can share last L2 cache
      line in sk_buff linear packet data area between DMA buffer and
      some useful data in other structure. So we can lose this data when
      we invalidate DMA buffer.
      
         sk_buff linear packet data area
                      |
                      |
                      |         skb->end        skb->tail
                      V            |                |
                                   V                V
      ----------------------------------------------.
            packet data            | <tail padding> |  <useful data in other struct>
      ----------------------------------------------.
      
      ---------------------.--------------------------------------------------.
           SLC line        |             SLC (L2 cache) line (128B)           |
      ---------------------.--------------------------------------------------.
              ^                                     ^
              |                                     |
           These cache lines will be invalidated when we invalidate skb
           linear packet data area before DMA transaction starting.
      
      This leads to issues painful to debug as it reproduces only if
      (sk_buff->end - sk_buff->tail) < SLC_LINE_SIZE and
      if we have some useful data right after sk_buff->end.
      
      Fix that by hardcode SMP_CACHE_BYTES to max line length we may have.
      Signed-off-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      eb277739
    • E
      ARC: dma [non IOC]: fix arc_dma_sync_single_for_(device|cpu) · 4c612add
      Eugeniy Paltsev 提交于
      ARC backend for dma_sync_single_for_(device|cpu) was broken as it was
      not honoring the @dir argument and simply forcing it based on the call:
       - arc_dma_sync_single_for_device(dir) assumed DMA_TO_DEVICE (cache wback)
       - arc_dma_sync_single_for_cpu(dir) assumed DMA_FROM_DEVICE (cache inv)
      
      This is not true given the DMA API programming model and has been
      discussed here [1] in some detail.
      
      Interestingly while the deficiency has been there forever, it only started
      showing up after 4.17 dma common ops rework, commit a8eb92d0
      ("arc: fix arc_dma_{map,unmap}_page") which wired up these calls under the
      more commonly used dma_map_page API triggering the issue.
      
      [1]: https://lkml.org/lkml/2018/5/18/979
      Fixes: commit a8eb92d0 ("arc: fix arc_dma_{map,unmap}_page")
      Cc: stable@kernel.org # v4.17+
      Signed-off-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      [vgupta: reworked changelog]
      4c612add
  12. 20 7月, 2018 1 次提交
  13. 12 7月, 2018 1 次提交
    • V
      ARC: mm: allow mprotect to make stack mappings executable · 93312b6d
      Vineet Gupta 提交于
      mprotect(EXEC) was failing for stack mappings as default vm flags was
      missing MAYEXEC.
      
      This was triggered by glibc test suite nptl/tst-execstack testcase
      
      What is surprising is that despite running LTP for years on, we didn't
      catch this issue as it lacks a directed test case.
      
      gcc dejagnu tests with nested functions also requiring exec stack work
      fine though because they rely on the GNU_STACK segment spit out by
      compiler and handled in kernel elf loader.
      
      This glibc case is different as the stack is non exec to begin with and
      a dlopen of shared lib with GNU_STACK segment triggers the exec stack
      proceedings using a mprotect(PROT_EXEC) which was broken.
      
      CC: stable@vger.kernel.org
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      93312b6d
  14. 10 7月, 2018 6 次提交
    • A
      ARC: Fix CONFIG_SWAP · 6e376114
      Alexey Brodkin 提交于
      swap was broken on ARC due to silly copy-paste issue.
      
      We encode offset from swapcache page in __swp_entry() as (off << 13) but
      were not decoding back in __swp_offset() as (off >> 13) - it was still
      (off << 13).
      
      This finally fixes swap usage on ARC.
      
      | # mkswap /dev/sda2
      |
      | # swapon -a -e /dev/sda2
      | Adding 500728k swap on /dev/sda2.  Priority:-2 extents:1 across:500728k
      |
      | # free
      |              total       used       free     shared    buffers     cached
      | Mem:        765104      13456     751648       4736          8       4736
      | -/+ buffers/cache:       8712     756392
      | Swap:       500728          0     500728
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      6e376114
    • V
      ARC: [arcompact] entry.S: minor code movement · ca1147fc
      Vineet Gupta 提交于
      This is a non functional code changw, which moves r25 restore from macro
      into the caller of macro
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      ca1147fc
    • A
      ARC: configs: Remove CONFIG_INITRAMFS_SOURCE from defconfigs · 64234961
      Alexey Brodkin 提交于
      We used to have pre-set CONFIG_INITRAMFS_SOURCE with local path
      to intramfs in ARC defconfigs. This was quite convenient for
      in-house development but not that convenient for newcomers
      who obviusly don't have folders like "arc_initramfs" next to
      the Linux source tree. Which leads to quite surprising failure
      of defconfig building:
      ------------------------------->8-----------------------------
        ../scripts/gen_initramfs_list.sh: Cannot open '../../arc_initramfs_hs/'
      ../usr/Makefile:57: recipe for target 'usr/initramfs_data.cpio.gz' failed
      make[2]: *** [usr/initramfs_data.cpio.gz] Error 1
      ------------------------------->8-----------------------------
      
      So now when more and more people start to deal with our defconfigs
      let's make their life easier with removal of CONFIG_INITRAMFS_SOURCE.
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      64234961
    • A
      ARC: configs: remove no longer needed CONFIG_DEVPTS_MULTIPLE_INSTANCES · 29c2068f
      Anders Roxell 提交于
      Since commit eedf265a ("devpts: Make each mount of devpts an
      independent filesystem.") CONFIG_DEVPTS_MULTIPLE_INSTANCES isn't needed
      in the defconfig anymore.
      Signed-off-by: NAnders Roxell <anders.roxell@linaro.org>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      29c2068f
    • P
      ARC: Improve cmpxchg syscall implementation · e8708786
      Peter Zijlstra 提交于
      This is used in configs lacking hardware atomics to emulate atomic r-m-w
      for user space, implemented by disabling preemption in kernel.
      
      However there are issues in current implementation:
      
      1. Process not terminated if invalid user pointer passed:
         i.e. __get_user() failed.
      
      2. The reason for this patch was __put_user() failure not being handled
         either, specifically for the COW break scenario.
         The zero page is initially wired up and read from __get_user()
         succeeds. A subsequent write by __put_user() induces a
         Protection Violation, but COW can't finish as Linux page fault
         handler is disabled due to preempt disable.
         And what's worse is we silently return the stale value to user space.
         Fix this specific case by re-enabling preemption and explicitly
         fixing up the fault and retrying the whole sequence over.
      
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: linux-arch@vger.kernel.org
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      [vgupta: rewrote the changelog]
      e8708786
    • G
      ARC: [plat-hsdk]: Configure APB GPIO controller on ARC HSDK platform · ec58ba16
      Gustavo Pimentel 提交于
      In case of HSDK we have intermediate INTC in for of DW APB GPIO controller
      which is used as a de-bounce logic for interrupt wires that come from
      outside the board.
      
      We cannot use existing "irq-dw-apb-ictl" driver here because all input
      lines are routed to corresponding output lines but not muxed into one
      line (this is configured in RTL and we cannot change this in software).
      
      But even if we add such a feature to "irq-dw-apb-ictl" driver that won't
      benefit us as higher-level INTC (in case of HSDK it is IDU) anyways has
      per-input control so adding fully-controller intermediate INTC will only
      bring some overhead on interrupt processing but no other benefits.
      
      Thus we just do one-time configuration of DW APB GPIO controller and
      forget about it.
      
      Based on implementation available on arch/arc/plat-axs10x/axs10x.c file.
      Acked-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NGustavo Pimentel <gustavo.pimentel@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      ec58ba16
  15. 22 6月, 2018 1 次提交
  16. 21 6月, 2018 5 次提交