1. 16 May, 2016 4 commits
    • Vitaly Kuznetsov's avatar
      hv_netvsc: untangle the pointer mess · 3d541ac5
      Vitaly Kuznetsov authored
      We have the following structures keeping netvsc adapter state:
      - struct net_device
      - struct net_device_context
      - struct netvsc_device
      - struct rndis_device
      - struct hv_device
      and there are pointers/dependencies between them:
      - struct net_device_context is contained in struct net_device
      - struct hv_device has driver_data pointer which points to
        'struct net_device' OR 'struct netvsc_device' depending on driver's
        state (!).
      - struct net_device_context has a pointer to 'struct hv_device'.
      - struct netvsc_device has pointers to 'struct hv_device' and
        'struct net_device_context'.
      - struct rndis_device has a pointer to 'struct netvsc_device'.
      
      Different functions get different structures as parameters and use these
      pointers for traveling. The problem is (in addition to keeping in mind
      this complex graph) that some of these structures (struct netvsc_device
      and struct rndis_device) are being removed and re-created on mtu change
      (as we implement it as re-creation of hyper-v device) so our travel using
      these pointers is dangerous.
      
      Simplify this to a the following:
      - add struct netvsc_device pointer to struct net_device_context (which is
        a part of struct net_device and thus never disappears)
      - remove struct hv_device and struct net_device_context pointers from
        struct netvsc_device
      - replace pointer to 'struct netvsc_device' with pointer to
        'struct net_device'.
      - always keep 'struct net_device' in hv_device driver_data.
      
      We'll end up with the following 'circular' structure:
      
      net_device:
       [net_device_context] -> netvsc_device -> rndis_device -> net_device
                            -> hv_device -> net_device
      
      On MTU change we'll be removing the 'netvsc_device -> rndis_device'
      branch and re-creating it making the synchronization easier.
      
      There is one additional redundant pointer left, it is struct net_device
      link in struct netvsc_device, it is going to be removed in a separate
      commit.
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d541ac5
    • Vitaly Kuznetsov's avatar
      hv_netvsc: use start_remove flag to protect netvsc_link_change() · 1bdcec8a
      Vitaly Kuznetsov authored
      netvsc_link_change() can race with netvsc_change_mtu() or
      netvsc_set_channels() as these functions destroy struct netvsc_device and
      rndis filter. Use start_remove flag for syncronization. As
      netvsc_change_mtu()/netvsc_set_channels() are called with rtnl lock held
      we need to take it before checking start_remove value in
      netvsc_link_change().
      Reported-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1bdcec8a
    • Vitaly Kuznetsov's avatar
      hv_netvsc: move start_remove flag to net_device_context · f580aec4
      Vitaly Kuznetsov authored
      struct netvsc_device is destroyed on mtu change so keeping the
      protection flag there is not a good idea. Move it to struct
      net_device_context which is preserved.
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f580aec4
    • Uwe Kleine-König's avatar
      phy: add support for a reset-gpio specification · da47b457
      Uwe Kleine-König authored
      The framework only asserts (for now) that the reset gpio is not active.
      Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Reviewed-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da47b457
  2. 15 May, 2016 12 commits
  3. 14 May, 2016 24 commits