* and Slave(s)
  *
  * @bus: SDW bus instance
+ * @prepare: true if sdw_program_params() is called by _prepare.
  */
-static int sdw_program_params(struct sdw_bus *bus)
+static int sdw_program_params(struct sdw_bus *bus, bool prepare)
 {
        struct sdw_master_runtime *m_rt;
        int ret = 0;
 
        list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) {
+
+               /*
+                * this loop walks through all master runtimes for a
+                * bus, but the ports can only be configured while
+                * explicitly preparing a stream or handling an
+                * already-prepared stream otherwise.
+                */
+               if (!prepare &&
+                   m_rt->stream->state == SDW_STREAM_CONFIGURED)
+                       continue;
+
                ret = sdw_program_port_params(m_rt);
                if (ret < 0) {
                        dev_err(bus->dev,
 
 program_params:
                /* Program params */
-               ret = sdw_program_params(bus);
+               ret = sdw_program_params(bus, true);
                if (ret < 0) {
                        dev_err(bus->dev, "Program params failed: %d\n", ret);
                        goto restore_params;
                bus = m_rt->bus;
 
                /* Program params */
-               ret = sdw_program_params(bus);
+               ret = sdw_program_params(bus, false);
                if (ret < 0) {
                        dev_err(bus->dev, "Program params failed: %d\n", ret);
                        return ret;
                struct sdw_bus *bus = m_rt->bus;
 
                /* Program params */
-               ret = sdw_program_params(bus);
+               ret = sdw_program_params(bus, false);
                if (ret < 0) {
                        dev_err(bus->dev, "Program params failed: %d\n", ret);
                        return ret;
                        m_rt->ch_count * m_rt->stream->params.bps;
 
                /* Program params */
-               ret = sdw_program_params(bus);
+               ret = sdw_program_params(bus, false);
                if (ret < 0) {
                        dev_err(bus->dev, "Program params failed: %d\n", ret);
                        return ret;