Received: by 10.213.65.68 with SMTP id h4csp1630711imn; Mon, 19 Mar 2018 09:10:57 -0700 (PDT) X-Google-Smtp-Source: AG47ELs/+GxS/k5Jr7drHzWjtiLJvRXbcj/8yuVt0iRnvoCGsuhz7WwreCiIX7D3ohHIEzbiibfy X-Received: by 10.98.135.76 with SMTP id i73mr10690494pfe.140.1521475857735; Mon, 19 Mar 2018 09:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521475857; cv=none; d=google.com; s=arc-20160816; b=UIyRk/RIBt/Wg58TPbf2JDv2nwxg4Jt+jzFCLbHPhgHVSBUNmxqnENbNK0tc+4f+qC c49VcNyRsmTISUXuBmnXFZXf3M+B+Pa0yPEyCSnqzFAdyzh03fmxU7sB7YtKSTW2iysH 3U4Nwm9JeqER098UAgKRX7NXN1uJTC6BcAZQqaAu0ZuFgQMPIHmXEm7KLh17FMBkaRaH NldEeBwL+2t1GWgWF6hBSKnDntL/ivk5F85Kc4+3HEN8EzSZLLWSKOjA9WU8R+0d+Tn1 OTg+Jv4TMO2M9kzJ5OVXAJhUOYhry01OQaVhphRV+Eu6rcAbE9fQm4LwN+mTyyf5FTpp IjtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=/3I5wlgS7YHHZmJUR96BjRrOag5Za9wTm+EQh9a2d4E=; b=gCpYesB2ZpwGWOM/j2r+Jqt3ZaUFLwk+MVmGCjVbCgJAY8PaOOscy+K74zHAdP1udq tNspP0+mXcdFkYJaZ/jhYLj5mT21rC1/ldgvx6lQf1ffMuWdydYgWwbOBwzrJ8mvs5qa 8RewBmzw1sJmIAiy+gxB9aBVni1GU0gIelX9PPCxdVYVxhqNuCLACPsBvZ9+AVnv/RPq LefZ7vU3u6tmNLHiTqtVI1vcLQm+UwL22f49daHEApHuNFVZyPQR1r2duXkh21aAxeQX 8JhfctMqfavxpDrgsX49qMKNhcfsfINtx4TqqLOpPnlzeoL1BDm7tNwk1lyDO/w71O6H oHbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=bfdov9H5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 102-v6si240955pla.230.2018.03.19.09.10.43; Mon, 19 Mar 2018 09:10:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=bfdov9H5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966260AbeCSQID (ORCPT + 99 others); Mon, 19 Mar 2018 12:08:03 -0400 Received: from mail-by2nam03on0137.outbound.protection.outlook.com ([104.47.42.137]:54368 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966200AbeCSQHn (ORCPT ); Mon, 19 Mar 2018 12:07:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/3I5wlgS7YHHZmJUR96BjRrOag5Za9wTm+EQh9a2d4E=; b=bfdov9H5TIly3N3RTA6BznZtF/ci6vURwHgRyMkiS9gIASHcALaLCzAgRvCRscjQqgIWpCC+2QKNTLiIs8gAtKkuB3hKP57S7/9C6RL4R/k4zLRuBiuISXij2A+Ho+a+yToDxPOAWWeeDbAJvtpfAdD2vUJo11iEeuSTmsHnyMo= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0920.namprd21.prod.outlook.com (52.132.132.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 16:07:37 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 16:07:37 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Anup Patel , Vinod Koul , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 038/167] async_tx: Fix DMA_PREP_FENCE usage in do_async_gen_syndrome() Thread-Topic: [PATCH AUTOSEL for 4.4 038/167] async_tx: Fix DMA_PREP_FENCE usage in do_async_gen_syndrome() Thread-Index: AQHTv5wxhsNkOYr2J0GBTz4lRIqkyg== Date: Mon, 19 Mar 2018 16:06:08 +0000 Message-ID: <20180319160513.16384-38-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0920;7:xT3cwgHl0rKYBzcBYbifdhKuDunSMAuT9w203kQre0vQrqURAnVymO+E4PTmchXDCVN+2IkU+MsS+eziwuQMDOtxZ2aFqYHK9fArOZ+SIb9w5kQ3QqqCsLasxua5vcJOot3Vsj5jFr7uZ1cXz4p6arS4pcUZrkIIGhbw/X7G1Dp6ZZqnoJMB+dN7kKi9Qei2AEKQC5BWtTyhSBNhmrTC/SX4W1NqK6bKr9kkN+CabP3yWas91byc8dKKB6sC6L1q;20:AuJeiLOPSt9mvinWe6MObH2o2R0ldHA1fvpMUAaJxjU1GBRGQQK5Rx7pSXhb2puf3JkQjGbzl3iWg19o2p/mLIxSKq1DQouhKiiP7KjfsFEAgeelIc/01uYFqI7a7ZudHg+N96D0/J4hKf8gUbrUWfk44ifwCN7Qaxo6QMte2Bg= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 30c5492f-b217-4904-2a89-08d58db388f7 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0920; x-ms-traffictypediagnostic: DM5PR2101MB0920: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0920;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0920; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39380400002)(396003)(376002)(39860400002)(366004)(189003)(199004)(6512007)(14454004)(2906002)(2900100001)(8936002)(186003)(86362001)(5250100002)(316002)(97736004)(2501003)(6116002)(1076002)(3846002)(81166006)(6436002)(6506007)(6486002)(26005)(72206003)(81156014)(53936002)(102836004)(478600001)(10290500003)(8676002)(575784001)(107886003)(6666003)(4326008)(3660700001)(66066001)(25786009)(2950100002)(86612001)(36756003)(54906003)(110136005)(3280700002)(7736002)(305945005)(5660300001)(76176011)(68736007)(22452003)(10090500001)(105586002)(106356001)(99286004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0920;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: zmmBbgHM9XtYi4yhQElU6XfYExe2rqrGDQgTUsvc9qSCRYHnA9GAKlaJwMr/izq55HOrMdAD9NNE1T2lnEAquOX1o2f2EpGArhANYmP7JsTeXAWWWZcr0r/MvgW9lZaSPSBtMp0StJI0pMd1SxYxpkEJYGZLok8g8ySxdFGVov/kIDi2fSOZwQLO8iKR0r61i4STqlz+DJ83uESJDP8AunH9t9ooYua70NRsTApwDRf3ia5PkF7csVYrnXMUtjxtkpkpF5fmjKW7DRTI3y5fqtG1agylbvDdfyeLG1405dfpyWAoD2OOcnOlD5SA3XrF2V8wERWwb2kjdQTMfyjMxA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30c5492f-b217-4904-2a89-08d58db388f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:06:09.0025 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0920 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anup Patel [ Upstream commit baae03a0e2497f49704628fd0aaf993cf98e1b99 ] The DMA_PREP_FENCE is to be used when preparing Tx descriptor if output of Tx descriptor is to be used by next/dependent Tx descriptor. The DMA_PREP_FENSE will not be set correctly in do_async_gen_syndrome() when calling dma->device_prep_dma_pq() under following conditions: 1. ASYNC_TX_FENCE not set in submit->flags 2. DMA_PREP_FENCE not set in dma_flags 3. src_cnt (=3D (disks - 2)) is greater than dma_maxpq(dma, dma_flags) This patch fixes DMA_PREP_FENCE usage in do_async_gen_syndrome() taking inspiration from do_async_xor() implementation. Signed-off-by: Anup Patel Reviewed-by: Ray Jui Reviewed-by: Scott Branden Acked-by: Dan Williams Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- crypto/async_tx/async_pq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crypto/async_tx/async_pq.c b/crypto/async_tx/async_pq.c index 84f8d4d8b6bc..09f706b7b06e 100644 --- a/crypto/async_tx/async_pq.c +++ b/crypto/async_tx/async_pq.c @@ -62,9 +62,6 @@ do_async_gen_syndrome(struct dma_chan *chan, dma_addr_t dma_dest[2]; int src_off =3D 0; =20 - if (submit->flags & ASYNC_TX_FENCE) - dma_flags |=3D DMA_PREP_FENCE; - while (src_cnt > 0) { submit->flags =3D flags_orig; pq_src_cnt =3D min(src_cnt, dma_maxpq(dma, dma_flags)); @@ -83,6 +80,8 @@ do_async_gen_syndrome(struct dma_chan *chan, if (cb_fn_orig) dma_flags |=3D DMA_PREP_INTERRUPT; } + if (submit->flags & ASYNC_TX_FENCE) + dma_flags |=3D DMA_PREP_FENCE; =20 /* Drivers force forward progress in case they can not provide * a descriptor --=20 2.14.1