04 Apr, 2020

1 commit

  • Pull char/misc driver updates from Greg KH:
    "Here is the big set of char/misc/other driver patches for 5.7-rc1.

    Lots of things in here, and it's later than expected due to some
    reverts to resolve some reported issues. All is now clean with no
    reported problems in linux-next.

    Included in here is:
    - interconnect updates
    - mei driver updates
    - uio updates
    - nvmem driver updates
    - soundwire updates
    - binderfs updates
    - coresight updates
    - habanalabs updates
    - mhi new bus type and core
    - extcon driver updates
    - some Kconfig cleanups
    - other small misc driver cleanups and updates

    As mentioned, all have been in linux-next for a while, and with the
    last two reverts, all is calm and good"

    * tag 'char-misc-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (174 commits)
    Revert "driver core: platform: Initialize dma_parms for platform devices"
    Revert "amba: Initialize dma_parms for amba devices"
    amba: Initialize dma_parms for amba devices
    driver core: platform: Initialize dma_parms for platform devices
    bus: mhi: core: Drop the references to mhi_dev in mhi_destroy_device()
    bus: mhi: core: Initialize bhie field in mhi_cntrl for RDDM capture
    bus: mhi: core: Add support for reading MHI info from device
    misc: rtsx: set correct pcr_ops for rts522A
    speakup: misc: Use dynamic minor numbers for speakup devices
    mei: me: add cedar fork device ids
    coresight: do not use the BIT() macro in the UAPI header
    Documentation: provide IBM contacts for embargoed hardware
    nvmem: core: remove nvmem_sysfs_get_groups()
    nvmem: core: use is_bin_visible for permissions
    nvmem: core: use device_register and device_unregister
    nvmem: core: add root_only member to nvmem device struct
    extcon: axp288: Add wakeup support
    extcon: Mark extcon_get_edev_name() function as exported symbol
    extcon: palmas: Hide error messages if gpio returns -EPROBE_DEFER
    dt-bindings: extcon: usbc-cros-ec: convert extcon-usbc-cros-ec.txt to yaml format
    ...

    Linus Torvalds
     

20 Mar, 2020

4 commits


19 Mar, 2020

17 commits

  • Driver should clear FIFO in PDI, or the previously stored sample data
    in FIFO will generate pop noise when stream is started. The soft reset
    bit will clear all the FIFO to zero and is self-cleared after that.

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

    randerwang
     
  • Enable multi-link (aka multi-master configuration). In this
    configuration, updates and commands with the 'ssp_sync' tag will be
    deferred and controlled by the gsync hardware signal.

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

    Pierre-Louis Bossart
     
  • Follow recommended flows, the BUS_RESET must be programmed before the
    UPDATE_CONFIG.

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

    Pierre-Louis Bossart
     
  • This is a good idea on paper, but it's not recommended at all when
    operating in multi-master mode. It's also not recommended when doing
    bank switches, since the retransmission would happen at the next SSP,
    and the command protocol is stuck in the mean time.

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

    Pierre-Louis Bossart
     
  • The hardware default is 0x1F, and the existing code does an OR with 0xF.
    This is a no-op, remove.

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

    Pierre-Louis Bossart
     
  • Follow recommended programming sequences, this needs to be enabled
    before the reset sequence.

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

    Pierre-Louis Bossart
     
  • Follow hardware programming flows and add placeholder comment for
    multi-master mode.

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

    Pierre-Louis Bossart
     
  • 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
     
  • This helps isolate code and align with recommended programming flows

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

    Pierre-Louis Bossart
     
  • Use a single loop to wait for hardware to set/clear fields.

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

    Pierre-Louis Bossart
     
  • Intel QA reported a very rare case, possibly hardware-dependent, where
    a Slave can become UNATTACHED during a clock stop sequence, which
    leads to timeouts and failed suspend sequences.

    This patch suppresses the handling of all Slave events while this
    transition happens. The two cases that matter are:

    a) alerts: if the Slave wants to signal an alert condition, it can do
    so using the in-band wake, so there's almost no impact with this
    patch.

    b) sync loss or imp-def reset: in those cases, bringing back the Slave
    to functional state requires a complete re-enumeration. It's better to
    just ignore this case and restart cleanly, rather than attempt a
    'clean' suspend.

    Validation results show the timeouts no longer visible with this patch.

    GitHub issue: https://github.com/thesofproject/linux/issues/1678
    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200317163329.25501-8-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Vinod Koul

    Pierre-Louis Bossart
     
  • After system resumes from S3, io timeout occurs when setting one
    unused master on Comet Lake platform. In this case, the master is
    reset to default state, and FIFOLEVEL is reset to default value,
    but msg_count used for tracing FIFOLEVEL is still with old value,
    so FIFOLEVEL will not be set if a new msg FIFO usage is equal to
    the old msg_count.

    This patch updates msg_count to default value of FIFOLEVEL when
    resetting master.

    Tested on Comet Lake platform.

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

    Rander Wang
     
  • 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
     
  • config_update() may time out or cannot be use in ClockStopMode

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

    Pierre-Louis Bossart
     
  • 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
     
  • Somehow we inverted the two, align with register definition to avoid
    further confusion.

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

    Pierre-Louis Bossart
     

13 Mar, 2020

1 commit

  • There is no point in using update for registers with write mask
    as 0xFF, this adds unnecessary traffic on the bus.
    Just use sdw_write directly.

    Signed-off-by: Srinivas Kandagatla
    Acked-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200312100105.5293-1-srinivas.kandagatla@linaro.org
    Signed-off-by: Vinod Koul

    Srinivas Kandagatla
     

10 Mar, 2020

1 commit

  • This patch switch to use plural form macro.

    - for_each_rtd_codec_dai()
    + for_each_rtd_codec_dais()

    - for_each_rtd_codec_dai_rollback()
    + for_each_rtd_codec_dais_rollback()

    - for_each_rtd_cpu_dai()
    + for_each_rtd_cpu_dais()

    - for_each_rtd_cpu_dai_rollback()
    + for_each_rtd_cpu_dais_rollback()

    Signed-off-by: Kuninori Morimoto
    Reviewed-by: Ranjani Sridharan
    Reviewed-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/87wo7ugogy.wl-kuninori.morimoto.gx@renesas.com
    Signed-off-by: Mark Brown

    Kuninori Morimoto
     

03 Mar, 2020

1 commit

  • It seems to be a typo. It makes more sense to return the return value
    of sdw_update() instead of the value we want to update.

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

    Bard Liao
     

26 Feb, 2020

3 commits


25 Feb, 2020

10 commits

  • If a SoundWire link is enabled, but there are no Slave devices exposed
    in firmware tables for this link, or no Slaves in ATTACHED or ALERT
    mode, the CMD_IGNORED/-ENODATA error code on a broadcast write is
    perfectly legit.

    Filter this case to report errors and let the caller deal with the
    CMD_IGNORED case.

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

    Pierre-Louis Bossart
     
  • SoundWire supports two clock stop modes. Add support to handle the
    clock stop modes and add pm_runtime calls in the bus.

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

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

    Rander Wang
     
  • There are two types of io errors when processing alert event.

    a) the Master detects an ALERT status for e.g. a jack event and
    invokes the implementation-defined function in the Slave driver to
    check the jack status. At this time the codec is just suspended, so io
    registers can't be accessed.

    b) when waking up from clock stop mode1 state, where the bus needs a
    complete re-enumeration, Slave registers can't be accessed until the
    enumeration is complete.

    This patch resumes the Slave device and waits for initialization
    complete when processing slave alert event, so that registers on the
    Slave can be accessed without timeouts or io errors.

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

    Rander Wang
     
  • Before removing the slave device, disable pm_runtime to prevent any
    race condition with the resume being executed after the bus and slave
    devices are removed.

    Since this pm_runtime_disable() is handled in common routines,
    implementations of Slave drivers do not need to call it in their
    .remove() routine.

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

    Pierre-Louis Bossart
     
  • When resuming with a bus reset, we need to re-enumerate and restart
    from UNATTACHED. The helper added in this patch helps implement a more
    robust state machine avoiding race conditions on resume.

    The unattach request is stored and will be used by Slave drivers, if
    needed: Intel validation exposed a corner case where the Slave device
    may transition to D3 when streaming stops, but streaming restarts
    before the Master transitions to D3. In that case, the Slave status
    was not cleared as UNATTACHED by the Master resuming, and the
    wait_for_completion will time out.

    When the slave resumes, it can check if a Master-initiated
    re-enumeration and initialization took place and skip the
    wait_for_completion() if there is no reason to wait.

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

    Pierre-Louis Bossart
     
  • While handling the Device0, we can safely use sdw_write_no_pm.

    This move will also helps us track that all other usages of
    sdw_write() happen when the Slave is already enumerated.

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

    Pierre-Louis Bossart
     
  • Add support for pm_runtime with the appropriate error checks for
    sdw_write/read functions, e.g. when pm_runtime is not supported.

    Also expose internal functions without pm_runtime support, which are
    required to perform any sort of suspend/resume operation, as well as
    any enumeration tasks.

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

    Pierre-Louis Bossart
     
  • Waiting for the enumeration to be complete may not be enough for a
    Slave driver, there is a possible race condition between resume
    operations and initializations handled in an interrupt thread, which
    can results in settings not being fully restored after system or
    pm_runtime resume.

    This patch builds on the changes added for enumeration_complete,
    init_completion() is called when the Slave device becomes UNATTACHED,
    as done with enumeration_complete.

    The difference with the enumeration_complete case is that complete()
    is signaled after the Slave device is fully initialized after the
    .update_status() callback is called.

    A Slave device driver can decide to wait on either of the two
    complete() cases, depending on its initialization code and
    requirements.

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

    Pierre-Louis Bossart
     
  • This patch adds the signaling needed for Slave drivers to wait until
    the enumeration completes so that race conditions when issuing
    read/write commands are avoided. The calls for wait_for_completion()
    will be added in codec drivers in follow-up patches.

    The order between init_completion() and complete() is deterministic,
    the Slave is marked as UNATTACHED either during a Master-initiated
    HardReset, or when the hardware detects the Slave no longer reports as
    ATTACHED.

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

    Pierre-Louis Bossart
     
  • The driver probe takes care of basic initialization and is invoked
    when a Slave becomes attached, after a match between the Slave DevID
    registers and ACPI/DT entries.

    The update_status callback is invoked when a Slave state changes,
    e.g. when it is assigned a non-zero Device Number and it reports with
    an ATTACHED/ALERT state.

    The state change detection is usually hardware-based and based on the
    SoundWire frame rate (e.g. double-digit microseconds) while the probe
    is a pure software operation, which may involve a kernel module
    load. In corner cases, it's possible that the state changes before the
    probe completes.

    This patch suggests the use of wait_for_completion to avoid races on
    startup, so that the update_status callback does not rely on invalid
    pointers/data structures.

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

    Pierre-Louis Bossart
     

20 Feb, 2020

1 commit


18 Feb, 2020

1 commit