Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2828996pxf; Sun, 28 Mar 2021 03:31:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6UzJmdO3CCK9XJwukA/IG/dLomimvmdIv0VV2aQP4EoYc/RDPaSZFlH1t2AsvZDgIRpWe X-Received: by 2002:a17:907:6289:: with SMTP id nd9mr23710700ejc.384.1616927464679; Sun, 28 Mar 2021 03:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616927464; cv=none; d=google.com; s=arc-20160816; b=BhGX2IbKF5RVmvxJMF0kkTBxyd8k7lMdnZfCVHathVTtc5yY1hLPmue0xx85oSZ/JK mH8kpUeqI8Q2kOBae6dASlSn9hN6D1QsIxHEZAxi93SuVvt06/DY4gsxArC/XMP69gOP iGftoEVe0+OWwZ2JG2bMDGZvmPgJ5ycN8qoMzhMABEc9Pq7K0TYAsGsjkrINi8uYMQ9q nsctCeEQlOKF/PvwlNjKFyc/r6LXpGtTKFRLqO5kSIyVI8Uiw9KOhqXabdVb9/d83CeM ilRFM/YtWbwtJcKXkYO7Gi1fqtatZpE2RE1JFf+7KWngzHFkcCtuCWp2pYiaGY7Iwkld TDXQ== 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=YnLfzixRyfPjuWkZcMb8XKCehMsORjx0EtBIOMrdOso=; b=Y4fiuzWOWZWJScnpoY55y4Ca3mWXdBq1zej9pKaKkOOy6E/VRBBWak8edrFkaEp979 s6PDmisioYWjJOtQ72CUIb8Lops2Nf5656gCQnxIODkQmtqWytvbEVDV7OQ0ynOmsCh8 clAFq7W4s7uXF+/hkLRRwvIw7XiyvXadz1U5LBBtBCArsrKRrVWaCzd+LMV1OrjqTcdV jMzdc0iDluAGAJAswK8M0aq2+ph4r6sHnuxnPEv6nd7Xatxnr2wdnBbFfFFapjGv8ZTU gES4lDgX0Fwyj3MYX6PBIHq62ac4ttUCiJyb7n7TkqbaegXii+vWjNtfn2yqxsXrC438 Gd6g== 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 g20si4526539edw.610.2021.03.28.03.30.29; Sun, 28 Mar 2021 03:31:04 -0700 (PDT) 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 S231142AbhC1K0G (ORCPT + 99 others); Sun, 28 Mar 2021 06:26:06 -0400 Received: from comms.puri.sm ([159.203.221.185]:56124 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbhC1KZr (ORCPT ); Sun, 28 Mar 2021 06:25:47 -0400 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id E8A3DE01BD; Sun, 28 Mar 2021 03:25:46 -0700 (PDT) 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 tEz7Z80CCxMY; Sun, 28 Mar 2021 03:25:45 -0700 (PDT) From: Martin Kepplinger To: martin.kepplinger@puri.sm Cc: bvanassche@acm.org, jejb@linux.ibm.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org, martin.petersen@oracle.com, stern@rowland.harvard.edu Subject: [PATCH v3 0/4] scsi: add runtime PM workaround for SD cardreaders Date: Sun, 28 Mar 2021 12:25:27 +0200 Message-Id: <20210328102531.1114535-1-martin.kepplinger@puri.sm> Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 always fails. I'd like to discuss a way to fix this or at least allow us 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/ I'd appreciate any feedback. Especially: Any naming-preferences for the flags? And is the specific device that I need this workaround for (Generic Ultra HS-SD/MMC, connected via USB) too "generic" maybe? Not sure about what possibilities I'd have here... revision history ---------------- v3: (thank you Bart) * create a new BLIST entry to mark affected devices instead of the sysfs module parameter for sd only. still, only sd implements handling the flag for now. * cc linux-pm list v2: https://lore.kernel.org/linux-scsi/20210112093329.3639-1-martin.kepplinger@puri.sm/ * move module parameter to sd * add Documentation v1: https://lore.kernel.org/linux-scsi/20210111152029.28426-1-martin.kepplinger@puri.sm/T/ Martin Kepplinger (4): scsi: add expecting_media_change flag to error path scsi: devinfo: add new flag BLIST_MEDIA_CHANGE scsi: sd: use expecting_media_change for BLIST_MEDIA_CHANGE devices scsi: devinfo: add BLIST_MEDIA_CHANGE for Ultra HS-SD/MMC usb cardreaders drivers/scsi/scsi_devinfo.c | 1 + drivers/scsi/scsi_error.c | 36 +++++++++++++++++++++++++++++++----- drivers/scsi/sd.c | 23 ++++++++++++++++++++++- include/scsi/scsi_device.h | 1 + include/scsi/scsi_devinfo.h | 6 +++--- 5 files changed, 58 insertions(+), 9 deletions(-) -- 2.30.2