1. 21 Nov, 2014 1 commit
  2. 05 Sep, 2014 3 commits
  3. 07 Jul, 2014 2 commits
  4. 16 Jun, 2014 1 commit
  5. 07 Jun, 2014 1 commit
  6. 06 May, 2014 1 commit
  7. 07 Mar, 2014 1 commit
    • Chao Bi's avatar
      mei: set client's read_cb to NULL when flow control fails · 2bc744aa
      Chao Bi authored
      commit accb884b32e82f943340688c9cd30290531e73e0 upstream.
      
      In mei_cl_read_start(), if it fails to send flow control request, it
      will release "cl->read_cb" but forget to set pointer to NULL, leaving
      "cl->read_cb" still pointing to random memory, next time this client is
      operated like mei_release(), it has chance to refer to this wrong pointer.
      
      Fixes:  PANIC at kfree in mei_release()
      
      [228781.826904] Call Trace:
      [228781.829737]  [<c16249b8>] ? mei_cl_unlink+0x48/0xa0
      [228781.835283]  [<c1624487>] mei_io_cb_free+0x17/0x30
      [228781.840733]  [<c16265d8>] mei_release+0xa8/0x180
      [228781.845989]  [<c135c610>] ? __fsnotify_parent+0xa0/0xf0
      [228781.851925]  [<c1325a69>] __fput+0xd9/0x200
      [228781.856696]  [<c1325b9d>] ____fput+0xd/0x10
      [228781.861467]  [<c125cae1>] task_work_run+0x81/0xb0
      [228781.866821]  [<c1242e53>] do_exit+0x283/0xa00
      [228781.871786]  [<c1a82b36>] ? kprobe_flush_task+0x66/0xc0
      [228781.877722]  [<c124eeb8>] ? __dequeue_signal+0x18/0x1a0
      [228781.883657]  [<c124f072>] ? dequeue_signal+0x32/0x190
      [228781.889397]  [<c1243744>] do_group_exit+0x34/0xa0
      [228781.894750]  [<c12517b6>] get_signal_to_deliver+0x206/0x610
      [228781.901075]  [<c12018d8>] do_signal+0x38/0x100
      [228781.906136]  [<c1626d1c>] ? mei_read+0x42c/0x4e0
      [228781.911393]  [<c12600a0>] ? wake_up_bit+0x30/0x30
      [228781.916745]  [<c16268f0>] ? mei_poll+0x120/0x120
      [228781.922001]  [<c1324be9>] ? vfs_read+0x89/0x160
      [228781.927158]  [<c16268f0>] ? mei_poll+0x120/0x120
      [228781.932414]  [<c133ca34>] ? fget_light+0x44/0xe0
      [228781.937670]  [<c1324e58>] ? SyS_read+0x68/0x80
      [228781.942730]  [<c12019f5>] do_notify_resume+0x55/0x70
      [228781.948376]  [<c1a7de5d>] work_notifysig+0x29/0x30
      [228781.953827]  [<c1a70000>] ? bad_area+0x5/0x3e
      Signed-off-by: default avatarChao Bi <chao.bi@intel.com>
      Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2bc744aa
  8. 22 Feb, 2014 2 commits
    • Alexander Usyskin's avatar
      mei: don't unset read cb ptr on reset · 24a50910
      Alexander Usyskin authored
      commit 5cb906c7035f03a3a44fecece9d3ff8fcc75d6e0 upstream.
      
      Don't set read callback to NULL during reset as
      this leads to memory leak of both cb and its buffer.
      The memory is correctly freed during mei_release.
      
      The memory leak is detectable by kmemleak if
      application has open read call while system is going through
      suspend/resume.
      
      unreferenced object 0xecead780 (size 64):
        comm "AsyncTask #1", pid 1018, jiffies 4294949621 (age 152.440s)
        hex dump (first 32 bytes):
          00 01 10 00 00 02 20 00 00 bf 30 f1 00 00 00 00  ...... ...0.....
          00 00 00 00 00 00 00 00 36 01 00 00 00 70 da e2  ........6....p..
        backtrace:
          [<c1a60aec>] kmemleak_alloc+0x3c/0xa0
          [<c131ed56>] kmem_cache_alloc_trace+0xc6/0x190
          [<c16243c9>] mei_io_cb_init+0x29/0x50
          [<c1625722>] mei_cl_read_start+0x102/0x360
          [<c16268f3>] mei_read+0x103/0x4e0
          [<c1324b09>] vfs_read+0x89/0x160
          [<c1324d5f>] SyS_read+0x4f/0x80
          [<c1a7b318>] syscall_call+0x7/0xb
          [<ffffffff>] 0xffffffff
      unreferenced object 0xe2da7000 (size 512):
        comm "AsyncTask #1", pid 1018, jiffies 4294949621 (age 152.440s)
        hex dump (first 32 bytes):
          00 6c da e2 7c 00 00 00 00 00 00 00 c0 eb 0c 59  .l..|..........Y
          1b 00 00 00 01 00 00 00 02 10 00 00 01 00 00 00  ................
        backtrace:
          [<c1a60aec>] kmemleak_alloc+0x3c/0xa0
          [<c131f127>] __kmalloc+0xe7/0x1d0
          [<c162447e>] mei_io_cb_alloc_resp_buf+0x2e/0x60
          [<c162574c>] mei_cl_read_start+0x12c/0x360
          [<c16268f3>] mei_read+0x103/0x4e0
          [<c1324b09>] vfs_read+0x89/0x160
          [<c1324d5f>] SyS_read+0x4f/0x80
          [<c1a7b318>] syscall_call+0x7/0xb
          [<ffffffff>] 0xffffffff
      Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
      Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      24a50910
    • Alexander Usyskin's avatar
      mei: clear write cb from waiting list on reset · 85153361
      Alexander Usyskin authored
      commit 30c54df7cb9b15b222529a028390b9c9582dd65e upstream.
      
      Clear write callbacks sitting in write_waiting list on reset.
      Otherwise these callbacks are left dangling and cause memory leak.
      Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
      Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      85153361
  9. 12 Dec, 2013 3 commits
  10. 29 Nov, 2013 1 commit
  11. 20 Nov, 2013 1 commit
  12. 05 Oct, 2013 3 commits
  13. 08 Sep, 2013 2 commits
  14. 29 Aug, 2013 3 commits
  15. 14 Jun, 2013 3 commits
    • Tomas Winkler's avatar
      mei: me: clear interrupts on the resume path · 42f132fe
      Tomas Winkler authored
      We need to clear pending interrupts on the resume
      path. This brings the device into defined state
      before starting the reset flow
      
      This should solve suspend/resume issues:
      
      mei_me : wait hw ready failed. status = 0x0
      mei_me : version message write failed
      Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      42f132fe
    • Tomas Winkler's avatar
      mei: nfc: fix nfc device freeing · 2753ff53
      Tomas Winkler authored
      The nfc_dev is a static variable and is not cleaned properly upon reset
      mainly ndev->cl and ndev->cl_info are not set to NULL after freeing which
      
      mei_stop:198: mei_me 0000:00:16.0: stopping the device.
      [  404.253427] general protection fault: 0000 [#2] SMP
      [  404.253437] Modules linked in: mei_me(-) binfmt_misc snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device edd af_packet cpufreq_conservative cpufreq_userspace cpufreq_powersave fuse loop dm_mod hid_generic usbhid hid coretemp acpi_cpufreq mperf kvm_intel kvm crc32c_intel ghash_clmulni_intel aesni_intel ablk_helper cryptd lrw gf128mul snd_hda_codec_hdmi glue_helper aes_x86_64 e1000e snd_hda_intel snd_hda_codec ehci_pci iTCO_wdt iTCO_vendor_support ehci_hcd snd_hwdep xhci_hcd snd_pcm usbcore ptp mei sg microcode snd_timer pps_core i2c_i801 snd pcspkr battery rtc_cmos lpc_ich mfd_core soundcore usb_common snd_page_alloc ac ext3 jbd mbcache drm_kms_helper drm intel_agp i2c_algo_bit intel_gtt i2c_core sd_mod crc_t10dif thermal fan video button processor thermal_sys hwmon ahci libahci libata scsi_mod [last unloaded: mei_me]
      [  404.253591] CPU: 0 PID: 5551 Comm: modprobe Tainted: G      D W    3.10.0-rc3 #1
      [  404.253611] task: ffff880143cd8300 ti: ffff880144a2a000 task.ti: ffff880144a2a000
      [  404.253619] RIP: 0010:[<ffffffff81334e5d>]  [<ffffffff81334e5d>] device_del+0x1d/0x1d0
      [  404.253638] RSP: 0018:ffff880144a2bcf8  EFLAGS: 00010206
      [  404.253645] RAX: 2020302e30202030 RBX: ffff880144fdb000 RCX: 0000000000000086
      [  404.253652] RDX: 0000000000000001 RSI: 0000000000000086 RDI: ffff880144fdb000
      [  404.253659] RBP: ffff880144a2bd18 R08: 0000000000000651 R09: 0000000000000006
      [  404.253666] R10: 0000000000000651 R11: 0000000000000006 R12: ffff880144fdb000
      [  404.253673] R13: ffff880149371098 R14: ffff880144482c00 R15: ffffffffa04710e0
      [  404.253681] FS:  00007f251c59a700(0000) GS:ffff88014e200000(0000) knlGS:0000000000000000
      [  404.253689] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  404.253696] CR2: ffffffffff600400 CR3: 0000000145319000 CR4: 00000000001407f0
      [  404.253703] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  404.253710] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  404.253716] Stack:
      [  404.253720]  ffff880144fdb000 ffff880143ffe000 ffff880149371098 ffffffffa0471000
      [  404.253732]  ffff880144a2bd38 ffffffff8133502d ffff88014e20cf48 ffff880143ffe1d8
      [  404.253744]  ffff880144a2bd48 ffffffffa02a4749 ffff880144a2bd58 ffffffffa02a4ba1
      [  404.253755] Call Trace:
      [  404.253766]  [<ffffffff8133502d>] device_unregister+0x1d/0x60
      [  404.253787]  [<ffffffffa02a4749>] mei_cl_remove_device+0x9/0x10 [mei]
      [  404.253804]  [<ffffffffa02a4ba1>] mei_nfc_host_exit+0x21/0x30 [mei]
      [  404.253819]  [<ffffffffa029c2dd>] mei_stop+0x3d/0x90 [mei]
      [  404.253830]  [<ffffffffa046e220>] mei_me_remove+0x60/0xe0 [mei_me]
      [  404.253843]  [<ffffffff81278f37>] pci_device_remove+0x37/0xb0
      [  404.253855]  [<ffffffff81337c68>] __device_release_driver+0x98/0x100
      [  404.253865]  [<ffffffff81337d80>] driver_detach+0xb0/0xc0
      [  404.253876]  [<ffffffff81336b4f>] bus_remove_driver+0x8f/0x120
      [  404.253891]  [<ffffffff81075990>] ? try_to_wake_up+0x2b0/0x2b0
      [  404.253903]  [<ffffffff81338a48>] driver_unregister+0x58/0x90
      [  404.253913]  [<ffffffff8127906b>] pci_unregister_driver+0x2b/0xb0
      [  404.253924]  [<ffffffffa046f244>] mei_me_driver_exit+0x10/0xdcc [mei_me]
      [  404.253936]  [<ffffffff810a50d8>] SyS_delete_module+0x198/0x2b0
      [  404.253949]  [<ffffffff814850d9>] ? do_page_fault+0x9/0x10
      [  404.253961]  [<ffffffff81489692>] system_call_fastpath+0x16/0x1b
      [  404.253967] Code: 41 5c 41 5d 41 5e 41 5f c9 c3 0f 1f 40 00 55 48 89 e5 41 56 41 55 41 54 49 89 fc 53 48 8b 87 88 00 00 00 4c 8b 37 48 85 c0 74 18 <48> 8b 78 78 4c 89 e2 be 02 00 00 00 48 81 c7 f8 00 00 00 e8 3b
      [  404.254048] RIP  [<ffffffff81334e5d>] device_del+0x1d/0x1d0
      
      Cc: Samuel Ortiz <sameo@linux.intel.com>
      Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2753ff53
    • Samuel Ortiz's avatar
      mei: init: Flush scheduled work before resetting the device · 5e85b364
      Samuel Ortiz authored
      Flushing pending work items before resetting the device makes more
      sense than doing so afterwards. Some of them, like e.g. the NFC
      initialization one, find themselves with client IDs changed after
      the reset, eventually leading to trigger a client.c:mei_me_cl_by_id()
      warning after a few modprobe/rmmod cycles.
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5e85b364
  16. 12 Jun, 2013 1 commit
  17. 21 May, 2013 2 commits
  18. 20 May, 2013 1 commit
  19. 18 May, 2013 1 commit
  20. 17 May, 2013 1 commit
  21. 01 May, 2013 1 commit
  22. 30 Apr, 2013 1 commit
    • Philipp Zabel's avatar
      misc: generic on-chip SRAM allocation driver · 4984c6f5
      Philipp Zabel authored
      This driver requests and remaps a memory region as configured in the
      device tree.  It serves memory from this region via the genalloc API.  It
      optionally enables the SRAM clock.
      
      Other drivers can retrieve the genalloc pool from a phandle pointing to
      this drivers' device node in the device tree.
      
      The allocation granularity is hard-coded to 32 bytes for now, to make the
      SRAM driver useful for the 6502 remoteproc driver.  There is overhead for
      bigger SRAMs, where only a much coarser allocation granularity is needed:
      At 32 bytes minimum allocation size, a 256 KiB SRAM needs a 1 KiB bitmap
      to track allocations.
      
      [akpm@linux-foundation.org: fix Kconfig text, make sram_init static]
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      Reviewed-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Tested-by: default avatarMichal Simek <monstr@monstr.eu>
      Cc: Dong Aisheng <dong.aisheng@linaro.org>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Huang Shijie <shijie8@gmail.com>
      Cc: Javier Martin <javier.martin@vista-silicon.com>
      Cc: Matt Porter <mporter@ti.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4984c6f5
  23. 29 Apr, 2013 1 commit
  24. 23 Apr, 2013 3 commits