block: Convert BDI proportion calculations to flexible proportions

Convert calculations of proportion of writeback each bdi does to new flexible
proportion code. That allows us to use aging period of fixed wallclock time
which gives better proportion estimates given the hugely varying throughput of
different devices.

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
iommu: msm: Move location of local iommu halt

During iommu detach we do a local iommu halt to ensure certain
registers are atomically updated. However, the local iommu halt
is taken at a larger scope than needed. Reduce the scope of this
halt. This will help with performance when detaching a context bank
from an iommu that has another context bank in use.

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: qdsp6 : fix DAP params length in adm dolby set params call

During adm set param call for DAP params, send correct buffer length
to dsp, so DAP module doesnt look for parameters after valid length

Signed-off-by: Jitendra Singh Naruka <jnaruk@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: qdsp6v2: Fixed AAC dual-mono param_size

Corrected the calculation of the param_size field
within the asm_aac_dual_mono_mapping_param struct.

Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: Fix underrun in LPA driver

Update LPA platform driver to register restart callback.
The implementation of the callback is to issue a pending buffer
written by the application to restart the session when the dequeue
process is stopped due to underrun issue.
The callback is triggered from ALSA core when the framework
detects that the renderer stopped pulling data but the application
is still writing data. It runs in atomic context.

Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm add support for meta data mode for lpa driver

Seek to EOS was causing playback to hang for three seconds before
switching to the next clip. This is because the lpa driver works
on period size. Partial buffers are not handled. Add metadata
mode changes to LPA Driver to support partial frames.

Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: Move ocmem enable request from trigger to open

OCMEM mapping needs to be done only once for multiple instances,
we vote and unvote when a lpa session is open and closed to make
above happen. But this voting and enable ocmem call was being
made in msm_compr_trigger, need to move this to msm_compr_open.

Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: qdsp6v2: Initialize local variable output_meta_data

The local variable output_meta_data is not initialized if
prtd->meta_data_mode is false. It can lead unexpected behavior.

Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ALSA: include: Add new ioctl for metadata mode

Add a new ioctl to support metadata mode in lpa driver. This ioctl
allows lpa driver to work in default alsa compliant mode and also
metadata mode.

Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ASoC: msm: Handle error scenarios correctly

In cases where workqueue allocation or device tree
parsing failed, we should return from the function
after freeing up all the resources.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>