From patchwork Wed May 10 16:39:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghava Aditya Renukunta X-Patchwork-Id: 9719245 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 9F3A560236 for ; Wed, 10 May 2017 06:24:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F3E0284D5 for ; Wed, 10 May 2017 06:24:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8436628552; Wed, 10 May 2017 06:24:11 +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=-5.0 required=2.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_HI 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 D7274284D5 for ; Wed, 10 May 2017 06:24:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751581AbdEJGYK (ORCPT ); Wed, 10 May 2017 02:24:10 -0400 Received: from mail-dm3nam03on0062.outbound.protection.outlook.com ([104.47.41.62]:55936 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751483AbdEJGYH (ORCPT ); Wed, 10 May 2017 02:24:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mscc365.onmicrosoft.com; s=selector1-microsemi-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=XLWLl945c0r9GgxSX5lTOb2lcnYZoW/RNnhKjup7Fkk=; b=GxCY8qqYlPnQapOf9SiurtQ0ZDqK5+Sjy9oW8ogUDsTpsieLKUkylG+m0OEYPFHubhEVrMkuuiwTJDHxRy05jBKMGSsC259UF524O8jfNzeBJMkhu7PnNiyBiay9VtyDnyea/e4+uNozFe3Sh7NSMieUaOLNn1agOdwneQFl3X8= Received: from CY4PR02CA0034.namprd02.prod.outlook.com (10.175.57.148) by BY2PR0201MB1894.namprd02.prod.outlook.com (10.163.75.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Wed, 10 May 2017 06:24:05 +0000 Received: from BN1BFFO11FD011.protection.gbl (2a01:111:f400:7c10::1:131) by CY4PR02CA0034.outlook.office365.com (2603:10b6:903:117::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11 via Frontend Transport; Wed, 10 May 2017 06:24:04 +0000 Authentication-Results: spf=neutral (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=microsemi.com; Received-SPF: Neutral (protection.outlook.com: 208.19.100.21 is neither permitted nor denied by domain of microsemi.com) Received: from avsrvexchhts1.microsemi.net (208.19.100.21) by BN1BFFO11FD011.mail.protection.outlook.com (10.58.144.74) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1047.9 via Frontend Transport; Wed, 10 May 2017 06:24:04 +0000 Received: from localhost (10.181.72.13) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server (TLS) id 14.3.339.0; Tue, 9 May 2017 23:24:01 -0700 From: Raghava Aditya Renukunta To: , , CC: , , , Subject: [PATCH V2 02/19] aacraid: Fix DMAR issues with iommu=pt Date: Wed, 10 May 2017 09:39:36 -0700 Message-ID: <1494434393-17261-3-git-send-email-RaghavaAditya.Renukunta@microsemi.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494434393-17261-1-git-send-email-RaghavaAditya.Renukunta@microsemi.com> References: <1494434393-17261-1-git-send-email-RaghavaAditya.Renukunta@microsemi.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.100.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39850400002)(39400400002)(39410400002)(39860400002)(39450400003)(39840400002)(2980300002)(189002)(199003)(9170700003)(189998001)(36756003)(478600001)(104016004)(8676002)(50466002)(2201001)(72206003)(77096006)(305945005)(81166006)(47776003)(8936002)(86362001)(53936002)(54906002)(76506005)(57986006)(6666003)(4326008)(356003)(107886003)(2950100002)(38730400002)(5003940100001)(105586002)(50226002)(106466001)(5660300001)(50986999)(76176999)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB1894; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Neutral; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD011; 1:exwJSOUqyMxwq9L45abFHd70muUnsjcF65EnvZN0kKl1Jp9W93PGVo+lng4g7qJ/AIBsaDbHwhY/VJ0YY6Uzbcw+w/BayGMms8fhnErWx7GoCC5LM/wywiOJW5c+KwGh78Xw4KMbLSghAuUnZgMz+MrQJ82XiEKMevEYa2R/gwDdA9bsoVLZlj7AdV2mlnAmjUCtltx7PtYqtkmbCAas58REaEOUdbJa9OyUa2SVMr/ftpUIFiDo9VCGVT5nEWQds/CUf/yi/t09NPjErq1l9hXUldgBOcN4MK3zuF126L0JqfVSJ4VYTZ4zWfnZJPKTLzS63XsFrZPJaPcsx2UZA+tjbzpxSby21/9gow3B4aQBldY4fzOcCE2uCh71yvW/sFbYL1IpohRAjktD3FrgDn9CkiLY6XD3ggfeyOQOdwDnqI1f+mzq7cIdGgC0NIBxQIFADf1hxEDMY7lTdDD/EqwoNciUvLySQ4aN7Kk+oMlu0SZ5/rqFfMfDFEB76vLsdFZid1nxjoEWSmi8M/m51kvK5g/NekJPLaRTRsabVBF1bcS/7XFAE9cd/sY/i2c/zdxVUI6+1t0emTR38j4Qnw== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3e2b07c1-bec4-46be-112f-08d4976d2833 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BY2PR0201MB1894; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1894; 3:8y2Y3xd7ycGLD2f/0nocuOY6EvJtHr6tptU3ISrYD8rW6HaRuAImE+t+XyL9tQpGtsRS7ur6arLcCwsIKI9a9ZcoMlAtV78L4mBDO9ilVwBZAns2PtHaYv74HCX6Gkn4lbCuzEreoMqn7LP/QwE2zMyfbgjrhga0JrciO8P2KdRyBQO2imOGU0ByY0z4wr/NsgC381nAj+YmdRlrCt5FgLdCw5dIo7Wiykpp42xjaZ+pam6CuwmPSjovQAsDJkp1a43b88sqekPg3sUrhS0xL3bt+oFLjdujGOMswwqNsdJ8kfAZkU/ReM28x6lzgVEQuNu7CrTsBxjrxz/jT51daKRb9at8kMcVwxzs9hBIUZCGFo8mTTYA4YdOWXPQt6UClwzKkT5kBUeJAvo4vcteeh7CtGxCMA3tQ/xb4tNz4eGeNdaHYL1bdmJia4rmBwbplCje0Yt1cjb5fx4nASEkLgbOpmVemkaQpKyauTR6luwKL2ZqX+uHxIgUHlwPk/B2 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1894; 25:tUsjzeXY41LubESRjvSziMDLKDtTtynIGkkHI8ADggnjqqe3a7AwfnAZnQjsRpFf37SP/7ehKaD0Jeh+BfhN/owcZWSyQGZX5Fgr19F3ZDrqjto/J8xUsxFh61XBQ3oN0Hfuvqy0hjKxOecfod5wDnjXBCLXCjHt3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uuATb8AQ/7tswOnwZihodU2mvxa5gakKKbhVfuR/YFiIyJ1van6pdt0BWc9Z8tmG4oHMyAmhz7fn2A2XOWy1fsMDoEZt52d0egJN1r55u2awiBfoFt5pQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13015025)(5005006)(13017025)(13024025)(13023025)(13018025)(8121501046)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(6072148); SRVR:BY2PR0201MB1894; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0201MB1894; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1894; 4:18YbPufW8mJT3puf0cjjw987maD2RTfXRHrNPp70RvEcIyNH6aAbJgfzPukjV8kdBNL5Sc54OFUH/mxmcj9I1aDkFV6z29AiZpW8zTIDUPubn2LlPDJg8u2YjDu2YGeoBvscNeFLnViQCQVHAwL33BeHni53AN4E2NN4E5NZyhPcG6lVI7a2QfaO8xFoyyuUAmLNeIQdt5Qpqq5kldQia6b6298oZskC+wFvgFlNuWk4vk4brPlJ2VSXgXdSlLkiW2bCmS0kIVSR4m883KBx+Jb4cCAKIOTf8ITlNJFc7jQfbEPnu1fNigBwpcx+tT72zVfsWT/gXfgygRjvJDn3PEkG6aScA7QHQg2U+FOKiNhcfWmrh0Ghnq2aSMFnJtBvJ40oarPnU8JyqxeeJzlKTj79R60VKKufFPOQbo9d0PExgx/zT4Gpt1AKuc4MHqL98vzcakE24rT05kAXHkj5tkKR/VAa83wb4NaHdKD/X5Gw+LtLy0IU2ycAnYgJ0SMO13+I1WiNHgctc9a7mik7YJ/PY8JGQWYZioPTs+fxCbwU+i4hK/jxqEwF4FyJls9djrD7edVfCqbbFMG+d+fjRQAx5TqPJZ19PYLDB+6ya+B9WewWhbRgiDlJ0TicdL0IsnhFPNZa2yL5E2A1QG6w4rQKtZF/VHeq3SPtI9dfXpj7Hg9S7bIBlFUrSUGIovvekNTuYPd2Vw45YdAzGWjKglTjF6uwGP9v7fgYGzVeCxtc4nve2e/x48T8ysS4vqRW9XZHYwtNrwYwyXOM/ZWSDzSuK9ipOCwA1CyMtlL5mllkfPVleubWkHQAbEPLcw2VkT0JvktSBExNnK7jnb22Y3f5UTXzPM0LC72g7JTB+U89AZCYZmMyJtrdCwDSwLFbXY/QyQ0vFZvRgcgGKobhnV6xzKmOOZ/I8no21n1K XGr/kEsmmf9dEuHgoxOfZUds X-Forefront-PRVS: 03030B9493 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0201MB1894; 23:QQ4HGe7KoLoVSZWE2dXhJuFtgzsdG3RU6/AP6fW?= =?us-ascii?Q?7Z5zYF0NiRl+U4FQws5z+gdGGKbD0hxF7hD4F1RPDQU8kbGjjItojFijMhyp?= =?us-ascii?Q?3tjlibxq3xGdb6MmvQW/aiYIlDF8edo2T0VUjadHJc8YQUzeJsjShxNONOIX?= =?us-ascii?Q?JC48aSs8YkBnq9T0klb4nVW7aj1ufP920SAH8uDLae9274G7wVdH3RTPRjNJ?= =?us-ascii?Q?E1pzR0jFsQfFNvf7hHjF/I+crySCqlB8/mtOEgpcuPXFjRkYWfiX7eleQVjL?= =?us-ascii?Q?3GgM9PfX/tKQy9VNDG6PR8ljsAeQkfiLo+4HHZCFkCNVdRfph+yKSRYuUwGl?= =?us-ascii?Q?VNqTWQbaPq1AQyGQo4WRSrA8WOhwX/jt7v7gOL6yvVCRvTiatJE5OjrL7tgI?= =?us-ascii?Q?vd4N9CYvXXJQ9A5OIsuHCViincaX04wYjyZiVVw//VFds6/753izkJjv+5Le?= =?us-ascii?Q?cb/wLvBihk8qSddbSzLyl+jE9Vq79CYQUMhyGWrp9APFcTmg/u39JrZbYKRB?= =?us-ascii?Q?oMXQTrzayxJKI66hqYCI3lKQRPvcqH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8/PnbaoHBKzZSMSyAtyEGjSAubDTUEnIjLd22SplvY/SM5aIVO7ViMyGKZCT0J3e7UhjKji8NV9g+cwWI8fCigFCoVluDwz6DCK6O0PTP764nk2EmxyxsfH9dhl11HHKA1aJI2Jam2tW3GRlbsbJBn8e0CMKL0g38C2h9zik49qACF/9gHvfl3qs0a4xzIVDvu032dbnL8=; 5:vYWF/7jHz9/pvZdjM1abvBaT5q+0BJh0ysJcMtaKg7poiKkr8ddGqcosyrrEg/LJs3ewGGcOFT2yilNArReBzHTv+Wye+kK7tdArfZU/r9Va1A1DVLbZZVIYb/i1vtg0BBqf3HOdmGXKiSClYXEBag==; 24:K/SEQYO/DAHsfF9XC96Jk+jbMQbiy5NeJw6kuf9DhTxUKk2hp8GZ1Qusht7GE1VsBoY/LG5vNmYQPdtKeoAipIs/lNYSruFl66TIgXuweKw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1894; 7:oYMINHGjepPqFiRzAv3QuY6YecVsn5bOdl7f/R63QjyWAOlE1PgQAA8jaYM6SUiuEmbNwzJT7icwU1cT+C9xbZA2EcrCOXX1DIiGchz/1H4XwQGCYr8iAF+vbUHUXRZLD6JsV3LPamMnYK2PI47of6rEnLIFiuV6J/RZar2M2eta4t9EzB5sRlG1k/PTLxQ/j8KRup+TWogVu08os+xZBXkG0Q2KfWqzk+UPxfb4lxuuiMD1PaMtWisS/ny/kqMi2rReBQ966Eh7m1XEhiJzuh9u2KyZniEoYIL+hRMZEydUD1Fc26tw0PgraCzjMyksV+zX2GpeSKHy92YUN9scDA== X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2017 06:24:04.4471 (UTC) X-MS-Exchange-CrossTenant-Id: f267a5c8-86d8-4cc9-af71-1fd2c67c8fad X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f267a5c8-86d8-4cc9-af71-1fd2c67c8fad; Ip=[208.19.100.21]; Helo=[avsrvexchhts1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB1894 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver changed the DMA consistent map after consistent memory was allocated, this invalidated the IOMMU identity mapping. The fix was to make sure that we set the DMA consistent mask setting once depending on the controller card. Signed-off-by: Raghava Aditya Renukunta Reviewed-by: Dave Carroll --- Changes in V2: None drivers/scsi/aacraid/aachba.c | 17 ++++++----------- drivers/scsi/aacraid/commsup.c | 29 ++++++++++++++++++----------- drivers/scsi/aacraid/linit.c | 32 +++++++++++++++++++------------- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 43d8838..707ee2f 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -2071,20 +2071,15 @@ int aac_get_adapter_info(struct aac_dev* dev) expose_physicals = 0; } - if(dev->dac_support != 0) { - if (!pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(64)) && - !pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(64))) { + if (dev->dac_support) { + if (!pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(64))) { if (!dev->in_reset) - printk(KERN_INFO"%s%d: 64 Bit DAC enabled\n", - dev->name, dev->id); - } else if (!pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(32)) && - !pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(32))) { - printk(KERN_INFO"%s%d: DMA mask set failed, 64 Bit DAC disabled\n", - dev->name, dev->id); + dev_info(&dev->pdev->dev, "64 Bit DAC enabled\n"); + } else if (!pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(32))) { + dev_info(&dev->pdev->dev, "DMA mask set failed, 64 Bit DAC disabled\n"); dev->dac_support = 0; } else { - printk(KERN_WARNING"%s%d: No suitable DMA available.\n", - dev->name, dev->id); + dev_info(&dev->pdev->dev, "No suitable DMA available\n"); rcode = -ENOMEM; } } diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index d08920d..47068b2 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -1513,6 +1513,7 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type) struct scsi_cmnd *command_list; int jafo = 0; int bled; + u64 dmamask; /* * Assumptions: @@ -1580,21 +1581,27 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type) aac_free_irq(aac); kfree(aac->fsa_dev); aac->fsa_dev = NULL; + + dmamask = DMA_BIT_MASK(32); quirks = aac_get_driver_ident(index)->quirks; - if (quirks & AAC_QUIRK_31BIT) { - if (((retval = pci_set_dma_mask(aac->pdev, DMA_BIT_MASK(31)))) || - ((retval = pci_set_consistent_dma_mask(aac->pdev, DMA_BIT_MASK(31))))) - goto out; - } else { - if (((retval = pci_set_dma_mask(aac->pdev, DMA_BIT_MASK(32)))) || - ((retval = pci_set_consistent_dma_mask(aac->pdev, DMA_BIT_MASK(32))))) - goto out; + if (quirks & AAC_QUIRK_31BIT) + retval = pci_set_dma_mask(aac->pdev, dmamask); + else if (!(quirks & AAC_QUIRK_SRC)) + retval = pci_set_dma_mask(aac->pdev, dmamask); + else + retval = pci_set_consistent_dma_mask(aac->pdev, dmamask); + + if (quirks & AAC_QUIRK_31BIT && !retval) { + dmamask = DMA_BIT_MASK(31); + retval = pci_set_consistent_dma_mask(aac->pdev, dmamask); } + + if (retval) + goto out; + if ((retval = (*(aac_get_driver_ident(index)->init))(aac))) goto out; - if (quirks & AAC_QUIRK_31BIT) - if ((retval = pci_set_dma_mask(aac->pdev, DMA_BIT_MASK(32)))) - goto out; + if (jafo) { aac->thread = kthread_run(aac_command_thread, aac, "%s", aac->name); diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 372a075..5a201da 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -1403,6 +1403,7 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) int error = -ENODEV; int unique_id = 0; u64 dmamask; + int mask_bits = 0; extern int aac_sync_mode; /* @@ -1426,18 +1427,32 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) goto out; error = -ENODEV; + if (!(aac_drivers[index].quirks & AAC_QUIRK_SRC)) { + error = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); + if (error) { + dev_err(&pdev->dev, "PCI 32 BIT dma mask set failed"); + goto out_disable_pdev; + } + } + /* * If the quirk31 bit is set, the adapter needs adapter * to driver communication memory to be allocated below 2gig */ - if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) + if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) { dmamask = DMA_BIT_MASK(31); - else + mask_bits = 31; + } else { dmamask = DMA_BIT_MASK(32); + mask_bits = 32; + } - if (pci_set_dma_mask(pdev, dmamask) || - pci_set_consistent_dma_mask(pdev, dmamask)) + error = pci_set_consistent_dma_mask(pdev, dmamask); + if (error) { + dev_err(&pdev->dev, "PCI %d B consistent dma mask set failed\n" + , mask_bits); goto out_disable_pdev; + } pci_set_master(pdev); @@ -1501,15 +1516,6 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) goto out_deinit; } - /* - * If we had set a smaller DMA mask earlier, set it to 4gig - * now since the adapter can dma data to at least a 4gig - * address space. - */ - if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) - if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) - goto out_deinit; - aac->maximum_num_channels = aac_drivers[index].channels; error = aac_get_adapter_info(aac); if (error < 0)