From patchwork Thu Dec 22 14:09:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 35789 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp349536wrn; Thu, 22 Dec 2022 06:16:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXt7qwfAB6yJ4VeaycJGFSxnkCp+NBoGHyPNC2yKuij9gBSn+NwATCgbplDkNfztUwAy6yR2 X-Received: by 2002:a17:906:6dc3:b0:7c1:49c:f9cd with SMTP id j3-20020a1709066dc300b007c1049cf9cdmr4835531ejt.54.1671718588990; Thu, 22 Dec 2022 06:16:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671718588; cv=none; d=google.com; s=arc-20160816; b=S1Id7O2dgRDoAQe87QIdhc0ThcigREqPXFFHo7+0+M51OIqdLkiJ+4eQgya4G0Y2B/ SercQyyOeevwAJ1n8Y6CD1dOSJ5fS9WWejfUEjHYd4d9bha9ttxzKDXy9IHayz/qVwIg rnU1u9k/F+nn4mP8gqx7AJPtCszf+lFlYW+pzwYty4uhUPKke/BANBaNJFrhll7T88fE oL0EbGqE2nHnSCEJ6rGXxLS6jzsQ8XZTgBkT3Sr3ea67BxZ3mgnGP0Aef1Opp59qby5Q sOypGvDOE8cglyNk5Ium/dHY3l6ZNnsoYqtEHm9yPIChFb/+yd+m6pKaHMdIrALRyVEv jxhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mPijPobTcYQaRyLBeRVB3HBZnVNDSDqtRoK4CmiEviM=; b=tG3bvikHixaqprJ4idkEVkwqlvp6N6hdcF5fVnqq7gZzytL1eHeW/UFUgFDnC9Hh6c wr3yECDIR34a3ZNBFzXweMwdkuQSSi7URNZqQ0ol97tFUwWgQMoLgbB1YclFjs6V7ccC FhPk3XqwFHFmFWlxUctgcTusVRgO8T7X8QWv3jAF5qL9zO0GMETbCjCcddFjfSJGmbVz vfmkAJE6l0uk/LM3GOu7zfUD3g1MaIB2h9tW9JVgx/PVMuZhVJkb/AY8A1AWWdy/fltW UhqDQwPRc70eNOPTs0K5o9whioBdVnYBVhryBbkwO6kj4YhS320j6pOlFiDrF3VIqmM3 lo1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BA0eDOPb; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xb10-20020a170907070a00b007c1052c9243si653868ejb.15.2022.12.22.06.15.55; Thu, 22 Dec 2022 06:16:28 -0800 (PST) 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=@linaro.org header.s=google header.b=BA0eDOPb; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235647AbiLVOOt (ORCPT + 99 others); Thu, 22 Dec 2022 09:14:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235504AbiLVONs (ORCPT ); Thu, 22 Dec 2022 09:13:48 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB1402CCBF for ; Thu, 22 Dec 2022 06:12:24 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id m4so2133831pls.4 for ; Thu, 22 Dec 2022 06:12:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mPijPobTcYQaRyLBeRVB3HBZnVNDSDqtRoK4CmiEviM=; b=BA0eDOPbqVVIhhnoX9eUYS0pHxcdGVSvOSEqKJssJmQgmB/zpfNs2ywpseefd9emYh XoqN4fMEHfG2pCF4KZiD2D5/qOOhJbSP8VUw1VfdAzx0eEsQJRZfPNZ1giqckcw6l/0F RY9jGf365mZQMeq8fABGTxuju4LBtSxJVrQVhQSYMynUL2F04SC6OwQb54WMmEL+4MHi nj4OlLmn3jy8CMwICcCtp6czimJzm9ypl8bMFg5PkRnYD7CXnKG/mQwKZnsgSz2ndx0y UIxtddqWDUwypdkhoLzg5pp8bnnjBvmdaWC8ZQ+LmnfdZ565cBWkogTOH/3UPtLm+trg koiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mPijPobTcYQaRyLBeRVB3HBZnVNDSDqtRoK4CmiEviM=; b=X3VZxXI50JUEAKpF0BQP9ScSAcvMFvyv6uMT3jQYx36tv8bQcaLLN7JHPDfZZG/oZV BSi36l1QAoyOIiMil9I3jMiN7q76/yB/mWuTOXfzXuOzxltxDdqyEZeRGmco37DyMNu5 4h5jrN4CL6cwC3V0Zzk22vN1YaHGHztd4941eVNgOhuvMCDGzke45ZIEZwJ6lpvY4xFN 4rX+J1NyAl86ewuCR1OypGMpDam5SqJx2j/V6eWWuwXVjnF3hQRrvK8t3xVLK26ZFkHe FvvLVULajDDbKck/75gFJaAG9FFkKZx12sA7R6wHGtTEIeQKr2OgaPQKNDSXq0XDUNjn 9Mcg== X-Gm-Message-State: AFqh2kqUyWjMl5B2UuSXBuW1ntubaS9WoQdhXdGy7JKXM6JGdZ1c/atH ZXkP028GYH1zDccLrPNZXlls X-Received: by 2002:a17:903:28d:b0:191:386:d8f with SMTP id j13-20020a170903028d00b0019103860d8fmr6265636plr.47.1671718344357; Thu, 22 Dec 2022 06:12:24 -0800 (PST) Received: from localhost.localdomain ([117.217.177.177]) by smtp.gmail.com with ESMTPSA id f8-20020a655908000000b0047829d1b8eesm832031pgu.31.2022.12.22.06.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 06:12:23 -0800 (PST) From: Manivannan Sadhasivam To: martin.petersen@oracle.com, jejb@linux.ibm.com, andersson@kernel.org, vkoul@kernel.org Cc: quic_cang@quicinc.com, quic_asutoshd@quicinc.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-scsi@vger.kernel.org, dmitry.baryshkov@linaro.org, ahalaney@redhat.com, abel.vesa@linaro.org, alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, Manivannan Sadhasivam Subject: [PATCH v5 18/23] scsi: ufs: core: Add reinit_notify() callback Date: Thu, 22 Dec 2022 19:39:56 +0530 Message-Id: <20221222141001.54849-19-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221222141001.54849-1-manivannan.sadhasivam@linaro.org> References: <20221222141001.54849-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752923991397092936?= X-GMAIL-MSGID: =?utf-8?q?1752923991397092936?= reinit_notify() callback can be used by the UFS controller drivers to perform changes required for UFSHCD reinit that can happen during max gear switch. Tested-by: Andrew Halaney # Qdrive3/sa8540p-ride Signed-off-by: Manivannan Sadhasivam Reviewed-by: Bart Van Assche --- drivers/ufs/core/ufshcd-priv.h | 6 ++++++ include/ufs/ufshcd.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h index a9e8e1f5afe7..2ce3c98e0711 100644 --- a/drivers/ufs/core/ufshcd-priv.h +++ b/drivers/ufs/core/ufshcd-priv.h @@ -226,6 +226,12 @@ static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba, hba->vops->config_scaling_param(hba, p, data); } +static inline void ufshcd_vops_reinit_notify(struct ufs_hba *hba) +{ + if (hba->vops && hba->vops->reinit_notify) + hba->vops->reinit_notify(hba); +} + extern const struct ufs_pm_lvl_states ufs_pm_lvl_states[]; /** diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index 5cf81dff60aa..0a0b435f5c17 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -297,6 +297,7 @@ struct ufs_pwr_mode_info { * @config_scaling_param: called to configure clock scaling parameters * @program_key: program or evict an inline encryption key * @event_notify: called to notify important events + * @reinit_notify: called to notify reinit of UFSHCD during max gear switch */ struct ufs_hba_variant_ops { const char *name; @@ -335,6 +336,7 @@ 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 (*reinit_notify)(struct ufs_hba *); }; /* clock gating state */