From patchwork Mon Sep 18 16:55:50 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: 13390131 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 36575CD37B0 for ; Mon, 18 Sep 2023 16:58:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231285AbjIRQ6W (ORCPT ); Mon, 18 Sep 2023 12:58:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231358AbjIRQ6I (ORCPT ); Mon, 18 Sep 2023 12:58:08 -0400 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4537B199; Mon, 18 Sep 2023 09:57:57 -0700 (PDT) Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3adc3d94f66so1493792b6e.1; Mon, 18 Sep 2023 09:57:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695056276; x=1695661076; 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=wCypCAdxLQEQSsjVxKqyMg4NnLK4235hjyBON3mIlJ3rtIjU9039u5BRCP8dv9JIPo C4CulW3Uiaqkx9+ykSL+GHh8EsDUVzDG5coct075ufTBOJuur/56YSP+F6+KCu7CcmLb B1wxx3sGTbc0W602wgUT64fNSFLen4lfkJuRM0xaYv9FeXkpxBxm6nw0yyLrrHuAa6ZA mo3kkDDYxeoNaBNTm8PL/QoaRSiUm/KxpVi/t53HiIJFv7nZZAsWgbSdKAy/FG7WaTo2 YNv/fdQP9EDJr1c7l/8on6KL48y5o0d6DCDcpU2Grv0Jo0p5+x9vhZvFkvdBI6tOgaL0 8HjA== X-Gm-Message-State: AOJu0YzGTCdH7e/uzL8tUFqlHiMPfgxQeLrvay8U7gTM9AZHEbmK6pVz mtMAYpT3qu5/8wQziEi+MwY= X-Google-Smtp-Source: AGHT+IHxegZRpFbdE1MwbePiZs3LV/jW7GX4WpCEHZo7IRU1GsUV+175fXoY6IiHx3qdKjjBRW6+7w== X-Received: by 2002:a05:6808:a81:b0:3a7:af4c:2406 with SMTP id q1-20020a0568080a8100b003a7af4c2406mr10351954oij.44.1695056276396; Mon, 18 Sep 2023 09:57:56 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:33e7:1437:5d00:8e3b]) by smtp.gmail.com with ESMTPSA id p17-20020a639511000000b005740aa41237sm5658041pgd.74.2023.09.18.09.57.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 09:57:55 -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" , Bean Huo , Adrian Hunter , Krzysztof Kozlowski Subject: [PATCH v12 11/16] scsi: ufs: hisi: Rework the code that disables auto-hibernation Date: Mon, 18 Sep 2023 09:55:50 -0700 Message-ID: <20230918165713.1598705-12-bvanassche@acm.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230918165713.1598705-1-bvanassche@acm.org> References: <20230918165713.1598705-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);