1. 08 Jul, 2016 3 commits
  2. 06 Jul, 2016 10 commits
  3. 29 Jun, 2016 7 commits
    • Viresh Kumar's avatar
      greybus: light: Initialize mutex before using it · 957ccca0
      Viresh Kumar authored
      Light protocol driver is suffering from the same issue that was fixed in
      camera driver earlier (commit a7c3b0c3c8da).
      
      Big cleanup function is used instead of fine grained control in the
      error path, and in one of the cases the mutex was found uninitialized
      and so the oops seen in SW-6752.
      
      Initialize the mutex before any code can access it.
      
      Compile tested only.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Reviewed-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      957ccca0
    • Johan Hovold's avatar
      greybus: Revert "greybus: uart: don't use spin_lock_irq()" · 2aae92bd
      Johan Hovold authored
      This reverts commit bd3c4aa99dc23449699432e0744bcb5af7afa98c.
      
      Someone decided that all use of spin_lock_irq was to be considered a bug
      and went on a search-and-replace type "bug-fixing" spree last week.
      
      This is however just plain wrong. Using spin_lock_irq is perfectly fine
      in paths were interrupts have not been disabled, and this is in fact
      even preferred over the lazy approach of always using spin_lock_irqsave
      instead of understanding the code that is being written or modified.
      
      All current uses of spin_lock_irq have already been vetted in this
      respect. Also note that it is only used in functions that may sleep,
      that is, in functions that must not be called with interrupts disabled
      in the first place.
      Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      2aae92bd
    • Johan Hovold's avatar
      greybus: Revert "greybus: es2.c: don't use spin_lock_irq()" · 07af9340
      Johan Hovold authored
      This reverts commit b44c3b5b0307788750eb4c462ed5982236876a8b.
      
      Someone decided that all use of spin_lock_irq was to be considered a bug
      and went on a search-and-replace type "bug-fixing" spree last week.
      
      This is however just plain wrong. Using spin_lock_irq is perfectly fine
      in paths were interrupts have not been disabled, and this is in fact
      even preferred over the lazy approach of always using spin_lock_irqsave
      instead of understanding the code that is being written or modified.
      
      All current uses of spin_lock_irq have already been vetted in this
      respect. Also note that it is only used in functions that may sleep,
      that is, in functions that must not be called with interrupts disabled
      in the first place.
      Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      07af9340
    • Johan Hovold's avatar
      greybus: Revert "greybus: gb_connections_lock: don't use spin_lock_irq()" · 0b1d2623
      Johan Hovold authored
      This reverts commit b022fd95108e8b9d202532a74d39e86152bc8f7f.
      
      Someone decided that all use of spin_lock_irq was to be considered a bug
      and went on a search-and-replace type "bug-fixing" spree last week.
      
      This is however just plain wrong. Using spin_lock_irq is perfectly fine
      in paths were interrupts have not been disabled, and this is in fact
      even preferred over the lazy approach of always using spin_lock_irqsave
      instead of understanding the code that is being written or modified.
      
      All current uses of spin_lock_irq have already been vetted in this
      respect. Also note that it is only used in functions that may sleep,
      that is, in functions that must not be called with interrupts disabled
      in the first place.
      Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      0b1d2623
    • Johan Hovold's avatar
      greybus: Revert "connection: switch to using spin_lock_irqsave/spin_lock_irqrestore excluisvely" · a29bac62
      Johan Hovold authored
      This reverts commit 426237c515b42b9f06d9a2b1021a6d2c4d440c51.
      
      Someone decided that all use of spin_lock_irq was to be considered a bug
      and went on a search-and-replace type "bug-fixing" spree last week.
      
      This is however just plain wrong. Using spin_lock_irq is perfectly fine
      in paths were interrupts have not been disabled, and this is in fact
      even preferred over the lazy approach of always using spin_lock_irqsave
      instead of understanding the code that is being written or modified.
      
      All current uses of spin_lock_irq have already been vetted in this
      respect. Also note that it is only used in functions that may sleep,
      that is, in functions that must not be called with interrupts disabled
      in the first place.
      Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      a29bac62
    • Sandeep Patil's avatar
      greybus: svc: remove input device handling in SVC protocol · 1beb1fae
      Sandeep Patil authored
      The input device was added before to handle the key(s) connected
      directly to SVC, which is not the case anymore. So, this change removes
      the gb_svc_key_event() operation and the corresponding input device
      code with it.
      
      Testing Done:
      Boot tested and tried module insert/removal through AraManager
      
      Change-Id: Iaa541d4aefb5c0ed16caaa39450029de35d7c228
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      1beb1fae
    • Viresh Kumar's avatar
      greybus: kernel_ver: Add kstrtobool() · 0ef5be18
      Viresh Kumar authored
      It was added in 4.6 and is required for one of the use case, copy it.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      0ef5be18
  4. 24 Jun, 2016 13 commits
  5. 23 Jun, 2016 7 commits
    • Viresh Kumar's avatar
      greybus: gb_connections_lock: don't use spin_lock_irq() · 6f7f2ae5
      Viresh Kumar authored
      spin_[un]lock_irq() routines should be used carefully as they things can
      go wrong, if they are mixed with spin_lock_irqsave() or other variants.
      
      The main problem is that spin_[un]lock_irq() routines doesn't check if
      the IRQs are already disabled/enabled on the local CPU and so
      spin_unlock_irq() will forcefully enable interrupts for example.
      
      This may not work well, if some other code was relying on interrupts
      being disabled.
      
      Use spin_lock_irqsave() and spin_unlock_restore() instead.
      
      This patch doesn't claim that it fixes the JIRA completely, but
      the issue was harder to reproduce for some iterations after this, which
      was quite easy to reproduce earlier on.
      
      Tested on EVT 2.0 with lots of debug patches to kernel and greybus.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      6f7f2ae5
    • Viresh Kumar's avatar
      greybus: es2.c: don't use spin_lock_irq() · fe905415
      Viresh Kumar authored
      spin_[un]lock_irq() routines should be used carefully as they things can
      go wrong, if they are mixed with spin_lock_irqsave() or other variants.
      
      The main problem is that spin_[un]lock_irq() routines doesn't check if
      the IRQs are already disabled/enabled on the local CPU and so
      spin_unlock_irq() will forcefully enable interrupts for example.
      
      This may not work well, if some other code was relying on interrupts
      being disabled.
      
      Use spin_lock_irqsave() and spin_unlock_restore() instead.
      
      This patch doesn't claim that it fixes the JIRA completely, but
      the issue was harder to reproduce for some iterations after this, which
      was quite easy to reproduce earlier on.
      
      Tested on EVT 2.0 with lots of debug patches to kernel and greybus.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      fe905415
    • Viresh Kumar's avatar
      greybus: uart: don't use spin_lock_irq() · e9f80f33
      Viresh Kumar authored
      spin_[un]lock_irq() routines should be used carefully as they things can
      go wrong, if they are mixed with spin_lock_irqsave() or other variants.
      
      The main problem is that spin_[un]lock_irq() routines doesn't check if
      the IRQs are already disabled/enabled on the local CPU and so
      spin_unlock_irq() will forcefully enable interrupts for example.
      
      This may not work well, if some other code was relying on interrupts
      being disabled.
      
      Use spin_lock_irqsave() and spin_unlock_restore() instead.
      
      This patch doesn't claim that it fixes the JIRA completely, but
      the issue was harder to reproduce for some iterations after this, which
      was quite easy to reproduce earlier on.
      
      Tested on EVT 2.0 with lots of debug patches to kernel and greybus.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      e9f80f33
    • Greg Kroah-Hartman's avatar
      greybus: Revert "greybus: don't use spin_lock_irq()" · 19cdabcf
      Greg Kroah-Hartman authored
      This reverts commit 469fbe5da0229edcb42aa08bef8e10feaa37e6d7.
      
      It isn't correct in places.
      Reported-by: default avatarGjorgji Rosikopulos <rosikopulos_gjorgji@projectara.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      19cdabcf
    • Bryan O'Donoghue's avatar
      greybus: timesync: Enforce TimeSync locks as subordinate to Interface locks · 12119151
      Bryan O'Donoghue authored
      gb_timesync_svc_teardown() is called from gb_timesync_svc_del() and issues a
      command to a remote Interface to switch off its timers. The lock ordering
      is TimeSync => Interface in this case. However gb_module_del() takes an
      Interface lock then calls gb_interface_del() => gb_timesync_svc_del() in
      this case the lock ordering is Interface => TimeSync.
      
      This patch fixes by removing the taking of the Interface mutex in
      gb_interface_timesync_do_something(). If an Interface is present in the
      TimeSync linked-list - it is by definition intf->enabled.
      Reported-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      12119151
    • Viresh Kumar's avatar
      greybus: don't use spin_lock_irq() · 5e2b6391
      Viresh Kumar authored
      spin_[un]lock_irq() routines should be used carefully as they things can
      go wrong, if they are mixed with spin_lock_irqsave() or other variants.
      
      The main problem is that spin_[un]lock_irq() routines doesn't check if
      the IRQs are already disabled/enabled on the local CPU and so
      spin_unlock_irq() will forcefully enable interrupts for example.
      
      This may not work well, if some other code was relying on interrupts
      being disabled.
      
      Use spin_lock_irqsave() and spin_unlock_restore() instead.
      
      This patch doesn't claim that it fixes the JIRA completely, but
      the issue was harder to reproduce for some iterations after this, which
      was quite easy to reproduce earlier on.
      
      Tested on EVT 2.0 with lots of debug patches to kernel and greybus.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Reviewed-by: default avatarJeffrey Carlyle <jcarlyle@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      5e2b6391
    • Viresh Kumar's avatar
      greybus: Revert "greybus: ratelimit errors usually seen on unipro_reset" · 05e30955
      Viresh Kumar authored
      This reverts commit 9b891f4fda8dfd6c1d8dc16479c5f6d418a9ccc7.
      
      We discussed this over the other thread,
      
      [PATCH 0/2] Improve watchdog's implementation a bit,
      
      and decided that we shouldn't be trying to hide the watchdog reboot
      problem by using such patches, rather we should make sure they occur
      consistently so that the real problem can be fixed.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      05e30955