Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2896900rwe; Mon, 29 Aug 2022 02:09:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR7POI3DQgzaoMe7bXsgyysb7rYB8iZgIrc11cxgcasSHpYgDMhzpb5DX9SriZ5AkJSRyVgY X-Received: by 2002:a17:907:7e92:b0:741:5f7e:f1ac with SMTP id qb18-20020a1709077e9200b007415f7ef1acmr5300070ejc.176.1661764156498; Mon, 29 Aug 2022 02:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661764156; cv=none; d=google.com; s=arc-20160816; b=cHtEmfobLI3mcTHqKuRjL0RFV+sEHjFx8oPXWruD7PJN5l+vxr4REdV7HDPdzMpapA gwk5+eGksZZV4wUGgmbktZBROV28efAX4b4ALuCBLicP0CFLboS5nQmZA8F0y7vwpOgB +kR/AZ6KRCeETIOenPvqXHQx56tljNniNPB5lMcxgnI3m1ScBO4jBHUiP6Qo9wpPFXbJ MU+evWmZt/RaJRmitYqm+OZTxR/uzRx7hgvfBbM/egwfxyUFIQGST/BS8Osk2BNO0n74 FpDRMKhx812AO9JypVSX9f2h7ScwRPEFoApOvK1OnHV0AyFCam46MaAPGDm2cwis6aPp hNMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=dvJbPkulTRMUdRp+qJIJHdCi2/u3RtC8spBF+E446wQ=; b=KU30UzMH5ksvaPSpigAN0bW64Vi4Hc1tsKuM67xHD2qVATXNq788x/wsco0g1qB2vM t2ozxnIhYDDTZJOm39F77kFvFhgbI3LgaBk4mjtI0ZyUwN//EyW4mJSzr9HJUfSMtkP9 GQHrSg72+XEY1R8vvje5uMxvcYIiUUhnScz5W3mumnvh5TXSBMEm/n1U2JfAPzjIPX94 f+8GGEFOsl6PdgexYYujRWJ0Kd8ynOUeK7olbp9Cp7qiML4O8bRN1Aqb+bIwqQANtsCW /TMqsUlB7jL1DoYVxdHpluF6BggENjCAdsHLFQYCCgWs7awQ1iYc0RTVg5D43QBa/NP1 bmRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w20-20020a056402269400b004486b3296aasi2661928edd.511.2022.08.29.02.08.50; Mon, 29 Aug 2022 02:09:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229597AbiH2JGy (ORCPT + 99 others); Mon, 29 Aug 2022 05:06:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiH2JGw (ORCPT ); Mon, 29 Aug 2022 05:06:52 -0400 Received: from out29-170.mail.aliyun.com (out29-170.mail.aliyun.com [115.124.29.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA01657E38; Mon, 29 Aug 2022 02:06:49 -0700 (PDT) X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07815871|-1;BR=01201311R101S09rulernew998_84748_2000303;CH=blue;DM=|CONTINUE|false|;DS=CONTINUE|ham_regular_dialog|0.00625813-0.00362955-0.990112;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047199;MF=michael@allwinnertech.com;NM=1;PH=DS;RN=5;RT=5;SR=0;TI=SMTPD_---.P2U-Gt-_1661764004; Received: from 192.168.220.136(mailfrom:michael@allwinnertech.com fp:SMTPD_---.P2U-Gt-_1661764004) by smtp.aliyun-inc.com; Mon, 29 Aug 2022 17:06:47 +0800 Message-ID: Date: Mon, 29 Aug 2022 17:06:44 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] scsi: core: Fix block I/O error of USB card reader during resume Content-Language: en-US To: Bart Van Assche , jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220817083438.118293-1-michael@allwinnertech.com> <6412c518-426a-69a4-e419-83dc97bebe27@allwinnertech.com> <5ba28a61-0aa2-14d7-61f0-0e9316844f70@acm.org> From: Michael Wu In-Reply-To: <5ba28a61-0aa2-14d7-61f0-0e9316844f70@acm.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/27/2022 6:05 AM, Bart Van Assche wrote: > On 8/23/22 03:16, Michael Wu wrote: >> Yes... My patch did seem suspicious. Here's the scene about the block >> I/O error: Some card reader does not respond the command 'MEDIUM >> REMOVAL PREVENT' correctly, as a result, the host does not send >> subsequent cmd 'MEDIUM REMOVAL ALLOW'/'MEDIUM REMOVAL PREVENT' >> before/after sleep, which leads to a enumeration failure after system >> resume. >> I wonder, without changing the behavior of the device, is there's a >> better way to solve this? -- Modifying the scsi core should not be a >> good idea though :( > > The above is not clear to me. My understanding is that "MEDIUM REMOVAL > PREVENT" is a sense code instead of a SCSI command? > >> Thanks for your kindly notice. I looked around in the latest linux >> mainline repo, but could not find this code. Where can I get this 2002 >> version of scsi_lib.c? Thank you. > > Please take a look at > https://stackoverflow.com/questions/3264283/linux-kernel-historical-git-repository-with-full-history. > That web page has instructions for how to configure a git repository > such that history goes back before the time when Linus started using git. > > Bart. > Dear Bart, Thank you. I'll try to figure it out and sync to you later. -- Regards, Michael Wu