msm: dma: Moving queue_work() function within spinlock

Currently we are adding a dma command to the staged list with in a
spinlock and then adding to workqueue using queue_work after unlocking
the spinlock. With this there is chance of executing DMA commands in out
of order in below concurrency case.

Tread1                                Thread2
__msm_dmov_enqueue_cmd_ext
   spin_lock_irqsave(..)
   list_add_tail(..)
   spin_unlock_irqrestore(..)
       --PREEMPT--
                                      __msm_dmov_enqueue_cmd_ext
                                         spin_lock_irqsave(..)
                                         list_add_tail(..)
                                         spin_unlock_irqrestore(..)
                                         queue_work()
                                         ..
   queue_work()
So adding queue_work with in spin_lock will make sure that the
work added in the work_queue is processed in the same order as they
are added in staged_commands.

CRs-Fixed: 423190
Change-Id: I2ffd1327fb5f0cd1f06db7de9c026d1c4997fe4d
Acked-by: Gopi Krishna Nedanuri <gnedanur@qti.qualcomm.com>
Signed-off-by: Utsab Bose <ubose@codeaurora.org>
Merge "msm: dma: Moving queue_work() function within spinlock"
power: pm8921-charger: NULL check in 'external_power_changed' callback

The power-supply framework internally calls power_supply_changed
after registering a power-supply type. This ends up calling
'external_power_changed' callback which unconditionally
accesses 'the_chip' pointer (which gets initialized later).
Fix this by adding a NULL check.

CRs-Fixed: 466083
Change-Id: I75a58ca5ab37e44454f139a2644ab316afe3c4b8
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Merge "power: pm8921-charger: NULL check in 'external_power_changed' callback"