From patchwork Wed Oct 18 17:54:35 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: 13427632 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 7F418CDB483 for ; Wed, 18 Oct 2023 17:57:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231864AbjJRR5K (ORCPT ); Wed, 18 Oct 2023 13:57:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232586AbjJRR4v (ORCPT ); Wed, 18 Oct 2023 13:56:51 -0400 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBD5812B; Wed, 18 Oct 2023 10:56:49 -0700 (PDT) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6934202b8bdso6196655b3a.1; Wed, 18 Oct 2023 10:56:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697651809; x=1698256609; 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=XeTP9UxMC9xuYvRY29/KP6o+hE37UxPqFnd4pYMhYhI=; b=ZnYt8jBcP6MivTni4NP3Ccv5upl30fyYHLTTDgotrXJS6LTM2ooovOajOjeHHx00jF q8uQ+vm/C+aP8G5SnQAG0oB4UM+KEOfNxcYH3UTLGyVE5+13F9GNUkZBg5y/i0sYjk4r Mg6mHyf6ibJyPCB6kGnyHzbKrAcOKc6BJfqtG8TEP6b9J1ie5iAYOTZ1f+orLZ/dsh7u 6S+cYAqfcKrE3kinF5GQTt0BkqI5+qxypbcxaIqhqU+GD51cg1eW/T/c52xSKo95zAo+ nvEXk/5T2xEcu4J069QFSg1GkIgPJkp+gJTSxzfx7SV0EMRtJSLFELEP89w22DY976Vc gGqA== X-Gm-Message-State: AOJu0YzKxslAhp0cjN+oOClbynPgEZ8Ords+CLiT2wJfJPPOOsM2x5Yo ZCPh/OI/tqXikAkp3IVtaxc= X-Google-Smtp-Source: AGHT+IGPPsi4hLwOqm8sKAT84KTTE+joZI3ncYitA1DGN1iNK/jJh5qeljzIhxxuItGT0qvIosVVLg== X-Received: by 2002:a05:6a00:10c6:b0:6b6:e147:717 with SMTP id d6-20020a056a0010c600b006b6e1470717mr6816277pfu.23.1697651809048; Wed, 18 Oct 2023 10:56:49 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:66c1:dd00:1e1e:add3]) by smtp.gmail.com with ESMTPSA id p15-20020aa7860f000000b00690cd981652sm3628612pfn.61.2023.10.18.10.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:56:48 -0700 (PDT) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, "Martin K . Petersen" , Christoph Hellwig , Bart Van Assche , "Bao D . Nguyen" , Can Guo , Avri Altman , "James E.J. Bottomley" , Krzysztof Kozlowski , Keoseong Park Subject: [PATCH v13 13/18] scsi: ufs: hisi: Rework the code that disables auto-hibernation Date: Wed, 18 Oct 2023 10:54:35 -0700 Message-ID: <20231018175602.2148415-14-bvanassche@acm.org> X-Mailer: git-send-email 2.42.0.655.g421f12c284-goog In-Reply-To: <20231018175602.2148415-1-bvanassche@acm.org> References: <20231018175602.2148415-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@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 5b3060cd0ab8..f2ec687121bb 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);