Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp325711ybv; Tue, 4 Feb 2020 22:33:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzeTpnldFfIDt5ZXYIV0lG2c2BnfW1iNhO1KKxxQgIC8hCP/GbOj1g2YqgMVlQmFE4WZXQC X-Received: by 2002:a9d:65c1:: with SMTP id z1mr18481102oth.180.1580884403265; Tue, 04 Feb 2020 22:33:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580884403; cv=none; d=google.com; s=arc-20160816; b=KNL31Lh7epSsAhwFtc2XNaqyD1hesIKkVMkxaYx1WHNRVRUPxS7IsJiH+NOJUqf7wD gBvDCX5ftTNybLnPggJ/UF5IQFVHTGZJeWIaxYk/zH9DYP58M9cmj01DdciHz6eQxng3 wa2Zamx1KBLrdv83HGs58yutKxZ3RVm7pXsUYf7dl30A3sjSK91n+vJ5o6CkIPZ8fE+R +ihcrgHJrFAmlxVYakR7bjNrGHqfEQ3M7dqDmudUEI+yQ/AtEP1XgCrxuf44F/YLscyV N1ZSwELyxNrD7fRcjtKkwFsNRhbnqDzWdkxtJfMP+s+NJ6S1O7B4JeT68/cGdViRxRDl Me2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=ViCP3t2YRGW6lTwQZQeQAgzT2huQLFAv95wozwScy2g=; b=C9qGOpMObvSRxgIn4M/eDoYd8VVcDs834Lm1UiZ4xYM/3acbufllV/BSySfQ1bTjUg wYut+HIm4rwcEhMRjJR/zTVJOOx6sq4EI8zVVb/vAu0ah5dL+f7iXKSFe+OJ1v2SIY58 E/jUOfa2Sb64WqTPA9ki2G00hCBDDcI3Yk0936xVZy5L8m8DN4YBbZF2ujBGFeqFCPy7 gMd9MfbJTmQ+LOdtZK5ZA2LYdmfAEWLTWajHsXpT1lSzERx0L1VrfyOVm8V2L2+FuUl8 CyYjUorjPxmbDstZUGXT+EAEYVi2VeBs455TkliTaMgmcUHoFMyD08Q9bYimst/2lB11 StGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="K/jdJAcJ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si10850072oib.152.2020.02.04.22.33.10; Tue, 04 Feb 2020 22:33:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="K/jdJAcJ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727012AbgBEGbu (ORCPT + 99 others); Wed, 5 Feb 2020 01:31:50 -0500 Received: from mail26.static.mailgun.info ([104.130.122.26]:60161 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbgBEGbt (ORCPT ); Wed, 5 Feb 2020 01:31:49 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1580884309; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=ViCP3t2YRGW6lTwQZQeQAgzT2huQLFAv95wozwScy2g=; b=K/jdJAcJEkjjzI+HgJTCa9i9m+Vh7ItDEqX0XIBqqxnu5vs19nFJVzaR3zPM/7thOa2SAXdo qHv9Btl9f440CxySGAxyxGmDyNeLHyXvq7SLX/VlTqmebOoMF6t6A1q6iwNGzeVGON8USPjT sCd3lpcpMSyu5+qKVRQeQnPiZ5I= X-Mailgun-Sending-Ip: 104.130.122.26 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 mxa.mailgun.org with ESMTP id 5e3a6153.7f282edce848-smtp-out-n03; Wed, 05 Feb 2020 06:31:47 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B30C3C447A3; Wed, 5 Feb 2020 06:31:46 +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=-1.0 required=2.0 tests=ALL_TRUSTED 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 E25B5C43383; Wed, 5 Feb 2020 06:31:45 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 05 Feb 2020 14:31:45 +0800 From: Can Guo To: Bart Van Assche Cc: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, Andy Gross , Bjorn Andersson , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Venkat Gopalakrishnan , Tomas Winkler , "open list:ARM/QUALCOMM SUPPORT" , open list Subject: Re: [PATCH] scsi: ufs: Fix registers dump vops caused scheduling while atomic In-Reply-To: <3e529862-7790-c506-abaa-9a6972f5d53c@acm.org> References: <1580882795-29675-1-git-send-email-cang@codeaurora.org> <3e529862-7790-c506-abaa-9a6972f5d53c@acm.org> Message-ID: <749a1db94df00278ec9f5c121cd937fe@codeaurora.org> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-02-05 14:21, Bart Van Assche wrote: > On 2020-02-04 22:06, Can Guo wrote: >> @@ -5617,7 +5622,7 @@ static irqreturn_t ufshcd_check_errors(struct >> >> __func__, hba->saved_err, >> hba->saved_uic_err); >> >> - ufshcd_print_host_regs(hba); >> + __ufshcd_print_host_regs(hba, true); >> ufshcd_print_pwr_info(hba); >> ufshcd_print_tmrs(hba, >> hba->outstanding_tasks); >> ufshcd_print_trs(hba, >> hba->outstanding_reqs, > > Hi Can, > > Please fix this by splitting ufs_qcom_dump_dbg_regs() into two > functions: one function that doesn't sleep and a second function that > behaves identically to the current function. If the function names will > make it clear which function sleeps and which function doesn't that > will > result in code that is much easier to read than the above code. For the > above code it is namely impossible to figure out what will happen > without looking up the caller. > > Thanks, > > Bart. Hi Bart, Do you mean by splitting ufshcd_print_host_regs() into two functions? One behaves identically same to the current function, another one called ufshcd_print_host_regs_nosleep(). No? Thanks, Can Guo.