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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 150ADC433EF for ; Thu, 20 Jan 2022 02:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244391AbiATCvc (ORCPT ); Wed, 19 Jan 2022 21:51:32 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:49689 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230154AbiATCvb (ORCPT ); Wed, 19 Jan 2022 21:51:31 -0500 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20220120025129epoutp023847694cab001538e9bd69feef5bf249~L2tMx2SNT1244412444epoutp02g for ; Thu, 20 Jan 2022 02:51:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20220120025129epoutp023847694cab001538e9bd69feef5bf249~L2tMx2SNT1244412444epoutp02g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1642647089; bh=6v1DbUHoAni8eiXbPHbpCUbTZkXT8iKtg6QKxiegaYY=; h=From:To:In-Reply-To:Subject:Date:References:From; b=sMiMHsPI84Gvn/0Q9+iazUqq6XfZm2c23t1i0mfCKOm9vKf5/3OYaFg6pi1rXjr+X HvMFK+yFE1fsaEdoE9DvIurWhNpFpG5VO5ZWDfZQtDXf/ZO/4/pmY4uGYlLDuUvbiz xmzV6t03n52hqvZHrSAZJHaTHxPqQY+PfXFuGfvc= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20220120025129epcas2p20b47936e4f4bf210dc9df094eb10189a~L2tMWWXT02904029040epcas2p2e; Thu, 20 Jan 2022 02:51:29 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.98]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4JfRq36Vjtz4x9Q5; Thu, 20 Jan 2022 02:51:27 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id B3.9B.10018.59DC8E16; Thu, 20 Jan 2022 11:48:53 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20220120025127epcas2p34ef71e7051606df008267df74a31815d~L2tKwffPF0992309923epcas2p3N; Thu, 20 Jan 2022 02:51:27 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220120025127epsmtrp2ba4c575a7cd31220fe5f8c60c0b13abd~L2tKv0fyz2814228142epsmtrp2c; Thu, 20 Jan 2022 02:51:27 +0000 (GMT) X-AuditID: b6c32a46-a25ff70000002722-c9-61e8cd95cda3 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 1B.F8.08738.F2EC8E16; Thu, 20 Jan 2022 11:51:27 +0900 (KST) Received: from KORCO011456 (unknown [12.36.185.54]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220120025127epsmtip232828f03422f6cbb774b33a97a690aea~L2tKkJ4WY2456824568epsmtip2c; Thu, 20 Jan 2022 02:51:27 +0000 (GMT) From: "Kiwoong Kim" To: "'Bart Van Assche'" , , , , , , In-Reply-To: <3bb0f5ad-2cea-2509-a9e1-d8ed159bd875@acm.org> Subject: RE: [PATCH v1] scsi: ufs: use an generic error code in ufshcd_set_dev_pwr_mode Date: Thu, 20 Jan 2022 11:51:27 +0900 Message-ID: <000001d80da8$9e987cd0$dbc97670$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-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flgx3WDqTP3ztj6Q+vNyw3vvyxx83fn8sxau311 4+4m7gemJfUCbYqnF2fNurbqINsPdsuHcdd8uYM3b76Vo/fhVM+tibu/tC1PCPv4ZWu5oNvy ft846QlX62fsFm3m8kny2Dwx3Ug0/lPJBRu2SbUThb3eLv2T1qa69n1Wm+3/RUosxRmJhlrM RcWJAChq5iEAAwAA X-CMS-MailID: 20220120025127epcas2p34ef71e7051606df008267df74a31815d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220117103107epcas2p3d7223ff63f6cb575316695cc8fb155a4 References: <1642415361-140388-1-git-send-email-kwmad.kim@samsung.com> <3bb0f5ad-2cea-2509-a9e1-d8ed159bd875@acm.org> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org > > =40=40 -8669,6 +8669,7 =40=40 static int ufshcd_set_dev_pwr_mode(struct= ufs_hba > *hba, > > pwr_mode, ret); > > if (ret > 0 && scsi_sense_valid(&sshdr)) > > scsi_print_sense_hdr(sdp, NULL, &sshdr); > > + ret =3D -EIO; > > =7D > > > > if (=21ret) >=20 > Shouldn't =22ret =3D -EIO=22 only be executed if ret > 0? Additionally, p= lease > update the documentation of ufshcd_set_dev_pwr_mode(). I'm referring to > the following comment: =22Returns non-zero if failed to set the requested > power mode=22. >=20 > Thanks, >=20 > Bart. scsi_execute returns cmd->result(int type) but I think there is no case tha= t the valaue is negative because all values defined for its most significant byte, i.e. driver byte,= are smaller than 0x80. And I understand the 'ret > 0' presents that something wrong happens during= the process. So I'm not sure if 'ret =3D -EIO;' should be executed under 'ret > 0'. -- =23define DRIVER_BUSY 0x01 =23define DRIVER_SOFT 0x02 And for the comment, I got it. Thanks Kiwoong