1. 24 3月, 2015 1 次提交
    • D
      sparc64: Fix several bugs in memmove(). · 2077cef4
      David S. Miller 提交于
      Firstly, handle zero length calls properly.  Believe it or not there
      are a few of these happening during early boot.
      
      Next, we can't just drop to a memcpy() call in the forward copy case
      where dst <= src.  The reason is that the cache initializing stores
      used in the Niagara memcpy() implementations can end up clearing out
      cache lines before we've sourced their original contents completely.
      
      For example, considering NG4memcpy, the main unrolled loop begins like
      this:
      
           load   src + 0x00
           load   src + 0x08
           load   src + 0x10
           load   src + 0x18
           load   src + 0x20
           store  dst + 0x00
      
      Assume dst is 64 byte aligned and let's say that dst is src - 8 for
      this memcpy() call.  That store at the end there is the one to the
      first line in the cache line, thus clearing the whole line, which thus
      clobbers "src + 0x28" before it even gets loaded.
      
      To avoid this, just fall through to a simple copy only mildly
      optimized for the case where src and dst are 8 byte aligned and the
      length is a multiple of 8 as well.  We could get fancy and call
      GENmemcpy() but this is good enough for how this thing is actually
      used.
      Reported-by: NDavid Ahern <david.ahern@oracle.com>
      Reported-by: NBob Picco <bpicco@meloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2077cef4
  2. 20 3月, 2015 13 次提交
    • D
      sparc: Touch NMI watchdog when walking cpus and calling printk · 31aaa98c
      David Ahern 提交于
      With the increase in number of CPUs calls to functions that dump
      output to console (e.g., arch_trigger_all_cpu_backtrace) can take
      a long time to complete. If IRQs are disabled eventually the NMI
      watchdog kicks in and creates more havoc. Avoid by telling the NMI
      watchdog everything is ok.
      Signed-off-by: NDavid Ahern <david.ahern@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      31aaa98c
    • D
      sparc: perf: Add support M7 processor · b5aff55d
      David Ahern 提交于
      The M7 processor has a different hypervisor group id and different PCR fast
      trap values. PIC read/write functions and PCR bit fields are the same as
      the T4 so those are reused.
      Signed-off-by: NDavid Ahern <david.ahern@oracle.com>
      Acked-by: NBob Picco <bob.picco@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b5aff55d
    • D
      sparc: perf: Make counting mode actually work · d51291cb
      David Ahern 提交于
      Currently perf-stat (aka, counting mode) does not work:
      
      $ perf stat ls
      ...
       Performance counter stats for 'ls':
      
                1.585665      task-clock (msec)         #    0.580 CPUs utilized
                      24      context-switches          #    0.015 M/sec
                       0      cpu-migrations            #    0.000 K/sec
                      86      page-faults               #    0.054 M/sec
         <not supported>      cycles
         <not supported>      stalled-cycles-frontend
         <not supported>      stalled-cycles-backend
         <not supported>      instructions
         <not supported>      branches
         <not supported>      branch-misses
      
             0.002735100 seconds time elapsed
      
      The reason is that state is never reset (stays with PERF_HES_UPTODATE set).
      Add a call to sparc_pmu_enable_event during the added_event handling.
      Clean up the encoding since pmu_start calls sparc_pmu_enable_event which
      does the same. Passing PERF_EF_RELOAD to sparc_pmu_start means the call
      to sparc_perf_event_set_period can be removed as well.
      
      With this patch:
      
      $ perf stat ls
      ...
       Performance counter stats for 'ls':
      
                1.552890      task-clock (msec)         #    0.552 CPUs utilized
                      24      context-switches          #    0.015 M/sec
                       0      cpu-migrations            #    0.000 K/sec
                      86      page-faults               #    0.055 M/sec
               5,748,997      cycles                    #    3.702 GHz
         <not supported>      stalled-cycles-frontend:HG
         <not supported>      stalled-cycles-backend:HG
               1,684,362      instructions:HG           #    0.29  insns per cycle
                 295,133      branches:HG               #  190.054 M/sec
                  28,007      branch-misses:HG          #    9.49% of all branches
      
             0.002815665 seconds time elapsed
      Signed-off-by: NDavid Ahern <david.ahern@oracle.com>
      Acked-by: NBob Picco <bob.picco@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d51291cb
    • D
      sparc: perf: Remove redundant perf_pmu_{en|dis}able calls · 5b0d4b55
      David Ahern 提交于
      perf_pmu_disable is called by core perf code before pmu->del and the
      enable function is called by core perf code afterwards. No need to
      call again within sparc_pmu_del.
      
      Ditto for pmu->add and sparc_pmu_add.
      Signed-off-by: NDavid Ahern <david.ahern@oracle.com>
      Acked-by: NBob Picco <bob.picco@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5b0d4b55
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · b314acac
      Linus Torvalds 提交于
      Pull input updates from Dmitry Torokhov:
       "An update to Synaptics driver that makes it usable with the 2015
        lineup from Lenovo"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Revert "Input: synaptics - use dmax in input_mt_assign_slots"
        Input: synaptics - remove X250 from the topbuttonpad list
        Input: synaptics - remove X1 Carbon 3rd gen from the topbuttonpad list
        Input: synaptics - re-route tracksticks buttons on the Lenovo 2015 series
        Input: synaptics - remove TOPBUTTONPAD property for Lenovos 2015
        Input: synaptics - retrieve the extended capabilities in query $10
        Input: synaptics - do not retrieve the board id on old firmwares
        Input: synaptics - handle spurious release of trackstick buttons
        Input: synaptics - fix middle button on Lenovo 2015 products
        Input: synaptics - skip quirks when post-2013 dimensions
        Input: synaptics - support min/max board id in min_max_pnpid_table
        Input: synaptics - remove obsolete min/max quirk for X240
        Input: synaptics - query min dimensions for fw v8.1
        Input: synaptics - log queried and quirked dimension values
        Input: synaptics - split synaptics_resolution(), query first
      b314acac
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse · 1e744c93
      Linus Torvalds 提交于
      Pull fuse fixes from Miklos Szeredi:
       "This fixes bugs in zero-copy splice to the fuse device"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
        fuse: explicitly set /dev/fuse file's private_data
        fuse: set stolen page uptodate
        fuse: notify: don't move pages
      1e744c93
    • L
      Merge branch 'overlayfs-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs · e409ac35
      Linus Torvalds 提交于
      Pull overlayfs fixes from Miklos Szeredi:
       "This fixes minor issues with the multi-layer update in v4.0"
      
      * 'overlayfs-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
        ovl: upper fs should not be R/O
        ovl: check lowerdir amount for non-upper mount
        ovl: print error message for invalid mount options
      e409ac35
    • L
      Merge tag 'mmc-v4.0-rc4' of git://git.linaro.org/people/ulf.hansson/mmc · 32dafb94
      Linus Torvalds 提交于
      Pull MMC fix from Ulf Hansson:
       "MMC core: fix error path in mmc_pwrseq_simple_alloc()"
      
      * tag 'mmc-v4.0-rc4' of git://git.linaro.org/people/ulf.hansson/mmc:
        mmc: pwrseq_simple: fix error path in mmc_pwrseq_simple_alloc
      32dafb94
    • L
      Merge tag 'pinctrl-v4.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 01d62ee5
      Linus Torvalds 提交于
      Pull pin control fixes from Linus Walleij:
       "Here is a slew of pin control fixes I've accumulated for the v4.0
        kernel.  Nothing special, just driver fixes (mainly embedded Intel it
        seems) and a misunderstanding regarding the stub functions was
        reverted:
      
         - Fix up consumer return values on pin control stubs.
         - Four patches fixing up the interrupt handling and sleep context
           save in the Baytrail driver.
         - Make default output directions work properly in the Cherryview
           driver.
         - Fix interrupt locking in the AT91 driver.
         - Fix setting interrupt generating lines as input in the sunxi
           driver"
      
      * tag 'pinctrl-v4.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: sun4i: GPIOs configured as irq must be set to input before reading
        pinctrl: at91: move lock/unlock_as_irq calls into request/release
        pinctrl: update direction_output function of cherryview driver
        pinctrl: baytrail: Save pin context over system sleep
        pinctrl: baytrail: Rework interrupt handling
        pinctrl: baytrail: Clear interrupt triggering from pins that are in GPIO mode
        pinctrl: baytrail: Relax GPIO request rules
        Revert "pinctrl: consumer: use correct retval for placeholder functions"
      01d62ee5
    • L
      Merge tag 'nios2-fixes-v4.0-rc5' of git://git.rocketboards.org/linux-socfpga-next · 18eda522
      Linus Torvalds 提交于
      Pull two arch/nios2 fixes from Ley Foon Tan:
       - Remove ucontext.h from exported arch headers
       - nios2: mm: do not invoke OOM killer on kernel fault OOM
      
      * tag 'nios2-fixes-v4.0-rc5' of git://git.rocketboards.org/linux-socfpga-next:
        nios2: mm: do not invoke OOM killer on kernel fault OOM
        nios2: Remove ucontext.h from exported arch headers
      18eda522
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide · a93fc153
      Linus Torvalds 提交于
      Pull IDE fix from David Miller:
       "Just one fix to convert a by-hand conversion of jiffies to msecs, from
        Nicholas McGuire"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide:
        ide_tape: convert jiffies with jiffies_to_msecs
      a93fc153
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · 22283c82
      Linus Torvalds 提交于
      Pull sparc fixes from David Miller:
      
       1) Some command cases of semtimedop() not even handled due to miscoded
          comparison on sparc64.  From Rob Gardner.
      
       2) Due to two bugs, /proc/kcore wan't working properly on sparc.
      
       3) Make sure fatal traps stop all running cpus, from Dave Kleikamp.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc: Fix /proc/kcore
        sparc: semtimedop() unreachable due to comparison error
        sparc: io_64.h: Replace io function-link macros
        sparc64: fatal trap should stop all cpus
        arch: sparc: kernel: starfire.c: Remove unused function
        arch: sparc: kernel: traps_64.c: Remove some unused functions
      22283c82
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 47226fe1
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Fix packet header offset calculation in _decode_session6(), from
          Hajime Tazaki.
      
       2) Fix route leak in error paths of xfrm_lookup(), from Huaibin Wang.
      
       3) Be sure to clear state properly when scans fail in iwlwifi mvm code,
          from Luciano Coelho.
      
       4) iwlwifi tries to stop scans that aren't actually running, also from
          Luciano Coelho.
      
       5) mac80211 should drop mesh frames that are not encrypted, fix from
          Bob Copeland.
      
       6) Add new device ID to b43 wireless driver for BCM432228 chips, from
          Rafał Miłecki.
      
       7) Fix accidental addition of members after variable sized array in
          struct tc_u_hnode, from WANG Cong.
      
       8) Don't re-enable interrupts until after we call napi_complete() in
          ibmveth and WIZnet drivers, frm Yongbae Park.
      
       9) Fix regression in vlan tag handling of fec driver, from Fugang Duan.
      
      10) If a network namespace change fails during rtnl_newlink(), we don't
          unwind the device registry properly.
      
      11) Fix two TCP regressions, from Neal Cardwell:
        - Don't allow snd_cwnd_cnt to accumulate huge values due to missing
          test in tcp_cong_avoid_ai().
        - Restore CUBIC back to advancing cwnd by 1.5x packets per RTT.
      
      12) Fix performance regression in xne-netback involving push TX
          notifications, from David Vrabel.
      
      13) __skb_tstamp_tx() can be called with a NULL sk pointer, do not
          dereference blindly.  From Willem de Bruijn.
      
      14) Fix potential stack overflow in RDS protocol stack, from Arnd
          Bergmann.
      
      15) VXLAN_VID_MASK used incorrectly in new remote checksum offload
          support of VXLAN driver.  Fix from Alexey Kodanev.
      
      16) Fix too small netlink SKB allocation in inet_diag layer, from Eric
          Dumazet.
      
      17) ieee80211_check_combinations() does not count interfaces correctly,
          from Andrei Otcheretianski.
      
      18) Hardware feature determination in bxn2x driver references a piece of
          software state that actually isn't initialized yet, fix from Michal
          Schmidt.
      
      19) inet_csk_wait_for_connect() needs a sched_annotate_sleep()
          annoation, from Eric Dumazet.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (56 commits)
        Revert "net: cx82310_eth: use common match macro"
        net/mlx4_en: Set statistics bitmap at port init
        IB/mlx4: Saturate RoCE port PMA counters in case of overflow
        net/mlx4_en: Fix off-by-one in ethtool statistics display
        IB/mlx4: Verify net device validity on port change event
        act_bpf: allow non-default TC_ACT opcodes as BPF exec outcome
        Revert "smc91x: retrieve IRQ and trigger flags in a modern way"
        inet: Clean up inet_csk_wait_for_connect() vs. might_sleep()
        ip6_tunnel: fix error code when tunnel exists
        netdevice.h: fix ndo_bridge_* comments
        bnx2x: fix encapsulation features on 57710/57711
        mac80211: ignore CSA to same channel
        nl80211: ignore HT/VHT capabilities without QoS/WMM
        mac80211: ask for ECSA IE to be considered for beacon parse CRC
        mac80211: count interfaces correctly for combination checks
        isdn: icn: use strlcpy() when parsing setup options
        rxrpc: bogus MSG_PEEK test in rxrpc_recvmsg()
        caif: fix MSG_OOB test in caif_seqpkt_recvmsg()
        bridge: reset bridge mtu after deleting an interface
        can: kvaser_usb: Fix tx queue start/stop race conditions
        ...
      47226fe1
  3. 19 3月, 2015 14 次提交
  4. 18 3月, 2015 12 次提交
    • H
      pinctrl: sun4i: GPIOs configured as irq must be set to input before reading · ef6d24cc
      Hans de Goede 提交于
      On sun4i-a10, when GPIOs are configured as external interrupt the value for
      them in the data register does not seem to get updated, so set their mux to
      input (and restore afterwards) when reading the pin.
      
      Missed edges seem to be buffered, so this does not introduce a race
      condition.
      
      I've also tested this on sun5i-a13 and sun7i-a20 and those do not seem to
      be affected, the input value representation in the data register does seem
      to correctly get updated to the actual pin value while in irq mode there.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ef6d24cc
    • H
      ovl: upper fs should not be R/O · 71cbad7e
      hujianyang 提交于
      After importing multi-lower layer support, users could mount a r/o
      partition as the left most lowerdir instead of using it as upperdir.
      And a r/o upperdir may cause an error like
      
      	overlayfs: failed to create directory ./workdir/work
      
      during mount.
      
      This patch check the *s_flags* of upper fs and return an error if
      it is a r/o partition. The checking of *upper_mnt->mnt_sb->s_flags*
      can be removed now.
      
      This patch also remove
      
      	/* FIXME: workdir is not needed for a R/O mount */
      
      from ovl_fill_super() because:
      
      1) for upper fs r/o case
      Setting a r/o partition as upper is prevented, no need to care about
      workdir in this case.
      
      2) for "mount overlay -o ro" with a r/w upper fs case
      Users could remount overlayfs to r/w in this case, so workdir should
      not be omitted.
      Signed-off-by: Nhujianyang <hujianyang@huawei.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      71cbad7e
    • H
      ovl: check lowerdir amount for non-upper mount · 6be4506e
      hujianyang 提交于
      Recently multi-lower layer mount support allow upperdir and workdir
      to be omitted, then cause overlayfs can be mount with only one
      lowerdir directory. This action make no sense and have potential risk.
      
      This patch check the total number of lower directories to prevent
      mounting overlayfs with only one directory.
      
      Also, an error message is added to indicate lower directories exceed
      OVL_MAX_STACK limit.
      Signed-off-by: Nhujianyang <hujianyang@huawei.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      6be4506e
    • H
      ovl: print error message for invalid mount options · bead55ef
      hujianyang 提交于
      Overlayfs should print an error message if an incorrect mount option
      is caught like other filesystems.
      
      After this patch, improper option input could be clearly known.
      Reported-by: NFabian Sturm <fabian.sturm@aduu.de>
      Signed-off-by: Nhujianyang <hujianyang@huawei.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      bead55ef
    • D
      act_bpf: allow non-default TC_ACT opcodes as BPF exec outcome · ced585c8
      Daniel Borkmann 提交于
      Revisiting commit d23b8ad8 ("tc: add BPF based action") with regards
      to eBPF support, I was thinking that it might be better to improve
      return semantics from a BPF program invoked through BPF_PROG_RUN().
      
      Currently, in case filter_res is 0, we overwrite the default action
      opcode with TC_ACT_SHOT. A default action opcode configured through tc's
      m_bpf can be: TC_ACT_RECLASSIFY, TC_ACT_PIPE, TC_ACT_SHOT, TC_ACT_UNSPEC,
      TC_ACT_OK.
      
      In cls_bpf, we have the possibility to overwrite the default class
      associated with the classifier in case filter_res is _not_ 0xffffffff
      (-1).
      
      That allows us to fold multiple [e]BPF programs into a single one, where
      they would otherwise need to be defined as a separate classifier with
      its own classid, needlessly redoing parsing work, etc.
      
      Similarly, we could do better in act_bpf: Since above TC_ACT* opcodes
      are exported to UAPI anyway, we reuse them for return-code-to-tc-opcode
      mapping, where we would allow above possibilities. Thus, like in cls_bpf,
      a filter_res of 0xffffffff (-1) means that the configured _default_ action
      is used. Any unkown return code from the BPF program would fail in
      tcf_bpf() with TC_ACT_UNSPEC.
      
      Should we one day want to make use of TC_ACT_STOLEN or TC_ACT_QUEUED,
      which both have the same semantics, we have the option to either use
      that as a default action (filter_res of 0xffffffff) or non-default BPF
      return code.
      
      All that will allow us to transparently use tcf_bpf() for both BPF
      flavours.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Acked-by: NJiri Pirko <jiri@resnulli.us>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ced585c8
    • B
      pinctrl: at91: move lock/unlock_as_irq calls into request/release · bd873373
      Boris Brezillon 提交于
      The gpiochip_lock_as_irq call can fail and return an error,
      while the irq_startup is not expected to fail (returns an
      unsigned int which is not checked by irq core code).
      
      irq_request/release_resources functions have been created
      to address this problem.
      
      Move gpiochip_lock/unlock_as_irq calls into
      irq_request/release_resources functions to prevent using a
      gpio as an irq if the gpiochip_lock_as_irq call failed.
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Acked-by: NJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      bd873373
    • L
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c5861658
      Linus Torvalds 提交于
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes from all around the place:
      
         - a KASLR related revert where we ran out of time to get a fix - this
           represents a substantial portion of the diffstat,
      
         - two FPU fixes,
      
         - two x86 platform fixes: an ACPI reduced-hw fix and a NumaChip fix,
      
         - an entry code fix,
      
         - and a VDSO build fix"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        Revert "x86/mm/ASLR: Propagate base load address calculation"
        x86/fpu: Drop_fpu() should not assume that tsk equals current
        x86/fpu: Avoid math_state_restore() without used_math() in __restore_xstate_sig()
        x86/apic/numachip: Fix sibling map with NumaChip
        x86/platform, acpi: Bypass legacy PIC and PIT in ACPI hardware reduced mode
        x86/asm/entry/32: Fix user_mode() misuses
        x86/vdso: Fix the build on GCC5
      c5861658
    • L
      Merge branches 'perf-urgent-for-linus' and 'timers-urgent-for-linus' of... · 13326e5a
      Linus Torvalds 提交于
      Merge branches 'perf-urgent-for-linus' and 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
      
      Pull perf and timer fixes from Ingo Molnar:
       "Two small perf fixes:
         - kernel side context leak fix
         - tooling crash fix
      
        And two clocksource driver fixes"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf: Fix context leak in put_event()
        perf annotate: Fix fallback to unparsed disassembler line
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clockevents: sun5i: Fix setup_irq init sequence
        clocksource: efm32: Fix a NULL pointer dereference
      13326e5a
    • B
      HID: wacom: check for wacom->shared before following the pointer · e2c7d887
      Benjamin Tissoires 提交于
      486b908d (HID: wacom: do not send pen events before touch is up/forced out)
      introduces a kernel oops when plugging a tablet without touch.
      
      wacom->shared is null for these devices so this leads to a null pointer
      exception.
      
      Change the condition to make it clear that what we need is wacom->shared
      not NULL.
      Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      e2c7d887
    • R
      Revert "smc91x: retrieve IRQ and trigger flags in a modern way" · 8d7d9cca
      Robert Jarzmik 提交于
      The commit breaks the legacy platforms, ie. these not using device-tree,
      and setting up the interrupt resources with a flag to activate edge
      detection. The issue was found on the zylonite platform.
      
      The reason is that zylonite uses platform resources to pass the interrupt number
      and the irq flags (here IORESOURCE_IRQ_HIGHEDGE). It expects the driver to
      request the irq with these flags, which in turn setups the irq as high edge
      triggered.
      
      After the patch, this was supposed to be taken care of with :
        irq_resflags = irqd_get_trigger_type(irq_get_irq_data(ndev->irq));
      
      But irq_resflags is 0 for legacy platforms, while for example in
      arch/arm/mach-pxa/zylonite.c, in struct resource smc91x_resources[] the
      irq flag is specified. This breaks zylonite because the interrupt is not
      setup as triggered, and hardware doesn't provide interrupts.
      Signed-off-by: NRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d7d9cca
    • E
      inet: Clean up inet_csk_wait_for_connect() vs. might_sleep() · cb7cf8a3
      Eric Dumazet 提交于
      I got the following trace with current net-next kernel :
      
      [14723.885290] WARNING: CPU: 26 PID: 22658 at kernel/sched/core.c:7285 __might_sleep+0x89/0xa0()
      [14723.885325] do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffff810e8734>] prepare_to_wait_exclusive+0x34/0xa0
      [14723.885355] CPU: 26 PID: 22658 Comm: netserver Not tainted 4.0.0-dbg-DEV #1379
      [14723.885359]  ffffffff81a223a8 ffff881fae9e7ca8 ffffffff81650b5d 0000000000000001
      [14723.885364]  ffff881fae9e7cf8 ffff881fae9e7ce8 ffffffff810a72e7 0000000000000000
      [14723.885367]  ffffffff81a57620 000000000000093a 0000000000000000 ffff881fae9e7e64
      [14723.885371] Call Trace:
      [14723.885377]  [<ffffffff81650b5d>] dump_stack+0x4c/0x65
      [14723.885382]  [<ffffffff810a72e7>] warn_slowpath_common+0x97/0xe0
      [14723.885386]  [<ffffffff810a73e6>] warn_slowpath_fmt+0x46/0x50
      [14723.885390]  [<ffffffff810f4c5d>] ? trace_hardirqs_on_caller+0x10d/0x1d0
      [14723.885393]  [<ffffffff810e8734>] ? prepare_to_wait_exclusive+0x34/0xa0
      [14723.885396]  [<ffffffff810e8734>] ? prepare_to_wait_exclusive+0x34/0xa0
      [14723.885399]  [<ffffffff810ccdc9>] __might_sleep+0x89/0xa0
      [14723.885403]  [<ffffffff81581846>] lock_sock_nested+0x36/0xb0
      [14723.885406]  [<ffffffff815829a3>] ? release_sock+0x173/0x1c0
      [14723.885411]  [<ffffffff815ea1f7>] inet_csk_accept+0x157/0x2a0
      [14723.885415]  [<ffffffff810e8900>] ? abort_exclusive_wait+0xc0/0xc0
      [14723.885419]  [<ffffffff8161b96d>] inet_accept+0x2d/0x150
      [14723.885424]  [<ffffffff8157db6f>] SYSC_accept4+0xff/0x210
      [14723.885428]  [<ffffffff8165a451>] ? retint_swapgs+0xe/0x44
      [14723.885431]  [<ffffffff810f4c5d>] ? trace_hardirqs_on_caller+0x10d/0x1d0
      [14723.885437]  [<ffffffff81369c0e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
      [14723.885441]  [<ffffffff8157ef40>] SyS_accept+0x10/0x20
      [14723.885444]  [<ffffffff81659872>] system_call_fastpath+0x12/0x17
      [14723.885447] ---[ end trace ff74cd83355b1873 ]---
      
      In commit 26cabd31
      Peter added a sched_annotate_sleep() in sk_wait_event()
      
      Is the following patch needed as well ?
      
      Alternative would be to use sk_wait_event() from inet_csk_wait_for_connect()
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cb7cf8a3
    • N
      ip6_tunnel: fix error code when tunnel exists · 37355565
      Nicolas Dichtel 提交于
      After commit 2b0bb01b, the kernel returns -ENOBUFS when user tries to add
      an existing tunnel with ioctl API:
      $ ip -6 tunnel add ip6tnl1 mode ip6ip6 dev eth1
      add tunnel "ip6tnl0" failed: No buffer space available
      
      It's confusing, the right error is EEXIST.
      
      This patch also change a bit the code returned:
       - ENOBUFS -> ENOMEM
       - ENOENT -> ENODEV
      
      Fixes: 2b0bb01b ("ip6_tunnel: Return an error when adding an existing tunnel.")
      CC: Steffen Klassert <steffen.klassert@secunet.com>
      Reported-by: NPierre Cheynier <me@pierre-cheynier.net>
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      37355565