09 Sep, 2020

1 commit

  • In system suspend stress cases, the SOF CI reports timeouts. The root
    cause is that an alert is generated while the system suspends. The
    interrupt handling generates transactions on the bus that will never
    be handled because the interrupts are disabled in parallel.

    As a result, the transaction never completes and times out on resume.
    This error doesn't seem too problematic since it happens in a work
    queue, and the system recovers without issues.

    Nevertheless, this race condition should not happen. When doing a
    system suspend, or when disabling interrupts, we should make sure the
    current transaction can complete, and prevent new work from being
    queued.

    BugLink: https://github.com/thesofproject/linux/issues/2344
    Signed-off-by: Pierre-Louis Bossart
    Reviewed-by: Ranjani Sridharan
    Reviewed-by: Rander Wang
    Signed-off-by: Bard Liao
    Acked-by: Jaroslav Kysela
    Link: https://lore.kernel.org/r/20200817222340.18042-1-yung-chuan.liao@linux.intel.com
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     

18 Aug, 2020

1 commit

  • The .prepare() callback is invoked for normal streaming, underflows or
    during the system resume transition. In the latter case, the context
    for the ALH PDIs is lost, and the DSP is not initialized properly
    either, but the bus parameters don't need to be recomputed.

    Conversely, when doing a regular .prepare() during an underflow, the
    ALH/SHIM registers shall not be changed as the hardware cannot be
    reprogrammed after the DMA started (hardware spec requirement).

    This patch adds storage of PDI and hw_params in the DAI dma context,
    and the difference between the types of .prepare() usages is handled
    via a simple boolean, updated when suspending, and tested for in the
    .prepare() case.

    Signed-off-by: Bard Liao
    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200817152923.3259-6-yung-chuan.liao@linux.intel.com
    Signed-off-by: Vinod Koul

    Bard Liao
     

21 Jul, 2020

1 commit

  • The existing code uses one pair of interrupt handler/thread per link
    but at the hardware level the interrupt is shared. This works fine for
    legacy PCI interrupts, but leads to timeouts in MSI (Message-Signaled
    Interrupt) mode, likely due to edges being lost.

    This patch unifies interrupt handling for all links. The dedicated
    handler is removed since we use a common one for all shared interrupt
    sources, and the thread function takes care of dealing with interrupt
    sources. This partition follows the model used for the SOF IPC on
    HDaudio platforms, where similar timeout issues were noticed and doing
    all the interrupt handling/clearing in the thread improved
    reliability/stability.

    Validation results with 4 links active in parallel show a night-and-day
    improvement with no timeouts noticed even during stress tests. Latency
    and quality of service are not affected by the change - mostly because
    events on a SoundWire link are throttled by the bus frame rate
    (typically 8..48kHz).

    Signed-off-by: Bard Liao
    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200716150947.22119-8-yung-chuan.liao@linux.intel.com
    Signed-off-by: Vinod Koul

    Bard Liao
     

19 Mar, 2020

4 commits

  • In multi-master mode, the IP will only accept SSP intervals with
    integer relationships between the frame rate and the gsync frequency.

    E.g for a 48kHz frame rate and 4 kHz gsync signal, the SSP interval
    can only be 1, 2, 3, 4, 6, 12.

    To simplify we only allow one SSP per gsync interval.

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200317163329.25501-11-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     
  • Add support for clock stop and restart, with two configuration
    parameters:

    1) when entering the ClockStop mode, Slave-initiated wakes can be
    prevented.

    2) When exiting the ClockStop mode, the caller can request a Bus Reset
    (either if all Slaves were configured in ClockStopMode1 or the Master
    IP lost context and enumeration is required)

    The code handles the case where no Slaves are present by configuring
    the IP to treat COMMAND_IGNORED as success.

    The exit_reset part can be dealt with in the caller, along with the
    required syncArm/syncGo sequence in multi-link mode.

    Signed-off-by: Rander Wang
    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200317163329.25501-6-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Vinod Koul

    Rander Wang
     
  • If master is in clock stop state, driver can't modify registers
    in master except the registers for clock stop setting.

    Signed-off-by: Rander Wang
    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200317163329.25501-4-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Vinod Koul

    Rander Wang
     
  • There is no need for the clock_stop_exit argument with the latest
    implementation

    Signed-off-by: Rander Wang
    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200317163329.25501-3-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Vinod Koul

    Rander Wang
     

26 Feb, 2020

1 commit


24 Oct, 2019

3 commits

  • The use of clock stop is not a requirement, the IP can e.g. be
    completely power gated and not detect any wakes while in s2idle/deep
    sleep.

    For now clock-stop is not supported anyways so the control parameter
    is always false. This will be revisited when we add clock stop.

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20191022235448.17586-6-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     
  • Prepare for future PM support and fix error handling by disabling
    interrupts as needed.

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20191022235448.17586-5-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     
  • Multiple changes squashed in single patch to avoid tick-tock effect
    and avoid breaking compilation/bisect

    1. Per the hardware documentation, all changes to MCP_CONFIG,
    MCP_CONTROL, MCP_CMDCTRL and MCP_PHYCTRL need to be validated with a
    self-clearing write to MCP_CONFIG_UPDATE. Add a helper and do the
    update when the CONFIG is changed.

    2. Move interrupt enable after interrupt handler registration

    3. Add a new helper to start the hardware bus reset with maximum duration
    to make sure the Slave(s) correctly detect the reset pattern and to
    ensure electrical conflicts can be resolved.

    4. flush command FIFOs

    Better error handling will be provided after interrupt disable is
    provided in follow-up patches.

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20191022235448.17586-2-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     

21 Oct, 2019

2 commits

  • PDI number should match dai->id, there is no need to track if a PDI is
    allocated or not.

    Signed-off-by: Bard Liao
    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20190916192348.467-7-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Vinod Koul

    Bard Liao
     
  • The existing Linux code uses a 1:1 mapping between ports and PDIs, but
    still has an independent allocation of ports and PDIs.

    Let's simplify the code and remove the port layer by only using PDIs.

    This patch does not change any functionality, just removes unnecessary
    code.

    This will also allow for further simplifications where the PDIs are
    not dynamically allocated but instead described in a topology file.

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20190916192348.467-5-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     

23 Aug, 2019

1 commit

  • Add debugfs file to dump the Cadence master registers.

    Credits: this patch is based on an earlier internal contribution by
    Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah.

    Reviewed-by: Greg Kroah-Hartman
    Acked-by: Sanyog Kale
    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20190821185821.12690-3-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     

21 Aug, 2019

1 commit


02 May, 2019

2 commits


12 May, 2018

3 commits


19 Dec, 2017

2 commits

  • Implement sdw_master_ops with support for xfer_msg, xfer_msg_defer
    and reset_page_addr. Since Cadence module doesn't know the systems
    it will be used, set the read_prop to the bus helper.

    Signed-off-by: Hardik T Shah
    Signed-off-by: Sanyog Kale
    Reviewed-by: Philippe Ombredanne
    Acked-By: Pierre-Louis Bossart
    Reviewed-by: Takashi Iwai
    Signed-off-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Sanyog Kale
     
  • Cadence IP implements SoundWire Master. Add base cadence library
    initialization and interrupt handling

    Signed-off-by: Hardik T Shah
    Signed-off-by: Sanyog Kale
    Reviewed-by: Philippe Ombredanne
    Acked-By: Pierre-Louis Bossart
    Reviewed-by: Takashi Iwai
    Signed-off-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Vinod Koul