From: "Luis R. Rodriguez" <[email protected]>
Mauro, Doug,
The 0-day robot found using WARN() on built-in kernels confusing. Upon
further thought pr_warn() is better and will likely also not confuse
humans too.
Boris, provided maintainers Ack, please consider these patches.
These depend on pat_enabled() exported symbol which went in through
the x86 tree, so I suppose this also needs to go through there. This
is an example issue of cross-tree collateral evolution follow ups,
one reason why I punted the a RFD and proposal for a linux-oven [0].
In that regard I suppose follow ups like these would need to go through
that tree as well.
[0] http://lkml.kernel.org/r/[email protected]
Luis R. Rodriguez (2):
x86/mm/pat, drivers/infiniband/ipath: replace WARN() with pr_warn()
x86/mm/pat, drivers/media/ivtv: replace WARN() with pr_warn()
drivers/infiniband/hw/ipath/ipath_driver.c | 6 ++++--
drivers/media/pci/ivtv/ivtvfb.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
--
2.3.2.209.gd67f9d5.dirty
From: "Luis R. Rodriguez" <[email protected]>
On built-in kernels this will always splat. Fix that.
Reported-by: Fengguang Wu <[email protected]> [0-day test robot]
Signed-off-by: Luis R. Rodriguez <[email protected]>
---
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 2d7e503..871dbe5 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
From: "Luis R. Rodriguez" <[email protected]>
On built-in kernels this will always splat. Fix that.
Reported-by: Fengguang Wu <[email protected]> [0-day test robot]
Signed-off-by: Luis R. Rodriguez <[email protected]>
---
drivers/media/pci/ivtv/ivtvfb.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c
index 4cb365d..6f0c364 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>
@@ -1266,8 +1268,8 @@ static int __init ivtvfb_init(void)
int err;
#ifdef CONFIG_X86_64
- if (WARN(pat_enabled(),
- "ivtvfb needs PAT disabled, boot with nopat kernel parameter\n")) {
+ if (pat_enabled()) {
+ pr_warn("ivtvfb needs PAT disabled, boot with nopat kernel parameter\n");
return -ENODEV;
}
#endif
--
2.3.2.209.gd67f9d5.dirty
* Luis R. Rodriguez <[email protected]> wrote:
> From: "Luis R. Rodriguez" <[email protected]>
>
> On built-in kernels this will always splat. Fix that.
>
> Reported-by: Fengguang Wu <[email protected]> [0-day test robot]
> Signed-off-by: Luis R. Rodriguez <[email protected]>
> ---
> drivers/media/pci/ivtv/ivtvfb.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c
> index 4cb365d..6f0c364 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>
> @@ -1266,8 +1268,8 @@ static int __init ivtvfb_init(void)
> int err;
>
> #ifdef CONFIG_X86_64
> - if (WARN(pat_enabled(),
> - "ivtvfb needs PAT disabled, boot with nopat kernel parameter\n")) {
> + if (pat_enabled()) {
> + pr_warn("ivtvfb needs PAT disabled, boot with nopat kernel parameter\n");
> return -ENODEV;
> }
So why should a built-in kernel bzImage with this driver enabled but the driver
not present print this warning?
Why not only print in a code path where we know the hardware is present?
allyesconfig bootups are noisy enough as-is ...
Thanks,
Ingo
* Luis R. Rodriguez <[email protected]> wrote:
> From: "Luis R. Rodriguez" <[email protected]>
>
> On built-in kernels this will always splat. Fix that.
>
> Reported-by: Fengguang Wu <[email protected]> [0-day test robot]
> Signed-off-by: Luis R. Rodriguez <[email protected]>
> ---
> 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 2d7e503..871dbe5 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;
> }
Same observation as for the other patch: please only warn if the hardware is
present and the driver tries to activate. No need to annoy others.
Thanks,
Ingo
On Tue, Jun 23, 2015 at 12:39 AM, Ingo Molnar <[email protected]> wrote:
> Same observation as for the other patch: please only warn if the hardware is
> present and the driver tries to activate. No need to annoy others.
Will fix, and respin.
Luis