1. 01 6月, 2016 18 次提交
  2. 31 5月, 2016 4 次提交
  3. 30 5月, 2016 18 次提交
    • L
      gpio: drop lock before reading GPIO direction · 545ebd9a
      Linus Walleij 提交于
      When adding the gpiochip, the GPIO HW drivers' callback get_direction()
      could get called in atomic context. Some of the GPIO HW drivers may
      sleep when accessing the register.
      
      Move the lock before initializing the descriptors.
      Reported-by: NLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      545ebd9a
    • L
      gpio: bail out silently on NULL descriptors · 54d77198
      Linus Walleij 提交于
      In fdeb8e15
      ("gpio: reflect base and ngpio into gpio_device")
      assumed that GPIO descriptors are either valid or error
      pointers, but gpiod_get_[index_]optional() actually return
      NULL descriptors and then all subsequent calls should just
      bail out.
      
      Cc: stable@vger.kernel.org
      Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Fixes: fdeb8e15 ("gpio: reflect base and ngpio into gpio_device")
      Reported-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      54d77198
    • L
      gpio: handle compatible ioctl() pointers · 8b92e17e
      Linus Walleij 提交于
      If we're using the compatible ioctl() we need to handle the
      argument pointer in a special way or there will be trouble.
      
      Fixes: 3c702e99 ("gpio: add a userspace chardev ABI for GPIOs")
      Reported-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Reviewed-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      8b92e17e
    • L
      gpio: flush direction status in gpiochip_lock_as_irq() · 9c10280d
      Linus Walleij 提交于
      As irqchip and gpiochip functions are orthogonal, the IRQ
      set-up or something else can have changed the direction of
      the GPIO line from what the GPIO descriptor knows when we
      get into gpiochip_lock_as_irq(). Make sure to re-read the
      direction setting if we have the .get_direction() callback
      enabled for the chip.
      
      Else we get problems like this:
      
      iio iio:device2: interrupts on the rising edge
      gpio gpiochip2: (8012e080.gpio): gpiochip_lock_as_irq:
        tried to flag a GPIO set as output for IRQ
      gpio gpiochip2: (8012e080.gpio): unable to lock HW IRQ 0 for IRQ
      genirq: Failed to request resources for l3g4200d-trigger
        (irq 111) on irqchip nmk1-32-63
      iio iio:device2: failed to request trigger IRQ.
      st-gyro-i2c: probe of 2-0068 failed with error -22
      
      Fixes: 72d32000 ("gpio: set up initial state from .get_direction()")
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      9c10280d
    • S
      gpio: lpc32xx: disable broken to_irq support · 320a6480
      Sylvain Lemieux 提交于
      The "to_irq" functionality is broken inside this driver since commit
      76ba59f8 ("genirq: Add irq_domain-aware core IRQ handler").
      
      The addition of the new lpc32xx irqchip driver in 4.7, fixed the
      lpc32xx platform interrupt issue.
      
      When switching to the new lpc32xx irqchip driver, a warning appear
      in the lpc32xx gpio driver: warning: "NR_IRQS" redefined.
      
      To remove this warning (temporary solution), this patch
      disables the broken "to_irq" mapping functionality support.
      Signed-off-by: NSylvain Lemieux <slemieux@tycoint.com>
      Acked-by: NVladimir Zapolskiy <vz@mleia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      320a6480
    • S
      net: l2tp: Make l2tp_ip6 namespace aware · 0e6b5259
      Shmulik Ladkani 提交于
      l2tp_ip6 tunnel and session lookups were still using init_net, although
      the l2tp core infrastructure already supports lookups keyed by 'net'.
      
      As a result, l2tp_ip6_recv discarded packets for tunnels/sessions
      created in namespaces other than the init_net.
      
      Fix, by using dev_net(skb->dev) or sock_net(sk) where appropriate.
      Signed-off-by: NShmulik Ladkani <shmulik.ladkani@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0e6b5259
    • E
      Documentation: ip-sysctl.txt: clarify secure_redirects · 176b346b
      Eric Garver 提交于
      Clarify how secure_redirects works. Mention that RFC1122 always applies.
      Signed-off-by: NEric Garver <e@erig.me>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      176b346b
    • E
      sfc: use flow dissector helpers for aRFS · 68bb399e
      Edward Cree 提交于
      Signed-off-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      68bb399e
    • B
      ieee802154: fix logic error in ieee802154_llsec_parse_dev_addr · 421eeea1
      Baozeng Ding 提交于
      Fix a logic error to avoid potential null pointer dereference.
      Signed-off-by: NBaozeng Ding <sploving1@gmail.com>
      Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      421eeea1
    • E
      net: nps_enet: Disable interrupts before napi reschedule · 86651650
      Elad Kanfi 提交于
      Since NAPI works by shutting down event interrupts when theres
      work and turning them on when theres none, the net driver must
      make sure that interrupts are disabled when it reschedules polling.
      By calling napi_reschedule, the driver switches to polling mode,
      therefor there should be no interrupt interference.
      Any received packets will be handled in nps_enet_poll by polling the HW
      indication of received packet until all packets are handled.
      Signed-off-by: NElad Kanfi <eladkan@mellanox.com>
      Acked-by: NNoam Camus <noamca@mellanox.com>
      Tested-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      86651650
    • A
      net/lapb: tuse %*ph to dump buffers · 0d08df6c
      Andy Shevchenko 提交于
      Use %*ph specifier to dump small buffers in hex format instead doing this
      byte-by-byte.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0d08df6c
    • D
      ptp: oops in ptp_ioctl() · 6756325a
      Dan Carpenter 提交于
      If we pass ERR_PTR(-EFAULT) to kfree() then it's going to oops.
      
      Fixes: 2ece068e ('ptp: use memdup_user().')
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6756325a
    • A
      fou: add Kconfig options for IPv6 support · fabb13db
      Arnd Bergmann 提交于
      A previous patch added the fou6.ko module, but that failed to link
      in a couple of configurations:
      
      net/built-in.o: In function `ip6_tnl_encap_add_fou_ops':
      net/ipv6/fou6.c:88: undefined reference to `ip6_tnl_encap_add_ops'
      net/ipv6/fou6.c:94: undefined reference to `ip6_tnl_encap_add_ops'
      net/ipv6/fou6.c:97: undefined reference to `ip6_tnl_encap_del_ops'
      net/built-in.o: In function `ip6_tnl_encap_del_fou_ops':
      net/ipv6/fou6.c:106: undefined reference to `ip6_tnl_encap_del_ops'
      net/ipv6/fou6.c:107: undefined reference to `ip6_tnl_encap_del_ops'
      
      If CONFIG_IPV6=m, ip6_tnl_encap_add_ops/ip6_tnl_encap_del_ops
      are in a module, but fou6.c can still be built-in, and that
      obviously fails to link.
      
      Also, if CONFIG_IPV6=y, but CONFIG_IPV6_TUNNEL=m or
      CONFIG_IPV6_TUNNEL=n, the same problem happens for a different
      reason.
      
      This adds two new silent Kconfig symbols to work around both
      problems:
      
      - CONFIG_IPV6_FOU is now always set to 'm' if either CONFIG_NET_FOU=m
        or CONFIG_IPV6=m
      - CONFIG_IPV6_FOU_TUNNEL is set implicitly when IPV6_FOU is enabled
        and NET_FOU_IP_TUNNELS is also turned out, and it will ensure
        that CONFIG_IPV6_TUNNEL is also available.
      
      The options could be made user-visible as well, to give additional
      room for configuration, but it seems easier not to bother users
      with more choice here.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: aa3463d6 ("fou: Add encap ops for IPv6 tunnels")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fabb13db
    • A
      ipv6: hide ip6_encap_hlen/ip6_tnl_encap definitions · 9791d8e7
      Arnd Bergmann 提交于
      A recent cleanup moved MAX_IPTUN_ENCAP_OPS along with some other
      definitions, but it is now invisible when CONFIG_INET is
      not defined, but still referenced from ip6_tunnel.h:
      
      In file included from net/xfrm/xfrm_input.c:17:0:
      include/net/ip6_tunnel.h:67:17: error: 'MAX_IPTUN_ENCAP_OPS' undeclared here (not in a function)
         ip6tun_encaps[MAX_IPTUN_ENCAP_OPS];
                       ^~~~~~~~~~~~~~~~~~~
      
      This hides the ip6_encap_hlen and ip6_tnl_encap functions inside
      of CONFIG_INET so we don't run into the the problem.
      
      Alternatively we could move the macro out of the #ifdef again to
      restore the previous behavior
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 55c2bc14 ("net: Cleanup encap items in ip_tunnels.h")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9791d8e7
    • D
      sparc64: Fix return from trap window fill crashes. · 7cafc0b8
      David S. Miller 提交于
      We must handle data access exception as well as memory address unaligned
      exceptions from return from trap window fill faults, not just normal
      TLB misses.
      
      Otherwise we can get an OOPS that looks like this:
      
      ld-linux.so.2(36808): Kernel bad sw trap 5 [#1]
      CPU: 1 PID: 36808 Comm: ld-linux.so.2 Not tainted 4.6.0 #34
      task: fff8000303be5c60 ti: fff8000301344000 task.ti: fff8000301344000
      TSTATE: 0000004410001601 TPC: 0000000000a1a784 TNPC: 0000000000a1a788 Y: 00000002    Not tainted
      TPC: <do_sparc64_fault+0x5c4/0x700>
      g0: fff8000024fc8248 g1: 0000000000db04dc g2: 0000000000000000 g3: 0000000000000001
      g4: fff8000303be5c60 g5: fff800030e672000 g6: fff8000301344000 g7: 0000000000000001
      o0: 0000000000b95ee8 o1: 000000000000012b o2: 0000000000000000 o3: 0000000200b9b358
      o4: 0000000000000000 o5: fff8000301344040 sp: fff80003013475c1 ret_pc: 0000000000a1a77c
      RPC: <do_sparc64_fault+0x5bc/0x700>
      l0: 00000000000007ff l1: 0000000000000000 l2: 000000000000005f l3: 0000000000000000
      l4: fff8000301347e98 l5: fff8000024ff3060 l6: 0000000000000000 l7: 0000000000000000
      i0: fff8000301347f60 i1: 0000000000102400 i2: 0000000000000000 i3: 0000000000000000
      i4: 0000000000000000 i5: 0000000000000000 i6: fff80003013476a1 i7: 0000000000404d4c
      I7: <user_rtt_fill_fixup+0x6c/0x7c>
      Call Trace:
       [0000000000404d4c] user_rtt_fill_fixup+0x6c/0x7c
      
      The window trap handlers are slightly clever, the trap table entries for them are
      composed of two pieces of code.  First comes the code that actually performs
      the window fill or spill trap handling, and then there are three instructions at
      the end which are for exception processing.
      
      The userland register window fill handler is:
      
      	add	%sp, STACK_BIAS + 0x00, %g1;		\
      	ldxa	[%g1 + %g0] ASI, %l0;			\
      	mov	0x08, %g2;				\
      	mov	0x10, %g3;				\
      	ldxa	[%g1 + %g2] ASI, %l1;			\
      	mov	0x18, %g5;				\
      	ldxa	[%g1 + %g3] ASI, %l2;			\
      	ldxa	[%g1 + %g5] ASI, %l3;			\
      	add	%g1, 0x20, %g1;				\
      	ldxa	[%g1 + %g0] ASI, %l4;			\
      	ldxa	[%g1 + %g2] ASI, %l5;			\
      	ldxa	[%g1 + %g3] ASI, %l6;			\
      	ldxa	[%g1 + %g5] ASI, %l7;			\
      	add	%g1, 0x20, %g1;				\
      	ldxa	[%g1 + %g0] ASI, %i0;			\
      	ldxa	[%g1 + %g2] ASI, %i1;			\
      	ldxa	[%g1 + %g3] ASI, %i2;			\
      	ldxa	[%g1 + %g5] ASI, %i3;			\
      	add	%g1, 0x20, %g1;				\
      	ldxa	[%g1 + %g0] ASI, %i4;			\
      	ldxa	[%g1 + %g2] ASI, %i5;			\
      	ldxa	[%g1 + %g3] ASI, %i6;			\
      	ldxa	[%g1 + %g5] ASI, %i7;			\
      	restored;					\
      	retry; nop; nop; nop; nop;			\
      	b,a,pt	%xcc, fill_fixup_dax;			\
      	b,a,pt	%xcc, fill_fixup_mna;			\
      	b,a,pt	%xcc, fill_fixup;
      
      And the way this works is that if any of those memory accesses
      generate an exception, the exception handler can revector to one of
      those final three branch instructions depending upon which kind of
      exception the memory access took.  In this way, the fault handler
      doesn't have to know if it was a spill or a fill that it's handling
      the fault for.  It just always branches to the last instruction in
      the parent trap's handler.
      
      For example, for a regular fault, the code goes:
      
      winfix_trampoline:
      	rdpr	%tpc, %g3
      	or	%g3, 0x7c, %g3
      	wrpr	%g3, %tnpc
      	done
      
      All window trap handlers are 0x80 aligned, so if we "or" 0x7c into the
      trap time program counter, we'll get that final instruction in the
      trap handler.
      
      On return from trap, we have to pull the register window in but we do
      this by hand instead of just executing a "restore" instruction for
      several reasons.  The largest being that from Niagara and onward we
      simply don't have enough levels in the trap stack to fully resolve all
      possible exception cases of a window fault when we are already at
      trap level 1 (which we enter to get ready to return from the original
      trap).
      
      This is executed inline via the FILL_*_RTRAP handlers.  rtrap_64.S's
      code branches directly to these to do the window fill by hand if
      necessary.  Now if you look at them, we'll see at the end:
      
      	    ba,a,pt    %xcc, user_rtt_fill_fixup;
      	    ba,a,pt    %xcc, user_rtt_fill_fixup;
      	    ba,a,pt    %xcc, user_rtt_fill_fixup;
      
      And oops, all three cases are handled like a fault.
      
      This doesn't work because each of these trap types (data access
      exception, memory address unaligned, and faults) store their auxiliary
      info in different registers to pass on to the C handler which does the
      real work.
      
      So in the case where the stack was unaligned, the unaligned trap
      handler sets up the arg registers one way, and then we branched to
      the fault handler which expects them setup another way.
      
      So the FAULT_TYPE_* value ends up basically being garbage, and
      randomly would generate the backtrace seen above.
      Reported-by: NNick Alcock <nix@esperi.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7cafc0b8
    • L
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · b02b1fbd
      Linus Torvalds 提交于
      Pull SCSI fixes from James Bottomley:
       "This is a set of four fixes noticed in the merge window.  The aacraid
        one is an optimisation, the mp3sas one fixes a spurious printk, the
        sd_check_events one fixes a theoretical race and the failed zero
        length commands fixes a bug in our completion/retry routines that has
        been causing problems in the field"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        aacraid: do not activate events on non-SRC adapters
        mpt3sas: add missing curly braces
        sd: get disk reference in sd_check_events()
        scsi_lib: correctly retry failed zero length REQ_TYPE_FS commands
      b02b1fbd
    • D
      sparc: Harden signal return frame checks. · d11c2a0d
      David S. Miller 提交于
      All signal frames must be at least 16-byte aligned, because that is
      the alignment we explicitly create when we build signal return stack
      frames.
      
      All stack pointers must be at least 8-byte aligned.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d11c2a0d
    • L
      Linux 4.7-rc1 · 1a695a90
      Linus Torvalds 提交于
      1a695a90