From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E71D480941 for ; Tue, 25 Aug 2026 18:24:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787682272; cv=none; b=DrTA94Nt/+6feUEhj8uWYxv16DDIXRWXGnk0BsahuH1HaS5rmNGwbJBnnG+u/E/8a62KiSOYPKO5I5SPCSJgZIrBy1dL8vpa4qhQUBfk3S1cREitKVNTWQ8qzQinyNSUEfc911Hj2DRUQ5GbLwdqsTpSDFVzuwcf6NaQd9NyjEc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787682272; c=relaxed/simple; bh=S3YGTXaGmPCgbv4iCXelKQAvXeOzmCEMabBXbhoH2Wc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GyfBDyLjGvoVNGNdMN1hizRjT4qEiBxNQXCL2LgDkLvbxc/yK5E8NxG2k11JKAVRzUdPO1ws4rYpU40VszC3t7BLfL7aw1mBPzAD2ZbJJdmxwpDv+tX3gTCwr1cyCbFNkWndOMdHulicOxZl+zqgtU8C2mzMe3kY3C4HGVA486Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Qdvderp0; arc=none smtp.client-ip=209.85.210.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Qdvderp0" Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-7e9f69ee6f4so107050a34.2 for ; Tue, 25 Aug 2026 11:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1787682268; x=1788287068; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=mrSQugjWwNbSyFKJC0aQ+HhLTDBrn6ENKLGPbrFSXE0=; b=Qdvderp0a4VDMVBw1R86lx/2BOmy4XgA3c0bdwF51z6M3za5MfLoL+DwBPxkVB+oq8 CtbhGwQLrqG9uHhbnoUneFTY1zp105K9ew86+c1YGcuXbR8gfyw8D90axWmPsPjC2Eov AfxMm3N2/3lWUv0zgpzZ22W7CtD+tnJqO8PICqhB+9J9Li1MXMJtvA4dpV9GxeH62bMs j7pmZE+ffqRllGd/OO7rT8TFc0qV2R8mEVJ7dTug1D8DG2sBuJbXjGvzat7TAqmcmw2t NKCHwUZPO7sgsXUgh78P7cNRtg+MR5Tz5XrPJayE2GzFwNzNZPI69U3ZnomdMm60uwaI L0Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787682268; x=1788287068; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mrSQugjWwNbSyFKJC0aQ+HhLTDBrn6ENKLGPbrFSXE0=; b=jJv3ShpVpV66f3tCUts3tw5jEgmltr+OQpUt2fxnVjM/MWI89m6LvmEHwlBmHZHHeo TXnP4NbbM10vii5MgdO9f9Y4cru9SG34peEy8CGFHbmuu4RVOA+yAmY4nYs1VjfiBTr3 lZoBlnP2CBw1rz8RkLGTaVWJ/17Gjd3rd1gJL1RYVi05pKyorajtdMe2WRnknA/xG05F atRA+Llqc/y2AabT+YBxOIVfB9MJuGpXeXMTxizzMw0/FJhemBlYtgL+9C3uMVHME7Lg c/tMu+P495sOr5l8Xd+VIc/XdNQKAonJC2Y4c66X7hpvA0nrQ4KMeMbe3Gjp2yY/djVo Yenw== X-Forwarded-Encrypted: i=1; AHgh+Ro+6OiI2nCsvszOhNoWtfrA7ifkFL+p1MdcKZL98WfyJ5XYNIMas5vjLOjELlaIHNiIe91TcO3eiq8VAu0=@vger.kernel.org X-Gm-Message-State: AFuF++ngwLicgHBZZ9qgy1bZDJ9/L1ZnY6M7MlyeVGvnz1R+uSyCfQJa bqUoJL94ERdKeNoUpemDf1hE6JGAVyPKlZvUpSSpXNKYYESTggkkhqf6lTUHABPBqw== X-Gm-Gg: AR+sD12G92XVoNiNqDr01i958hsArcH2ssEQ5Do3sla2eQe5F9C7LdOZfW8Pg1xkvML Jka2DUWe2lQ4p7g7lzTDggygdPAi5M5KvcAuPDAot870DUiOaw2iwX1R1QR01g9pW7qaV50grjn +4Dw00kss1nWxzjN3Kx1whwFfJArtjEaKV+TAW/nNUYrw1cx5lJwcIGHe+MlRA8JvhnrX55PKIF RD/jt/AsQ11wWv0fhL/VudG5neJeY7S2VnPme57+vVBdxIKtebvYKfQgpVkVXLfuMpM/L/28tGQ AXTrfhboi6hmAv7nmZrwuD6KRgmSHm6M3aLtsPSqq5pSrtJURkkcEugrhPx2yGSCFZ6KE6lJQwu xo6A4viGx2/4fDv/DwIKEvUjXa9UFyVUh5Qn/LRgv1X6VKyxzg8vv5QccqA7nfNv4Qzsv9ZfQkN Dh3019tb2iOHgYNgr2L8GbyKa8ZHFnu9ijmvOiDyMUVCDnNGejgqP9au+gtas6y9RlS2asqkAk+ R5NjGJjYZR47IhV8rsqaa358raa X-Received: by 2002:a05:6820:55ca:10b0:6ac:a539:bc41 with SMTP id 006d021491bc7-6b1a03e5c38mr696085eaf.12.1787682267892; Tue, 25 Aug 2026 11:24:27 -0700 (PDT) Received: from google.com (203.215.188.35.bc.googleusercontent.com. [35.188.215.203]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6b1a02566desm215005eaf.11.2026.08.25.11.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2026 11:24:27 -0700 (PDT) Date: Tue, 25 Aug 2026 18:24:25 +0000 From: Neill Kapron To: RD Babiera Cc: vkoul@kernel.org, peter.griffin@linaro.org, andre.draszik@linaro.org, tudor.ambarus@linaro.org, p.zabel@pengutronix.de, neil.armstrong@linaro.org, badhri@google.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6] phy: Add USB3 PHY support to Google Tensor SoC USB PHY driver Message-ID: References: <20260710172946.15633-2-rdbabiera@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260710172946.15633-2-rdbabiera@google.com> Hi RD, some minor comments below. On Fri, Jul 10, 2026 at 05:29:47PM +0000, RD Babiera wrote: > +#define GPHY_TCA_DELAY_US 10 > +#define GPHY_TCA_TIMEOUT_US 2500000 Do we really need a 2.5s timeout? ... > + > +static int wait_tca_xa_ack(struct google_usb_phy *gphy) > +{ > + int ret; > + u32 reg; > + > + ret = readl_poll_timeout(gphy->usb3_tca_base + TCA_INTR_STS_OFFSET, > + reg, !!(reg & TCA_INTR_STS_XA_ACT_EVT), > + GPHY_TCA_DELAY_US, GPHY_TCA_TIMEOUT_US); > + if (ret) > + dev_err(gphy->dev, "tca xa_ack timeout, ret=%d", ret); The dev_* calls throughout this patch should have trailing newline characters. > + > + return ret; > +} ... > static int google_usb_set_orientation(struct typec_switch_dev *sw, > enum typec_orientation orientation) > { > struct google_usb_phy *gphy = typec_switch_get_drvdata(sw); > + int ret = 0; > > dev_dbg(gphy->dev, "set orientation %d\n", orientation); > > - gphy->orientation = orientation; > + guard(mutex)(&gphy->phy_mutex); > > - if (pm_runtime_suspended(gphy->dev)) > - return 0; > + gphy->orientation = orientation; > > - guard(mutex)(&gphy->phy_mutex); > + if (IS_ENABLED(CONFIG_PM)) { > + if (pm_runtime_get_if_active(gphy->dev) <= 0) > + return 0; > + } > > set_vbus_valid(gphy); > > - return 0; > + if (gphy->phy_state == COMBO_PHY_TCA_READY && orientation != TYPEC_ORIENTATION_NONE) > + ret = program_tca_locked(gphy); > + > + pm_runtime_put_autosuspend(gphy->dev); Here you are using the _autosuspend variant, but autosuspend is never configured in probe(). Should this be changed to the plain pm_runtime_put(), or actually enable autosuspend in the probe function? > + > + return ret; > } ... > + > +static int google_usb3_phy_power_on(struct phy *_phy) > +{ > + struct google_usb_phy_instance *inst = phy_get_drvdata(_phy); > + struct google_usb_phy *gphy = inst->parent; > + int ret; > + > + dev_dbg(gphy->dev, "power on usb3 phy\n"); > + > + guard(mutex)(&gphy->phy_mutex); > + > + if (gphy->phy_state != COMBO_PHY_TCA_READY) { I think prior to this we should add a check if phy_state is COMBO_PHY_IDLE, return an error and change this check to phy_state == COMBO_PHY_INIT_DONE to make sure we are explicit in our state handling to prevent issues with any potential refactoring. > + /* Wait for PoR -> NC transitions*/ > + ret = wait_tca_xa_ack(gphy); > + if (ret) { > + dev_err(gphy->dev, "PoR->NC transition timeout"); > + return ret; > + } > + gphy->phy_state = COMBO_PHY_TCA_READY; > + } > + > + if (gphy->orientation != TYPEC_ORIENTATION_NONE) > + return program_tca_locked(gphy); > + > + return 0; > +} ... Thanks, Neill