From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.12 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387996; b=Iw88crc5rh0/XwQXYlUVi7Qm32JaeIZojM3Eu8bCXvNbUjxfov45HLpi4JiBu8DnEmX3 A39A9lJI3kQ1BbkbEK1Dce4MiSF/Y1F+PafLE4mFY3AYfs7rQ9tIZo5zT4xOSE4UbJcNl mqrPdJ20J97Ol7mkwBUTU8DCMZRvCTKiYDww+8BQ2rV6+k9mHXU1Hz5Y0SxpKvfXsleDl wiu6u3YtbSof1OAhCJkdoAAbw6m1NSj83hgRisvMmzMXw6lkuq85G24JSyRmIDydcG4L1 NQZt4oXZx9w151z+odYsxO97/u2OH7rmSHhCsW6c7Pjihp+NcSUxAEGEHHos9rfUOqA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387996; 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=SpwSkkiSPe1OJIvp/JcyTNJfTtYGfjEy5/HtfOJdgRY=; b=A1+KseBTpBnsgYtwoLfVXt+J/t8JKxMc2lZzDy3GxjNJ3iUyM8qMzLp00zvFVcGgPG55 +PcJulW90KKwIE1tBvXTRagBG0V3S1oDY/NwPZoNSjVmu2OB/krgmJO+lvIfpXxHFzWVi 1efY9O5SUci+ZiShaN/xQReWnJj4eHnwW59vDusbR6MXztPLfbH2Gnf4V7jTQv+4hnOmF 28CjKpwA1Fg8gfzofzfDtBk8hN65zE1S9tn9Lnm/RmKJ0sURQQ/IhkWluzTl0dapGc5Zm u7kYPch9fvNgnU6Aedfs21coV8SadQnZ9o5yBFBYoU6jRNgNtBWmLhGlXgDN5zyZ43Q== 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=Fo2r6cX7; arc=none smtp.remote-ip=192.198.163.12 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 28E7E606A33C; Fri, 4 Dec 2026 12:39:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 28E7E606A33C 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=Fo2r6cX7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796387995; x=1827923995; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=SpwSkkiSPe1OJIvp/JcyTNJfTtYGfjEy5/HtfOJdgRY=; b=Fo2r6cX74Hw8FQ90QphPY0emsENpfiVaPUb5WIQ/UvmRXGQOxZ6Zl4YG fzSgnGO88Ra58kPkdEp/IOtCImlwkutCBn2HmDhifLagTd+i6SrWZyM1i 6Y0qrac7EYNoF5BTtgd8NNBT787IMgODh0mecY+1fGPGhl9QTKfDKVVCy Ng2j6OmVIXpbGt4vDR5OHkHfI9U4aGAvLrITGvu//TJ3lsn7/TjGvJh/a SLQ1n9JoiIshX/JZlUQS6p6Ow4mGL2VoitLb5cF0ds9d+uJ42e2KMVcc4 rnv4Fum7UKYZmeOy60xj5oxxdb6iUySUg38r/RiDsbqJI9KP1N1tUv8Va w==; X-CSE-ConnectionGUID: yxF+GicvQd6nBe+sY/Dsfw== X-CSE-MsgGUID: sncwgrLzS9i9B4UGlHx+TA== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5271541" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5271541" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 04:27:31 -0800 X-CSE-ConnectionGUID: GYZuyc+rQgmVIqILxB5aKw== X-CSE-MsgGUID: Guf7UeK8S7m2a/2xuCeBeQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="13869189" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa008.jf.intel.com with ESMTP; 04 Dec 2026 04:27:30 -0800 Received: by black.igk.intel.com (Postfix, from userid 1008) id 1F80C98; Fri, 04 Dec 2026 13:27:29 +0100 (CET) Date: Fri, 4 Dec 2026 13:27:29 +0100 From: Heikki Krogerus To: Cong Nguyen Cc: Greg Kroah-Hartman , Roger Quadros , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] usb: typec: tipd: do not fail probe on a connect() error in polling mode Message-ID: References: <20261201042142.3169367-1-congnt264@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: <20261201042142.3169367-1-congnt264@gmail.com> On Tue, Dec 01, 2026 at 11:21:42AM +0700, Cong Nguyen wrote: > In polling mode tps6598x_probe() queues wq_poll and then tests ret, > which still holds the error from the connect() callback. Probe fails > with the poll work queued, and nothing cancels it before the > devm-allocated tps is freed. > > In IRQ mode a failed connect() is only logged, because > devm_request_threaded_irq() overwrites ret. Test ret only for the IRQ > request, so polling mode behaves the same and never fails probe after > queueing the work. > > Fixes: 0d6a119cecd7 ("usb: typec: tps6598x: Add support for polling interrupts status") > Signed-off-by: Cong Nguyen LGTM, but please Cc stable. Thanks, > --- > Changes in v2: > - Do not cancel the poll work in the error path. Test ret only for the > IRQ request, so a failed connect() is not fatal in polling mode, as in > IRQ mode (Sashiko review of v1). > > drivers/usb/typec/tipd/core.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c > index 02539378ffed..9b0a50076507 100644 > --- a/drivers/usb/typec/tipd/core.c > +++ b/drivers/usb/typec/tipd/core.c > @@ -1906,6 +1906,8 @@ static int tps6598x_probe(struct i2c_client *client) > tps->data->irq_handler, > IRQF_SHARED | IRQF_ONESHOT, > dev_name(&client->dev), tps); > + if (ret) > + goto err_disconnect; > } else { > dev_dbg(tps->dev, "no IRQ specified, using polling mode\n"); > INIT_DELAYED_WORK(&tps->wq_poll, tps6598x_poll_work); > @@ -1913,9 +1915,6 @@ static int tps6598x_probe(struct i2c_client *client) > msecs_to_jiffies(POLL_INTERVAL)); > } > > - if (ret) > - goto err_disconnect; > - > i2c_set_clientdata(client, tps); > fwnode_handle_put(fwnode); > > -- > 2.25.1 -- heikki