linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH 0/4] usb: typec: ucsi: Fix various locking issues
Date: Thu, 13 Aug 2020 14:07:13 +0300	[thread overview]
Message-ID: <20200813110713.GG1169992@kuha.fi.intel.com> (raw)
In-Reply-To: <20200809141904.4317-1-hdegoede@redhat.com>

On Sun, Aug 09, 2020 at 04:19:00PM +0200, Hans de Goede wrote:
> Hi Heikki, et al.,
> 
> As discussed before here is my fix for the AB BA lock inversion issue
> which lockdep found in the ucsi code.
> 
> While working on the AB BA fix I added a
> WARN_ON(!mutex_is_locked(&ucsi->ppm_lock)) to ucsi_run_command() and
> that found me some more unrelated issues of ucsi_run_command() getting
> called without the ppm_lock held. This is fixed in the second patch.
> This made me realize that the ppm_lock handling should probably just
> be pushed down to inside ucsi_run_command() instead of letting the
> callers worry about this.
> 
> In essence the first 3 patches are all related and all boil down to
> push the ppm_lock handling down into ucsi_run_command(), removing the
> difference between ucsi_run_command() and ucsi_send_command(). I have
> been thinking that we may want to just squash these 3 together. I've
> left them as separate patches now as thet document how I go to the
> end result after the 3th patch and having them separate might be
> easier for reviewing purposes. Let me know if you want a v2 of this
> patchset with them squashed into a single "usb: typec: ucsi: Rework
> ppm_lock handling" commit (with the commit messages merged).
> 
> The 4th patch makes the also already discussed change of holding
> con->lock for the entire duration of ucsi_register_port().

I'm fine with having them in separate pathes like that. This all looks
good to me. Thanks for fixing this. For the whole series:

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>


-- 
heikki

  parent reply	other threads:[~2020-08-13 11:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-09 14:19 [PATCH 0/4] usb: typec: ucsi: Fix various locking issues Hans de Goede
2020-08-09 14:19 ` [PATCH 1/4] usb: typec: ucsi: Fix AB BA lock inversion Hans de Goede
2020-08-19 23:56   ` Sasha Levin
2020-08-26 13:54   ` Sasha Levin
2020-08-09 14:19 ` [PATCH 2/4] usb: typec: ucsi: Fix 2 unlocked ucsi_run_command calls Hans de Goede
2020-08-13 16:25   ` Sasha Levin
2020-08-19 23:56   ` Sasha Levin
2020-08-26 13:53   ` Sasha Levin
2020-08-09 14:19 ` [PATCH 3/4] usb: typec: ucsi: Rework ppm_lock handling Hans de Goede
2020-08-13 16:25   ` Sasha Levin
2020-08-19 23:56   ` Sasha Levin
2020-08-26 13:53   ` Sasha Levin
2020-08-09 14:19 ` [PATCH 4/4] usb: typec: ucsi: Hold con->lock for the entire duration of ucsi_register_port() Hans de Goede
2020-08-13 16:25   ` Sasha Levin
2020-08-19 23:56   ` Sasha Levin
2020-08-26 13:53   ` Sasha Levin
2020-08-13 11:07 ` Heikki Krogerus [this message]
2020-08-13 13:48   ` [PATCH 0/4] usb: typec: ucsi: Fix various locking issues Guenter Roeck

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=20200813110713.GG1169992@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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;
as well as URLs for NNTP newsgroup(s).