All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] gma500_gfx: Avoid inserting gma500_gfx module for certain devices
       [not found] <cover.1444057729.git.alejandro.hernandez@linux.intel.com>
@ 2015-11-09 16:11   ` Alejandro Hernandez
  0 siblings, 0 replies; 3+ messages in thread
From: Alejandro Hernandez @ 2015-10-05 15:13 UTC (permalink / raw)
  To: yocto

The gma500_gfx driver will match certain devices on which it causes incorrect functionality,
we want to avoid inserting this module, basicallly blacklist it for specific hardware,
but still allow it to work on other hardware by default; usually when we have an already working system,
using udev rules would do the job, but since we are building it, it is impossible to blacklist
a driver when a certain udev rule matches, since rootfs isn't writeable at this point during boot time,
the solution is to use modprobe install, which runs a certain command instead of inserting a matching module,
this command needs to insert the module manually afterwards and have a flag --ignore-install
so it doesnt create an infinite loop executing itself everytime it wants to insert the module,
busybox's modprobe doesn't provide this functionality, so a small hack had to be used to avoid
the infite loop instead.

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
---
 meta-yocto-bsp/conf/machine/genericx86.conf            |  2 ++
 .../gma500-gfx-check/gma500-gfx-check.conf             |  2 ++
 .../gma500-gfx-check/gma500-gfx-check.sh               | 11 +++++++++++
 .../gma500-gfx-check/gma500-gfx-check_1.0.bb           | 18 ++++++++++++++++++
 4 files changed, 33 insertions(+)
 create mode 100644 meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf
 create mode 100644 meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh
 create mode 100644 meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb

diff --git a/meta-yocto-bsp/conf/machine/genericx86.conf b/meta-yocto-bsp/conf/machine/genericx86.conf
index 2642cab..798b62ec 100644
--- a/meta-yocto-bsp/conf/machine/genericx86.conf
+++ b/meta-yocto-bsp/conf/machine/genericx86.conf
@@ -6,3 +6,5 @@
 DEFAULTTUNE ?= "core2-32"
 require conf/machine/include/tune-core2.inc
 require conf/machine/include/genericx86-common.inc
+
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "gma500-gfx-check"
diff --git a/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf
new file mode 100644
index 0000000..69f109e
--- /dev/null
+++ b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf
@@ -0,0 +1,2 @@
+# Mimic modprobe's install funcitonality with busybox's modprobe
+install gma500_gfx lsmod | grep gma || { gma500_gfx_check.sh || modprobe gma500_gfx; }
diff --git a/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh
new file mode 100644
index 0000000..0c7b3aa
--- /dev/null
+++ b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# Check for devices we wish to avoid gma500_gfx for
+DEVICES="0x8119 0x4108"
+for DEVICE in $DEVICES; do
+    if udevadm trigger --subsystem-match=pci --verbose --attr-match=device=$DEVICE | grep "pci" >> /dev/null ; then
+        echo "Found $DEVICE, avoiding gma500_gfx module" >> /dev/kmsg;
+        exit 0
+    fi
+done
+exit 1
diff --git a/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb
new file mode 100644
index 0000000..00680de
--- /dev/null
+++ b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Intel gma500_gfx fix for certain hardware"
+DESCRIPTION = "Avoid inserting gma500_gfx module for certain hardware devices."
+LICENSE="GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI = "file://gma500-gfx-check.conf \
+	file://gma500-gfx-check.sh "
+
+do_install(){
+    install -d ${D}${sysconfdir}/modprobe.d/
+    install -m 755 ${WORKDIR}/gma500-gfx-check.sh ${D}${sysconfdir}/modprobe.d/gma500-gfx-check.sh
+    install -m 644 ${WORKDIR}/gma500-gfx-check.conf ${D}${sysconfdir}/modprobe.d/gma500-gfx-check.conf
+}
+
+FILES_${PN}="${sysconfdir}/modprobe.d/gma500-gfx-check.conf \
+             ${sysconfdir}/modprobe.d/gma500-gfx-check.sh"
+
+COMPATIBLE_MACHINE = "genericx86"
-- 
1.8.4.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [yocto][PATCH 1/1] gma500_gfx: Avoid inserting gma500_gfx module for certain devices
@ 2015-11-09 16:11   ` Alejandro Hernandez
  0 siblings, 0 replies; 3+ messages in thread
From: Alejandro Hernandez @ 2015-11-09 16:11 UTC (permalink / raw)
  To: poky

The gma500_gfx driver will match certain devices on which it causes incorrect functionality,
we want to avoid inserting this module, basicallly blacklist it for specific hardware,
but still allow it to work on other hardware by default; usually when we have an already working system,
using udev rules would do the job, but since we are building it, it is impossible to blacklist
a driver when a certain udev rule matches, since rootfs isn't writeable at this point during boot time,
the solution is to use modprobe install, which runs a certain command instead of inserting a matching module,
this command needs to insert the module manually afterwards and have a flag --ignore-install
so it doesnt create an infinite loop executing itself everytime it wants to insert the module,
busybox's modprobe doesn't provide this functionality, so a small hack had to be used to avoid
the infite loop instead.

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
---
 meta-yocto-bsp/conf/machine/genericx86.conf            |  2 ++
 .../gma500-gfx-check/gma500-gfx-check.conf             |  2 ++
 .../gma500-gfx-check/gma500-gfx-check.sh               | 11 +++++++++++
 .../gma500-gfx-check/gma500-gfx-check_1.0.bb           | 18 ++++++++++++++++++
 4 files changed, 33 insertions(+)
 create mode 100644 meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf
 create mode 100644 meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh
 create mode 100644 meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb

diff --git a/meta-yocto-bsp/conf/machine/genericx86.conf b/meta-yocto-bsp/conf/machine/genericx86.conf
index 2642cab..798b62ec 100644
--- a/meta-yocto-bsp/conf/machine/genericx86.conf
+++ b/meta-yocto-bsp/conf/machine/genericx86.conf
@@ -6,3 +6,5 @@
 DEFAULTTUNE ?= "core2-32"
 require conf/machine/include/tune-core2.inc
 require conf/machine/include/genericx86-common.inc
+
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "gma500-gfx-check"
diff --git a/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf
new file mode 100644
index 0000000..69f109e
--- /dev/null
+++ b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf
@@ -0,0 +1,2 @@
+# Mimic modprobe's install funcitonality with busybox's modprobe
+install gma500_gfx lsmod | grep gma || { gma500_gfx_check.sh || modprobe gma500_gfx; }
diff --git a/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh
new file mode 100644
index 0000000..0c7b3aa
--- /dev/null
+++ b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# Check for devices we wish to avoid gma500_gfx for
+DEVICES="0x8119 0x4108"
+for DEVICE in $DEVICES; do
+    if udevadm trigger --subsystem-match=pci --verbose --attr-match=device=$DEVICE | grep "pci" >> /dev/null ; then
+        echo "Found $DEVICE, avoiding gma500_gfx module" >> /dev/kmsg;
+        exit 0
+    fi
+done
+exit 1
diff --git a/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb
new file mode 100644
index 0000000..00680de
--- /dev/null
+++ b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Intel gma500_gfx fix for certain hardware"
+DESCRIPTION = "Avoid inserting gma500_gfx module for certain hardware devices."
+LICENSE="GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI = "file://gma500-gfx-check.conf \
+	file://gma500-gfx-check.sh "
+
+do_install(){
+    install -d ${D}${sysconfdir}/modprobe.d/
+    install -m 755 ${WORKDIR}/gma500-gfx-check.sh ${D}${sysconfdir}/modprobe.d/gma500-gfx-check.sh
+    install -m 644 ${WORKDIR}/gma500-gfx-check.conf ${D}${sysconfdir}/modprobe.d/gma500-gfx-check.conf
+}
+
+FILES_${PN}="${sysconfdir}/modprobe.d/gma500-gfx-check.conf \
+             ${sysconfdir}/modprobe.d/gma500-gfx-check.sh"
+
+COMPATIBLE_MACHINE = "genericx86"
-- 
1.8.4.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [yocto][PATCH 1/1] gma500_gfx: Avoid inserting gma500_gfx module for certain devices
  2015-11-09 16:11   ` [yocto][PATCH " Alejandro Hernandez
  (?)
@ 2015-11-12  6:24   ` Saul Wold
  -1 siblings, 0 replies; 3+ messages in thread
From: Saul Wold @ 2015-11-12  6:24 UTC (permalink / raw)
  To: Alejandro Hernandez, poky

On Mon, 2015-11-09 at 16:11 +0000, Alejandro Hernandez wrote:
> The gma500_gfx driver will match certain devices on which it causes
> incorrect functionality,
> we want to avoid inserting this module, basicallly blacklist it for
> specific hardware,
> but still allow it to work on other hardware by default; usually when
> we have an already working system,
> using udev rules would do the job, but since we are building it, it
> is impossible to blacklist
> a driver when a certain udev rule matches, since rootfs isn't
> writeable at this point during boot time,
> the solution is to use modprobe install, which runs a certain command
> instead of inserting a matching module,
> this command needs to insert the module manually afterwards and have
> a flag --ignore-install
> so it doesnt create an infinite loop executing itself everytime it
> wants to insert the module,
> busybox's modprobe doesn't provide this functionality, so a small
> hack had to be used to avoid
> the infite loop instead.
> 
> Signed-off-by: Alejandro Hernandez
> <alejandro.hernandez@linux.intel.com>
Acked-by: Saul Wold <sgw@linux.intel.com>

> ---
>  meta-yocto-bsp/conf/machine/genericx86.conf            |  2 ++
>  .../gma500-gfx-check/gma500-gfx-check.conf             |  2 ++
>  .../gma500-gfx-check/gma500-gfx-check.sh               | 11
> +++++++++++
>  .../gma500-gfx-check/gma500-gfx-check_1.0.bb           | 18
> ++++++++++++++++++
>  4 files changed, 33 insertions(+)
>  create mode 100644 meta-yocto-bsp/recipes-bsp/gma500-gfx-
> check/gma500-gfx-check/gma500-gfx-check.conf
>  create mode 100644 meta-yocto-bsp/recipes-bsp/gma500-gfx-
> check/gma500-gfx-check/gma500-gfx-check.sh
>  create mode 100644 meta-yocto-bsp/recipes-bsp/gma500-gfx-
> check/gma500-gfx-check_1.0.bb
> 
> diff --git a/meta-yocto-bsp/conf/machine/genericx86.conf b/meta-
> yocto-bsp/conf/machine/genericx86.conf
> index 2642cab..798b62ec 100644
> --- a/meta-yocto-bsp/conf/machine/genericx86.conf
> +++ b/meta-yocto-bsp/conf/machine/genericx86.conf
> @@ -6,3 +6,5 @@
>  DEFAULTTUNE ?= "core2-32"
>  require conf/machine/include/tune-core2.inc
>  require conf/machine/include/genericx86-common.inc
> +
> +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "gma500-gfx-check"
> diff --git a/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-
> check/gma500-gfx-check.conf b/meta-yocto-bsp/recipes-bsp/gma500-gfx-
> check/gma500-gfx-check/gma500-gfx-check.conf
> new file mode 100644
> index 0000000..69f109e
> --- /dev/null
> +++ b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-
> check/gma500-gfx-check.conf
> @@ -0,0 +1,2 @@
> +# Mimic modprobe's install funcitonality with busybox's modprobe
> +install gma500_gfx lsmod | grep gma || { gma500_gfx_check.sh ||
> modprobe gma500_gfx; }
> diff --git a/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-
> check/gma500-gfx-check.sh b/meta-yocto-bsp/recipes-bsp/gma500-gfx-
> check/gma500-gfx-check/gma500-gfx-check.sh
> new file mode 100644
> index 0000000..0c7b3aa
> --- /dev/null
> +++ b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-
> check/gma500-gfx-check.sh
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +
> +# Check for devices we wish to avoid gma500_gfx for
> +DEVICES="0x8119 0x4108"
> +for DEVICE in $DEVICES; do
> +    if udevadm trigger --subsystem-match=pci --verbose --attr-
> match=device=$DEVICE | grep "pci" >> /dev/null ; then
> +        echo "Found $DEVICE, avoiding gma500_gfx module" >>
> /dev/kmsg;
> +        exit 0
> +    fi
> +done
> +exit 1
> diff --git a/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-
> check_1.0.bb b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-
> gfx-check_1.0.bb
> new file mode 100644
> index 0000000..00680de
> --- /dev/null
> +++ b/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-
> check_1.0.bb
> @@ -0,0 +1,18 @@
> +SUMMARY = "Intel gma500_gfx fix for certain hardware"
> +DESCRIPTION = "Avoid inserting gma500_gfx module for certain
> hardware devices."
> +LICENSE="GPLv2"
> +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-
> licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
> +
> +SRC_URI = "file://gma500-gfx-check.conf \
> +	file://gma500-gfx-check.sh "
> +
> +do_install(){
> +    install -d ${D}${sysconfdir}/modprobe.d/
> +    install -m 755 ${WORKDIR}/gma500-gfx-check.sh
> ${D}${sysconfdir}/modprobe.d/gma500-gfx-check.sh
> +    install -m 644 ${WORKDIR}/gma500-gfx-check.conf
> ${D}${sysconfdir}/modprobe.d/gma500-gfx-check.conf
> +}
> +
> +FILES_${PN}="${sysconfdir}/modprobe.d/gma500-gfx-check.conf \
> +             ${sysconfdir}/modprobe.d/gma500-gfx-check.sh"
> +
> +COMPATIBLE_MACHINE = "genericx86"
> -- 
> 1.8.4.5
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-12  6:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1444057729.git.alejandro.hernandez@linux.intel.com>
2015-10-05 15:13 ` [PATCH 1/1] gma500_gfx: Avoid inserting gma500_gfx module for certain devices Alejandro Hernandez
2015-11-09 16:11   ` [yocto][PATCH " Alejandro Hernandez
2015-11-12  6:24   ` Saul Wold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.