Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2417479rwn; Fri, 9 Sep 2022 13:27:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR7CRnk/px+cF5IauYnVQaRi5vyLtTpzwe9IofpZ26ekvd5konoYAaEbAK3oWScM4Dx8q8QY X-Received: by 2002:a17:907:2ced:b0:773:6f77:f10f with SMTP id hz13-20020a1709072ced00b007736f77f10fmr7844558ejc.34.1662755248020; Fri, 09 Sep 2022 13:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662755248; cv=none; d=google.com; s=arc-20160816; b=UNw5WdIkgDmocOCJoxjw8EeUG6cQAz8wR2PecghtUsP9I/yqUfXDGK3XgyZtDsrrEE bHiPXm8XBVVsEgOoAOL6eXYsO0AAtYR2VprRgO+UihOVAXJZJhE7qBYP/bmCO82eaz1t 50j/ZD9WtPo5ia8bpHFnI3YoQ/MqX5yi1gJDo4yKL8409GWCiFcDrdSv33IEwMlRComW h6nlE3tQJd8NIEexiWd4ZuvLAMgOjPZ6eqaoQ49qWBWs3TwCGnXHo7RVn0yXrlGu5iNW zZVW09pXqM3fP+5vpifpbNZTE8Hw4cjTxObZHBL5d9aLQms7Oj+kruB64U1fynDRvUwP U2XA== 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:dkim-filter; bh=2uGMZvqONo/mGb1/ywfB2p6vdAzh6/ySAHV5YXJ66sg=; b=vOpw8dW/cnRDdXB5dUdMO5b5+DcBQOkE0gRPH/ZwOROCpVPDvthVrx12hdzZuFw841 cwTnli+kJ94hZBqhI3PgVR9G0LsJtBt82zd6owlNjVN132miACysBVe5P7tyy4S5bDU3 xB5AYNyM+oJwyWTd48Mfqdxjs2CbEK69kORh5khbZyweDfzAQViiaznrbcIPg3PrpHA6 SH1n1pRv62wi0D5MQgu41iG33Ou3dicd5aG+ZW4PtSvQ+5Hwsa5mG+ZOZqh6y82tuCCr zBxD8CMskXyCRjAwlMCIXbUKxgxwULnhDuTnHmtUklJfl6UFylOp0DxG1qDdRWbEfrY9 hFig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=mail header.b=ckiSdyXX; 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=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di12-20020a170906730c00b00779bfd92c85si1561261ejc.10.2022.09.09.13.27.03; Fri, 09 Sep 2022 13:27:28 -0700 (PDT) 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=@baikalelectronics.ru header.s=mail header.b=ckiSdyXX; 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=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231719AbiIITiY (ORCPT + 99 others); Fri, 9 Sep 2022 15:38:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231611AbiIIThS (ORCPT ); Fri, 9 Sep 2022 15:37:18 -0400 Received: from mail.baikalelectronics.com (mail.baikalelectronics.com [87.245.175.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0A5A211E6F5; Fri, 9 Sep 2022 12:36:49 -0700 (PDT) Received: from mail (mail.baikal.int [192.168.51.25]) by mail.baikalelectronics.com (Postfix) with ESMTP id 67B04DC2; Fri, 9 Sep 2022 22:40:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.baikalelectronics.com 67B04DC2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baikalelectronics.ru; s=mail; t=1662752429; bh=2uGMZvqONo/mGb1/ywfB2p6vdAzh6/ySAHV5YXJ66sg=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=ckiSdyXX6/kEg4mGPqIUSRtmPdMugy2tKqRLF0S3DLItruLeTqoYOxUuN3vcIMcGz P7bbBFZHB/VMQqBF+KXcCiT9nK2HTrmFhYV5IrdTOl7pa4AErDZanrkM5CfsHXUSUg U5SHAQjRdoJWaj+7thO7N08ZAfaxbadrSJ+9Hzbg= Received: from localhost (192.168.168.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 9 Sep 2022 22:36:40 +0300 From: Serge Semin To: Damien Le Moal , Hans de Goede , Jens Axboe , Hannes Reinecke CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Rob Herring , Krzysztof Kozlowski , , , Subject: [PATCH v8 14/23] ata: libahci: Don't read AHCI version twice in the save-config method Date: Fri, 9 Sep 2022 22:36:12 +0300 Message-ID: <20220909193621.17380-15-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20220909193621.17380-1-Sergey.Semin@baikalelectronics.ru> References: <20220909193621.17380-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 There is no point in reading the AHCI version all over in the tail of the ahci_save_initial_config() method. That register is RO and doesn't change its value even after reset. So just reuse the data, which has already been read from there earlier in the head of the function. Signed-off-by: Serge Semin Reviewed-by: Hannes Reinecke --- drivers/ata/libahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 000a7072614f..1ffaa5f5f21a 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -564,7 +564,7 @@ void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv) /* record values to use during operation */ hpriv->cap = cap; hpriv->cap2 = cap2; - hpriv->version = readl(mmio + HOST_VERSION); + hpriv->version = vers; hpriv->port_map = port_map; if (!hpriv->start_engine) -- 2.37.2