Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp886362imu; Mon, 5 Nov 2018 10:13:04 -0800 (PST) X-Google-Smtp-Source: AJdET5cn+luSekWeXKIaZyI23QLTihOdsFdf3VDDhUze5e8Tno6SBvUq2SS3WIMZT+CXQ4TUpth9 X-Received: by 2002:a65:6447:: with SMTP id s7mr20824014pgv.226.1541441584477; Mon, 05 Nov 2018 10:13:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541441584; cv=none; d=google.com; s=arc-20160816; b=mnSFLgm4eaVISfYrLDeewmU77dIJvpvUkd7vkM2hiiyLIr4pWZcGAIDIMBPR1QE435 n0rtKmgOddb4QkodN290QndgAFuIZHA0Vmlwjdp3o99O5KJ6T+V6vspG22EuFp1mFTR+ GE5xjwhc06Jjs9O1Nm+QQq3hGqzSkUTns00baS00TUDfzXdJvsMkyAVKiagHUkYOHcI0 G2vDCDh+3T5Pj1RMK07ObU1eQy/m/YwZmlsSTvxI5jJglhW6dDEu1B9lobBsn6WhQohH oL1KR42LPwsqKce1noRZHXwSqJ8XxpAHVCXlpm8zQPvqKu7wdSlpH3K6WFFKfkaxeCSd gzoQ== 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 :content-id:spamdiagnosticmetadata:spamdiagnosticoutput:user-agent :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=GgOcS7kwe9d2KeTV5hxmW2lXp6viz6U1ZLGzJ1GowMQ=; b=UsutrD6FJnAVYojSWH0l2CUywBLWA5ScmXWfiJDdVWip6eegv1WEC2d/BUnn09JfTI mECmYpv6v8mnIUvV5E+FIsOaU7+7mfjjexTvTh++aQz9DjB7CyyMXOngm5jK5AKiaubF OY426y2hQp30Q0bzlXaQMUsCdkXcD/ScJwtaJSBeMGMFGvxqDxGM8V3I7wcMXiH9LbSq +nAe7sB9H/hfXqu8tv6dDKXpFrsAcOIug0kP1Kn6PuGzOuKbhtrZ8s5VDyaQA0TV+gEc UOnv/sicGLmlcHVI4PKb8zMPPWPPG7H7mo78IWTD441/BVTMSOsW96lQy6GL4eyHCrld pnoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wavesemi.onmicrosoft.com header.s=selector1-wavecomp-com header.b=WCN6917L; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5-v6si42850282pll.320.2018.11.05.10.12.49; Mon, 05 Nov 2018 10:13:04 -0800 (PST) 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=@wavesemi.onmicrosoft.com header.s=selector1-wavecomp-com header.b=WCN6917L; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387840AbeKFDbd (ORCPT + 99 others); Mon, 5 Nov 2018 22:31:33 -0500 Received: from mail-eopbgr820129.outbound.protection.outlook.com ([40.107.82.129]:15744 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387595AbeKFDbd (ORCPT ); Mon, 5 Nov 2018 22:31:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavesemi.onmicrosoft.com; s=selector1-wavecomp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GgOcS7kwe9d2KeTV5hxmW2lXp6viz6U1ZLGzJ1GowMQ=; b=WCN6917LXXkz9hfGM42b72wK95g/UXvfahIQGGpJTrYXA4woFipvbyNRKSBX+aASKHUInT1TNCyBL31R2Dt8ElIQN61NbMHL+72NtrKUzg3NU7zcyvSkyN3+5cSuP3uM6QhhjEvoJcJsER0ovGnvapuyi23SG/SfuZxKhZazra0= Received: from MWHSPR00MB117.namprd22.prod.outlook.com (10.175.52.23) by MWHPR2201MB1279.namprd22.prod.outlook.com (10.174.162.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.27; Mon, 5 Nov 2018 18:10:39 +0000 Received: from MWHSPR00MB117.namprd22.prod.outlook.com ([fe80::b95a:a3f9:be06:b045]) by MWHSPR00MB117.namprd22.prod.outlook.com ([fe80::b95a:a3f9:be06:b045%2]) with mapi id 15.20.1294.032; Mon, 5 Nov 2018 18:10:39 +0000 From: Paul Burton To: "Maciej W. Rozycki" CC: Christoph Hellwig , "iommu@lists.linux-foundation.org" , Marek Szyprowski , Robin Murphy , Greg Kroah-Hartman , "linux-mips@linux-mips.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: [PATCH] MIPS: Fix `dma_alloc_coherent' returning a non-coherent allocation Thread-Topic: [PATCH] MIPS: Fix `dma_alloc_coherent' returning a non-coherent allocation Thread-Index: AQHUcbhcbz7B9XfQTUuMxTjjhGHjqqVBgkOA Date: Mon, 5 Nov 2018 18:10:38 +0000 Message-ID: <20181105181037.m2hxoosf7z2bz7lu@pburton-laptop> References: <20180914095808.22202-1-hch@lst.de> <20180914095808.22202-5-hch@lst.de> <20181031203206.GA28337@lst.de> <20181101051359.GA4164@lst.de> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MWHPR10CA0052.namprd10.prod.outlook.com (2603:10b6:300:2c::14) To MWHSPR00MB117.namprd22.prod.outlook.com (2603:10b6:300:10c::23) user-agent: NeoMutt/20180716 authentication-results: spf=none (sender IP is ) smtp.mailfrom=pburton@wavecomp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [4.16.204.77] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR2201MB1279;6:GaGw/kGKHhFqC4J69XoppFOBcvLGhbuK/uNrwPcRTxwtVBKPpTLPcdUUgLZpthaUVb7/YTJ8rC41yJDCOm0Ip1/f+VPXn+EcTssfKXnR46XZp07CRjTrVO/nFcP3wPwhYyYnTmcdv3foXe4INSwFRYoDJEymkmg/SwJGEoIFhQEPkM2GGsTM99Wrk41ZZj/EYRFBluzBWBbsjgA1iWM8VU+7kq2a5Bf6dEV6CXiTL5ypwqVwyvMGBxlqa+EoopOhoC78vpvkYPeMWe64bowXIvpUW9MimChSG9R+b8ANN13zPAqEhmUito0Ixf7Wbx8HkBrgl9jFc4Ub55QfKAucvIeDR0q4R9A0Lbq8a2axvEvkIGkGe9WzIcJ1CzdiQhLG/QE72SXYWHnyxNNemLqsvadN9TVDgANW28ceYH8DosWIM60xVbK+ALFRryVaaXpe52m3Y7uHb1sxyvydct5YCA==;5:9OMOUYb+r5Hm/JtLBnT7NjSo0tPHVQpVXNfcebq4+UgalOQHHRrk7fQXIZe5kP4/ruu0j9jLCOAAhD17Rak++vlqJ492t3bAYTNJKSs7yPQcjSqm5g14WTsjRvshxs9BGhoslIh6P/PwSyC9SmJLMbXzsUHWhBmp2pibQN77i5w=;7:vsvN5mG4wneVHl2b9gAZ5ZF/HWwtqNDizB3TED5jYin3Ju8/qmg40nmMvNAEgMeHJCtbA7Qa0OSnI3ZHOl4nEZNxcn4rfVJq0eE3O1+hfB/elBfwgfFmz178UFFmadtCGFAehBRhhMcBxl4k+vaPAA== x-ms-office365-filtering-correlation-id: 5e8176f9-16d3-467e-f81b-08d64349fda4 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:MWHPR2201MB1279; x-ms-traffictypediagnostic: MWHPR2201MB1279: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(2016111802025)(6043046)(201708071742011)(7699051)(76991095);SRVR:MWHPR2201MB1279;BCL:0;PCL:0;RULEID:;SRVR:MWHPR2201MB1279; x-forefront-prvs: 08476BC6EF x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(7916004)(136003)(39840400004)(396003)(376002)(366004)(346002)(199004)(189003)(6486002)(106356001)(6436002)(2900100001)(6506007)(14454004)(11346002)(54906003)(316002)(58126008)(6916009)(2906002)(6512007)(6116002)(386003)(3846002)(42882007)(4326008)(9686003)(102836004)(33716001)(71200400001)(81156014)(446003)(8936002)(71190400001)(229853002)(81166006)(508600001)(53936002)(476003)(25786009)(97736004)(6246003)(305945005)(99286004)(76176011)(52116002)(66066001)(105586002)(68736007)(93886005)(33896004)(486006)(26005)(44832011)(1076002)(5660300001)(14444005)(256004)(8676002)(7736002)(186003)(81973001);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR2201MB1279;H:MWHSPR00MB117.namprd22.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: wavecomp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: l4sVFJ+0xkOLwK7fN6x6Yg8KJSW3MXu6s9XlF866DKhUb1QioVzOeo9pJv3iLiLZ0NOSY/PQFZd5JSNqXLUryBLPfgMhYnKIbAI+HdXHBjwJbBrtrDsvOAnN1MVEa4c8kb9CjeLsDS1CfjoN3Y8Ah7P4eza/fTkb76+kqHZYgfndj4BGsmDpYa9cgNUKi7UMNHOWMm1iScg7+wL8mycK5naEygMWa6HP4dfBsHx9QrR9H8kC8UsmDw5cJFVehGUJLFwRpE88gpIbQMYR08P5/LwoUzmXZxz/xZZM1VyU1waWwBrSjNMi+SkWNTpRkq2RIVqbHrLyh7/pX1CD8KmcPCC0DN+PV0TzQGMUKDpKtSM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: mips.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e8176f9-16d3-467e-f81b-08d64349fda4 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2018 18:10:39.0157 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 463607d3-1db3-40a0-8a29-970c56230104 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR2201MB1279 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maciej, On Thu, Nov 01, 2018 at 07:54:24AM +0000, Maciej W. Rozycki wrote: > Fix a MIPS `dma_alloc_coherent' regression from commit bc3ec75de545=20 > ("dma-mapping: merge direct and noncoherent ops") that causes a cached=20 > allocation to be returned on noncoherent cache systems. >=20 > This is due to an inverted check now used in the MIPS implementation of=20 > `arch_dma_alloc' on the result from `dma_direct_alloc_pages' before=20 > doing the cached-to-uncached mapping of the allocation address obtained. = =20 > The mapping has to be done for a non-NULL rather than NULL result,=20 > because a NULL result means the allocation has failed. >=20 > Invert the check for correct operation then. >=20 > Signed-off-by: Maciej W. Rozycki > Fixes: bc3ec75de545 ("dma-mapping: merge direct and noncoherent ops") > Cc: stable@vger.kernel.org # 4.19+ > --- > arch/mips/mm/dma-noncoherent.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks, nice catch! Applied to mips-fixes. Paul