From: Alan Stern <stern@rowland.harvard.edu>
To: Samuel Sadok <samuel.sadok@bluewin.ch>
Cc: USB list <linux-usb@vger.kernel.org>,
Mathias Nyman <mathias.nyman@intel.com>, <yu.c.chen@intel.com>,
<mironov.ivan@gmail.com>
Subject: Re: [BUG] SD card reader disappears after suspend
Date: Mon, 13 Jan 2020 10:15:02 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.44L0.2001131006400.1502-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <CAJ4e7SX=vJXx1=AQ+f9ajJK_BBgzV-u_vr9V+uLffyv4+vO+ug@mail.gmail.com>
On Mon, 13 Jan 2020, Samuel Sadok wrote:
> Hello,
>
> It's been a while that there was any discussion on this bug so here's
> a brief context: There's a bug on some MacBook Pro's where the
> built-in SD card reader would be missing after a suspend/resume cycle.
>
> After looking at the schematics for my laptop I noticed that
> `OC6*/GPIO10` of the Intel PCH is connected to a net called
> `SD_PWR_EN`. So I tried to set this pin to 0 and then to 1 again in
> order to completely power cycle the card reader. Turns out this
> finally makes the card reader appear after a suspend/resume cycle.
>
> For the record, here's the user space workaround:
> https://gist.github.com/samuelsadok/6d7b3e3015d3370a92ed4702e4d3c4b5#gistcomment-3134437
>
> Are there other buggy devices for which the kernel already implements
> such a power cycle? Otherwise, where would be the right place to add
> this?
This is a platform-specific solution, so it belongs in a
platform-specific region of the kernel. Any necessary changes would
mostly have to go outside the USB stack -- after all, GPIO lines aren't
USB devices.
If the kernel already contains some system-setup code specific to the
MacBook Pro, that's where such a fix belongs.
> Additional observations:
> - by default (after boot), GPIO10 is configured as input and shows
> the state "high". In the schematics there's a pull-up resistor. and I
> assume it goes to a mosfet (off-sheet). So the problem is not that the
> card reader has no power after suspend. It just needs a power cycle.
> - the card reader is connected to the PCH via the four USB3 data
> lines, but the two USB2 data lines are not connected. Is this a legal
> configuration? Might this prevent the card reader from receiving power
> state commands?
It is not allowed for a generic connection (i.e., to an external
device) but I think it's okay for something that's built into the
platform. It could prevent the card reader from working correctly if
for some reason the USB-3 signalling failed and the device tried to
switch over to USB-2 signalling.
On the other hand, there's no real reason I can think of for the card
reader to need a power cycle following resume. Fixing that problem,
whatever it is, would be a better solution.
Alan Stern
prev parent reply other threads:[~2020-01-13 15:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.44L0.1801251043430.1531-100000@iolanthe.rowland.org>
[not found] ` <396c2337-d9de-01fe-47f8-03d7a12d1b93@linux.intel.com>
[not found] ` <fb8553cb-0fce-2359-1266-c794c6fef7dc@linux.intel.com>
[not found] ` <CAJ4e7SVgU5cUrR=aRbQJntOXZs8na3A5jiLFQ6ZVagkTsuw5OA@mail.gmail.com>
[not found] ` <05b9ea64-fd85-b003-d764-cf610a0138c9@intel.com>
[not found] ` <b0681e13-92a3-a485-31d8-ab93c347c189@linux.intel.com>
[not found] ` <CAJ4e7SU0KUVGHGZCmarLmn8GUXUchFtQ9h_NVbW-ubWYKtCNZw@mail.gmail.com>
[not found] ` <3b197634-c51c-8cac-b786-42a36791b5b5@linux.intel.com>
2020-01-12 23:33 ` [BUG] SD card reader disappears after suspend Samuel Sadok
2020-01-13 15:15 ` Alan Stern [this message]
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=Pine.LNX.4.44L0.2001131006400.1502-100000@iolanthe.rowland.org \
--to=stern@rowland.harvard.edu \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=mironov.ivan@gmail.com \
--cc=samuel.sadok@bluewin.ch \
--cc=yu.c.chen@intel.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;
as well as URLs for NNTP newsgroup(s).