Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp578774imn; Tue, 26 Jul 2022 04:07:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ttTxJW+B7m2ndQDAiLuM2FGOVmvBcsVPeeAtxcfuu8awnQwIgXir0Jdb1bdkRxryJelqdD X-Received: by 2002:a17:907:87b0:b0:72f:11fc:86c1 with SMTP id qv48-20020a17090787b000b0072f11fc86c1mr13547681ejc.449.1658833660954; Tue, 26 Jul 2022 04:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658833660; cv=none; d=google.com; s=arc-20160816; b=ZkLW70SzdD7dKhbZIhR9Iy4KHCPXcRwFvdGb9EEjSi/raHsEDWPJI+5+6dci6tkfaQ zC9HWiJ4dVzSyrDJ5MblV2/SkXao2SHAWbBrxiJInICEosT8P9saUODRKOBM5ZaB5yA2 lfyD4HsM7DPjIACGJkKntbsO0p5h/wRdFb6TeFVyvTR9BrYOTzVESRma5bpXvF9SZYkT cot+pwJwfnfLKFKgZQFmdFCMKN5R+/GKDliERtpMLtQSGHVdE/hQ7vTkPEsg9o0FX3jH sXVbDd/tPhE0CMp/bWW/R0zZxf3zgOarhJAmm5hFbSrpT9GhPLwwGB0QiJp189oGoJX1 JjLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:dkim-filter; bh=fQ+Y+QmHnh/EDveNBIvr5sL4r2bOolAvTQu/ym0MQ40=; b=bMCrwC3CNUnu5IJwSmR9X2ptTwSyhJFMX8cQK6y+8Eo6ve1VfFkrPcrwMNTPe2IH2w CECnIg+SNJVjVO1WqIu8cvKzWdbEb4nVmlsMV6DnJ00tqqlEYB05F3ThIx+H7+3tL2zk Xb/06czAxcYJk/gUp1eIIrliKqjyYpHVh6ORxf/JeiexAtlWDQ4+WQofYdYUQ3F0Zq7y v3IkxnMyWhittzkix7sNAAumdWOwEbMgDkKjr4Mpq4IU3XTZAtftFbWtnXqLjnt5dFID p7SERxmgQBhlpN42+X5S+j+Q24smctMEeaoui3mglTH1WUg56HPetqZRLjuQtsaM03CJ p/CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=QSoSkNSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r22-20020a1709067fd600b007136091f459si13722493ejs.302.2022.07.26.04.07.14; Tue, 26 Jul 2022 04:07:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=QSoSkNSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238724AbiGZKsH (ORCPT + 99 others); Tue, 26 Jul 2022 06:48:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233341AbiGZKsE (ORCPT ); Tue, 26 Jul 2022 06:48:04 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A297240B4 for ; Tue, 26 Jul 2022 03:47:59 -0700 (PDT) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20220726104754epoutp044ffc760078b2e7804f6b4367ec5145f6~FW1immUgg1496914969epoutp04g for ; Tue, 26 Jul 2022 10:47:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20220726104754epoutp044ffc760078b2e7804f6b4367ec5145f6~FW1immUgg1496914969epoutp04g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1658832474; bh=fQ+Y+QmHnh/EDveNBIvr5sL4r2bOolAvTQu/ym0MQ40=; h=From:To:Cc:Subject:Date:References:From; b=QSoSkNSlZ9myZg4vn3DO35QoU/VU+WK4mHamVkqdIYX1IWrdARJ8TSougIzEGJDUp COJFMbamRwwDkvk/SNWv3FUUg/couFDyHa2/h0yoNBMwcuOGL1mR55SA4rN+jo7okl TOem5lY6LBsupe6JpVVguyyUXL2mE4uvdYTEeHVg= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20220726104753epcas2p1f4f7ed696f18d7e5b34b7729d114cf1e~FW1iKIoha2666126661epcas2p1U; Tue, 26 Jul 2022 10:47:53 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.99]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4LsYXT28Thz4x9Pq; Tue, 26 Jul 2022 10:47:53 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 3D.DD.09666.956CFD26; Tue, 26 Jul 2022 19:47:53 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20220726104752epcas2p25991dabdb0acb21e25f21277f3198b09~FW1hQlJM61146411464epcas2p29; Tue, 26 Jul 2022 10:47:52 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220726104752epsmtrp19621ddec4fcba5decef904a14c85faf9~FW1hPwgku2764827648epsmtrp1K; Tue, 26 Jul 2022 10:47:52 +0000 (GMT) X-AuditID: b6c32a45-45bff700000025c2-ee-62dfc659025c Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 40.DD.08802.856CFD26; Tue, 26 Jul 2022 19:47:52 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.55]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220726104752epsmtip26f3ea21891bc998bbdebccc76ea401a5~FW1hETgl02032620326epsmtip2W; Tue, 26 Jul 2022 10:47:52 +0000 (GMT) From: Gyunghoon Kwon To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Gyunghoon Kwon Subject: [PATCH] scsi: ufs: introduce dev_cmd_notify callback Date: Tue, 26 Jul 2022 19:45:17 +0900 Message-Id: <20220726104516.127032-1-goodjob.kwon@samsung.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLKsWRmVeSWpSXmKPExsWy7bCmuW7ksftJBmvvcFk8mLeNzeLlz6ts Fj07nS0W3djGZHF51xw2i+7rO9gslh//x+TA7jFh0QFGj49Pb7F49G1ZxejxeZOcR/uBbqYA 1qhsm4zUxJTUIoXUvOT8lMy8dFsl7+B453hTMwNDXUNLC3MlhbzE3FRbJRefAF23zBygK5QU yhJzSoFCAYnFxUr6djZF+aUlqQoZ+cUltkqpBSk5BeYFesWJucWleel6eaklVoYGBkamQIUJ 2RmPvjawFBwQrPj3YiVrA+M5vi5GTg4JAROJ1xvXMncxcnEICexglDjZcJ0ZJCEk8IlRYtps ZQj7M6PE0k5TmIYHc5czQjTsYpToObWVHcL5yChx6UofG0gVm4C+xNT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kQMoISNx74gURI2wxP2WI6wQNe8ZJU6vP8UIkmAT0JeYev4lM4gtAjRoxq13YEXM AnMZJSZs/sEEkhAWsJX4cfosC4jNIqAqcerXF7AGXgE7ibbbO5kgNshLXL/ZBhUXlDg58wlY PTNQvHnrbOYJjHyzkKRmIUktYGRaxSiZWlCcm55bbFhglJdarlecmFtcmpeul5yfu4kRHKRa WjsY96z6oHeIkYmD8RCjBAezkghvQvT9JCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8F7pOxgsJ pCeWpGanphakFsFkmTg4pRqY1nnO75v4Nc11EYubKP/c/JSt3eqFOnqnv29jyeRhfVB89/ux eu21d59uW5t69VxVE+8j2UgZ6eQ1cXN7V3nlVxc73Df/qCgZqFzH2cUq0LUx8pl3fo79P7Wv k6sUrgX1nnGpdH6X6Wd1a43wXUNG/UK/1kebBB+ufB072+zWQkWHo2VTjv0r1Fz5Wlro0wNu xh1vKuYoLRIx3iK78YGkWee7gPrLXDl+kWvN1sr9XXxgxsYJxzTVQ58sv3crcIrwCVNBlo4L nk160ysl1xiqO59cfe/grWsLLTavmZFRda7DXc6BpymI64JM1fOglHtrC+duPxC8Jdtt7tFq yS++Jj8N18gIB6YZrlnAU7ROiaU4I9FQi7moOBEAfqyhcMECAAA= X-CMS-MailID: 20220726104752epcas2p25991dabdb0acb21e25f21277f3198b09 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: 20220726104752epcas2p25991dabdb0acb21e25f21277f3198b09 References: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some UFS host controller may need to synchronize dev command among UFS host controllers. Signed-off-by: Gyunghoon Kwon --- drivers/scsi/ufs/ufshcd.c | 2 ++ drivers/scsi/ufs/ufshcd.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 823ecd99eb2c..02d0350ee1a2 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2942,8 +2942,10 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, ufshcd_add_query_upiu_trace(hba, UFS_QUERY_SEND, lrbp->ucd_req_ptr); + ufshcd_vops_dev_cmd_notify(hba, PRE_CHANGE); ufshcd_send_command(hba, tag); err = ufshcd_wait_for_dev_cmd(hba, lrbp, timeout); + ufshcd_vops_dev_cmd_notify(hba, POST_CHANGE); ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP, (struct utp_upiu_req *)lrbp->ucd_rsp_ptr); diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 34c5db101f14..f13b6cdfbe1d 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -320,6 +320,7 @@ struct ufs_pwr_mode_info { * @device_reset: called to issue a reset pulse on the UFS device * @program_key: program or evict an inline encryption key * @event_notify: called to notify important events + * @dev_cmd_notify: called to notify device management request is issued */ struct ufs_hba_variant_ops { const char *name; @@ -357,6 +358,8 @@ struct ufs_hba_variant_ops { const union ufs_crypto_cfg_entry *cfg, int slot); void (*event_notify)(struct ufs_hba *hba, enum ufs_event_type evt, void *data); + void (*dev_cmd_notify)(struct ufs_hba *hba, + enum ufs_notify_change_status); }; /* clock gating state */ @@ -1354,6 +1357,13 @@ static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba, hba->vops->config_scaling_param(hba, profile, data); } +static inline void ufshcd_vops_dev_cmd_notify(struct ufs_hba *hba, + enum ufs_notify_change_status status) +{ + if (hba->vops && hba->vops->dev_cmd_notify) + hba->vops->dev_cmd_notify(hba, status); +} + extern struct ufs_pm_lvl_states ufs_pm_lvl_states[]; /* -- 2.37.1