linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "M. Vefa Bicakci" <m.v.b@runbox.com>
To: linux-usb@vger.kernel.org
Cc: "M. Vefa Bicakci" <m.v.b@runbox.com>,
	Bastien Nocera <hadess@hadess.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Pany <pany@fedoraproject.org>
Subject: [PATCH 0/2] Patches to prevent re-probing all Apple USB devices on apple-mfi-fastcharge load
Date: Thu, 22 Oct 2020 09:55:19 -0400	[thread overview]
Message-ID: <20201022135521.375211-1-m.v.b@runbox.com> (raw)
In-Reply-To: <4cc0e162-c607-3fdf-30c9-1b3a77f6cf20@runbox.com>

Hello all,

This thread is intended to continue the thread at [1], where Pany
reported an issue involving the apple-mfi-fastcharge driver. The
bug in question causes a re-probe of all Apple USB devices when the
driver in question is loaded, including an Apple SD card reader,
which in turn causes a boot-up failure. (The original bug report
is in the RedHat Bugzilla at [2].)

These two patches aim to resolve this issue by implementing a match
function in the apple-mfi-fastcharge driver to ensure that this driver
is only matched with devices it is intended to be used with, and by
modifying the USB core to ensure that when a device driver has an
ID table and a match function, they are both taken into account.
(The previous behaviour did not check the result of the driver's
match() if the driver's id_table matched the device.)

These changes have been verified to not cause regressions on a
5.8.16-based kernel by (1) verifying apple-mfi-fastcharge behaviour
with an iPhone, (2) running the usbip regression test to ensure that
the changes in USB core are harmless to usbip, and (3) using the
patched kernel with other USB devices (a keyboard, a mouse and a
webcam). Greg Kroah-Hartman's usb-next tree has been verified to
compile with these patches and was briefly runtime tested as well.
(The base commit in usb-next is listed below.)

Credits: The first patch was co-developed by Bastien Nocera and
myself, with the main idea (i.e., the use of id_table *and* the
match function) coming from Bastien. The second patch was
developed solely by Bastien, and I only added a few tags to the
patch description.

Bastien, sorry for the delay!

Thank you,

Vefa

[1] https://lore.kernel.org/linux-usb/CAE3RAxt0WhBEz8zkHrVO5RiyEOasayy1QUAjsv-pB0fAbY1GSw@mail.gmail.com/
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1878347

Cc: Bastien Nocera <hadess@hadess.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Pany <pany@fedoraproject.org>

Bastien Nocera (2):
  usbcore: Check both id_table and match() when both available
  USB: apple-mfi-fastcharge: don't probe unhandled devices

 drivers/usb/core/driver.c               | 30 +++++++++++++++++--------
 drivers/usb/core/generic.c              |  4 +---
 drivers/usb/core/usb.h                  |  2 ++
 drivers/usb/misc/apple-mfi-fastcharge.c | 17 +++++++++-----
 4 files changed, 36 insertions(+), 17 deletions(-)


base-commit: 270315b8235e3d10c2e360cff56c2f9e0915a252
-- 
2.26.2


  reply	other threads:[~2020-10-22 13:55 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-17 16:07 Bug caused by 53965c79c2db (USB: Fix device driver race) Pany
2020-10-17 20:02 ` Alan Stern
2020-10-19  9:36   ` Pany
2020-10-19 17:40     ` Alan Stern
2020-10-20 12:03       ` M. Vefa Bicakci
2020-10-20 15:28         ` Alan Stern
2020-10-21  4:18           ` M. Vefa Bicakci
2020-10-21 11:53             ` Bastien Nocera
2020-10-21 12:02               ` Bastien Nocera
2020-10-21 12:29                 ` Alan Stern
2020-10-21 12:31                   ` Bastien Nocera
2020-10-21 13:01                 ` Bastien Nocera
2020-10-21 13:08               ` M. Vefa Bicakci
2020-10-21 13:18                 ` Bastien Nocera
2020-10-21 13:21                   ` Bastien Nocera
2020-10-21 20:11                   ` Alan Stern
2020-10-21 20:49                     ` M. Vefa Bicakci
2020-10-21 20:49                   ` M. Vefa Bicakci
2020-10-22 13:55                     ` M. Vefa Bicakci [this message]
2020-10-22 13:55                       ` [PATCH 1/2] usbcore: Check both id_table and match() when both available M. Vefa Bicakci
2020-10-22 13:59                         ` M. Vefa Bicakci
     [not found]                           ` <CAHp75VeBgQ2ywLzU5PZEdfS+9M_niD0KoiEG=UMNH+4cPfsCNw@mail.gmail.com>
2020-10-23 12:51                             ` M. Vefa Bicakci
2020-10-27 14:02                         ` Bastien Nocera
2020-10-28  4:00                           ` Pany
2020-10-29  3:33                             ` M. Vefa Bicakci
2020-10-29  5:35                               ` Pany
2020-10-22 13:55                       ` [PATCH 2/2] USB: apple-mfi-fastcharge: don't probe unhandled devices M. Vefa Bicakci
2020-10-27 14:02                         ` Bastien Nocera
2020-10-28  4:01                           ` Pany
2020-10-21  3:17         ` Bug caused by 53965c79c2db (USB: Fix device driver race) Pany
2020-10-21  4:18           ` M. Vefa Bicakci
2020-10-21  5:19             ` Pany

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=20201022135521.375211-1-m.v.b@runbox.com \
    --to=m.v.b@runbox.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hadess@hadess.net \
    --cc=linux-usb@vger.kernel.org \
    --cc=pany@fedoraproject.org \
    --cc=stern@rowland.harvard.edu \
    /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).