[FE training-materials-updates] Minor updates and improvements

Michael Opdenacker michael.opdenacker at free-electrons.com
Wed Dec 7 16:49:03 CET 2016

Repository : git://git.free-electrons.com/training-materials.git
On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=e0a92dc9c9dbd71a0954e8cd77811b87a56614b7


commit e0a92dc9c9dbd71a0954e8cd77811b87a56614b7
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date:   Wed Dec 7 16:44:48 2016 +0100

    Minor updates and improvements
    Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>


 .../kernel-driver-development-memory.tex           |  2 +-
 .../kernel-driver-development-sleeping.tex         | 35 ++++++++++++----------
 slides/kernel-frameworks2/kernel-frameworks2.tex   |  2 +-
 3 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/slides/kernel-driver-development-memory/kernel-driver-development-memory.tex b/slides/kernel-driver-development-memory/kernel-driver-development-memory.tex
index c5e431c..916b2e5 100644
--- a/slides/kernel-driver-development-memory/kernel-driver-development-memory.tex
+++ b/slides/kernel-driver-development-memory/kernel-driver-development-memory.tex
@@ -370,7 +370,7 @@ kfree(work);
   \item \code{Kmemcheck}
     \item Dynamic checker for access to uninitialized memory.
-    \item Only available on \code{x86} so far (Linux 3.17 status), but will
+    \item Only available on \code{x86} so far (Linux 4.9 status), but will
       help to improve architecture independent code anyway.
     \item See \kerneldoc{kmemcheck.txt} for details.
diff --git a/slides/kernel-driver-development-sleeping/kernel-driver-development-sleeping.tex b/slides/kernel-driver-development-sleeping/kernel-driver-development-sleeping.tex
index 2ec20d7..e2decd9 100644
--- a/slides/kernel-driver-development-sleeping/kernel-driver-development-sleeping.tex
+++ b/slides/kernel-driver-development-sleeping/kernel-driver-development-sleeping.tex
@@ -12,24 +12,29 @@
   \frametitle{How to sleep 1/3}
-  \item Must declare a wait queue
-  \item A wait queue will be used to store the list of threads waiting for an event
-    \begin{itemize}
-    \item Static queue declaration
-      \begin{itemize}
-      \item useful to declare as a global variable
-      \item \mint{c}+DECLARE_WAIT_QUEUE_HEAD(module_queue);+
-      \end{itemize}
-    \item Or dynamic queue declaration
+  \item Must declare a wait queue, which will be used to store the list of threads
+        waiting for an event
+  \item Dynamic queue declaration:
-      \item Useful to embed the wait queue inside another data
-        structure
+      \item Typically one queue per device managed by the driver
+      \item It's convenient to embed the wait queue inside a per-device data
+        structure.
+      \item Example from \kpath{drivers/net/ethernet/marvell/mvmdio.c}:
-wait_queue_head_t queue;
+struct orion_mdio_dev {
+        ...
+        wait_queue_head_t smi_busy_wait;
+struct orion_mdio_dev *dev;
-      \end{itemize}
+    \item Static queue declaration:
+      \begin{itemize}
+      \item Using a global variable when a global resource is sufficient
+      \item \mint{c}+DECLARE_WAIT_QUEUE_HEAD(module_queue);+
+      \end{itemize}
@@ -46,7 +51,7 @@ init_waitqueue_head(&queue);
   \item \mint{c}+int wait_event_killable(queue, condition);+
     \item Can be interrupted, but only by a \emph{fatal} signal
-      (\ksym{SIGKILL}). Returns \code{-}\ksym{ERESTARSYS} if interrupted.
+      (\ksym{SIGKILL}). Returns \code{-}\ksym{ERESTARTSYS} if interrupted.
   \item \mint{c}+int wait_event_interruptible(queue, condition);+
diff --git a/slides/kernel-frameworks2/kernel-frameworks2.tex b/slides/kernel-frameworks2/kernel-frameworks2.tex
index a393964..758271e 100644
--- a/slides/kernel-frameworks2/kernel-frameworks2.tex
+++ b/slides/kernel-frameworks2/kernel-frameworks2.tex
@@ -84,7 +84,7 @@ struct file_operations {
     \item Called when user space uses the \code{read()} system call on
       the device.
     \item Must read data from the device, write at most \code{sz}
-      bytes in the user space buffer \code{buf}, and update the
+      bytes to the user space buffer \code{buf}, and update the
       current position in the file \code{off}. \code{f} is a pointer
       to the same file structure that was passed in the \code{open()}

More information about the training-materials-updates mailing list