From: Abel Vesa <abel.vesa@linaro.org>
To: Bjorn Andersson <andersson@kernel.org>
Cc: Johan Hovold <johan@kernel.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Rajendra Nayak <quic_rjendra@quicinc.com>,
Sibi Sankar <quic_sibis@quicinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Trilok Soni <quic_tsoni@quicinc.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 2/6] usb: typec: Add support for Parade PS8830 Type-C Retimer
Date: Sat, 7 Dec 2024 23:45:19 +0200 [thread overview]
Message-ID: <Z1TB7wQ3FkCdybmX@linaro.org> (raw)
In-Reply-To: <v7konhz4x7fzfseyeyiazcw35zqmpjb6tjv5ukdlttzs74ykgb@lpftcociq257>
On 24-12-05 17:05:17, Bjorn Andersson wrote:
> On Wed, Dec 04, 2024 at 05:24:54PM +0100, Johan Hovold wrote:
> > On Tue, Nov 12, 2024 at 07:01:11PM +0200, Abel Vesa wrote:
> > > The Parade PS8830 is a USB4, DisplayPort and Thunderbolt 4 retimer,
> > > controlled over I2C. It usually sits between a USB/DisplayPort PHY
> > > and the Type-C connector, and provides orientation and altmode handling.
> > >
> > > The boards that use this retimer are the ones featuring the Qualcomm
> > > Snapdragon X Elite SoCs.
> >
> > > +static int ps883x_sw_set(struct typec_switch_dev *sw,
> > > + enum typec_orientation orientation)
> > > +{
> > > + struct ps883x_retimer *retimer = typec_switch_get_drvdata(sw);
> > > + int ret = 0;
> > > +
> > > + ret = typec_switch_set(retimer->typec_switch, orientation);
> > > + if (ret)
> > > + return ret;
> > > +
> > > + mutex_lock(&retimer->lock);
> > > +
> > > + if (retimer->orientation != orientation) {
> > > + retimer->orientation = orientation;
> > > +
> > > + ret = ps883x_set(retimer);
> > > + }
> > > +
> > > + mutex_unlock(&retimer->lock);
> > > +
> > > + return ret;
> > > +}
> >
> > This seems to indicate a bigger problem, but I see this function called
> > during early resume while the i2c controller is suspended:
> >
> > [ 54.213900] ------------[ cut here ]------------
> > [ 54.213942] i2c i2c-2: Transfer while suspended
> > [ 54.214125] WARNING: CPU: 0 PID: 126 at drivers/i2c/i2c-core.h:56 __i2c_transfer+0x874/0x968 [i2c_core]
> > ...
> > [ 54.214833] CPU: 0 UID: 0 PID: 126 Comm: kworker/0:2 Not tainted 6.13.0-rc1 #11
> > [ 54.214844] Hardware name: Qualcomm CRD, BIOS 6.0.231221.BOOT.MXF.2.4-00348.1-HAMOA-1 12/21/2023
> > [ 54.214852] Workqueue: events pmic_glink_altmode_worker [pmic_glink_altmode]
> > ...
> > [ 54.215090] Call trace:
> > [ 54.215097] __i2c_transfer+0x874/0x968 [i2c_core] (P)
> > [ 54.215112] __i2c_transfer+0x874/0x968 [i2c_core] (L)
> > [ 54.215126] i2c_transfer+0x94/0xf0 [i2c_core]
> > [ 54.215140] i2c_transfer_buffer_flags+0x5c/0x90 [i2c_core]
> > [ 54.215153] regmap_i2c_write+0x20/0x58 [regmap_i2c]
> > [ 54.215166] _regmap_raw_write_impl+0x740/0x894
> > [ 54.215184] _regmap_bus_raw_write+0x60/0x7c
> > [ 54.215192] _regmap_write+0x60/0x1b4
> > [ 54.215200] regmap_write+0x4c/0x78
> > [ 54.215207] ps883x_set+0xb0/0x10c [ps883x]
> > [ 54.215219] ps883x_sw_set+0x74/0x98 [ps883x]
> > [ 54.215227] typec_switch_set+0x58/0x90 [typec]
> > [ 54.215248] pmic_glink_altmode_worker+0x3c/0x23c [pmic_glink_altmode]
> > [ 54.215257] process_one_work+0x20c/0x610
> > [ 54.215274] worker_thread+0x23c/0x378
> > [ 54.215283] kthread+0x124/0x128
> > [ 54.215291] ret_from_fork+0x10/0x20
> > [ 54.215303] irq event stamp: 28140
> > [ 54.215309] hardirqs last enabled at (28139): [<ffffd15e3bc2a434>] __up_console_sem+0x6c/0x80
> > [ 54.215325] hardirqs last disabled at (28140): [<ffffd15e3c596aa4>] el1_dbg+0x24/0x8c
> > [ 54.215341] softirqs last enabled at (28120): [<ffffd15e3bb9b82c>] handle_softirqs+0x4c4/0x4dc
> > [ 54.215355] softirqs last disabled at (27961): [<ffffd15e3bb501ec>] __do_softirq+0x14/0x20
> > [ 54.215363] ---[ end trace 0000000000000000 ]---
> > [ 54.216889] Enabling non-boot CPUs ...
> >
> > This can be reproduced on the CRD (or T14s) by disconnecting, for
> > example, a mass storage device while the laptop is suspended.
> >
>
> I wonder if this is because drivers/rpmsg/qcom_glink_smem.c line 309
> registers the GLINK interrupt as IRQF_NO_SUSPEND as a remnant from being
> used for rpm communication...
Yes. Seems like dropping the flag fixes this.
>
> This is no longer needed (glink/rpm code path is now different), but
> iirc the cleanup got stuck in the question of dealing with wakeup
> capabilities (and priorities).
I'll send a patch to drop the flag and we then can debate there if it's
the right thing to do w.r.t. wakeup.
>
> Regards,
> Bjorn
next prev parent reply other threads:[~2024-12-07 21:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 17:01 [PATCH v5 0/6] usb: typec: Add new driver for Parade PS8830 Type-C Retimer Abel Vesa
2024-11-12 17:01 ` [PATCH v5 1/6] dt-bindings: usb: Add Parade PS8830 Type-C retimer bindings Abel Vesa
2024-11-15 16:44 ` Rob Herring
2024-11-12 17:01 ` [PATCH v5 2/6] usb: typec: Add support for Parade PS8830 Type-C Retimer Abel Vesa
2024-12-04 16:24 ` Johan Hovold
2024-12-05 23:05 ` Bjorn Andersson
2024-12-07 21:45 ` Abel Vesa [this message]
2025-01-06 14:14 ` Abel Vesa
2025-01-07 9:46 ` Johan Hovold
2024-11-12 17:01 ` [PATCH v5 3/6] arm64: dts: qcom: x1e80100-crd: Describe the Parade PS8830 retimers Abel Vesa
2024-11-12 17:01 ` [PATCH v5 4/6] arm64: dts: qcom: x1e80100-crd: Enable external DisplayPort support Abel Vesa
2024-11-12 17:05 ` Abel Vesa
2024-11-13 6:03 ` Greg Kroah-Hartman
2025-01-06 14:24 ` Abel Vesa
2024-11-12 17:01 ` [PATCH v5 5/6] arm64: dts: qcom: x1e80100-t14s: Describe the Parade PS8830 retimers Abel Vesa
2024-11-12 17:01 ` [PATCH v5 6/6] arm64: dts: qcom: x1e80100-t14s: Enable external DisplayPort support Abel Vesa
2024-11-12 17:05 ` Abel Vesa
2024-11-15 15:13 ` [PATCH v5 0/6] usb: typec: Add new driver for Parade PS8830 Type-C Retimer Rob Herring (Arm)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z1TB7wQ3FkCdybmX@linaro.org \
--to=abel.vesa@linaro.org \
--cc=andersson@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=johan@kernel.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=quic_rjendra@quicinc.com \
--cc=quic_sibis@quicinc.com \
--cc=quic_tsoni@quicinc.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.