1. 01 Nov, 2017 23 commits
    • Daniel Lezcano's avatar
      thermal/drivers/step_wise: Fix temperature regulation misbehavior · 07209fcf
      Daniel Lezcano authored
      There is a particular situation when the cooling device is cpufreq and the heat
      dissipation is not efficient enough where the temperature increases little by
      little until reaching the critical threshold and leading to a SoC reset.
      
      The behavior is reproducible on a hikey6220 with bad heat dissipation (eg.
      stacked with other boards).
      
      Running a simple C program doing while(1); for each CPU of the SoC makes the
      temperature to reach the passive regulation trip point and ends up to the
      maximum allowed temperature followed by a reset.
      
      This issue has been also reported by running the libhugetlbfs test suite.
      
      What is observed is a ping pong between two cpu frequencies, 1.2GHz and 900MHz
      while the temperature continues to grow.
      
      It appears the step wise governor calls get_target_state() the first time with
      the throttle set to true and the trend to 'raising'. The code selects logically
      the next state, so the cpu frequency decreases from 1.2GHz to 900MHz, so far so
      good. The temperature decreases immediately but still stays greater than the
      trip point, then get_target_state() is called again, this time with the
      throttle set to true *and* the trend to 'dropping'. From there the algorithm
      assumes we have to step down the state and the cpu frequency jumps back to
      1.2GHz. But the temperature is still higher than the trip point, so
      get_target_state() is called with throttle=1 and trend='raising' again, we jump
      to 900MHz, then get_target_state() is called with throttle=1 and
      trend='dropping', we jump to 1.2GHz, etc ... but the temperature does not
      stabilizes and continues to increase.
      
      [  237.922654] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=1,throttle=1
      [  237.922678] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=1,throttle=1
      [  237.922690] thermal cooling_device0: cur_state=0
      [  237.922701] thermal cooling_device0: old_target=0, target=1
      [  238.026656] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=2,throttle=1
      [  238.026680] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=2,throttle=1
      [  238.026694] thermal cooling_device0: cur_state=1
      [  238.026707] thermal cooling_device0: old_target=1, target=0
      [  238.134647] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=1,throttle=1
      [  238.134667] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=1,throttle=1
      [  238.134679] thermal cooling_device0: cur_state=0
      [  238.134690] thermal cooling_device0: old_target=0, target=1
      
      In this situation the temperature continues to increase while the trend is
      oscillating between 'dropping' and 'raising'. We need to keep the current state
      untouched if the throttle is set, so the temperature can decrease or a higher
      state could be selected, thus preventing this oscillation.
      
      Keeping the next_target untouched when 'throttle' is true at 'dropping' time
      fixes the issue.
      
      The following traces show the governor does not change the next state if
      trend==2 (dropping) and throttle==1.
      
      [ 2306.127987] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=1,throttle=1
      [ 2306.128009] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=1,throttle=1
      [ 2306.128021] thermal cooling_device0: cur_state=0
      [ 2306.128031] thermal cooling_device0: old_target=0, target=1
      [ 2306.231991] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=2,throttle=1
      [ 2306.232016] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=2,throttle=1
      [ 2306.232030] thermal cooling_device0: cur_state=1
      [ 2306.232042] thermal cooling_device0: old_target=1, target=1
      [ 2306.335982] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=0,throttle=1
      [ 2306.336006] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=0,throttle=1
      [ 2306.336021] thermal cooling_device0: cur_state=1
      [ 2306.336034] thermal cooling_device0: old_target=1, target=1
      [ 2306.439984] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=2,throttle=1
      [ 2306.440008] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=2,throttle=0
      [ 2306.440022] thermal cooling_device0: cur_state=1
      [ 2306.440034] thermal cooling_device0: old_target=1, target=0
      
      [ ... ]
      
      After a while, if the temperature continues to increase, the next state becomes
      2 which is 720MHz on the hikey. That results in the temperature stabilizing
      around the trip point.
      
      [ 2455.831982] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=1,throttle=1
      [ 2455.832006] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=1,throttle=0
      [ 2455.832019] thermal cooling_device0: cur_state=1
      [ 2455.832032] thermal cooling_device0: old_target=1, target=1
      [ 2455.935985] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=0,throttle=1
      [ 2455.936013] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=0,throttle=0
      [ 2455.936027] thermal cooling_device0: cur_state=1
      [ 2455.936040] thermal cooling_device0: old_target=1, target=1
      [ 2456.043984] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=0,throttle=1
      [ 2456.044009] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=0,throttle=0
      [ 2456.044023] thermal cooling_device0: cur_state=1
      [ 2456.044036] thermal cooling_device0: old_target=1, target=1
      [ 2456.148001] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=1,throttle=1
      [ 2456.148028] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=1,throttle=1
      [ 2456.148042] thermal cooling_device0: cur_state=1
      [ 2456.148055] thermal cooling_device0: old_target=1, target=2
      [ 2456.252009] thermal thermal_zone0: Trip0[type=1,temp=65000]:trend=2,throttle=1
      [ 2456.252041] thermal thermal_zone0: Trip1[type=1,temp=75000]:trend=2,throttle=0
      [ 2456.252058] thermal cooling_device0: cur_state=2
      [ 2456.252075] thermal cooling_device0: old_target=2, target=1
      
      IOW, this change is needed to keep the state for a cooling device if the
      temperature trend is oscillating while the temperature increases slightly.
      
      Without this change, the situation above leads to a catastrophic crash by a
      hardware reset on hikey. This issue has been reported to happen on an OMAP
      dra7xx also.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Tested-by: default avatarKeerthy <j-keerthy@ti.com>
      Reviewed-by: default avatarKeerthy <j-keerthy@ti.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      07209fcf
    • Kevin Wangtao's avatar
      thermal/drivers/hisi: Use round up step value · e42bbe11
      Kevin Wangtao authored
      Use round up division to ensure the programmed value of threshold and the lag
      are not less than what we set, and in order to keep the accuracy while using
      round up division, the step value should be a rounded up value.  There is
      no need to use hisi_thermal_round_temp.
      Signed-off-by: default avatarKevin Wangtao <kevin.wangtao@linaro.org>
      Tested-by: Daniel Lezcano <daniel.lezcano@linaro.org> # hikey6220
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      e42bbe11
    • Kevin Wangtao's avatar
      thermal/drivers/hisi: Move the clk setup in the corresponding functions · 943c0f6a
      Kevin Wangtao authored
      The sensor's clock is enabled and disabled outside of the probe and
      disable function. Moving the corresponding action in the
      hisi_thermal_setup() and hisi_thermal_disable_sensor(), factors out
      some lines of code and makes the code more symmetric.
      Signed-off-by: default avatarKevin Wangtao <kevin.wangtao@linaro.org>
      Tested-by: Daniel Lezcano <daniel.lezcano@linaro.org> # hikey6220
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      943c0f6a
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Remove mutex_lock in the code · cc1ab38d
      Daniel Lezcano authored
      The mutex is used to protect against writes in the configuration register.
      
      That happens at probe time, with no possible race yet.
      
      Then when the module is unloaded and at suspend/resume.
      
      When the module is unloaded, it is an userspace operation, thus via a process.
      Suspending the system goes through the freezer to suspend all the tasks
      synchronously before continuing. So it is not possible to hit the suspend ops
      in this driver while we are unloading it.
      
      The resume is the same situation than the probe.
      
      In other words, even if there are several places where we write the
      configuration register, there is no situation where we can write it at the same
      time, so far as I can judge
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      cc1ab38d
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Remove thermal data back pointer · 81d7cb79
      Daniel Lezcano authored
      The presence of the thermal data pointer in the sensor structure has the unique
      purpose of accessing the thermal data in the interrupt handler.
      
      The sensor pointer is passed when registering the interrupt handler, replace the
      cookie by the thermal data pointer, so the back pointer is no longer needed.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      81d7cb79
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Convert long to int · bc02ef6d
      Daniel Lezcano authored
      There is no point to specify the temperature as long variable, the int is
      enough.
      
      Replace all long variables to int, so making the code consistent.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      bc02ef6d
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Rename and remove unused field · 609f26dc
      Daniel Lezcano authored
      Rename the 'sensors' field to 'sensor' as we describe only one sensor.
      Remove the 'sensor_temp' as it is no longer used.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      609f26dc
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Remove costly sensor inspection · 10d7e9a9
      Daniel Lezcano authored
      The sensor is all setup, bind, resetted, acked, etc... every single second.
      
      That was the way to workaround a problem with the interrupt bouncing again and
      again.
      
      With the following changes, we fix all in one:
      
       - Do the setup, one time, at probe time
      
       - Add the IRQF_ONESHOT, ack the interrupt in the threaded handler
      
       - Remove the interrupt handler
      
       - Set the correct value for the LAG register
      
       - Remove all the irq_enabled stuff in the code as the interruption
         handling is fixed
      
       - Remove the 3ms delay
      
       - Reorder the initialization routine to be in the right order
      
      It ends up to a nicer code and more efficient, the 3-5ms delay is removed from
      the get_temp() path.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      10d7e9a9
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Fix configuration register setting · b424315a
      Daniel Lezcano authored
      The TEMP0_CFG configuration register contains different field to set up the
      temperature controller. However in the code, nothing prevents a setup to
      overwrite the previous one: eg. writing the hdak value overwrites the sensor
      selection, the sensor selection overwrites the hdak value.
      
      In order to prevent such thing, use a regmap-like mechanism by reading the
      value before, set the corresponding bits and write the result.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      b424315a
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Encapsulate register writes into helpers · 1e11b014
      Daniel Lezcano authored
      Hopefully, the function name can help to clarify the semantic of the operations
      when writing in the register.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      1e11b014
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Remove pointless lock · 2d4fa7b4
      Daniel Lezcano authored
      The threaded interrupt inspect the sensors structure to look in the temp
      threshold field, but this field is read-only in all the code, except in the
      probe function before the threaded interrupt is set. In other words there
      is not race window in the threaded interrupt when reading the field value.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      2d4fa7b4
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Fix multiple alarm interrupts firing · db2b0332
      Daniel Lezcano authored
      The DT specifies a threshold of 65000, we setup the register with a value in
      the temperature resolution for the controller, 64656.
      
      When we reach 64656, the interrupt fires, the interrupt is disabled. Then the
      irq thread runs and calls thermal_zone_device_update() which will call in turn
      hisi_thermal_get_temp().
      
      The function will look if the temperature decreased, assuming it was more than
      65000, but that is not the case because the current temperature is 64656
      (because of the rounding when setting the threshold). This condition being
      true, we re-enable the interrupt which fires immediately after exiting the irq
      thread. That happens again and again until the temperature goes to more than
      65000.
      
      Potentially, there is here an interrupt storm if the temperature stabilizes at
      this temperature. A very unlikely case but possible.
      
      In any case, it does not make sense to handle dozens of alarm interrupt for
      nothing.
      
      Fix this by rounding the threshold value to the controller resolution so the
      check against the threshold is consistent with the one set in the controller.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      db2b0332
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Simplify the temperature/step computation · 48880b97
      Daniel Lezcano authored
      The step and the base temperature are fixed values, we can simplify the
      computation by converting the base temperature to milli celsius and use a
      pre-computed step value. That saves us a lot of mult + div for nothing at
      runtime.
      
      Take also the opportunity to change the function names to be consistent with
      the rest of the code.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      48880b97
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Fix kernel panic on alarm interrupt · 2cb4de78
      Daniel Lezcano authored
      The threaded interrupt for the alarm interrupt is requested before the
      temperature controller is setup. This one can fire an interrupt immediately
      leading to a kernel panic as the sensor data is not initialized.
      
      In order to prevent that, move the threaded irq after the Tsensor is setup.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      2cb4de78
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Remove the multiple sensors support · ff4ec299
      Daniel Lezcano authored
      By essence, the tsensor does not really support multiple sensor at the same
      time. It allows to set a sensor and use it to get the temperature, another
      sensor could be switched but with a delay of 3-5ms. It is difficult to read
      simultaneously several sensors without a big delay.
      
      Today, just one sensor is used, it is not necessary to deal with multiple
      sensors in the code. Remove them and if it is needed in the future add them
      on top of a code which will be clean up in the meantime.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Acked-by: default avatarWangtao (Kevin, Kirin) <kevin.wangtao@hisilicon.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      ff4ec299
    • Daniel Lezcano's avatar
      thermal/drivers/hisi: Fix missing interrupt enablement · c176b10b
      Daniel Lezcano authored
      The interrupt for the temperature threshold is not enabled at the end of the
      probe function, enable it after the setup is complete.
      
      On the other side, the irq_enabled is not correctly set as we are checking if
      the interrupt is masked where 'yes' means irq_enabled=false.
      
      	irq_get_irqchip_state(data->irq, IRQCHIP_STATE_MASKED,
      				&data->irq_enabled);
      
      As we are always enabling the interrupt, it is pointless to check if
      the interrupt is masked or not, just set irq_enabled to 'true'.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      c176b10b
    • Tony Lindgren's avatar
      thermal: ti-soc-thermal: Fix ti_thermal_unregister_cpu_cooling NULL pointer on unload · ba817a8c
      Tony Lindgren authored
      While debugging some PM issues and trying to remove all the loaded modules, I ran
      across the following when unloading ti-soc-thermal:
      
      Unable to handle kernel NULL pointer dereference at virtual address 000000b4
      ...
      [<c08db340>] (kobject_put) from [<bf28954c>] (ti_thermal_unregister_cpu_cooling+0x20/0x28 [ti_soc_thermal])
      [<bf28954c>] (ti_thermal_unregister_cpu_cooling [ti_soc_thermal]) from [<bf287c88>] (ti_bandgap_remove+0x3c/0x104 [ti_soc_thermal])
      [<bf287c88>] (ti_bandgap_remove [ti_soc_thermal]) from [<c0610d48>] (platform_drv_remove+0x24/0x3c)
      [<c0610d48>] (platform_drv_remove) from [<c060f114>] (device_release_driver_internal+0x160/0x208)
      [<c060f114>] (device_release_driver_internal) from [<c060f200>] (driver_detach+0x38/0x6c)
      [<c060f200>] (driver_detach) from [<c060e2d4>] (bus_remove_driver+0x4c/0xa0)
      [<c060e2d4>] (bus_remove_driver) from [<c01f2370>] (SyS_delete_module+0x168/0x238)
      [<c01f2370>] (SyS_delete_module) from [<c0108240>] (ret_fast_syscall+0x0/0x28)
      
      Cc: Keerthy <j-keerthy@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      ba817a8c
    • Niklas Söderlund's avatar
      thermal: rcar_gen3_thermal: fix initialization sequence for H3 ES2.0 · d668c807
      Niklas Söderlund authored
      The initialization sequence for H3 (r8a7795) ES1.x and ES2.0 is
      different. H3 ES2.0 and later uses the same sequence as M3 (r8a7796)
      ES1.0. Fix this by not looking at compatible strings and instead
      defaulting to the r8a7796 initialization sequence and use
      soc_device_match() to check for H3 ES1.x.
      Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      d668c807
    • Baruch Siach's avatar
      thermal: armada: fix formula documentation comment · 0cf3a1ac
      Baruch Siach authored
      The formula implementation at armada_get_temp() indicates that the sign
      in the formula is inverted.
      
      Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
      Signed-off-by: default avatarBaruch Siach <baruch@tkos.co.il>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      0cf3a1ac
    • Nicolin Chen's avatar
      thermal: tegra: remove null check for dev pointer · 1fba81cc
      Nicolin Chen authored
      The dev pointer is going through a null check after a dereference.
      So this patch removes that useless check since the driver does not
      pass a null dev pointer in any case.
      Signed-off-by: default avatarNicolin Chen <nicoleotsuka@gmail.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      1fba81cc
    • Allen Wild's avatar
      thermal: enable broadcom menu for arm64 bcm2835 · fec3624f
      Allen Wild authored
      Moving the bcm2835 thermal driver to the broadcom directory prevented it
      from getting enabled for arm64 builds, since the broadcom directory is only
      available when 32-bit specific ARCH_BCM is set.
      
      Fix this by enabling the Broadcom menu for ARCH_BCM or ARCH_BCM2835.
      
      Fixes: 6892cf07 ("thermal: bcm2835: move to the broadcom subdirectory")
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      Signed-off-by: default avatarAllen Wild <allenwild93@gmail.com>
      Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      fec3624f
    • Rocky Hao's avatar
      thermal: rockchip: Support the RV1108 SoC in thermal driver · 4eca8cac
      Rocky Hao authored
      RV1108 SOC has one Temperature Sensor for CPU.
      Reviewed-by: default avatarCaesar Wang <wxt@rock-chips.com>
      Signed-off-by: default avatarRocky Hao <rocky.hao@rock-chips.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      4eca8cac
    • Rocky Hao's avatar
      dt-bindings: rockchip-thermal: Support the RV1108 SoC compatible · 1027d759
      Rocky Hao authored
      Add a new compatible for thermal founding on RV1108 SoCs.
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarRocky Hao <rocky.hao@rock-chips.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      1027d759
  2. 16 Sep, 2017 13 commits
    • Linus Torvalds's avatar
      Linux 4.14-rc1 · 2bd6bf03
      Linus Torvalds authored
      2bd6bf03
    • Linus Torvalds's avatar
      Merge tag 'upstream-4.14-rc1' of git://git.infradead.org/linux-ubifs · 194a4ef9
      Linus Torvalds authored
      Pull UBI updates from Richard Weinberger:
       "Minor improvements"
      
      * tag 'upstream-4.14-rc1' of git://git.infradead.org/linux-ubifs:
        UBI: Fix two typos in comments
        ubi: fastmap: fix spelling mistake: "invalidiate" -> "invalidate"
        ubi: pr_err() strings should end with newlines
        ubi: pr_err() strings should end with newlines
        ubi: pr_err() strings should end with newlines
      194a4ef9
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml · 2896b80e
      Linus Torvalds authored
      Pull UML updates from Richard Weinberger:
      
       - minor improvements
      
       - fixes for Debian's new gcc defaults (pie enabled by default)
      
       - fixes for XSTATE/XSAVE to make UML work again on modern systems
      
      * 'for-linus-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
        um: return negative in tuntap_open_tramp()
        um: remove a stray tab
        um: Use relative modversions with LD_SCRIPT_DYN
        um: link vmlinux with -no-pie
        um: Fix CONFIG_GCOV for modules.
        Fix minor typos and grammar in UML start_up help
        um: defconfig: Cleanup from old Kconfig options
        um: Fix FP register size for XSTATE/XSAVE
      2896b80e
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 48bddb14
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix hotplug deadlock in hv_netvsc, from Stephen Hemminger.
      
       2) Fix double-free in rmnet driver, from Dan Carpenter.
      
       3) INET connection socket layer can double put request sockets, fix
          from Eric Dumazet.
      
       4) Don't match collect metadata-mode tunnels if the device is down,
          from Haishuang Yan.
      
       5) Do not perform TSO6/GSO on ipv6 packets with extensions headers in
          be2net driver, from Suresh Reddy.
      
       6) Fix scaling error in gen_estimator, from Eric Dumazet.
      
       7) Fix 64-bit statistics deadlock in systemport driver, from Florian
          Fainelli.
      
       8) Fix use-after-free in sctp_sock_dump, from Xin Long.
      
       9) Reject invalid BPF_END instructions in verifier, from Edward Cree.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (43 commits)
        mlxsw: spectrum_router: Only handle IPv4 and IPv6 events
        Documentation: link in networking docs
        tcp: fix data delivery rate
        bpf/verifier: reject BPF_ALU64|BPF_END
        sctp: do not mark sk dumped when inet_sctp_diag_fill returns err
        sctp: fix an use-after-free issue in sctp_sock_dump
        netvsc: increase default receive buffer size
        tcp: update skb->skb_mstamp more carefully
        net: ipv4: fix l3slave check for index returned in IP_PKTINFO
        net: smsc911x: Quieten netif during suspend
        net: systemport: Fix 64-bit stats deadlock
        net: vrf: avoid gcc-4.6 warning
        qed: remove unnecessary call to memset
        tg3: clean up redundant initialization of tnapi
        tls: make tls_sw_free_resources static
        sctp: potential read out of bounds in sctp_ulpevent_type_enabled()
        MAINTAINERS: review Renesas DT bindings as well
        net_sched: gen_estimator: fix scaling error in bytes/packets samples
        nfp: wait for the NSP resource to appear on boot
        nfp: wait for board state before talking to the NSP
        ...
      48bddb14
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · c8503720
      Linus Torvalds authored
      Pull more input updates from Dmitry Torokhov:
       "A second round of updates for the input subsystem:
      
         - a new driver for PWM-controlled vibrators
      
         - ucb1400 touchscreen driver had completely busted suspend/resume
           handling
      
         - we now handle "home" button found on some devices with Goodix
           touchscreens
      
         - assorted other fixups"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: i8042 - add Gigabyte P57 to the keyboard reset table
        Input: xpad - validate USB endpoint type during probe
        Input: ucb1400_ts - fix suspend and resume handling
        Input: edt-ft5x06 - fix access to non-existing register
        Input: elantech - make arrays debounce_packet static, reduces object code size
        Input: surface3_spi - make const array header static, reduces object code size
        Input: goodix - add support for capacitive home button
        Input: add a driver for PWM controllable vibrators
        Input: adi - make array seq static, reduces object code size
      c8503720
    • Markus Trippelsdorf's avatar
      firmware: Restore support for built-in firmware · df85b2d7
      Markus Trippelsdorf authored
      Commit 5620a0d1 ("firmware: delete in-kernel firmware") removed the
      entire firmware directory.  Unfortunately it thereby also removed the
      support for built-in firmware.
      
      This restores the ability to build firmware directly into the kernel by
      pruning the original Makefile to the necessary minimum.  The default for
      EXTRA_FIRMWARE_DIR is now the standard directory /lib/firmware/.
      
      Fixes: 5620a0d1 ("firmware: delete in-kernel firmware")
      Signed-off-by: default avatarMarkus Trippelsdorf <markus@trippelsdorf.de>
      Acked-by: default avatarGreg K-H <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      df85b2d7
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Only handle IPv4 and IPv6 events · 8e29f979
      Ido Schimmel authored
      The driver doesn't support events from address families other than IPv4
      and IPv6, so ignore them. Otherwise, we risk queueing a work item before
      it's initialized.
      
      This can happen in case a VRF is configured when MROUTE_MULTIPLE_TABLES
      is enabled, as the VRF driver will try to add an l3mdev rule for the
      IPMR family.
      
      Fixes: 65e65ec1 ("mlxsw: spectrum_router: Don't ignore IPv6 notifications")
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reported-by: default avatarAndreas Rammhold <andreas@rammhold.de>
      Reported-by: default avatarFlorian Klink <flokli@flokli.de>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8e29f979
    • Pavel Machek's avatar
      Documentation: link in networking docs · 2130c028
      Pavel Machek authored
      Fix link in filter.txt.
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2130c028
    • Eric Dumazet's avatar
      tcp: fix data delivery rate · fc225799
      Eric Dumazet authored
      Now skb->mstamp_skb is updated later, we also need to call
      tcp_rate_skb_sent() after the update is done.
      
      Fixes: 8c72c65b ("tcp: update skb->skb_mstamp more carefully")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fc225799
    • Linus Torvalds's avatar
      Merge branch '4.14-features' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 73184130
      Linus Torvalds authored
      Pull MIPS updates from Ralf Baechle:
       "This is the main pull request for 4.14 for MIPS; below a summary of
        the non-merge commits:
      
        CM:
         - Rename mips_cm_base to mips_gcr_base
         - Specify register size when generating accessors
         - Use BIT/GENMASK for register fields, order & drop shifts
         - Add cluster & block args to mips_cm_lock_other()
      
        CPC:
         - Use common CPS accessor generation macros
         - Use BIT/GENMASK for register fields, order & drop shifts
         - Introduce register modify (set/clear/change) accessors
         - Use change_*, set_* & clear_* where appropriate
         - Add CM/CPC 3.5 register definitions
         - Use GlobalNumber macros rather than magic numbers
         - Have asm/mips-cps.h include CM & CPC headers
         - Cluster support for topology functions
         - Detect CPUs in secondary clusters
      
        CPS:
         - Read GIC_VL_IDENT directly, not via irqchip driver
      
        DMA:
         - Consolidate coherent and non-coherent dma_alloc code
         - Don't use dma_cache_sync to implement fd_cacheflush
      
        FPU emulation / FP assist code:
         - Another series of 14 commits fixing corner cases such as NaN
           propgagation and other special input values.
         - Zero bits 32-63 of the result for a CLASS.D instruction.
         - Enhanced statics via debugfs
         - Do not use bools for arithmetic. GCC 7.1 moans about this.
         - Correct user fault_addr type
      
        Generic MIPS:
         - Enhancement of stack backtraces
         - Cleanup from non-existing options
         - Handle non word sized instructions when examining frame
         - Fix detection and decoding of ADDIUSP instruction
         - Fix decoding of SWSP16 instruction
         - Refactor handling of stack pointer in get_frame_info
         - Remove unreachable code from force_fcr31_sig()
         - Convert to using %pOF instead of full_name
         - Remove the R6000 support.
         - Move FP code from *_switch.S to *_fpu.S
         - Remove unused ST_OFF from r2300_switch.S
         - Allow platform to specify multiple its.S files
         - Add #includes to various files to ensure code builds reliable and
           without warning..
         - Remove __invalidate_kernel_vmap_range
         - Remove plat_timer_setup
         - Declare various variables & functions static
         - Abstract CPU core & VP(E) ID access through accessor functions
         - Store core & VP IDs in GlobalNumber-style variable
         - Unify checks for sibling CPUs
         - Add CPU cluster number accessors
         - Prevent direct use of generic_defconfig
         - Make CONFIG_MIPS_MT_SMP default y
         - Add __ioread64_copy
         - Remove unnecessary inclusions of linux/irqchip/mips-gic.h
      
        GIC:
         - Introduce asm/mips-gic.h with accessor functions
         - Use new GIC accessor functions in mips-gic-timer
         - Remove counter access functions from irq-mips-gic.c
         - Remove gic_read_local_vp_id() from irq-mips-gic.c
         - Simplify shared interrupt pending/mask reads in irq-mips-gic.c
         - Simplify gic_local_irq_domain_map() in irq-mips-gic.c
         - Drop gic_(re)set_mask() functions in irq-mips-gic.c
         - Remove gic_set_polarity(), gic_set_trigger(), gic_set_dual_edge(),
           gic_map_to_pin() and gic_map_to_vpe() from irq-mips-gic.c.
         - Convert remaining shared reg access, local int mask access and
           remaining local reg access to new accessors
         - Move GIC_LOCAL_INT_* to asm/mips-gic.h
         - Remove GIC_CPU_INT* macros from irq-mips-gic.c
         - Move various definitions to the driver
         - Remove gic_get_usm_range()
         - Remove __gic_irq_dispatch() forward declaration
         - Remove gic_init()
         - Use mips_gic_present() in place of gic_present and remove
           gic_present
         - Move gic_get_c0_*_int() to asm/mips-gic.h
         - Remove linux/irqchip/mips-gic.h
         - Inline __gic_init()
         - Inline gic_basic_init()
         - Make pcpu_masks a per-cpu variable
         - Use pcpu_masks to avoid reading GIC_SH_MASK*
         - Clean up mti, reserved-cpu-vectors handling
         - Use cpumask_first_and() in gic_set_affinity()
         - Let the core set struct irq_common_data affinity
      
        microMIPS:
         - Fix microMIPS stack unwinding on big endian systems
      
        MIPS-GIC:
         - SYNC after enabling GIC region
      
        NUMA:
         - Remove the unused parent_node() macro
      
        R6:
         - Constify r2_decoder_tables
         - Add accessor & bit definitions for GlobalNumber
      
        SMP:
         - Constify smp ops
         - Allow boot_secondary SMP op to return errors
      
        VDSO:
         - Drop gic_get_usm_range() usage
         - Avoid use of linux/irqchip/mips-gic.h
      
        Platform changes:
      
        Alchemy:
         - Add devboard machine type to cpuinfo
         - update cpu feature overrides
         - Threaded carddetect irqs for devboards
      
        AR7:
         - allow NULL clock for clk_get_rate
      
        BCM63xx:
         - Fix ENETDMA_6345_MAXBURST_REG offset
         - Allow NULL clock for clk_get_rate
      
        CI20:
         - Enable GPIO and RTC drivers in defconfig
         - Add ethernet and fixed-regulator nodes to DTS
      
        Generic platform:
         - Move Boston and NI 169445 FIT image source to their own files
         - Include asm/bootinfo.h for plat_fdt_relocated()
         - Include asm/time.h for get_c0_*_int()
         - Include asm/bootinfo.h for plat_fdt_relocated()
         - Include asm/time.h for get_c0_*_int()
         - Allow filtering enabled boards by requirements
         - Don't explicitly disable CONFIG_USB_SUPPORT
         - Bump default NR_CPUS to 16
      
        JZ4700:
         - Probe the jz4740-rtc driver from devicetree
      
        Lantiq:
         - Drop check of boot select from the spi-falcon driver.
         - Drop check of boot select from the lantiq-flash MTD driver.
         - Access boot cause register in the watchdog driver through regmap
         - Add device tree binding documentation for the watchdog driver
         - Add docs for the RCU DT bindings.
         - Convert the fpi bus driver to a platform_driver
         - Remove ltq_reset_cause() and ltq_boot_select(
         - Switch to a proper reset driver
         - Switch to a new drivers/soc GPHY driver
         - Add an USB PHY driver for the Lantiq SoCs using the RCU module
         - Use of_platform_default_populate instead of __dt_register_buses
         - Enable MFD_SYSCON to be able to use it for the RCU MFD
         - Replace ltq_boot_select() with dummy implementation.
      
        Loongson 2F:
         - Allow NULL clock for clk_get_rate
      
        Malta:
         - Use new GIC accessor functions
      
        NI 169445:
         - Add support for NI 169445 board.
         - Only include in 32r2el kernels
      
        Octeon:
         - Add support for watchdog of 78XX SOCs.
         - Add support for watchdog of CN68XX SOCs.
         - Expose support for mips32r1, mips32r2 and mips64r1
         - Enable more drivers in config file
         - Add support for accessing the boot vector.
         - Remove old boot vector code from watchdog driver
         - Define watchdog registers for 70xx, 73xx, 78xx, F75xx.
         - Make CSR functions node aware.
         - Allow access to CIU3 IRQ domains.
         - Misc cleanups in the watchdog driver
      
        Omega2+:
         - New board, add support and defconfig
      
        Pistachio:
         - Enable Root FS on NFS in defconfig
      
        Ralink:
         - Add Mediatek MT7628A SoC
         - Allow NULL clock for clk_get_rate
         - Explicitly request exclusive reset control in the pci-mt7620 PCI driver.
      
        SEAD3:
         - Only include in 32 bit kernels by default
      
        VoCore:
         - Add VoCore as a vendor t0 dt-bindings
         - Add defconfig file"
      
      * '4.14-features' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (167 commits)
        MIPS: Refactor handling of stack pointer in get_frame_info
        MIPS: Stacktrace: Fix microMIPS stack unwinding on big endian systems
        MIPS: microMIPS: Fix decoding of swsp16 instruction
        MIPS: microMIPS: Fix decoding of addiusp instruction
        MIPS: microMIPS: Fix detection of addiusp instruction
        MIPS: Handle non word sized instructions when examining frame
        MIPS: ralink: allow NULL clock for clk_get_rate
        MIPS: Loongson 2F: allow NULL clock for clk_get_rate
        MIPS: BCM63XX: allow NULL clock for clk_get_rate
        MIPS: AR7: allow NULL clock for clk_get_rate
        MIPS: BCM63XX: fix ENETDMA_6345_MAXBURST_REG offset
        mips: Save all registers when saving the frame
        MIPS: Add DWARF unwinding to assembly
        MIPS: Make SAVE_SOME more standard
        MIPS: Fix issues in backtraces
        MIPS: jz4780: DTS: Probe the jz4740-rtc driver from devicetree
        MIPS: Ci20: Enable RTC driver
        watchdog: octeon-wdt: Add support for 78XX SOCs.
        watchdog: octeon-wdt: Add support for cn68XX SOCs.
        watchdog: octeon-wdt: File cleaning.
        ...
      73184130
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.14-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 8d93c7a4
      Linus Torvalds authored
      Pull PCI fix from Bjorn Helgaas:
       "Revert an attempt to fix a race while enabling upstream bridges
        because it broke iwlwifi firmware loading"
      
      * tag 'pci-v4.14-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        Revert "PCI: Avoid race while enabling upstream bridges"
      8d93c7a4
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.14-rc1' of git://people.freedesktop.org/~airlied/linux · 02cfe977
      Linus Torvalds authored
      Pull drm AMD fixes from Dave Airlie:
       "Just had a single AMD fixes pull from Alex for rc1"
      
      * tag 'drm-fixes-for-v4.14-rc1' of git://people.freedesktop.org/~airlied/linux:
        drm/amdgpu: revert "fix deadlock of reservation between cs and gpu reset v2"
        drm/amdgpu: remove duplicate return statement
        drm/amdgpu: check memory allocation failure
        drm/amd/amdgpu: fix BANK_SELECT on Vega10 (v2)
        drm/amdgpu: inline amdgpu_ttm_do_bind again
        drm/amdgpu: fix amdgpu_ttm_bind
        drm/amdgpu: remove the GART copy hack
        drm/ttm:fix wrong decoding of bo_count
        drm/ttm: fix missing inc bo_count
        drm/amdgpu: set sched_hw_submission higher for KIQ (v3)
        drm/amdgpu: move default gart size setting into gmc modules
        drm/amdgpu: refine default gart size
        drm/amd/powerplay: ACG frequency added in PPTable
        drm/amdgpu: discard commands of killed processes
        drm/amdgpu: fix and cleanup shadow handling
        drm/amdgpu: add automatic per asic settings for gart_size
        drm/amdgpu/gfx8: fix spelling typo in mqd allocation
        drm/amd/powerplay: unhalt mec after loading
        drm/amdgpu/virtual_dce: Virtual display doesn't support disable vblank immediately
        drm/amdgpu: Fix huge page updates with CPU
      02cfe977
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · bbe05e54
      Linus Torvalds authored
      Pull more i2c updates from Wolfram Sang:
       "I2C has two more new drivers: Altera FPGA and STM32F7"
      
      * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: i2c-stm32f7: add driver
        i2c: i2c-stm32f4: use generic definition of speed enum
        dt-bindings: i2c-stm32: Document the STM32F7 I2C bindings
        i2c: altera: Add Altera I2C Controller driver
        dt-bindings: i2c: Add Altera I2C Controller
      bbe05e54
  3. 15 Sep, 2017 4 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 9db59599
      Linus Torvalds authored
      Pull more KVM updates from Paolo Bonzini:
       - PPC bugfixes
       - RCU splat fix
       - swait races fix
       - pointless userspace-triggerable BUG() fix
       - misc fixes for KVM_RUN corner cases
       - nested virt correctness fixes + one host DoS
       - some cleanups
       - clang build fix
       - fix AMD AVIC with default QEMU command line options
       - x86 bugfixes
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (28 commits)
        kvm: nVMX: Handle deferred early VMLAUNCH/VMRESUME failure properly
        kvm: vmx: Handle VMLAUNCH/VMRESUME failure properly
        kvm: nVMX: Remove nested_vmx_succeed after successful VM-entry
        kvm,mips: Fix potential swait_active() races
        kvm,powerpc: Serialize wq active checks in ops->vcpu_kick
        kvm: Serialize wq active checks in kvm_vcpu_wake_up()
        kvm,x86: Fix apf_task_wake_one() wq serialization
        kvm,lapic: Justify use of swait_active()
        kvm,async_pf: Use swq_has_sleeper()
        sched/wait: Add swq_has_sleeper()
        KVM: VMX: Do not BUG() on out-of-bounds guest IRQ
        KVM: Don't accept obviously wrong gsi values via KVM_IRQFD
        kvm: nVMX: Don't allow L2 to access the hardware CR8
        KVM: trace events: update list of exit reasons
        KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously
        KVM: X86: Don't block vCPU if there is pending exception
        KVM: SVM: Add irqchip_split() checks before enabling AVIC
        KVM: Add struct kvm_vcpu pointer parameter to get_enable_apicv()
        KVM: SVM: Refactor AVIC vcpu initialization into avic_init_vcpu()
        KVM: x86: fix clang build
        ...
      9db59599
    • Edward Cree's avatar
      bpf/verifier: reject BPF_ALU64|BPF_END · e67b8a68
      Edward Cree authored
      Neither ___bpf_prog_run nor the JITs accept it.
      Also adds a new test case.
      
      Fixes: 17a52670 ("bpf: verifier (add verifier core)")
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e67b8a68
    • Xin Long's avatar
      sctp: do not mark sk dumped when inet_sctp_diag_fill returns err · 8c7c19a5
      Xin Long authored
      sctp_diag would not actually dump out sk/asoc if inet_sctp_diag_fill
      returns err, in which case it shouldn't mark sk dumped by setting
      cb->args[3] as 1 in sctp_sock_dump().
      
      Otherwise, it could cause some asocs to have no parent's sk dumped
      in 'ss --sctp'.
      
      So this patch is to not set cb->args[3] when inet_sctp_diag_fill()
      returns err in sctp_sock_dump().
      
      Fixes: 8f840e47 ("sctp: add the sctp_diag.c file")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8c7c19a5
    • Xin Long's avatar
      sctp: fix an use-after-free issue in sctp_sock_dump · d25adbeb
      Xin Long authored
      Commit 86fdb344 ("sctp: ensure ep is not destroyed before doing the
      dump") tried to fix an use-after-free issue by checking !sctp_sk(sk)->ep
      with holding sock and sock lock.
      
      But Paolo noticed that endpoint could be destroyed in sctp_rcv without
      sock lock protection. It means the use-after-free issue still could be
      triggered when sctp_rcv put and destroy ep after sctp_sock_dump checks
      !ep, although it's pretty hard to reproduce.
      
      I could reproduce it by mdelay in sctp_rcv while msleep in sctp_close
      and sctp_sock_dump long time.
      
      This patch is to add another param cb_done to sctp_for_each_transport
      and dump ep->assocs with holding tsp after jumping out of transport's
      traversal in it to avoid this issue.
      
      It can also improve sctp diag dump to make it run faster, as no need
      to save sk into cb->args[5] and keep calling sctp_for_each_transport
      any more.
      
      This patch is also to use int * instead of int for the pos argument
      in sctp_for_each_transport, which could make postion increment only
      in sctp_for_each_transport and no need to keep changing cb->args[2]
      in sctp_sock_filter and sctp_sock_dump any more.
      
      Fixes: 86fdb344 ("sctp: ensure ep is not destroyed before doing the dump")
      Reported-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d25adbeb