* [RESEND PATCH v2 0/2] x86/mm/pat: modify nopat requirement warning
@ 2015-07-17 21:07 Luis R. Rodriguez
2015-07-17 21:07 ` [RESEND PATCH v2 1/2] x86/mm/pat, drivers/infiniband/ipath: replace WARN() with pr_warn() Luis R. Rodriguez
2015-07-17 21:07 ` [RESEND PATCH v2 2/2] x86/mm/pat, drivers/media/ivtv: move pat warn and " Luis R. Rodriguez
0 siblings, 2 replies; 4+ messages in thread
From: Luis R. Rodriguez @ 2015-07-17 21:07 UTC (permalink / raw)
To: mingo
Cc: bp, andy, mchehab, dledford, dan.j.williams, benh, luto,
julia.lawall, jkosina, linux-media, linux-rdma, linux-kernel,
Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof@suse.com>
Ingo,
Boris is on vacation so sending this through you. This is just a resend of
the v2 series. The issue here was the WARN() splat on built-in kernels due
to ivtv's funky probe which will trigger even if you don't have any ivtv
hardware. I've moved this to only trigger upon a device detection.
We also spoke about not doing any of this and and letting it silently fail
for these drivers but since this is only for two drivers and the ipath diver
will be removed only the ivtv driver would be left with this work around. I'd
like to enforce the semantics for usage of arch_phys_wc_add() with ioremap_wc()
and making an exception just for ivtv does not seem worth the gains of having
strong semantics. After all the ioremap_wc() + arch_phys_wc_add() are in I'll
then try to add an SmPL rule check to enforce semantics on the ioremap_wc() +
arch_phys_wc_add() API. Hope is that maintainers can vet new code for its
correct usage in the future with 'make coccicheck M=path' on their subsystems.
For your reference we discussed this and I mentioned my semantics preference
and you were OK with this [0] so just resending this series as it fell through
the cracks as Boris is on vacation now.
Although the WARN() --> pr_warn() change is not techically needed for ipath,
we make both checks consistent and less chatty. Since the ivtv change is
splattering all v4.2 kernels that patch may be worthy for v4.2 inclusion. I
did not peg the Cc: stable tag so leave this up to you to decide.
Please let me know if this is OK or if there are any other oustandind issues.
[0] http://lkml.kernel.org/r/20150707070306.GB9784@gmail.com
Luis R. Rodriguez (2):
x86/mm/pat, drivers/infiniband/ipath: replace WARN() with pr_warn()
x86/mm/pat, drivers/media/ivtv: move pat warn and replace WARN() with
pr_warn()
drivers/infiniband/hw/ipath/ipath_driver.c | 6 ++++--
drivers/media/pci/ivtv/ivtvfb.c | 15 +++++++++------
2 files changed, 13 insertions(+), 8 deletions(-)
--
2.3.2.209.gd67f9d5.dirty
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RESEND PATCH v2 1/2] x86/mm/pat, drivers/infiniband/ipath: replace WARN() with pr_warn()
2015-07-17 21:07 [RESEND PATCH v2 0/2] x86/mm/pat: modify nopat requirement warning Luis R. Rodriguez
@ 2015-07-17 21:07 ` Luis R. Rodriguez
[not found] ` <1437167245-28273-2-git-send-email-mcgrof-3uybbJdB1yH774rrrx3eTA@public.gmane.org>
2015-07-17 21:07 ` [RESEND PATCH v2 2/2] x86/mm/pat, drivers/media/ivtv: move pat warn and " Luis R. Rodriguez
1 sibling, 1 reply; 4+ messages in thread
From: Luis R. Rodriguez @ 2015-07-17 21:07 UTC (permalink / raw)
To: mingo
Cc: bp, andy, mchehab, dledford, dan.j.williams, benh, luto,
julia.lawall, jkosina, linux-media, linux-rdma, linux-kernel,
Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof@suse.com>
WARN() may confuse users, fix that. ipath_init_one() is part the
device's probe so this would only be triggered if a corresponding
device was found.
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
drivers/infiniband/hw/ipath/ipath_driver.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 2d7e503d13cb..871dbe56216a 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -31,6 +31,8 @@
* SOFTWARE.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/idr.h>
@@ -399,8 +401,8 @@ static int ipath_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
u32 bar0 = 0, bar1 = 0;
#ifdef CONFIG_X86_64
- if (WARN(pat_enabled(),
- "ipath needs PAT disabled, boot with nopat kernel parameter\n")) {
+ if (pat_enabled()) {
+ pr_warn("ipath needs PAT disabled, boot with nopat kernel parameter\n");
ret = -ENODEV;
goto bail;
}
--
2.3.2.209.gd67f9d5.dirty
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RESEND PATCH v2 2/2] x86/mm/pat, drivers/media/ivtv: move pat warn and replace WARN() with pr_warn()
2015-07-17 21:07 [RESEND PATCH v2 0/2] x86/mm/pat: modify nopat requirement warning Luis R. Rodriguez
2015-07-17 21:07 ` [RESEND PATCH v2 1/2] x86/mm/pat, drivers/infiniband/ipath: replace WARN() with pr_warn() Luis R. Rodriguez
@ 2015-07-17 21:07 ` Luis R. Rodriguez
1 sibling, 0 replies; 4+ messages in thread
From: Luis R. Rodriguez @ 2015-07-17 21:07 UTC (permalink / raw)
To: mingo
Cc: bp, andy, mchehab, dledford, dan.j.williams, benh, luto,
julia.lawall, jkosina, linux-media, linux-rdma, linux-kernel,
Luis R. Rodriguez
From: "Luis R. Rodriguez" <mcgrof@suse.com>
On built-in kernels this warning will always splat as this is part
of the module init. Fix that by shifting the PAT requirement check
out under the code that does the "quasi-probe" for the device. This
device driver relies on an existing driver to find its own devices,
it looks for that device driver and its own found devices, then
uses driver_for_each_device() to try to see if it can probe each of
those devices as a frambuffer device with ivtvfb_init_card(). We
tuck the PAT requiremenet check then on the ivtvfb_init_card()
call making the check at least require an ivtv device present
before complaining.
Reported-by: Fengguang Wu <fengguang.wu@intel.com> [0-day test robot]
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
drivers/media/pci/ivtv/ivtvfb.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c
index 4cb365d4ffdc..8b95eefb610b 100644
--- a/drivers/media/pci/ivtv/ivtvfb.c
+++ b/drivers/media/pci/ivtv/ivtvfb.c
@@ -38,6 +38,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fb.h>
@@ -1171,6 +1173,13 @@ static int ivtvfb_init_card(struct ivtv *itv)
{
int rc;
+#ifdef CONFIG_X86_64
+ if (pat_enabled()) {
+ pr_warn("ivtvfb needs PAT disabled, boot with nopat kernel parameter\n");
+ return -ENODEV;
+ }
+#endif
+
if (itv->osd_info) {
IVTVFB_ERR("Card %d already initialised\n", ivtvfb_card_id);
return -EBUSY;
@@ -1265,12 +1274,6 @@ static int __init ivtvfb_init(void)
int registered = 0;
int err;
-#ifdef CONFIG_X86_64
- if (WARN(pat_enabled(),
- "ivtvfb needs PAT disabled, boot with nopat kernel parameter\n")) {
- return -ENODEV;
- }
-#endif
if (ivtvfb_card_id < -1 || ivtvfb_card_id >= IVTV_MAX_CARDS) {
printk(KERN_ERR "ivtvfb: ivtvfb_card_id parameter is out of range (valid range: -1 - %d)\n",
--
2.3.2.209.gd67f9d5.dirty
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RESEND PATCH v2 1/2] x86/mm/pat, drivers/infiniband/ipath: replace WARN() with pr_warn()
[not found] ` <1437167245-28273-2-git-send-email-mcgrof-3uybbJdB1yH774rrrx3eTA@public.gmane.org>
@ 2015-07-20 18:08 ` Doug Ledford
0 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2015-07-20 18:08 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: Ingo Molnar, Borislav Petkov,
andy-JCKMKWeByS3xr+NhZqW+5SMd26UNKDXL, Mauro Carvalho Chehab,
dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r, luto, Julia Lawall,
Jiri Kosina, linux-media, linux-rdma, linux-kernel,
Luis R. Rodriguez
[-- Attachment #1: Type: text/plain, Size: 601 bytes --]
> On Jul 17, 2015, at 5:07 PM, Luis R. Rodriguez <mcgrof-3uybbJdB1yH774rrrx3eTA@public.gmane.org> wrote:
>
> From: "Luis R. Rodriguez" <mcgrof-IBi9RG/b67k@public.gmane.org>
>
> WARN() may confuse users, fix that. ipath_init_one() is part the
> device's probe so this would only be triggered if a corresponding
> device was found.
>
> Signed-off-by: Luis R. Rodriguez <mcgrof-IBi9RG/b67k@public.gmane.org>
Acked-by: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
—
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 842 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-20 18:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-17 21:07 [RESEND PATCH v2 0/2] x86/mm/pat: modify nopat requirement warning Luis R. Rodriguez
2015-07-17 21:07 ` [RESEND PATCH v2 1/2] x86/mm/pat, drivers/infiniband/ipath: replace WARN() with pr_warn() Luis R. Rodriguez
[not found] ` <1437167245-28273-2-git-send-email-mcgrof-3uybbJdB1yH774rrrx3eTA@public.gmane.org>
2015-07-20 18:08 ` Doug Ledford
2015-07-17 21:07 ` [RESEND PATCH v2 2/2] x86/mm/pat, drivers/media/ivtv: move pat warn and " Luis R. Rodriguez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox