From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53E25C7619A for ; Wed, 5 Apr 2023 15:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:Cc:To:From:Date:References: In-Reply-To:Message-Id:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MkzGq+OQcubfDdsBlLKUlzaZy2AK8nb4BsOJ5J1jERM=; b=D74Gx/Ke/gED40 qI4iu0n+rWrbBUhp88hrXWr6u++YksDOQdvydeoNCReIrNutrlThmozXsZhwjNB3PocVdFMz4PKmr TdzPiXZSNqWMZ6ZxlyPXHaEzcwQxysJe47zyV91evX8IJ30mZK4up9ddWUlhEjOrswVFe1eRudukh DybwOBj5lLk7RLnR2SgoopvNdkUBXI6uqW/ZQb2DrSInfBlkCju4Oef6Nhmlpii1RM9Sl/NQhpl9x zPWtIMTy/Sa16RrP1/hdnPfvivyTezSQDbFFLrpxyPAP1BbauM+/6PsvuK/qpxANphSCjj6y+jhHx fJ6dl/B3tuCIQFbBTbkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pk5S7-00528P-2L; Wed, 05 Apr 2023 15:53:39 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pk5S0-00525f-0q; Wed, 05 Apr 2023 15:53:37 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 958B632007CF; Wed, 5 Apr 2023 11:53:25 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Wed, 05 Apr 2023 11:53:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1680710005; x=1680796405; bh=Nw bB+EHW5S+V11givdbxuIy2Uf+thntoCfTqZWxMcBg=; b=YAuUXEBHlJ+kw9Zmtu 9I5T+IGhxkBqddi19dn4r+kNWXx/0s7MbpimtmFPL+aPlqdAyBvCvEsdsYUd5tTf dBua9XG68Yl0nAEEaOyNWPgbGp6alKd9HHDJSvPFHUNlT8zuWj1g9huygqraxlWC Y+7aQ0Y5o6JpEn9vn6pvB592FVfSJZTE0wQ53CHjaAn3N3A83rdRSbIzi5UNwgov IcI7SaTPzh0bHkde+aJv1IK0dSQpj45he+L1xtfkD90bXKLSnl9xy0H9KtD29GkI 2+G9FZEVKV8Ap9yXYVustJlay4HAIUJFWpO3k3GqLJgcjagxLjHlqMCd0ESl4Zi8 VyAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1680710005; x=1680796405; bh=NwbB+EHW5S+V1 1givdbxuIy2Uf+thntoCfTqZWxMcBg=; b=X0YUdqlMVBOCdYHJ8fMsj7rw5LYNz ZGJ0nWIBBIL3CKMDRVVw2YGPAAiFOVnx7L1394T+EXUfeUzEKvYMxNmF0dJpg65D qT9JFnQfBWcM5VGeF55Js0uJ5ogNkDIdRPUREUIHT1EtxI8FePekTl0V4NAuAe5Y qNymd5gN9jUrHF8b/D8IDIAoOBs1X79EO2v/otVPN+ytEPy8eYxvMw6YOZAONkMt 5RApka5ld90qALBZBcg+sniYxlayLf3ViaDFB298sG58vLKWLb118o2FnrdR0eT0 dNfDQuIkc53XS6ntd6jHdr0SIi5xBB7v6AC/Ua1W+XfuOjYh6m52RqtGw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejuddgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C4968B60098; Wed, 5 Apr 2023 11:53:24 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-334-g8c072af647-fm-20230330.001-g8c072af6 Mime-Version: 1.0 Message-Id: <92fe3838-41f0-4e27-8467-161553ff724f@app.fastmail.com> In-Reply-To: <20230405150554.30540-2-tzimmermann@suse.de> References: <20230405150554.30540-1-tzimmermann@suse.de> <20230405150554.30540-2-tzimmermann@suse.de> Date: Wed, 05 Apr 2023 17:53:03 +0200 From: "Arnd Bergmann" To: "Thomas Zimmermann" , "Daniel Vetter" , "Helge Deller" , "Javier Martinez Canillas" , "Greg Kroah-Hartman" Cc: Linux-Arch , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 01/18] fbdev: Prepare generic architecture helpers X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230405_085332_615678_682756D0 X-CRM114-Status: GOOD ( 16.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 5, 2023, at 17:05, Thomas Zimmermann wrote: > Generic implementations of fb_pgprotect() and fb_is_primary_device() > have been in the source code for a long time. Prepare the header file > to make use of them. > > Improve the code by using an inline function for fb_pgprotect() and > by removing include statements. > > Symbols are protected by preprocessor guards. Architectures that > provide a symbol need to define a preprocessor token of the same > name and value. Otherwise the header file will provide a generic > implementation. This pattern has been taken from . > > Signed-off-by: Thomas Zimmermann Moving this into generic code is good, but I'm not sure about the default for fb_pgprotect(): > + > +#ifndef fb_pgprotect > +#define fb_pgprotect fb_pgprotect > +static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, > + unsigned long off) > +{ } > +#endif I think most architectures will want the version we have on arc, arm, arm64, loongarch, and sh already: static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, unsigned long off) { vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); } so I'd suggest making that version the default, and treating the empty ones (m68knommu, sparc32) as architecture specific workarounds. I see that sparc64 and parisc use pgprot_uncached here, but as they don't define a custom pgprot_writecombine, this ends up being the same, and they can use the above definition as well. mips defines pgprot_writecombine but uses pgprot_noncached in fb_pgprotect(), which is probably a mistake and should have been updated as part of commit 4b050ba7a66c ("MIPS: pgtable.h: Implement the pgprot_writecombine function for MIPS"). Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel