Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3585649pxj; Mon, 24 May 2021 09:57:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOTdT5qEvoQJC1JVmKa1NdRppfA/zO7HaSn2YBs53G1wgJ8ro1citLDsSDrqfzsudlIhkx X-Received: by 2002:a05:6402:111a:: with SMTP id u26mr26289764edv.260.1621875454047; Mon, 24 May 2021 09:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621875454; cv=none; d=google.com; s=arc-20160816; b=k2HH1bxZzZyzSwdK0qnn/c2SFeWNssBmb8eRy76wlpy2DkkVxjWsZBDkmb/EjueAVm 0/xAtsaAA+00nt6H+tUCdQKBy6vK33ZIjOMRKfFAoDzi5MIDzK1JNL8r1ROKF01D/yrk F29QIcywrcs8BlmhtP/AVjyDqFuFAHjyrxsRd5RWYsZbHy3eK4vs1mQzDYigywK1BF5g RsTv877NcRDKuf47Z71fHR0/rw8AuiD1S/Z8K51UGov1QZrszclmaGVUFOgxacSD0Vd5 T1MxnjnJrXH5jKmLRwjum1WS1MCZhAiWr8Skcn3+bTSoUWfvBaGLsfrPEZQG8uQGT36A yOlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=19TIfgdbq72p4i232l0hKg6re5NjXUcN0qnK0ejAszk=; b=ivGDhHNzdTj/I2u+BCQ3tFrgJfPY1m+nUM3L3IXXaQ6pRWnqq3Yvk2T1L5CzShAKAa GveX65+mrpEAZuWEfpBnGRn0CmcSprXGZ5cXZtdVjMxNSY5pUgplVAbj/LS9HB2qXwtP F0NQbThT+Wkhe3Ak62+VBGTUvFkEexs5ZBFeX5yu9WlTD4+oGKEeqQL9jvC+TfqHvj/G MT8vQ8GEwNN1q7QpXxkkY2a/KmKKA5YlTs9O//fsDEe8NsjGGhcvk0jrgHYPga+Y4jJm uGyLK4xJMpLD61L/BtEUSIXtZY5NSuw9SEn4QOjI0LLWQsLVmKDMZpfkSbpwvchnrXKU NXHQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si11650462edc.269.2021.05.24.09.57.10; Mon, 24 May 2021 09:57:34 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233221AbhEXQ5s (ORCPT + 99 others); Mon, 24 May 2021 12:57:48 -0400 Received: from mail-pj1-f51.google.com ([209.85.216.51]:45881 "EHLO mail-pj1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232543AbhEXQ5r (ORCPT ); Mon, 24 May 2021 12:57:47 -0400 Received: by mail-pj1-f51.google.com with SMTP id ne24-20020a17090b3758b029015f2dafecb0so10308078pjb.4; Mon, 24 May 2021 09:56:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=19TIfgdbq72p4i232l0hKg6re5NjXUcN0qnK0ejAszk=; b=Wx0JtsgGZU9IK0Pj44Zb9l4wqMIJ37qzmSL6SaPpl2Ndiz7ltPtYVu4YgJ1CVvMAOM +20kRfa7i3a/BNzgnKFZ1J5GlPa+olYzs0sl2Uv33Sh0Ezcs2o3Kwoy2HuByjTCn6WA9 PpokQWjrTiwsq27NO5f1d9vBGnc/l1I8RiLpLjctjewtoWiF4BlXhC5e7RF1iJsLGpTQ 3ZwVpEVxg9gqNajq2YTCe73QpM0LbTBOb8YUS8Kc00SYGrnDXJjnhWfW0edrMuKxM4N5 gkD10bADouDlzC4d83Ka6hCNqhqSOwdTtJ3n38lQ33NUEfo338cC/49hPwnP8dewcSiR uomw== X-Gm-Message-State: AOAM532CTsolfnezAaCoyliaKAuLBsBEj631BxEJBo1THRebs3wXeWY+ +v7oMbrx+Fbbod0YUl4kUFwnMl+v13ozqA== X-Received: by 2002:a17:902:d305:b029:f0:d3db:26db with SMTP id b5-20020a170902d305b02900f0d3db26dbmr26400149plc.36.1621875377840; Mon, 24 May 2021 09:56:17 -0700 (PDT) Received: from [192.168.3.217] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id c128sm11759276pfa.189.2021.05.24.09.56.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 May 2021 09:56:17 -0700 (PDT) Subject: Re: [PATCH v2 5/6] scsi: ufs: Let host_sem cover the entire system suspend/resume To: Can Guo , asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com Cc: Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Jaegeuk Kim , open list References: <1621846046-22204-1-git-send-email-cang@codeaurora.org> <1621846046-22204-6-git-send-email-cang@codeaurora.org> From: Bart Van Assche Message-ID: <19b44731-1a4f-c88c-58fd-05eca5df2c2e@acm.org> Date: Mon, 24 May 2021 09:56:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <1621846046-22204-6-git-send-email-cang@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/24/21 1:47 AM, Can Guo wrote: > UFS error handling now is doing more than just re-probing, but also sending > scsi cmds, e.g., for clearing UACs, and recovering runtime PM error, which > may change runtime status of scsi devices. To protect system suspend/resume > from being disturbed by error handling, move the host_sem from wl pm ops > to ufshcd_suspend_prepare() and ufshcd_resume_complete(). Other SCSI LLDs can perform error handling while system suspend/resume is in progress. Why can't the UFS driver do this? Additionally, please document what the purpose of host_sem is before making any changes to how host_sem is used. The only documentation I have found of host_sem is the following: "* @host_sem: semaphore used to serialize concurrent contexts". To me that text is less than useful since semaphores are almost always used to serialize concurrent code. Thanks, Bart.