From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796392429; b=BbFLs3CNFcp++JDyJCB9Z09vhVth7LlDKF9O7/De3k4nAJCdHxKUtC2Shq6y0fetcXqL 8V8VCxdDC6L/Qhj4D+GNGNv7dE6PKuHiiF0Q6mOBj9jEB6oVtYtIqndU6fouTY7F6FG1I +J7Ne6zxvWAjGnlMRwC9DbkpSjIfVn3+lYRN7dIb1gDE2Z46PEOaOihF/yqbl/OReDEAJ OiVSIpgswwHb8uXNPkWTcC4oZkYawWZ5i+n7C6Pk5c5A6WBVXiRmCBzqbxWH8Wafa+cWU aZlX8D/1C0xY2HSgOw+/xB9ydLTGgRdJA0HtlZZx9OiwaDDiI7DhLX8AVvanMNiFkrw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796392429; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Date:From:To: Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=AFC7RY6DtiLAvAmBt/eGS9DtIHpo8/KIA241VwFsQoA=; b=ewTIHGIEmyUbYTprTj2Ors7mRZKoZVAU9P5zYOTx7w+OQQk1pby627zW8b76F6dkLB0u ZNAoftZ6Fc4iDKDLBEEnu8D2ieWfdgJWOISpf9u6YZzEqkG3PCa7zF1NeDOGJYZfnnwa1 hBaaLkuSGFknwDnJFCm/F+b3YXsNXdcGC+kSG+ai0vUUMYxMXDuJdqOOP+2u01EWcY4R8 IJaRPM3ZPgF252wRNTiT3a0NEGf2k5pr9FTqZoADoDE7CZjL/0ZZuWX9bmQg/6H5xs3gA k75RGaMw4AymUNm5LAUJbswKpxujZwiRog5A05H1MAH/k25+WN/YVh4g19jhIhFDtZA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=csTQxm4O; arc=none smtp.remote-ip=198.175.65.18 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96E6D606A333 for ; Fri, 4 Dec 2026 13:53:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 96E6D606A333 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=csTQxm4O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796392429; x=1827928429; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=AFC7RY6DtiLAvAmBt/eGS9DtIHpo8/KIA241VwFsQoA=; b=csTQxm4Ois5P9d9h0UhB3LL9lOf7WFSdA5QUsyCPScZoXfArs4i7Zbkv 6+pJAy/ycb1tYPPTl/Mj53is2gxuiey2+3f9wAmlqS2QziwcFtc0yEj55 VaY7CFqRGk9U6WeXn2rZ06YUhGM3qcdgq2gNt3W+KV74U6PsM1USf5Xsc UB18t0ax8xQKKB3j8LKSN23oFvhT5BS/yML+E0N+CTq+xB2NQtdi8vfAj 2yNNHuZzwpFJ3tYEIeCYBBp/7NolQRJoQLJkYBZoTQtWLtc+ulfg+pBVz GaPTLS0aE17XbJ4tkMMcIqdd9xJiGzh0f84SkVUu9CvW8YERqeIcYP41r g==; X-CSE-ConnectionGUID: mEJC3LijTQmiQYhBo/L65Q== X-CSE-MsgGUID: dJL92cwoS0ibL7FNgT4Aeg== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5391062" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5391062" Received: from fmviesa012.fm.intel.com ([10.60.135.152]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 05:53:48 -0800 X-CSE-ConnectionGUID: a/kFHvNiSbasehlJqzvVyA== X-CSE-MsgGUID: qgW2uIN2SvWFlmGyAmJYRQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="15731909" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa012.fm.intel.com with ESMTP; 04 Dec 2026 05:53:47 -0800 Received: by black.igk.intel.com (Postfix, from userid 1008) id DF8EF98; Fri, 04 Dec 2026 14:53:45 +0100 (CET) Date: Fri, 4 Dec 2026 14:53:45 +0100 From: Heikki Krogerus To: Krishna Kurapati Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, Praveen Kumar Thuppa Subject: Re: [PATCH] usb: typec: ucsi: Do not override an active alternate mode with USB mode Message-ID: References: <20261203-sm8750-dp-issue-v1-1-a519848958ad@oss.qualcomm.com> X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261203-sm8750-dp-issue-v1-1-a519848958ad@oss.qualcomm.com> Hi, On Thu, Dec 03, 2026 at 12:13:10AM +0530, Krishna Kurapati wrote: > From: Praveen Kumar Thuppa > > ucsi_partner_change() switches the port to USB mode whenever the > connector status reports a USB partner. An alternate mode can be entered > through a path other than the UCSI alternate mode negotiation, for example > pmic glink altmodedriver that programs muxes from firmware events. UCSI > does not know about such an alternate mode, so a partner change handled > after it is up takes the muxes back to USB. > > On SM8750, when the Qualcomm PMIC GLINK altmode driver enters DisplayPort, > the USB mode update from ucsi switches the wcd939x-usbss mux, which carries > the DisplayPort AUX lines, away from DisplayPort shortly after the hotplug > handling has read the sink capabilities and EDID successfully. The next AUX > read times out with -110 and link training never runs. > > The check cannot be done in UCSI or in the driver that entered the altmode, > as neither knows what the other did. It is done in the mux layer, where the > state is applied. Record in struct typec_mux_dev whether the last state > accepted by the set callback was an alternate mode, and add > mux_set_unless_altmode and set_mode_unless_altmode, which behave like > typec_mux_set and typec_set_mode but leave mux devices that are in an alt > mode untouched and report success for them. Use the latter for the USB > mode update in ucsi_partner_change(). This also applies to alt modes that > UCSI entered itself: a later USB mode update from a partner change no > longer takes them back to USB. Any other accepted state clears the record. > > Hold a per mux device mutex around the set() callback and the update of the > record, so that the check cannot interleave with an alternate mode entry > coming from another path. Give every mutex its own lockdep class, muxes > such as wcd939x-usbss forward a state to a downstream mux from their set > callback and must be able to nest. > > Ports without an active alternate mode get the same states and error > handling as before; the set() calls are now serialized per mux > device. > > Signed-off-by: Praveen Kumar Thuppa > Signed-off-by: Krishna Kurapati There's something wrong with the flow of things here. It sounds like the PPM on this system is not aware of the connector state when this pmic alt mode driver handles the mode entry. That would be really bad situation, because the PPM really should always know the connector state. On most systems UCSI is not taking care of the actual mode entry. It only reports what ever the PPM/FW says. So it really should not matter if something else, like the pmic alt mode driver, actually enters the altmode. In that case the UCSI driver should just get the appropriate connector change event telling what has happened. It is then up to the mux layer/drivers to know how to handle the information that's coming from UCSI - filter/ignore it when the pmic driver has already told to switch to DP (or what ever) mode, or only get the commands from the UCSI (don't program the muxes from pmic alt mode driver at all). So why is the PPM not getting the information about the mode entry when the pmic alt mode driver has taken care of that? Which component is the PPM on this platform? Thanks, -- heikki