From patchwork Fri Nov 27 16:41:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11936669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7638AC3E8C5 for ; Fri, 27 Nov 2020 16:45:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1484520657 for ; Fri, 27 Nov 2020 16:45:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Vzi0hWDy"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="a1TFJ5oy"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="U7CnpbD0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1484520657 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5RmIzhKPiGgawKeS5z83d5pRaz/Z8ozTcb/LUDFT4dg=; b=Vzi0hWDySL8epeDCuOwjZZgmh aojmzQXMLhKxh/gxv48pLQeWEBSrRdxqg5Movoo5Pfgt05nE+Co3oajXQIaUzcCf5W3uPDX40vIdn iiqxcriXgv4PGxHe1JZzSqIs/syF6OIfo/8vPsjTLzVCW29m9fxYyCvRdg8i8QDHuEBDLpx3DPPOK pE8Aa7jfwpIPxTaDEf8uLCru1kANmqbOVosHptRf+zMmVRRpvQHP7c8lwJrPEvZMhGd74DvWY+qnK HvTq5TTao98PRqjkw6EYN4VrE48FD+Zwk8FzqTBKN2EoHhQ0dhrhZ6RE1QX+gm00UN0eAoQDVb2Kf rvIfMqnWQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kigqB-0008IJ-Hx; Fri, 27 Nov 2020 16:43:23 +0000 Received: from casper.infradead.org ([90.155.50.34]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kigp4-0007sA-TJ for linux-arm-kernel@merlin.infradead.org; Fri, 27 Nov 2020 16:42:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=lUo9ncFU/nKq3MG4mWQrX8BX1Csq/yukMRd1xs72MQA=; b=a1TFJ5oym1UJKJ21Td/61uzoM7 ni04jqMolUPCwMifbacmcN3QCn55in/szMxVtx/nOaVCJmcVL4nC7fXzxVrbbd6GRYnbOTaj8js5u 58T0RmCIaMRhlogjBUqOCtqmn2mJY7YQsBefx0JJ6h+41C2ysG9mO0N6paiidcJGqsjmURv0CODEO HFThT4MoiaA54f67kNO9gfjOoZhsIH6xe3fiRSbBafbIU6wukTxpVJw0y5C+aauqJ1skcc4lLlOuG 2+hUyh4Gp0NYv7giIP6lfFVg2ctzDBZbh3Me1HouVOcPN1+M2Z5XjUtQZdYBeIOhUBcpQ7RX64q+J wWuGIp+A==; Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kigp0-00030j-La for linux-arm-kernel@lists.infradead.org; Fri, 27 Nov 2020 16:42:13 +0000 Received: by mail-wm1-x344.google.com with SMTP id 3so3344721wmg.4 for ; Fri, 27 Nov 2020 08:42:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lUo9ncFU/nKq3MG4mWQrX8BX1Csq/yukMRd1xs72MQA=; b=U7CnpbD00qEoN/vUsVW+I4243+W/JnXoGNjkeopzZQU5so09mhertht0Ptz/Y9CU97 QBJjqG6J8HVGWhflVJAnSEhJA51fquUA/rLUSiFGQ3D16s3hdHYPSCDYykR5ivgrpzt5 UNuqMwTHX4nMkYA9iGIVY8KW3+QGNck+OCdBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lUo9ncFU/nKq3MG4mWQrX8BX1Csq/yukMRd1xs72MQA=; b=bW2CxoDAwl8GzkEqncypqbdmJUHTcOhOG2SPW5AeewAcyIu6ln9ilGipaIVV0aM4ay Nw5AK1p3xPownH5mHVh1FW/xdRWYsdmT64k51vH8GPT+X6LBs92ngjN2lLMeniMu8G0u vzck/ZiaKJ9nUoLBNmlgxMAxoPDD2OjtvkcDxOSXncI6WBI9TWuuKiSr4wqjyHynoK7D MOvVR0xEq+VT8n6iizpX35jl8vuIM7msltDBmqe23nD1mzAobB+qqhL7v5UCqUNBWdNq 0XjwrJJJdMhmRv+ATbgHo8KJlDap87ufs27/jCoQmlK/vpsgc7oUbW65D6E69lBV8EZG /gcA== X-Gm-Message-State: AOAM532DRFBKtoYmpjm9tym0K37K76zbvj9ezaZTBZGUQb4YmuVKbqVn 9GVZEop8OO43nB0vzupnnyw4OQ== X-Google-Smtp-Source: ABdhPJxKU2LEPA3ycZu0g6uNTdSP1FwFa6HvSU/jo43OGE9w8xBQTe6/Vk/r7mX9FCsKkcy0le5iyg== X-Received: by 2002:a7b:cbd1:: with SMTP id n17mr9963982wmi.186.1606495329592; Fri, 27 Nov 2020 08:42:09 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q12sm14859078wrx.86.2020.11.27.08.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 08:42:08 -0800 (PST) From: Daniel Vetter To: DRI Development , LKML Subject: [PATCH v7 09/17] /dev/mem: Only set filp->f_mapping Date: Fri, 27 Nov 2020 17:41:23 +0100 Message-Id: <20201127164131.2244124-10-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201127164131.2244124-1-daniel.vetter@ffwll.ch> References: <20201127164131.2244124-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201127_164210_865680_35B2265D X-CRM114-Status: GOOD ( 15.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Jan Kara , Kees Cook , kvm@vger.kernel.org, Jason Gunthorpe , Daniel Vetter , linux-mm@kvack.org, =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , John Hubbard , Daniel Vetter , Dan Williams , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When we care about pagecache maintenance, we need to make sure that both f_mapping and i_mapping point at the right mapping. But for iomem mappings we only care about the virtual/pte side of things, so f_mapping is enough. Also setting inode->i_mapping was confusing me as a driver maintainer, since in e.g. drivers/gpu we don't do that. Per Dan this seems to be copypasta from places which do care about pagecache consistency, but not needed. Hence remove it for slightly less confusion. Signed-off-by: Daniel Vetter Cc: Jason Gunthorpe Cc: Kees Cook Cc: Dan Williams Cc: Andrew Morton Cc: John Hubbard Cc: Jérôme Glisse Cc: Jan Kara Cc: Dan Williams Cc: linux-mm@kvack.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-media@vger.kernel.org Reviewed-by: Dan Williams Signed-off-by: Daniel Vetter --- drivers/char/mem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 94c2b556cf97..7dcf9e4ea79d 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -891,7 +891,6 @@ static int open_port(struct inode *inode, struct file *filp) * revocations when drivers want to take over a /dev/mem mapped * range. */ - inode->i_mapping = devmem_inode->i_mapping; filp->f_mapping = inode->i_mapping; return 0;