From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E781CC43381 for ; Wed, 27 Jan 2021 08:57:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6A9020754 for ; Wed, 27 Jan 2021 08:57:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233113AbhA0I5E (ORCPT ); Wed, 27 Jan 2021 03:57:04 -0500 Received: from m42-8.mailgun.net ([69.72.42.8]:39915 "EHLO m42-8.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233362AbhA0Iyy (ORCPT ); Wed, 27 Jan 2021 03:54:54 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1611737659; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=EUssQP2vZo9f1NeJLiuievSQB3Q8g6yl/yOnTsJJnrY=; b=iZCbqbZ6RNPbHee+S/XWvUoQDY26ljCeA+x/MlgjuDKghB4hVjWTudOC2dKfr03Xp5W0ckg/ 2fjcLlyODPIxf9hJW0UUFhUPpKCnw8bu9eWXfie87TrARex+H+vsPyk594V05kXVDT9x8lSf if455TgDCjycl01z/dzFKWjlgII= X-Mailgun-Sending-Ip: 69.72.42.8 X-Mailgun-Sid: WyI0MmE5NyIsICJsaW51eC1ibG9ja0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-west-2.postgun.com with SMTP id 60112a21a8db642432e346ab (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 27 Jan 2021 08:53:53 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 31DF8C43462; Wed, 27 Jan 2021 08:53:53 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: cang) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9273BC433CA; Wed, 27 Jan 2021 08:53:52 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 27 Jan 2021 16:53:52 +0800 From: Can Guo To: Avri Altman Cc: Asutosh Das , martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org, stern@rowland.harvard.edu, "Bao D . Nguyen" , FUJITA Tomonori , Jens Axboe , "open list:BLOCK LAYER" , open list Subject: Re: [RFC PATCH v1 1/2] block: bsg: resume scsi device before accessing In-Reply-To: <75c66862d61c63fcfa61cd6dce254169@codeaurora.org> References: <75c66862d61c63fcfa61cd6dce254169@codeaurora.org> Message-ID: <19e1d785e5fb3d8ee79bf55758ef2dcf@codeaurora.org> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On 2021-01-27 15:59, Can Guo wrote: > On 2021-01-27 15:09, Avri Altman wrote: >>> >>> Resumes the scsi device before accessing it. >>> >>> Change-Id: I2929af60f2a92c89704a582fcdb285d35b429fde >>> Signed-off-by: Asutosh Das >>> Signed-off-by: Can Guo >>> Signed-off-by: Bao D. Nguyen >> Following this patch, is it possible to revert commit 74e5e468b664d? >> > > No, but this is a good finding... This change assumes > that the queue->queue_data is a scsi_device, which is > why we call scsi_auto_pm_get(). But for ufs_bsg's case, > queue->queue_data is a device... > If we call pm_runtime_get/put_sync(bcd->class_dev->parent) in bsg_get/put_device(), commit 74e5e468b664d can be reverted. This is just a rough idea. > Thanks, > Can Guo. > >> Thanks, >> Avri