Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6503093imu; Mon, 21 Jan 2019 10:00:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN5EaPLcPbZcrNJUPaPmesCoxR9dLiaBdJL7/AXpeY7xs1JV/BkefDfPTIcmKEnWhXPxVT1/ X-Received: by 2002:a17:902:bd4a:: with SMTP id b10mr31193697plx.232.1548093646646; Mon, 21 Jan 2019 10:00:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548093646; cv=none; d=google.com; s=arc-20160816; b=Ic8JRT2rOthbr2ygCpJGSI8LMY31NDs87fm5qNl2Mi5PZX03sH8gnLgNPnh/t/GIE4 /TIY6fE7DuA+7dEyADOyHlb+4Km5fmp173cfOsybKZQkpnSsCYogAuM6U6ru+Jz7JH6a vLao4qO91tE/NaWLiScZlLv9BNefQ9iOQ8xY90GBZnqS5SbfjD1skeVyIphexN4314TW +WP9yMyLa7CjBBgdYfKLhf3puakVcnylA74ftjz13LvF+J8LKNrQQ9daGwfw8DWUn5GI fYpJVFNlnmf4UuiJN2hJpE/5QzmHHUbArOEtbSo7ojy++G+wG4Qag219UzoyusncPgBn KAdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=GIkKZS9024nvngV6e2KIorYK3XJmAI8zh9FUlk87wCM=; b=LNknPiYsXRVk9ZKBcDYIErv462Itum80Kq86jX82+qZlYR0slLo6PNJ7f7dNVnwUpD odVlr065wavQcDjSychdFripRDpE6kFjWsFqLGwKao4bpmfRgyjGjRJRX9Y7NEFWz1p0 WFp6YD66Kda6SIg8oOvRrf02J0t5EMHoeG/qF+yIHuK2MJwFrgsJJA+TyqVgVW25S7D2 mPUQocmstyB60CdWhIYixRAwnc7HAZcq80HSMt+OD6Q/ywWg2U6vipPIXF1bWOFWaK+B BaN8WYYFFqWRPWWPHIom3kQv/7LJjPTEYP/TE/xN66WOwBGnL9VDW0cVdEvWR7rFB8kv gLtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WMRhZXc0; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si12423694pgv.33.2019.01.21.10.00.27; Mon, 21 Jan 2019 10:00:46 -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=@linaro.org header.s=google header.b=WMRhZXc0; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726738AbfAUR7W (ORCPT + 99 others); Mon, 21 Jan 2019 12:59:22 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:51544 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbfAUR7W (ORCPT ); Mon, 21 Jan 2019 12:59:22 -0500 Received: by mail-it1-f195.google.com with SMTP id w18so17608426ite.1 for ; Mon, 21 Jan 2019 09:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GIkKZS9024nvngV6e2KIorYK3XJmAI8zh9FUlk87wCM=; b=WMRhZXc0UjFFWdsPF5yVyvY4vVSav9F0z0zPtSiW7IOPv9kh5948WERCDs5DGh3hMk lm1Labs/Qzygsebmyx+r5zGHAfVxPKJQv7rPRLbDKlvdtl7Sy/xUwFJF9C6M2ePKqBFn 6aDTC8AZztniu4pmAMtevm9JLMXa+7Aq30OX4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GIkKZS9024nvngV6e2KIorYK3XJmAI8zh9FUlk87wCM=; b=MSx2hRp9/03JJtQyNp29xC0waN5WzAbd0Pix045sXKDH9fk2VjmsMMfkoU0SSh8dX+ k7VDqe713yxv8w9/MX8GrWTD1iNlq/QnOUq1kD2JWMM2H4ISqTxic1EV6KEyue8lpL9q Ye1yNN+1BNCEUcVOd1wwL5TudI9BUh0cMjv1zjMZanZ6meIRKwjxcItwsR3gnrnRHj3+ SzfKnWvkCJV0SYxao/LZwywRRdhYIui9ZMUfLfyqWiMtnCaRvHbFjZbWQK/kPg6Aw5vV SSfhePTAL1vniR09N/AwFiXVnyY/dR6kXSP+IA7uQxgahwhqtl8qtBoKigFPYZrd6+8q oxgg== X-Gm-Message-State: AJcUukdXcxHZ24wG6RoXnjnyzLnVYOUCxKi/oT4zNYlfYbdHvXkH9qpU 3xv3v5YcN+MP3QKJb0Gmn0i6d2k1fVBg8Sytjlf0xw== X-Received: by 2002:a24:710:: with SMTP id f16mr220842itf.121.1548093561061; Mon, 21 Jan 2019 09:59:21 -0800 (PST) MIME-Version: 1.0 References: <20190121100617.2311-1-ard.biesheuvel@linaro.org> <20190121150734.GA30582@infradead.org> <20190121155908.GA8084@infradead.org> <20190121162238.GA17651@infradead.org> <59ccf85d-b99d-b5c8-ea87-66c2a892e197@daenzer.net> In-Reply-To: <59ccf85d-b99d-b5c8-ea87-66c2a892e197@daenzer.net> From: Ard Biesheuvel Date: Mon, 21 Jan 2019 18:59:10 +0100 Message-ID: Subject: Re: [RFC PATCH] drm: disable WC optimization for cache coherent devices on non-x86 To: =?UTF-8?Q?Michel_D=C3=A4nzer?= Cc: Christoph Hellwig , Will Deacon , David Zhou , Maxime Ripard , Benjamin Herrenschmidt , David Airlie , Maarten Lankhorst , Michel Daenzer , Linux Kernel Mailing List , amd-gfx@lists.freedesktop.org, Junwei Zhang , Huang Rui , dri-devel , Daniel Vetter , Michael Ellerman , Alex Deucher , Sean Paul , Christian Koenig , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Jan 2019 at 18:55, Michel D=C3=A4nzer wrote= : > > On 2019-01-21 5:30 p.m., Ard Biesheuvel wrote: > > On Mon, 21 Jan 2019 at 17:22, Christoph Hellwig wro= te: > > > >> Until that happens we should just change the driver ifdefs to default > >> the hacks to off and only enable them on setups where we 100% > >> positively know that they actually work. And document that fact > >> in big fat comments. > > > > Well, as I mentioned in my commit log as well, if we default to off > > unless CONFIG_X86, we may break working setups on MIPS and Power where > > the device is in fact non-cache coherent, and relies on this > > 'optimization' to get things working. > > FWIW, the amdgpu driver doesn't rely on non-snooped transfers for > correct basic operation (the scenario Christian brought up is a very > specialized use-case), so that shouldn't be an issue. > The point is that this is only true for x86. On other architectures, the use of non-cached mappings on the CPU side means that you /do/ rely on non-snooped transfers, since if those transfers turn out not to snoop inadvertently, the accesses are incoherent with the CPU's view of memory.