From patchwork Thu Dec 1 17:43:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 28481 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp399529wrr; Thu, 1 Dec 2022 09:49:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf7cmYVkBZMaVzAb6U0EN7X21NPcLvsgBu8LqNt1UjoCSwX5Pe54k7y8y1YFS0bN7b6+uhe7 X-Received: by 2002:a17:906:fa98:b0:7c0:a8ff:3380 with SMTP id lt24-20020a170906fa9800b007c0a8ff3380mr5176361ejb.92.1669916967087; Thu, 01 Dec 2022 09:49:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669916967; cv=none; d=google.com; s=arc-20160816; b=qmG1/R0OXz08c+vsOLza+xZkLVZQJhBGL13yEnoX+5juZPD2f0JhFEAU+olTexhHzm Xr4qB04/ZGw8/acEKm/TBY42hdmmZJkfAXMIzstSBz0jufwijkFAdbLSF+YpCxX2gW8W Q62sB+npJJwanPxRfZbeXrriE+lawhjdPAJo/9UCdNq6vVDtiYvmANyucSAr1ACWKVjG 6UyKppzVFbbsrC2clkfxos5KwuHntDC/WAs6jwCD20CkKjqLr+o7MLQ4hC2mGexy5mct F2U3XSWn8kgw7B6vw198sKdvleChPbp4/nFmazLXe+yWUx1F5iVZiXyPBbdzniwvQmtZ 9EcQ== 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=L8CMRsJAWw5Kl2y6C4bQ/udAroFdc5lkzkoFkDtAV0k=; b=lxM9IG0pZlR4P8DlUU9YVkAYFVwjwJHipgWnv9CZxS/XynxlFTMq6f1avXHae+N7KN XtOld2W1On20LoHeHkfjMFc5BxuPZgc5slGWPZneuu53pevpfFFnVWvhClxaxIYhlzMW 0yfgmvj2WCMV0vJgaPmk0QkSPQ1hRuWDKLJo1iJ7BmFlkgO1i4U3wT++SmZ7Y80LrOp1 Scg8OCYWNq9QhDkkC5M/z2ml1G+Tqx1EBP9uLOHKPbxnAceljRL+CVgoGrkC9cCmPsA8 oPtZgycN+wICA5FbfUKKHCgXDl80W/FC8Ri1mqUiPyZf/yZqhyaarH5lgs0Em8bvhZMO I41A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L9ZGHIuI; 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 gs20-20020a1709072d1400b007ae85c3b7b3si4766056ejc.362.2022.12.01.09.49.02; Thu, 01 Dec 2022 09:49:27 -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=L9ZGHIuI; 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 S230523AbiLARri (ORCPT + 99 others); Thu, 1 Dec 2022 12:47:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbiLARq7 (ORCPT ); Thu, 1 Dec 2022 12:46:59 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8509BB000 for ; Thu, 1 Dec 2022 09:45:45 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id 130so2545744pfu.8 for ; Thu, 01 Dec 2022 09:45:45 -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=L8CMRsJAWw5Kl2y6C4bQ/udAroFdc5lkzkoFkDtAV0k=; b=L9ZGHIuIN4pPpIQ02mKvPDbt7rsp+sys+Lik1R2XQTVkFu+uRC89PbR+dZwc52D8Q7 g11NpkjDgJTJiTpWG/PbIwmXqJ22q/CAgB0sdJB4kjkpmvKdGsfzPUJFka0G9hBGXSka qfMUADxnUudncW+CM4fhFdPDrOiQuhVjxu4Fx8YZPXJuni6pnL07h9Y4l9+cyKgoJz23 CEUnpzZoPOyMDeBy9l5ALrJI/57dx03ck+PieN6055E5ZoB9AR7kZ5Gum8iHrUAah0RB Qxn2i9gkfZe4YxEgUpH2qSa9m/9fqpxXD5UuKg0mY4EY8J+PGfD0JHGQu12n0WhzJJyL z7pg== 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=L8CMRsJAWw5Kl2y6C4bQ/udAroFdc5lkzkoFkDtAV0k=; b=0TaExBsOs+kHKNsY41UV2JrFyXsM3YBiLDQZTXo6qIALlkYF45mzpWiUUnFjMmV2z1 RwxdDRI/BwGsZPtRegknYGbRSOKWhiFIJUqgFwvShiJ+eJv68ajfhYW6ECN4eN7u47bF POSIKVGoY0halkrNh29P0b5iLeRLuAp2KywwDtPnUZpQqt6NVlSbedG9tYzQgP0HITlV UmvALgZRinSjewTFUZ2ByG5mYA0J7IBeZV7GM1uZEJHQqmMS8wpDjrOBtF7ITYdIZCIj HDSRmaGXflsq5F8eNmKUmp+qThWdmJz0duP5+QFQNIEel4Q6zoBSAPFeyaSltmwKnHgs hZMg== X-Gm-Message-State: ANoB5plP3jwiGjgCBUn/9GwvOaKbM9bAlYSYGFDDI6UR3GuMSJQvuisy zqJ9WdXxDF5wFU8HWLwWJim+ X-Received: by 2002:a63:2361:0:b0:477:b603:f683 with SMTP id u33-20020a632361000000b00477b603f683mr39094258pgm.93.1669916745385; Thu, 01 Dec 2022 09:45:45 -0800 (PST) Received: from localhost.localdomain ([220.158.159.39]) by smtp.gmail.com with ESMTPSA id p4-20020a170902780400b0016d9b101413sm3898743pll.200.2022.12.01.09.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 09:45:44 -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 v4 18/23] scsi: ufs: core: Add reinit_notify() callback Date: Thu, 1 Dec 2022 23:13:23 +0530 Message-Id: <20221201174328.870152-19-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221201174328.870152-1-manivannan.sadhasivam@linaro.org> References: <20221201174328.870152-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?1751034853501883108?= X-GMAIL-MSGID: =?utf-8?q?1751034853501883108?= reinit_notify() callback can be used by the UFS controllers to perform changes required for UFS core reinit. Signed-off-by: Manivannan Sadhasivam --- 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..af8c95077d96 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 UFS core reinit */ 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 */