Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1344763imu; Sat, 26 Jan 2019 00:30:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN4JfLKcGbb4EhU6xu+wL213zNfZuKdCFzHb3iHyvwUYLrGf8GeGxuuJ/UaEfkx0Xu7phz/5 X-Received: by 2002:a63:f65:: with SMTP id 37mr12749576pgp.238.1548491440700; Sat, 26 Jan 2019 00:30:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548491440; cv=none; d=google.com; s=arc-20160816; b=B78zikVKoH2NCho2D134rdm+eDwow1rflWvCuLzTbhxYxAszj7YQqoMlZO4P54e0J3 5Jlux/ucNXb04u9rmO55xBI/2S20/tFbUztXwplJKzDNyPfvLBJ+MkeHoWlkeB3QX+uO 2qvdldcREsCxQybyLhS4HEGw0DeNFSFDUJpnAcZEC/2ODF8gYxQQ8NPBKCZyzRqacHoj jOGNLXAd3pdjiWWIPKWxnmHOq0Jbua4HwdLZ7ySbbGEKaR7iYokPsRnmibwDbgZ3Tpzp OseSrKoZqtlYdGtwpBZSHuDkoujP0T2pTdb8slCZHHkP8lqGhq76mtqsOreQq9LW3vka uMKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=hS5jxfTINQ7dRCjzwEfSI2x11RuM1PafPyGN8JxqSxQ=; b=bScZKqIaUGD7/R203faGj2MVBzaw69F3QM88mUtQKrHF94Hc4R6fQnXA4QvQMUb7z0 CDx5747VL0F+nyx2vhvJThf76E6ud7nKZ1cBCKRznACEyhhi0UHKqnJWVAP1ZcOLfKrK sEaPlG8z4d7u9A8rWL4wtqDvn83kRJZ5YBOhObLTPFbfD5nE8Z27LUsiQAhuZmYJX3aY HPyB3ZRKEvw32TCAkoV2LrsYoNIkaGU2oRBGz74jY+BT8SB/mOl4DJZTVhTy8eRML8ly MzN59/3S+CGcxWqOOjgY4QsWFNRDDBP/ZLG90q+qnAqsJgMdB4MFrGK+v5tjUwZs2OJr CGvA== ARC-Authentication-Results: i=1; mx.google.com; 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 f24si28069902pgj.315.2019.01.26.00.30.25; Sat, 26 Jan 2019 00:30:40 -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; 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 S1726326AbfAZIaV (ORCPT + 99 others); Sat, 26 Jan 2019 03:30:21 -0500 Received: from mail.qboosh.pl ([217.73.31.61]:58575 "EHLO mail.qboosh.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726122AbfAZIaV (ORCPT ); Sat, 26 Jan 2019 03:30:21 -0500 X-Greylist: delayed 417 seconds by postgrey-1.27 at vger.kernel.org; Sat, 26 Jan 2019 03:30:20 EST Received: by mail.qboosh.pl (Postfix, from userid 1000) id 040B21A26DA9; Sat, 26 Jan 2019 09:23:22 +0100 (CET) Date: Sat, 26 Jan 2019 09:23:22 +0100 From: Jakub Bogusz To: Dmitry Torokhov Cc: Eric Wong , lkml , Miloslav Trmac , "linux-input@vger.kernel.org" Subject: Re: [PATCH][RESEND] wistron_btns needs executable BIOS image Message-ID: <20190126082321.GA6792@mail> References: <20170731182010.GA933@stranger.qboosh.pl> <20190125191437.GA25902@stranger.qboosh.pl> <20190125211349.nfbbcuaip5y6l5dr@dcvr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 25, 2019 at 01:41:47PM -0800, Dmitry Torokhov wrote: > On Fri, Jan 25, 2019 at 1:13 PM Eric Wong wrote: > > > > Jakub Bogusz wrote: > > > Let's try once again... (take 3) > > > > > > First time I sent this patch when I prepared it in 2013 for Linux 3.12, > > > the second time after update for Linux 4.12 in 2017... > > > And it still applies to Linux 4.20. > > > > Adding Dmitry Torokhov and linux-input to Cc: > > (that's what ./scripts/get_maintainer.pl says) Thanks. I was aware only of MAINTAINERS file. [...] > > > wistron_btns needs executable BIOS image. > > > > > > Signed-off-by: Jakub Bogusz > > > > > > --- linux-4.12/drivers/input/misc/wistron_btns.c.orig 2013-11-16 09:05:55.612742472 +0100 > > > +++ linux-4.12/drivers/input/misc/wistron_btns.c 2013-11-16 09:24:37.356028732 +0100 > > > @@ -33,6 +33,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > > > > /* How often we poll keys - msecs */ > > > #define POLL_INTERVAL_DEFAULT 500 /* when idle */ > > > @@ -124,6 +125,7 @@ > > > if (entry_point >= 0xF0000) { > > > bios_code_map_base = base; > > > bios_entry_point = bios_code_map_base + (entry_point & 0xFFFF); > > > + set_memory_x((unsigned long)bios_code_map_base, 0x10000 >> PAGE_SHIFT); > > > } else { > > > iounmap(base); > > > bios_code_map_base = ioremap(entry_point & ~0x3FFF, 0x4000); > > > @@ -134,6 +136,7 @@ > > > goto err; > > > } > > > bios_entry_point = bios_code_map_base + (entry_point & 0x3FFF); > > > + set_memory_x((unsigned long)bios_code_map_base, 0x4000 >> PAGE_SHIFT); > > > } > > > /* The Windows driver maps 0x10000 bytes, we keep only one page... */ > > > bios_data_map_base = ioremap(0x400, 0xc00); > > It is really weird have __iomem region to have executable bit set. I > wonder if, along with the setting memory to X, we should not change > that ioremap() to memremap()? Maybe... this is area of BIOS ROM, not I/O. But I'm not sure about cacheability. Looking at recent kernel code (4.19 to be exact) ioremap ends in __ioremap_caller with _PAGE_CACHE_MODE_UC_MINUS, while memremap would end in __ioremap_caller with e.g. (depending on flags) _PAGE_CACHE_MODE_WT. Unfortunately now I have rare access to this hardware (FS Amilo) to test. -- Jakub Bogusz http://qboosh.pl/