Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5615212pxb; Mon, 28 Mar 2022 15:00:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXziaF5CK101GUFEUjkdk47vN/pB4nUZdXoSMQd6C/UeLMZjnoAaS/EYIzD6oZjnO/EA4z X-Received: by 2002:a05:6830:8f:b0:5cd:7916:7c81 with SMTP id a15-20020a056830008f00b005cd79167c81mr11077008oto.119.1648504853001; Mon, 28 Mar 2022 15:00:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648504852; cv=none; d=google.com; s=arc-20160816; b=WuqLAabVPVZuENy2vpNrpL8Zn7EwRcUXqs446wT7zSZJ99BJr7uWpRew+eb07WzXZj sp349ympfEC9FdeNoW/kus0TGTDbsyqgyOEHMqMSDXnyqEfNZLcmRnRfzAhd5txOFQt0 57Rj2wNVzBdWwYEh0iCokoANqfYsSLX7xEwgS3dmnIJbgaR1NVlO/IcU3U4fEuyF4Afu 1kirAKrRVpnZkp1NK45/QlSoFPxxi4t7W8l5AVD8Lmk7yzBIfyUMZrT2iQzm6nKLBrXE sYxD8kae0/sDOIV3hCIEc6EiTqZ+r4nZG3Ai5w9Wbydy+MxXE4fOnEtpjjDVj3tRw/5T GLPA== 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=kz+leqgXu9Oyb7Iv/xF8mH6bVvrAfosELcFPiuERPeU=; b=E7KOQMovnXyoK2wADVt22SkglsWAwNxxF0QIcgrdOefxaiAwWBQab5EZEvkzOPcJZG 1k90R4r5SYX0sNaxfHSqw0AEtQFlVcfE4lTrPl7jsIZn5n7vC20JJQyNCHPCH2TEMy8b 8R+rI7IcQEEqFKSqAxJMEsoMDbXdVkJ6kEYE7gfz26pDXZOaYl8PeVK9K8zuoEDHfERF fr9r7UFXKuaPWRG87P6Kz6wkRi90n16JkgRx/SYLUaTON7GkcQPKqm8DW6NhNzMmV/Vc pkHcPtqcRb+7t62442kgmjOsvebbcgVowZ4k+ml53IXG/ayN4XcMjcNeDMdIcs6YFFAf 4EbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=mail header.b=PYV7Biu2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m6-20020a056870a40600b000da7b4a061fsi10352482oal.261.2022.03.28.15.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 15:00:52 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=mail header.b=PYV7Biu2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CEAD513BACD; Mon, 28 Mar 2022 14:26:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238696AbiC1Pp5 (ORCPT + 99 others); Mon, 28 Mar 2022 11:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238577AbiC1Ppx (ORCPT ); Mon, 28 Mar 2022 11:45:53 -0400 Received: from mail.baikalelectronics.ru (mail.baikalelectronics.com [87.245.175.226]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0553D4A3DE; Mon, 28 Mar 2022 08:44:11 -0700 (PDT) Received: from mail.baikalelectronics.ru (unknown [192.168.51.25]) by mail.baikalelectronics.ru (Postfix) with ESMTP id A9B321E28D9; Thu, 24 Mar 2022 03:16:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.baikalelectronics.ru A9B321E28D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baikalelectronics.ru; s=mail; t=1648081001; bh=kz+leqgXu9Oyb7Iv/xF8mH6bVvrAfosELcFPiuERPeU=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=PYV7Biu2TIFAHPuME7iZf0Ou6i0t2IxNSrf/pLaXKPQ9Tr2AoWFCo+xPZ6p7In8H9 zpktk53MZqmZck9QgqdR4KNGkc+NzBzEqdYEs8mdRw3EVGIpWBQ71LEvA/6j3E5Uq2 MTiIsU7dR9o3CKOalj6Yi7fLAYa6CNwMXoyH2Soc= Received: from localhost (192.168.168.10) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 24 Mar 2022 03:16:41 +0300 From: Serge Semin To: Damien Le Moal , Hans de Goede , Jens Axboe CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Rob Herring , , , Subject: [PATCH 14/21] ata: ahci: Convert __ahci_port_base to accepting hpriv as arguments Date: Thu, 24 Mar 2022 03:16:21 +0300 Message-ID: <20220324001628.13028-15-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20220324001628.13028-1-Sergey.Semin@baikalelectronics.ru> References: <20220324001628.13028-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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 It may get required to retrieve the port-base address even before the ata_host instance is initialized and activated, for instance in the ahci_save_initial_config() method which we about to update (consider this modification as a preparation for that one). Seeing the __ahci_port_base() function isn't used much it's the best candidate to provide the required functionality. So let's convert it to accepting the ahci_host_priv structure pointer. Signed-off-by: Serge Semin --- drivers/ata/ahci.c | 2 +- drivers/ata/ahci.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 8ce0d166cc8d..973190732cd6 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -687,7 +687,7 @@ static void ahci_pci_init_controller(struct ata_host *host) mv = 2; else mv = 4; - port_mmio = __ahci_port_base(host, mv); + port_mmio = __ahci_port_base(hpriv, mv); writel(0, port_mmio + PORT_IRQ_MASK); diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 519d148ecaea..0fde57e7457e 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -433,10 +433,9 @@ int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht); void ahci_error_handler(struct ata_port *ap); u32 ahci_handle_port_intr(struct ata_host *host, u32 irq_masked); -static inline void __iomem *__ahci_port_base(struct ata_host *host, +static inline void __iomem *__ahci_port_base(struct ahci_host_priv *hpriv, unsigned int port_no) { - struct ahci_host_priv *hpriv = host->private_data; void __iomem *mmio = hpriv->mmio; return mmio + 0x100 + (port_no * 0x80); @@ -444,7 +443,9 @@ static inline void __iomem *__ahci_port_base(struct ata_host *host, static inline void __iomem *ahci_port_base(struct ata_port *ap) { - return __ahci_port_base(ap->host, ap->port_no); + struct ahci_host_priv *hpriv = ap->host->private_data; + + return __ahci_port_base(hpriv, ap->port_no); } static inline int ahci_nr_ports(u32 cap) -- 2.35.1