From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796356007; b=xw0mUjBqjbwZ74vOxWowggms6gX0AKuUox21qG1F0qIA4fY3CMH/X2PU/WAUVwzNZtWm y5kczTlcfJ3mEQzDNFbzJkTRCjOK63WQ18iRpkoHGdjXABy7ZkD5mVz1LivnrP6dCxMoG xt/hxO6HS85GGNB9JTFETcV7o4EepHMvbp1Gb1tMO065pnNj+c2ZFh4A4BEhDC+rmvEVM /QmKnfQ5qzxfQocqQBKotme4wHE3czHlEsOrLF4+txURYUcRoVmXhr9pNlu0AaB8+4VUZ t2/aLCO++CQ5wu6OUBu/PF+RO7UvQ1UtVmJ6jZ4xO1gG16O18LPgtM1HcflbrkBr5wA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796356007; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=8zXTCHCb3JySYptaegvHZiOwXj/UUavmEOP3QeCiDJg=; b=HeIvl/sLgCh6jBTem5R2tWkPPlzHxtd0OwpeegNXLV7lrkA84bDT2tPBcxKsKbKZvNcq Y6GrPye1vBYSLCFVAcgLyYGwYwOcz7Yni7ftC1VzuSPX6lmkBoq4MRmPAujXqscEEeLWC nSc+E7Z3MOVkHKoQJ5R61G1JDH3p8ejmzdYh8GqkpjBF+ZK7cwgRlr/3Lp4bcc10+sei1 0TTcVjAHUIc0eX+M6T43uhyoEjEdJSfJgNwWxedwebMdrrw9zk5FFBozgkvj6hMgT0GZ9 7yHjV1JHR5eriuXPprCJimG4C4ZlRSTenSwy/oKyUToXk05Jdk2jJ458sYtEJjZcW5Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jw1iA0aw; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE014606A322; Fri, 4 Dec 2026 03:46:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jw1iA0aw Received: by smtp.kernel.org (Postfix) with ESMTPSA id 149801F000C2; Fri, 4 Dec 2026 03:46:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796356007; bh=8zXTCHCb3JySYptaegvHZiOwXj/UUavmEOP3QeCiDJg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=jw1iA0awed/zZcq67R6ZTGPPY/lrS1VqgxeCVMWO4Rh2Xgk4W9kjDdJKNP5qtFC0k PvppY+BmR0eImUSakbpFHPu0l6jfRoWEuonIfeeQoB/1Qd2yMF5FMkmO/VgeHL2Ndc zod9wZR1uIt+ElJgHzZhgcxcaB35/uIsZmUWAzec= Date: Thu, 3 Dec 2026 23:07:31 +0100 From: Greg Kroah-Hartman To: Vinicius Pedrosa Cc: Heikki Krogerus , 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: <2026120314-untitled-chase-ae6b@gregkh> 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@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 > > Does not apply to my usb-testing branch. Can you rebase and resend? thanks, greg k-h