Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp164305pxb; Wed, 18 Nov 2020 00:54:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZ/t/MG8JkRy5JlNQZtKBxlEcMGNTeqw4HApaZ+f5H7uVCdidbHur1RqU5Jmv/a3tKw53X X-Received: by 2002:a17:906:15c4:: with SMTP id l4mr4476604ejd.84.1605689643912; Wed, 18 Nov 2020 00:54:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605689643; cv=none; d=google.com; s=arc-20160816; b=GXiBsXsF0/lJq4cH4+zot01Kpblc6Zssc8IS26a8z6mwfTopCvOCXn9wKJWJE96jtF 34jBkznQjXGjI3wb8SSFmpn0UcyMgp/rh49rWUVPH50o81eQXZgFQvtTIhj/s8PCT6WP g3Q5j2fVH90ORlQ4R1UdWKOfLfi8zEzv74d3QDTTHyjmuiYkWp+i9qtEUmpnXFZDDXEX lblne84r1Madn5i99h0k4/BlWWrDINx78ROQaNVU8/R1QPFNftLrdZYuFChEVc8vSzCP 4pf7tNK4Go+ID4Rt9ZrKBy45NKoiPHvcR3ucRYmRwLfK/r5Bq7tIXhSN/KTJ3UZuGevm 486A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=8ubPeUbv9nGA17bHuaYj4qnBJnm2N8KJxhb4W1TPD4Q=; b=0CzzmpRjPg3695ku5jUd4NicfmzdsSCTpMkk5SaHaeZ0zX9AsVjkbXTpclgac/0xZe RJpHozWYphafAk7R3ZMR4AEVoYak0H2dq3uHTKIauY4MfGny2s9FACCTnhy6CK9Dxux2 41hTGeiW5wZFBDv++3/H937AP+4eFAHwK1wqtd/dj15WKfYHD2+G7N5V1SK+vC1ZsjQs bMp2BTbvpId5iVz+5D0BqmADgCjm06ogvxu0I2kMp0qUxTbyPMNOQPUNph3sOAhObS8h mkfFVOGlZ/5lU2JGMmj9dYK6tHDgVhsI6h03cKNTRuZ5wlnprrIvm3k591pIkbNA1/uN cBlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=dHdveSGf; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j27si3063248eje.30.2020.11.18.00.53.40; Wed, 18 Nov 2020 00:54:03 -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; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=dHdveSGf; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727436AbgKRItx (ORCPT + 99 others); Wed, 18 Nov 2020 03:49:53 -0500 Received: from z5.mailgun.us ([104.130.96.5]:10837 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727347AbgKRItw (ORCPT ); Wed, 18 Nov 2020 03:49:52 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1605689392; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=8ubPeUbv9nGA17bHuaYj4qnBJnm2N8KJxhb4W1TPD4Q=; b=dHdveSGfVrstA4RADxlsGQnmriai8Rz25XilNO5ZNd2u8tlLsC/sy+TEQZKpkbLd5asKtiPk iVKX9qHkG/c0Y7J6/egzSjOGnLU1o0wkZdnHCslxQv+2dNiEqPwGnOFuvecbnEkYQ9lgperW 9P09NyCePpI3R1i/GjSsidJfU5o= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n10.prod.us-east-1.postgun.com with SMTP id 5fb4e02e309342b9149d05ef (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 18 Nov 2020 08:49:50 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id E5590C433ED; Wed, 18 Nov 2020 08:49:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 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 05AF5C433C6; Wed, 18 Nov 2020 08:49:47 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 18 Nov 2020 16:49:47 +0800 From: Can Guo To: Bart Van Assche Cc: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, ziqichen@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, Stanley Chu , "James E.J. Bottomley" , "Martin K. Petersen" , Matthias Brugger , open list , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" Subject: Re: [PATCH RFC v1 1/1] scsi: pm: Leave runtime resume along if block layer PM is enabled In-Reply-To: <6d774277-b055-6924-cf2d-01e874ac3f7b@acm.org> References: <1605249009-13752-1-git-send-email-cang@codeaurora.org> <1605249009-13752-2-git-send-email-cang@codeaurora.org> <97dea590-5f2e-b4e3-ac64-7c346761c523@acm.org> <20f447a438aa98afb18be4642c8888b3@codeaurora.org> <6d774277-b055-6924-cf2d-01e874ac3f7b@acm.org> Message-ID: <3d58c7a1971bbb2895a30122255ed2e1@codeaurora.org> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bart, On 2020-11-18 12:38, Bart Van Assche wrote: > On 11/15/20 5:42 PM, Can Guo wrote: >> Actually, I am thinking about removing all the pm_runtime_set_active() >> codes in both scsi_bus_resume_common() and scsi_dev_type_resume() - we >> don't need to forcibly set the runtime PM status to RPM_ACTIVE for >> either >> SCSI host/target or SCSI devices. >> >> Whenever we access one SCSI device, either block layer or somewhere in >> the path (e.g. throgh sg IOCTL, sg_open() calls >> scsi_autopm_get_device()) >> should runtime resume the device first, and the runtime PM framework >> makes >> sure device's parent (and its parent's parent and so on)gets resumed >> as >> well. >> Thus, the pm_runtime_set_active() seems redundant. What do you think? > > Hi Can, > > It is not clear to me why the pm_runtime_set_active() calls occur in > the > scsi_pm.c source file since the block layer automatically activates > block devices if necessary. Maybe these calls are a leftover from a > time > when runtime suspended devices were not resumed automatically by the > block layer? Anyway, I'm fine with removing these calls. > > Thanks, > > Bart. Yes, I agree with you. Let me test the new patch (which removes all the pm_runtime_set_active() calls) first, if no issue found, I will upload it for review. Thanks, Can Guo.