Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4115726pxv; Mon, 28 Jun 2021 22:42:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMpzXil2BTU+OD3SwJusBmlqnO5wPzSHsti07T6QBU945ZRNFdUJhGHhesE0u/L9tTrF9m X-Received: by 2002:a05:6638:1316:: with SMTP id r22mr2746834jad.89.1624945373027; Mon, 28 Jun 2021 22:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624945373; cv=none; d=google.com; s=arc-20160816; b=ZG290ms45ZqTKq2AETaSWpynP54PPL2cWg6a4VHSyB2euY8T90T1l3fGKhq9oEmWOq toaJmBI9cKNluupwcTvr6Xss+ht0I/KyaxDK48UAd48iMpIDozQMlcEw1uI4jaYqmNn5 FsEak7vk35JOTWC32tCVsZdNu88IrcbZT/6zEjxez+DO+cALfpuGGviZpjhCq8fvklPa PU/MpdDhqRjQXI9B+LOCC83UrRDTdLMXKuDHThcyMvCk4nPEgSjUoTBbv7qzJ9sGOVeM +XRgc8+OiXf2mWAiJqY/K4rmoFPVDJ1k22i9kcB6a7PvGWpHdfcCo3EZX0w40VdAk/5+ RvEw== 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=o4+eZM2Dx3GnLj8Xg6wXr6QB6hTOedtc94/YUj4qaP8=; b=bkSeQ+gxOim0pwBaYGPo4Mpi+w5aDVZxY9rewbRMEnn2GlK9Liv1zIObWKbuclzgpV dmIfZ0Za6TejozslM9BwZVpKQKtiWRJXIz1HQsCbJLsC2lcYwXaaEDjLbN5JdEtNB0Ac o44j+Z44KnNo/7QxZ7DeyMiEN03U+RvvQqF/KykxR/DXUg3YXQudxnZXCWsJdzILKFSI 1DdKcXh9p7fxth8xWQjzgeLjG2TUlfdqoW9BboZ38mm9+lVs3/nU6R+lBSK1UwcAIjmb 1r60rELcag0lC8YvYAqEm6ppLsCrJVTvEbRvB17LNpp0j7zcHfJMA0/EvOcI2FeSXoNH XavA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=sj8IxSgB; 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 m15si7608049jat.45.2021.06.28.22.42.40; Mon, 28 Jun 2021 22:42:53 -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; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=sj8IxSgB; 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 S230216AbhF2Foj (ORCPT + 99 others); Tue, 29 Jun 2021 01:44:39 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:24616 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231881AbhF2Foh (ORCPT ); Tue, 29 Jun 2021 01:44:37 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1624945331; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=o4+eZM2Dx3GnLj8Xg6wXr6QB6hTOedtc94/YUj4qaP8=; b=sj8IxSgBlkvOqgPrBgF9fkWm33j0Csad9WU/kDNbSJwYWRPCU2K4AcSKKT3S/qwCZAfDU2LG j9uAQYdFhlfwstZijCp1dDabTffvwgmMbJu5AMREivQu2XTsWO2q6Z7lmjW4wJQtUzppC5f/ TJiSStjHFyMuZz6nHJ3+3WjHzx0= X-Mailgun-Sending-Ip: 69.72.43.7 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-n06.prod.us-west-2.postgun.com with SMTP id 60dab2a3ad0600eeded224d7 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 29 Jun 2021 05:41:55 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A26AAC43147; Tue, 29 Jun 2021 05:41:54 +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 9AFE8C433D3; Tue, 29 Jun 2021 05:41:53 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 29 Jun 2021 13:41:53 +0800 From: Can Guo To: Bart Van Assche Cc: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, Stanley Chu , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Matthias Brugger , Bean Huo , Jaegeuk Kim , Adrian Hunter , Kiwoong Kim , Satya Tangirala , open list , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" Subject: Re: [PATCH v1 2/3] scsi: ufs: Optimize host lock on transfer requests send/compl paths In-Reply-To: References: <1621845419-14194-1-git-send-email-cang@codeaurora.org> <1621845419-14194-3-git-send-email-cang@codeaurora.org> Message-ID: <464097469b09752ce4ebb38c08f1a94a@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 On 2021-06-29 06:58, Bart Van Assche wrote: > On 5/24/21 1:36 AM, Can Guo wrote: >> Current UFS IRQ handler is completely wrapped by host lock, and >> because >> ufshcd_send_command() is also protected by host lock, when IRQ handler >> fires, not only the CPU running the IRQ handler cannot send new >> requests, >> the rest CPUs can neither. Move the host lock wrapping the IRQ handler >> into >> specific branches, i.e., ufshcd_uic_cmd_compl(), >> ufshcd_check_errors(), >> ufshcd_tmc_handler() and ufshcd_transfer_req_compl(). Meanwhile, to >> further >> reduce occpuation of host lock in ufshcd_transfer_req_compl(), host >> lock is >> no longer required to call __ufshcd_transfer_req_compl(). As per test, >> the >> optimization can bring considerable gain to random read/write >> performance. > > Hi Can, > > Since this patch has been applied on the AOSP kernel we see 100% > reproducible lockups appearing on multiple test setups. Examples of > call > traces: > > blk_execute_rq() > __scsi_execute() > sd_sync_cache() > sd_suspend_common() > sd_suspend_system() > scsi_bus_suspend() > __device_suspend() > > blk_execute_rq() > __scsi_execute() > ufshcd_clear_ua_wlun() > ufshcd_err_handling_unprepare() > ufshcd_err_handler() > process_one_work() > > Reverting this patch and the next patch from this series solved the > lockups. Do you prefer to revert this patch or do you perhaps want us > to > test a potential fix? > Hi Bart, I am waiting for more infos/logs/dumps on Buganizor to look into it. With above calltrace snippet, it is hard to figure out what is happening. Besides, we've tested this series before go upstream and we didn't see such problem. Thanks, Can Guo. > Thanks, > > Bart.