* [PATCH 1/2] staging: fbtft: fb_ra8875: prefer usleep_range over udelay
From: Georgii Druzhinin @ 2026-06-07 20:17 UTC (permalink / raw)
To: andy, gregkh
Cc: dri-devel, linux-fbdev, linux-staging, linux-kernel,
Georgii Druzhinin
Replace udelay(100) with usleep_range(100, 120) to avoid busy-waiting
and allow the scheduler to utilize the CPU during the delay.
Signed-off-by: Georgii Druzhinin <ilovelinuxgames@gmail.com>
---
drivers/staging/fbtft/fb_ra8875.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c
index 0ab1de6647d0..6058934e2ca2 100644
--- a/drivers/staging/fbtft/fb_ra8875.c
+++ b/drivers/staging/fbtft/fb_ra8875.c
@@ -210,7 +210,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
}
len--;
- udelay(100);
+ usleep_range(100, 120);
if (len) {
buf = (u8 *)par->buf;
@@ -231,7 +231,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
/* restore user spi-speed */
par->fbtftops.write = fbtft_write_spi;
- udelay(100);
+ usleep_range(100, 120);
}
static int write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len)
--
2.54.0
^ permalink raw reply related
* [PATCH 2/2] staging: fbtft: fbtft-bus: remove prohibited space before close parenthesis
From: Georgii Druzhinin @ 2026-06-07 20:17 UTC (permalink / raw)
To: andy, gregkh
Cc: dri-devel, linux-fbdev, linux-staging, linux-kernel,
Georgii Druzhinin
In-Reply-To: <20260607201708.88644-1-ilovelinuxgames@gmail.com>
Fix checkpatch.pl error: "space prohibited before that close
parenthesis ')'" by removing the empty argument and comma
in define_fbtft_write_reg macro calls.
Signed-off-by: Georgii Druzhinin <ilovelinuxgames@gmail.com>
---
drivers/staging/fbtft/fbtft-bus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
index 30e436ff19e4..409770891c54 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -62,9 +62,9 @@ out: \
} \
EXPORT_SYMBOL(func);
-define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8, )
+define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, u8)
define_fbtft_write_reg(fbtft_write_reg16_bus8, __be16, u16, cpu_to_be16)
-define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16, )
+define_fbtft_write_reg(fbtft_write_reg16_bus16, u16, u16)
void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
{
--
2.54.0
^ permalink raw reply related
* Re: [PATCH 1/2] staging: fbtft: fb_ra8875: prefer usleep_range over udelay
From: Andy Shevchenko @ 2026-06-08 6:07 UTC (permalink / raw)
To: Georgii Druzhinin
Cc: andy, gregkh, dri-devel, linux-fbdev, linux-staging, linux-kernel
In-Reply-To: <20260607201708.88644-1-ilovelinuxgames@gmail.com>
On Sun, Jun 7, 2026 at 11:17 PM Georgii Druzhinin
<ilovelinuxgames@gmail.com> wrote:
>
> Replace udelay(100) with usleep_range(100, 120) to avoid busy-waiting
> and allow the scheduler to utilize the CPU during the delay.
Nice, now go to the lore.kernel.org mailing list archives and check
what was done previously on this and why none of the similar patches
have been applied so far. Also read README in the driver's folder.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH 2/2] staging: fbtft: fbtft-bus: remove prohibited space before close parenthesis
From: Andy Shevchenko @ 2026-06-08 6:08 UTC (permalink / raw)
To: Georgii Druzhinin
Cc: andy, gregkh, dri-devel, linux-fbdev, linux-staging, linux-kernel
In-Reply-To: <20260607201708.88644-2-ilovelinuxgames@gmail.com>
On Sun, Jun 7, 2026 at 11:17 PM Georgii Druzhinin
<ilovelinuxgames@gmail.com> wrote:
>
> Fix checkpatch.pl error: "space prohibited before that close
> parenthesis ')'" by removing the empty argument and comma
> in define_fbtft_write_reg macro calls.
Please, learn C preprocessor and compile your stuff before submitting.
Also since you have a series of the patches it should have had a cover letter.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH] staging: media: atomisp: prefer kcalloc over kzalloc with multiply
From: Dan Carpenter @ 2026-06-08 7:08 UTC (permalink / raw)
To: Andrew Soto
Cc: hansg, mchehab, gregkh, andy, sakari.ailus, linux-media,
linux-staging, linux-kernel
In-Reply-To: <20260606234427.9902-1-linux@notrealandy.dev>
On Sat, Jun 06, 2026 at 11:44:27PM +0000, Andrew Soto wrote:
> Optimize memory allocation layout
This part of the commit message is techno-bable. It's just
words that don't mean anything. I suppose teally they do
mean something, but it's not what the patch does...
> in sh_css_params.c by replacing the raw multiplication inside kzalloc() with a type-safe kcalloc() array allocation wrapper.
>
> This prevents potential integer overflow vulnerabilities by validating the array size calculations before interacting with the kernel heap allocator, aligning the driver with modern kernel memory allocation standards.
>
There is no risk of integer overflow when we multiply by 1.
> Signed-off-by: Andrew Soto <linux@notrealandy.dev>
> ---
> drivers/staging/media/atomisp/pci/sh_css_params.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c
> index fcebace11..9147ca047 100644
> --- a/drivers/staging/media/atomisp/pci/sh_css_params.c
> +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
> @@ -3716,7 +3716,7 @@ ia_css_ptr sh_css_store_sp_group_to_ddr(void)
>
> IA_CSS_ENTER_LEAVE_PRIVATE("void");
>
> - write_buf = kzalloc(sizeof(u8) * 8192, GFP_KERNEL);
> + write_buf = kcalloc(8192, sizeof(u8), GFP_KERNEL);
This should just be:
write_buf = kzalloc(8192, GFP_KERNEL);
If we weren't allocating a text buffer then the new way to write this
would be using kzalloc_objs().
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH v2] staging: media: atomisp: remove unused macros
From: Dan Carpenter @ 2026-06-08 7:12 UTC (permalink / raw)
To: Rhys Tumelty
Cc: Andy Shevchenko, Hans de Goede, Mauro Carvalho Chehab,
Sakari Ailus, Greg Kroah-Hartman, linux-media, linux-staging,
linux-kernel
In-Reply-To: <20260607094130.3208513-1-rhys@tumelty.co.uk>
On Sun, Jun 07, 2026 at 10:41:30AM +0100, Rhys Tumelty wrote:
> Remove unused macros across the atomisp driver that are defined
> in .c files but never used. This was flagged as an error in a
> W=2 build due to -Werror=unused-macros.
>
> Signed-off-by: Rhys Tumelty <rhys@tumelty.co.uk>
> ---
> v2: Removed some macros that are used, or should be kept for documentation, with feedback from Dan Carpenter
Thanks. Looks okay to me now.
regards,
dan carpenter
^ permalink raw reply
* [PATCH] media: atomisp: Fix resource leak in atomisp_pci_probe()
From: Dawei Feng @ 2026-06-08 8:27 UTC (permalink / raw)
To: andy
Cc: hansg, mchehab, sakari.ailus, gregkh, abdelrahmanfekry375,
linux-kernel, linux-media, linux-staging, jianhao.xu, Dawei Feng,
Zilin Guan
During atomisp_pci_probe(), the ISP subdev is initialized via
atomisp_initialize_modules() prior to entity registration. If
atomisp_register_entities() fails, the current error path only
uninitializes the CSI2 modules. This leaks the subdev entity and control
handler that were previously set up by atomisp_subdev_init().
Fix this by calling atomisp_subdev_unregister_entities() to properly
release the subdev state on this specific error path. Later error paths
remain unchanged, as they correctly use atomisp_unregister_entities() to
handle broader cleanup after successful registration.
The bug was first flagged by an experimental analysis tool we are
developing for kernel memory-management bugs while analyzing v6.13-rc1.
The tool is still under development and is not yet publicly available.
Manual inspection confirms that the bug is still present in v7.1-rc5.
An x86_64 allyesconfig build showed no new warnings. As we do not have an
Intel Atom ISP platform to test with, no runtime testing was able to be
performed.
Fixes: 9d4fa1a16b28 ("media: atomisp: cleanup directory hierarchy")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
---
drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index 900a67552d6a..d4e4e845f66e 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -1401,6 +1401,7 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
err = atomisp_register_entities(isp);
if (err < 0) {
dev_err(&pdev->dev, "atomisp_register_entities failed (%d)\n", err);
+ atomisp_subdev_unregister_entities(&isp->asd);
goto error_uninitialize_modules;
}
--
2.34.1
^ permalink raw reply related
* Re: [PATCH v3] staging: media: max96712: drop unneeded dependency on OF_GPIO
From: Bartosz Golaszewski @ 2026-06-08 8:38 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Greg Kroah-Hartman, Bartosz Golaszewski
Cc: brgl, linux-media, linux-staging, linux-kernel
In-Reply-To: <20260506082211.5624-1-bartosz.golaszewski@oss.qualcomm.com>
On Wed, 06 May 2026 10:22:11 +0200, Bartosz Golaszewski wrote:
> OF_GPIO is selected automatically on all OF systems. Any symbols it
> controls also provide stubs and are private to GPIOLIB anyway so there's
> really no reason to select it explicitly.
>
>
Applied, thanks!
[1/1] staging: media: max96712: drop unneeded dependency on OF_GPIO
https://git.kernel.org/brgl/c/b8840c4f640e07562f15e5fc477ddaf1b2efb241
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply
* Re: [PATCH] media: atomisp: Fix resource leak in atomisp_pci_probe()
From: Dan Carpenter @ 2026-06-08 8:51 UTC (permalink / raw)
To: Dawei Feng
Cc: andy, hansg, mchehab, sakari.ailus, gregkh, abdelrahmanfekry375,
linux-kernel, linux-media, linux-staging, jianhao.xu, Zilin Guan
In-Reply-To: <20260608082706.3287831-1-dawei.feng@seu.edu.cn>
On Mon, Jun 08, 2026 at 04:27:06PM +0800, Dawei Feng wrote:
> During atomisp_pci_probe(), the ISP subdev is initialized via
> atomisp_initialize_modules() prior to entity registration. If
> atomisp_register_entities() fails, the current error path only
> uninitializes the CSI2 modules. This leaks the subdev entity and control
> handler that were previously set up by atomisp_subdev_init().
>
> Fix this by calling atomisp_subdev_unregister_entities() to properly
> release the subdev state on this specific error path. Later error paths
> remain unchanged, as they correctly use atomisp_unregister_entities() to
> handle broader cleanup after successful registration.
>
> The bug was first flagged by an experimental analysis tool we are
> developing for kernel memory-management bugs while analyzing v6.13-rc1.
> The tool is still under development and is not yet publicly available.
> Manual inspection confirms that the bug is still present in v7.1-rc5.
>
> An x86_64 allyesconfig build showed no new warnings. As we do not have an
> Intel Atom ISP platform to test with, no runtime testing was able to be
> performed.
>
> Fixes: 9d4fa1a16b28 ("media: atomisp: cleanup directory hierarchy")
> Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
> Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
> ---
The code is buggy, but this isn't the right fix.
Here is generally the standard way to do error handling.
https://staticthinking.wordpress.com/2022/04/28/free-the-last-thing-style/
1. An allocation should clean up it's own partial allocations. That
should not be handled in the caller. 2. Every allocation function should
have a mirror cleanup function.
The atomisp_uninitialize_modules() function is just a dummy and was never
actually implemented. The correct thing is to implement it.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH RESEND] media: atomisp: replace kmalloc() with kmalloc_array() in sh_css.c
From: Andy Shevchenko @ 2026-06-08 9:41 UTC (permalink / raw)
To: Andrei Khomenkov
Cc: Greg Kroah-Hartman, Hans de Goede, Mauro Carvalho Chehab,
Andy Shevchenko, Sakari Ailus, Kees Cook, linux-staging,
linux-media
In-Reply-To: <20260606095410.13968-1-khomenkov@mailbox.org>
On Sat, Jun 06, 2026 at 12:54:10PM +0300, Andrei Khomenkov wrote:
> Replace arithmetic in the kmalloc() function with the kmalloc_array()
> function, as this calculation method is unsafe.
...
> - descr->in_info = kmalloc(descr->num_stage *
> - sizeof(struct ia_css_frame_info),
> - GFP_KERNEL);
> + descr->in_info = kmalloc_array(descr->num_stage, sizeof(struct ia_css_frame_info),
Why not sizeof(*descr->in_info) ?
...
Same Q to the rest.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* [linux-5.10.y 1/3] HID: core: Add printk_ratelimited variants to hid_warn() etc
From: Lee Jones @ 2026-06-08 10:02 UTC (permalink / raw)
To: lee, Jiri Kosina, Benjamin Tissoires, Viresh Kumar, Johan Hovold,
Alex Elder, Greg Kroah-Hartman, linux-input, linux-kernel,
greybus-dev, linux-staging
Cc: stable, Vicki Pfau, Jiri Kosina
From: Vicki Pfau <vi@endrift.com>
hid_warn_ratelimited() is needed. Add the others as part of the block.
Signed-off-by: Vicki Pfau <vi@endrift.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
(cherry picked from commit 1d64624243af8329b4b219d8c39e28ea448f9929)
Signed-off-by: Lee Jones <lee@kernel.org>
(cherry picked from commit 3dc96d0b81eae69bf71e129e3f331c982c5c70fd)
Signed-off-by: Lee Jones <lee@kernel.org>
(cherry picked from commit 023f03a90d4fcc809ffbfc70e6927ce9889b2578)
Signed-off-by: Lee Jones <lee@kernel.org>
---
include/linux/hid.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 03627c96d814..ab56fffb74a2 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -1217,4 +1217,15 @@ do { \
#define hid_dbg_once(hid, fmt, ...) \
dev_dbg_once(&(hid)->dev, fmt, ##__VA_ARGS__)
+#define hid_err_ratelimited(hid, fmt, ...) \
+ dev_err_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__)
+#define hid_notice_ratelimited(hid, fmt, ...) \
+ dev_notice_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__)
+#define hid_warn_ratelimited(hid, fmt, ...) \
+ dev_warn_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__)
+#define hid_info_ratelimited(hid, fmt, ...) \
+ dev_info_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__)
+#define hid_dbg_ratelimited(hid, fmt, ...) \
+ dev_dbg_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__)
+
#endif
--
2.54.0.1032.g2f8565e1d1-goog
^ permalink raw reply related
* [linux-5.10.y 2/3] HID: pass the buffer size to hid_report_raw_event
From: Lee Jones @ 2026-06-08 10:02 UTC (permalink / raw)
To: lee, Jiri Kosina, Benjamin Tissoires, Viresh Kumar, Johan Hovold,
Alex Elder, Greg Kroah-Hartman, linux-input, linux-kernel,
greybus-dev, linux-staging
Cc: stable, Benjamin Tissoires, Jiri Kosina, Sasha Levin
In-Reply-To: <20260608100236.2781796-1-lee@kernel.org>
From: Benjamin Tissoires <bentiss@kernel.org>
[ Upstream commit 2c85c61d1332e1e16f020d76951baf167dcb6f7a ]
commit 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing
bogus memset()") enforced the provided data to be at least the size of
the declared buffer in the report descriptor to prevent a buffer
overflow. However, we can try to be smarter by providing both the buffer
size and the data size, meaning that hid_report_raw_event() can make
better decision whether we should plaining reject the buffer (buffer
overflow attempt) or if we can safely memset it to 0 and pass it to the
rest of the stack.
Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Acked-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Stable-dep-of: 206342541fc8 ("HID: core: introduce hid_safe_input_report()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 509c2605065004fc4cd86ee50a9350d402785307)
[Lee: Backported to linux-6.12.y and beyond]
Signed-off-by: Lee Jones <lee@kernel.org>
(cherry picked from commit f9393998660f146970047bda31526aeb96190f28)
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/hid/hid-core.c | 29 ++++++++++++++++++++++-------
drivers/hid/hid-gfrm.c | 4 ++--
drivers/hid/hid-logitech-hidpp.c | 2 +-
drivers/hid/hid-multitouch.c | 2 +-
drivers/hid/hid-primax.c | 2 +-
drivers/hid/hid-vivaldi.c | 2 +-
drivers/hid/wacom_sys.c | 6 +++---
drivers/staging/greybus/hid.c | 2 +-
include/linux/hid.h | 4 ++--
9 files changed, 34 insertions(+), 19 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index aa9ae6ccb28a..c73f4ac16fdf 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1775,8 +1775,8 @@ int __hid_request(struct hid_device *hid, struct hid_report *report,
}
EXPORT_SYMBOL_GPL(__hid_request);
-int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
- int interrupt)
+int hid_report_raw_event(struct hid_device *hid, int type, u8 *data,
+ size_t bufsize, u32 size, int interrupt)
{
struct hid_report_enum *report_enum = hid->report_enum + type;
struct hid_report *report;
@@ -1784,16 +1784,24 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
int max_buffer_size = HID_MAX_BUFFER_SIZE;
unsigned int a;
u32 rsize, csize = size;
+ size_t bsize = bufsize;
u8 *cdata = data;
int ret = 0;
report = hid_get_report(report_enum, data);
if (!report)
- goto out;
+ return 0;
+
+ if (unlikely(bsize < csize)) {
+ hid_warn_ratelimited(hid, "Event data for report %d is incorrect (%d vs %ld)\n",
+ report->id, csize, bsize);
+ return -EINVAL;
+ }
if (report_enum->numbered) {
cdata++;
csize--;
+ bsize--;
}
rsize = hid_compute_report_size(report);
@@ -1806,9 +1814,15 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
else if (rsize > max_buffer_size)
rsize = max_buffer_size;
+ if (bsize < rsize) {
+ hid_warn_ratelimited(hid, "Event data for report %d was too short (%d vs %ld)\n",
+ report->id, rsize, bsize);
+ return -EINVAL;
+ }
+
if (csize < rsize) {
dbg_hid("report %d is too short, (%d < %d)\n", report->id,
- csize, rsize);
+ csize, rsize);
memset(cdata + csize, 0, rsize - csize);
}
@@ -1817,7 +1831,7 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
if (hid->claimed & HID_CLAIMED_HIDRAW) {
ret = hidraw_report_event(hid, data, size);
if (ret)
- goto out;
+ return ret;
}
if (hid->claimed != HID_CLAIMED_HIDRAW && report->maxfield) {
@@ -1830,7 +1844,7 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
if (hid->claimed & HID_CLAIMED_INPUT)
hidinput_report_event(hid, report);
-out:
+
return ret;
}
EXPORT_SYMBOL_GPL(hid_report_raw_event);
@@ -1851,6 +1865,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, u32 size, int i
struct hid_report_enum *report_enum;
struct hid_driver *hdrv;
struct hid_report *report;
+ size_t bufsize = size;
int ret = 0;
if (!hid)
@@ -1889,7 +1904,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, u32 size, int i
goto unlock;
}
- ret = hid_report_raw_event(hid, type, data, size, interrupt);
+ ret = hid_report_raw_event(hid, type, data, bufsize, size, interrupt);
unlock:
up(&hid->driver_input_lock);
diff --git a/drivers/hid/hid-gfrm.c b/drivers/hid/hid-gfrm.c
index 699186ff2349..d2a56bf92b41 100644
--- a/drivers/hid/hid-gfrm.c
+++ b/drivers/hid/hid-gfrm.c
@@ -66,7 +66,7 @@ static int gfrm_raw_event(struct hid_device *hdev, struct hid_report *report,
switch (data[1]) {
case GFRM100_SEARCH_KEY_DOWN:
ret = hid_report_raw_event(hdev, HID_INPUT_REPORT, search_key_dn,
- sizeof(search_key_dn), 1);
+ sizeof(search_key_dn), sizeof(search_key_dn), 1);
break;
case GFRM100_SEARCH_KEY_AUDIO_DATA:
@@ -74,7 +74,7 @@ static int gfrm_raw_event(struct hid_device *hdev, struct hid_report *report,
case GFRM100_SEARCH_KEY_UP:
ret = hid_report_raw_event(hdev, HID_INPUT_REPORT, search_key_up,
- sizeof(search_key_up), 1);
+ sizeof(search_key_up), sizeof(search_key_up), 1);
break;
default:
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 98562a0ed0c3..d31f2737b13d 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -3176,7 +3176,7 @@ static int hidpp10_consumer_keys_raw_event(struct hidpp_device *hidpp,
memcpy(&consumer_report[1], &data[3], 4);
/* We are called from atomic context */
hid_report_raw_event(hidpp->hid_dev, HID_INPUT_REPORT,
- consumer_report, 5, 1);
+ consumer_report, sizeof(consumer_report), 5, 1);
return 1;
}
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 948bd59ab5d2..c3bcc23d7c7c 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -449,7 +449,7 @@ static void mt_get_feature(struct hid_device *hdev, struct hid_report *report)
}
ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, buf,
- size, 0);
+ size, size, 0);
if (ret)
dev_warn(&hdev->dev, "failed to report feature\n");
}
diff --git a/drivers/hid/hid-primax.c b/drivers/hid/hid-primax.c
index 1e6413d07cae..16e2a811eda9 100644
--- a/drivers/hid/hid-primax.c
+++ b/drivers/hid/hid-primax.c
@@ -44,7 +44,7 @@ static int px_raw_event(struct hid_device *hid, struct hid_report *report,
data[0] |= (1 << (data[idx] - 0xE0));
data[idx] = 0;
}
- hid_report_raw_event(hid, HID_INPUT_REPORT, data, size, 0);
+ hid_report_raw_event(hid, HID_INPUT_REPORT, data, size, size, 0);
return 1;
default: /* unknown report */
diff --git a/drivers/hid/hid-vivaldi.c b/drivers/hid/hid-vivaldi.c
index d57ec1767037..fdfea1355ee7 100644
--- a/drivers/hid/hid-vivaldi.c
+++ b/drivers/hid/hid-vivaldi.c
@@ -126,7 +126,7 @@ static void vivaldi_feature_mapping(struct hid_device *hdev,
}
ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, report_data,
- report_len, 0);
+ report_len, report_len, 0);
if (ret) {
dev_warn(&hdev->dev, "failed to report feature %d\n",
field->report->id);
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index abbfb53bb7dc..09b513812fff 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -79,7 +79,7 @@ static void wacom_wac_queue_flush(struct hid_device *hdev,
int err;
size = kfifo_out(fifo, buf, sizeof(buf));
- err = hid_report_raw_event(hdev, HID_INPUT_REPORT, buf, size, false);
+ err = hid_report_raw_event(hdev, HID_INPUT_REPORT, buf, size, size, false);
if (err) {
hid_warn(hdev, "%s: unable to flush event due to error %d\n",
__func__, err);
@@ -324,7 +324,7 @@ static void wacom_feature_mapping(struct hid_device *hdev,
data, n, WAC_CMD_RETRIES);
if (ret == n && features->type == HID_GENERIC) {
ret = hid_report_raw_event(hdev,
- HID_FEATURE_REPORT, data, n, 0);
+ HID_FEATURE_REPORT, data, n, n, 0);
} else if (ret == 2 && features->type != HID_GENERIC) {
features->touch_max = data[1];
} else {
@@ -385,7 +385,7 @@ static void wacom_feature_mapping(struct hid_device *hdev,
data, n, WAC_CMD_RETRIES);
if (ret == n) {
ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT,
- data, n, 0);
+ data, n, n, 0);
} else {
hid_warn(hdev, "%s: could not retrieve sensor offsets\n",
__func__);
diff --git a/drivers/staging/greybus/hid.c b/drivers/staging/greybus/hid.c
index ed706f39e87a..d68f60da0dd1 100644
--- a/drivers/staging/greybus/hid.c
+++ b/drivers/staging/greybus/hid.c
@@ -201,7 +201,7 @@ static void gb_hid_init_report(struct gb_hid *ghid, struct hid_report *report)
* we just need to setup the input fields, so using
* hid_report_raw_event is safe.
*/
- hid_report_raw_event(ghid->hid, report->type, ghid->inbuf, size, 1);
+ hid_report_raw_event(ghid->hid, report->type, ghid->inbuf, ghid->bufsize, size, 1);
}
static void gb_hid_init_reports(struct gb_hid *ghid)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index ab56fffb74a2..aaae2fecd4ae 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -1175,8 +1175,8 @@ static inline u32 hid_report_len(struct hid_report *report)
return DIV_ROUND_UP(report->size, 8) + (report->id > 0);
}
-int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
- int interrupt);
+int hid_report_raw_event(struct hid_device *hid, int type, u8 *data,
+ size_t bufsize, u32 size, int interrupt);
/* HID quirks API */
unsigned long hid_lookup_quirk(const struct hid_device *hdev);
--
2.54.0.1032.g2f8565e1d1-goog
^ permalink raw reply related
* [linux-5.10.y 3/3] HID: core: Fix size_t specifier in hid_report_raw_event()
From: Lee Jones @ 2026-06-08 10:02 UTC (permalink / raw)
To: lee, Jiri Kosina, Benjamin Tissoires, Viresh Kumar, Johan Hovold,
Alex Elder, Greg Kroah-Hartman, linux-input, linux-kernel,
greybus-dev, linux-staging
Cc: stable, Nathan Chancellor, Miguel Ojeda, Linus Torvalds,
Sasha Levin
In-Reply-To: <20260608100236.2781796-1-lee@kernel.org>
From: Nathan Chancellor <nathan@kernel.org>
[ Upstream commit 4d3a2a466b8d68d852a1f3bbf11204b718428dc4 ]
When building for 32-bit platforms, for which 'size_t' is
'unsigned int', there are warnings around using the incorrect format
specifier to print bsize in hid_report_raw_event():
drivers/hid/hid-core.c:2054:29: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
2053 | hid_warn_ratelimited(hid, "Event data for report %d is incorrect (%d vs %ld)\n",
| ~~~
| %zu
2054 | report->id, csize, bsize);
| ^~~~~
drivers/hid/hid-core.c:2076:29: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
2075 | hid_warn_ratelimited(hid, "Event data for report %d was too short (%d vs %ld)\n",
| ~~~
| %zu
2076 | report->id, rsize, bsize);
| ^~~~~
Use the proper 'size_t' format specifier, '%zu', to clear up the
warnings.
Cc: stable@vger.kernel.org
Fixes: 2c85c61d1332 ("HID: pass the buffer size to hid_report_raw_event")
Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: https://lore.kernel.org/20260516020430.110135-1-ojeda@kernel.org/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 3ab135238832446399614e7a4bb796d620717806)
Signed-off-by: Lee Jones <lee@kernel.org>
(cherry picked from commit 0f77a993b5426cca1b046c9ab4b2f8355a4d45dc)
Signed-off-by: Lee Jones <lee@kernel.org>
(cherry picked from commit 70333a8f866aad8cbd6956e2ec4ace159fa4243b)
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/hid/hid-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index c73f4ac16fdf..918c66d5bc93 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1793,7 +1793,7 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data,
return 0;
if (unlikely(bsize < csize)) {
- hid_warn_ratelimited(hid, "Event data for report %d is incorrect (%d vs %ld)\n",
+ hid_warn_ratelimited(hid, "Event data for report %d is incorrect (%d vs %zu)\n",
report->id, csize, bsize);
return -EINVAL;
}
@@ -1815,7 +1815,7 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data,
rsize = max_buffer_size;
if (bsize < rsize) {
- hid_warn_ratelimited(hid, "Event data for report %d was too short (%d vs %ld)\n",
+ hid_warn_ratelimited(hid, "Event data for report %d was too short (%d vs %zu)\n",
report->id, rsize, bsize);
return -EINVAL;
}
--
2.54.0.1032.g2f8565e1d1-goog
^ permalink raw reply related
* Re: [PATCH] media: atomisp: Fix resource leak in atomisp_pci_probe()
From: Dawei Feng @ 2026-06-08 14:05 UTC (permalink / raw)
To: error27
Cc: abdelrahmanfekry375, andy, dawei.feng, gregkh, hansg, jianhao.xu,
linux-kernel, linux-media, linux-staging, mchehab, sakari.ailus,
zilin
In-Reply-To: <aiaCoV1DQKBx4ph6@stanley.mountain>
Hi Dan,
On Mon, Jun 08, 2026 at 11:51:45 +0300, Dan Carpenter wrote:
> The code is buggy, but this isn't the right fix.
>
> Here is generally the standard way to do error handling.
> https://staticthinking.wordpress.com/2022/04/28/free-the-last-thing-style/
>
> 1. An allocation should clean up it's own partial allocations. That
> should not be handled in the caller. 2. Every allocation function should
> have a mirror cleanup function.
>
> The atomisp_uninitialize_modules() function is just a dummy and was never
> actually implemented. The correct thing is to implement it.
Thanks for the review and the link to the error handling guidelines.
Thanks for the pointer. I'll update it in v2.
Thanks,
Dawei
^ permalink raw reply
* [PATCH] staging: media: atomisp: fix variable shadowing warnings
From: Rhys Tumelty @ 2026-06-08 15:16 UTC (permalink / raw)
To: Hans de Goede, Mauro Carvalho Chehab, Greg Kroah-Hartman
Cc: Andy Shevchenko, Sakari Ailus, Dan Carpenter, linux-media,
linux-staging, linux-kernel, Rhys Tumelty
Fix local variable shadowing warnings, flagged by a W=2
kernel build, due to -Werror=shadow.
In atomisp_css_stop(), an inner loop 'i' index shadows
an outer unsigned int i. Rename the inner loop index to 'k'
In ia_css_stream_create(), the block-local 'effective_res'
struct shadows an outer local declaration. Rename the
block scoped instance in the loop over pipes to
'pipe_effective_res' to clearly show context.
Signed-off-by: Rhys Tumelty <rhys@tumelty.co.uk>
---
.../media/atomisp/pci/atomisp_compat_css20.c | 6 +++---
drivers/staging/media/atomisp/pci/sh_css.c | 14 +++++++-------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
index be5f37f4a6fd..da945fddb5ea 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -1775,10 +1775,10 @@ void atomisp_css_stop(struct atomisp_sub_device *asd, bool in_reset)
if (!in_reset) {
struct atomisp_stream_env *stream_env;
- int i, j;
+ int k, j;
- for (i = 0; i < ATOMISP_INPUT_STREAM_NUM; i++) {
- stream_env = &asd->stream_env[i];
+ for (k = 0; k < ATOMISP_INPUT_STREAM_NUM; k++) {
+ stream_env = &asd->stream_env[k];
for (j = 0; j < IA_CSS_PIPE_ID_NUM; j++) {
ia_css_pipe_config_defaults(
&stream_env->pipe_configs[j]);
diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c
index cd1be313c758..44c77179abb8 100644
--- a/drivers/staging/media/atomisp/pci/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/sh_css.c
@@ -7971,22 +7971,22 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
}
for (i = 0; i < num_pipes; i++) {
- struct ia_css_resolution effective_res;
+ struct ia_css_resolution pipe_effective_res;
curr_pipe = pipes[i];
/* set current stream */
curr_pipe->stream = curr_stream;
/* take over effective info */
- effective_res = curr_pipe->config.input_effective_res;
- if (effective_res.height == 0 || effective_res.width == 0) {
- effective_res = curr_pipe->stream->config.input_config.effective_res;
+ pipe_effective_res = curr_pipe->config.input_effective_res;
+ if (pipe_effective_res.height == 0 || pipe_effective_res.width == 0) {
+ pipe_effective_res = curr_pipe->stream->config.input_config.effective_res;
- curr_pipe->config.input_effective_res = effective_res;
+ curr_pipe->config.input_effective_res = pipe_effective_res;
}
IA_CSS_LOG("effective_res=%dx%d",
- effective_res.width,
- effective_res.height);
+ pipe_effective_res.width,
+ pipe_effective_res.height);
}
err = ia_css_stream_isp_parameters_init(curr_stream);
--
2.54.0
^ permalink raw reply related
* [PATCH] staging: rtl8723bs: core: avoid NULL pointer dereference in c2h_wk_callback
From: Nikoloz Bakuradze @ 2026-06-08 19:06 UTC (permalink / raw)
To: Greg Kroah-Hartman, Khushal Chitturi, Archit Anant, Minu Jin,
Andy Shevchenko, Kees Cook, Hans de Goede, linux-staging,
linux-kernel
Cc: Nikoloz Bakuradze, stable
c2h_wk_callback() allocates a 16-byte buffer with kmalloc(GFP_ATOMIC)
when the c2h event needs to be read by the host. The existing guard
only wraps the read step, so on allocation failure the loop body falls
through with a NULL c2h_evt and dereferences it in rtw_hal_c2h_valid()
(via c2h_evt_valid() which reads buf->id).
Restructure the check into an early continue so the rest of the loop
iteration cannot be reached with a NULL pointer.
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable@vger.kernel.org
Signed-off-by: Nikoloz Bakuradze <nbakuradze28@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index c1185c25ed369..874970116f920 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -1702,12 +1702,12 @@ static void c2h_wk_callback(struct work_struct *work)
c2h_evt_clear(adapter);
} else {
c2h_evt = kmalloc(16, GFP_ATOMIC);
- if (c2h_evt) {
- /* This C2H event is not read, read & clear now */
- if (c2h_evt_read_88xx(adapter, c2h_evt) != _SUCCESS) {
- kfree(c2h_evt);
- continue;
- }
+ if (!c2h_evt)
+ continue;
+ /* This C2H event is not read, read & clear now */
+ if (c2h_evt_read_88xx(adapter, c2h_evt) != _SUCCESS) {
+ kfree(c2h_evt);
+ continue;
}
}
--
2.54.0
^ permalink raw reply related
* Re: [linux-5.10.y 1/3] HID: core: Add printk_ratelimited variants to hid_warn() etc
From: Sasha Levin @ 2026-06-09 0:51 UTC (permalink / raw)
To: lee, Jiri Kosina, Benjamin Tissoires, Viresh Kumar, Johan Hovold,
Alex Elder, Greg Kroah-Hartman, linux-input, linux-kernel,
greybus-dev, linux-staging
Cc: Sasha Levin, stable, Vicki Pfau, Jiri Kosina
In-Reply-To: <20260608100236.2781796-1-lee@kernel.org>
> [linux-5.10.y 1/3] HID: core: Add printk_ratelimited variants to hid_warn() etc
> [linux-5.10.y 2/3] HID: pass the buffer size to hid_report_raw_event
> [linux-5.10.y 3/3] HID: core: Fix size_t specifier in hid_report_raw_event()
Whole series queued for 5.10, thanks.
--
Thanks,
Sasha
^ permalink raw reply
* [PATCH] staging: sm750fb: make g_fbmode array const
From: Brock Haftner @ 2026-06-09 1:17 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, outreachy
Cc: linux-fbdev, linux-staging, linux-kernel, Brock Haftner
The g_fbmode array is a static array of constant strings, but the pointer
array itself is not marked as const. Fix the checkpatch.pl warning by
adding the const modifier to the array declaration.
Signed-off-by: Brock Haftner <brockhaftner@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 89c811e0806c..8f533f3b1b42 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -21,7 +21,7 @@
static int g_hwcursor = 1;
static int g_noaccel __ro_after_init;
static int g_nomtrr __ro_after_init;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
static const char *g_def_fbmode = "1024x768-32@60";
static char *g_settings;
static int g_dualview __ro_after_init;
--
2.54.0
^ permalink raw reply related
* Re: [PATCH] staging: sm750fb: make g_fbmode array const
From: Ahmet Sezgin Duran @ 2026-06-09 6:12 UTC (permalink / raw)
To: Brock Haftner, Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman,
outreachy
Cc: linux-fbdev, linux-staging, linux-kernel
In-Reply-To: <20260609011736.17401-1-brockhaftner@gmail.com>
On 6/9/26 4:17 AM, Brock Haftner wrote:
> The g_fbmode array is a static array of constant strings, but the pointer
> array itself is not marked as const. Fix the checkpatch.pl warning by
> adding the const modifier to the array declaration.
>
> Signed-off-by: Brock Haftner <brockhaftner@gmail.com>
> ---
> drivers/staging/sm750fb/sm750.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 89c811e0806c..8f533f3b1b42 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -21,7 +21,7 @@
> static int g_hwcursor = 1;
> static int g_noaccel __ro_after_init;
> static int g_nomtrr __ro_after_init;
> -static const char *g_fbmode[] = {NULL, NULL};
> +static const char * const g_fbmode[] = {NULL, NULL};
> static const char *g_def_fbmode = "1024x768-32@60";
> static char *g_settings;
> static int g_dualview __ro_after_init;
Did you compile this patch while enabling sm750fb driver in the config?
Regards,
Ahmet Sezgin Duran
^ permalink raw reply
* Re: [PATCH] staging: rtl8723bs: core: avoid NULL pointer dereference in c2h_wk_callback
From: Andy Shevchenko @ 2026-06-09 7:14 UTC (permalink / raw)
To: Nikoloz Bakuradze
Cc: Greg Kroah-Hartman, Khushal Chitturi, Archit Anant, Minu Jin,
Kees Cook, Hans de Goede, linux-staging, linux-kernel, stable
In-Reply-To: <20260608190700.85755-1-nbakuradze28@gmail.com>
On Mon, Jun 08, 2026 at 11:06:58PM +0400, Nikoloz Bakuradze wrote:
> c2h_wk_callback() allocates a 16-byte buffer with kmalloc(GFP_ATOMIC)
> when the c2h event needs to be read by the host. The existing guard
> only wraps the read step, so on allocation failure the loop body falls
> through with a NULL c2h_evt and dereferences it in rtw_hal_c2h_valid()
> (via c2h_evt_valid() which reads buf->id).
>
> Restructure the check into an early continue so the rest of the loop
> iteration cannot be reached with a NULL pointer.
Not sure if we need any Fixes tag. kmalloc(16) won't ever fail (otherwise
the system is already in the state when nothing can help).
...
> c2h_evt = kmalloc(16, GFP_ATOMIC);
> - if (c2h_evt) {
> - /* This C2H event is not read, read & clear now */
> - if (c2h_evt_read_88xx(adapter, c2h_evt) != _SUCCESS) {
> - kfree(c2h_evt);
> - continue;
> - }
> + if (!c2h_evt)
> + continue;
> + /* This C2H event is not read, read & clear now */
> + if (c2h_evt_read_88xx(adapter, c2h_evt) != _SUCCESS) {
> + kfree(c2h_evt);
> + continue;
It's too verbose way of saying
} else
continue;
here.
> }
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH] staging: media: atomisp: fix variable shadowing warnings
From: Andy Shevchenko @ 2026-06-09 10:42 UTC (permalink / raw)
To: Rhys Tumelty
Cc: Hans de Goede, Mauro Carvalho Chehab, Greg Kroah-Hartman,
Andy Shevchenko, Sakari Ailus, Dan Carpenter, linux-media,
linux-staging, linux-kernel
In-Reply-To: <20260608151617.3393471-1-rhys@tumelty.co.uk>
On Mon, Jun 8, 2026 at 6:16 PM Rhys Tumelty <rhys@tumelty.co.uk> wrote:
>
> Fix local variable shadowing warnings, flagged by a W=2
> kernel build, due to -Werror=shadow.
>
> In atomisp_css_stop(), an inner loop 'i' index shadows
> an outer unsigned int i. Rename the inner loop index to 'k'
>
> In ia_css_stream_create(), the block-local 'effective_res'
> struct shadows an outer local declaration. Rename the
> block scoped instance in the loop over pipes to
> 'pipe_effective_res' to clearly show context.
Before even looking towards (some of) the W=2 warnings, please pay
attention to the real issues the driver has.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH] staging: rtl8723bs: core: avoid NULL pointer dereference in c2h_wk_callback
From: nika bakuradze @ 2026-06-09 16:40 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Greg Kroah-Hartman, Khushal Chitturi, Archit Anant, Minu Jin,
Kees Cook, Hans de Goede, linux-staging, linux-kernel, stable
In-Reply-To: <aie9bqpiNDJ_IU0M@ashevche-desk.local>
You're right, kmalloc(16) effectively won't fail. This is my first
kernel patch so I was being overcautious with the framing.
Should I resend v2 with the else continue form you suggested,
or drop the patch entirely?
Regards,
Nikoloz Bakuradze
On Tue, Jun 9, 2026 at 11:15 AM Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
>
> On Mon, Jun 08, 2026 at 11:06:58PM +0400, Nikoloz Bakuradze wrote:
> > c2h_wk_callback() allocates a 16-byte buffer with kmalloc(GFP_ATOMIC)
> > when the c2h event needs to be read by the host. The existing guard
> > only wraps the read step, so on allocation failure the loop body falls
> > through with a NULL c2h_evt and dereferences it in rtw_hal_c2h_valid()
> > (via c2h_evt_valid() which reads buf->id).
> >
> > Restructure the check into an early continue so the rest of the loop
> > iteration cannot be reached with a NULL pointer.
>
>
> Not sure if we need any Fixes tag. kmalloc(16) won't ever fail (otherwise
> the system is already in the state when nothing can help).
>
> ...
>
> > c2h_evt = kmalloc(16, GFP_ATOMIC);
> > - if (c2h_evt) {
> > - /* This C2H event is not read, read & clear now */
> > - if (c2h_evt_read_88xx(adapter, c2h_evt) != _SUCCESS) {
> > - kfree(c2h_evt);
> > - continue;
> > - }
>
> > + if (!c2h_evt)
> > + continue;
> > + /* This C2H event is not read, read & clear now */
> > + if (c2h_evt_read_88xx(adapter, c2h_evt) != _SUCCESS) {
> > + kfree(c2h_evt);
> > + continue;
>
> It's too verbose way of saying
>
> } else
> continue;
>
> here.
>
> > }
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
^ permalink raw reply
* Re: [PATCH] staging: rtl8723bs: core: avoid NULL pointer dereference in c2h_wk_callback
From: Andy Shevchenko @ 2026-06-09 18:05 UTC (permalink / raw)
To: nika bakuradze
Cc: Greg Kroah-Hartman, Khushal Chitturi, Archit Anant, Minu Jin,
Kees Cook, Hans de Goede, linux-staging, linux-kernel, stable
In-Reply-To: <CAHyzTT3R-cOpJdE=hKPGSBSdC-BiY29y40DURvKjCN4V+w5EAg@mail.gmail.com>
On Tue, Jun 09, 2026 at 08:40:39PM +0400, nika bakuradze wrote:
First of all, do not top-post!
> You're right, kmalloc(16) effectively won't fail. This is my first
> kernel patch so I was being overcautious with the framing.
>
> Should I resend v2 with the else continue form you suggested,
> or drop the patch entirely?
To some extent the patch makes sense (at least for you to train your skills in
Linux kernel processes, et cetera). I would go with the v2 that uses my approach.
Also drop Fixes tag, consider this as an improvement to make code robust.
> On Tue, Jun 9, 2026 at 11:15 AM Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> > On Mon, Jun 08, 2026 at 11:06:58PM +0400, Nikoloz Bakuradze wrote:
> > > c2h_wk_callback() allocates a 16-byte buffer with kmalloc(GFP_ATOMIC)
> > > when the c2h event needs to be read by the host. The existing guard
> > > only wraps the read step, so on allocation failure the loop body falls
> > > through with a NULL c2h_evt and dereferences it in rtw_hal_c2h_valid()
> > > (via c2h_evt_valid() which reads buf->id).
> > >
> > > Restructure the check into an early continue so the rest of the loop
> > > iteration cannot be reached with a NULL pointer.
> >
> >
> > Not sure if we need any Fixes tag. kmalloc(16) won't ever fail (otherwise
> > the system is already in the state when nothing can help).
...
> > > c2h_evt = kmalloc(16, GFP_ATOMIC);
> > > - if (c2h_evt) {
> > > - /* This C2H event is not read, read & clear now */
> > > - if (c2h_evt_read_88xx(adapter, c2h_evt) != _SUCCESS) {
> > > - kfree(c2h_evt);
> > > - continue;
> > > - }
> >
> > > + if (!c2h_evt)
> > > + continue;
> > > + /* This C2H event is not read, read & clear now */
> > > + if (c2h_evt_read_88xx(adapter, c2h_evt) != _SUCCESS) {
> > > + kfree(c2h_evt);
> > > + continue;
> >
> > It's too verbose way of saying
> >
> > } else
> > continue;
> >
> > here.
> >
> > > }
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH] media: atomisp: Fix local variable shadowing warnings
From: Rhys Tumelty @ 2026-06-09 20:09 UTC (permalink / raw)
To: andy.shevchenko
Cc: andy, dan.carpenter, gregkh, hansg, linux-kernel, linux-media,
linux-staging, mchehab, rhys, sakari.ailus
In-Reply-To: <CAHp75Ve3Cs95e4CLHDfO0_T=gSDa2tDBS+eZTAJoHxWd_zWMAA@mail.gmail.com>
On Tue, Jun 9, 2026 at 11:42 AM Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> Before even looking towards (some of) the W=2 warnings, please pay
> attention to the real issues the driver has.
Thanks for the feedback. I'm quite new to kernel development,
and I'm mainly just trying to get my footing on sending in
patches, currently starting with W=2. I'll have a look
at the TODOs or any known bugs to see if there are any minor
issues I can trust myself to help with.
Best regards,
Rhys
^ permalink raw reply
* [PATCH] staging: greybus: remove driver depending on nonexistent config option
From: Ethan Nelson-Moore @ 2026-06-09 20:26 UTC (permalink / raw)
To: greybus-dev, linux-staging, linux-kernel
Cc: Johan Hovold, Alex Elder, Greg Kroah-Hartman, Ethan Nelson-Moore,
Jakub Kicinski, Namjae Jeon
The Greybus Arche Platform driver depends on the config option
USB_HSIC_USB3613, which has never existed in mainline Linux. Therefore,
it is impossible for anyone to be using it with unmodified mainline
kernels. Remove it and move the former maintainer to the CREDITS file.
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
CREDITS | 4 +
MAINTAINERS | 7 -
drivers/staging/greybus/Kconfig | 9 -
drivers/staging/greybus/Makefile | 6 -
drivers/staging/greybus/arche-apb-ctrl.c | 491 -----------------
drivers/staging/greybus/arche-platform.c | 653 -----------------------
drivers/staging/greybus/arche_platform.h | 28 -
7 files changed, 4 insertions(+), 1194 deletions(-)
delete mode 100644 drivers/staging/greybus/arche-apb-ctrl.c
delete mode 100644 drivers/staging/greybus/arche-platform.c
delete mode 100644 drivers/staging/greybus/arche_platform.h
diff --git a/CREDITS b/CREDITS
index 17962bdd6dbd..19a493aceabf 100644
--- a/CREDITS
+++ b/CREDITS
@@ -1701,6 +1701,10 @@ S: Talstr. 1
S: D - 72072 Tuebingen
S: Germany
+N: Vaibhav Hiremath
+E: hvaibhav.linux@gmail.com
+D: Greybus Arche Platform driver
+
N: Richard Hirst
E: richard@sleepie.demon.co.uk
E: rhirst@linuxcare.com
diff --git a/MAINTAINERS b/MAINTAINERS
index e035a3be797c..2461e8a6a45a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11122,13 +11122,6 @@ M: Bryan O'Donoghue <pure.logic@nexus-software.ie>
S: Maintained
F: drivers/staging/greybus/loopback.c
-GREYBUS PLATFORM DRIVERS
-M: Vaibhav Hiremath <hvaibhav.linux@gmail.com>
-S: Maintained
-F: drivers/staging/greybus/arche-apb-ctrl.c
-F: drivers/staging/greybus/arche-platform.c
-F: drivers/staging/greybus/arche_platform.h
-
GREYBUS SDIO/GPIO/SPI PROTOCOLS DRIVERS
M: Rui Miguel Silva <rmfrfs@gmail.com>
S: Maintained
diff --git a/drivers/staging/greybus/Kconfig b/drivers/staging/greybus/Kconfig
index 7635f3e850fa..c25da61570eb 100644
--- a/drivers/staging/greybus/Kconfig
+++ b/drivers/staging/greybus/Kconfig
@@ -204,13 +204,4 @@ config GREYBUS_USB
endif # GREYBUS_BRIDGED_PHY
-config GREYBUS_ARCHE
- tristate "Greybus Arche Platform driver"
- depends on USB_HSIC_USB3613 || COMPILE_TEST
- help
- Select this option if you have an Arche device.
-
- To compile this code as a module, chose M here: the module
- will be called gb-arche.ko
-
endif # GREYBUS
diff --git a/drivers/staging/greybus/Makefile b/drivers/staging/greybus/Makefile
index 7c5e89622334..7b9807f8a1a3 100644
--- a/drivers/staging/greybus/Makefile
+++ b/drivers/staging/greybus/Makefile
@@ -65,9 +65,3 @@ obj-$(CONFIG_GREYBUS_SDIO) += gb-sdio.o
obj-$(CONFIG_GREYBUS_SPI) += gb-spi.o gb-spilib.o
obj-$(CONFIG_GREYBUS_UART) += gb-uart.o
obj-$(CONFIG_GREYBUS_USB) += gb-usb.o
-
-
-# Greybus Platform driver
-gb-arche-y := arche-platform.o arche-apb-ctrl.o
-
-obj-$(CONFIG_GREYBUS_ARCHE) += gb-arche.o
diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c
deleted file mode 100644
index 19a6e59b6d5c..000000000000
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ /dev/null
@@ -1,491 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Arche Platform driver to control APB.
- *
- * Copyright 2014-2015 Google Inc.
- * Copyright 2014-2015 Linaro Ltd.
- */
-
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/gpio/consumer.h>
-#include <linux/interrupt.h>
-#include <linux/module.h>
-#include <linux/pinctrl/consumer.h>
-#include <linux/platform_device.h>
-#include <linux/pm.h>
-#include <linux/property.h>
-#include <linux/regulator/consumer.h>
-#include <linux/spinlock.h>
-#include <linux/mod_devicetable.h>
-#include "arche_platform.h"
-
-static void apb_bootret_deassert(struct device *dev);
-
-struct arche_apb_ctrl_drvdata {
- /* Control GPIO signals to and from AP <=> AP Bridges */
- struct gpio_desc *resetn;
- struct gpio_desc *boot_ret;
- struct gpio_desc *pwroff;
- struct gpio_desc *wake_in;
- struct gpio_desc *wake_out;
- struct gpio_desc *pwrdn;
-
- enum arche_platform_state state;
- bool init_disabled;
-
- struct regulator *vcore;
- struct regulator *vio;
-
- struct gpio_desc *clk_en;
- struct clk *clk;
-
- struct pinctrl *pinctrl;
- struct pinctrl_state *pin_default;
-
- /* V2: SPI Bus control */
- struct gpio_desc *spi_en;
- bool spi_en_polarity_high;
-};
-
-/*
- * Note that these low level api's are active high
- */
-static inline void deassert_reset(struct gpio_desc *gpio)
-{
- gpiod_set_raw_value(gpio, 1);
-}
-
-static inline void assert_reset(struct gpio_desc *gpio)
-{
- gpiod_set_raw_value(gpio, 0);
-}
-
-/*
- * Note: Please do not modify the below sequence, as it is as per the spec
- */
-static int coldboot_seq(struct platform_device *pdev)
-{
- struct device *dev = &pdev->dev;
- struct arche_apb_ctrl_drvdata *apb = platform_get_drvdata(pdev);
- int ret;
-
- if (apb->init_disabled ||
- apb->state == ARCHE_PLATFORM_STATE_ACTIVE)
- return 0;
-
- /* Hold APB in reset state */
- assert_reset(apb->resetn);
-
- if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && apb->spi_en)
- devm_gpiod_put(dev, apb->spi_en);
-
- /* Enable power to APB */
- if (!IS_ERR(apb->vcore)) {
- ret = regulator_enable(apb->vcore);
- if (ret) {
- dev_err(dev, "failed to enable core regulator\n");
- return ret;
- }
- }
-
- if (!IS_ERR(apb->vio)) {
- ret = regulator_enable(apb->vio);
- if (ret) {
- dev_err(dev, "failed to enable IO regulator\n");
- return ret;
- }
- }
-
- apb_bootret_deassert(dev);
-
- /* On DB3 clock was not mandatory */
- if (apb->clk_en)
- gpiod_set_value(apb->clk_en, 1);
-
- usleep_range(100, 200);
-
- /* deassert reset to APB : Active-low signal */
- deassert_reset(apb->resetn);
-
- apb->state = ARCHE_PLATFORM_STATE_ACTIVE;
-
- return 0;
-}
-
-static int fw_flashing_seq(struct platform_device *pdev)
-{
- struct device *dev = &pdev->dev;
- struct arche_apb_ctrl_drvdata *apb = platform_get_drvdata(pdev);
- int ret;
-
- if (apb->init_disabled ||
- apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING)
- return 0;
-
- ret = regulator_enable(apb->vcore);
- if (ret) {
- dev_err(dev, "failed to enable core regulator\n");
- return ret;
- }
-
- ret = regulator_enable(apb->vio);
- if (ret) {
- dev_err(dev, "failed to enable IO regulator\n");
- return ret;
- }
-
- if (apb->spi_en) {
- unsigned long flags;
-
- if (apb->spi_en_polarity_high)
- flags = GPIOD_OUT_HIGH;
- else
- flags = GPIOD_OUT_LOW;
-
- apb->spi_en = devm_gpiod_get(dev, "spi-en", flags);
- if (IS_ERR(apb->spi_en)) {
- ret = PTR_ERR(apb->spi_en);
- dev_err(dev, "Failed requesting SPI bus en GPIO: %d\n",
- ret);
- return ret;
- }
- }
-
- /* for flashing device should be in reset state */
- assert_reset(apb->resetn);
- apb->state = ARCHE_PLATFORM_STATE_FW_FLASHING;
-
- return 0;
-}
-
-static int standby_boot_seq(struct platform_device *pdev)
-{
- struct device *dev = &pdev->dev;
- struct arche_apb_ctrl_drvdata *apb = platform_get_drvdata(pdev);
-
- if (apb->init_disabled)
- return 0;
-
- /*
- * Even if it is in OFF state,
- * then we do not want to change the state
- */
- if (apb->state == ARCHE_PLATFORM_STATE_STANDBY ||
- apb->state == ARCHE_PLATFORM_STATE_OFF)
- return 0;
-
- if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && apb->spi_en)
- devm_gpiod_put(dev, apb->spi_en);
-
- /*
- * As per WDM spec, do nothing
- *
- * Pasted from WDM spec,
- * - A falling edge on POWEROFF_L is detected (a)
- * - WDM enters standby mode, but no output signals are changed
- */
-
- /* TODO: POWEROFF_L is input to WDM module */
- apb->state = ARCHE_PLATFORM_STATE_STANDBY;
- return 0;
-}
-
-static void poweroff_seq(struct platform_device *pdev)
-{
- struct device *dev = &pdev->dev;
- struct arche_apb_ctrl_drvdata *apb = platform_get_drvdata(pdev);
-
- if (apb->init_disabled || apb->state == ARCHE_PLATFORM_STATE_OFF)
- return;
-
- if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && apb->spi_en)
- devm_gpiod_put(dev, apb->spi_en);
-
- /* disable the clock */
- if (apb->clk_en)
- gpiod_set_value(apb->clk_en, 0);
-
- if (!IS_ERR(apb->vcore) && regulator_is_enabled(apb->vcore) > 0)
- regulator_disable(apb->vcore);
-
- if (!IS_ERR(apb->vio) && regulator_is_enabled(apb->vio) > 0)
- regulator_disable(apb->vio);
-
- /* As part of exit, put APB back in reset state */
- assert_reset(apb->resetn);
- apb->state = ARCHE_PLATFORM_STATE_OFF;
-
- /* TODO: May have to send an event to SVC about this exit */
-}
-
-static void apb_bootret_deassert(struct device *dev)
-{
- struct arche_apb_ctrl_drvdata *apb = dev_get_drvdata(dev);
-
- gpiod_set_value(apb->boot_ret, 0);
-}
-
-int apb_ctrl_coldboot(struct device *dev)
-{
- return coldboot_seq(to_platform_device(dev));
-}
-
-int apb_ctrl_fw_flashing(struct device *dev)
-{
- return fw_flashing_seq(to_platform_device(dev));
-}
-
-int apb_ctrl_standby_boot(struct device *dev)
-{
- return standby_boot_seq(to_platform_device(dev));
-}
-
-void apb_ctrl_poweroff(struct device *dev)
-{
- poweroff_seq(to_platform_device(dev));
-}
-
-static ssize_t state_store(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct platform_device *pdev = to_platform_device(dev);
- struct arche_apb_ctrl_drvdata *apb = platform_get_drvdata(pdev);
- int ret = 0;
- bool is_disabled;
-
- if (sysfs_streq(buf, "off")) {
- if (apb->state == ARCHE_PLATFORM_STATE_OFF)
- return count;
-
- poweroff_seq(pdev);
- } else if (sysfs_streq(buf, "active")) {
- if (apb->state == ARCHE_PLATFORM_STATE_ACTIVE)
- return count;
-
- poweroff_seq(pdev);
- is_disabled = apb->init_disabled;
- apb->init_disabled = false;
- ret = coldboot_seq(pdev);
- if (ret)
- apb->init_disabled = is_disabled;
- } else if (sysfs_streq(buf, "standby")) {
- if (apb->state == ARCHE_PLATFORM_STATE_STANDBY)
- return count;
-
- ret = standby_boot_seq(pdev);
- } else if (sysfs_streq(buf, "fw_flashing")) {
- if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING)
- return count;
-
- /*
- * First we want to make sure we power off everything
- * and then enter FW flashing state
- */
- poweroff_seq(pdev);
- ret = fw_flashing_seq(pdev);
- } else {
- dev_err(dev, "unknown state\n");
- ret = -EINVAL;
- }
-
- return ret ? ret : count;
-}
-
-static ssize_t state_show(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- struct arche_apb_ctrl_drvdata *apb = dev_get_drvdata(dev);
-
- switch (apb->state) {
- case ARCHE_PLATFORM_STATE_OFF:
- return sysfs_emit(buf, "off%s\n",
- apb->init_disabled ? ",disabled" : "");
- case ARCHE_PLATFORM_STATE_ACTIVE:
- return sysfs_emit(buf, "active\n");
- case ARCHE_PLATFORM_STATE_STANDBY:
- return sysfs_emit(buf, "standby\n");
- case ARCHE_PLATFORM_STATE_FW_FLASHING:
- return sysfs_emit(buf, "fw_flashing\n");
- default:
- return sysfs_emit(buf, "unknown state\n");
- }
-}
-
-static DEVICE_ATTR_RW(state);
-
-static int apb_ctrl_get_fw_data(struct platform_device *pdev,
- struct arche_apb_ctrl_drvdata *apb)
-{
- struct device *dev = &pdev->dev;
- int ret;
-
- apb->resetn = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
- if (IS_ERR(apb->resetn)) {
- ret = PTR_ERR(apb->resetn);
- dev_err(dev, "Failed requesting reset GPIO: %d\n", ret);
- return ret;
- }
-
- apb->boot_ret = devm_gpiod_get(dev, "boot-ret", GPIOD_OUT_LOW);
- if (IS_ERR(apb->boot_ret)) {
- ret = PTR_ERR(apb->boot_ret);
- dev_err(dev, "Failed requesting bootret GPIO: %d\n", ret);
- return ret;
- }
-
- /* It's not mandatory to support power management interface */
- apb->pwroff = devm_gpiod_get_optional(dev, "pwr-off", GPIOD_IN);
- if (IS_ERR(apb->pwroff)) {
- ret = PTR_ERR(apb->pwroff);
- dev_err(dev, "Failed requesting pwroff_n GPIO: %d\n", ret);
- return ret;
- }
-
- /* Do not make clock mandatory as of now (for DB3) */
- apb->clk_en = devm_gpiod_get_optional(dev, "clock-en", GPIOD_OUT_LOW);
- if (IS_ERR(apb->clk_en)) {
- ret = PTR_ERR(apb->clk_en);
- dev_err(dev, "Failed requesting APB clock en GPIO: %d\n", ret);
- return ret;
- }
-
- apb->pwrdn = devm_gpiod_get(dev, "pwr-down", GPIOD_OUT_LOW);
- if (IS_ERR(apb->pwrdn)) {
- ret = PTR_ERR(apb->pwrdn);
- dev_warn(dev, "Failed requesting power down GPIO: %d\n", ret);
- return ret;
- }
-
- /* Regulators are optional, as we may have fixed supply coming in */
- apb->vcore = devm_regulator_get(dev, "vcore");
- if (IS_ERR(apb->vcore))
- dev_warn(dev, "no core regulator found\n");
-
- apb->vio = devm_regulator_get(dev, "vio");
- if (IS_ERR(apb->vio))
- dev_warn(dev, "no IO regulator found\n");
-
- apb->pinctrl = devm_pinctrl_get(&pdev->dev);
- if (IS_ERR(apb->pinctrl)) {
- dev_err(&pdev->dev, "could not get pinctrl handle\n");
- return PTR_ERR(apb->pinctrl);
- }
- apb->pin_default = pinctrl_lookup_state(apb->pinctrl, "default");
- if (IS_ERR(apb->pin_default)) {
- dev_err(&pdev->dev, "could not get default pin state\n");
- return PTR_ERR(apb->pin_default);
- }
-
- /* Only applicable for platform >= V2 */
- if (device_property_read_bool(&pdev->dev, "gb,spi-en-active-high"))
- apb->spi_en_polarity_high = true;
-
- return 0;
-}
-
-static int arche_apb_ctrl_probe(struct platform_device *pdev)
-{
- int ret;
- struct arche_apb_ctrl_drvdata *apb;
- struct device *dev = &pdev->dev;
-
- apb = devm_kzalloc(&pdev->dev, sizeof(*apb), GFP_KERNEL);
- if (!apb)
- return -ENOMEM;
-
- ret = apb_ctrl_get_fw_data(pdev, apb);
- if (ret) {
- dev_err(dev, "failed to get apb devicetree data %d\n", ret);
- return ret;
- }
-
- /* Initially set APB to OFF state */
- apb->state = ARCHE_PLATFORM_STATE_OFF;
- /* Check whether device needs to be enabled on boot */
- if (device_property_read_bool(&pdev->dev, "arche,init-disable"))
- apb->init_disabled = true;
-
- platform_set_drvdata(pdev, apb);
-
- /* Create sysfs interface to allow user to change state dynamically */
- ret = device_create_file(dev, &dev_attr_state);
- if (ret) {
- dev_err(dev, "failed to create state file in sysfs\n");
- return ret;
- }
-
- dev_info(&pdev->dev, "Device registered successfully\n");
- return 0;
-}
-
-static void arche_apb_ctrl_remove(struct platform_device *pdev)
-{
- device_remove_file(&pdev->dev, &dev_attr_state);
- poweroff_seq(pdev);
- platform_set_drvdata(pdev, NULL);
-}
-
-static int __maybe_unused arche_apb_ctrl_suspend(struct device *dev)
-{
- /*
- * If timing profile permits, we may shutdown bridge
- * completely
- *
- * TODO: sequence ??
- *
- * Also, need to make sure we meet precondition for unipro suspend
- * Precondition: Definition ???
- */
- return 0;
-}
-
-static int __maybe_unused arche_apb_ctrl_resume(struct device *dev)
-{
- /*
- * At least for ES2 we have to meet the delay requirement between
- * unipro switch and AP bridge init, depending on whether bridge is in
- * OFF state or standby state.
- *
- * Based on whether bridge is in standby or OFF state we may have to
- * assert multiple signals. Please refer to WDM spec, for more info.
- *
- */
- return 0;
-}
-
-static void arche_apb_ctrl_shutdown(struct platform_device *pdev)
-{
- apb_ctrl_poweroff(&pdev->dev);
-}
-
-static SIMPLE_DEV_PM_OPS(arche_apb_ctrl_pm_ops, arche_apb_ctrl_suspend,
- arche_apb_ctrl_resume);
-
-static const struct of_device_id arche_apb_ctrl_of_match[] = {
- { .compatible = "usbffff,2", },
- { },
-};
-MODULE_DEVICE_TABLE(of, arche_apb_ctrl_of_match);
-
-static struct platform_driver arche_apb_ctrl_device_driver = {
- .probe = arche_apb_ctrl_probe,
- .remove = arche_apb_ctrl_remove,
- .shutdown = arche_apb_ctrl_shutdown,
- .driver = {
- .name = "arche-apb-ctrl",
- .pm = &arche_apb_ctrl_pm_ops,
- .of_match_table = arche_apb_ctrl_of_match,
- }
-};
-
-int __init arche_apb_init(void)
-{
- return platform_driver_register(&arche_apb_ctrl_device_driver);
-}
-
-void __exit arche_apb_exit(void)
-{
- platform_driver_unregister(&arche_apb_ctrl_device_driver);
-}
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
deleted file mode 100644
index de5de59ea8ab..000000000000
--- a/drivers/staging/greybus/arche-platform.c
+++ /dev/null
@@ -1,653 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Arche Platform driver to enable Unipro link.
- *
- * Copyright 2014-2015 Google Inc.
- * Copyright 2014-2015 Linaro Ltd.
- */
-
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/gpio/consumer.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/of_platform.h>
-#include <linux/pinctrl/consumer.h>
-#include <linux/platform_device.h>
-#include <linux/pm.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/suspend.h>
-#include <linux/time.h>
-#include <linux/greybus.h>
-#include <linux/of.h>
-#include "arche_platform.h"
-
-#if IS_ENABLED(CONFIG_USB_HSIC_USB3613)
-#include <linux/usb/usb3613.h>
-#else
-static inline int usb3613_hub_mode_ctrl(bool unused)
-{
- return 0;
-}
-#endif
-
-#define WD_COLDBOOT_PULSE_WIDTH_MS 30
-
-enum svc_wakedetect_state {
- WD_STATE_IDLE, /* Default state = pulled high/low */
- WD_STATE_BOOT_INIT, /* WD = falling edge (low) */
- WD_STATE_COLDBOOT_TRIG, /* WD = rising edge (high), > 30msec */
- WD_STATE_STANDBYBOOT_TRIG, /* As of now not used ?? */
- WD_STATE_COLDBOOT_START, /* Cold boot process started */
- WD_STATE_STANDBYBOOT_START, /* Not used */
-};
-
-struct arche_platform_drvdata {
- /* Control GPIO signals to and from AP <=> SVC */
- struct gpio_desc *svc_reset;
- bool is_reset_act_hi;
- struct gpio_desc *svc_sysboot;
- struct gpio_desc *wake_detect; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME signals */
-
- enum arche_platform_state state;
-
- struct gpio_desc *svc_refclk_req;
- struct clk *svc_ref_clk;
-
- struct pinctrl *pinctrl;
- struct pinctrl_state *pin_default;
-
- int num_apbs;
-
- enum svc_wakedetect_state wake_detect_state;
- int wake_detect_irq;
- spinlock_t wake_lock; /* Protect wake_detect_state */
- struct mutex platform_state_mutex; /* Protect state */
- unsigned long wake_detect_start;
- struct notifier_block pm_notifier;
-
- struct device *dev;
-};
-
-/* Requires calling context to hold arche_pdata->platform_state_mutex */
-static void arche_platform_set_state(struct arche_platform_drvdata *arche_pdata,
- enum arche_platform_state state)
-{
- arche_pdata->state = state;
-}
-
-/* Requires arche_pdata->wake_lock is held by calling context */
-static void arche_platform_set_wake_detect_state(struct arche_platform_drvdata *arche_pdata,
- enum svc_wakedetect_state state)
-{
- arche_pdata->wake_detect_state = state;
-}
-
-static inline void svc_reset_onoff(struct gpio_desc *gpio, bool onoff)
-{
- gpiod_set_raw_value(gpio, onoff);
-}
-
-static int apb_cold_boot(struct device *dev, void *data)
-{
- int ret;
-
- ret = apb_ctrl_coldboot(dev);
- if (ret)
- dev_warn(dev, "failed to coldboot\n");
-
- /*Child nodes are independent, so do not exit coldboot operation */
- return 0;
-}
-
-static int apb_poweroff(struct device *dev, void *data)
-{
- apb_ctrl_poweroff(dev);
-
- /* Enable HUB3613 into HUB mode. */
- if (usb3613_hub_mode_ctrl(false))
- dev_warn(dev, "failed to control hub device\n");
-
- return 0;
-}
-
-static void arche_platform_wd_irq_en(struct arche_platform_drvdata *arche_pdata)
-{
- /* Enable interrupt here, to read event back from SVC */
- enable_irq(arche_pdata->wake_detect_irq);
-}
-
-static irqreturn_t arche_platform_wd_irq_thread(int irq, void *devid)
-{
- struct arche_platform_drvdata *arche_pdata = devid;
- unsigned long flags;
-
- spin_lock_irqsave(&arche_pdata->wake_lock, flags);
- if (arche_pdata->wake_detect_state != WD_STATE_COLDBOOT_TRIG) {
- /* Something is wrong */
- spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
- return IRQ_HANDLED;
- }
-
- arche_platform_set_wake_detect_state(arche_pdata,
- WD_STATE_COLDBOOT_START);
- spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
-
- /* It should complete power cycle, so first make sure it is poweroff */
- device_for_each_child(arche_pdata->dev, NULL, apb_poweroff);
-
- /* Bring APB out of reset: cold boot sequence */
- device_for_each_child(arche_pdata->dev, NULL, apb_cold_boot);
-
- /* Enable HUB3613 into HUB mode. */
- if (usb3613_hub_mode_ctrl(true))
- dev_warn(arche_pdata->dev, "failed to control hub device\n");
-
- spin_lock_irqsave(&arche_pdata->wake_lock, flags);
- arche_platform_set_wake_detect_state(arche_pdata, WD_STATE_IDLE);
- spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
-
- return IRQ_HANDLED;
-}
-
-static irqreturn_t arche_platform_wd_irq(int irq, void *devid)
-{
- struct arche_platform_drvdata *arche_pdata = devid;
- unsigned long flags;
-
- spin_lock_irqsave(&arche_pdata->wake_lock, flags);
-
- if (gpiod_get_value(arche_pdata->wake_detect)) {
- /* wake/detect rising */
-
- /*
- * If wake/detect line goes high after low, within less than
- * 30msec, then standby boot sequence is initiated, which is not
- * supported/implemented as of now. So ignore it.
- */
- if (arche_pdata->wake_detect_state == WD_STATE_BOOT_INIT) {
- if (time_before(jiffies,
- arche_pdata->wake_detect_start +
- msecs_to_jiffies(WD_COLDBOOT_PULSE_WIDTH_MS))) {
- arche_platform_set_wake_detect_state(arche_pdata,
- WD_STATE_IDLE);
- } else {
- /*
- * Check we are not in middle of irq thread
- * already
- */
- if (arche_pdata->wake_detect_state !=
- WD_STATE_COLDBOOT_START) {
- arche_platform_set_wake_detect_state(arche_pdata,
- WD_STATE_COLDBOOT_TRIG);
- spin_unlock_irqrestore(&arche_pdata->wake_lock,
- flags);
- return IRQ_WAKE_THREAD;
- }
- }
- }
- } else {
- /* wake/detect falling */
- if (arche_pdata->wake_detect_state == WD_STATE_IDLE) {
- arche_pdata->wake_detect_start = jiffies;
- /*
- * In the beginning, when wake/detect goes low
- * (first time), we assume it is meant for coldboot
- * and set the flag. If wake/detect line stays low
- * beyond 30msec, then it is coldboot else fallback
- * to standby boot.
- */
- arche_platform_set_wake_detect_state(arche_pdata,
- WD_STATE_BOOT_INIT);
- }
- }
-
- spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
-
- return IRQ_HANDLED;
-}
-
-/*
- * Requires arche_pdata->platform_state_mutex to be held
- */
-static int
-arche_platform_coldboot_seq(struct arche_platform_drvdata *arche_pdata)
-{
- int ret;
-
- if (arche_pdata->state == ARCHE_PLATFORM_STATE_ACTIVE)
- return 0;
-
- dev_info(arche_pdata->dev, "Booting from cold boot state\n");
-
- svc_reset_onoff(arche_pdata->svc_reset, arche_pdata->is_reset_act_hi);
-
- gpiod_set_value(arche_pdata->svc_sysboot, 0);
- usleep_range(100, 200);
-
- ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
- if (ret) {
- dev_err(arche_pdata->dev, "failed to enable svc_ref_clk: %d\n",
- ret);
- return ret;
- }
-
- /* bring SVC out of reset */
- svc_reset_onoff(arche_pdata->svc_reset, !arche_pdata->is_reset_act_hi);
-
- arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_ACTIVE);
-
- return 0;
-}
-
-/*
- * Requires arche_pdata->platform_state_mutex to be held
- */
-static int
-arche_platform_fw_flashing_seq(struct arche_platform_drvdata *arche_pdata)
-{
- int ret;
-
- if (arche_pdata->state == ARCHE_PLATFORM_STATE_FW_FLASHING)
- return 0;
-
- dev_info(arche_pdata->dev, "Switching to FW flashing state\n");
-
- svc_reset_onoff(arche_pdata->svc_reset, arche_pdata->is_reset_act_hi);
-
- gpiod_set_value(arche_pdata->svc_sysboot, 1);
-
- usleep_range(100, 200);
-
- ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
- if (ret) {
- dev_err(arche_pdata->dev, "failed to enable svc_ref_clk: %d\n",
- ret);
- return ret;
- }
-
- svc_reset_onoff(arche_pdata->svc_reset, !arche_pdata->is_reset_act_hi);
-
- arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_FW_FLASHING);
-
- return 0;
-}
-
-/*
- * Requires arche_pdata->platform_state_mutex to be held
- */
-static void
-arche_platform_poweroff_seq(struct arche_platform_drvdata *arche_pdata)
-{
- unsigned long flags;
-
- if (arche_pdata->state == ARCHE_PLATFORM_STATE_OFF)
- return;
-
- /* If in fw_flashing mode, then no need to repeate things again */
- if (arche_pdata->state != ARCHE_PLATFORM_STATE_FW_FLASHING) {
- disable_irq(arche_pdata->wake_detect_irq);
-
- spin_lock_irqsave(&arche_pdata->wake_lock, flags);
- arche_platform_set_wake_detect_state(arche_pdata,
- WD_STATE_IDLE);
- spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
- }
-
- clk_disable_unprepare(arche_pdata->svc_ref_clk);
-
- /* As part of exit, put APB back in reset state */
- svc_reset_onoff(arche_pdata->svc_reset, arche_pdata->is_reset_act_hi);
-
- arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_OFF);
-}
-
-static ssize_t state_store(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct arche_platform_drvdata *arche_pdata = dev_get_drvdata(dev);
- int ret = 0;
-
- mutex_lock(&arche_pdata->platform_state_mutex);
-
- if (sysfs_streq(buf, "off")) {
- if (arche_pdata->state == ARCHE_PLATFORM_STATE_OFF)
- goto exit;
-
- /* If SVC goes down, bring down APB's as well */
- device_for_each_child(arche_pdata->dev, NULL, apb_poweroff);
-
- arche_platform_poweroff_seq(arche_pdata);
-
- } else if (sysfs_streq(buf, "active")) {
- if (arche_pdata->state == ARCHE_PLATFORM_STATE_ACTIVE)
- goto exit;
-
- /* First we want to make sure we power off everything
- * and then activate back again
- */
- device_for_each_child(arche_pdata->dev, NULL, apb_poweroff);
- arche_platform_poweroff_seq(arche_pdata);
-
- arche_platform_wd_irq_en(arche_pdata);
- ret = arche_platform_coldboot_seq(arche_pdata);
- if (ret)
- goto exit;
-
- } else if (sysfs_streq(buf, "standby")) {
- if (arche_pdata->state == ARCHE_PLATFORM_STATE_STANDBY)
- goto exit;
-
- dev_warn(arche_pdata->dev, "standby state not supported\n");
- } else if (sysfs_streq(buf, "fw_flashing")) {
- if (arche_pdata->state == ARCHE_PLATFORM_STATE_FW_FLASHING)
- goto exit;
-
- /*
- * Here we only control SVC.
- *
- * In case of FW_FLASHING mode we do not want to control
- * APBs, as in case of V2, SPI bus is shared between both
- * the APBs. So let user chose which APB he wants to flash.
- */
- arche_platform_poweroff_seq(arche_pdata);
-
- ret = arche_platform_fw_flashing_seq(arche_pdata);
- if (ret)
- goto exit;
- } else {
- dev_err(arche_pdata->dev, "unknown state\n");
- ret = -EINVAL;
- }
-
-exit:
- mutex_unlock(&arche_pdata->platform_state_mutex);
- return ret ? ret : count;
-}
-
-static ssize_t state_show(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- struct arche_platform_drvdata *arche_pdata = dev_get_drvdata(dev);
-
- switch (arche_pdata->state) {
- case ARCHE_PLATFORM_STATE_OFF:
- return sysfs_emit(buf, "off\n");
- case ARCHE_PLATFORM_STATE_ACTIVE:
- return sysfs_emit(buf, "active\n");
- case ARCHE_PLATFORM_STATE_STANDBY:
- return sysfs_emit(buf, "standby\n");
- case ARCHE_PLATFORM_STATE_FW_FLASHING:
- return sysfs_emit(buf, "fw_flashing\n");
- default:
- return sysfs_emit(buf, "unknown state\n");
- }
-}
-
-static DEVICE_ATTR_RW(state);
-
-static int arche_platform_pm_notifier(struct notifier_block *notifier,
- unsigned long pm_event, void *unused)
-{
- struct arche_platform_drvdata *arche_pdata =
- container_of(notifier, struct arche_platform_drvdata,
- pm_notifier);
- int ret = NOTIFY_DONE;
-
- mutex_lock(&arche_pdata->platform_state_mutex);
- switch (pm_event) {
- case PM_SUSPEND_PREPARE:
- if (arche_pdata->state != ARCHE_PLATFORM_STATE_ACTIVE) {
- ret = NOTIFY_STOP;
- break;
- }
- device_for_each_child(arche_pdata->dev, NULL, apb_poweroff);
- arche_platform_poweroff_seq(arche_pdata);
- break;
- case PM_POST_SUSPEND:
- if (arche_pdata->state != ARCHE_PLATFORM_STATE_OFF)
- break;
-
- arche_platform_wd_irq_en(arche_pdata);
- arche_platform_coldboot_seq(arche_pdata);
- break;
- default:
- break;
- }
- mutex_unlock(&arche_pdata->platform_state_mutex);
-
- return ret;
-}
-
-static int arche_platform_probe(struct platform_device *pdev)
-{
- struct arche_platform_drvdata *arche_pdata;
- struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
- int ret;
- unsigned int flags;
-
- arche_pdata = devm_kzalloc(&pdev->dev, sizeof(*arche_pdata),
- GFP_KERNEL);
- if (!arche_pdata)
- return -ENOMEM;
-
- /* setup svc reset gpio */
- arche_pdata->is_reset_act_hi = of_property_read_bool(np,
- "svc,reset-active-high");
- if (arche_pdata->is_reset_act_hi)
- flags = GPIOD_OUT_HIGH;
- else
- flags = GPIOD_OUT_LOW;
-
- arche_pdata->svc_reset = devm_gpiod_get(dev, "svc,reset", flags);
- if (IS_ERR(arche_pdata->svc_reset)) {
- ret = PTR_ERR(arche_pdata->svc_reset);
- dev_err(dev, "failed to request svc-reset GPIO: %d\n", ret);
- return ret;
- }
- arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_OFF);
-
- arche_pdata->svc_sysboot = devm_gpiod_get(dev, "svc,sysboot",
- GPIOD_OUT_LOW);
- if (IS_ERR(arche_pdata->svc_sysboot)) {
- ret = PTR_ERR(arche_pdata->svc_sysboot);
- dev_err(dev, "failed to request sysboot0 GPIO: %d\n", ret);
- return ret;
- }
-
- /* setup the clock request gpio first */
- arche_pdata->svc_refclk_req = devm_gpiod_get(dev, "svc,refclk-req",
- GPIOD_IN);
- if (IS_ERR(arche_pdata->svc_refclk_req)) {
- ret = PTR_ERR(arche_pdata->svc_refclk_req);
- dev_err(dev, "failed to request svc-clk-req GPIO: %d\n", ret);
- return ret;
- }
-
- /* setup refclk2 to follow the pin */
- arche_pdata->svc_ref_clk = devm_clk_get(dev, "svc_ref_clk");
- if (IS_ERR(arche_pdata->svc_ref_clk)) {
- ret = PTR_ERR(arche_pdata->svc_ref_clk);
- dev_err(dev, "failed to get svc_ref_clk: %d\n", ret);
- return ret;
- }
-
- platform_set_drvdata(pdev, arche_pdata);
-
- arche_pdata->num_apbs = of_get_child_count(np);
- dev_dbg(dev, "Number of APB's available - %d\n", arche_pdata->num_apbs);
-
- arche_pdata->wake_detect = devm_gpiod_get(dev, "svc,wake-detect",
- GPIOD_IN);
- if (IS_ERR(arche_pdata->wake_detect)) {
- ret = PTR_ERR(arche_pdata->wake_detect);
- dev_err(dev, "Failed requesting wake_detect GPIO: %d\n", ret);
- return ret;
- }
-
- arche_platform_set_wake_detect_state(arche_pdata, WD_STATE_IDLE);
-
- arche_pdata->dev = &pdev->dev;
-
- spin_lock_init(&arche_pdata->wake_lock);
- mutex_init(&arche_pdata->platform_state_mutex);
- arche_pdata->wake_detect_irq =
- gpiod_to_irq(arche_pdata->wake_detect);
-
- ret = devm_request_threaded_irq(dev, arche_pdata->wake_detect_irq,
- arche_platform_wd_irq,
- arche_platform_wd_irq_thread,
- IRQF_TRIGGER_FALLING |
- IRQF_TRIGGER_RISING | IRQF_ONESHOT,
- dev_name(dev), arche_pdata);
- if (ret) {
- dev_err(dev, "failed to request wake detect IRQ %d\n", ret);
- return ret;
- }
- disable_irq(arche_pdata->wake_detect_irq);
-
- ret = device_create_file(dev, &dev_attr_state);
- if (ret) {
- dev_err(dev, "failed to create state file in sysfs\n");
- return ret;
- }
-
- ret = of_platform_populate(np, NULL, NULL, dev);
- if (ret) {
- dev_err(dev, "failed to populate child nodes %d\n", ret);
- goto err_device_remove;
- }
-
- arche_pdata->pm_notifier.notifier_call = arche_platform_pm_notifier;
- ret = register_pm_notifier(&arche_pdata->pm_notifier);
- if (ret) {
- dev_err(dev, "failed to register pm notifier %d\n", ret);
- goto err_depopulate;
- }
-
- /* Explicitly power off if requested */
- if (!of_property_read_bool(pdev->dev.of_node, "arche,init-off")) {
- mutex_lock(&arche_pdata->platform_state_mutex);
- ret = arche_platform_coldboot_seq(arche_pdata);
- if (ret) {
- mutex_unlock(&arche_pdata->platform_state_mutex);
- dev_err(dev, "Failed to cold boot svc %d\n", ret);
- goto err_unregister_pm_notifier;
- }
- arche_platform_wd_irq_en(arche_pdata);
- mutex_unlock(&arche_pdata->platform_state_mutex);
- }
-
- dev_info(dev, "Device registered successfully\n");
- return 0;
-
-err_unregister_pm_notifier:
- unregister_pm_notifier(&arche_pdata->pm_notifier);
-err_depopulate:
- of_platform_depopulate(dev);
-err_device_remove:
- device_remove_file(&pdev->dev, &dev_attr_state);
- return ret;
-}
-
-static void arche_platform_remove(struct platform_device *pdev)
-{
- struct arche_platform_drvdata *arche_pdata = platform_get_drvdata(pdev);
-
- unregister_pm_notifier(&arche_pdata->pm_notifier);
- device_remove_file(&pdev->dev, &dev_attr_state);
- of_platform_depopulate(&pdev->dev);
- arche_platform_poweroff_seq(arche_pdata);
-
- if (usb3613_hub_mode_ctrl(false))
- dev_warn(arche_pdata->dev, "failed to control hub device\n");
-}
-
-static __maybe_unused int arche_platform_suspend(struct device *dev)
-{
- /*
- * If timing profile permits, we may shutdown bridge
- * completely
- *
- * TODO: define shutdown sequence
- *
- * Also, need to make sure we meet precondition for unipro suspend
- * Precondition: Definition ???
- */
- return 0;
-}
-
-static __maybe_unused int arche_platform_resume(struct device *dev)
-{
- /*
- * At least for ES2 we have to meet the delay requirement between
- * unipro switch and AP bridge init, depending on whether bridge is in
- * OFF state or standby state.
- *
- * Based on whether bridge is in standby or OFF state we may have to
- * assert multiple signals. Please refer to WDM spec, for more info.
- *
- */
- return 0;
-}
-
-static void arche_platform_shutdown(struct platform_device *pdev)
-{
- struct arche_platform_drvdata *arche_pdata = platform_get_drvdata(pdev);
-
- arche_platform_poweroff_seq(arche_pdata);
-
- usb3613_hub_mode_ctrl(false);
-}
-
-static SIMPLE_DEV_PM_OPS(arche_platform_pm_ops,
- arche_platform_suspend,
- arche_platform_resume);
-
-static const struct of_device_id arche_platform_of_match[] = {
- /* Use PID/VID of SVC device */
- { .compatible = "google,arche-platform", },
- { },
-};
-MODULE_DEVICE_TABLE(of, arche_platform_of_match);
-
-static struct platform_driver arche_platform_device_driver = {
- .probe = arche_platform_probe,
- .remove = arche_platform_remove,
- .shutdown = arche_platform_shutdown,
- .driver = {
- .name = "arche-platform-ctrl",
- .pm = &arche_platform_pm_ops,
- .of_match_table = arche_platform_of_match,
- }
-};
-
-static int __init arche_init(void)
-{
- int retval;
-
- retval = platform_driver_register(&arche_platform_device_driver);
- if (retval)
- return retval;
-
- retval = arche_apb_init();
- if (retval)
- platform_driver_unregister(&arche_platform_device_driver);
-
- return retval;
-}
-module_init(arche_init);
-
-static void __exit arche_exit(void)
-{
- arche_apb_exit();
- platform_driver_unregister(&arche_platform_device_driver);
-}
-module_exit(arche_exit);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Vaibhav Hiremath <vaibhav.hiremath@linaro.org>");
-MODULE_DESCRIPTION("Arche Platform Driver");
diff --git a/drivers/staging/greybus/arche_platform.h b/drivers/staging/greybus/arche_platform.h
deleted file mode 100644
index 9d997f2d6517..000000000000
--- a/drivers/staging/greybus/arche_platform.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Arche Platform driver to enable Unipro link.
- *
- * Copyright 2015-2016 Google Inc.
- * Copyright 2015-2016 Linaro Ltd.
- */
-
-#ifndef __ARCHE_PLATFORM_H
-#define __ARCHE_PLATFORM_H
-
-enum arche_platform_state {
- ARCHE_PLATFORM_STATE_OFF,
- ARCHE_PLATFORM_STATE_ACTIVE,
- ARCHE_PLATFORM_STATE_STANDBY,
- ARCHE_PLATFORM_STATE_FW_FLASHING,
-};
-
-int __init arche_apb_init(void);
-void __exit arche_apb_exit(void);
-
-/* Operational states for the APB device */
-int apb_ctrl_coldboot(struct device *dev);
-int apb_ctrl_fw_flashing(struct device *dev);
-int apb_ctrl_standby_boot(struct device *dev);
-void apb_ctrl_poweroff(struct device *dev);
-
-#endif /* __ARCHE_PLATFORM_H */
--
2.43.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox