From patchwork Tue Nov 14 21:16:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 744587 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 65900C4332F for ; Tue, 14 Nov 2023 21:19:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234094AbjKNVTP (ORCPT ); Tue, 14 Nov 2023 16:19:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234111AbjKNVTC (ORCPT ); Tue, 14 Nov 2023 16:19:02 -0500 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97816F3; Tue, 14 Nov 2023 13:18:59 -0800 (PST) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1cc1ee2d8dfso54699435ad.3; Tue, 14 Nov 2023 13:18:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699996739; x=1700601539; 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=a/jFKmYA4b/I5NdwoRTgPurns61Kr2vxDZ6EVCw0jDk=; b=nxR3Owm/C5fKiKxIFueC6spGafX9/yPdXrG1K/n7vIspel6cQoBglyvXGWgdslWW7E 02LPOvDc+k8j8oPP0flDynrYaN3hI8k2Ztam8Pp48/yPBJNYo8JreJZhHqkeaJzCxR5m RmEsjRCoDfq5NQyY6gJ4f29zGTNb9X5RbmhKS+L+00SqyhZXt+Ac+xHehDytRz4BA/MU jIklwFBmMAf4TespQ7FUV8ejc7BlDavr4xUgemihKRj0ZOnkNz5166e7Bs4XDTRX6lkF cAsyPOxEi2QNL3QDhiQyX2/G8r81sFu+Cj6r9dlFHHS9vn4owpi0GPnfayPrvY2nq2RK wdNw== X-Gm-Message-State: AOJu0YyKE0jVOTUfTgEKEVNLk18dKWpman++rEBYbMGiSVr16Jj/MH0K 7sAccKDKcbyEINy9+UHi5z4= X-Google-Smtp-Source: AGHT+IELUfic68TNf5ipjG5vfFrum1HgG4FKPn2VNX9AD8GYZCLWSHXfxiqeEAMv3UiEnYUNzF70PA== X-Received: by 2002:a17:903:40cd:b0:1cc:4071:fa44 with SMTP id t13-20020a17090340cd00b001cc4071fa44mr4328683pld.8.1699996738949; Tue, 14 Nov 2023 13:18:58 -0800 (PST) Received: from bvanassche-linux.mtv.corp.google.com ([2620:0:1000:8411:2278:ad72:cefb:4d49]) by smtp.gmail.com with ESMTPSA id ix7-20020a170902f80700b001c71ec1866fsm6169288plb.258.2023.11.14.13.18.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 13:18:58 -0800 (PST) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig , Bart Van Assche , "Bao D . Nguyen" , Can Guo , Avri Altman , "James E.J. Bottomley" , Bean Huo , Keoseong Park , Adrian Hunter , Krzysztof Kozlowski , =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= Subject: [PATCH v15 14/19] scsi: ufs: hisi: Rework the code that disables auto-hibernation Date: Tue, 14 Nov 2023 13:16:22 -0800 Message-ID: <20231114211804.1449162-15-bvanassche@acm.org> X-Mailer: git-send-email 2.43.0.rc0.421.g78406f8d94-goog In-Reply-To: <20231114211804.1449162-1-bvanassche@acm.org> References: <20231114211804.1449162-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The host driver link startup callback is called indirectly by ufshcd_probe_hba(). That function applies the auto-hibernation settings by writing hba->ahit into the auto-hibernation control register. Simplify the code for disabling auto-hibernation by setting hba->ahit instead of writing into the auto-hibernation control register. This patch is part of an effort to move all auto-hibernation register changes into the UFSHCI driver core. Reviewed-by: Bao D. Nguyen Cc: Martin K. Petersen Cc: Can Guo Cc: Avri Altman Signed-off-by: Bart Van Assche --- drivers/ufs/host/ufs-hisi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/ufs/host/ufs-hisi.c b/drivers/ufs/host/ufs-hisi.c index 0229ac0a8dbe..2e032eaf9e93 100644 --- a/drivers/ufs/host/ufs-hisi.c +++ b/drivers/ufs/host/ufs-hisi.c @@ -142,7 +142,6 @@ static int ufs_hisi_link_startup_pre_change(struct ufs_hba *hba) struct ufs_hisi_host *host = ufshcd_get_variant(hba); int err; uint32_t value; - uint32_t reg; /* Unipro VS_mphy_disable */ ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD0C1, 0x0), 0x1); @@ -232,9 +231,7 @@ static int ufs_hisi_link_startup_pre_change(struct ufs_hba *hba) ufshcd_writel(hba, UFS_HCLKDIV_NORMAL_VALUE, UFS_REG_HCLKDIV); /* disable auto H8 */ - reg = ufshcd_readl(hba, REG_AUTO_HIBERNATE_IDLE_TIMER); - reg = reg & (~UFS_AHIT_AH8ITV_MASK); - ufshcd_writel(hba, reg, REG_AUTO_HIBERNATE_IDLE_TIMER); + hba->ahit = 0; /* Unipro PA_Local_TX_LCC_Enable */ ufshcd_disable_host_tx_lcc(hba);