From patchwork Fri Aug 26 01:47:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 9300749 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B5F2A607D8 for ; Fri, 26 Aug 2016 01:49:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A33DA29439 for ; Fri, 26 Aug 2016 01:49:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 980862943C; Fri, 26 Aug 2016 01:49:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58C962943B for ; Fri, 26 Aug 2016 01:49:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756503AbcHZBtO (ORCPT ); Thu, 25 Aug 2016 21:49:14 -0400 Received: from mail-dm3nam03on0069.outbound.protection.outlook.com ([104.47.41.69]:49804 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756575AbcHZBtM (ORCPT ); Thu, 25 Aug 2016 21:49:12 -0400 X-Greylist: delayed 70329 seconds by postgrey-1.27 at vger.kernel.org; Thu, 25 Aug 2016 21:48:12 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=altera.onmicrosoft.com; s=selector1-altera-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=borM5xx89t4aitvXwfIJHLcpRpMcJEAutbDvlgO9cVE=; b=etgiUOxmS1tLZqc/rWnT8pDijSYkCmCKUon+nVfBbxPcMc2QuomeDHq2vM/H0RKG9sIlpeuudeQYSthZHlscZ2TQS3WCJolTGbmla5AwBxk17RixSjkFx3prXFPVMLawZiOxgNv7hzK/BC1cqbMqZNzS2SqYjixHDp1lv+6eyjo= Received: from BN6PR03CA0041.namprd03.prod.outlook.com (10.175.124.27) by BLUPR03MB1394.namprd03.prod.outlook.com (10.163.81.140) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.13; Fri, 26 Aug 2016 01:47:35 +0000 Received: from BY2FFO11FD037.protection.gbl (2a01:111:f400:7c0c::193) by BN6PR03CA0041.outlook.office365.com (2603:10b6:404:10c::27) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21 via Frontend Transport; Fri, 26 Aug 2016 01:47:35 +0000 Authentication-Results: spf=softfail (sender IP is 66.35.236.227) smtp.mailfrom=altera.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=altera.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning altera.com discourages use of 66.35.236.227 as permitted sender) Received: from sj-itexedge03.altera.priv.altera.com (66.35.236.227) by BY2FFO11FD037.mail.protection.outlook.com (10.1.14.222) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.6 via Frontend Transport; Fri, 26 Aug 2016 01:47:36 +0000 Received: from sj-mail01.altera.com (137.57.1.6) by webmail.altera.com (66.35.236.227) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 25 Aug 2016 18:47:21 -0700 Received: from ubuntu (pg-lftan-440b.altera.priv.altera.com [137.57.162.77]) by sj-mail01.altera.com (8.13.7+Sun/8.13.7) with SMTP id u7Q1lVog005298; Thu, 25 Aug 2016 18:47:32 -0700 (PDT) Received: by ubuntu (sSMTP sendmail emulation); Fri, 26 Aug 2016 09:47:30 +0800 From: Ley Foon Tan To: Bjorn Helgaas CC: , , Ley Foon Tan , Ley Foon Tan Subject: [PATCH v4 1/2] PCI: altera: Rework configs accessors Date: Fri, 26 Aug 2016 09:47:24 +0800 Message-ID: <1472176045-27815-2-git-send-email-lftan@altera.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472176045-27815-1-git-send-email-lftan@altera.com> References: <1472176045-27815-1-git-send-email-lftan@altera.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.35.236.227; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(189002)(199003)(7846002)(76176999)(5003940100001)(50986999)(5660300001)(356003)(8936002)(189998001)(48376002)(97736004)(11100500001)(107886002)(305945005)(47776003)(110136002)(50466002)(50226002)(92566002)(68736007)(42186005)(106466001)(4001430100002)(626004)(4326007)(8676002)(86362001)(19580405001)(2950100001)(87936001)(81156014)(36756003)(81166006)(105596002)(586003)(33646002)(229853001)(19580395003)(2906002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB1394; H:sj-itexedge03.altera.priv.altera.com; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD037; 1:r+0brR17oWYoC/HUiZDM3NChDlu5hKYINanN/61OmPoUDQ88J3XGSR1ihiwgeAUL3hvHe/CPg0K64ir7Cb/HsaW3O6+mSv3cuT+XJf15ztlToscQAfrlvk7unqT9hZNDmOW/9rHN13wkZJJGlJ1xUWXvac9yy0fq2PMf4/kwJriav8tSSUtMa1Lfd8cJLVbIHeJcEV2pvmWyJwrxCbIQ4MdcYGAprC9/fnpZz29ZyEGZQoBAoIRwK54Cz5t9qpZ2kyTdSgxVz7lLPaqDGQ9CHxRV/x+/AUTZeHPhFcwVKLJbVtwBLRbQgkUZ7RFB9zXu80puAymze30u0+bAXDntfq/w4xnSZt8VPyj7yrgOggu6Lgw3Wt15X3uUwSuqom9P8MnipNUTAcOSHgq7flxMZ+vhgcM7FgDIq0QPwBYdex63Yl0fnvl/rWaqjDfpQSvuw/v/iXga/ZhXzi3i4tKPtkar7lX6KC7cgKeGT8/JngpTHdbvKs7BSxZGHBCuUVx3nN5uYOE6rDuvv67zn+hk6b6CWpKixMRszwvNYkrxP3fhoydx2R1PEgGJe+9Jr/oW X-MS-Office365-Filtering-Correlation-Id: c521fb74-bbd0-425a-7e6a-08d3cd52f4af X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1394; 2:GRC3OEbZ8n23ZaX66VixmDK0J57V6U913h3ydFrikl9f/T2d8udWhvxFtjX+L8pOvSNiri3YYJgnsuV8YqIEeSQHW8njRY7oXeZMpgwNOxGNbNPOPD3VwL0NZ2Ld5MD33cVdIkaMk9TGsaGYSUbfihM6IbucUTxiNu/2Tjhfm+9aXdueahdcn6hoM+IB5/Xt; 3:pW4P6ii/SWGnd4Gq3jgAO9K0OEihju7vBi1FUN0zTOe+n+dQjVSM1+x/Xd+HUqf22Glnkcz3Ik6g6ipOSnEBZ8w7aUmSxluWB/h6F+jLZ8RCeZyiGQcOGh4K9Y6pqqOwkpZLtThZrDGi2mNh3npur8bPfkyWEFM22UgT+A3aQHpJMtg/WPeQBd+wg6CudXKybbfyJtxn7lGO6kCMIzstEYfHMRoRDH5D/tFDlbTqLsY= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1394; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1394; 25:rcSQETQ5rMt9KGoaGNVksm0xAU+hw1itq84Iy7NXYY2x1gMswoNIfaVJotOza3dYAIU7WJ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B/mmu8ZZiIKINhVxY7VuWZLfiyLSVhnN3OJCopPxYr2OhzGhDHqIkSzNBila4jiHeU3wkbS/5Z1ml7QLDJlRnnG5eZVuml/Y2fSkxWstQ=; 4:rtIR+EIzTosAq3c3uU2XHTAW2R8icMtsp1EBhuBAYgNT9n//vug6nAIiZMhHj1qFVGoUrfbh9OjEuOJb+Ylcv7QNZ4urmEKtPnvzZ12kvwhMTVSq1cJB4ewdm83l48NZUTNUp8kYOPXy1nG0OOk2FToa9CHOFhD3rwF7x5NBorytjuW9D18/jpXyN2a6S3e/2j4Zsj8y5712TTWpajX6exnbLRZrAsQ1tGVZGRE+fV/3A1JNovM9Bio0OJwHIVV5fZ+OFAiMl7yiMvxQ6Hp+AzH0ppIAio9NUnV40JNVS1yRP3mwjCSkoRnVDRicJQcady38MF+WBjaLudsqCLrd7rU6z9j3VnfRp3r+75xarKKWeLa3n8Hj+IwF2uKAT4++VVQNl1udpihJyYzdDet7hr6W2TuhTVZh0fXPFi/LVNBAqLBdja/hmnO8Z8CS4G3WVRztDdh+ne7eImRaAqi9VsUhfctsnJAMWQy5EC3EzJze4IyQvcxzf5NVKBGdl5A9JteY8y/9ko FWaYM7baA4RJpCmQ587gy09qL+v6M4bfU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(80048183373757); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13015025)(13023025)(13024025)(13018025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BLUPR03MB1394; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB1394; X-Forefront-PRVS: 00462943DE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB1394; 23:h25ini2l1s8Bq+Z0kyj8cNxxJvsS1K//HdiKQuDJd?= =?us-ascii?Q?qeo//CF4l1dpVcb3EZvxxjgsNg2XQTpPidvPCW3mUWpCkkU1EuZC4ZZc691d?= =?us-ascii?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ata: NSPM X-OriginatorOrg: altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 01:47:36.3498 (UTC) X-MS-Exchange-CrossTenant-Id: fbd72e03-d4a5-4110-adce-614d51f2077a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fbd72e03-d4a5-4110-adce-614d51f2077a; Ip=[66.35.236.227]; Helo=[sj-itexedge03.altera.priv.altera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1394 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Rework configs accessors so a future patch can use them in _probe() with struct altera_pcie instead of struct pci_bus. Signed-off-by: Ley Foon Tan --- drivers/pci/host/pcie-altera.c | 64 +++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c index 58eef99..34e6258 100644 --- a/drivers/pci/host/pcie-altera.c +++ b/drivers/pci/host/pcie-altera.c @@ -330,22 +330,14 @@ static int tlp_cfg_dword_write(struct altera_pcie *pcie, u8 bus, u32 devfn, return PCIBIOS_SUCCESSFUL; } -static int altera_pcie_cfg_read(struct pci_bus *bus, unsigned int devfn, - int where, int size, u32 *value) +static int _altera_pcie_cfg_read(struct altera_pcie *pcie, u8 busno, + unsigned int devfn, int where, int size, + u32 *value) { - struct altera_pcie *pcie = bus->sysdata; int ret; u32 data; u8 byte_en; - if (altera_pcie_hide_rc_bar(bus, devfn, where)) - return PCIBIOS_BAD_REGISTER_NUMBER; - - if (!altera_pcie_valid_config(pcie, bus, PCI_SLOT(devfn))) { - *value = 0xffffffff; - return PCIBIOS_DEVICE_NOT_FOUND; - } - switch (size) { case 1: byte_en = 1 << (where & 3); @@ -358,7 +350,7 @@ static int altera_pcie_cfg_read(struct pci_bus *bus, unsigned int devfn, break; } - ret = tlp_cfg_dword_read(pcie, bus->number, devfn, + ret = tlp_cfg_dword_read(pcie, busno, devfn, (where & ~DWORD_MASK), byte_en, &data); if (ret != PCIBIOS_SUCCESSFUL) return ret; @@ -378,20 +370,14 @@ static int altera_pcie_cfg_read(struct pci_bus *bus, unsigned int devfn, return PCIBIOS_SUCCESSFUL; } -static int altera_pcie_cfg_write(struct pci_bus *bus, unsigned int devfn, - int where, int size, u32 value) +static int _altera_pcie_cfg_write(struct altera_pcie *pcie, u8 busno, + unsigned int devfn, int where, int size, + u32 value) { - struct altera_pcie *pcie = bus->sysdata; u32 data32; u32 shift = 8 * (where & 3); u8 byte_en; - if (altera_pcie_hide_rc_bar(bus, devfn, where)) - return PCIBIOS_BAD_REGISTER_NUMBER; - - if (!altera_pcie_valid_config(pcie, bus, PCI_SLOT(devfn))) - return PCIBIOS_DEVICE_NOT_FOUND; - switch (size) { case 1: data32 = (value & 0xff) << shift; @@ -407,8 +393,40 @@ static int altera_pcie_cfg_write(struct pci_bus *bus, unsigned int devfn, break; } - return tlp_cfg_dword_write(pcie, bus->number, devfn, - (where & ~DWORD_MASK), byte_en, data32); + return tlp_cfg_dword_write(pcie, busno, devfn, (where & ~DWORD_MASK), + byte_en, data32); +} + +static int altera_pcie_cfg_read(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *value) +{ + struct altera_pcie *pcie = bus->sysdata; + + if (altera_pcie_hide_rc_bar(bus, devfn, where)) + return PCIBIOS_BAD_REGISTER_NUMBER; + + if (!altera_pcie_valid_config(pcie, bus, PCI_SLOT(devfn))) { + *value = 0xffffffff; + return PCIBIOS_DEVICE_NOT_FOUND; + } + + return _altera_pcie_cfg_read(pcie, bus->number, devfn, where, size, + value); +} + +static int altera_pcie_cfg_write(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 value) +{ + struct altera_pcie *pcie = bus->sysdata; + + if (altera_pcie_hide_rc_bar(bus, devfn, where)) + return PCIBIOS_BAD_REGISTER_NUMBER; + + if (!altera_pcie_valid_config(pcie, bus, PCI_SLOT(devfn))) + return PCIBIOS_DEVICE_NOT_FOUND; + + return _altera_pcie_cfg_write(pcie, bus->number, devfn, where, size, + value); } static struct pci_ops altera_pcie_ops = {