From patchwork Fri May 15 21:23:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 6416481 Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DC995C0432 for ; Fri, 15 May 2015 21:25:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 05DC12054C for ; Fri, 15 May 2015 21:25:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C1F2F2056D for ; Fri, 15 May 2015 21:25:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946025AbbEOVZN (ORCPT ); Fri, 15 May 2015 17:25:13 -0400 Received: from mail-bl2on0146.outbound.protection.outlook.com ([65.55.169.146]:46511 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1946166AbbEOVYE (ORCPT ); Fri, 15 May 2015 17:24:04 -0400 Received: from CY1PR0201CA0029.namprd02.prod.outlook.com (25.163.30.167) by CO1PR02MB077.namprd02.prod.outlook.com (10.242.164.11) with Microsoft SMTP Server (TLS) id 15.1.154.19; Fri, 15 May 2015 21:24:00 +0000 Received: from BY2FFO11FD005.protection.gbl (2a01:111:f400:7c0c::112) by CY1PR0201CA0029.outlook.office365.com (2a01:111:e400:58b9::39) with Microsoft SMTP Server (TLS) id 15.1.166.22 via Frontend Transport; Fri, 15 May 2015 21:23:59 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; arm.com; dkim=none (message not signed) header.d=none; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from atltwp01.amd.com (165.204.84.221) by BY2FFO11FD005.mail.protection.outlook.com (10.1.14.126) with Microsoft SMTP Server id 15.1.160.8 via Frontend Transport; Fri, 15 May 2015 21:23:58 +0000 X-WSS-ID: 0NOEU3V-07-0NG-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp01.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2160E12C0046; Fri, 15 May 2015 17:23:55 -0400 (EDT) Received: from SATLEXDAG04.amd.com (10.181.40.9) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 15 May 2015 16:24:01 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by satlexdag04.amd.com (10.181.40.9) with Microsoft SMTP Server id 14.3.195.1; Fri, 15 May 2015 17:23:54 -0400 From: Suravee Suthikulpanit To: , , , , , , , , CC: , , , , , , , , , , , "Suravee Suthikulpanit" Subject: [V4 PATCH 6/6] amd-xgbe: Unify coherency checking logic with device_dma_is_coherent() Date: Fri, 15 May 2015 16:23:14 -0500 Message-ID: <1431724994-21601-7-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1431724994-21601-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1431724994-21601-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD005; 1:SwTTGKw3ZiSqX81rweYYMAOvxMKsl8a2897XPZfi/LCVqUSxj6kcM1cBZRHYxoxyqb+k2cJF+KDBlQ7YPQcGNubSwWM5+QfVJdXtwiLqBNDnp1jhrZ9VhGWyeI0l/G+bbCxkYQZCypJEvgb7veZttJ1Fu1+X4nDkb65hePQPILho70jsdnS5KirZ7mnrYvb/HaEU9gvgNWAiKCQfJoOZLifoTUnHCN7apKoWSDFuZDWN5wCZ6WI9NC/WCfRkog/2ugwn0NKHiqSYzlVVZYllh0XMdH2HRM76EVaF0C4PASxHJP7X4ynMiXE5uddszk85 X-Forefront-Antispam-Report: CIP:165.204.84.221; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(189002)(199003)(2201001)(86362001)(106466001)(53416004)(50466002)(87936001)(46102003)(229853001)(48376002)(101416001)(189998001)(19580405001)(77096005)(5001770100001)(47776003)(2950100001)(19580395003)(50226001)(36756003)(105586002)(92566002)(77156002)(62966003)(76176999)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:CO1PR02MB077; H:atltwp01.amd.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO1PR02MB077; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:CO1PR02MB077; BCL:0; PCL:0; RULEID:; SRVR:CO1PR02MB077; X-Forefront-PRVS: 0577AD41D6 X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2015 21:23:58.5554 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96; Ip=[165.204.84.221]; Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR02MB077 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, amd-xgbe driver has separate logic to determine device coherency for DT vs. ACPI. This patch simplifies the code with a call to device_dma_is_coherent(). Signed-off-by: Tom Lendacky Signed-off-by: Suravee Suthikulpanit CC: David S. Miller --- drivers/net/ethernet/amd/xgbe/xgbe-main.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c index 7149053..6d2c702 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c @@ -168,13 +168,8 @@ static void xgbe_init_all_fptrs(struct xgbe_prv_data *pdata) #ifdef CONFIG_ACPI static int xgbe_acpi_support(struct xgbe_prv_data *pdata) { - struct acpi_device *adev = pdata->adev; struct device *dev = pdata->dev; u32 property; - acpi_handle handle; - acpi_status status; - unsigned long long data; - int cca; int ret; /* Obtain the system clock setting */ @@ -195,24 +190,6 @@ static int xgbe_acpi_support(struct xgbe_prv_data *pdata) } pdata->ptpclk_rate = property; - /* Retrieve the device cache coherency value */ - handle = adev->handle; - do { - status = acpi_evaluate_integer(handle, "_CCA", NULL, &data); - if (!ACPI_FAILURE(status)) { - cca = data; - break; - } - - status = acpi_get_parent(handle, &handle); - } while (!ACPI_FAILURE(status)); - - if (ACPI_FAILURE(status)) { - dev_err(dev, "error obtaining acpi coherency value\n"); - return -EINVAL; - } - pdata->coherent = !!cca; - return 0; } #else /* CONFIG_ACPI */ @@ -243,9 +220,6 @@ static int xgbe_of_support(struct xgbe_prv_data *pdata) } pdata->ptpclk_rate = clk_get_rate(pdata->ptpclk); - /* Retrieve the device cache coherency value */ - pdata->coherent = of_dma_is_coherent(dev->of_node); - return 0; } #else /* CONFIG_OF */ @@ -364,6 +338,7 @@ static int xgbe_probe(struct platform_device *pdev) goto err_io; /* Set the DMA coherency values */ + pdata->coherent = device_dma_is_coherent(pdata->dev); if (pdata->coherent) { pdata->axdomain = XGBE_DMA_OS_AXDOMAIN; pdata->arcache = XGBE_DMA_OS_ARCACHE;