* Re: [PATCH v9 0/3] staging: rtl8723bs: fix several style issues in hal/sdio_halinit.c
From: Dan Carpenter @ 2026-05-29 7:40 UTC (permalink / raw)
To: artur.ugnivenko; +Cc: gregkh, ahmet, linux-kernel, linux-staging
In-Reply-To: <20260528170645.30861-1-artur.ugnivenko@gmx.de>
Looks okay to me now.
Reviewed-by: Dan Carpenter <error27@gmail.com>
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: Remove bouncing Intel media maintainers
From: Sakari Ailus @ 2026-05-28 19:06 UTC (permalink / raw)
To: Dave Stevenson
Cc: Dave Hansen, linux-kernel, Yong Zhi, Dan Scally,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Lixu Zhang,
linux-media, linux-staging, David Heidelberg
In-Reply-To: <CAPY8ntBFG=FzJdWjU+jnjx9k5H=pSyb9AVGiYwH+Kqu2kLMLTw@mail.gmail.com>
Hi Dave,
On Thu, May 28, 2026 at 11:21:47AM +0100, Dave Stevenson wrote:
> Hi Sakari & Dave
>
> On Wed, 27 May 2026 at 09:10, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> >
> > Hi Dave,
> >
> > On Tue, May 26, 2026 at 02:41:31PM -0700, Dave Hansen wrote:
> > > Tianshu Qiu and Bingbu Cao are maintainers and reviewers of a bunch of
> > > media drivers (7 and 9 respectively). Both of their emails are
> > > bouncing.
> > >
> > > Remove the bouncing entries and update driver status in cases where
> > > there are no M:'s left.
> >
> > I can pick at least some of these. I'll send v2.
>
> If Intel have no/limited interest in IMX355 any more, then I'm happy
> to step up as the maintainer as we have a customer looking to use it.
> I was going to add that as an extra patch to v2 of my recent patchset
> for it, but haven't sent it out yet.
>
> Based on recent commits I had pinged David Heidelberg (added to cc)
> and Richard Acayan too as other potential folk with an interest. David
> has agreed to be a reviewer, but Richard hasn't the spare capacity at
> present.
>
> I don't mind if you add that to your V2 of this set, or I'll try and
> get my v2 imx355 set out in the next week.
The sensor is present in a Chromebook and so I think there's some interest.
I'll add us both as M: and David as R: in v2.
--
Regards,
Sakari Ailus
^ permalink raw reply
* [PATCH] staging: rtl8723bs: clean up coding style in sdio_intf.c
From: Vitaliy Slivinskiy @ 2026-05-28 18:44 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, Vitaliy Slivinskiy
Fix checkpatch.pl warnings: remove unnecessary braces for single statement blocks, fix spacing around conditional operators, and remove multiple blank lines.
Signed-off-by: Vitaliy Slivinskiy <phant0m.mail2023@gmail.com>
---
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index d0feb28b7..17829b982 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -19,7 +19,7 @@ static const struct sdio_device_id sdio_ids[] = {
{ SDIO_DEVICE(0x024c, 0x0626), },
{ SDIO_DEVICE(0x024c, 0x0627), },
{ SDIO_DEVICE(0x024c, 0xb723), },
- { /* end: all zeroes */ },
+ { /* end: all zeroes */ },
};
MODULE_DEVICE_TABLE(sdio, sdio_ids);
@@ -47,7 +47,6 @@ static void sd_sync_int_hdl(struct sdio_func *func)
{
struct dvobj_priv *psdpriv;
-
psdpriv = sdio_get_drvdata(func);
if (!psdpriv->if1)
@@ -77,7 +76,7 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)
sdio_release_host(func);
- return err?_FAIL:_SUCCESS;
+ return err ? _FAIL : _SUCCESS;
}
static void sdio_free_irq(struct dvobj_priv *dvobj)
@@ -144,13 +143,13 @@ static void sdio_deinit(struct dvobj_priv *dvobj)
sdio_claim_host(func);
sdio_disable_func(func);
- if (dvobj->irq_alloc) {
+ if (dvobj->irq_alloc)
sdio_release_irq(func);
- }
sdio_release_host(func);
}
}
+
static struct dvobj_priv *sdio_dvobj_init(struct sdio_func *func)
{
struct dvobj_priv *dvobj = NULL;
@@ -216,8 +215,7 @@ static void sd_intf_stop(struct adapter *padapter)
rtw_hal_disable_interrupt(padapter);
}
-
-static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct sdio_device_id *pdid)
+static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct sdio_device_id *pdid)
{
int status = _FAIL;
struct net_device *pnetdev;
@@ -250,11 +248,9 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct
/* 4 3.1 set hardware operation functions */
rtw_set_hal_ops(padapter);
-
/* 3 5. initialize Chip version */
padapter->intf_start = &sd_intf_start;
padapter->intf_stop = &sd_intf_stop;
-
padapter->intf_init = &sdio_init;
padapter->intf_deinit = &sdio_deinit;
padapter->intf_alloc_irq = &sdio_alloc_irq;
@@ -336,9 +332,7 @@ static void rtw_sdio_if1_deinit(struct adapter *if1)
* notes: drv_init() is called when the bus driver has located a card for us to support.
* We accept the new device by returning 0.
*/
-static int rtw_drv_init(
- struct sdio_func *func,
- const struct sdio_device_id *id)
+static int rtw_drv_init(struct sdio_func *func, const struct sdio_device_id *id)
{
int status = _FAIL;
struct adapter *if1 = NULL;
--
2.53.0
^ permalink raw reply related
* [PATCH] staging: sm750fb: rename Bpp parameter to bpp
From: Gabry @ 2026-05-28 18:36 UTC (permalink / raw)
To: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com,
gregkh@linuxfoundation.org
Cc: linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
The Linux kernel coding style prefers snake_case over CamelCase foridentifier names.
Rename the 'Bpp' parameter (bytes per pixel) of sm750_hw_fillrect()
and sm750_hw_copyarea() to 'bpp' to comply with this standard. Update
the function prototypes in sm750_accel.h and the corresponding
kernel-doc descriptions accordingly.
This is a pure rename with no functional change, and addresses a
checkpatch.pl warning:
CHECK: Avoid CamelCase: <Bpp>
Signed-off-by: Gabriele Rizzo <gabry.256@proton.me>
---
drivers/staging/sm750fb/sm750_accel.c | 22 +++++++++++-----------
drivers/staging/sm750fb/sm750_accel.h | 6 +++---
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c
index 0f94d859e91c..4beabe1053f9 100644
--- a/drivers/staging/sm750fb/sm750_accel.c
+++ b/drivers/staging/sm750fb/sm750_accel.c
@@ -85,7 +85,7 @@ void sm750_hw_set2dformat(struct lynx_accel *accel, int fmt)
}
int sm750_hw_fillrect(struct lynx_accel *accel,
- u32 base, u32 pitch, u32 Bpp,
+ u32 base, u32 pitch, u32 bpp,
u32 x, u32 y, u32 width, u32 height,
u32 color, u32 rop)
{
@@ -102,14 +102,14 @@ int sm750_hw_fillrect(struct lynx_accel *accel,
write_dpr(accel, DE_WINDOW_DESTINATION_BASE, base); /* dpr40 */
write_dpr(accel, DE_PITCH,
- ((pitch / Bpp << DE_PITCH_DESTINATION_SHIFT) &
+ ((pitch / bpp << DE_PITCH_DESTINATION_SHIFT) &
DE_PITCH_DESTINATION_MASK) |
- (pitch / Bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */
+ (pitch / bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */
write_dpr(accel, DE_WINDOW_WIDTH,
- ((pitch / Bpp << DE_WINDOW_WIDTH_DST_SHIFT) &
+ ((pitch / bpp << DE_WINDOW_WIDTH_DST_SHIFT) &
DE_WINDOW_WIDTH_DST_MASK) |
- (pitch / Bpp & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr44 */
+ (pitch / bpp & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr44 */
write_dpr(accel, DE_FOREGROUND, color); /* DPR14 */
@@ -138,7 +138,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,
* @sy: Starting y coordinate of source surface
* @dest_base: Address of destination: offset in frame buffer
* @dest_pitch: Pitch value of destination surface in BYTE
- * @Bpp: Color depth of destination surface
+ * @bpp: Color depth of destination surface
* @dx: Starting x coordinate of destination surface
* @dy: Starting y coordinate of destination surface
* @width: width of rectangle in pixel value
@@ -149,7 +149,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,
unsigned int source_base, unsigned int source_pitch,
unsigned int sx, unsigned int sy,
unsigned int dest_base, unsigned int dest_pitch,
- unsigned int Bpp, unsigned int dx, unsigned int dy,
+ unsigned int bpp, unsigned int dx, unsigned int dy,
unsigned int width, unsigned int height,
unsigned int rop2)
{
@@ -249,9 +249,9 @@ int sm750_hw_copyarea(struct lynx_accel *accel,
* pixel values. Need Byte to pixel conversion.
*/
write_dpr(accel, DE_PITCH,
- ((dest_pitch / Bpp << DE_PITCH_DESTINATION_SHIFT) &
+ ((dest_pitch / bpp << DE_PITCH_DESTINATION_SHIFT) &
DE_PITCH_DESTINATION_MASK) |
- (source_pitch / Bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */
+ (source_pitch / bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */
/*
* Screen Window width in Pixels.
@@ -259,9 +259,9 @@ int sm750_hw_copyarea(struct lynx_accel *accel,
* for a given point.
*/
write_dpr(accel, DE_WINDOW_WIDTH,
- ((dest_pitch / Bpp << DE_WINDOW_WIDTH_DST_SHIFT) &
+ ((dest_pitch / bpp << DE_WINDOW_WIDTH_DST_SHIFT) &
DE_WINDOW_WIDTH_DST_MASK) |
- (source_pitch / Bpp & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr3c */
+ (source_pitch / bpp & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr3c */
if (accel->de_wait() != 0)
return -1;
diff --git a/drivers/staging/sm750fb/sm750_accel.h b/drivers/staging/sm750fb/sm750_accel.h
index 2c79cb730a0a..d15a40cacb84 100644
--- a/drivers/staging/sm750fb/sm750_accel.h
+++ b/drivers/staging/sm750fb/sm750_accel.h
@@ -190,7 +190,7 @@ void sm750_hw_set2dformat(struct lynx_accel *accel, int fmt);
void sm750_hw_de_init(struct lynx_accel *accel);
int sm750_hw_fillrect(struct lynx_accel *accel,
- u32 base, u32 pitch, u32 Bpp,
+ u32 base, u32 pitch, u32 bpp,
u32 x, u32 y, u32 width, u32 height,
u32 color, u32 rop);
@@ -202,7 +202,7 @@ int sm750_hw_fillrect(struct lynx_accel *accel,
* @sy: Starting y coordinate of source surface
* @dBase: Address of destination: offset in frame buffer
* @dPitch: Pitch value of destination surface in BYTE
- * @Bpp: Color depth of destination surface
+ * @bpp: Color depth of destination surface
* @dx: Starting x coordinate of destination surface
* @dy: Starting y coordinate of destination surface
* @width: width of rectangle in pixel value
@@ -213,7 +213,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel,
unsigned int sBase, unsigned int sPitch,
unsigned int sx, unsigned int sy,
unsigned int dBase, unsigned int dPitch,
- unsigned int Bpp, unsigned int dx, unsigned int dy,
+ unsigned int bpp, unsigned int dx, unsigned int dy,
unsigned int width, unsigned int height,
unsigned int rop2);
--
2.54.0
^ permalink raw reply related
* [PATCH v9 3/3] staging: rtl8723bs: refactor queue priority initialization
From: artur.ugnivenko @ 2026-05-28 18:07 UTC (permalink / raw)
To: gregkh; +Cc: ahmet, error27, linux-kernel, linux-staging, Artur Ugnivenko
In-Reply-To: <20260528170645.30861-1-artur.ugnivenko@gmx.de>
From: Artur Ugnivenko <artur.ugnivenko@gmx.de>
Pack individual priority values into an enum-indexed array
to simplify the initialization code and prevent passing around
six loose values as function parameters.
Signed-off-by: Artur Ugnivenko <artur.ugnivenko@gmx.de>
---
Changes in v9:
- don't declare variables in the middle of functions
- remove unnecessary whitespace
Changes in v8:
- Remove the struct from v7, use an enum-indexed array instead
- Remove other lines ending in parentheses fixes to keep the
commit small
Changes in v7:
- Add changelog.
- Add transmit_queues struct in include/drv_types.h to improve
style of _InitNormalChipRegPriority
Changes in v6: Make the patch apply to gregkh/staging-testing.
Changes in v5: No changes in this patch.
Changes in v4: No changes in this patch.
Changes in v3: Split the patch into multiple patches.
Changes in v2: Make patch apply to gregkh/staging-testing.
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 105 +++++++++---------
drivers/staging/rtl8723bs/include/drv_types.h | 10 ++
2 files changed, 62 insertions(+), 53 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index 6f2aea984b30..1246c5fdfc32 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -188,25 +188,18 @@ static void _InitTxBufferBoundary(struct adapter *padapter)
rtw_write8(padapter, REG_TDECTRL + 1, txpktbuf_bndy);
}
-static void _InitNormalChipRegPriority(
- struct adapter *Adapter,
- u16 beQ,
- u16 bkQ,
- u16 viQ,
- u16 voQ,
- u16 mgtQ,
- u16 hiQ
-)
+static void _InitNormalChipRegPriority(struct adapter *Adapter,
+ u16 queues[TX_Q_MAX])
{
u16 value16 = (rtw_read16(Adapter, REG_TRXDMA_CTRL) & 0x7);
value16 |=
- _TXDMA_BEQ_MAP(beQ) |
- _TXDMA_BKQ_MAP(bkQ) |
- _TXDMA_VIQ_MAP(viQ) |
- _TXDMA_VOQ_MAP(voQ) |
- _TXDMA_MGQ_MAP(mgtQ) |
- _TXDMA_HIQ_MAP(hiQ);
+ _TXDMA_BEQ_MAP(queues[TX_Q_BE]) |
+ _TXDMA_BKQ_MAP(queues[TX_Q_BK]) |
+ _TXDMA_VIQ_MAP(queues[TX_Q_VI]) |
+ _TXDMA_VOQ_MAP(queues[TX_Q_VO]) |
+ _TXDMA_MGQ_MAP(queues[TX_Q_MGT]) |
+ _TXDMA_HIQ_MAP(queues[TX_Q_HI]);
rtw_write16(Adapter, REG_TRXDMA_CTRL, value16);
}
@@ -214,6 +207,7 @@ static void _InitNormalChipRegPriority(
static void _InitNormalChipOneOutEpPriority(struct adapter *Adapter)
{
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
+ u16 queues[TX_Q_MAX];
u16 value = 0;
@@ -231,17 +225,19 @@ static void _InitNormalChipOneOutEpPriority(struct adapter *Adapter)
break;
}
- _InitNormalChipRegPriority(
- Adapter, value, value, value, value, value, value
- );
+ for (int i = 0; i < TX_Q_MAX; i++)
+ queues[i] = value;
+ _InitNormalChipRegPriority(Adapter, queues);
}
static void _InitNormalChipTwoOutEpPriority(struct adapter *Adapter)
{
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
struct registry_priv *pregistrypriv = &Adapter->registrypriv;
- u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ;
+
+ u16 typical_queues[TX_Q_MAX];
+ u16 wmm_queues[TX_Q_MAX];
u16 valueHi = 0;
u16 valueLow = 0;
@@ -263,50 +259,53 @@ static void _InitNormalChipTwoOutEpPriority(struct adapter *Adapter)
break;
}
+ typical_queues[TX_Q_BE] = valueLow;
+ typical_queues[TX_Q_BK] = valueLow;
+ typical_queues[TX_Q_VI] = valueHi;
+ typical_queues[TX_Q_VO] = valueHi;
+ typical_queues[TX_Q_MGT] = valueHi;
+ typical_queues[TX_Q_HI] = valueHi;
+
+ wmm_queues[TX_Q_BE] = valueLow;
+ wmm_queues[TX_Q_BK] = valueHi;
+ wmm_queues[TX_Q_VI] = valueHi;
+ wmm_queues[TX_Q_VO] = valueLow;
+ wmm_queues[TX_Q_MGT] = valueHi;
+ wmm_queues[TX_Q_HI] = valueHi;
+
if (!pregistrypriv->wifi_spec) {
- beQ = valueLow;
- bkQ = valueLow;
- viQ = valueHi;
- voQ = valueHi;
- mgtQ = valueHi;
- hiQ = valueHi;
+ _InitNormalChipRegPriority(Adapter, typical_queues);
} else {
/* for WMM , CONFIG_OUT_EP_WIFI_MODE */
- beQ = valueLow;
- bkQ = valueHi;
- viQ = valueHi;
- voQ = valueLow;
- mgtQ = valueHi;
- hiQ = valueHi;
+ _InitNormalChipRegPriority(Adapter, wmm_queues);
}
-
- _InitNormalChipRegPriority(Adapter, beQ, bkQ, viQ, voQ, mgtQ, hiQ);
-
}
static void _InitNormalChipThreeOutEpPriority(struct adapter *padapter)
{
struct registry_priv *pregistrypriv = &padapter->registrypriv;
- u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ;
- if (!pregistrypriv->wifi_spec) {
- /* typical setting */
- beQ = QUEUE_LOW;
- bkQ = QUEUE_LOW;
- viQ = QUEUE_NORMAL;
- voQ = QUEUE_HIGH;
- mgtQ = QUEUE_HIGH;
- hiQ = QUEUE_HIGH;
- } else {
- /* for WMM */
- beQ = QUEUE_LOW;
- bkQ = QUEUE_NORMAL;
- viQ = QUEUE_NORMAL;
- voQ = QUEUE_HIGH;
- mgtQ = QUEUE_HIGH;
- hiQ = QUEUE_HIGH;
- }
- _InitNormalChipRegPriority(padapter, beQ, bkQ, viQ, voQ, mgtQ, hiQ);
+ u16 typical_queues[TX_Q_MAX] = {
+ [TX_Q_BE] = QUEUE_LOW,
+ [TX_Q_BK] = QUEUE_LOW,
+ [TX_Q_VI] = QUEUE_NORMAL,
+ [TX_Q_VO] = QUEUE_HIGH,
+ [TX_Q_MGT] = QUEUE_HIGH,
+ [TX_Q_HI] = QUEUE_HIGH,
+ };
+ u16 wmm_queues[TX_Q_MAX] = {
+ [TX_Q_BE] = QUEUE_LOW,
+ [TX_Q_BK] = QUEUE_NORMAL,
+ [TX_Q_VI] = QUEUE_NORMAL,
+ [TX_Q_VO] = QUEUE_HIGH,
+ [TX_Q_MGT] = QUEUE_HIGH,
+ [TX_Q_HI] = QUEUE_HIGH,
+ };
+
+ if (!pregistrypriv->wifi_spec)
+ _InitNormalChipRegPriority(padapter, typical_queues);
+ else
+ _InitNormalChipRegPriority(padapter, wmm_queues);
}
static void _InitQueuePriority(struct adapter *Adapter)
diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
index 552d0c5fa47f..b2c43f53571a 100644
--- a/drivers/staging/rtl8723bs/include/drv_types.h
+++ b/drivers/staging/rtl8723bs/include/drv_types.h
@@ -373,6 +373,16 @@ struct adapter {
unsigned char in_cta_test;
};
+enum transmit_queues {
+ TX_Q_BE = 0,
+ TX_Q_BK,
+ TX_Q_VI,
+ TX_Q_VO,
+ TX_Q_MGT,
+ TX_Q_HI,
+ TX_Q_MAX,
+};
+
#define adapter_to_dvobj(adapter) (adapter->dvobj)
#define adapter_to_pwrctl(adapter) (dvobj_to_pwrctl(adapter->dvobj))
#define adapter_wdev_data(adapter) (&((adapter)->wdev_data))
--
2.54.0
^ permalink raw reply related
* [PATCH v9 2/3] staging: rtl8723bs: fix inconsistent braces in hal/sdio_halinit.c
From: artur.ugnivenko @ 2026-05-28 17:06 UTC (permalink / raw)
To: gregkh; +Cc: ahmet, error27, linux-kernel, linux-staging, Artur Ugnivenko
In-Reply-To: <20260528170645.30861-1-artur.ugnivenko@gmx.de>
From: Artur Ugnivenko <artur.ugnivenko@gmx.de>
Fix checkpatch warnings on inconsistent braces around if/else statements
in hal/sdio_halinit.c
Signed-off-by: Artur Ugnivenko <artur.ugnivenko@gmx.de>
---
Changes in v9: No changes in this patch.
Changes in v8: No changes in this patch.
Changes in v7: Add changelog.
Changes in v6: Make the patch apply to gregkh/staging-testing.
Changes in v5: No changes in this patch.
Changes in v4: Fix long line checkpatch warning.
Changes in v3: Split the patch into multiple patches.
Changes in v2: Make patch apply to gregkh/staging-testing.
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index 43f9c45967f4..6f2aea984b30 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -36,8 +36,9 @@ static u8 CardEnable(struct adapter *padapter)
bMacPwrCtrlOn = true;
rtw_hal_set_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
}
- } else
+ } else {
ret = _SUCCESS;
+ }
return ret;
}
@@ -1011,8 +1012,9 @@ static void Hal_EfuseParseBoardType_8723BS(
pHalData->BoardType = (hwinfo[EEPROM_RF_BOARD_OPTION_8723B] & 0xE0) >> 5;
if (pHalData->BoardType == 0xFF)
pHalData->BoardType = (EEPROM_DEFAULT_BOARD_OPTION & 0xE0) >> 5;
- } else
+ } else {
pHalData->BoardType = 0;
+ }
}
static void _ReadEfuseInfo8723BS(struct adapter *padapter)
--
2.54.0
^ permalink raw reply related
* [PATCH v9 1/3] staging: rtl8723bs: shorten long lines in hal/sdio_halinit.c
From: artur.ugnivenko @ 2026-05-28 17:06 UTC (permalink / raw)
To: gregkh; +Cc: ahmet, error27, linux-kernel, linux-staging, Artur Ugnivenko
In-Reply-To: <20260528170645.30861-1-artur.ugnivenko@gmx.de>
From: Artur Ugnivenko <artur.ugnivenko@gmx.de>
Fix checkpatch warnings on lines above 100 chars in length by splitting
long function calls and long comments into multiple lines.
Signed-off-by: Artur Ugnivenko <artur.ugnivenko@gmx.de>
---
Changes in v9: No changes in this patch.
Changes in v8: No changes in this patch.
Changes in v7: Add changelog.
Changes in v6: Make the patch apply to gregkh/staging-testing.
Changes in v5: No changes in this patch.
Changes in v4: No changes in this patch.
Changes in v3: Split the patch into multiple patches.
Changes in v2: Make the patch apply to gregkh/staging-testing.
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 52 ++++++++++++++++----
1 file changed, 42 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index ed9b8fb07fec..43f9c45967f4 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -27,7 +27,11 @@ static u8 CardEnable(struct adapter *padapter)
/* unlock ISO/CLK/Power control register */
rtw_write8(padapter, REG_RSV_CTRL, 0x0);
- ret = HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_enable_flow);
+ ret = HalPwrSeqCmdParsing(padapter,
+ PWR_CUT_ALL_MSK,
+ PWR_FAB_ALL_MSK,
+ PWR_INTF_SDIO_MSK,
+ rtl8723B_card_enable_flow);
if (ret == _SUCCESS) {
bMacPwrCtrlOn = true;
rtw_hal_set_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
@@ -104,7 +108,11 @@ u8 _InitPowerOn_8723BS(struct adapter *padapter)
}
/* Tx Page FIFO threshold */
-static void _init_available_page_threshold(struct adapter *padapter, u8 numHQ, u8 numNQ, u8 numLQ, u8 numPubQ)
+static void _init_available_page_threshold(struct adapter *padapter,
+ u8 numHQ,
+ u8 numNQ,
+ u8 numLQ,
+ u8 numPubQ)
{
u16 HQ_threshold, NQ_threshold, LQ_threshold;
@@ -781,7 +789,11 @@ u32 rtl8723bs_hal_init(struct adapter *padapter)
restore_iqk_rst = pwrpriv->bips_processing;
b2Ant = pHalData->EEPROMBluetoothAntNum == Ant_x2;
- PHY_IQCalibrate_8723B(padapter, false, restore_iqk_rst, b2Ant, pHalData->ant_path);
+ PHY_IQCalibrate_8723B(padapter,
+ false,
+ restore_iqk_rst,
+ b2Ant,
+ pHalData->ant_path);
pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized = true;
hal_btcoex_IQKNotify(padapter, false);
@@ -812,7 +824,11 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter)
u8 bMacPwrCtrlOn;
/* Run LPS WL RFOFF flow */
- HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_enter_lps_flow);
+ HalPwrSeqCmdParsing(padapter,
+ PWR_CUT_ALL_MSK,
+ PWR_FAB_ALL_MSK,
+ PWR_INTF_SDIO_MSK,
+ rtl8723B_enter_lps_flow);
/* ==== Reset digital sequence ====== */
@@ -841,7 +857,11 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter)
bMacPwrCtrlOn = false; /* Disable CMD53 R/W */
rtw_hal_set_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
- HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_disable_flow);
+ HalPwrSeqCmdParsing(padapter,
+ PWR_CUT_ALL_MSK,
+ PWR_FAB_ALL_MSK,
+ PWR_INTF_SDIO_MSK,
+ rtl8723B_card_disable_flow);
}
u32 rtl8723bs_hal_deinit(struct adapter *padapter)
@@ -853,7 +873,10 @@ u32 rtl8723bs_hal_deinit(struct adapter *padapter)
u8 val8 = 0;
rtl8723b_set_FwPwrModeInIPS_cmd(padapter, 0x3);
- /* poll 0x1cc to make sure H2C command already finished by FW; MAC_0x1cc = 0 means H2C done by FW. */
+ /*
+ * poll 0x1cc to make sure H2C command already finished by FW;
+ * MAC_0x1cc = 0 means H2C done by FW.
+ */
do {
val8 = rtw_read8(padapter, REG_HMETFR);
cnt++;
@@ -862,10 +885,13 @@ u32 rtl8723bs_hal_deinit(struct adapter *padapter)
/* H2C done, enter 32k */
if (val8 == 0) {
/* set rpwm to enter 32k */
- val8 = rtw_read8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HRPWM1);
+ val8 = rtw_read8(padapter,
+ SDIO_LOCAL_BASE | SDIO_REG_HRPWM1);
val8 += 0x80;
val8 |= BIT(0);
- rtw_write8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HRPWM1, val8);
+ rtw_write8(padapter,
+ SDIO_LOCAL_BASE | SDIO_REG_HRPWM1,
+ val8);
adapter_to_pwrctl(padapter)->tog = (val8 + 0x80) & 0x80;
cnt = val8 = 0;
do {
@@ -1063,8 +1089,14 @@ static s32 _ReadAdapterInfo8723BS(struct adapter *padapter)
_ReadPROMContent(padapter);
if (!padapter->hw_init_completed) {
- rtw_write8(padapter, 0x67, 0x00); /* for BT, Switch Ant control to BT */
- CardDisableRTL8723BSdio(padapter);/* for the power consumption issue, wifi ko module is loaded during booting, but wifi GUI is off */
+ /* for BT, Switch Ant control to BT */
+ rtw_write8(padapter, 0x67, 0x00);
+
+ /*
+ * for the power consumption issue, wifi ko module is loaded during booting,
+ * but wifi GUI is off
+ */
+ CardDisableRTL8723BSdio(padapter);
}
return _SUCCESS;
--
2.54.0
^ permalink raw reply related
* [PATCH v9 0/3] staging: rtl8723bs: fix several style issues in hal/sdio_halinit.c
From: artur.ugnivenko @ 2026-05-28 17:06 UTC (permalink / raw)
To: gregkh; +Cc: ahmet, error27, linux-kernel, linux-staging, Artur Ugnivenko
From: Artur Ugnivenko <artur.ugnivenko@gmx.de>
Fix the following checkpatch warnings in hal/sdio_halinit.c:
- lines longer than 100 chars
- inconsistent brackets around else statements
And refactor queue priority initialization in hal/sdio_halinit.c
to fix a "lines ending in parentheses" warning.
Changes in v9:
- don't declare variables in the middle of functions in 3/3
- remove unnecessary whitespace in 3/3
Changes in v8:
- Remove the struct from v7, use an array instead.
- Remove other "lines ending in parentheses" fixes to keep
3/3 small
Changes in v7:
- Remove whitespace patch.
- Add transmit_queues struct to improve style of
_InitNormalChipRegPriority
- Add changelog to individual patches.
Changes in v6: Make the patch series apply to gregkh/staging-testing.
Changes in v5: Added the entire changelog to the cover letter.
Changes in v4: Fixed the long line checkpatch warning in patch 2.
Changes in v3: Split the patch into multiple patches.
Changes in v2: Make the patch apply to gregkh/staging-testing.
Artur Ugnivenko (3):
staging: rtl8723bs: shorten long lines in hal/sdio_halinit.c
staging: rtl8723bs: fix inconsistent braces in hal/sdio_halinit.c
staging: rtl8723bs: refactor queue priority initialization
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 163 +++++++++++-------
drivers/staging/rtl8723bs/include/drv_types.h | 10 ++
2 files changed, 108 insertions(+), 65 deletions(-)
--
2.54.0
^ permalink raw reply
* Re: [PATCH 1/2] staging: sm750fb: rename pvReg to pv_reg
From: Dan Carpenter @ 2026-05-28 14:15 UTC (permalink / raw)
To: Onish Sharma
Cc: sudipm.mukherjee, gregkh, linux-staging, linux-fbdev,
linux-kernel
In-Reply-To: <20260528133627.10850-1-neharora23587@gmail.com>
On Thu, May 28, 2026 at 07:06:26PM +0530, Onish Sharma wrote:
> Rename pvReg to pv_reg to comply with kernel coding style (checkpatch.pl)
> and improve readability.
>
> Signed-off-by: Onish Sharma <neharora23587@gmail.com>
pv stands for pointer void. It's Hungarian notation and it's not
allowed.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 2/2] staging: sm750fb: rename setAllEngOff
From: Dan Carpenter @ 2026-05-28 14:14 UTC (permalink / raw)
To: Onish Sharma
Cc: sudipm.mukherjee, gregkh, linux-staging, linux-fbdev,
linux-kernel
In-Reply-To: <20260528133627.10850-2-neharora23587@gmail.com>
On Thu, May 28, 2026 at 07:06:27PM +0530, Onish Sharma wrote:
> Rename setAllEngOff to set_all_eng_off to comply with kernel coding style
> and improve readability.
>
> Signed-off-by: Onish Sharma <neharora23587@gmail.com>
> ---
> drivers/staging/sm750fb/sm750.c | 2 +-
> drivers/staging/sm750fb/sm750.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 8f01b3c63fe8..716a8935f58d 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -848,7 +848,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
> sm750_dev->init_parm.mem_clk = 0;
> sm750_dev->init_parm.master_clk = 0;
> sm750_dev->init_parm.power_mode = 0;
> - sm750_dev->init_parm.setAllEngOff = 0;
> + sm750_dev->init_parm.set_all_eng_off = 0;
> sm750_dev->init_parm.reset_memory = 1;
>
> /* defaultly turn g_hwcursor on for both view */
> diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
> index 0492b1afbb11..e8885133da2e 100644
> --- a/drivers/staging/sm750fb/sm750.h
> +++ b/drivers/staging/sm750fb/sm750.h
> @@ -44,7 +44,7 @@ struct init_status {
> ushort chip_clk;
> ushort mem_clk;
> ushort master_clk;
> - ushort setAllEngOff;
> + ushort set_all_eng_off;
> ushort reset_memory;
> };
There are no users? Why not just delete it.
regards,
dan carpenter
^ permalink raw reply
* [PATCH] staging: greybus: vibrator: return device_create() errors
From: Alfie Varghese @ 2026-05-28 13:52 UTC (permalink / raw)
To: Johan Hovold, Alex Elder, Greg Kroah-Hartman
Cc: greybus-dev, linux-staging, linux-kernel, Alfie Varghese
gb_vibrator_probe() maps any device_create() failure to -EINVAL. This
loses the real errno returned by the driver core, such as -ENOMEM, and
makes probe failures harder to diagnose correctly.
Return PTR_ERR(dev) instead so callers receive the actual failure reason
while preserving the existing cleanup path.
Signed-off-by: Alfie Varghese <alfievarghese22@gmail.com>
---
drivers/staging/greybus/vibrator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/vibrator.c b/drivers/staging/greybus/vibrator.c
index 0ec4d317c..763c234fb 100644
--- a/drivers/staging/greybus/vibrator.c
+++ b/drivers/staging/greybus/vibrator.c
@@ -161,7 +161,7 @@ static int gb_vibrator_probe(struct gb_bundle *bundle,
dev = device_create(&vibrator_class, &bundle->dev,
MKDEV(0, 0), vib, "vibrator%d", vib->minor);
if (IS_ERR(dev)) {
- retval = -EINVAL;
+ retval = PTR_ERR(dev);
goto err_ida_remove;
}
vib->dev = dev;
--
2.54.0.windows.1
^ permalink raw reply related
* [PATCH] staging: greybus: vibrator: return device_create() errors
From: Alfie Varghese @ 2026-05-28 13:51 UTC (permalink / raw)
To: Johan Hovold, Alex Elder, Greg Kroah-Hartman
Cc: greybus-dev, linux-staging, linux-kernel, Alfie Varghese
gb_vibrator_probe() maps any device_create() failure to -EINVAL. This
loses the real errno returned by the driver core, such as -ENOMEM, and
makes probe failures harder to diagnose correctly.
Return PTR_ERR(dev) instead so callers receive the actual failure reason
while preserving the existing cleanup path.
Signed-off-by: Alfie Varghese <alfievarghese22@gmail.com>
---
drivers/staging/greybus/vibrator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/vibrator.c b/drivers/staging/greybus/vibrator.c
index 0ec4d317c..763c234fb 100644
--- a/drivers/staging/greybus/vibrator.c
+++ b/drivers/staging/greybus/vibrator.c
@@ -161,7 +161,7 @@ static int gb_vibrator_probe(struct gb_bundle *bundle,
dev = device_create(&vibrator_class, &bundle->dev,
MKDEV(0, 0), vib, "vibrator%d", vib->minor);
if (IS_ERR(dev)) {
- retval = -EINVAL;
+ retval = PTR_ERR(dev);
goto err_ida_remove;
}
vib->dev = dev;
--
2.54.0.windows.1
^ permalink raw reply related
* [PATCH 2/2] staging: sm750fb: rename setAllEngOff
From: Onish Sharma @ 2026-05-28 13:36 UTC (permalink / raw)
To: sudipm.mukherjee, gregkh
Cc: linux-staging, linux-fbdev, linux-kernel, Onish Sharma
In-Reply-To: <20260528133627.10850-1-neharora23587@gmail.com>
Rename setAllEngOff to set_all_eng_off to comply with kernel coding style
and improve readability.
Signed-off-by: Onish Sharma <neharora23587@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 2 +-
drivers/staging/sm750fb/sm750.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 8f01b3c63fe8..716a8935f58d 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -848,7 +848,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
sm750_dev->init_parm.mem_clk = 0;
sm750_dev->init_parm.master_clk = 0;
sm750_dev->init_parm.power_mode = 0;
- sm750_dev->init_parm.setAllEngOff = 0;
+ sm750_dev->init_parm.set_all_eng_off = 0;
sm750_dev->init_parm.reset_memory = 1;
/* defaultly turn g_hwcursor on for both view */
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index 0492b1afbb11..e8885133da2e 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -44,7 +44,7 @@ struct init_status {
ushort chip_clk;
ushort mem_clk;
ushort master_clk;
- ushort setAllEngOff;
+ ushort set_all_eng_off;
ushort reset_memory;
};
--
2.54.0
^ permalink raw reply related
* [PATCH 1/2] staging: sm750fb: rename pvReg to pv_reg
From: Onish Sharma @ 2026-05-28 13:36 UTC (permalink / raw)
To: sudipm.mukherjee, gregkh
Cc: linux-staging, linux-fbdev, linux-kernel, Onish Sharma
Rename pvReg to pv_reg to comply with kernel coding style (checkpatch.pl)
and improve readability.
Signed-off-by: Onish Sharma <neharora23587@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 4 ++--
drivers/staging/sm750fb/sm750.h | 2 +-
drivers/staging/sm750fb/sm750_hw.c | 12 ++++++------
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 89c811e0806c..8f01b3c63fe8 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -743,7 +743,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
* must be set after crtc member initialized
*/
crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
- crtc->cursor.mmio = sm750_dev->pvReg +
+ crtc->cursor.mmio = sm750_dev->pv_reg +
0x800f0 + (int)crtc->channel * 0x140;
crtc->cursor.max_h = 64;
@@ -1047,7 +1047,7 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
sm750fb_framebuffer_release(sm750_dev);
arch_phys_wc_del(sm750_dev->mtrr.vram);
- iounmap(sm750_dev->pvReg);
+ iounmap(sm750_dev->pv_reg);
iounmap(sm750_dev->vmem);
pci_release_region(pdev, 1);
kfree(g_settings);
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index d2c522e67f26..0492b1afbb11 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -97,7 +97,7 @@ struct sm750_dev {
unsigned long vidreg_start;
__u32 vidmem_size;
__u32 vidreg_size;
- void __iomem *pvReg;
+ void __iomem *pv_reg;
unsigned char __iomem *vmem;
/* locks*/
spinlock_t slock;
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index 34a837fb4b64..95f797e5776a 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -23,18 +23,18 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
}
/* now map mmio and vidmem */
- sm750_dev->pvReg =
+ sm750_dev->pv_reg =
ioremap(sm750_dev->vidreg_start, sm750_dev->vidreg_size);
- if (!sm750_dev->pvReg) {
+ if (!sm750_dev->pv_reg) {
dev_err(&pdev->dev, "mmio failed\n");
ret = -EFAULT;
goto err_release_region;
}
- sm750_dev->accel.dpr_base = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
- sm750_dev->accel.dp_port_base = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
+ sm750_dev->accel.dpr_base = sm750_dev->pv_reg + DE_BASE_ADDR_TYPE1;
+ sm750_dev->accel.dp_port_base = sm750_dev->pv_reg + DE_PORT_ADDR_TYPE1;
- mmio750 = sm750_dev->pvReg;
+ mmio750 = sm750_dev->pv_reg;
sm750_set_chip_type(sm750_dev->devid, sm750_dev->revid);
sm750_dev->vidmem_start = pci_resource_start(pdev, 0);
@@ -58,7 +58,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
return 0;
err_unmap_reg:
- iounmap(sm750_dev->pvReg);
+ iounmap(sm750_dev->pv_reg);
err_release_region:
pci_release_region(pdev, 1);
return ret;
--
2.54.0
^ permalink raw reply related
* [PATCH] staging: greybus: camera: remove broken camera driver
From: Ashwin Gundarapu @ 2026-05-28 13:13 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, linux-staging
The Greybus camera driver has been non-functional since its inclusion
due to a missing greybus_protocols.h header and reliance on deprecated
v4l2_mbus_pixelcode enum.
The Project Ara hardware this driver was written for never shipped,
and the driver has seen no real fixes in over 8 years—only treewide
cleanups such as GFP_KERNEL conversions and debugfs error handling
changes.
Remove the entire camera driver (~2,000 lines).
Signed-off-by: Ashwin Gundarapu <linuxuser509@zohomail.in>
---
drivers/staging/greybus/camera.c | 1047 ---------------------------
drivers/staging/greybus/gb-camera.h | 127 ----
2 files changed, 1174 deletions(-)
delete mode 100644 drivers/staging/greybus/camera.c
delete mode 100644 drivers/staging/greybus/gb-camera.h
diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c
deleted file mode 100644
index f448b7713384..000000000000
--- a/drivers/staging/greybus/camera.c
+++ /dev/null
@@ -1,1047 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Greybus Camera protocol driver.
- *
- * Copyright 2015 Google Inc.
- * Copyright 2015 Linaro Ltd.
- */
-
-#include <linux/debugfs.h>
-#include <linux/fs.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/string.h>
-#include <linux/uaccess.h>
-#include <linux/vmalloc.h>
-#include <linux/greybus.h>
-
-#include "gb-camera.h"
-#include "greybus_protocols.h"
-
-enum gb_camera_debugs_buffer_id {
- GB_CAMERA_DEBUGFS_BUFFER_CAPABILITIES,
- GB_CAMERA_DEBUGFS_BUFFER_STREAMS,
- GB_CAMERA_DEBUGFS_BUFFER_CAPTURE,
- GB_CAMERA_DEBUGFS_BUFFER_FLUSH,
- GB_CAMERA_DEBUGFS_BUFFER_MAX,
-};
-
-struct gb_camera_debugfs_buffer {
- char data[PAGE_SIZE];
- size_t length;
-};
-
-enum gb_camera_state {
- GB_CAMERA_STATE_UNCONFIGURED,
- GB_CAMERA_STATE_CONFIGURED,
-};
-
-/**
- * struct gb_camera - A Greybus Camera Device
- * @connection: the greybus connection for camera management
- * @data_connection: the greybus connection for camera data
- * @data_cport_id: the data CPort ID on the module side
- * @mutex: protects the connection and state fields
- * @state: the current module state
- * @debugfs: debugfs entries for camera protocol operations testing
- * @module: Greybus camera module registered to HOST processor.
- */
-struct gb_camera {
- struct gb_bundle *bundle;
- struct gb_connection *connection;
- struct gb_connection *data_connection;
- u16 data_cport_id;
-
- struct mutex mutex;
- enum gb_camera_state state;
-
- struct {
- struct dentry *root;
- struct gb_camera_debugfs_buffer *buffers;
- } debugfs;
-
- struct gb_camera_module module;
-};
-
-struct gb_camera_stream_config {
- unsigned int width;
- unsigned int height;
- unsigned int format;
- unsigned int vc;
- unsigned int dt[2];
- unsigned int max_size;
-};
-
-struct gb_camera_fmt_info {
- enum v4l2_mbus_pixelcode mbus_code;
- unsigned int gb_format;
- unsigned int bpp;
-};
-
-/* GB format to media code map */
-static const struct gb_camera_fmt_info gb_fmt_info[] = {
- {
- .mbus_code = V4L2_MBUS_FMT_UYVY8_1X16,
- .gb_format = 0x01,
- .bpp = 16,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_NV12_1x8,
- .gb_format = 0x12,
- .bpp = 12,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_NV21_1x8,
- .gb_format = 0x13,
- .bpp = 12,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_YU12_1x8,
- .gb_format = 0x16,
- .bpp = 12,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_YV12_1x8,
- .gb_format = 0x17,
- .bpp = 12,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_JPEG_1X8,
- .gb_format = 0x40,
- .bpp = 0,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_GB_CAM_METADATA_1X8,
- .gb_format = 0x41,
- .bpp = 0,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_GB_CAM_DEBUG_DATA_1X8,
- .gb_format = 0x42,
- .bpp = 0,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_SBGGR10_1X10,
- .gb_format = 0x80,
- .bpp = 10,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_SGBRG10_1X10,
- .gb_format = 0x81,
- .bpp = 10,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_SGRBG10_1X10,
- .gb_format = 0x82,
- .bpp = 10,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_SRGGB10_1X10,
- .gb_format = 0x83,
- .bpp = 10,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_SBGGR12_1X12,
- .gb_format = 0x84,
- .bpp = 12,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_SGBRG12_1X12,
- .gb_format = 0x85,
- .bpp = 12,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_SGRBG12_1X12,
- .gb_format = 0x86,
- .bpp = 12,
- },
- {
- .mbus_code = V4L2_MBUS_FMT_SRGGB12_1X12,
- .gb_format = 0x87,
- .bpp = 12,
- },
-};
-
-static const struct gb_camera_fmt_info *gb_camera_get_format_info(u16 gb_fmt)
-{
- unsigned int i;
-
- for (i = 0; i < ARRAY_SIZE(gb_fmt_info); i++) {
- if (gb_fmt_info[i].gb_format == gb_fmt)
- return &gb_fmt_info[i];
- }
-
- return NULL;
-}
-
-#define ES2_APB_CDSI0_CPORT 16
-#define ES2_APB_CDSI1_CPORT 17
-
-#define GB_CAMERA_MAX_SETTINGS_SIZE 8192
-
-static int gb_camera_operation_sync_flags(struct gb_connection *connection,
- int type, unsigned int flags,
- void *request, size_t request_size,
- void *response, size_t *response_size)
-{
- struct gb_operation *operation;
- int ret;
-
- operation = gb_operation_create_flags(connection, type, request_size,
- *response_size, flags,
- GFP_KERNEL);
- if (!operation)
- return -ENOMEM;
-
- if (request_size)
- memcpy(operation->request->payload, request, request_size);
-
- ret = gb_operation_request_send_sync(operation);
- if (ret) {
- dev_err(&connection->hd->dev,
- "%s: synchronous operation of type 0x%02x failed: %d\n",
- connection->name, type, ret);
- } else {
- *response_size = operation->response->payload_size;
-
- if (operation->response->payload_size)
- memcpy(response, operation->response->payload,
- operation->response->payload_size);
- }
-
- gb_operation_put(operation);
-
- return ret;
-}
-
-static int gb_camera_get_max_pkt_size(struct gb_camera *gcam,
- struct gb_camera_configure_streams_response *resp)
-{
- unsigned int max_pkt_size = 0;
- unsigned int i;
-
- for (i = 0; i < resp->num_streams; i++) {
- struct gb_camera_stream_config_response *cfg = &resp->config[i];
- const struct gb_camera_fmt_info *fmt_info;
- unsigned int pkt_size;
-
- fmt_info = gb_camera_get_format_info(cfg->format);
- if (!fmt_info) {
- dev_err(&gcam->bundle->dev, "unsupported greybus image format: %d\n",
- cfg->format);
- return -EIO;
- }
-
- if (fmt_info->bpp == 0) {
- pkt_size = le32_to_cpu(cfg->max_pkt_size);
-
- if (pkt_size == 0) {
- dev_err(&gcam->bundle->dev,
- "Stream %u: invalid zero maximum packet size\n",
- i);
- return -EIO;
- }
- } else {
- pkt_size = le16_to_cpu(cfg->width) * fmt_info->bpp / 8;
-
- if (pkt_size != le32_to_cpu(cfg->max_pkt_size)) {
- dev_err(&gcam->bundle->dev,
- "Stream %u: maximum packet size mismatch (%u/%u)\n",
- i, pkt_size, cfg->max_pkt_size);
- return -EIO;
- }
- }
-
- max_pkt_size = max(pkt_size, max_pkt_size);
- }
-
- return max_pkt_size;
-}
-
-/*
- * Validate the stream configuration response verifying padding is correctly
- * set and the returned number of streams is supported
- */
-static const int gb_camera_configure_streams_validate_response(struct gb_camera *gcam,
- struct gb_camera_configure_streams_response *resp,
- unsigned int nstreams)
-{
- unsigned int i;
-
- /* Validate the returned response structure */
- if (resp->padding[0] || resp->padding[1]) {
- dev_err(&gcam->bundle->dev, "response padding != 0\n");
- return -EIO;
- }
-
- if (resp->num_streams > nstreams) {
- dev_err(&gcam->bundle->dev, "got #streams %u > request %u\n",
- resp->num_streams, nstreams);
- return -EIO;
- }
-
- for (i = 0; i < resp->num_streams; i++) {
- struct gb_camera_stream_config_response *cfg = &resp->config[i];
-
- if (cfg->padding) {
- dev_err(&gcam->bundle->dev, "stream #%u padding != 0\n", i);
- return -EIO;
- }
- }
-
- return 0;
-}
-
-/* -----------------------------------------------------------------------------
- * Hardware Configuration
- */
-
-static int gb_camera_set_intf_power_mode(struct gb_camera *gcam, u8 intf_id,
- bool hs)
-{
- struct gb_svc *svc = gcam->connection->hd->svc;
- int ret;
-
- if (hs)
- ret = gb_svc_intf_set_power_mode(svc, intf_id,
- GB_SVC_UNIPRO_HS_SERIES_A,
- GB_SVC_UNIPRO_FAST_MODE, 2, 2,
- GB_SVC_SMALL_AMPLITUDE,
- GB_SVC_NO_DE_EMPHASIS,
- GB_SVC_UNIPRO_FAST_MODE, 2, 2,
- GB_SVC_PWRM_RXTERMINATION |
- GB_SVC_PWRM_TXTERMINATION, 0,
- NULL, NULL);
- else
- ret = gb_svc_intf_set_power_mode(svc, intf_id,
- GB_SVC_UNIPRO_HS_SERIES_A,
- GB_SVC_UNIPRO_SLOW_AUTO_MODE,
- 2, 1,
- GB_SVC_SMALL_AMPLITUDE,
- GB_SVC_NO_DE_EMPHASIS,
- GB_SVC_UNIPRO_SLOW_AUTO_MODE,
- 2, 1,
- 0, 0,
- NULL, NULL);
-
- return ret;
-}
-
-static int gb_camera_set_power_mode(struct gb_camera *gcam, bool hs)
-{
- struct gb_interface *intf = gcam->connection->intf;
- struct gb_svc *svc = gcam->connection->hd->svc;
- int ret;
-
- ret = gb_camera_set_intf_power_mode(gcam, intf->interface_id, hs);
- if (ret < 0) {
- dev_err(&gcam->bundle->dev, "failed to set module interface to %s (%d)\n",
- hs ? "HS" : "PWM", ret);
- return ret;
- }
-
- ret = gb_camera_set_intf_power_mode(gcam, svc->ap_intf_id, hs);
- if (ret < 0) {
- gb_camera_set_intf_power_mode(gcam, intf->interface_id, !hs);
- dev_err(&gcam->bundle->dev, "failed to set AP interface to %s (%d)\n",
- hs ? "HS" : "PWM", ret);
- return ret;
- }
-
- return 0;
-}
-
-struct ap_csi_config_request {
- __u8 csi_id;
- __u8 flags;
-#define GB_CAMERA_CSI_FLAG_CLOCK_CONTINUOUS 0x01
- __u8 num_lanes;
- __u8 padding;
- __le32 csi_clk_freq;
- __le32 max_pkt_size;
-} __packed;
-
-/*
- * TODO: Compute the number of lanes dynamically based on bandwidth
- * requirements.
- */
-#define GB_CAMERA_CSI_NUM_DATA_LANES 4
-
-#define GB_CAMERA_CSI_CLK_FREQ_MAX 999000000U
-#define GB_CAMERA_CSI_CLK_FREQ_MIN 100000000U
-#define GB_CAMERA_CSI_CLK_FREQ_MARGIN 150000000U
-
-static int gb_camera_setup_data_connection(struct gb_camera *gcam,
- struct gb_camera_configure_streams_response *resp,
- struct gb_camera_csi_params *csi_params)
-{
- struct ap_csi_config_request csi_cfg;
- struct gb_connection *conn;
- unsigned int clk_freq;
- int ret;
-
- /*
- * Create the data connection between the camera module data CPort and
- * APB CDSI1. The CDSI1 CPort ID is hardcoded by the ES2 bridge.
- */
- conn = gb_connection_create_offloaded(gcam->bundle, gcam->data_cport_id,
- GB_CONNECTION_FLAG_NO_FLOWCTRL |
- GB_CONNECTION_FLAG_CDSI1);
- if (IS_ERR(conn))
- return PTR_ERR(conn);
-
- gcam->data_connection = conn;
- gb_connection_set_data(conn, gcam);
-
- ret = gb_connection_enable(conn);
- if (ret)
- goto error_conn_destroy;
-
- /* Set the UniPro link to high speed mode. */
- ret = gb_camera_set_power_mode(gcam, true);
- if (ret < 0)
- goto error_conn_disable;
-
- /*
- * Configure the APB-A CSI-2 transmitter.
- *
- * Hardcode the number of lanes to 4 and compute the bus clock frequency
- * based on the module bandwidth requirements with a safety margin.
- */
- memset(&csi_cfg, 0, sizeof(csi_cfg));
- csi_cfg.csi_id = 1;
- csi_cfg.flags = 0;
- csi_cfg.num_lanes = GB_CAMERA_CSI_NUM_DATA_LANES;
-
- clk_freq = resp->data_rate / 2 / GB_CAMERA_CSI_NUM_DATA_LANES;
- clk_freq = clamp(clk_freq + GB_CAMERA_CSI_CLK_FREQ_MARGIN,
- GB_CAMERA_CSI_CLK_FREQ_MIN,
- GB_CAMERA_CSI_CLK_FREQ_MAX);
- csi_cfg.csi_clk_freq = clk_freq;
-
- ret = gb_camera_get_max_pkt_size(gcam, resp);
- if (ret < 0) {
- ret = -EIO;
- goto error_power;
- }
- csi_cfg.max_pkt_size = ret;
-
- ret = gb_hd_output(gcam->connection->hd, &csi_cfg,
- sizeof(csi_cfg),
- GB_APB_REQUEST_CSI_TX_CONTROL, false);
- if (ret < 0) {
- dev_err(&gcam->bundle->dev, "failed to start the CSI transmitter\n");
- goto error_power;
- }
-
- if (csi_params) {
- csi_params->clk_freq = csi_cfg.csi_clk_freq;
- csi_params->num_lanes = csi_cfg.num_lanes;
- }
-
- return 0;
-
-error_power:
- gb_camera_set_power_mode(gcam, false);
-error_conn_disable:
- gb_connection_disable(gcam->data_connection);
-error_conn_destroy:
- gb_connection_destroy(gcam->data_connection);
- gcam->data_connection = NULL;
- return ret;
-}
-
-static void gb_camera_teardown_data_connection(struct gb_camera *gcam)
-{
- struct ap_csi_config_request csi_cfg;
- int ret;
-
- /* Stop the APB1 CSI transmitter. */
- memset(&csi_cfg, 0, sizeof(csi_cfg));
- csi_cfg.csi_id = 1;
-
- ret = gb_hd_output(gcam->connection->hd, &csi_cfg,
- sizeof(csi_cfg),
- GB_APB_REQUEST_CSI_TX_CONTROL, false);
-
- if (ret < 0)
- dev_err(&gcam->bundle->dev, "failed to stop the CSI transmitter\n");
-
- /* Set the UniPro link to low speed mode. */
- gb_camera_set_power_mode(gcam, false);
-
- /* Destroy the data connection. */
- gb_connection_disable(gcam->data_connection);
- gb_connection_destroy(gcam->data_connection);
- gcam->data_connection = NULL;
-}
-
-/* -----------------------------------------------------------------------------
- * Camera Protocol Operations
- */
-
-static int gb_camera_capabilities(struct gb_camera *gcam,
- u8 *capabilities, size_t *size)
-{
- int ret;
-
- ret = gb_pm_runtime_get_sync(gcam->bundle);
- if (ret)
- return ret;
-
- mutex_lock(&gcam->mutex);
-
- if (!gcam->connection) {
- ret = -EINVAL;
- goto done;
- }
-
- ret = gb_camera_operation_sync_flags(gcam->connection,
- GB_CAMERA_TYPE_CAPABILITIES,
- GB_OPERATION_FLAG_SHORT_RESPONSE,
- NULL, 0,
- (void *)capabilities, size);
- if (ret)
- dev_err(&gcam->bundle->dev, "failed to retrieve capabilities: %d\n", ret);
-
-done:
- mutex_unlock(&gcam->mutex);
-
- gb_pm_runtime_put_autosuspend(gcam->bundle);
-
- return ret;
-}
-
-static int gb_camera_configure_streams(struct gb_camera *gcam,
- unsigned int *num_streams,
- unsigned int *flags,
- struct gb_camera_stream_config *streams,
- struct gb_camera_csi_params *csi_params)
-{
- struct gb_camera_configure_streams_request *req;
- struct gb_camera_configure_streams_response *resp;
- unsigned int nstreams = *num_streams;
- unsigned int i;
- size_t req_size;
- size_t resp_size;
- int ret;
-
- if (nstreams > GB_CAMERA_MAX_STREAMS)
- return -EINVAL;
-
- req_size = sizeof(*req) + nstreams * sizeof(req->config[0]);
- resp_size = sizeof(*resp) + nstreams * sizeof(resp->config[0]);
-
- req = kmalloc(req_size, GFP_KERNEL);
- resp = kmalloc(resp_size, GFP_KERNEL);
- if (!req || !resp) {
- kfree(req);
- kfree(resp);
- return -ENOMEM;
- }
-
- req->num_streams = nstreams;
- req->flags = *flags;
- req->padding = 0;
-
- for (i = 0; i < nstreams; ++i) {
- struct gb_camera_stream_config_request *cfg = &req->config[i];
-
- cfg->width = cpu_to_le16(streams[i].width);
- cfg->height = cpu_to_le16(streams[i].height);
- cfg->format = cpu_to_le16(streams[i].format);
- cfg->padding = 0;
- }
-
- mutex_lock(&gcam->mutex);
-
- ret = gb_pm_runtime_get_sync(gcam->bundle);
- if (ret)
- goto done_skip_pm_put;
-
- if (!gcam->connection) {
- ret = -EINVAL;
- goto done;
- }
-
- ret = gb_camera_operation_sync_flags(gcam->connection,
- GB_CAMERA_TYPE_CONFIGURE_STREAMS,
- GB_OPERATION_FLAG_SHORT_RESPONSE,
- req, req_size,
- resp, &resp_size);
- if (ret < 0)
- goto done;
-
- ret = gb_camera_configure_streams_validate_response(gcam, resp,
- nstreams);
- if (ret < 0)
- goto done;
-
- *flags = resp->flags;
- *num_streams = resp->num_streams;
-
- for (i = 0; i < resp->num_streams; ++i) {
- struct gb_camera_stream_config_response *cfg = &resp->config[i];
-
- streams[i].width = le16_to_cpu(cfg->width);
- streams[i].height = le16_to_cpu(cfg->height);
- streams[i].format = le16_to_cpu(cfg->format);
- streams[i].vc = cfg->virtual_channel;
- streams[i].dt[0] = cfg->data_type[0];
- streams[i].dt[1] = cfg->data_type[1];
- streams[i].max_size = le32_to_cpu(cfg->max_size);
- }
-
- if ((resp->flags & GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED) ||
- (req->flags & GB_CAMERA_CONFIGURE_STREAMS_TEST_ONLY))
- goto done;
-
- if (gcam->state == GB_CAMERA_STATE_CONFIGURED) {
- gb_camera_teardown_data_connection(gcam);
- gcam->state = GB_CAMERA_STATE_UNCONFIGURED;
-
- /*
- * When unconfiguring streams release the PM runtime reference
- * that was acquired when streams were configured. The bundle
- * won't be suspended until the PM runtime reference acquired at
- * the beginning of this function gets released right before
- * returning.
- */
- gb_pm_runtime_put_noidle(gcam->bundle);
- }
-
- if (resp->num_streams == 0)
- goto done;
-
- /*
- * Make sure the bundle won't be suspended until streams get
- * unconfigured after the stream is configured successfully
- */
- gb_pm_runtime_get_noresume(gcam->bundle);
-
- /* Setup CSI-2 connection from APB-A to AP */
- ret = gb_camera_setup_data_connection(gcam, resp, csi_params);
- if (ret < 0) {
- memset(req, 0, sizeof(*req));
- gb_operation_sync(gcam->connection,
- GB_CAMERA_TYPE_CONFIGURE_STREAMS,
- req, sizeof(*req),
- resp, sizeof(*resp));
- *flags = 0;
- *num_streams = 0;
- gb_pm_runtime_put_noidle(gcam->bundle);
- goto done;
- }
-
- gcam->state = GB_CAMERA_STATE_CONFIGURED;
-
-done:
- gb_pm_runtime_put_autosuspend(gcam->bundle);
-
-done_skip_pm_put:
- mutex_unlock(&gcam->mutex);
- kfree(req);
- kfree(resp);
- return ret;
-}
-
-static int gb_camera_capture(struct gb_camera *gcam, u32 request_id,
- unsigned int streams, unsigned int num_frames,
- size_t settings_size, const void *settings)
-{
- struct gb_camera_capture_request *req;
- size_t req_size;
- int ret;
-
- if (settings_size > GB_CAMERA_MAX_SETTINGS_SIZE)
- return -EINVAL;
-
- req_size = sizeof(*req) + settings_size;
- req = kmalloc(req_size, GFP_KERNEL);
- if (!req)
- return -ENOMEM;
-
- req->request_id = cpu_to_le32(request_id);
- req->streams = streams;
- req->padding = 0;
- req->num_frames = cpu_to_le16(num_frames);
- memcpy(req->settings, settings, settings_size);
-
- mutex_lock(&gcam->mutex);
-
- if (!gcam->connection) {
- ret = -EINVAL;
- goto done;
- }
-
- ret = gb_operation_sync(gcam->connection, GB_CAMERA_TYPE_CAPTURE,
- req, req_size, NULL, 0);
-done:
- mutex_unlock(&gcam->mutex);
-
- kfree(req);
-
- return ret;
-}
-
-static int gb_camera_flush(struct gb_camera *gcam, u32 *request_id)
-{
- struct gb_camera_flush_response resp;
- int ret;
-
- mutex_lock(&gcam->mutex);
-
- if (!gcam->connection) {
- ret = -EINVAL;
- goto done;
- }
-
- ret = gb_operation_sync(gcam->connection, GB_CAMERA_TYPE_FLUSH, NULL, 0,
- &resp, sizeof(resp));
-
- if (ret < 0)
- goto done;
-
- if (request_id)
- *request_id = le32_to_cpu(resp.request_id);
-
-done:
- mutex_unlock(&gcam->mutex);
-
- return ret;
-}
-
-static int gb_camera_request_handler(struct gb_operation *op)
-{
- struct gb_camera *gcam = gb_connection_get_data(op->connection);
- struct gb_camera_metadata_request *payload;
- struct gb_message *request;
-
- if (op->type != GB_CAMERA_TYPE_METADATA) {
- dev_err(&gcam->bundle->dev, "Unsupported unsolicited event: %u\n", op->type);
- return -EINVAL;
- }
-
- request = op->request;
-
- if (request->payload_size < sizeof(*payload)) {
- dev_err(&gcam->bundle->dev, "Wrong event size received (%zu < %zu)\n",
- request->payload_size, sizeof(*payload));
- return -EINVAL;
- }
-
- payload = request->payload;
-
- dev_dbg(&gcam->bundle->dev, "received metadata for request %u, frame %u, stream %u\n",
- payload->request_id, payload->frame_number, payload->stream);
-
- return 0;
-}
-
-/* -----------------------------------------------------------------------------
- * Interface with HOST gmp camera.
- */
-static unsigned int gb_camera_mbus_to_gb(enum v4l2_mbus_pixelcode mbus_code)
-{
- unsigned int i;
-
- for (i = 0; i < ARRAY_SIZE(gb_fmt_info); i++) {
- if (gb_fmt_info[i].mbus_code == mbus_code)
- return gb_fmt_info[i].gb_format;
- }
- return gb_fmt_info[0].gb_format;
-}
-
-static enum v4l2_mbus_pixelcode gb_camera_gb_to_mbus(u16 gb_fmt)
-{
- unsigned int i;
-
- for (i = 0; i < ARRAY_SIZE(gb_fmt_info); i++) {
- if (gb_fmt_info[i].gb_format == gb_fmt)
- return gb_fmt_info[i].mbus_code;
- }
- return gb_fmt_info[0].mbus_code;
-}
-
-static ssize_t gb_camera_op_capabilities(void *priv, char *data, size_t len)
-{
- struct gb_camera *gcam = priv;
- size_t capabilities_len = len;
- int ret;
-
- ret = gb_camera_capabilities(gcam, data, &capabilities_len);
- if (ret)
- return ret;
-
- return capabilities_len;
-}
-
-static int gb_camera_op_configure_streams(void *priv, unsigned int *nstreams,
- unsigned int *flags, struct gb_camera_stream *streams,
- struct gb_camera_csi_params *csi_params)
-{
- struct gb_camera *gcam = priv;
- struct gb_camera_stream_config *gb_streams;
- unsigned int gb_flags = 0;
- unsigned int gb_nstreams = *nstreams;
- unsigned int i;
- int ret;
-
- if (gb_nstreams > GB_CAMERA_MAX_STREAMS)
- return -EINVAL;
-
- gb_streams = kzalloc_objs(*gb_streams, gb_nstreams);
- if (!gb_streams)
- return -ENOMEM;
-
- for (i = 0; i < gb_nstreams; i++) {
- gb_streams[i].width = streams[i].width;
- gb_streams[i].height = streams[i].height;
- gb_streams[i].format =
- gb_camera_mbus_to_gb(streams[i].pixel_code);
- }
-
- if (*flags & GB_CAMERA_IN_FLAG_TEST)
- gb_flags |= GB_CAMERA_CONFIGURE_STREAMS_TEST_ONLY;
-
- ret = gb_camera_configure_streams(gcam, &gb_nstreams,
- &gb_flags, gb_streams, csi_params);
- if (ret < 0)
- goto done;
- if (gb_nstreams > *nstreams) {
- ret = -EINVAL;
- goto done;
- }
-
- *flags = 0;
- if (gb_flags & GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED)
- *flags |= GB_CAMERA_OUT_FLAG_ADJUSTED;
-
- for (i = 0; i < gb_nstreams; i++) {
- streams[i].width = gb_streams[i].width;
- streams[i].height = gb_streams[i].height;
- streams[i].vc = gb_streams[i].vc;
- streams[i].dt[0] = gb_streams[i].dt[0];
- streams[i].dt[1] = gb_streams[i].dt[1];
- streams[i].max_size = gb_streams[i].max_size;
- streams[i].pixel_code =
- gb_camera_gb_to_mbus(gb_streams[i].format);
- }
- *nstreams = gb_nstreams;
-
-done:
- kfree(gb_streams);
- return ret;
-}
-
-static int gb_camera_op_capture(void *priv, u32 request_id,
- unsigned int streams, unsigned int num_frames,
- size_t settings_size, const void *settings)
-{
- struct gb_camera *gcam = priv;
-
- return gb_camera_capture(gcam, request_id, streams, num_frames,
- settings_size, settings);
-}
-
-static int gb_camera_op_flush(void *priv, u32 *request_id)
-{
- struct gb_camera *gcam = priv;
-
- return gb_camera_flush(gcam, request_id);
-}
-
-static const struct gb_camera_ops gb_cam_ops = {
- .capabilities = gb_camera_op_capabilities,
- .configure_streams = gb_camera_op_configure_streams,
- .capture = gb_camera_op_capture,
- .flush = gb_camera_op_flush,
-};
-
-/* -----------------------------------------------------------------------------
- * DebugFS
- */
-
-static void gb_camera_cleanup(struct gb_camera *gcam)
-{
- gb_camera_debugfs_cleanup(gcam);
-
- mutex_lock(&gcam->mutex);
- if (gcam->data_connection) {
- gb_connection_disable(gcam->data_connection);
- gb_connection_destroy(gcam->data_connection);
- gcam->data_connection = NULL;
- }
-
- if (gcam->connection) {
- gb_connection_disable(gcam->connection);
- gb_connection_destroy(gcam->connection);
- gcam->connection = NULL;
- }
- mutex_unlock(&gcam->mutex);
-}
-
-static void gb_camera_release_module(struct kref *ref)
-{
- struct gb_camera_module *cam_mod =
- container_of(ref, struct gb_camera_module, refcount);
- kfree(cam_mod->priv);
-}
-
-static int gb_camera_probe(struct gb_bundle *bundle,
- const struct greybus_bundle_id *id)
-{
- struct gb_connection *conn;
- struct gb_camera *gcam;
- u16 mgmt_cport_id = 0;
- u16 data_cport_id = 0;
- unsigned int i;
- int ret;
-
- /*
- * The camera bundle must contain exactly two CPorts, one for the
- * camera management protocol and one for the camera data protocol.
- */
- if (bundle->num_cports != 2)
- return -ENODEV;
-
- for (i = 0; i < bundle->num_cports; ++i) {
- struct greybus_descriptor_cport *desc = &bundle->cport_desc[i];
-
- switch (desc->protocol_id) {
- case GREYBUS_PROTOCOL_CAMERA_MGMT:
- mgmt_cport_id = le16_to_cpu(desc->id);
- break;
- case GREYBUS_PROTOCOL_CAMERA_DATA:
- data_cport_id = le16_to_cpu(desc->id);
- break;
- default:
- return -ENODEV;
- }
- }
-
- if (!mgmt_cport_id || !data_cport_id)
- return -ENODEV;
-
- gcam = kzalloc_obj(*gcam);
- if (!gcam)
- return -ENOMEM;
-
- mutex_init(&gcam->mutex);
-
- gcam->bundle = bundle;
- gcam->state = GB_CAMERA_STATE_UNCONFIGURED;
- gcam->data_cport_id = data_cport_id;
-
- conn = gb_connection_create(bundle, mgmt_cport_id,
- gb_camera_request_handler);
- if (IS_ERR(conn)) {
- ret = PTR_ERR(conn);
- goto error;
- }
-
- gcam->connection = conn;
- gb_connection_set_data(conn, gcam);
-
- ret = gb_connection_enable(conn);
- if (ret)
- goto error;
-
- ret = gb_camera_debugfs_init(gcam);
- if (ret < 0)
- goto error;
-
- gcam->module.priv = gcam;
- gcam->module.ops = &gb_cam_ops;
- gcam->module.interface_id = gcam->connection->intf->interface_id;
- gcam->module.release = gb_camera_release_module;
- ret = gb_camera_register(&gcam->module);
- if (ret < 0)
- goto error;
-
- greybus_set_drvdata(bundle, gcam);
-
- gb_pm_runtime_put_autosuspend(gcam->bundle);
-
- return 0;
-
-error:
- gb_camera_cleanup(gcam);
- kfree(gcam);
- return ret;
-}
-
-static void gb_camera_disconnect(struct gb_bundle *bundle)
-{
- struct gb_camera *gcam = greybus_get_drvdata(bundle);
- int ret;
-
- ret = gb_pm_runtime_get_sync(bundle);
- if (ret)
- gb_pm_runtime_get_noresume(bundle);
-
- gb_camera_cleanup(gcam);
- gb_camera_unregister(&gcam->module);
-}
-
-static const struct greybus_bundle_id gb_camera_id_table[] = {
- { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_CAMERA) },
- { },
-};
-
-#ifdef CONFIG_PM
-static int gb_camera_suspend(struct device *dev)
-{
- struct gb_bundle *bundle = to_gb_bundle(dev);
- struct gb_camera *gcam = greybus_get_drvdata(bundle);
-
- if (gcam->data_connection)
- gb_connection_disable(gcam->data_connection);
-
- gb_connection_disable(gcam->connection);
-
- return 0;
-}
-
-static int gb_camera_resume(struct device *dev)
-{
- struct gb_bundle *bundle = to_gb_bundle(dev);
- struct gb_camera *gcam = greybus_get_drvdata(bundle);
- int ret;
-
- ret = gb_connection_enable(gcam->connection);
- if (ret) {
- dev_err(&gcam->bundle->dev, "failed to enable connection: %d\n", ret);
- return ret;
- }
-
- if (gcam->data_connection) {
- ret = gb_connection_enable(gcam->data_connection);
- if (ret) {
- dev_err(&gcam->bundle->dev,
- "failed to enable data connection: %d\n", ret);
- return ret;
- }
- }
-
- return 0;
-}
-#endif
-
-static const struct dev_pm_ops gb_camera_pm_ops = {
- SET_RUNTIME_PM_OPS(gb_camera_suspend, gb_camera_resume, NULL)
-};
-
-static struct greybus_driver gb_camera_driver = {
- .name = "camera",
- .probe = gb_camera_probe,
- .disconnect = gb_camera_disconnect,
- .id_table = gb_camera_id_table,
- .driver.pm = &gb_camera_pm_ops,
-};
-
-module_greybus_driver(gb_camera_driver);
-
-MODULE_DESCRIPTION("Greybus Camera protocol driver.");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/staging/greybus/gb-camera.h b/drivers/staging/greybus/gb-camera.h
deleted file mode 100644
index d5a33a13f2a4..000000000000
--- a/drivers/staging/greybus/gb-camera.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Greybus Camera protocol driver.
- *
- * Copyright 2015 Google Inc.
- */
-#ifndef __GB_CAMERA_H
-#define __GB_CAMERA_H
-
-#include <linux/v4l2-mediabus.h>
-
-/* Input flags need to be set from the caller */
-#define GB_CAMERA_IN_FLAG_TEST BIT(0)
-/* Output flags returned */
-#define GB_CAMERA_OUT_FLAG_ADJUSTED BIT(0)
-
-/**
- * struct gb_camera_stream - Represents greybus camera stream.
- * @width: Stream width in pixels.
- * @height: Stream height in pixels.
- * @pixel_code: Media bus pixel code.
- * @vc: MIPI CSI virtual channel.
- * @dt: MIPI CSI data types. Most formats use a single data type, in which case
- * the second element will be ignored.
- * @max_size: Maximum size of a frame in bytes. The camera module guarantees
- * that all data between the Frame Start and Frame End packet for
- * the associated virtual channel and data type(s) will not exceed
- * this size.
- */
-struct gb_camera_stream {
- unsigned int width;
- unsigned int height;
- enum v4l2_mbus_pixelcode pixel_code;
- unsigned int vc;
- unsigned int dt[2];
- unsigned int max_size;
-};
-
-/**
- * struct gb_camera_csi_params - CSI configuration parameters
- * @num_lanes: number of CSI data lanes
- * @clk_freq: CSI clock frequency in Hz
- */
-struct gb_camera_csi_params {
- unsigned int num_lanes;
- unsigned int clk_freq;
-};
-
-/**
- * struct gb_camera_ops - Greybus camera operations, used by the Greybus camera
- * driver to expose operations to the host camera driver.
- * @capabilities: Retrieve camera capabilities and store them in the buffer
- * 'buf' capabilities. The buffer maximum size is specified by
- * the caller in the 'size' parameter, and the effective
- * capabilities size is returned from the function. If the buffer
- * size is too small to hold the capabilities an error is
- * returned and the buffer is left untouched.
- *
- * @configure_streams: Negotiate configuration and prepare the module for video
- * capture. The caller specifies the number of streams it
- * requests in the 'nstreams' argument and the associated
- * streams configurations in the 'streams' argument. The
- * GB_CAMERA_IN_FLAG_TEST 'flag' can be set to test a
- * configuration without applying it, otherwise the
- * configuration is applied by the module. The module can
- * decide to modify the requested configuration, including
- * using a different number of streams. In that case the
- * modified configuration won't be applied, the
- * GB_CAMERA_OUT_FLAG_ADJUSTED 'flag' will be set upon
- * return, and the modified configuration and number of
- * streams stored in 'streams' and 'array'. The module
- * returns its CSI-2 bus parameters in the 'csi_params'
- * structure in all cases.
- *
- * @capture: Submit a capture request. The supplied 'request_id' must be unique
- * and higher than the IDs of all the previously submitted requests.
- * The 'streams' argument specifies which streams are affected by the
- * request in the form of a bitmask, with bits corresponding to the
- * configured streams indexes. If the request contains settings, the
- * 'settings' argument points to the settings buffer and its size is
- * specified by the 'settings_size' argument. Otherwise the 'settings'
- * argument should be set to NULL and 'settings_size' to 0.
- *
- * @flush: Flush the capture requests queue. Return the ID of the last request
- * that will processed by the device before it stops transmitting video
- * frames. All queued capture requests with IDs higher than the returned
- * ID will be dropped without being processed.
- */
-struct gb_camera_ops {
- ssize_t (*capabilities)(void *priv, char *buf, size_t len);
- int (*configure_streams)(void *priv, unsigned int *nstreams,
- unsigned int *flags,
- struct gb_camera_stream *streams,
- struct gb_camera_csi_params *csi_params);
- int (*capture)(void *priv, u32 request_id,
- unsigned int streams, unsigned int num_frames,
- size_t settings_size, const void *settings);
- int (*flush)(void *priv, u32 *request_id);
-};
-
-/**
- * struct gb_camera_module - Represents greybus camera module.
- * @priv: Module private data, passed to all camera operations.
- * @ops: Greybus camera operation callbacks.
- * @interface_id: Interface id of the module.
- * @refcount: Reference counting object.
- * @release: Module release function.
- * @list: List entry in the camera modules list.
- */
-struct gb_camera_module {
- void *priv;
- const struct gb_camera_ops *ops;
-
- unsigned int interface_id;
- struct kref refcount;
- void (*release)(struct kref *kref);
- struct list_head list; /* Global list */
-};
-
-#define gb_camera_call(f, op, args...) \
- (!(f) ? -ENODEV : (((f)->ops->op) ? \
- (f)->ops->op((f)->priv, ##args) : -ENOIOCTLCMD))
-
-int gb_camera_register(struct gb_camera_module *module);
-int gb_camera_unregister(struct gb_camera_module *module);
-
-#endif /* __GB_CAMERA_H */
--
2.43.0
^ permalink raw reply related
* Re: [PATCH] staging: rtl8723bs: fix mismatched free of HalData in rtw_sdio_if1_init()
From: Dan Carpenter @ 2026-05-28 10:35 UTC (permalink / raw)
To: Dawei Feng
Cc: gregkh, omer.e.idrissi, hansg, hi, straube.linux, xela,
ethantidmore06, liangjie, linux-staging, linux-kernel, jianhao.xu,
stable, zilin
In-Reply-To: <20260528101542.2395619-1-dawei.feng@seu.edu.cn>
On Thu, May 28, 2026 at 06:15:42PM +0800, Dawei Feng wrote:
> On Thu, May 28, 2026 at 15:30:18 Dan Carpenter wrote:
> > > Manual inspection
> > > confirms that the issue is still present in current mainline.
> > >
> > > An x86_64 allyesconfig build showed no new warnings. As we do not have
> > > suitable RTL8723BS SDIO hardware to test with, no runtime testing was
> > > able to be performed.
> >
> > to HERE should be put
> >
> > >
> > > Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
> > > Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
> > > Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
> > > ---
> > ^^^
> > Here under the --- cut off line. We don't need this kind of meta
> > commentary about testing in the permanent git log. Otherwise
> > the patch is correct.
>
> Hi Dan,
>
> Thank you for the review and for pointing this out.
>
> The reason the manual inspection and testing commentary was placed above
> the `---` line is that we were strictly following the example template
> provided in Documentation/process/researcher-guidelines.rst.
Ah, hm. Perhaps, the rules are changing. That's fine then. I would
normally ask for a v2 but you copied from our template so that's on us.
No need to resend.
Reviewed-by: Dan Carpenter <error27@gmail.com>
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH] staging: rtl8723bs: remove redundant else after return
From: Dan Carpenter @ 2026-05-28 10:24 UTC (permalink / raw)
To: Tomasz Unger; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel
In-Reply-To: <20260528-fix-else-after-return-v1-1-f07ea0f010fb@yahoo.pl>
On Thu, May 28, 2026 at 11:55:42AM +0200, Tomasz Unger wrote:
> In enqueue_reorder_recvframe(), the else branch after a return
> statement is unnecessary. When a duplicate sequence number is found,
> the function returns false immediately, making the else keyword
> redundant. Remove else and fix the indentation of the break statement.
>
> Reported by checkpatch.pl with no remaining warnings.
>
> Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
> ---
> drivers/staging/rtl8723bs/core/rtw_recv.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
> index 86c5e2c4e7dd..51536f155750 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
> @@ -1789,8 +1789,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un
> /* Duplicate entry is found!! Do not insert current entry. */
> /* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */
> return false;
> - else
> - break;
> + break;
You have made the code buggy. Don't follow checkpatch blindly.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: Remove bouncing Intel media maintainers
From: Dave Stevenson @ 2026-05-28 10:21 UTC (permalink / raw)
To: Sakari Ailus
Cc: Dave Hansen, linux-kernel, Yong Zhi, Dan Scally,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Lixu Zhang,
linux-media, linux-staging, David Heidelberg
In-Reply-To: <aham35tbJEbDc1Ee@kekkonen.localdomain>
Hi Sakari & Dave
On Wed, 27 May 2026 at 09:10, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
>
> Hi Dave,
>
> On Tue, May 26, 2026 at 02:41:31PM -0700, Dave Hansen wrote:
> > Tianshu Qiu and Bingbu Cao are maintainers and reviewers of a bunch of
> > media drivers (7 and 9 respectively). Both of their emails are
> > bouncing.
> >
> > Remove the bouncing entries and update driver status in cases where
> > there are no M:'s left.
>
> I can pick at least some of these. I'll send v2.
If Intel have no/limited interest in IMX355 any more, then I'm happy
to step up as the maintainer as we have a customer looking to use it.
I was going to add that as an extra patch to v2 of my recent patchset
for it, but haven't sent it out yet.
Based on recent commits I had pinged David Heidelberg (added to cc)
and Richard Acayan too as other potential folk with an interest. David
has agreed to be a reviewer, but Richard hasn't the spare capacity at
present.
I don't mind if you add that to your V2 of this set, or I'll try and
get my v2 imx355 set out in the next week.
Dave
> --
> Kind regards,
>
> Sakari Ailus
>
^ permalink raw reply
* Re: [PATCH] staging: rtl8723bs: fix mismatched free of HalData in rtw_sdio_if1_init()
From: Dawei Feng @ 2026-05-28 10:15 UTC (permalink / raw)
To: error27
Cc: gregkh, omer.e.idrissi, hansg, hi, straube.linux, xela,
ethantidmore06, liangjie, linux-staging, linux-kernel, jianhao.xu,
stable, zilin
In-Reply-To: <ahfvCpI6YOA9Gpyh@stanley.mountain>
On Thu, May 28, 2026 at 15:30:18 Dan Carpenter wrote:
> > Manual inspection
> > confirms that the issue is still present in current mainline.
> >
> > An x86_64 allyesconfig build showed no new warnings. As we do not have
> > suitable RTL8723BS SDIO hardware to test with, no runtime testing was
> > able to be performed.
>
> to HERE should be put
>
> >
> > Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
> > Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
> > Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
> > ---
> ^^^
> Here under the --- cut off line. We don't need this kind of meta
> commentary about testing in the permanent git log. Otherwise
> the patch is correct.
Hi Dan,
Thank you for the review and for pointing this out.
The reason the manual inspection and testing commentary was placed above
the `---` line is that we were strictly following the example template
provided in Documentation/process/researcher-guidelines.rst.
In the researcher-guidelines[1], the example explicitly places the build
and hardware testing disclaimer before the Signed-off-by tags, which is
why we included it directly in the commit message.
Please let me know if you would like a v2 to adjust the position of the
mentioned commit log details.
[1] https://docs.kernel.org/process/researcher-guidelines.html
Best regards,
Dawei
^ permalink raw reply
* [PATCH] staging: rtl8723bs: remove redundant else after return
From: Tomasz Unger @ 2026-05-28 9:55 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Tomasz Unger
In-Reply-To: <20260528-fix-else-after-return-v1-1-f07ea0f010fb.ref@yahoo.pl>
In enqueue_reorder_recvframe(), the else branch after a return
statement is unnecessary. When a duplicate sequence number is found,
the function returns false immediately, making the else keyword
redundant. Remove else and fix the indentation of the break statement.
Reported by checkpatch.pl with no remaining warnings.
Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 86c5e2c4e7dd..51536f155750 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1789,8 +1789,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un
/* Duplicate entry is found!! Do not insert current entry. */
/* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */
return false;
- else
- break;
+ break;
}
/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */
---
base-commit: 7cb1c5b32a2bfde961fff8d5204526b609bcb30a
change-id: 20260528-fix-else-after-return-1225fa7dec5f
Best regards,
--
Tomasz Unger <tomasz.unger@yahoo.pl>
^ permalink raw reply related
* [PATCH] staging: rtl8723bs: fix spelling mistake found by codespell
From: Tomasz Unger @ 2026-05-28 9:01 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Tomasz Unger
In-Reply-To: <20260528-fix-typo-rtw-mlme-v1-1-2172d3227b00.ref@yahoo.pl>
Corrected typo in comment:
- varable -> variable
Found by codespell.
Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 4fb74729180f..43587a927d17 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -52,7 +52,7 @@ int rtw_init_mlme_priv(struct adapter *padapter)
pmlmepriv->pscanned = NULL;
pmlmepriv->fw_state = WIFI_STATION_STATE; /* Must sync with rtw_wdev_alloc() */
pmlmepriv->cur_network.network.infrastructure_mode = Ndis802_11AutoUnknown;
- pmlmepriv->scan_mode = SCAN_ACTIVE;/* 1: active, 0: passive. Maybe someday we should rename this varable to "active_mode" (Jeff) */
+ pmlmepriv->scan_mode = SCAN_ACTIVE;/* 1: active, 0: passive. Maybe someday we should rename this variable to "active_mode" (Jeff) */
spin_lock_init(&pmlmepriv->lock);
INIT_LIST_HEAD(&pmlmepriv->free_bss_pool.queue);
---
base-commit: 7cb1c5b32a2bfde961fff8d5204526b609bcb30a
change-id: 20260528-fix-typo-rtw-mlme-35be9179cd45
Best regards,
--
Tomasz Unger <tomasz.unger@yahoo.pl>
^ permalink raw reply related
* Re: [PATCH v8 3/3] staging: rtl8723bs: refactor queue priority initialization
From: Dan Carpenter @ 2026-05-28 7:42 UTC (permalink / raw)
To: artur.ugnivenko; +Cc: gregkh, linux-kernel, linux-staging, ahmet
In-Reply-To: <20260525173619.5012-1-artur.ugnivenko@gmx.de>
On Mon, May 25, 2026 at 07:36:19PM +0200, artur.ugnivenko@gmx.de wrote:
> From: Artur Ugnivenko <artur.ugnivenko@gmx.de>
>
> Pack individual priority values into an enum-indexed array
> to simplify the initialization code and prevent passing around
> six loose values as function parameters.
>
> Signed-off-by: Artur Ugnivenko <artur.ugnivenko@gmx.de>
> ---
> Changes in v8:
> - Remove the struct from v7, use an enum-indexed array instead
> - Remove other lines ending in parentheses fixes to keep the
> commit small
> Changes in v7:
> - Add changelog.
> - Add transmit_queues struct in include/drv_types.h to improve
> style of _InitNormalChipRegPriority
> Changes in v6: Make the patch apply to gregkh/staging-testing.
> Changes in v5: No changes in this patch.
> Changes in v4: No changes in this patch.
> Changes in v3: Split the patch into multiple patches.
> Changes in v2: Make patch apply to gregkh/staging-testing.
>
> drivers/staging/rtl8723bs/hal/sdio_halinit.c | 108 +++++++++---------
> drivers/staging/rtl8723bs/include/drv_types.h | 10 ++
> 2 files changed, 65 insertions(+), 53 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> index 6f2aea984b30..01911188fd44 100644
> --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> @@ -188,25 +188,18 @@ static void _InitTxBufferBoundary(struct adapter *padapter)
> rtw_write8(padapter, REG_TDECTRL + 1, txpktbuf_bndy);
> }
>
> -static void _InitNormalChipRegPriority(
> - struct adapter *Adapter,
> - u16 beQ,
> - u16 bkQ,
> - u16 viQ,
> - u16 voQ,
> - u16 mgtQ,
> - u16 hiQ
> -)
> +static void _InitNormalChipRegPriority(struct adapter *Adapter,
> + u16 queues[TX_Q_MAX])
> {
> u16 value16 = (rtw_read16(Adapter, REG_TRXDMA_CTRL) & 0x7);
>
> value16 |=
> - _TXDMA_BEQ_MAP(beQ) |
> - _TXDMA_BKQ_MAP(bkQ) |
> - _TXDMA_VIQ_MAP(viQ) |
> - _TXDMA_VOQ_MAP(voQ) |
> - _TXDMA_MGQ_MAP(mgtQ) |
> - _TXDMA_HIQ_MAP(hiQ);
> + _TXDMA_BEQ_MAP(queues[TX_Q_BE]) |
> + _TXDMA_BKQ_MAP(queues[TX_Q_BK]) |
> + _TXDMA_VIQ_MAP(queues[TX_Q_VI]) |
> + _TXDMA_VOQ_MAP(queues[TX_Q_VO]) |
> + _TXDMA_MGQ_MAP(queues[TX_Q_MGT]) |
> + _TXDMA_HIQ_MAP(queues[TX_Q_HI]);
>
> rtw_write16(Adapter, REG_TRXDMA_CTRL, value16);
> }
> @@ -231,17 +224,18 @@ static void _InitNormalChipOneOutEpPriority(struct adapter *Adapter)
> break;
> }
>
> - _InitNormalChipRegPriority(
> - Adapter, value, value, value, value, value, value
> - );
> + u16 queues[TX_Q_MAX];
Don't declare a variable in the middle of a function.
> +
> + for (int i = 0; i < TX_Q_MAX; i++)
> + queues[i] = value;
>
> + _InitNormalChipRegPriority(Adapter, queues);
> }
>
> static void _InitNormalChipTwoOutEpPriority(struct adapter *Adapter)
> {
> struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
> struct registry_priv *pregistrypriv = &Adapter->registrypriv;
> - u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ;
>
> u16 valueHi = 0;
> u16 valueLow = 0;
> @@ -263,50 +257,58 @@ static void _InitNormalChipTwoOutEpPriority(struct adapter *Adapter)
> break;
> }
>
> + u16 typical_queues[TX_Q_MAX] = {
> + [TX_Q_BE] = valueLow,
> + [TX_Q_BK] = valueLow,
> + [TX_Q_VI] = valueHi,
> + [TX_Q_VO] = valueHi,
> + [TX_Q_MGT] = valueHi,
> + [TX_Q_HI] = valueHi,
> + };
> +
> + u16 wmm_queues[TX_Q_MAX] = {
> + [TX_Q_BE] = valueLow,
> + [TX_Q_BK] = valueHi,
> + [TX_Q_VI] = valueHi,
> + [TX_Q_VO] = valueLow,
> + [TX_Q_MGT] = valueHi,
> + [TX_Q_HI] = valueHi,
> + };
Same.
> +
> if (!pregistrypriv->wifi_spec) {
> - beQ = valueLow;
> - bkQ = valueLow;
> - viQ = valueHi;
> - voQ = valueHi;
> - mgtQ = valueHi;
> - hiQ = valueHi;
> + _InitNormalChipRegPriority(Adapter, typical_queues);
> } else {
> /* for WMM , CONFIG_OUT_EP_WIFI_MODE */
> - beQ = valueLow;
> - bkQ = valueHi;
> - viQ = valueHi;
> - voQ = valueLow;
> - mgtQ = valueHi;
> - hiQ = valueHi;
> + _InitNormalChipRegPriority(Adapter, wmm_queues);
> }
> -
> - _InitNormalChipRegPriority(Adapter, beQ, bkQ, viQ, voQ, mgtQ, hiQ);
> -
> }
>
> static void _InitNormalChipThreeOutEpPriority(struct adapter *padapter)
> {
> struct registry_priv *pregistrypriv = &padapter->registrypriv;
> - u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ;
>
> - if (!pregistrypriv->wifi_spec) {
> - /* typical setting */
> - beQ = QUEUE_LOW;
> - bkQ = QUEUE_LOW;
> - viQ = QUEUE_NORMAL;
> - voQ = QUEUE_HIGH;
> - mgtQ = QUEUE_HIGH;
> - hiQ = QUEUE_HIGH;
> - } else {
> - /* for WMM */
> - beQ = QUEUE_LOW;
> - bkQ = QUEUE_NORMAL;
> - viQ = QUEUE_NORMAL;
> - voQ = QUEUE_HIGH;
> - mgtQ = QUEUE_HIGH;
> - hiQ = QUEUE_HIGH;
> - }
> - _InitNormalChipRegPriority(padapter, beQ, bkQ, viQ, voQ, mgtQ, hiQ);
> + u16 typical_queues[TX_Q_MAX] = {
> + [TX_Q_BE] = QUEUE_LOW,
> + [TX_Q_BK] = QUEUE_LOW,
> + [TX_Q_VI] = QUEUE_NORMAL,
> + [TX_Q_VO] = QUEUE_HIGH,
> + [TX_Q_MGT] = QUEUE_HIGH,
> + [TX_Q_HI] = QUEUE_HIGH,
> + };
> +
No blank lines in the declaration block.
regards,
dan carpenter
> + u16 wmm_queues[TX_Q_MAX] = {
> + [TX_Q_BE] = QUEUE_LOW,
> + [TX_Q_BK] = QUEUE_NORMAL,
> + [TX_Q_VI] = QUEUE_NORMAL,
> + [TX_Q_VO] = QUEUE_HIGH,
> + [TX_Q_MGT] = QUEUE_HIGH,
> + [TX_Q_HI] = QUEUE_HIGH,
> + };
> +
> + if (!pregistrypriv->wifi_spec)
> + _InitNormalChipRegPriority(padapter, typical_queues);
> + else
> + _InitNormalChipRegPriority(padapter, wmm_queues);
> }
>
> static void _InitQueuePriority(struct adapter *Adapter)
> diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
> index 552d0c5fa47f..b2c43f53571a 100644
> --- a/drivers/staging/rtl8723bs/include/drv_types.h
> +++ b/drivers/staging/rtl8723bs/include/drv_types.h
> @@ -373,6 +373,16 @@ struct adapter {
> unsigned char in_cta_test;
> };
>
> +enum transmit_queues {
> + TX_Q_BE = 0,
> + TX_Q_BK,
> + TX_Q_VI,
> + TX_Q_VO,
> + TX_Q_MGT,
> + TX_Q_HI,
> + TX_Q_MAX,
> +};
> +
> #define adapter_to_dvobj(adapter) (adapter->dvobj)
> #define adapter_to_pwrctl(adapter) (dvobj_to_pwrctl(adapter->dvobj))
> #define adapter_wdev_data(adapter) (&((adapter)->wdev_data))
> --
> 2.54.0
^ permalink raw reply
* Re: [PATCH 15/16] media: sun6i-isp: Add support for MC-centric format enumeration
From: arash golgol @ 2026-05-28 7:35 UTC (permalink / raw)
To: Paul Kocialkowski
Cc: linux-media, linux-arm-kernel, linux-sunxi, linux-kernel,
linux-staging, Mauro Carvalho Chehab, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, Greg Kroah-Hartman,
Laurent Pinchart, Nicolas Dufresne
In-Reply-To: <20260518102451.417971-16-paulk@sys-base.io>
Hi Paul,
On Mon, May 18, 2026 at 2:02 PM Paul Kocialkowski <paulk@sys-base.io> wrote:
>
> Just make sure the provided mbus code is supported and carry on with the
> existing implementation since the pixelformat is independent from the
> mbus code.
>
> The params video node only supports a single format and does not care
> about the mbus format, but we can still report MC-centric support.
>
> Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
> ---
> .../staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c | 9 ++++++++-
> drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c | 3 ++-
> 2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c
> index 24e731bcabe9..372b9331bd6d 100644
> --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c
> +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c
> @@ -436,8 +436,14 @@ static int sun6i_isp_capture_querycap(struct file *file, void *priv,
> static int sun6i_isp_capture_enum_fmt(struct file *file, void *priv,
> struct v4l2_fmtdesc *fmtdesc)
> {
> + u32 mbus_code = fmtdesc->mbus_code;
> u32 index = fmtdesc->index;
>
> + if (mbus_code && !sun6i_isp_proc_format_find(mbus_code))
> + return -EINVAL;
> +
> + /* Capture format is independent from proc format. */
> +
> if (index >= ARRAY_SIZE(sun6i_isp_capture_formats))
> return -EINVAL;
>
> @@ -697,7 +703,8 @@ int sun6i_isp_capture_setup(struct sun6i_isp_device *isp_dev)
>
> strscpy(video_dev->name, SUN6I_ISP_CAPTURE_NAME,
> sizeof(video_dev->name));
> - video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> + video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
> + V4L2_CAP_IO_MC;
> video_dev->vfl_dir = VFL_DIR_RX;
> video_dev->release = video_device_release_empty;
> video_dev->fops = &sun6i_isp_capture_fops;
> diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c
> index 0cc48e2bc8c6..2622e5a07817 100644
> --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c
> +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c
> @@ -531,7 +531,8 @@ int sun6i_isp_params_setup(struct sun6i_isp_device *isp_dev)
>
> strscpy(video_dev->name, SUN6I_ISP_PARAMS_NAME,
> sizeof(video_dev->name));
> - video_dev->device_caps = V4L2_CAP_META_OUTPUT | V4L2_CAP_STREAMING;
> + video_dev->device_caps = V4L2_CAP_META_OUTPUT | V4L2_CAP_STREAMING |
> + V4L2_CAP_IO_MC;
> video_dev->vfl_dir = VFL_DIR_TX;
> video_dev->release = video_device_release_empty;
> video_dev->fops = &sun6i_isp_params_fops;
> --
> 2.54.0
>
Tested on a LicheePi Zero Dock (V3s) with the following pipeline:
ov5647 -> sun6i-mipi-csi2 -> sun6i-csi-bridge -> sun6i-isp-proc ->
sun6i-isp-capture
I verified MC-centric format enumeration on the ISP capture node with
multiple mbus codes supported by sun6i-isp-proc.
Tested-by: Arash Golgol <arash.golgol@gmail.com>
--
Regards,
Arash Golgol
^ permalink raw reply
* Re: [PATCH] staging: rtl8723bs: fix mismatched free of HalData in rtw_sdio_if1_init()
From: Dan Carpenter @ 2026-05-28 7:30 UTC (permalink / raw)
To: Dawei Feng
Cc: gregkh, omer.e.idrissi, hansg, hi, straube.linux, xela,
ethantidmore06, liangjie, linux-staging, linux-kernel, jianhao.xu,
Zilin Guan
In-Reply-To: <20260525091836.812565-1-dawei.feng@seu.edu.cn>
On Mon, May 25, 2026 at 05:18:36PM +0800, Dawei Feng wrote:
> padapter->HalData is allocated via vzalloc(), but incorrectly freed
> using kfree() in the rtw_sdio_if1_init() error path. Using kfree() to
> release this vmalloc-backed buffer can lead to memory corruption.
>
> Use rtw_hal_data_deinit() to pair the free correctly and free
> HalData with vfree().
>
> The bug was first flagged by an experimental static analysis tool we
> are developing for kernel memory-management bugs.
The rest of the commit message from HERE
> Manual inspection
> confirms that the issue is still present in current mainline.
>
> An x86_64 allyesconfig build showed no new warnings. As we do not have
> suitable RTL8723BS SDIO hardware to test with, no runtime testing was
> able to be performed.
to HERE should be put
>
> Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
> Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
> Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
> ---
^^^
Here under the --- cut off line. We don't need this kind of meta
commentary about testing in the permanent git log. Otherwise
the patch is correct.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH v3] staging: rtl8723bs: remove unnecessary NULL check before vfree
From: Greg Kroah-Hartman @ 2026-05-28 7:28 UTC (permalink / raw)
To: Bastien Cossette; +Cc: Dan Carpenter, linux-staging
In-Reply-To: <20260528070554.40315-1-bastiencossette29@icloud.com>
On Thu, May 28, 2026 at 03:05:54AM -0400, Bastien Cossette wrote:
> The vfree() function handles NULL pointers natively. Cleaning up the
> redundant if check simplifies the code and adheres to core kernel
> coding styles.
>
> Signed-off-by: Bastien Cossette <bastiencossette29@icloud.com>
> ---
> drivers/staging/rtl8723bs/hal/hal_com.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
> index 728a2171fbcb..00c511b38595 100644
> --- a/drivers/staging/rtl8723bs/hal/hal_com.c
> +++ b/drivers/staging/rtl8723bs/hal/hal_com.c
> @@ -23,14 +23,11 @@ u8 rtw_hal_data_init(struct adapter *padapter)
>
> void rtw_hal_data_deinit(struct adapter *padapter)
> {
> - if (padapter->HalData) {
> - vfree(padapter->HalData);
> - padapter->HalData = NULL;
> - padapter->hal_data_sz = 0;
> - }
> + vfree(padapter->HalData);
> + padapter->HalData = NULL;
> + padapter->hal_data_sz = 0;
> }
>
> -
> void dump_chip_info(struct hal_version chip_version)
> {
> char buf[128];
> --
> 2.53.0
>
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/process/submitting-patches.rst for what
needs to be done here to properly describe this.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply
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