Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3521181pxb; Tue, 12 Jan 2021 17:27:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpnXb8WsN58h4gnUFU7TLzxADHBAsCWuCScSGkYl22WHUcOPFoEpjaWyEvHqqgU5mzcp0W X-Received: by 2002:a17:906:5043:: with SMTP id e3mr1110592ejk.260.1610501259890; Tue, 12 Jan 2021 17:27:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610501259; cv=none; d=google.com; s=arc-20160816; b=aGoYsu1dWF+cItbg1iZXrIw/q5GXKC85/0Ql8PDF9s6ZzrvdqnC/EiSvgiTe++3+i8 qO5Jd3CfDjrlwZc3V8Cu1IdOlZyfdqsGyQSFvi7XlOl3ugnt6lgFKSEBuQ9uQGnxuIUy NoKrixVMd6R8mWECQqtqw+RQvsPTMPGNk7ISzvs/SjowGBG84xlXY+/H8GXTVjgN3Xs5 4LtTMgiXe44wU9AhzhGRjetrVPyGcy+XGQDcKBRD8J+VWyDrc1GqDINqM5o+R59BT83a SE5qVjpWwNYk2d0XrSOIe6vJf1s62CLFZAd5R0i8UmiluDmpJAkKUZ6DkPQPNxGlwTtT mu5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:date :subject:cc:to:from; bh=vUDDrLAoIBwvncrBk0AQulrW7WPAFSnSqBpPMt7EaGc=; b=XCCWSksYwboTfBw4oscBEHS5PSH0Yf7uQ0zKAp8sv7GvEKy0lDYjIbAGbjC1N0hBTZ 6/juAW77y+fBMfmVeakUmAYbvrCr8IgKYv1zje1fg1GacyjvnKpm3FKNoUnnd2NW6FCn kpnMeUCUhf+BdSavtbLJMpddU06ZvvOF/iWIEf9RCaYA00CbkeCFllhdSaPpbpKNDlJ/ thnVHfeGtua62U/mlNzbY82QgK/t819RXL03zOuz3DehBiNaxI2j1q0BGZwVK5njd73N vArraRJ/QcnAq4fsHZFkbJGAGPsWtKCUTGpFuNp7RR9kAF7z2A6EIm91/nyNt1D/LnV5 N0Ig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s5si203446ejz.284.2021.01.12.17.27.16; Tue, 12 Jan 2021 17:27:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405954AbhALJfA (ORCPT + 99 others); Tue, 12 Jan 2021 04:35:00 -0500 Received: from comms.puri.sm ([159.203.221.185]:33640 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731123AbhALJe7 (ORCPT ); Tue, 12 Jan 2021 04:34:59 -0500 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 8BBC8DFDE2; Tue, 12 Jan 2021 01:33:49 -0800 (PST) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bBp79AYO0gXz; Tue, 12 Jan 2021 01:33:48 -0800 (PST) From: Martin Kepplinger 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 Subject: [PATCH v2 0/3] scsi: add runtime PM workaround for SD cardreaders Date: Tue, 12 Jan 2021 10:33:26 +0100 Message-Id: <20210112093329.3639-1-martin.kepplinger@puri.sm> Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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