All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Kepplinger <martin.kepplinger@puri.sm>
To: jejb@linux.ibm.com, martin.petersen@oracle.com,
	stern@rowland.harvard.edu, bvanassche@acm.org
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Martin Kepplinger <martin.kepplinger@puri.sm>
Subject: [PATCH v2 0/3] scsi: add runtime PM workaround for SD cardreaders
Date: Tue, 12 Jan 2021 10:33:26 +0100	[thread overview]
Message-ID: <20210112093329.3639-1-martin.kepplinger@puri.sm> (raw)

revision history
----------------
v2:
 * move module parameter to sd
 * add Documentation

v1:
https://lore.kernel.org/linux-scsi/20210111152029.28426-1-martin.kepplinger@puri.sm/T/#t



hi,

In short: there are SD cardreaders that send MEDIA_CHANGED on
runtime resume. We cannot use runtime PM with these devices as
I/O basically always fails. I'd like to discuss a way to fix this
or at least allow users to work around this problem:

For the full background, the discussion started in June 2020 here:
https://lore.kernel.org/linux-scsi/20200623111018.31954-1-martin.kepplinger@puri.sm/

and I sent the first of these patches in August, as a reference:
https://lore.kernel.org/linux-scsi/20200824190400.12339-1-martin.kepplinger@puri.sm/
so this is where I'm following up on.

I'm not sure whether maintaining an in-kernel quirk for specific devices
makes sense so here I suggest adding a userspace knob. This way there's at
least a chance to use runtime PM for sd cardreaders that send MEDIA_CHANGED.

I'd appreciate any feedback.

Martin Kepplinger (3):
  scsi: add expecting_media_change flag to error path
  scsi: sd: add ignore_resume_medium_changed disk setting
  scsi: sd: Documentation: describe ignore_resume_medium_changed

 Documentation/scsi/sd-parameters.rst | 14 ++++++++
 drivers/scsi/scsi_error.c            | 36 +++++++++++++++++---
 drivers/scsi/sd.c                    | 50 +++++++++++++++++++++++++++-
 drivers/scsi/sd.h                    |  1 +
 include/scsi/scsi_device.h           |  1 +
 5 files changed, 96 insertions(+), 6 deletions(-)

-- 
2.20.1


             reply	other threads:[~2021-01-12  9:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12  9:33 Martin Kepplinger [this message]
2021-01-12  9:33 ` [PATCH v2 1/3] scsi: add expecting_media_change flag to error path Martin Kepplinger
2021-01-12  9:33 ` [PATCH v2 2/3] scsi: sd: add ignore_resume_medium_changed disk setting Martin Kepplinger
2021-01-12  9:33 ` [PATCH v2 3/3] scsi: sd: Documentation: describe ignore_resume_medium_changed Martin Kepplinger
2021-03-27 10:48 ` [PATCH v2 0/3] scsi: add runtime PM workaround for SD cardreaders Martin Kepplinger
2021-03-27 16:01   ` Bart Van Assche

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=20210112093329.3639-1-martin.kepplinger@puri.sm \
    --to=martin.kepplinger@puri.sm \
    --cc=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.