linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] soc: qcom: pmic_glink: v6.11-rc bug fixes
@ 2024-08-18 23:17 Bjorn Andersson
  2024-08-18 23:17 ` [PATCH 1/3] soc: qcom: pmic_glink: Fix race during initialization Bjorn Andersson
                   ` (5 more replies)
  0 siblings, 6 replies; 24+ messages in thread
From: Bjorn Andersson @ 2024-08-18 23:17 UTC (permalink / raw)
  To: Sebastian Reichel, Bjorn Andersson, Konrad Dybcio,
	Heikki Krogerus, Greg Kroah-Hartman, Neil Armstrong
  Cc: Johan Hovold, Chris Lew, Dmitry Baryshkov, Stephen Boyd,
	Amit Pundir, linux-arm-msm, linux-pm, linux-kernel, linux-usb,
	Bjorn Andersson, Johan Hovold, stable

Amit and Johan both reported a NULL pointer dereference in the
pmic_glink client code during initialization, and Stephen Boyd pointed
out the problem (race condition).

While investigating, and writing the fix, I noticed that
ucsi_unregister() is called in atomic context but tries to sleep, and I
also noticed that the condition for when to inform the pmic_glink client
drivers when the remote has gone down is just wrong.

So, let's fix all three.

As mentioned in the commit message for the UCSI fix, I have a series in
the works that makes the GLINK callback happen in a sleepable context,
which would remove the need for the clients list to be protected by a
spinlock, and removing the work scheduling. This is however not -rc
material...

In addition to the NULL pointer dereference, there is the -ECANCELED
issue reported here:
https://lore.kernel.org/all/Zqet8iInnDhnxkT9@hovoldconsulting.com/
I have not yet been able to either reproduce this or convince myself
that this is the same issue.

Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
Bjorn Andersson (3):
      soc: qcom: pmic_glink: Fix race during initialization
      usb: typec: ucsi: Move unregister out of atomic section
      soc: qcom: pmic_glink: Actually communicate with remote goes down

 drivers/power/supply/qcom_battmgr.c   | 16 ++++++++-----
 drivers/soc/qcom/pmic_glink.c         | 40 +++++++++++++++++++++----------
 drivers/soc/qcom/pmic_glink_altmode.c | 17 +++++++++-----
 drivers/usb/typec/ucsi/ucsi_glink.c   | 44 ++++++++++++++++++++++++++---------
 include/linux/soc/qcom/pmic_glink.h   | 11 +++++----
 5 files changed, 88 insertions(+), 40 deletions(-)
---
base-commit: 296c871d2904cff2b4742702ef94512ab467a8e3
change-id: 20240818-pmic-glink-v6-11-races-363f5964c339

Best regards,
-- 
Bjorn Andersson <quic_bjorande@quicinc.com>


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-08-20  7:31 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-18 23:17 [PATCH 0/3] soc: qcom: pmic_glink: v6.11-rc bug fixes Bjorn Andersson
2024-08-18 23:17 ` [PATCH 1/3] soc: qcom: pmic_glink: Fix race during initialization Bjorn Andersson
2024-08-19  9:15   ` Neil Armstrong
2024-08-19 13:20   ` Heikki Krogerus
2024-08-18 23:17 ` [PATCH 2/3] usb: typec: ucsi: Move unregister out of atomic section Bjorn Andersson
2024-08-19  1:16   ` Dmitry Baryshkov
2024-08-19  3:05     ` Bjorn Andersson
2024-08-19  7:32       ` Dmitry Baryshkov
2024-08-19  9:16   ` Neil Armstrong
2024-08-19 13:27   ` Heikki Krogerus
2024-08-19 15:06   ` Johan Hovold
2024-08-19 16:45     ` Bjorn Andersson
2024-08-20  6:34       ` Johan Hovold
2024-08-19 15:33   ` Johan Hovold
2024-08-18 23:17 ` [PATCH 3/3] soc: qcom: pmic_glink: Actually communicate with remote goes down Bjorn Andersson
2024-08-19  1:09   ` Dmitry Baryshkov
2024-08-19  9:16   ` Neil Armstrong
2024-08-19 13:33   ` Heikki Krogerus
2024-08-19 10:12 ` [PATCH 0/3] soc: qcom: pmic_glink: v6.11-rc bug fixes Amit Pundir
2024-08-19 14:07 ` Greg Kroah-Hartman
2024-08-19 14:56   ` Bjorn Andersson
2024-08-19 15:48 ` Johan Hovold
2024-08-19 16:53   ` Bjorn Andersson
2024-08-20  7:31     ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).