* [PATCH v5 0/3] staging: most: move core module out of staging
@ 2020-02-19 10:23 Christian Gromm
2020-02-19 10:23 ` [PATCH v5 1/3] staging: most: move core files out of the staging area Christian Gromm
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Christian Gromm @ 2020-02-19 10:23 UTC (permalink / raw)
To: gregkh; +Cc: Christian Gromm, driverdev-devel
v2:
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- use -M option to create patches
v3:
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- fix date range in comment section of core.c
- move code to free up memory to release funtions
- remove noisy log messages
- use dev_* functions for logging
v4:
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- change owner of struct device that is registered with kernel's
device/driver model
- fix linked list race condition
- fix logging behaviour
- fix possible NULL pointer dereference
v5:
rebased and adapted
Christian Gromm (3):
staging: most: move core files out of the staging area
staging: most: Documentation: update ABI description
staging: most: Documentation: move ABI description files out of
staging area
.../ABI/testing/configfs-most | 8 --------
.../ABI/testing/sysfs-bus-most | 24 +++-------------------
drivers/Kconfig | 1 +
drivers/Makefile | 1 +
drivers/most/Kconfig | 15 ++++++++++++++
drivers/most/Makefile | 4 ++++
drivers/{staging => }/most/configfs.c | 3 +--
drivers/{staging => }/most/core.c | 3 +--
drivers/staging/most/Kconfig | 6 +++---
drivers/staging/most/Makefile | 3 ---
drivers/staging/most/cdev/cdev.c | 3 +--
drivers/staging/most/dim2/dim2.c | 3 +--
drivers/staging/most/i2c/i2c.c | 3 +--
drivers/staging/most/net/net.c | 3 +--
drivers/staging/most/sound/sound.c | 3 +--
drivers/staging/most/usb/usb.c | 3 +--
drivers/staging/most/video/video.c | 3 +--
{drivers/staging/most => include/linux}/most.h | 0
18 files changed, 36 insertions(+), 53 deletions(-)
rename drivers/staging/most/Documentation/ABI/configfs-most.txt => Documentation/ABI/testing/configfs-most (94%)
rename drivers/staging/most/Documentation/ABI/sysfs-bus-most.txt => Documentation/ABI/testing/sysfs-bus-most (92%)
create mode 100644 drivers/most/Kconfig
create mode 100644 drivers/most/Makefile
rename drivers/{staging => }/most/configfs.c (99%)
rename drivers/{staging => }/most/core.c (99%)
rename {drivers/staging/most => include/linux}/most.h (100%)
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v5 1/3] staging: most: move core files out of the staging area
2020-02-19 10:23 [PATCH v5 0/3] staging: most: move core module out of staging Christian Gromm
@ 2020-02-19 10:23 ` Christian Gromm
2020-02-19 10:23 ` [PATCH v5 2/3] staging: most: Documentation: update ABI description Christian Gromm
2020-02-19 10:23 ` [PATCH v5 3/3] staging: most: Documentation: move ABI description files out of staging area Christian Gromm
2 siblings, 0 replies; 4+ messages in thread
From: Christian Gromm @ 2020-02-19 10:23 UTC (permalink / raw)
To: gregkh; +Cc: Christian Gromm, driverdev-devel
This patch moves the core module to the /drivers/most directory
and makes all necessary changes in order to not break the build.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
---
v2:
v3:
v4:
v5: rebased and adapted
drivers/Kconfig | 1 +
drivers/Makefile | 1 +
drivers/most/Kconfig | 15 +++++++++++++++
drivers/most/Makefile | 4 ++++
drivers/{staging => }/most/configfs.c | 3 +--
drivers/{staging => }/most/core.c | 3 +--
drivers/staging/most/Kconfig | 6 +++---
drivers/staging/most/Makefile | 3 ---
drivers/staging/most/cdev/cdev.c | 3 +--
drivers/staging/most/dim2/dim2.c | 3 +--
drivers/staging/most/i2c/i2c.c | 3 +--
drivers/staging/most/net/net.c | 3 +--
drivers/staging/most/sound/sound.c | 3 +--
drivers/staging/most/usb/usb.c | 3 +--
drivers/staging/most/video/video.c | 3 +--
{drivers/staging/most => include/linux}/most.h | 0
16 files changed, 33 insertions(+), 24 deletions(-)
create mode 100644 drivers/most/Kconfig
create mode 100644 drivers/most/Makefile
rename drivers/{staging => }/most/configfs.c (99%)
rename drivers/{staging => }/most/core.c (99%)
rename {drivers/staging/most => include/linux}/most.h (100%)
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 8befa53..c739665 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -228,4 +228,5 @@ source "drivers/interconnect/Kconfig"
source "drivers/counter/Kconfig"
+source "drivers/most/Kconfig"
endmenu
diff --git a/drivers/Makefile b/drivers/Makefile
index 31cf17d..7646549a 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -186,3 +186,4 @@ obj-$(CONFIG_SIOX) += siox/
obj-$(CONFIG_GNSS) += gnss/
obj-$(CONFIG_INTERCONNECT) += interconnect/
obj-$(CONFIG_COUNTER) += counter/
+obj-$(CONFIG_MOST) += most/
diff --git a/drivers/most/Kconfig b/drivers/most/Kconfig
new file mode 100644
index 0000000..58d7999
--- /dev/null
+++ b/drivers/most/Kconfig
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0
+menuconfig MOST
+ tristate "MOST support"
+ depends on HAS_DMA && CONFIGFS_FS
+ default n
+ help
+ Say Y here if you want to enable MOST support.
+ This driver needs at least one additional component to enable the
+ desired access from userspace (e.g. character devices) and one that
+ matches the network controller's hardware interface (e.g. USB).
+
+ To compile this driver as a module, choose M here: the
+ module will be called most_core.
+
+ If in doubt, say N here.
diff --git a/drivers/most/Makefile b/drivers/most/Makefile
new file mode 100644
index 0000000..e810cd3
--- /dev/null
+++ b/drivers/most/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+obj-$(CONFIG_MOST) += most_core.o
+most_core-y := core.o \
+ configfs.o
diff --git a/drivers/staging/most/configfs.c b/drivers/most/configfs.c
similarity index 99%
rename from drivers/staging/most/configfs.c
rename to drivers/most/configfs.c
index 9a96122..27b0c92 100644
--- a/drivers/staging/most/configfs.c
+++ b/drivers/most/configfs.c
@@ -10,8 +10,7 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/configfs.h>
-
-#include "most.h"
+#include <linux/most.h>
#define MAX_STRING_SIZE 80
diff --git a/drivers/staging/most/core.c b/drivers/most/core.c
similarity index 99%
rename from drivers/staging/most/core.c
rename to drivers/most/core.c
index 0c4ae69..6a59e87 100644
--- a/drivers/staging/most/core.c
+++ b/drivers/most/core.c
@@ -20,8 +20,7 @@
#include <linux/kthread.h>
#include <linux/dma-mapping.h>
#include <linux/idr.h>
-
-#include "most.h"
+#include <linux/most.h>
#define MAX_CHANNELS 64
#define STRING_SIZE 80
diff --git a/drivers/staging/most/Kconfig b/drivers/staging/most/Kconfig
index 6262eb2..c5a99f7 100644
--- a/drivers/staging/most/Kconfig
+++ b/drivers/staging/most/Kconfig
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
-menuconfig MOST
+menuconfig MOST_COMPONENTS
tristate "MOST support"
- depends on HAS_DMA && CONFIGFS_FS
+ depends on HAS_DMA && CONFIGFS_FS && MOST
default n
help
Say Y here if you want to enable MOST support.
@@ -16,7 +16,7 @@ menuconfig MOST
-if MOST
+if MOST_COMPONENTS
source "drivers/staging/most/cdev/Kconfig"
diff --git a/drivers/staging/most/Makefile b/drivers/staging/most/Makefile
index 20a99ec..a803a98 100644
--- a/drivers/staging/most/Makefile
+++ b/drivers/staging/most/Makefile
@@ -1,7 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_MOST) += most_core.o
-most_core-y := core.o
-most_core-y += configfs.o
obj-$(CONFIG_MOST_CDEV) += cdev/
obj-$(CONFIG_MOST_NET) += net/
diff --git a/drivers/staging/most/cdev/cdev.c b/drivers/staging/most/cdev/cdev.c
index 71943d1..cc1e3de 100644
--- a/drivers/staging/most/cdev/cdev.c
+++ b/drivers/staging/most/cdev/cdev.c
@@ -16,8 +16,7 @@
#include <linux/kfifo.h>
#include <linux/uaccess.h>
#include <linux/idr.h>
-
-#include "../most.h"
+#include <linux/most.h>
#define CHRDEV_REGION_SIZE 50
diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c
index 1659328..8e0f27e 100644
--- a/drivers/staging/most/dim2/dim2.c
+++ b/drivers/staging/most/dim2/dim2.c
@@ -20,8 +20,7 @@
#include <linux/dma-mapping.h>
#include <linux/sched.h>
#include <linux/kthread.h>
-
-#include "../most.h"
+#include <linux/most.h>
#include "hal.h"
#include "errors.h"
#include "sysfs.h"
diff --git a/drivers/staging/most/i2c/i2c.c b/drivers/staging/most/i2c/i2c.c
index 2980f70..893a8bab 100644
--- a/drivers/staging/most/i2c/i2c.c
+++ b/drivers/staging/most/i2c/i2c.c
@@ -13,8 +13,7 @@
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/err.h>
-
-#include "../most.h"
+#include <linux/most.h>
enum { CH_RX, CH_TX, NUM_CHANNELS };
diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
index 5547e36..830f089 100644
--- a/drivers/staging/most/net/net.c
+++ b/drivers/staging/most/net/net.c
@@ -15,8 +15,7 @@
#include <linux/list.h>
#include <linux/wait.h>
#include <linux/kobject.h>
-
-#include "../most.h"
+#include <linux/most.h>
#define MEP_HDR_LEN 8
#define MDP_HDR_LEN 16
diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c
index 44cf233..1527f41 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -17,8 +17,7 @@
#include <sound/pcm_params.h>
#include <linux/sched.h>
#include <linux/kthread.h>
-
-#include "../most.h"
+#include <linux/most.h>
#define DRIVER_NAME "sound"
#define STRING_SIZE 80
diff --git a/drivers/staging/most/usb/usb.c b/drivers/staging/most/usb/usb.c
index 0bda88c..e8c5a8c 100644
--- a/drivers/staging/most/usb/usb.c
+++ b/drivers/staging/most/usb/usb.c
@@ -23,8 +23,7 @@
#include <linux/dma-mapping.h>
#include <linux/etherdevice.h>
#include <linux/uaccess.h>
-
-#include "../most.h"
+#include <linux/most.h>
#define USB_MTU 512
#define NO_ISOCHRONOUS_URB 0
diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
index d32ae49..20d177a 100644
--- a/drivers/staging/most/video/video.c
+++ b/drivers/staging/most/video/video.c
@@ -20,8 +20,7 @@
#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fh.h>
-
-#include "../most.h"
+#include <linux/most.h>
#define V4L2_CMP_MAX_INPUT 1
diff --git a/drivers/staging/most/most.h b/include/linux/most.h
similarity index 100%
rename from drivers/staging/most/most.h
rename to include/linux/most.h
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v5 2/3] staging: most: Documentation: update ABI description
2020-02-19 10:23 [PATCH v5 0/3] staging: most: move core module out of staging Christian Gromm
2020-02-19 10:23 ` [PATCH v5 1/3] staging: most: move core files out of the staging area Christian Gromm
@ 2020-02-19 10:23 ` Christian Gromm
2020-02-19 10:23 ` [PATCH v5 3/3] staging: most: Documentation: move ABI description files out of staging area Christian Gromm
2 siblings, 0 replies; 4+ messages in thread
From: Christian Gromm @ 2020-02-19 10:23 UTC (permalink / raw)
To: gregkh; +Cc: Christian Gromm, driverdev-devel
This patch updates the ABI description files to be in sync
with current implementation.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
---
v2:
v3:
v4:
v5: rebased and adapted
.../most/Documentation/ABI/configfs-most.txt | 8 --------
.../most/Documentation/ABI/sysfs-bus-most.txt | 24 +++-------------------
2 files changed, 3 insertions(+), 29 deletions(-)
diff --git a/drivers/staging/most/Documentation/ABI/configfs-most.txt b/drivers/staging/most/Documentation/ABI/configfs-most.txt
index 2bf8114..ed67a4d 100644
--- a/drivers/staging/most/Documentation/ABI/configfs-most.txt
+++ b/drivers/staging/most/Documentation/ABI/configfs-most.txt
@@ -194,11 +194,3 @@ Description:
destroy_link write '1' to this attribute to destroy an
active link
-
-What: /sys/kernel/config/rdma_cm/<hca>/ports/<port-num>/default_roce_tos
-Date: March 8, 2019
-KernelVersion: 5.2
-Description: RDMA-CM QPs from HCA <hca> at port <port-num>
- will be created with this TOS as default.
- This can be overridden by using the rdma_set_option API.
- The possible RoCE TOS values are 0-255.
diff --git a/drivers/staging/most/Documentation/ABI/sysfs-bus-most.txt b/drivers/staging/most/Documentation/ABI/sysfs-bus-most.txt
index d8fa841..6b1d06e 100644
--- a/drivers/staging/most/Documentation/ABI/sysfs-bus-most.txt
+++ b/drivers/staging/most/Documentation/ABI/sysfs-bus-most.txt
@@ -5,7 +5,7 @@ Contact: Christian Gromm <christian.gromm@microchip.com>
Description:
Provides information about the interface type and the physical
location of the device. Hardware attached via USB, for instance,
- might return <usb_device 1-1.1:1.0>
+ might return <1-1.1:1.0>
Users:
What: /sys/bus/most/devices/.../interface
@@ -278,25 +278,7 @@ Description:
Indicates whether current channel ran out of buffers.
Users:
-What: /sys/bus/most/drivers/mostcore/add_link
-Date: March 2017
-KernelVersion: 4.15
-Contact: Christian Gromm <christian.gromm@microchip.com>
-Description:
- This is used to link a channel to a component of the
- mostcore. A link created by writing to this file is
- referred to as pipe.
-Users:
-
-What: /sys/bus/most/drivers/mostcore/remove_link
-Date: March 2017
-KernelVersion: 4.15
-Contact: Christian Gromm <christian.gromm@microchip.com>
-Description:
- This is used to unlink a channel from a component.
-Users:
-
-What: /sys/bus/most/drivers/mostcore/components
+What: /sys/bus/most/drivers/most_core/components
Date: March 2017
KernelVersion: 4.15
Contact: Christian Gromm <christian.gromm@microchip.com>
@@ -304,7 +286,7 @@ Description:
This is used to retrieve a list of registered components.
Users:
-What: /sys/bus/most/drivers/mostcore/links
+What: /sys/bus/most/drivers/most_core/links
Date: March 2017
KernelVersion: 4.15
Contact: Christian Gromm <christian.gromm@microchip.com>
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v5 3/3] staging: most: Documentation: move ABI description files out of staging area
2020-02-19 10:23 [PATCH v5 0/3] staging: most: move core module out of staging Christian Gromm
2020-02-19 10:23 ` [PATCH v5 1/3] staging: most: move core files out of the staging area Christian Gromm
2020-02-19 10:23 ` [PATCH v5 2/3] staging: most: Documentation: update ABI description Christian Gromm
@ 2020-02-19 10:23 ` Christian Gromm
2 siblings, 0 replies; 4+ messages in thread
From: Christian Gromm @ 2020-02-19 10:23 UTC (permalink / raw)
To: gregkh; +Cc: Christian Gromm, driverdev-devel
This patch moves the ABI description fils sysfs-bus-most and
configfs-most to the kernel's documentation folder.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
---
v2:
v3:
v4:
v5: rebased and adapted
.../ABI/configfs-most.txt => Documentation/ABI/testing/configfs-most | 0
.../ABI/sysfs-bus-most.txt => Documentation/ABI/testing/sysfs-bus-most | 0
2 files changed, 0 insertions(+), 0 deletions(-)
rename drivers/staging/most/Documentation/ABI/configfs-most.txt => Documentation/ABI/testing/configfs-most (100%)
rename drivers/staging/most/Documentation/ABI/sysfs-bus-most.txt => Documentation/ABI/testing/sysfs-bus-most (100%)
diff --git a/drivers/staging/most/Documentation/ABI/configfs-most.txt b/Documentation/ABI/testing/configfs-most
similarity index 100%
rename from drivers/staging/most/Documentation/ABI/configfs-most.txt
rename to Documentation/ABI/testing/configfs-most
diff --git a/drivers/staging/most/Documentation/ABI/sysfs-bus-most.txt b/Documentation/ABI/testing/sysfs-bus-most
similarity index 100%
rename from drivers/staging/most/Documentation/ABI/sysfs-bus-most.txt
rename to Documentation/ABI/testing/sysfs-bus-most
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-19 10:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19 10:23 [PATCH v5 0/3] staging: most: move core module out of staging Christian Gromm
2020-02-19 10:23 ` [PATCH v5 1/3] staging: most: move core files out of the staging area Christian Gromm
2020-02-19 10:23 ` [PATCH v5 2/3] staging: most: Documentation: update ABI description Christian Gromm
2020-02-19 10:23 ` [PATCH v5 3/3] staging: most: Documentation: move ABI description files out of staging area Christian Gromm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).