1. 30 Mar, 2016 23 commits
  2. 29 Mar, 2016 8 commits
  3. 28 Mar, 2016 3 commits
    • Geert Uytterhoeven's avatar
      gpio: rcar: Add Runtime PM handling for interrupts · 93267aeb
      Geert Uytterhoeven authored
      commit b26a719b upstream.
      
      The R-Car GPIO driver handles Runtime PM for requested GPIOs only.
      
      When using a GPIO purely as an interrupt source, no Runtime PM handling
      is done, and the GPIO module's clock may not be enabled.
      
      To fix this:
        - Add .irq_request_resources() and .irq_release_resources() callbacks
          to handle Runtime PM when an interrupt is requested,
        - Add irq_bus_lock() and sync_unlock() callbacks to handle Runtime PM
          when e.g. disabling/enabling an interrupt, or configuring the
          interrupt type.
      
      Fixes: d5c3d846 "net: phy: Avoid polling PHY with PHY_IGNORE_INTERRUPTS"
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      93267aeb
    • Linus Walleij's avatar
      gpio: add a data pointer to gpio_chip · 70ee401b
      Linus Walleij authored
      commit b08ea35a upstream.
      
      This adds a void * pointer to gpio_chip so that driver can
      assign and retrieve some states. This is done to get rid of
      container_of() calls for gpio_chips embedded inside state
      containers, so we can remove the need to have the gpio_chip
      or later (planned) struct gpio_device be dynamically allocated
      at registration time, so that its struct device can be properly
      reference counted and not bound to its parent device (e.g.
      a platform_device) but instead live on after unregistration
      if it is opened by e.g. a char device or sysfs.
      
      The data is added with the new function gpiochip_add_data()
      and for compatibility we add static inline wrapper function
      gpiochip_add() that will call gpiochip_add_data() with
      NULL as argument. The latter will be removed once we have
      exorcised gpiochip_add() from the kernel.
      
      gpiochip_get_data() is added as a static inline accessor
      for drivers to quickly get their data out.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      [ kamal: 4.2-stable prereq ]
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      70ee401b
    • Bamvor Jian Zhang's avatar
      gpiolib: do not allow to insert an empty gpiochip · 31d98a9a
      Bamvor Jian Zhang authored
      commit 5ed41cc4 upstream.
      
      We need to check if number of gpio is positive if there is no
      such check in devicetree or acpi or whatever called before
      gpiochip_add.
      
      I suppose that devicetree and acpi do not allow insert gpiochip
      with zero number but I do not know if it is enough to ignore
      this check in gpiochip_add.
      Signed-off-by: default avatarBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      [ kamal: 4.2-stable prereq ]
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      31d98a9a
  4. 25 Mar, 2016 4 commits
  5. 21 Mar, 2016 1 commit
  6. 15 Mar, 2016 1 commit
    • Benjamin Poirier's avatar
      mld, igmp: Fix reserved tailroom calculation · be35cd0e
      Benjamin Poirier authored
      commit 1837b2e2 upstream.
      
      The current reserved_tailroom calculation fails to take hlen and tlen into
      account.
      
      skb:
      [__hlen__|__data____________|__tlen___|__extra__]
      ^                                               ^
      head                                            skb_end_offset
      
      In this representation, hlen + data + tlen is the size passed to alloc_skb.
      "extra" is the extra space made available in __alloc_skb because of
      rounding up by kmalloc. We can reorder the representation like so:
      
      [__hlen__|__data____________|__extra__|__tlen___]
      ^                                               ^
      head                                            skb_end_offset
      
      The maximum space available for ip headers and payload without
      fragmentation is min(mtu, data + extra). Therefore,
      reserved_tailroom
      = data + extra + tlen - min(mtu, data + extra)
      = skb_end_offset - hlen - min(mtu, skb_end_offset - hlen - tlen)
      = skb_tailroom - min(mtu, skb_tailroom - tlen) ; after skb_reserve(hlen)
      
      Compare the second line to the current expression:
      reserved_tailroom = skb_end_offset - min(mtu, skb_end_offset)
      and we can see that hlen and tlen are not taken into account.
      
      The min() in the third line can be expanded into:
      if mtu < skb_tailroom - tlen:
      	reserved_tailroom = skb_tailroom - mtu
      else:
      	reserved_tailroom = tlen
      
      Depending on hlen, tlen, mtu and the number of multicast address records,
      the current code may output skbs that have less tailroom than
      dev->needed_tailroom or it may output more skbs than needed because not all
      space available is used.
      
      Fixes: 4c672e4b ("ipv6: mld: fix add_grhead skb_over_panic for devs with large MTUs")
      Signed-off-by: default avatarBenjamin Poirier <bpoirier@suse.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
      be35cd0e