{"id":1641674,"url":"http://patchwork.ozlabs.org/api/patches/1641674/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ide/patch/20220610081801.11854-16-Sergey.Semin@baikalelectronics.ru/","project":{"id":13,"url":"http://patchwork.ozlabs.org/api/projects/13/?format=json","name":"Linux IDE development","link_name":"linux-ide","list_id":"linux-ide.vger.kernel.org","list_email":"linux-ide@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20220610081801.11854-16-Sergey.Semin@baikalelectronics.ru>","list_archive_url":null,"date":"2022-06-10T08:17:53","name":"[v4,15/23] ata: ahci: Convert __ahci_port_base to accepting hpriv as arguments","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"d06e82c849e3488de0f390f5c267f9ce21f18aae","submitter":{"id":78624,"url":"http://patchwork.ozlabs.org/api/people/78624/?format=json","name":"Serge Semin","email":"Sergey.Semin@baikalelectronics.ru"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-ide/patch/20220610081801.11854-16-Sergey.Semin@baikalelectronics.ru/mbox/","series":[{"id":304159,"url":"http://patchwork.ozlabs.org/api/series/304159/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ide/list/?series=304159","date":"2022-06-10T08:17:42","name":"ata: ahci: Add DWC/Baikal-T1 AHCI SATA support","version":4,"mbox":"http://patchwork.ozlabs.org/series/304159/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/1641674/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/1641674/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linux-ide-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["bilbo.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=baikalelectronics.ru header.i=@baikalelectronics.ru\n header.a=rsa-sha256 header.s=mail header.b=R9z226et;\n\tdkim-atps=neutral","ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2620:137:e000::1:20; helo=out1.vger.email;\n envelope-from=linux-ide-owner@vger.kernel.org; receiver=<UNKNOWN>)"],"Received":["from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20])\n\tby bilbo.ozlabs.org (Postfix) with ESMTP id 4LKDQ00Mbcz9s09\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Jun 2022 18:19:04 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n        id S1347477AbiFJIS7 (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n        Fri, 10 Jun 2022 04:18:59 -0400","from lindbergh.monkeyblade.net ([23.128.96.19]:35950 \"EHLO\n        lindbergh.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n        with ESMTP id S1347297AbiFJISm (ORCPT\n        <rfc822;linux-ide@vger.kernel.org>); Fri, 10 Jun 2022 04:18:42 -0400","from mail.baikalelectronics.com (mail.baikalelectronics.com\n [87.245.175.230])\n        by lindbergh.monkeyblade.net (Postfix) with ESMTP id A64BD22077A;\n        Fri, 10 Jun 2022 01:18:27 -0700 (PDT)","from mail (mail.baikal.int [192.168.51.25])\n        by mail.baikalelectronics.com (Postfix) with ESMTP id 90A1E16A4;\n        Fri, 10 Jun 2022 11:19:07 +0300 (MSK)","from localhost (192.168.53.207) by mail (192.168.51.25) with\n Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 10 Jun 2022 11:18:15 +0300"],"DKIM-Filter":"OpenDKIM Filter v2.11.0 mail.baikalelectronics.com 90A1E16A4","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=baikalelectronics.ru; s=mail; t=1654849147;\n        bh=A+W4XClXlfkhgcR00Y8l0/PKuATXmBMrfHaiygA/2qg=;\n        h=From:To:CC:Subject:Date:In-Reply-To:References:From;\n        b=R9z226etTIBTfkJkEHr6FvnBBY9eunvhu8ZFvQ+INzAuAfcQtsvuPBA6RQh15oqah\n         YzcKvBN4CtNZZ1IEvaA59X34wtwfIUKCerB4kIOK6w2ttLrlkK9sILSwNDpd1AL3Cf\n         BatiSv73D5Kj7ui5X4BRiLizTcvtf8zJ6GHdqRqE=","From":"Serge Semin <Sergey.Semin@baikalelectronics.ru>","To":"Damien Le Moal <damien.lemoal@opensource.wdc.com>,\n        Hans de Goede <hdegoede@redhat.com>,\n        Jens Axboe <axboe@kernel.dk>, Hannes Reinecke <hare@suse.de>","CC":"Serge Semin <Sergey.Semin@baikalelectronics.ru>,\n        Serge Semin <fancer.lancer@gmail.com>,\n        Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,\n        Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,\n        Rob Herring <robh+dt@kernel.org>, <linux-ide@vger.kernel.org>,\n        <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>","Subject":"[PATCH v4 15/23] ata: ahci: Convert __ahci_port_base to accepting\n hpriv as arguments","Date":"Fri, 10 Jun 2022 11:17:53 +0300","Message-ID":"<20220610081801.11854-16-Sergey.Semin@baikalelectronics.ru>","In-Reply-To":"<20220610081801.11854-1-Sergey.Semin@baikalelectronics.ru>","References":"<20220610081801.11854-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,\n        DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,\n        T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no\n        version=3.4.6","X-Spam-Checker-Version":"SpamAssassin 3.4.6 (2021-04-09) on\n        lindbergh.monkeyblade.net","Precedence":"bulk","List-ID":"<linux-ide.vger.kernel.org>","X-Mailing-List":"linux-ide@vger.kernel.org"},"content":"It may get required to retrieve the port-base address even before the\nata_host instance is initialized and activated, for instance in the\nahci_save_initial_config() method which we about to update (consider this\nmodification as a preparation for that one). Seeing the __ahci_port_base()\nfunction isn't used much it's the best candidate to provide the required\nfunctionality. So let's convert it to accepting the ahci_host_priv\nstructure pointer.\n\nSigned-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>\nReviewed-by: Hannes Reinecke <hare@suse.de>\n---\n drivers/ata/ahci.c | 2 +-\n drivers/ata/ahci.h | 7 ++++---\n 2 files changed, 5 insertions(+), 4 deletions(-)","diff":"diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c\nindex 9bc8fa77e92f..d14d74649e0e 100644\n--- a/drivers/ata/ahci.c\n+++ b/drivers/ata/ahci.c\n@@ -689,7 +689,7 @@ static void ahci_pci_init_controller(struct ata_host *host)\n \t\t\tmv = 2;\n \t\telse\n \t\t\tmv = 4;\n-\t\tport_mmio = __ahci_port_base(host, mv);\n+\t\tport_mmio = __ahci_port_base(hpriv, mv);\n \n \t\twritel(0, port_mmio + PORT_IRQ_MASK);\n \ndiff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h\nindex 0e66446a5883..8b9826533ae5 100644\n--- a/drivers/ata/ahci.h\n+++ b/drivers/ata/ahci.h\n@@ -431,10 +431,9 @@ int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht);\n void ahci_error_handler(struct ata_port *ap);\n u32 ahci_handle_port_intr(struct ata_host *host, u32 irq_masked);\n \n-static inline void __iomem *__ahci_port_base(struct ata_host *host,\n+static inline void __iomem *__ahci_port_base(struct ahci_host_priv *hpriv,\n \t\t\t\t\t     unsigned int port_no)\n {\n-\tstruct ahci_host_priv *hpriv = host->private_data;\n \tvoid __iomem *mmio = hpriv->mmio;\n \n \treturn mmio + 0x100 + (port_no * 0x80);\n@@ -442,7 +441,9 @@ static inline void __iomem *__ahci_port_base(struct ata_host *host,\n \n static inline void __iomem *ahci_port_base(struct ata_port *ap)\n {\n-\treturn __ahci_port_base(ap->host, ap->port_no);\n+\tstruct ahci_host_priv *hpriv = ap->host->private_data;\n+\n+\treturn __ahci_port_base(hpriv, ap->port_no);\n }\n \n static inline int ahci_nr_ports(u32 cap)\n","prefixes":["v4","15/23"]}