Linux USB
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Linyu Yuan <quic_linyyuan@quicinc.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, Jack Pham <quic_jackp@quicinc.com>,
	Wesley Cheng <quic_wcheng@quicinc.com>,
	Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>,
	Fenglin Wu <quic_fenglinw@quicinc.com>
Subject: Re: [PATCH v2] usb: ucsi: fix connector partner ucsi work issue
Date: Thu, 5 Jan 2023 13:27:07 +0200	[thread overview]
Message-ID: <Y7a0C+DkI5Q6hq6O@kuha.fi.intel.com> (raw)
In-Reply-To: <1672897360-24257-1-git-send-email-quic_linyyuan@quicinc.com>

Hi,

On Thu, Jan 05, 2023 at 01:42:40PM +0800, Linyu Yuan wrote:
> When a PPM client unregisters with UCSI framework, connector specific work
> queue is destroyed. However, a pending delayed work queued before may
> still exist. Once the delay timer expires and the work is scheduled,
> this can cause a system crash as the workqueue is destroyed already.

When the workqueue is destroyed it's also flushed, no? So how could
there be still something pending, delayed or not? Did you actually see
this happening?

> Fix this by moving all partner related delayed work to connector instance
> and cancel all of them when ucsi_unregister() is called by PPM client.

I would love to be able to cancel these works, though not because of
driver removal - I'm more concerned about disconnections. The reason
why each task is a unique work is because it allows the driver to add
the same task to the queue as many times as needed, and that was
needed inorder to recover from some firmware issues. If there's only a
dedicated work per task like in your proposal, we can only schedule
the task once at a time, and that may lead into other issues.

But first things first. Is the problem that you are describing here a
real problem that can actually happen?

thanks,

-- 
heikki

  reply	other threads:[~2023-01-05 11:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05  5:42 [PATCH v2] usb: ucsi: fix connector partner ucsi work issue Linyu Yuan
2023-01-05 11:27 ` Heikki Krogerus [this message]
2023-01-05 18:34   ` Jack Pham
2023-01-09 11:49     ` Heikki Krogerus
2023-01-09 20:46       ` Jack Pham

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=Y7a0C+DkI5Q6hq6O@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_fenglinw@quicinc.com \
    --cc=quic_jackp@quicinc.com \
    --cc=quic_linyyuan@quicinc.com \
    --cc=quic_subbaram@quicinc.com \
    --cc=quic_wcheng@quicinc.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox