The loopback driver help text describes the debug log class and names
gb-log.ko. Update it to describe the loopback class and the actual
module name, gb-loopback.ko.
Signed-off-by: linfordWu <linfordwu(a)163.com>
---
drivers/staging/greybus/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/Kconfig b/drivers/staging/greybus/Kconfig
index e1d7ffdf4..3ff475500 100644
--- a/drivers/staging/greybus/Kconfig
+++ b/drivers/staging/greybus/Kconfig
@@ -75,10 +75,10 @@ config GREYBUS_LOOPBACK
tristate "Greybus Loopback Class driver"
help
Select this option if you have a device that follows the
- Greybus Debug Log Class specification.
+ Greybus Loopback Class specification.
To compile this code as a module, chose M here: the module
- will be called gb-log.ko
+ will be called gb-loopback.ko
config GREYBUS_POWER
tristate "Greybus Powersupply Class driver"
--
2.43.0
From: Yalagada Pavan Kumar <pavankumaryalagada(a)gmail.com>
Replace the existing usleep_range() and msleep() calls with
a single call to fsleep(), simplifying the code and letting
fsleep() select the appropriate delay method based on the
requested time.
For short delays, fsleep() allows up to 25% extra time instead
of the fixed 100 microseconds. For longer delays, the old code
rounds the requested time down to whole milliseconds, while
fsleep() rounds it up when using msleep().
These changes may affect the time between loopback operations
and the reported performance.
Suggested-by: Alex Elder <elder(a)riscstar.com>
Signed-off-by: Yalagada Pavan Kumar <pavankumaryalagada(a)gmail.com>
Reviewed-by: Alex Elder <elder(a)riscstar.com>
---
v3:
- Clarify the reason for using fsleep() in the commit message
v2:
- Add more details about how fsleep() affects delays.
- Update the subject to include the loopback module.
v1: https://lore.kernel.org/outreachy/c482704b-903e-413d-ba7b-5bf31c0a6104@risc…
---
drivers/staging/greybus/loopback.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
index efc69c10cffe..2fe845eaef29 100644
--- a/drivers/staging/greybus/loopback.c
+++ b/drivers/staging/greybus/loopback.c
@@ -898,12 +898,8 @@ static int gb_loopback_fn(void *data)
gb->send_count++;
mutex_unlock(&gb->mutex);
- if (us_wait) {
- if (us_wait < 20000)
- usleep_range(us_wait, us_wait + 100);
- else
- msleep(us_wait / 1000);
- }
+ if (us_wait)
+ fsleep(us_wait);
}
gb_pm_runtime_put_autosuspend(bundle);
--
2.43.0
From: Yalagada Pavan Kumar <pavankumaryalagada(a)gmail.com>
In the loopback function, usleep_range() is used for short delays
and msleep() for longer delays. This requires choosing the delay
function based on the requested time and converting microseconds
to milliseconds when using msleep().
Replace both functions with fsleep(), which chooses a delay
delay method based on the requested time. For short delays,
fsleep() allows up to 25% extra time instead of the fixed 100
microseconds. For longer delays, the old code rounds the
requested time down to whole milliseconds, while fsleep() rounds
it up when using msleep().
These changes may affect time between loopback operations and
the reported performance.
Suggested-by: Alex Elder <elder(a)riscstar.com>
Signed-off-by: Yalagada Pavan Kumar <pavankumaryalagada(a)gmail.com>
---
v2:
- Add more details about how fsleep() affects delays.
- Update the subject to include the loopback module.
v1: https://lore.kernel.org/outreachy/c482704b-903e-413d-ba7b-5bf31c0a6104@risc…
---
drivers/staging/greybus/loopback.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
index efc69c10cffe..2fe845eaef29 100644
--- a/drivers/staging/greybus/loopback.c
+++ b/drivers/staging/greybus/loopback.c
@@ -898,12 +898,8 @@ static int gb_loopback_fn(void *data)
gb->send_count++;
mutex_unlock(&gb->mutex);
- if (us_wait) {
- if (us_wait < 20000)
- usleep_range(us_wait, us_wait + 100);
- else
- msleep(us_wait / 1000);
- }
+ if (us_wait)
+ fsleep(us_wait);
}
gb_pm_runtime_put_autosuspend(bundle);
--
2.43.0
The audio manager module is created in a context that permits
sleeping. Its caller, gb_audio_manager_add(), already uses
GFP_KERNEL through ida_alloc(), and module creation subsequently
calls kobject_init_and_add().
GFP_ATOMIC is unnecessary in this context and restricts memory
reclaim. Remove the explicit flag to use the default GFP_KERNEL
allocation.
Signed-off-by: Torra Sowmya <sowmyatorra(a)gmail.com>
---
drivers/staging/greybus/audio_manager_module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
index dc90cc2d2308..8a9f7e7d1766 100644
--- a/drivers/staging/greybus/audio_manager_module.c
+++ b/drivers/staging/greybus/audio_manager_module.c
@@ -187,7 +187,7 @@ int gb_audio_manager_module_create(struct gb_audio_manager_module **module,
int err;
struct gb_audio_manager_module *m;
- m = kzalloc_obj(*m, GFP_ATOMIC);
+ m = kzalloc_obj(*m);
if (!m)
return -ENOMEM;
--
2.47.3