1. 28 5月, 2016 1 次提交
    • A
      remove lots of IS_ERR_VALUE abuses · 287980e4
      Arnd Bergmann 提交于
      Most users of IS_ERR_VALUE() in the kernel are wrong, as they
      pass an 'int' into a function that takes an 'unsigned long'
      argument. This happens to work because the type is sign-extended
      on 64-bit architectures before it gets converted into an
      unsigned type.
      
      However, anything that passes an 'unsigned short' or 'unsigned int'
      argument into IS_ERR_VALUE() is guaranteed to be broken, as are
      8-bit integers and types that are wider than 'unsigned long'.
      
      Andrzej Hajda has already fixed a lot of the worst abusers that
      were causing actual bugs, but it would be nice to prevent any
      users that are not passing 'unsigned long' arguments.
      
      This patch changes all users of IS_ERR_VALUE() that I could find
      on 32-bit ARM randconfig builds and x86 allmodconfig. For the
      moment, this doesn't change the definition of IS_ERR_VALUE()
      because there are probably still architecture specific users
      elsewhere.
      
      Almost all the warnings I got are for files that are better off
      using 'if (err)' or 'if (err < 0)'.
      The only legitimate user I could find that we get a warning for
      is the (32-bit only) freescale fman driver, so I did not remove
      the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
      For 9pfs, I just worked around one user whose calling conventions
      are so obscure that I did not dare change the behavior.
      
      I was using this definition for testing:
      
       #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
             unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
      
      which ends up making all 16-bit or wider types work correctly with
      the most plausible interpretation of what IS_ERR_VALUE() was supposed
      to return according to its users, but also causes a compile-time
      warning for any users that do not pass an 'unsigned long' argument.
      
      I suggested this approach earlier this year, but back then we ended
      up deciding to just fix the users that are obviously broken. After
      the initial warning that caused me to get involved in the discussion
      (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
      asked me to send the whole thing again.
      
      [ Updated the 9p parts as per Al Viro  - Linus ]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Link: https://lkml.org/lkml/2016/1/7/363
      Link: https://lkml.org/lkml/2016/5/27/486
      Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      287980e4
  2. 12 5月, 2016 1 次提交
  3. 12 4月, 2016 1 次提交
  4. 08 4月, 2016 1 次提交
  5. 10 3月, 2016 2 次提交
  6. 12 2月, 2016 1 次提交
  7. 29 1月, 2016 3 次提交
  8. 14 1月, 2016 1 次提交
  9. 31 12月, 2015 2 次提交
    • U
      wlcore/wl12xx: spi: fix NULL pointer dereference (Oops) · e47301b0
      Uri Mashiach 提交于
      Fix the below Oops when trying to modprobe wlcore_spi.
      The oops occurs because the wl1271_power_{off,on}()
      function doesn't check the power() function pointer.
      
      [   23.401447] Unable to handle kernel NULL pointer dereference at
      virtual address 00000000
      [   23.409954] pgd = c0004000
      [   23.412922] [00000000] *pgd=00000000
      [   23.416693] Internal error: Oops: 80000007 [#1] SMP ARM
      [   23.422168] Modules linked in: wl12xx wlcore mac80211 cfg80211
      musb_dsps musb_hdrc usbcore usb_common snd_soc_simple_card evdev joydev
      omap_rng wlcore_spi snd_soc_tlv320aic23_i2c rng_core snd_soc_tlv320aic23
      c_can_platform c_can can_dev snd_soc_davinci_mcasp snd_soc_edma
      snd_soc_omap omap_wdt musb_am335x cpufreq_dt thermal_sys hwmon
      [   23.453253] CPU: 0 PID: 36 Comm: kworker/0:2 Not tainted
      4.2.0-00002-g951efee-dirty #233
      [   23.461720] Hardware name: Generic AM33XX (Flattened Device Tree)
      [   23.468123] Workqueue: events request_firmware_work_func
      [   23.473690] task: de32efc0 ti: de4ee000 task.ti: de4ee000
      [   23.479341] PC is at 0x0
      [   23.482112] LR is at wl12xx_set_power_on+0x28/0x124 [wlcore]
      [   23.488074] pc : [<00000000>]    lr : [<bf2581f0>]    psr: 60000013
      [   23.488074] sp : de4efe50  ip : 00000002  fp : 00000000
      [   23.500162] r10: de7cdd00  r9 : dc848800  r8 : bf27af00
      [   23.505663] r7 : bf27a1a8  r6 : dcbd8a80  r5 : dce0e2e0  r4 :
      dce0d2e0
      [   23.512536] r3 : 00000000  r2 : 00000000  r1 : 00000001  r0 :
      dc848810
      [   23.519412] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
      Segment kernel
      [   23.527109] Control: 10c5387d  Table: 9cb78019  DAC: 00000015
      [   23.533160] Process kworker/0:2 (pid: 36, stack limit = 0xde4ee218)
      [   23.539760] Stack: (0xde4efe50 to 0xde4f0000)
      
      [...]
      
      [   23.665030] [<bf2581f0>] (wl12xx_set_power_on [wlcore]) from
      [<bf25f7ac>] (wlcore_nvs_cb+0x118/0xa4c [wlcore])
      [   23.675604] [<bf25f7ac>] (wlcore_nvs_cb [wlcore]) from [<c04387ec>]
      (request_firmware_work_func+0x30/0x58)
      [   23.685784] [<c04387ec>] (request_firmware_work_func) from
      [<c0058e2c>] (process_one_work+0x1b4/0x4b4)
      [   23.695591] [<c0058e2c>] (process_one_work) from [<c0059168>]
      (worker_thread+0x3c/0x4a4)
      [   23.704124] [<c0059168>] (worker_thread) from [<c005ee68>]
      (kthread+0xd4/0xf0)
      [   23.711747] [<c005ee68>] (kthread) from [<c000f598>]
      (ret_from_fork+0x14/0x3c)
      [   23.719357] Code: bad PC value
      [   23.722760] ---[ end trace 981be8510db9b3a9 ]---
      
      Prevent oops by validationg power() pointer value before
      calling the function.
      Signed-off-by: NUri Mashiach <uri.mashiach@compulab.co.il>
      Cc: stable@vger.kernel.org
      Acked-by: NIgor Grinberg <grinberg@compulab.co.il>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      e47301b0
    • S
      wlcore/wl18xx: fw logger over sdio · 3719c17e
      Shahar Patury 提交于
      Enable the FW Logger to work over the SDIO interface in addition to over UART
      interface. In the new design we use fw internal memory instead of packet ram
      that was used in older (wl12xx) design. This change reduces the impact on TP
      and stability.
      
      A new event was added to notify fw logger is ready for reading. Dynamic
      configuration to debugfs was added as well.
      Signed-off-by: NShahar Patury <shaharp@ti.com>
      Signed-off-by: NGuy Mishol <guym@ti.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      3719c17e
  10. 23 12月, 2015 1 次提交
  11. 11 12月, 2015 2 次提交
    • U
      wlcore/wl12xx: spi: fix oops on firmware load · 9b2761cb
      Uri Mashiach 提交于
      The maximum chunks used by the function is
      (SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE + 1).
      The original commands array had space for
      (SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) commands.
      When the last chunk is used (len > 4 * WSPI_MAX_CHUNK_SIZE), the last
      command is stored outside the bounds of the commands array.
      
      Oops 5 (page fault) is generated during current wl1271 firmware load
      attempt:
      
      root@debian-armhf:~# ifconfig wlan0 up
      [  294.312399] Unable to handle kernel paging request at virtual address
      00203fc4
      [  294.320173] pgd = de528000
      [  294.323028] [00203fc4] *pgd=00000000
      [  294.326916] Internal error: Oops: 5 [#1] SMP ARM
      [  294.331789] Modules linked in: bnep rfcomm bluetooth ipv6 arc4 wl12xx
      wlcore mac80211 musb_dsps cfg80211 musb_hdrc usbcore usb_common
      wlcore_spi omap_rng rng_core musb_am335x omap_wdt cpufreq_dt thermal_sys
      hwmon
      [  294.351838] CPU: 0 PID: 1827 Comm: ifconfig Not tainted
      4.2.0-00002-g3e9ad27-dirty #78
      [  294.360154] Hardware name: Generic AM33XX (Flattened Device Tree)
      [  294.366557] task: dc9d6d40 ti: de550000 task.ti: de550000
      [  294.372236] PC is at __spi_validate+0xa8/0x2ac
      [  294.376902] LR is at __spi_sync+0x78/0x210
      [  294.381200] pc : [<c049c760>]    lr : [<c049ebe0>]    psr: 60000013
      [  294.381200] sp : de551998  ip : de5519d8  fp : 00200000
      [  294.393242] r10: de551c8c  r9 : de5519d8  r8 : de3a9000
      [  294.398730] r7 : de3a9258  r6 : de3a9400  r5 : de551a48  r4 :
      00203fbc
      [  294.405577] r3 : 00000000  r2 : 00000000  r1 : 00000000  r0 :
      de3a9000
      [  294.412420] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
      Segment user
      [  294.419918] Control: 10c5387d  Table: 9e528019  DAC: 00000015
      [  294.425954] Process ifconfig (pid: 1827, stack limit = 0xde550218)
      [  294.432437] Stack: (0xde551998 to 0xde552000)
      
      ...
      
      [  294.883613] [<c049c760>] (__spi_validate) from [<c049ebe0>]
      (__spi_sync+0x78/0x210)
      [  294.891670] [<c049ebe0>] (__spi_sync) from [<bf036598>]
      (wl12xx_spi_raw_write+0xfc/0x148 [wlcore_spi])
      [  294.901661] [<bf036598>] (wl12xx_spi_raw_write [wlcore_spi]) from
      [<bf21c694>] (wlcore_boot_upload_firmware+0x1ec/0x458 [wlcore])
      [  294.914038] [<bf21c694>] (wlcore_boot_upload_firmware [wlcore]) from
      [<bf24532c>] (wl12xx_boot+0xc10/0xfac [wl12xx])
      [  294.925161] [<bf24532c>] (wl12xx_boot [wl12xx]) from [<bf20d5cc>]
      (wl1271_op_add_interface+0x5b0/0x910 [wlcore])
      [  294.936364] [<bf20d5cc>] (wl1271_op_add_interface [wlcore]) from
      [<bf15c4ac>] (ieee80211_do_open+0x44c/0xf7c [mac80211])
      [  294.947963] [<bf15c4ac>] (ieee80211_do_open [mac80211]) from
      [<c0537978>] (__dev_open+0xa8/0x110)
      [  294.957307] [<c0537978>] (__dev_open) from [<c0537bf8>]
      (__dev_change_flags+0x88/0x148)
      [  294.965713] [<c0537bf8>] (__dev_change_flags) from [<c0537cd0>]
      (dev_change_flags+0x18/0x48)
      [  294.974576] [<c0537cd0>] (dev_change_flags) from [<c05a55a0>]
      (devinet_ioctl+0x6b4/0x7d0)
      [  294.983191] [<c05a55a0>] (devinet_ioctl) from [<c0517040>]
      (sock_ioctl+0x1e4/0x2bc)
      [  294.991244] [<c0517040>] (sock_ioctl) from [<c017d378>]
      (do_vfs_ioctl+0x420/0x6b0)
      [  294.999208] [<c017d378>] (do_vfs_ioctl) from [<c017d674>]
      (SyS_ioctl+0x6c/0x7c)
      [  295.006880] [<c017d674>] (SyS_ioctl) from [<c000f4c0>]
      (ret_fast_syscall+0x0/0x54)
      [  295.014835] Code: e1550004 e2444034 0a00007d e5953018 (e5942008)
      [  295.021544] ---[ end trace 66ed188198f4e24e ]---
      Signed-off-by: NUri Mashiach <uri.mashiach@compulab.co.il>
      Acked-by: NIgor Grinberg <grinberg@compulab.co.il>
      Cc: stable@vger.kernel.org
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      9b2761cb
    • G
      wlcore: split wl12xx/wl18xx sg parameters · 133b7326
      Guy Mishol 提交于
      Align to new wl18xx sg parameters.
      This requires to split both wl12xx/wl18xx enumerators.
      Signed-off-by: NGuy Mishol <guym@ti.com>
      Acked-by: NEliad Peller <eliad@wizery.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      133b7326
  12. 18 11月, 2015 1 次提交
    • K
      ti: unify Kconfig with other vendors · bd842171
      Kalle Valo 提交于
      Rename WL_TI to WLAN_VENDOR_TI to match with other vendor configs and make sure
      that it's enabled by default in new configs. Convert menuconfigs to regular
      configs to unify the wireless drivers menuconfig. Part of reorganising wireless
      drivers directory and Kconfig.
      
      Also remove WLCORE dependency to WL_TI. It should not be needed as WLCORE is
      already under if  WLAN_VENDOR_TI.
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      bd842171
  13. 28 10月, 2015 1 次提交
  14. 29 9月, 2015 1 次提交
    • G
      wlcore: align reg_ch_conf_last[] to 64bit · 32677b25
      Guodong Xu 提交于
      Align fields reg_ch_conf_last and reg_ch_conf_pending of
      struct wl1271{} to 64bit.
      
      Without this, on 64bit ARM, wlcore_set_pending_regdomain_ch() fails at
      the point it calls set_bit(ch_bit_idx, (long*)wl->reg_ch_conf_pending);
      Here is the error message while doing iw wlan0 scan or connect:
      
      [   10.666857] wlcore: IRQ work
      [   10.670046] wlcore: intr: 0x40 (fw_rx_counter = 1, drv_rx_counter = 0, tx_results_counter = 0)
      [   10.678697] wlcore: WL1271_ACX_INTR_DATA
      [   10.682810] Unhandled fault: alignment fault (0x96000021) at 0xffffffc037a817f4
      [   10.690139] Internal error: : 96000021 [#1] PREEMPT SMP
      [   10.695366] Modules linked in:
      [   10.698437] CPU: 3 PID: 894 Comm: irq/60-wl18xx Tainted: G        W       4.2.0-rc6-linaro-hikey #2
      [   10.707501] Hardware name: HiKey Development Board (DT)
      [   10.712733] task: ffffffc03a9d1680 ti: ffffffc039e18000 task.ti: ffffffc039e18000
      [   10.720239] PC is at set_bit+0x14/0x30
      [   10.724002] LR is at wlcore_set_pending_regdomain_ch+0x40/0x4c
      Signed-off-by: NGuodong Xu <guodong.xu@linaro.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      32677b25
  15. 22 9月, 2015 1 次提交
  16. 11 8月, 2015 3 次提交
    • E
      wlcore: add p2p device support · 7845af35
      Eliad Peller 提交于
      When starting a p2p mgmt interface, enable its device role. This
      allows us to keep the sta role disabled and scan on the dev role.
      
      In general, p2p management interfaces cannot send vif-specific commands
      to FW, as the vif role id is invalid. Only off-channel data and scans
      happen on this vif, so most ops are not relevant.
      
      If the vif is a p2p mgmt vif, block some mac80211 ops.
      
      Configure rate policies for p2p mgmt interface, as
      otherwise p2p packets come out with arbitrary rates.
      
      Since wpa_supplicant currently doesn't support standalone
      p2p device mode (without another attached managed interface),
      add p2p device to the allowed interface combinations without
      decreasing the allowed station count.
      
      Moreover, increase the station count in some cases, as AP
      mode usually starts as station interface, and the AP interface
      is now different from the p2p management one).
      Signed-off-by: NArik Nemtsov <arik@wizery.com>
      Signed-off-by: NEliad Peller <eliad@wizery.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      7845af35
    • E
      wlcore: add generic_cfg_feature command definitions · c32e35f2
      Eliad Peller 提交于
      Add definitions and function prototypes for generic_cfg
      command.
      Signed-off-by: NEliad Peller <eliad@wizery.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      c32e35f2
    • E
      wl18xx: use long intervals in sched scan · 8698a3a4
      Eliad Peller 提交于
      Add support for long intervals on sched scan.
      
      If configured, the original request interval will
      be used num_short_interval times, and then the
      long interval will be used.
      
      While on it, fix the scan command field names
      to reflect the expected value is in ms (rather
      than secs).
      
      These values will be taken from the conf file,
      so bump its version accordingly.
      Signed-off-by: NEyal Shapira <eyal@wizery.com>
      Signed-off-by: NEliad Peller <eliad@wizery.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      8698a3a4
  17. 06 8月, 2015 2 次提交
  18. 21 7月, 2015 2 次提交
  19. 10 6月, 2015 1 次提交
    • J
      mac80211: convert HW flags to unsigned long bitmap · 30686bf7
      Johannes Berg 提交于
      As we're running out of hardware capability flags pretty quickly,
      convert them to use the regular test_bit() style unsigned long
      bitmaps.
      
      This introduces a number of helper functions/macros to set and to
      test the bits, along with new debugfs code.
      
      The occurrences of an explicit __clear_bit() are intentional, the
      drivers were never supposed to change their supported bits on the
      fly. We should investigate changing this to be a per-frame flag.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      30686bf7
  20. 09 5月, 2015 1 次提交
  21. 24 4月, 2015 1 次提交
    • J
      mac80211: remove support for IFF_PROMISC · df140465
      Johannes Berg 提交于
      This support is essentially useless as typically networks are encrypted,
      frames will be filtered by hardware, and rate scaling will be done with
      the intended recipient in mind. For real monitoring of the network, the
      monitor mode support should be used instead.
      
      Removing it removes a lot of corner cases.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      df140465
  22. 22 4月, 2015 1 次提交
  23. 25 3月, 2015 2 次提交
  24. 20 3月, 2015 1 次提交
  25. 17 3月, 2015 1 次提交
  26. 04 3月, 2015 1 次提交
  27. 24 1月, 2015 2 次提交
  28. 09 1月, 2015 2 次提交