From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.14 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796047259; b=K7Pfxly4XRnGOaZr3+a58jLgQPBlnClnvZAVxHzLsrQB3R1kNzwOGaVaceJyIcY7Kh2w ILBO4B/78ONy5X14uGNJdqSST82xuwLJJNVvPGUL2cXql2EQZpwERzL1iugYzJFEbul1c tMe+iljrmeMq7fOnn67enlzKZUlylUwH8f//6kuIiwvFQC7yCiFSC3qVLChhGnoRAfK4g nvadCK8j/MPuQ5IXta8qQ2O9gY9C84eWbIVXlOU/x9C26PLsOPV8lGLg39FgaFiHTlcT0 n53wKcN6C25cOb9OXFa2NH/4AjyJGwmoyeG4X7peMrAOAnFGMt3h/PrqIXOYcRY0urw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796047259; 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=hyEuEHhxo822qqbjauD5VocVs3FJhrIo0cUst0BxapU=; b=HyizP9wr7a+Yyr4952LM0uGzLqu56SrHdp5Fp1PeIt673Cfc9GYUXGN+0TnLKyZTl//x JA/o8qz5K9Br+G+E0VZqBLrjdGnShJVW1KQbDmS338Rzb1kIPhuzokVT+I106ZY9M/Whl KiE5XvFi6Gm7zybPsi/cgjb9WFlZNAeW8aWH0NoCrUbbeVi8gZhTitBmkylN/r0m6llbW SIlgVyUAz2bSGyjEDkBf8ScTiWjcRsRo77TpUOLvrXx4aX8xg8ARgKm+EO74rzA4qdsNy 1QTww4UoGPPdt9MLX3D1QZbO1EauRybzxZSM8GjpVO+o4nqb4ItWfTdw6ttvBReoDVQ== 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=C5eGsrxE; arc=none smtp.remote-ip=192.198.163.14 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 091A3606A320; Mon, 30 Nov 2026 14:00:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 091A3606A320 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=C5eGsrxE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796047260; x=1827583260; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=hyEuEHhxo822qqbjauD5VocVs3FJhrIo0cUst0BxapU=; b=C5eGsrxEf7OcYt4k86Bl+2MsbMZFhYe4tr120KnTgU4Zu3IvXeso5RXn RIARmohIWAxerTxZ3xHuCSRh+nWJ+ndiA9Pl2HgCuj+HbmF6ZBadT+vpO v3CGNlbj2rdPI0q0mrtMYHsa1czpZc8EZFyklwnU0IwlyeZJoVs8N80Ln hVSEh65TgE0jHRGhPNAWUpjOHecVNsjyO+fPvIoHhVOdVhsxNCvSofZj/ W4c+bxfiGhUMaeVDOs1MHnmL2AvB5bD3sYynKw3iEZ3aSugLymv8qoszZ nOVvVBUryxDNccEjsI9CtIv4OjGrqwpw7fcMypRvB4axh3u0osQHr1jCi A==; X-CSE-ConnectionGUID: qRHNikwhSiyPojsWYwMUfA== X-CSE-MsgGUID: jDn1eWUVS6qEziA6AVFSXQ== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4843275" X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="4843275" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 06:00:59 -0800 X-CSE-ConnectionGUID: apfsJwkwSsyo5FfHkqf72A== X-CSE-MsgGUID: W+Hr8v9tS3mNZnl0ZBal3g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="13072811" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa005.fm.intel.com with ESMTP; 30 Nov 2026 06:00:57 -0800 Received: by black.igk.intel.com (Postfix, from userid 1008) id AEB7799; Mon, 30 Nov 2026 15:00:55 +0100 (CET) Date: Mon, 30 Nov 2026 15:00:55 +0100 From: Heikki Krogerus To: Vinicius Pedrosa Cc: Greg Kroah-Hartman , AngeloGioacchino Del Regno , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] usb: typec: tcpci_rt1711h: unmask alerts before registering the port Message-ID: References: <20261126195059.1139494-1-vinicius.eduardo.pedrosa@gmail.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: <20261126195059.1139494-1-vinicius.eduardo.pedrosa@gmail.com> On Thu, Nov 26, 2026 at 04:50:59PM -0300, Vinicius Pedrosa wrote: > rt1711h_probe() masks all alerts before tcpci_register_port() and only > writes the real mask after devm_request_threaded_irq(). TCPM starts > looking for a partner several milliseconds after the registration > returns. > > The ET7304 (RT1715 compatible) does not latch a CC status change in > TCPC_ALERT while its mask bit is clear, and setting the bit later does > not bring it back. If the partner shows up before the mask is written, > CC_STATUS has the Rd but no alert is pending. TCPM stays in > SRC_UNATTACHED and VBUS stays off until the cable is replugged. > > On a Radxa Cubie A7Z (Allwinner A733) with PREEMPT_RT, a source-only > port and a sink attached at boot, 6 of 12 boots ended like that. In each > of them the mask write finished after TCPM started driving Rp, and in > each of the other six it finished before. With this change 0 of 12 > failed. > > Write the mask right before the registration, so the setup before it > still runs masked, and drop the write after the interrupt request. The > interrupt is still requested after the registration. It is level > triggered, so an alert raised in between is handled once it is requested. > > Fixes: d6b82dafd17d ("usb: typec: tcpci_rt1711h: Unmask alert interrupts to fix functionality") > Cc: stable@vger.kernel.org > Signed-off-by: Vinicius Pedrosa Reviewed-by: Heikki Krogerus > --- > I only had the ET7304 on a Cubie A7Z. RT1711H and RT1715 are untested. > > drivers/usb/typec/tcpm/tcpci_rt1711h.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c > index 0581659763a..635ea9aa8fc 100644 > --- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c > +++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c > @@ -337,6 +337,15 @@ static int rt1711h_probe(struct i2c_client *client) > chip->data.set_vbus = rt1711h_set_vbus; > chip->data.set_vconn = rt1711h_set_vconn; > chip->data.start_drp_toggling = rt1711h_start_drp_toggling; > + > + /* > + * Unmask alerts before TCPM starts looking for a partner. The ET7304 > + * does not latch CC changes in ALERT while its mask bit is clear. > + */ > + ret = rt1711h_write16(chip, TCPC_ALERT_MASK, alert_mask); > + if (ret < 0) > + return ret; > + > chip->tcpci = tcpci_register_port(chip->dev, &chip->data); > if (IS_ERR_OR_NULL(chip->tcpci)) > return PTR_ERR(chip->tcpci); > @@ -352,11 +361,6 @@ static int rt1711h_probe(struct i2c_client *client) > if (ret < 0) > return ret; > > - /* Enable alert interrupts */ > - ret = rt1711h_write16(chip, TCPC_ALERT_MASK, alert_mask); > - if (ret < 0) > - return ret; > - > enable_irq_wake(client->irq); > > return 0; > -- > 2.43.0 > -- heikki