Re: [PATCH v2 00/13] bss_ht struct cleanups
Looks good. Reviewed-by: Dan Carpenter regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v4 3/3] drm/bridge: anx7625: add MIPI DPI input feature support
Hi Hsin-Yi, thanks for the comment, I'll change it in the next serial. As video-interfaces.yaml not exist in drm-next, I'm waiting for 5.12-rc1 to apply to drm-misc, then I'll upstream patch v5. Thanks, Xin On Wed, Feb 24, 2021 at 05:55:39PM +0800, Hsin-Yi Wang wrote: > On Thu, Jan 28, 2021 at 11:10 AM Xin Ji wrote: > > > > Add MIPI rx DPI input support > > > > Reported-by: kernel test robot > > Signed-off-by: Xin Ji > > --- > > drivers/gpu/drm/bridge/analogix/anx7625.c | 326 > > -- > > drivers/gpu/drm/bridge/analogix/anx7625.h | 20 +- > > 2 files changed, 285 insertions(+), 61 deletions(-) > > > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c > > b/drivers/gpu/drm/bridge/analogix/anx7625.c > > index 04536cc..628ae43 100644 > > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > > @@ -150,18 +150,18 @@ static int anx7625_write_and(struct anx7625_data *ctx, > > return anx7625_reg_write(ctx, client, offset, (val & (mask))); > > } > > > > -static int anx7625_write_and_or(struct anx7625_data *ctx, > > - struct i2c_client *client, > > - u8 offset, u8 and_mask, u8 or_mask) > > +static int anx7625_config_bit_matrix(struct anx7625_data *ctx) > > { > > - int val; > > + int i, ret; > > > > - val = anx7625_reg_read(ctx, client, offset); > > - if (val < 0) > > - return val; > > + ret = anx7625_write_or(ctx, ctx->i2c.tx_p2_client, > > + AUDIO_CONTROL_REGISTER, 0x80); > > + for (i = 0; i < 13; i++) > > + ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, > > +VIDEO_BIT_MATRIX_12 + i, > > +0x18 + i); > > > > - return anx7625_reg_write(ctx, client, > > -offset, (val & and_mask) | (or_mask)); > > + return ret; > > } > > > > static int anx7625_read_ctrl_status_p0(struct anx7625_data *ctx) > > @@ -195,6 +195,60 @@ static int wait_aux_op_finish(struct anx7625_data *ctx) > > return 0; > > } > > > > +static int anx7625_aux_dpcd_read(struct anx7625_data *ctx, > > +u8 addrh, u8 addrm, u8 addrl, > > +u8 len, u8 *buf) > > +{ > > + struct device *dev = >client->dev; > > + int ret; > > + u8 cmd; > > + > > + if (len > MAX_DPCD_BUFFER_SIZE) { > > + DRM_DEV_ERROR(dev, "exceed aux buffer len.\n"); > > + return -EINVAL; > > + } > > + > > + cmd = ((len - 1) << 4) | 0x09; > > + > > + /* Set command and length */ > > + ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > > + AP_AUX_COMMAND, cmd); > > + > > + /* Set aux access address */ > > + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > > +AP_AUX_ADDR_7_0, addrl); > > + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > > +AP_AUX_ADDR_15_8, addrm); > > + ret |= anx7625_write_and(ctx, ctx->i2c.rx_p0_client, > > +AP_AUX_ADDR_19_16, addrh); > > + > > + /* Enable aux access */ > > + ret |= anx7625_write_or(ctx, ctx->i2c.rx_p0_client, > > + AP_AUX_CTRL_STATUS, AP_AUX_CTRL_OP_EN); > > + > > + if (ret < 0) { > > + DRM_DEV_ERROR(dev, "cannot access aux related register.\n"); > > + return -EIO; > > + } > > + > > + usleep_range(2000, 2100); > > + > > + ret = wait_aux_op_finish(ctx); > > + if (ret) { > > + DRM_DEV_ERROR(dev, "aux IO error: wait aux op finish.\n"); > > + return ret; > > + } > > + > > + ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client, > > +AP_AUX_BUFF_START, len, buf); > > + if (ret < 0) { > > + DRM_DEV_ERROR(dev, "read dpcd register failed\n"); > > + return -EIO; > > + } > > + > > + return 0; > > +} > > + > > static int anx7625_video_mute_control(struct anx7625_data *ctx, > > u8 status) > > { > > @@ -219,38 +273,6 @@ static int anx7625_video_mute_control(struct > > anx7625_data *ctx, > > return ret; > > } > > > > -static int anx7625_config_audio_input(struct anx7625_data *ctx) > > -{ > > - struct device *dev = >client->dev; > > - int ret; > > - > > - /* Channel num */ > > - ret = anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, > > - AUDIO_CHANNEL_STATUS_6, I2S_CH_2 << 5); > > - > > - /* FS */ > > - ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, > > - AUDIO_CHANNEL_STATUS_4, > > -
[staging:staging-testing] BUILD SUCCESS 281ad9728617c00ad5f76d8307ff7210e0413027
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing branch HEAD: 281ad9728617c00ad5f76d8307ff7210e0413027 staging: wimax: fix code style issues elapsed time: 725m configs tested: 120 configs skipped: 2 The following configs have been built successfully. More configs may be tested in the coming days. gcc tested configs: arm defconfig arm64allyesconfig arm64 defconfig arm allyesconfig arm allmodconfig mips allyesconfig arm milbeaut_m10v_defconfig armvexpress_defconfig sh sh2007_defconfig powerpc kmeter1_defconfig arm collie_defconfig powerpc chrp32_defconfig arm sama5_defconfig powerpc pasemi_defconfig sh se7751_defconfig mips xway_defconfig csky alldefconfig powerpc currituck_defconfig mips tb0226_defconfig sh se7750_defconfig i386 alldefconfig sh kfr2r09-romimage_defconfig m68kmvme16x_defconfig shedosk7705_defconfig arm64alldefconfig mipsmaltaup_xpa_defconfig armhisi_defconfig sh se7619_defconfig mipsworkpad_defconfig sh se7712_defconfig arm netwinder_defconfig powerpc makalu_defconfig mipsvocore2_defconfig powerpc mpc836x_rdk_defconfig sh r7780mp_defconfig powerpc ep8248e_defconfig shtitan_defconfig arm footbridge_defconfig powerpc sequoia_defconfig armmulti_v5_defconfig mips ath79_defconfig mips maltaaprp_defconfig xtensageneric_kc705_defconfig powerpc lite5200b_defconfig powerpc pseries_defconfig mips rs90_defconfig mips mpc30x_defconfig openriscor1ksim_defconfig powerpc mpc5200_defconfig arm at91_dt_defconfig ia64 allmodconfig ia64defconfig ia64 allyesconfig m68k allmodconfig m68kdefconfig m68k allyesconfig nios2 defconfig arc allyesconfig nds32 allnoconfig c6x allyesconfig nds32 defconfig nios2allyesconfig cskydefconfig alpha defconfig alphaallyesconfig xtensa allyesconfig h8300allyesconfig arc defconfig sh allmodconfig parisc defconfig s390 allyesconfig s390 allmodconfig parisc allyesconfig s390defconfig i386 allyesconfig sparcallyesconfig sparc defconfig i386 tinyconfig i386defconfig mips allmodconfig powerpc allyesconfig powerpc allmodconfig powerpc allnoconfig i386 randconfig-a005-20210223 i386 randconfig-a006-20210223 i386 randconfig-a004-20210223 i386 randconfig-a003-20210223 i386 randconfig-a001-20210223 i386 randconfig-a002-20210223 x86_64 randconfig-a015-20210223 x86_64 randconfig-a011-20210223 x86_64 randconfig-a012-20210223 x86_64 randconfig-a016-20210223 x86_64 randconfig-a014-20210223 x86_64 randconfig-a013-20210223 i386 randconfig-a013-20210223 i386 randconfig-a012-20210223 i386 randconfig-a011-20210223 i386 randconfig-a014-20210223 i386 randconfig-a016-20210223 i386
[PATCH v2 13/13] staging: rtl8192e: reformat bss_ht struct
This change uses a space instead of tabs between the type and name of each member of the struct. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl819x_HT.h | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 33a58c87f4c1..ce13b41074a7 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -179,20 +179,20 @@ struct rt_hi_throughput { } __packed; struct bss_ht { - u8 bd_support_ht; + u8 bd_support_ht; - u8 bd_ht_cap_buf[32]; - u16 bd_ht_cap_len; - u8 bd_ht_info_buf[32]; - u16 bd_ht_info_len; + u8 bd_ht_cap_buf[32]; + u16 bd_ht_cap_len; + u8 bd_ht_info_buf[32]; + u16 bd_ht_info_len; enum ht_spec_ver bd_ht_spec_ver; enum ht_channel_width bd_bandwidth; - u8 bd_rt2rt_aggregation; - u8 bd_rt2rt_long_slot_time; - u8 rt2rt_ht_mode; - u8 bd_ht_1r; + u8 bd_rt2rt_aggregation; + u8 bd_rt2rt_long_slot_time; + u8 rt2rt_ht_mode; + u8 bd_ht_1r; }; extern u8 MCS_FILTER_ALL[16]; -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 12/13] staging: rtl8192e: rename bdHT1R to bd_ht_1r in bss_ht struct
Rename bdHT1R to bd_ht_1r to silence a checkpatch warning about CamelCase. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl819x_HT.h | 2 +- drivers/staging/rtl8192e/rtllib_rx.c | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 0b4ff153fdb6..33a58c87f4c1 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -192,7 +192,7 @@ struct bss_ht { u8 bd_rt2rt_aggregation; u8 bd_rt2rt_long_slot_time; u8 rt2rt_ht_mode; - u8 bdHT1R; + u8 bd_ht_1r; }; extern u8 MCS_FILTER_ALL[16]; diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index af93eee57038..b8ab34250e6a 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1860,10 +1860,10 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, } if (*tmp_htcap_len != 0) { network->bssht.bd_support_ht = true; - network->bssht.bdHT1R = struct ht_capab_ele *)(network->bssht.bd_ht_cap_buf))->MCS[1]) == 0); + network->bssht.bd_ht_1r = struct ht_capab_ele *)(network->bssht.bd_ht_cap_buf))->MCS[1]) == 0); } else { network->bssht.bd_support_ht = false; - network->bssht.bdHT1R = false; + network->bssht.bd_ht_1r = false; } } @@ -2028,7 +2028,7 @@ static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element, memcpy(ht->bd_ht_cap_buf, info_element->data, ht->bd_ht_cap_len); ht->bd_support_ht = true; - ht->bdHT1R = struct ht_capab_ele *) + ht->bd_ht_1r = struct ht_capab_ele *) ht->bd_ht_cap_buf))->MCS[1]) == 0; ht->bd_bandwidth = (enum ht_channel_width) @@ -2036,7 +2036,7 @@ static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element, (ht->bd_ht_cap_buf))->ChlWidth); } else { ht->bd_support_ht = false; - ht->bdHT1R = false; + ht->bd_ht_1r = false; ht->bd_bandwidth = HT_CHANNEL_WIDTH_20; } } -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 11/13] staging: rtl8192e: rename RT2RT_HT_Mode to rt2rt_ht_mode in bss_ht struct
Rename RT2RT_HT_Mode to rt2rt_ht_mode to silence a checkpatch warning about CamelCase. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +- drivers/staging/rtl8192e/rtl819x_HT.h| 2 +- drivers/staging/rtl8192e/rtl819x_HTProc.c| 8 drivers/staging/rtl8192e/rtllib_rx.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 8a3316e0bf5e..e85d9c2cdc96 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -376,7 +376,7 @@ static void _rtl92e_update_beacon(void *data) if (ieee->pHTInfo->bCurrentHTSupport) HT_update_self_and_peer_setting(ieee, net); ieee->pHTInfo->bCurrentRT2RTLongSlotTime = net->bssht.bd_rt2rt_long_slot_time; - ieee->pHTInfo->RT2RT_HT_Mode = net->bssht.RT2RT_HT_Mode; + ieee->pHTInfo->RT2RT_HT_Mode = net->bssht.rt2rt_ht_mode; _rtl92e_update_cap(dev, net->capability); } diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index a24551af4a27..0b4ff153fdb6 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -191,7 +191,7 @@ struct bss_ht { u8 bd_rt2rt_aggregation; u8 bd_rt2rt_long_slot_time; - u8 RT2RT_HT_Mode; + u8 rt2rt_ht_mode; u8 bdHT1R; }; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 6ceeaf6eb8d1..cc761d965b1d 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -173,9 +173,9 @@ static void HTIOTPeerDetermine(struct rtllib_device *ieee) if (net->bssht.bd_rt2rt_aggregation) { pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK; - if (net->bssht.RT2RT_HT_Mode & RT_HT_CAP_USE_92SE) + if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_92SE) pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK_92SE; - if (net->bssht.RT2RT_HT_Mode & RT_HT_CAP_USE_SOFTAP) + if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_SOFTAP) pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP; } else if (net->broadcom_cap_exist) { pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM; @@ -699,7 +699,7 @@ void HTInitializeBssDesc(struct bss_ht *pBssHT) pBssHT->bd_rt2rt_aggregation = false; pBssHT->bd_rt2rt_long_slot_time = false; - pBssHT->RT2RT_HT_Mode = (enum rt_ht_capability)0; + pBssHT->rt2rt_ht_mode = (enum rt_ht_capability)0; } void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, @@ -734,7 +734,7 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, pNetwork->bssht.bd_rt2rt_aggregation; pHTInfo->bCurrentRT2RTLongSlotTime = pNetwork->bssht.bd_rt2rt_long_slot_time; - pHTInfo->RT2RT_HT_Mode = pNetwork->bssht.RT2RT_HT_Mode; + pHTInfo->RT2RT_HT_Mode = pNetwork->bssht.rt2rt_ht_mode; } else { pHTInfo->bCurrentRT2RTAggregation = false; pHTInfo->bCurrentRT2RTLongSlotTime = false; diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 036eca477261..af93eee57038 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1908,12 +1908,12 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, if ((ht_realtek_agg_buf[4] == 1) && (ht_realtek_agg_buf[5] & RT_HT_CAP_USE_92SE)) - network->bssht.RT2RT_HT_Mode |= RT_HT_CAP_USE_92SE; + network->bssht.rt2rt_ht_mode |= RT_HT_CAP_USE_92SE; } } if (ht_realtek_agg_len >= 5) { if ((ht_realtek_agg_buf[5] & RT_HT_CAP_USE_SOFTAP)) - network->bssht.RT2RT_HT_Mode |= RT_HT_CAP_USE_SOFTAP; + network->bssht.rt2rt_ht_mode |= RT_HT_CAP_USE_SOFTAP; } if ((info_element->len >= 3 && -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 10/13] staging: rtl8192e: rename bdRT2RTLongSlotTime to bd_rt2rt_long_slot_time in bss_ht struct
Rename bdRT2RTLongSlotTime to bd_rt2rt_long_slot_time to silence a checkpatch warning about CamelCase. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +-- drivers/staging/rtl8192e/rtl819x_HT.h| 2 +- drivers/staging/rtl8192e/rtl819x_HTProc.c| 4 ++-- drivers/staging/rtl8192e/rtllib_rx.c | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 9078fadd65f9..8a3316e0bf5e 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -375,8 +375,7 @@ static void _rtl92e_update_beacon(void *data) if (ieee->pHTInfo->bCurrentHTSupport) HT_update_self_and_peer_setting(ieee, net); - ieee->pHTInfo->bCurrentRT2RTLongSlotTime = -net->bssht.bdRT2RTLongSlotTime; + ieee->pHTInfo->bCurrentRT2RTLongSlotTime = net->bssht.bd_rt2rt_long_slot_time; ieee->pHTInfo->RT2RT_HT_Mode = net->bssht.RT2RT_HT_Mode; _rtl92e_update_cap(dev, net->capability); } diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 6c5255af27fb..a24551af4a27 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -190,7 +190,7 @@ struct bss_ht { enum ht_channel_width bd_bandwidth; u8 bd_rt2rt_aggregation; - u8 bdRT2RTLongSlotTime; + u8 bd_rt2rt_long_slot_time; u8 RT2RT_HT_Mode; u8 bdHT1R; }; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index a3575272e4da..6ceeaf6eb8d1 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -698,7 +698,7 @@ void HTInitializeBssDesc(struct bss_ht *pBssHT) pBssHT->bd_ht_spec_ver = HT_SPEC_VER_IEEE; pBssHT->bd_rt2rt_aggregation = false; - pBssHT->bdRT2RTLongSlotTime = false; + pBssHT->bd_rt2rt_long_slot_time = false; pBssHT->RT2RT_HT_Mode = (enum rt_ht_capability)0; } @@ -733,7 +733,7 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, pHTInfo->bCurrentRT2RTAggregation = pNetwork->bssht.bd_rt2rt_aggregation; pHTInfo->bCurrentRT2RTLongSlotTime = -pNetwork->bssht.bdRT2RTLongSlotTime; +pNetwork->bssht.bd_rt2rt_long_slot_time; pHTInfo->RT2RT_HT_Mode = pNetwork->bssht.RT2RT_HT_Mode; } else { pHTInfo->bCurrentRT2RTAggregation = false; diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 54f3bce46c0d..036eca477261 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1904,7 +1904,7 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, if ((ht_realtek_agg_buf[4] == 1) && (ht_realtek_agg_buf[5] & 0x02)) - network->bssht.bdRT2RTLongSlotTime = true; + network->bssht.bd_rt2rt_long_slot_time = true; if ((ht_realtek_agg_buf[4] == 1) && (ht_realtek_agg_buf[5] & RT_HT_CAP_USE_92SE)) @@ -2467,7 +2467,7 @@ static inline void update_network(struct rtllib_device *ieee, memcpy(dst->bssht.bd_ht_info_buf, src->bssht.bd_ht_info_buf, src->bssht.bd_ht_info_len); dst->bssht.bd_ht_spec_ver = src->bssht.bd_ht_spec_ver; - dst->bssht.bdRT2RTLongSlotTime = src->bssht.bdRT2RTLongSlotTime; + dst->bssht.bd_rt2rt_long_slot_time = src->bssht.bd_rt2rt_long_slot_time; dst->broadcom_cap_exist = src->broadcom_cap_exist; dst->ralink_cap_exist = src->ralink_cap_exist; dst->atheros_cap_exist = src->atheros_cap_exist; -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 09/13] staging: rtl8192e: rename bdRT2RTAggregation to bd_rt2rt_aggregation in bss_ht struct
Rename bdRT2RTAggregation to bd_rt2rt_aggregation to silence a checkpatch warning about CamelCase. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl819x_HT.h | 2 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 10 +- drivers/staging/rtl8192e/rtllib_rx.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index b44fd8e39263..6c5255af27fb 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -189,7 +189,7 @@ struct bss_ht { enum ht_spec_ver bd_ht_spec_ver; enum ht_channel_width bd_bandwidth; - u8 bdRT2RTAggregation; + u8 bd_rt2rt_aggregation; u8 bdRT2RTLongSlotTime; u8 RT2RT_HT_Mode; u8 bdHT1R; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 48a63706b8ba..a3575272e4da 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -158,7 +158,7 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee) !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) || (net->broadcom_cap_exist)) retValue = true; - else if (net->bssht.bdRT2RTAggregation) + else if (net->bssht.bd_rt2rt_aggregation) retValue = true; else retValue = false; @@ -171,7 +171,7 @@ static void HTIOTPeerDetermine(struct rtllib_device *ieee) struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; struct rtllib_network *net = >current_network; - if (net->bssht.bdRT2RTAggregation) { + if (net->bssht.bd_rt2rt_aggregation) { pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK; if (net->bssht.RT2RT_HT_Mode & RT_HT_CAP_USE_92SE) pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK_92SE; @@ -591,7 +591,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee) pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; } else { - if (ieee->current_network.bssht.bdRT2RTAggregation) { + if (ieee->current_network.bssht.bd_rt2rt_aggregation) { if (ieee->pairwise_key_type != KEY_TYPE_NA) pHTInfo->CurrentAMPDUFactor = pPeerHTCap->MaxRxAMPDUFactor; @@ -697,7 +697,7 @@ void HTInitializeBssDesc(struct bss_ht *pBssHT) pBssHT->bd_ht_spec_ver = HT_SPEC_VER_IEEE; - pBssHT->bdRT2RTAggregation = false; + pBssHT->bd_rt2rt_aggregation = false; pBssHT->bdRT2RTLongSlotTime = false; pBssHT->RT2RT_HT_Mode = (enum rt_ht_capability)0; } @@ -731,7 +731,7 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, if (pHTInfo->bRegRT2RTAggregation) { pHTInfo->bCurrentRT2RTAggregation = -pNetwork->bssht.bdRT2RTAggregation; +pNetwork->bssht.bd_rt2rt_aggregation; pHTInfo->bCurrentRT2RTLongSlotTime = pNetwork->bssht.bdRT2RTLongSlotTime; pHTInfo->RT2RT_HT_Mode = pNetwork->bssht.RT2RT_HT_Mode; diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index e95be64edffb..54f3bce46c0d 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1900,7 +1900,7 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, } if (ht_realtek_agg_len >= 5) { network->realtek_cap_exit = true; - network->bssht.bdRT2RTAggregation = true; + network->bssht.bd_rt2rt_aggregation = true; if ((ht_realtek_agg_buf[4] == 1) && (ht_realtek_agg_buf[5] & 0x02)) @@ -2291,7 +2291,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, if (!network->atheros_cap_exist && !network->broadcom_cap_exist && !network->cisco_cap_exist && !network->ralink_cap_exist && - !network->bssht.bdRT2RTAggregation) + !network->bssht.bd_rt2rt_aggregation) network->unknown_cap_exist = true; else network->unknown_cap_exist = false; @@ -2459,7 +2459,7 @@ static inline void update_network(struct rtllib_device *ieee, memcpy(>tim, >tim, sizeof(struct rtllib_tim_parameters)); dst->bssht.bd_support_ht = src->bssht.bd_support_ht; - dst->bssht.bdRT2RTAggregation = src->bssht.bdRT2RTAggregation; + dst->bssht.bd_rt2rt_aggregation = src->bssht.bd_rt2rt_aggregation;
[PATCH v2 07/13] staging: rtl8192e: rename bdHTSpecVer to bd_ht_spec_ver in bss_ht struct
Rename bdHTSpecVer to bd_ht_spec_ver to silence a checkpatch warning about CamelCase. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl819x_HT.h | 2 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 4 ++-- drivers/staging/rtl8192e/rtllib_rx.c | 10 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 1f1bca10753d..b3856044b52f 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -186,7 +186,7 @@ struct bss_ht { u8 bd_ht_info_buf[32]; u16 bd_ht_info_len; - enum ht_spec_ver bdHTSpecVer; + enum ht_spec_ver bd_ht_spec_ver; enum ht_channel_width bdBandWidth; u8 bdRT2RTAggregation; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 1fd912d1cbe2..48a63706b8ba 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -695,7 +695,7 @@ void HTInitializeBssDesc(struct bss_ht *pBssHT) memset(pBssHT->bd_ht_info_buf, 0, sizeof(pBssHT->bd_ht_info_buf)); pBssHT->bd_ht_info_len = 0; - pBssHT->bdHTSpecVer = HT_SPEC_VER_IEEE; + pBssHT->bd_ht_spec_ver = HT_SPEC_VER_IEEE; pBssHT->bdRT2RTAggregation = false; pBssHT->bdRT2RTLongSlotTime = false; @@ -714,7 +714,7 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, */ if (pNetwork->bssht.bd_support_ht) { pHTInfo->bCurrentHTSupport = true; - pHTInfo->ePeerHTSpecVer = pNetwork->bssht.bdHTSpecVer; + pHTInfo->ePeerHTSpecVer = pNetwork->bssht.bd_ht_spec_ver; if (pNetwork->bssht.bd_ht_cap_len > 0 && pNetwork->bssht.bd_ht_cap_len <= sizeof(pHTInfo->PeerHTCapBuf)) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 8c7b0e21de95..0b2618df86aa 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1850,7 +1850,7 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, *tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN); if (*tmp_htcap_len != 0) { - network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; + network->bssht.bd_ht_spec_ver = HT_SPEC_VER_EWC; network->bssht.bd_ht_cap_len = min_t(u16, *tmp_htcap_len, sizeof(network->bssht.bd_ht_cap_buf)); memcpy(network->bssht.bd_ht_cap_buf, @@ -1877,7 +1877,7 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, *tmp_htinfo_len = min_t(u8, info_element->len, MAX_IE_LEN); if (*tmp_htinfo_len != 0) { - network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; + network->bssht.bd_ht_spec_ver = HT_SPEC_VER_EWC; network->bssht.bd_ht_info_len = min_t(u16, *tmp_htinfo_len, sizeof(network->bssht.bd_ht_info_buf)); memcpy(network->bssht.bd_ht_info_buf, @@ -2022,7 +2022,7 @@ static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element, *tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN); if (*tmp_htcap_len != 0) { - ht->bdHTSpecVer = HT_SPEC_VER_EWC; + ht->bd_ht_spec_ver = HT_SPEC_VER_EWC; ht->bd_ht_cap_len = min_t(u16, *tmp_htcap_len, sizeof(ht->bd_ht_cap_buf)); memcpy(ht->bd_ht_cap_buf, info_element->data, ht->bd_ht_cap_len); @@ -2234,7 +2234,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, tmp_htinfo_len = min_t(u8, info_element->len, MAX_IE_LEN); if (tmp_htinfo_len) { - network->bssht.bdHTSpecVer = HT_SPEC_VER_IEEE; + network->bssht.bd_ht_spec_ver = HT_SPEC_VER_IEEE; network->bssht.bd_ht_info_len = tmp_htinfo_len > sizeof(network->bssht.bd_ht_info_buf) ? sizeof(network->bssht.bd_ht_info_buf) : @@ -2466,7 +2466,7 @@ static inline void update_network(struct rtllib_device *ieee, dst->bssht.bd_ht_info_len = src->bssht.bd_ht_info_len; memcpy(dst->bssht.bd_ht_info_buf,
[PATCH v2 08/13] staging: rtl8192e: rename bdBandWidth to bd_bandwidth in bss_ht struct
Rename bdBandWidth to bd_bandwidth to silence a checkpatch warning about CamelCase. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl819x_HT.h | 2 +- drivers/staging/rtl8192e/rtllib_rx.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index b3856044b52f..b44fd8e39263 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -187,7 +187,7 @@ struct bss_ht { u16 bd_ht_info_len; enum ht_spec_ver bd_ht_spec_ver; - enum ht_channel_width bdBandWidth; + enum ht_channel_width bd_bandwidth; u8 bdRT2RTAggregation; u8 bdRT2RTLongSlotTime; diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 0b2618df86aa..e95be64edffb 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -2031,13 +2031,13 @@ static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element, ht->bdHT1R = struct ht_capab_ele *) ht->bd_ht_cap_buf))->MCS[1]) == 0; - ht->bdBandWidth = (enum ht_channel_width) + ht->bd_bandwidth = (enum ht_channel_width) (((struct ht_capab_ele *) (ht->bd_ht_cap_buf))->ChlWidth); } else { ht->bd_support_ht = false; ht->bdHT1R = false; - ht->bdBandWidth = HT_CHANNEL_WIDTH_20; + ht->bd_bandwidth = HT_CHANNEL_WIDTH_20; } } -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 06/13] staging: rtl8192e: rename bdHTInfoLen to bd_ht_info_len in bss_ht struct
Rename bdHTInfoLen to bd_ht_info_len to silence a checkpatch warning about CamelCase. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl819x_HT.h | 2 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 10 +- drivers/staging/rtl8192e/rtllib_rx.c | 14 +++--- drivers/staging/rtl8192e/rtllib_softmac.c | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 29650e55361a..1f1bca10753d 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -184,7 +184,7 @@ struct bss_ht { u8 bd_ht_cap_buf[32]; u16 bd_ht_cap_len; u8 bd_ht_info_buf[32]; - u16 bdHTInfoLen; + u16 bd_ht_info_len; enum ht_spec_ver bdHTSpecVer; enum ht_channel_width bdBandWidth; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 93fd73a7203b..1fd912d1cbe2 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -693,7 +693,7 @@ void HTInitializeBssDesc(struct bss_ht *pBssHT) memset(pBssHT->bd_ht_cap_buf, 0, sizeof(pBssHT->bd_ht_cap_buf)); pBssHT->bd_ht_cap_len = 0; memset(pBssHT->bd_ht_info_buf, 0, sizeof(pBssHT->bd_ht_info_buf)); - pBssHT->bdHTInfoLen = 0; + pBssHT->bd_ht_info_len = 0; pBssHT->bdHTSpecVer = HT_SPEC_VER_IEEE; @@ -722,12 +722,12 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, pNetwork->bssht.bd_ht_cap_buf, pNetwork->bssht.bd_ht_cap_len); - if (pNetwork->bssht.bdHTInfoLen > 0 && - pNetwork->bssht.bdHTInfoLen <= + if (pNetwork->bssht.bd_ht_info_len > 0 && + pNetwork->bssht.bd_ht_info_len <= sizeof(pHTInfo->PeerHTInfoBuf)) memcpy(pHTInfo->PeerHTInfoBuf, pNetwork->bssht.bd_ht_info_buf, - pNetwork->bssht.bdHTInfoLen); + pNetwork->bssht.bd_ht_info_len); if (pHTInfo->bRegRT2RTAggregation) { pHTInfo->bCurrentRT2RTAggregation = @@ -786,7 +786,7 @@ void HT_update_self_and_peer_setting(struct rtllib_device *ieee, (struct ht_info_ele *)pNetwork->bssht.bd_ht_info_buf; if (pHTInfo->bCurrentHTSupport) { - if (pNetwork->bssht.bdHTInfoLen != 0) + if (pNetwork->bssht.bd_ht_info_len != 0) pHTInfo->CurrentOpMode = pPeerHTInfo->OptMode; } } diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 5facd55839f5..8c7b0e21de95 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1878,11 +1878,11 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, MAX_IE_LEN); if (*tmp_htinfo_len != 0) { network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; - network->bssht.bdHTInfoLen = min_t(u16, *tmp_htinfo_len, - sizeof(network->bssht.bd_ht_info_buf)); + network->bssht.bd_ht_info_len = min_t(u16, *tmp_htinfo_len, + sizeof(network->bssht.bd_ht_info_buf)); memcpy(network->bssht.bd_ht_info_buf, info_element->data, - network->bssht.bdHTInfoLen); + network->bssht.bd_ht_info_len); } } } @@ -2235,13 +2235,13 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, MAX_IE_LEN); if (tmp_htinfo_len) { network->bssht.bdHTSpecVer = HT_SPEC_VER_IEEE; - network->bssht.bdHTInfoLen = tmp_htinfo_len > + network->bssht.bd_ht_info_len = tmp_htinfo_len > sizeof(network->bssht.bd_ht_info_buf) ? sizeof(network->bssht.bd_ht_info_buf) : tmp_htinfo_len; memcpy(network->bssht.bd_ht_info_buf, info_element->data, - network->bssht.bdHTInfoLen); +
[PATCH v2 05/13] staging: rtl8192e: rename bdHTInfoBuf to bd_ht_info_buf in bss_ht struct
Rename bdHTInfoBuf to bd_ht_info_buf to silence a checkpatch warning about CamelCase. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl819x_HT.h | 2 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 6 +++--- drivers/staging/rtl8192e/rtllib_rx.c | 13 +++-- drivers/staging/rtl8192e/rtllib_softmac.c | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index cd5dc4a3abe3..29650e55361a 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -183,7 +183,7 @@ struct bss_ht { u8 bd_ht_cap_buf[32]; u16 bd_ht_cap_len; - u8 bdHTInfoBuf[32]; + u8 bd_ht_info_buf[32]; u16 bdHTInfoLen; enum ht_spec_ver bdHTSpecVer; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 786df3fbedc2..93fd73a7203b 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -692,7 +692,7 @@ void HTInitializeBssDesc(struct bss_ht *pBssHT) pBssHT->bd_support_ht = false; memset(pBssHT->bd_ht_cap_buf, 0, sizeof(pBssHT->bd_ht_cap_buf)); pBssHT->bd_ht_cap_len = 0; - memset(pBssHT->bdHTInfoBuf, 0, sizeof(pBssHT->bdHTInfoBuf)); + memset(pBssHT->bd_ht_info_buf, 0, sizeof(pBssHT->bd_ht_info_buf)); pBssHT->bdHTInfoLen = 0; pBssHT->bdHTSpecVer = HT_SPEC_VER_IEEE; @@ -726,7 +726,7 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, pNetwork->bssht.bdHTInfoLen <= sizeof(pHTInfo->PeerHTInfoBuf)) memcpy(pHTInfo->PeerHTInfoBuf, - pNetwork->bssht.bdHTInfoBuf, + pNetwork->bssht.bd_ht_info_buf, pNetwork->bssht.bdHTInfoLen); if (pHTInfo->bRegRT2RTAggregation) { @@ -783,7 +783,7 @@ void HT_update_self_and_peer_setting(struct rtllib_device *ieee, { struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; struct ht_info_ele *pPeerHTInfo = -(struct ht_info_ele *)pNetwork->bssht.bdHTInfoBuf; +(struct ht_info_ele *)pNetwork->bssht.bd_ht_info_buf; if (pHTInfo->bCurrentHTSupport) { if (pNetwork->bssht.bdHTInfoLen != 0) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 697fd7fcb48b..5facd55839f5 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1878,8 +1878,9 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, MAX_IE_LEN); if (*tmp_htinfo_len != 0) { network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; - network->bssht.bdHTInfoLen = min_t(u16, *tmp_htinfo_len, sizeof(network->bssht.bdHTInfoBuf)); - memcpy(network->bssht.bdHTInfoBuf, + network->bssht.bdHTInfoLen = min_t(u16, *tmp_htinfo_len, + sizeof(network->bssht.bd_ht_info_buf)); + memcpy(network->bssht.bd_ht_info_buf, info_element->data, network->bssht.bdHTInfoLen); } @@ -2235,10 +2236,10 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, if (tmp_htinfo_len) { network->bssht.bdHTSpecVer = HT_SPEC_VER_IEEE; network->bssht.bdHTInfoLen = tmp_htinfo_len > - sizeof(network->bssht.bdHTInfoBuf) ? - sizeof(network->bssht.bdHTInfoBuf) : + sizeof(network->bssht.bd_ht_info_buf) ? + sizeof(network->bssht.bd_ht_info_buf) : tmp_htinfo_len; - memcpy(network->bssht.bdHTInfoBuf, + memcpy(network->bssht.bd_ht_info_buf, info_element->data, network->bssht.bdHTInfoLen); } @@ -2463,7 +2464,7 @@ static inline void update_network(struct rtllib_device *ieee, memcpy(dst->bssht.bd_ht_cap_buf, src->bssht.bd_ht_cap_buf, src->bssht.bd_ht_cap_len); dst->bssht.bdHTInfoLen = src->bssht.bdHTInfoLen; - memcpy(dst->bssht.bdHTInfoBuf, src->bssht.bdHTInfoBuf, +
[PATCH v2 04/13] staging: rtl8192e: rename bdHTCapLen to bd_ht_cap_len in bss_ht struct
Rename bdHTCapLen to bd_ht_cap_len to silence a checkpatch warning about CamelCase. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl819x_HT.h | 2 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 8 drivers/staging/rtl8192e/rtllib_rx.c | 12 ++-- drivers/staging/rtl8192e/rtllib_softmac.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 3b7b480a42b3..cd5dc4a3abe3 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -182,7 +182,7 @@ struct bss_ht { u8 bd_support_ht; u8 bd_ht_cap_buf[32]; - u16 bdHTCapLen; + u16 bd_ht_cap_len; u8 bdHTInfoBuf[32]; u16 bdHTInfoLen; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 14c00c6f7df5..786df3fbedc2 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -691,7 +691,7 @@ void HTInitializeBssDesc(struct bss_ht *pBssHT) pBssHT->bd_support_ht = false; memset(pBssHT->bd_ht_cap_buf, 0, sizeof(pBssHT->bd_ht_cap_buf)); - pBssHT->bdHTCapLen = 0; + pBssHT->bd_ht_cap_len = 0; memset(pBssHT->bdHTInfoBuf, 0, sizeof(pBssHT->bdHTInfoBuf)); pBssHT->bdHTInfoLen = 0; @@ -716,11 +716,11 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, pHTInfo->bCurrentHTSupport = true; pHTInfo->ePeerHTSpecVer = pNetwork->bssht.bdHTSpecVer; - if (pNetwork->bssht.bdHTCapLen > 0 && - pNetwork->bssht.bdHTCapLen <= sizeof(pHTInfo->PeerHTCapBuf)) + if (pNetwork->bssht.bd_ht_cap_len > 0 && + pNetwork->bssht.bd_ht_cap_len <= sizeof(pHTInfo->PeerHTCapBuf)) memcpy(pHTInfo->PeerHTCapBuf, pNetwork->bssht.bd_ht_cap_buf, - pNetwork->bssht.bdHTCapLen); + pNetwork->bssht.bd_ht_cap_len); if (pNetwork->bssht.bdHTInfoLen > 0 && pNetwork->bssht.bdHTInfoLen <= diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 2abda3d3174f..697fd7fcb48b 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1851,11 +1851,11 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, MAX_IE_LEN); if (*tmp_htcap_len != 0) { network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; - network->bssht.bdHTCapLen = min_t(u16, *tmp_htcap_len, + network->bssht.bd_ht_cap_len = min_t(u16, *tmp_htcap_len, sizeof(network->bssht.bd_ht_cap_buf)); memcpy(network->bssht.bd_ht_cap_buf, info_element->data, - network->bssht.bdHTCapLen); + network->bssht.bd_ht_cap_len); } } if (*tmp_htcap_len != 0) { @@ -2022,9 +2022,9 @@ static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element, *tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN); if (*tmp_htcap_len != 0) { ht->bdHTSpecVer = HT_SPEC_VER_EWC; - ht->bdHTCapLen = min_t(u16, *tmp_htcap_len, + ht->bd_ht_cap_len = min_t(u16, *tmp_htcap_len, sizeof(ht->bd_ht_cap_buf)); - memcpy(ht->bd_ht_cap_buf, info_element->data, ht->bdHTCapLen); + memcpy(ht->bd_ht_cap_buf, info_element->data, ht->bd_ht_cap_len); ht->bd_support_ht = true; ht->bdHT1R = struct ht_capab_ele *) @@ -2459,9 +2459,9 @@ static inline void update_network(struct rtllib_device *ieee, dst->bssht.bd_support_ht = src->bssht.bd_support_ht; dst->bssht.bdRT2RTAggregation = src->bssht.bdRT2RTAggregation; - dst->bssht.bdHTCapLen = src->bssht.bdHTCapLen; + dst->bssht.bd_ht_cap_len = src->bssht.bd_ht_cap_len; memcpy(dst->bssht.bd_ht_cap_buf, src->bssht.bd_ht_cap_buf, - src->bssht.bdHTCapLen); + src->bssht.bd_ht_cap_len); dst->bssht.bdHTInfoLen = src->bssht.bdHTInfoLen; memcpy(dst->bssht.bdHTInfoBuf, src->bssht.bdHTInfoBuf, src->bssht.bdHTInfoLen); diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c
[PATCH v2 01/13] staging: rtl8192e: remove blank line in bss_ht struct
Fix a checkpatch warning about a blank line after an open curly brace. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl819x_HT.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 11269fe6b395..1bbb9ed18e6d 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -179,7 +179,6 @@ struct rt_hi_throughput { } __packed; struct bss_ht { - u8 bdSupportHT; u8 bdHTCapBuf[32]; -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 02/13] staging: rtl8192e: rename bdSupportHT to bd_support_ht in bss_ht struct
Rename bdSupportHT to bd_support_ht to silence a checkpatch warning about CamelCase. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl819x_HT.h | 2 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 4 ++-- drivers/staging/rtl8192e/rtllib_rx.c | 14 +++--- drivers/staging/rtl8192e/rtllib_softmac.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 1bbb9ed18e6d..71a078c0d5f5 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -179,7 +179,7 @@ struct rt_hi_throughput { } __packed; struct bss_ht { - u8 bdSupportHT; + u8 bd_support_ht; u8 bdHTCapBuf[32]; u16 bdHTCapLen; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 9377e48c3f32..444f8ce6a170 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -689,7 +689,7 @@ void HTInitializeHTInfo(struct rtllib_device *ieee) void HTInitializeBssDesc(struct bss_ht *pBssHT) { - pBssHT->bdSupportHT = false; + pBssHT->bd_support_ht = false; memset(pBssHT->bdHTCapBuf, 0, sizeof(pBssHT->bdHTCapBuf)); pBssHT->bdHTCapLen = 0; memset(pBssHT->bdHTInfoBuf, 0, sizeof(pBssHT->bdHTInfoBuf)); @@ -712,7 +712,7 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, /* unmark bEnableHT flag here is the same reason why unmarked in * function rtllib_softmac_new_net. WB 2008.09.10 */ - if (pNetwork->bssht.bdSupportHT) { + if (pNetwork->bssht.bd_support_ht) { pHTInfo->bCurrentHTSupport = true; pHTInfo->ePeerHTSpecVer = pNetwork->bssht.bdHTSpecVer; diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 66c135321da4..98d7b9ba6099 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1858,10 +1858,10 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, } } if (*tmp_htcap_len != 0) { - network->bssht.bdSupportHT = true; + network->bssht.bd_support_ht = true; network->bssht.bdHT1R = struct ht_capab_ele *)(network->bssht.bdHTCapBuf))->MCS[1]) == 0); } else { - network->bssht.bdSupportHT = false; + network->bssht.bd_support_ht = false; network->bssht.bdHT1R = false; } } @@ -1885,7 +1885,7 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, } } - if (network->bssht.bdSupportHT) { + if (network->bssht.bd_support_ht) { if (info_element->len >= 4 && info_element->data[0] == 0x00 && info_element->data[1] == 0xe0 && @@ -2025,7 +2025,7 @@ static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element, sizeof(ht->bdHTCapBuf)); memcpy(ht->bdHTCapBuf, info_element->data, ht->bdHTCapLen); - ht->bdSupportHT = true; + ht->bd_support_ht = true; ht->bdHT1R = struct ht_capab_ele *) ht->bdHTCapBuf))->MCS[1]) == 0; @@ -2033,7 +2033,7 @@ static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element, (((struct ht_capab_ele *) (ht->bdHTCapBuf))->ChlWidth); } else { - ht->bdSupportHT = false; + ht->bd_support_ht = false; ht->bdHT1R = false; ht->bdBandWidth = HT_CHANNEL_WIDTH_20; } @@ -2380,7 +2380,7 @@ static inline int rtllib_network_init( return 1; } - if (network->bssht.bdSupportHT) { + if (network->bssht.bd_support_ht) { if (network->mode == IEEE_A) network->mode = IEEE_N_5G; else if (network->mode & (IEEE_G | IEEE_B)) @@ -2456,7 +2456,7 @@ static inline void update_network(struct rtllib_device *ieee, dst->last_dtim_sta_time = src->last_dtim_sta_time; memcpy(>tim, >tim, sizeof(struct rtllib_tim_parameters)); - dst->bssht.bdSupportHT = src->bssht.bdSupportHT; + dst->bssht.bd_support_ht = src->bssht.bd_support_ht; dst->bssht.bdRT2RTAggregation = src->bssht.bdRT2RTAggregation; dst->bssht.bdHTCapLen = src->bssht.bdHTCapLen; memcpy(dst->bssht.bdHTCapBuf, src->bssht.bdHTCapBuf, diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c
[PATCH v2 03/13] staging: rtl8192e: rename bdHTCapBuf to bd_ht_cap_buf in bss_ht struct
Rename bdHTCapBuf to bd_ht_cap_buf to silence a checkpatch warning about CamelCase. Signed-off-by: William Durand --- drivers/staging/rtl8192e/rtl819x_HT.h | 2 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 4 ++-- drivers/staging/rtl8192e/rtllib_rx.c | 17 + drivers/staging/rtl8192e/rtllib_softmac.c | 2 +- drivers/staging/rtl8192e/rtllib_wx.c | 6 +++--- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 71a078c0d5f5..3b7b480a42b3 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -181,7 +181,7 @@ struct rt_hi_throughput { struct bss_ht { u8 bd_support_ht; - u8 bdHTCapBuf[32]; + u8 bd_ht_cap_buf[32]; u16 bdHTCapLen; u8 bdHTInfoBuf[32]; u16 bdHTInfoLen; diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 444f8ce6a170..14c00c6f7df5 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -690,7 +690,7 @@ void HTInitializeBssDesc(struct bss_ht *pBssHT) { pBssHT->bd_support_ht = false; - memset(pBssHT->bdHTCapBuf, 0, sizeof(pBssHT->bdHTCapBuf)); + memset(pBssHT->bd_ht_cap_buf, 0, sizeof(pBssHT->bd_ht_cap_buf)); pBssHT->bdHTCapLen = 0; memset(pBssHT->bdHTInfoBuf, 0, sizeof(pBssHT->bdHTInfoBuf)); pBssHT->bdHTInfoLen = 0; @@ -719,7 +719,7 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, if (pNetwork->bssht.bdHTCapLen > 0 && pNetwork->bssht.bdHTCapLen <= sizeof(pHTInfo->PeerHTCapBuf)) memcpy(pHTInfo->PeerHTCapBuf, - pNetwork->bssht.bdHTCapBuf, + pNetwork->bssht.bd_ht_cap_buf, pNetwork->bssht.bdHTCapLen); if (pNetwork->bssht.bdHTInfoLen > 0 && diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 98d7b9ba6099..2abda3d3174f 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1851,15 +1851,16 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, MAX_IE_LEN); if (*tmp_htcap_len != 0) { network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; - network->bssht.bdHTCapLen = min_t(u16, *tmp_htcap_len, sizeof(network->bssht.bdHTCapBuf)); - memcpy(network->bssht.bdHTCapBuf, + network->bssht.bdHTCapLen = min_t(u16, *tmp_htcap_len, + sizeof(network->bssht.bd_ht_cap_buf)); + memcpy(network->bssht.bd_ht_cap_buf, info_element->data, network->bssht.bdHTCapLen); } } if (*tmp_htcap_len != 0) { network->bssht.bd_support_ht = true; - network->bssht.bdHT1R = struct ht_capab_ele *)(network->bssht.bdHTCapBuf))->MCS[1]) == 0); + network->bssht.bdHT1R = struct ht_capab_ele *)(network->bssht.bd_ht_cap_buf))->MCS[1]) == 0); } else { network->bssht.bd_support_ht = false; network->bssht.bdHT1R = false; @@ -2022,16 +2023,16 @@ static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element, if (*tmp_htcap_len != 0) { ht->bdHTSpecVer = HT_SPEC_VER_EWC; ht->bdHTCapLen = min_t(u16, *tmp_htcap_len, - sizeof(ht->bdHTCapBuf)); - memcpy(ht->bdHTCapBuf, info_element->data, ht->bdHTCapLen); + sizeof(ht->bd_ht_cap_buf)); + memcpy(ht->bd_ht_cap_buf, info_element->data, ht->bdHTCapLen); ht->bd_support_ht = true; ht->bdHT1R = struct ht_capab_ele *) - ht->bdHTCapBuf))->MCS[1]) == 0; + ht->bd_ht_cap_buf))->MCS[1]) == 0; ht->bdBandWidth = (enum ht_channel_width) (((struct ht_capab_ele *) -(ht->bdHTCapBuf))->ChlWidth); +(ht->bd_ht_cap_buf))->ChlWidth); } else { ht->bd_support_ht = false; ht->bdHT1R = false; @@
[PATCH v2 00/13] bss_ht struct cleanups
This patchset fixes the checkpatch issues related to the `bss_ht` struct defined in `rtl8192e/rtl819x_HT.h` (avoid camelcase). The first patch removes a blank line and the last patch reformats the struct a bit to be more consistent with the other types defined in the same file. Changes in v2: Updated commit messages as per Dan Carpenter recommendation William Durand (13): staging: rtl8192e: remove blank line in bss_ht struct staging: rtl8192e: rename bdSupportHT to bd_support_ht in bss_ht struct staging: rtl8192e: rename bdHTCapBuf to bd_ht_cap_buf in bss_ht struct staging: rtl8192e: rename bdHTCapLen to bd_ht_cap_len in bss_ht struct staging: rtl8192e: rename bdHTInfoBuf to bd_ht_info_buf in bss_ht struct staging: rtl8192e: rename bdHTInfoLen to bd_ht_info_len in bss_ht struct staging: rtl8192e: rename bdHTSpecVer to bd_ht_spec_ver in bss_ht struct staging: rtl8192e: rename bdBandWidth to bd_bandwidth in bss_ht struct staging: rtl8192e: rename bdRT2RTAggregation to bd_rt2rt_aggregation in bss_ht struct staging: rtl8192e: rename bdRT2RTLongSlotTime to bd_rt2rt_long_slot_time in bss_ht struct staging: rtl8192e: rename RT2RT_HT_Mode to rt2rt_ht_mode in bss_ht struct staging: rtl8192e: rename bdHT1R to bd_ht_1r in bss_ht struct staging: rtl8192e: reformat bss_ht struct drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 5 +- drivers/staging/rtl8192e/rtl819x_HT.h| 23 +++-- drivers/staging/rtl8192e/rtl819x_HTProc.c| 58 ++-- drivers/staging/rtl8192e/rtllib_rx.c | 96 ++-- drivers/staging/rtl8192e/rtllib_softmac.c| 12 +-- drivers/staging/rtl8192e/rtllib_wx.c | 6 +- 6 files changed, 100 insertions(+), 100 deletions(-) -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/13] staging: rtl8192e: remove blank line in bss_ht struct
> All these patches have the same vague commit message. It's okay if the > commit message basically restates the commit one line summary. It > should say something like: > > Fix a checkpatch warning about a blank line after an open curly brace. > > Rename FooBar to foo_bar to silence a checkpatch warning about > CamelCase. Thanks, I'll update the patchset! ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/2] fix sparse warnings
On Wed, Feb 24, 2021 at 06:06:48PM +0300, Dan Carpenter wrote: > On Wed, Feb 24, 2021 at 08:26:41PM +0530, karthek wrote: > > On Sun, Feb 21, 2021 at 09:00:48PM +0530, karthik alapati wrote: > > > the following patches fixes two byte-order issues > > > and fixes these sparse warnings > > > > > > > > > drivers/staging//wimax/i2400m/op-rfkill.c:89:25: warning: incorrect type > > > in assignment (different base types) > > > drivers/staging//wimax/i2400m/op-rfkill.c:89:25:expected restricted > > > __le16 [usertype] length > > > drivers/staging//wimax/i2400m/op-rfkill.c:89:25:got unsigned long > > > . > > > drivers/staging//wimax/i2400m/fw.c:514:27: warning: restricted __le32 > > > degrades to integer > > > > > > > > > karthik alapati (2): > > > staging: wimax/i2400m: fix byte-order issue > > > staging: wimax/i2400m: convert __le32 type to host byte-order > > > > > > drivers/staging/wimax/i2400m/fw.c| 2 +- > > > drivers/staging/wimax/i2400m/op-rfkill.c | 2 +- > > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > > > -- > > > 2.30.1 > > > > > ping? > > The merge window is open so no one is merging these types of fixes now. > Wait until -rc1 is out, and then give the maintainer two weeks to look > at your patch and get back to you. > > regards, > dan carpenter > thanks dan, Got it. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v10 5/9] staging: clocking-wizard: Add support for dynamic reconfiguration
The patch adds support for dynamic reconfiguration of clock output rate. Output clocks are registered as dividers and set rate callback function is used for dynamic reconfiguration. Signed-off-by: Shubhrajyoti Datta Co-developed-by: Chirag Parekh --- v6: Remove the typecast. use min for capping frequency. use polled timeout v7: Use devm functions Add the spinlock v10: Add a codeveloped by tag. .../clocking-wizard/clk-xlnx-clock-wizard.c| 178 - 1 file changed, 173 insertions(+), 5 deletions(-) diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index e08fc2f..b1bfdb86 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -15,6 +15,7 @@ #include #include #include +#include #define WZRD_NUM_OUTPUTS 7 #define WZRD_ACLK_MAX_FREQ 25000UL @@ -29,8 +30,24 @@ #define WZRD_DIVCLK_DIVIDE_SHIFT 0 #define WZRD_DIVCLK_DIVIDE_MASK(0xff << WZRD_DIVCLK_DIVIDE_SHIFT) #define WZRD_CLKOUT_DIVIDE_SHIFT 0 +#define WZRD_CLKOUT_DIVIDE_WIDTH 8 #define WZRD_CLKOUT_DIVIDE_MASK(0xff << WZRD_DIVCLK_DIVIDE_SHIFT) +#define WZRD_DR_MAX_INT_DIV_VALUE 255 +#define WZRD_DR_STATUS_REG_OFFSET 0x04 +#define WZRD_DR_LOCK_BIT_MASK 0x0001 +#define WZRD_DR_INIT_REG_OFFSET0x25C +#define WZRD_DR_DIV_TO_PHASE_OFFSET4 +#define WZRD_DR_BEGIN_DYNA_RECONF 0x03 + +#define WZRD_USEC_POLL 10 +#define WZRD_TIMEOUT_POLL 1000 +/* Get the mask from width */ +#define div_mask(width)((1 << (width)) - 1) + +/* Extract divider instance from clock hardware instance */ +#define to_clk_wzrd_divider(_hw) container_of(_hw, struct clk_wzrd_divider, hw) + enum clk_wzrd_int_clks { wzrd_clk_mul, wzrd_clk_mul_div, @@ -62,6 +79,29 @@ struct clk_wzrd { bool suspended; }; +/** + * struct clk_wzrd_divider - clock divider specific to clk_wzrd + * + * @hw:handle between common and hardware-specific interfaces + * @base: base address of register containing the divider + * @offset:offset address of register containing the divider + * @shift: shift to the divider bit field + * @width: width of the divider bit field + * @flags: clk_wzrd divider flags + * @table: array of value/divider pairs, last entry should have div = 0 + * @lock: register lock + */ +struct clk_wzrd_divider { + struct clk_hw hw; + void __iomem *base; + u16 offset; + u8 shift; + u8 width; + u8 flags; + const struct clk_div_table *table; + spinlock_t *lock; /* divider lock */ +}; + #define to_clk_wzrd(_nb) container_of(_nb, struct clk_wzrd, nb) /* maximum frequencies for input/output clocks per speed grade */ @@ -71,6 +111,131 @@ static const unsigned long clk_wzrd_max_freq[] = { 106600UL }; +/* spin lock variable for clk_wzrd */ +static DEFINE_SPINLOCK(clkwzrd_lock); + +static unsigned long clk_wzrd_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw); + void __iomem *div_addr = divider->base + divider->offset; + unsigned int val; + + val = readl(div_addr) >> divider->shift; + val &= div_mask(divider->width); + + return divider_recalc_rate(hw, parent_rate, val, divider->table, + divider->flags, divider->width); +} + +static int clk_wzrd_dynamic_reconfig(struct clk_hw *hw, unsigned long rate, +unsigned long parent_rate) +{ + int err; + u32 value; + unsigned long flags = 0; + struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw); + void __iomem *div_addr = divider->base + divider->offset; + + if (divider->lock) + spin_lock_irqsave(divider->lock, flags); + else + __acquire(divider->lock); + + value = DIV_ROUND_CLOSEST(parent_rate, rate); + + /* Cap the value to max */ + min_t(u32, value, WZRD_DR_MAX_INT_DIV_VALUE); + + /* Set divisor and clear phase offset */ + writel(value, div_addr); + writel(0x00, div_addr + WZRD_DR_DIV_TO_PHASE_OFFSET); + + /* Check status register */ + err = readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET, +value, value & WZRD_DR_LOCK_BIT_MASK, +WZRD_USEC_POLL, WZRD_TIMEOUT_POLL); + if (err) + goto err_reconfig; + + /* Initiate reconfiguration */ + writel(WZRD_DR_BEGIN_DYNA_RECONF, + divider->base + WZRD_DR_INIT_REG_OFFSET); + + /* Check status register */ + err = readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET, +
Re: [PATCH 0/2] fix sparse warnings
On Wed, Feb 24, 2021 at 08:26:41PM +0530, karthek wrote: > On Sun, Feb 21, 2021 at 09:00:48PM +0530, karthik alapati wrote: > > the following patches fixes two byte-order issues > > and fixes these sparse warnings > > > > > > drivers/staging//wimax/i2400m/op-rfkill.c:89:25: warning: incorrect type in > > assignment (different base types) > > drivers/staging//wimax/i2400m/op-rfkill.c:89:25:expected restricted > > __le16 [usertype] length > > drivers/staging//wimax/i2400m/op-rfkill.c:89:25:got unsigned long > > . > > drivers/staging//wimax/i2400m/fw.c:514:27: warning: restricted __le32 > > degrades to integer > > > > > > karthik alapati (2): > > staging: wimax/i2400m: fix byte-order issue > > staging: wimax/i2400m: convert __le32 type to host byte-order > > > > drivers/staging/wimax/i2400m/fw.c| 2 +- > > drivers/staging/wimax/i2400m/op-rfkill.c | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > -- > > 2.30.1 > > > ping? The merge window is open so no one is merging these types of fixes now. Wait until -rc1 is out, and then give the maintainer two weeks to look at your patch and get back to you. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/2] fix sparse warnings
On Sun, Feb 21, 2021 at 09:00:48PM +0530, karthik alapati wrote: > the following patches fixes two byte-order issues > and fixes these sparse warnings > > > drivers/staging//wimax/i2400m/op-rfkill.c:89:25: warning: incorrect type in > assignment (different base types) > drivers/staging//wimax/i2400m/op-rfkill.c:89:25:expected restricted > __le16 [usertype] length > drivers/staging//wimax/i2400m/op-rfkill.c:89:25:got unsigned long > . > drivers/staging//wimax/i2400m/fw.c:514:27: warning: restricted __le32 > degrades to integer > > > karthik alapati (2): > staging: wimax/i2400m: fix byte-order issue > staging: wimax/i2400m: convert __le32 type to host byte-order > > drivers/staging/wimax/i2400m/fw.c| 2 +- > drivers/staging/wimax/i2400m/op-rfkill.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > -- > 2.30.1 > ping? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v10 7/9] staging: clocking-wizard: Remove the hardcoding of the clock outputs
The number of output clocks are configurable in the hardware. Currently the driver registers the maximum number of outputs. Fix the same by registering only the outputs that are there. Signed-off-by: Shubhrajyoti Datta --- v10: generate the names runtime. drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index a70f09e..b0ced42 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -517,16 +518,15 @@ static int clk_wzrd_probe(struct platform_device *pdev) } /* register div per output */ - for (i = WZRD_NUM_OUTPUTS - 1; i >= 0 ; i--) { + for (i = nr_outputs - 1; i >= 0 ; i--) { const char *clkout_name; - if (of_property_read_string_index(np, "clock-output-names", i, - _name)) { - dev_err(>dev, - "clock output name not specified\n"); - ret = -EINVAL; - goto err_rm_int_clks; + clkout_name = kasprintf(GFP_KERNEL, "%s_out%d", dev_name(>dev), i); + if (!clkout_name) { + ret = -ENOMEM; + goto err_rm_int_clk; } + if (!i) clk_wzrd->clkout[i] = clk_wzrd_register_divf (>dev, clkout_name, @@ -548,7 +548,7 @@ static int clk_wzrd_probe(struct platform_device *pdev) if (IS_ERR(clk_wzrd->clkout[i])) { int j; - for (j = i + 1; j < WZRD_NUM_OUTPUTS; j++) + for (j = i + 1; j < nr_outputs; j++) clk_unregister(clk_wzrd->clkout[j]); dev_err(>dev, "unable to register divider clock\n"); -- 2.1.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v10 3/9] staging: clocking-wizard: Update the fixed factor divisors
Update the fixed factor clock registration to register the divisors. Signed-off-by: Shubhrajyoti Datta --- drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index 57f80ba..9cc2f6d 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -135,8 +135,10 @@ static int clk_wzrd_probe(struct platform_device *pdev) u32 reg; unsigned long rate; const char *clk_name; + void __iomem *ctrl_reg; struct clk_wzrd *clk_wzrd; struct device_node *np = pdev->dev.of_node; + unsigned long flags = 0; clk_wzrd = devm_kzalloc(>dev, sizeof(*clk_wzrd), GFP_KERNEL); if (!clk_wzrd) @@ -198,6 +200,7 @@ static int clk_wzrd_probe(struct platform_device *pdev) ret = -ENOMEM; goto err_disable_clk; } + clk_wzrd->clks_internal[wzrd_clk_mul] = clk_register_fixed_factor (>dev, clk_name, __clk_get_name(clk_wzrd->clk_in1), @@ -209,19 +212,19 @@ static int clk_wzrd_probe(struct platform_device *pdev) goto err_disable_clk; } - /* register div */ - reg = (readl(clk_wzrd->base + WZRD_CLK_CFG_REG(0)) & - WZRD_DIVCLK_DIVIDE_MASK) >> WZRD_DIVCLK_DIVIDE_SHIFT; clk_name = kasprintf(GFP_KERNEL, "%s_mul_div", dev_name(>dev)); if (!clk_name) { ret = -ENOMEM; goto err_rm_int_clk; } - clk_wzrd->clks_internal[wzrd_clk_mul_div] = clk_register_fixed_factor + ctrl_reg = clk_wzrd->base + WZRD_CLK_CFG_REG(0); + /* register div */ + clk_wzrd->clks_internal[wzrd_clk_mul_div] = clk_register_divider (>dev, clk_name, __clk_get_name(clk_wzrd->clks_internal[wzrd_clk_mul]), -0, 1, reg); + flags, ctrl_reg, 0, 8, CLK_DIVIDER_ONE_BASED | + CLK_DIVIDER_ALLOW_ZERO, _lock); if (IS_ERR(clk_wzrd->clks_internal[wzrd_clk_mul_div])) { dev_err(>dev, "unable to register divider clock\n"); ret = PTR_ERR(clk_wzrd->clks_internal[wzrd_clk_mul_div]); -- 2.1.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v10 8/9] dt-bindings: add documentation of xilinx clocking wizard
Add the devicetree binding for the xilinx clocking wizard. Signed-off-by: Shubhrajyoti Datta --- v6: Fix a yaml warning v7: Add vendor prefix speed-grade v8: Fix the warnings v10: Add nr-outputs .../bindings/clock/xlnx,clocking-wizard.yaml | 72 ++ 1 file changed, 72 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yaml diff --git a/Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yaml b/Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yaml new file mode 100644 index 000..280eb09 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yaml @@ -0,0 +1,72 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/clock/xlnx,clocking-wizard.yaml#; +$schema: "http://devicetree.org/meta-schemas/core.yaml#; + +title: Xilinx clocking wizard + +maintainers: + - Shubhrajyoti Datta + +description: + The clocking wizard is a soft ip clocking block of Xilinx versal. It + reads required input clock frequencies from the devicetree and acts as clock + clock output. + +properties: + compatible: +const: xlnx,clocking-wizard + + reg: +maxItems: 1 + + "#clock-cells": +const: 1 + + clocks: +items: + - description: clock input + - description: axi clock + + clock-names: +items: + - const: clk_in1 + - const: s_axi_aclk + + + xlnx,speed-grade: +$ref: /schemas/types.yaml#/definitions/uint32 +enum: [1, 2, 3] +description: + Speed grade of the device. Higher the speed grade faster is the FPGA device. + + nr-outputs: +$ref: /schemas/types.yaml#/definitions/uint32 +enum: [1, 2, 3, 4, 5, 6, 7, 8] +description: + Number of outputs. + +required: + - compatible + - reg + - "#clock-cells" + - clocks + - clock-names + - xlnx,speed-grade + - nr-outputs + +additionalProperties: false + +examples: + - | +wizard@b000 { +compatible = "xlnx,clocking-wizard"; +reg = <0xb000 0x1>; +#clock-cells = <1>; +xlnx,speed-grade = <1>; +nr-outputs = <6>; +clock-names = "clk_in1", "s_axi_aclk"; +clocks = < 15>, < 15>; +}; +... -- 2.1.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v10 4/9] staging: clocking-wizard: Allow changing of parent rate for single output
If there is only one output then allow changing of the parent rate. Signed-off-by: Shubhrajyoti Datta --- drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index 9cc2f6d..e08fc2f 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -138,6 +138,7 @@ static int clk_wzrd_probe(struct platform_device *pdev) void __iomem *ctrl_reg; struct clk_wzrd *clk_wzrd; struct device_node *np = pdev->dev.of_node; + int nr_outputs; unsigned long flags = 0; clk_wzrd = devm_kzalloc(>dev, sizeof(*clk_wzrd), GFP_KERNEL); @@ -201,6 +202,14 @@ static int clk_wzrd_probe(struct platform_device *pdev) goto err_disable_clk; } + ret = of_property_read_u32(np, "nr-outputs", _outputs); + if (ret || nr_outputs > WZRD_NUM_OUTPUTS) { + ret = -EINVAL; + goto err_disable_clk; + } + if (nr_outputs == 1) + flags = CLK_SET_RATE_PARENT; + clk_wzrd->clks_internal[wzrd_clk_mul] = clk_register_fixed_factor (>dev, clk_name, __clk_get_name(clk_wzrd->clk_in1), -- 2.1.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v10 2/9] staging: clocking-wizard: Rename speed-grade to xlnx, speed-grade
Rename speed-grade to xlnx,speed-grade Signed-off-by: Shubhrajyoti Datta --- drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index 1973587..57f80ba 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -147,7 +147,7 @@ static int clk_wzrd_probe(struct platform_device *pdev) if (IS_ERR(clk_wzrd->base)) return PTR_ERR(clk_wzrd->base); - ret = of_property_read_u32(np, "speed-grade", _wzrd->speed_grade); + ret = of_property_read_u32(np, "xlnx,speed-grade", _wzrd->speed_grade); if (!ret) { if (clk_wzrd->speed_grade < 1 || clk_wzrd->speed_grade > 3) { dev_warn(>dev, "invalid speed grade '%d'\n", -- 2.1.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v10 9/9] clk: clock-wizard: Add the clockwizard to clk directory
Add clocking wizard driver to clk. And delete the driver from the staging as it is in drivers/clk. Signed-off-by: Shubhrajyoti Datta --- drivers/clk/Kconfig| 9 +++ drivers/clk/Makefile | 1 + .../clk-xlnx-clock-wizard.c| 3 ++- drivers/staging/Kconfig| 2 -- drivers/staging/Makefile | 1 - drivers/staging/clocking-wizard/Kconfig| 10 drivers/staging/clocking-wizard/Makefile | 2 -- drivers/staging/clocking-wizard/TODO | 12 - drivers/staging/clocking-wizard/dt-binding.txt | 30 -- 9 files changed, 12 insertions(+), 58 deletions(-) rename drivers/{staging/clocking-wizard => clk}/clk-xlnx-clock-wizard.c (99%) delete mode 100644 drivers/staging/clocking-wizard/Kconfig delete mode 100644 drivers/staging/clocking-wizard/Makefile delete mode 100644 drivers/staging/clocking-wizard/TODO delete mode 100644 drivers/staging/clocking-wizard/dt-binding.txt diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 85856cff..03ccd77 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -368,6 +368,15 @@ config COMMON_CLK_FIXED_MMIO help Support for Memory Mapped IO Fixed clocks +config COMMON_CLK_XLNX_CLKWZRD + tristate "Xilinx Clocking Wizard" + depends on COMMON_CLK && OF + help + Support for the Xilinx Clocking Wizard IP core clock generator. + Adds support for clocking wizard and compatible. + This driver supports the Xilinx clocking wizard programmable clock + synthesizer. The number of output is configurable in the design. + source "drivers/clk/actions/Kconfig" source "drivers/clk/analogbits/Kconfig" source "drivers/clk/baikal-t1/Kconfig" diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index dbdc590..b1cc447 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -70,6 +70,7 @@ obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o obj-$(CONFIG_COMMON_CLK_VC5) += clk-versaclock5.o obj-$(CONFIG_COMMON_CLK_WM831X)+= clk-wm831x.o obj-$(CONFIG_COMMON_CLK_XGENE) += clk-xgene.o +obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clk-xlnx-clock-wizard.o # please keep this section sorted lexicographically by directory path name obj-y += actions/ diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/clk/clk-xlnx-clock-wizard.c similarity index 99% rename from drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c rename to drivers/clk/clk-xlnx-clock-wizard.c index b0ced42..6cb8b79 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/clk/clk-xlnx-clock-wizard.c @@ -2,9 +2,10 @@ /* * Xilinx 'Clocking Wizard' driver * - * Copyright (C) 2013 - 2014 Xilinx + * Copyright (C) 2013 - 2021 Xilinx * * Sören Brinkmann + * */ #include diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig index b22f73d..d032fb5 100644 --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig @@ -74,8 +74,6 @@ source "drivers/staging/gs_fpgaboot/Kconfig" source "drivers/staging/unisys/Kconfig" -source "drivers/staging/clocking-wizard/Kconfig" - source "drivers/staging/fbtft/Kconfig" source "drivers/staging/fsl-dpaa2/Kconfig" diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index 2245059..2327185 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile @@ -27,7 +27,6 @@ obj-$(CONFIG_LTE_GDM724X) += gdm724x/ obj-$(CONFIG_FIREWIRE_SERIAL) += fwserial/ obj-$(CONFIG_GS_FPGABOOT) += gs_fpgaboot/ obj-$(CONFIG_UNISYSSPAR) += unisys/ -obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/ obj-$(CONFIG_FB_TFT) += fbtft/ obj-$(CONFIG_FSL_DPAA2)+= fsl-dpaa2/ obj-$(CONFIG_MOST) += most/ diff --git a/drivers/staging/clocking-wizard/Kconfig b/drivers/staging/clocking-wizard/Kconfig deleted file mode 100644 index 69cf514..000 --- a/drivers/staging/clocking-wizard/Kconfig +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# Xilinx Clocking Wizard Driver -# - -config COMMON_CLK_XLNX_CLKWZRD - tristate "Xilinx Clocking Wizard" - depends on COMMON_CLK && OF && IOMEM - help - Support for the Xilinx Clocking Wizard IP core clock generator. diff --git a/drivers/staging/clocking-wizard/Makefile b/drivers/staging/clocking-wizard/Makefile deleted file mode 100644 index b1f9152..000 --- a/drivers/staging/clocking-wizard/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clk-xlnx-clock-wizard.o diff --git a/drivers/staging/clocking-wizard/TODO b/drivers/staging/clocking-wizard/TODO deleted file mode 100644 index ebe99db..000 --- a/drivers/staging/clocking-wizard/TODO +++
[PATCH v10 6/9] staging: clocking-wizard: Add support for fractional support
Currently the set rate granularity is to integral divisors. Add support for the fractional divisors. Only the first output0 is fractional in the hardware. Signed-off-by: Shubhrajyoti Datta --- v7: Remove unnecessary comments use mult_frac use a common divisor function. .../clocking-wizard/clk-xlnx-clock-wizard.c| 153 ++--- 1 file changed, 137 insertions(+), 16 deletions(-) diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index b1bfdb86..a70f09e 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -27,11 +27,15 @@ #define WZRD_CLKFBOUT_MULT_SHIFT 8 #define WZRD_CLKFBOUT_MULT_MASK(0xff << WZRD_CLKFBOUT_MULT_SHIFT) +#define WZRD_CLKFBOUT_FRAC_SHIFT 16 +#define WZRD_CLKFBOUT_FRAC_MASK(0x3ff << WZRD_CLKFBOUT_FRAC_SHIFT) #define WZRD_DIVCLK_DIVIDE_SHIFT 0 #define WZRD_DIVCLK_DIVIDE_MASK(0xff << WZRD_DIVCLK_DIVIDE_SHIFT) #define WZRD_CLKOUT_DIVIDE_SHIFT 0 #define WZRD_CLKOUT_DIVIDE_WIDTH 8 #define WZRD_CLKOUT_DIVIDE_MASK(0xff << WZRD_DIVCLK_DIVIDE_SHIFT) +#define WZRD_CLKOUT_FRAC_SHIFT 8 +#define WZRD_CLKOUT_FRAC_MASK 0x3ff #define WZRD_DR_MAX_INT_DIV_VALUE 255 #define WZRD_DR_STATUS_REG_OFFSET 0x04 @@ -51,6 +55,7 @@ enum clk_wzrd_int_clks { wzrd_clk_mul, wzrd_clk_mul_div, + wzrd_clk_mul_frac, wzrd_clk_int_max }; @@ -194,6 +199,117 @@ static const struct clk_ops clk_wzrd_clk_divider_ops = { .recalc_rate = clk_wzrd_recalc_rate, }; +static unsigned long clk_wzrd_recalc_ratef(struct clk_hw *hw, + unsigned long parent_rate) +{ + unsigned int val; + u32 div, frac; + struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw); + void __iomem *div_addr = divider->base + divider->offset; + + val = readl(div_addr); + div = val & div_mask(divider->width); + frac = (val >> WZRD_CLKOUT_FRAC_SHIFT) & WZRD_CLKOUT_FRAC_MASK; + + return mult_frac(parent_rate, 1000, (div * 1000) + frac); +} + +static int clk_wzrd_dynamic_reconfig_f(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) +{ + int err; + u32 value, pre; + unsigned long rate_div, f, clockout0_div; + struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw); + void __iomem *div_addr = divider->base + divider->offset; + + rate_div = ((parent_rate * 1000) / rate); + clockout0_div = rate_div / 1000; + + pre = DIV_ROUND_CLOSEST((parent_rate * 1000), rate); + f = (u32)(pre - (clockout0_div * 1000)); + f = f & WZRD_CLKOUT_FRAC_MASK; + f = f << WZRD_CLKOUT_DIVIDE_WIDTH; + + value = (f | (clockout0_div & WZRD_CLKOUT_DIVIDE_MASK)); + + /* Set divisor and clear phase offset */ + writel(value, div_addr); + writel(0x0, div_addr + WZRD_DR_DIV_TO_PHASE_OFFSET); + + /* Check status register */ + err = readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET, value, +value & WZRD_DR_LOCK_BIT_MASK, +WZRD_USEC_POLL, WZRD_TIMEOUT_POLL); + if (err) + return err; + + /* Initiate reconfiguration */ + writel(WZRD_DR_BEGIN_DYNA_RECONF, + divider->base + WZRD_DR_INIT_REG_OFFSET); + + /* Check status register */ + return readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET, value, + value & WZRD_DR_LOCK_BIT_MASK, + WZRD_USEC_POLL, WZRD_TIMEOUT_POLL); +} + +static long clk_wzrd_round_rate_f(struct clk_hw *hw, unsigned long rate, + unsigned long *prate) +{ + return rate; +} + +static const struct clk_ops clk_wzrd_clk_divider_ops_f = { + .round_rate = clk_wzrd_round_rate_f, + .set_rate = clk_wzrd_dynamic_reconfig_f, + .recalc_rate = clk_wzrd_recalc_ratef, +}; + +static struct clk *clk_wzrd_register_divf(struct device *dev, + const char *name, + const char *parent_name, + unsigned long flags, + void __iomem *base, u16 offset, + u8 shift, u8 width, + u8 clk_divider_flags, + const struct clk_div_table *table, + spinlock_t *lock) +{ + struct clk_wzrd_divider *div; + struct clk_hw *hw; + struct clk_init_data init; + int ret; + + div = devm_kzalloc(dev, sizeof(*div), GFP_KERNEL); + if (!div) +
[PATCH v10 0/9] clk: clocking-wizard: driver updates
In the thread [1] Greg suggested that we move the driver to the clk from the staging. Add patches to address the concerns regarding the fractional and set rate support in the TODO. The patch set does the following - Trivial fixes for kernel doc. - Move the driver to the clk folder - Add capability to set rate. - Add fractional support. - Add support for configurable outputs. - Make the output names unique so that multiple instances do not crib. Changes in the v3: Added the cover-letter. Add patches for rate setting and fractional support Add patches for warning. Remove the driver from staging as suggested v4: Reorder the patches. Merge the CLK_IS_BASIC patch. Add the yaml form of binding document v5: Fix a mismerge v6: Fix the yaml warning use poll timedout v7: Binding doc updates Use common divisor function. v8: Fix Robs comments v9: Fix device tree warnings v10: Reorder the patches Update the speed grade description. [1] https://spinics.net/lists/linux-driver-devel/msg117326.html Shubhrajyoti Datta (9): staging: clocking-wizard: Fix kernel-doc warning staging: clocking-wizard: Rename speed-grade to xlnx,speed-grade staging: clocking-wizard: Update the fixed factor divisors staging: clocking-wizard: Allow changing of parent rate for single output staging: clocking-wizard: Add support for dynamic reconfiguration staging: clocking-wizard: Add support for fractional support staging: clocking-wizard: Remove the hardcoding of the clock outputs dt-bindings: add documentation of xilinx clocking wizard clk: clock-wizard: Add the clockwizard to clk directory .../bindings/clock/xlnx,clocking-wizard.yaml | 72 +++ drivers/clk/Kconfig| 9 + drivers/clk/Makefile | 1 + drivers/clk/clk-xlnx-clock-wizard.c| 636 + drivers/staging/Kconfig| 2 - drivers/staging/Makefile | 1 - drivers/staging/clocking-wizard/Kconfig| 10 - drivers/staging/clocking-wizard/Makefile | 2 - drivers/staging/clocking-wizard/TODO | 12 - .../clocking-wizard/clk-xlnx-clock-wizard.c| 333 --- drivers/staging/clocking-wizard/dt-binding.txt | 30 - 11 files changed, 718 insertions(+), 390 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yaml create mode 100644 drivers/clk/clk-xlnx-clock-wizard.c delete mode 100644 drivers/staging/clocking-wizard/Kconfig delete mode 100644 drivers/staging/clocking-wizard/Makefile delete mode 100644 drivers/staging/clocking-wizard/TODO delete mode 100644 drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c delete mode 100644 drivers/staging/clocking-wizard/dt-binding.txt -- 2.1.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v10 1/9] staging: clocking-wizard: Fix kernel-doc warning
Fix the clocking wizard main structure kernel documentation. Signed-off-by: Shubhrajyoti Datta --- v10: Updated the description drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index e52a64b..1973587 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -38,7 +38,8 @@ enum clk_wzrd_int_clks { }; /** - * struct clk_wzrd: + * struct clk_wzrd - Clock wizard private data structure + * * @clk_data: Clock data * @nb:Notifier block * @base: Memory base -- 2.1.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 4.4 09/11] staging: most: sound: add sanity check for function argument
From: Christian Gromm [ Upstream commit 45b754ae5b82949dca2b6e74fa680313cefdc813 ] This patch checks the function parameter 'bytes' before doing the subtraction to prevent memory corruption. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1612282865-21846-1-git-send-email-christian.gr...@microchip.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/most/aim-sound/sound.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/most/aim-sound/sound.c b/drivers/staging/most/aim-sound/sound.c index 9c645801cff4d..532ec0f7100eb 100644 --- a/drivers/staging/most/aim-sound/sound.c +++ b/drivers/staging/most/aim-sound/sound.c @@ -92,6 +92,8 @@ static void swap_copy24(u8 *dest, const u8 *source, unsigned int bytes) { unsigned int i = 0; + if (bytes < 2) + return; while (i < bytes - 2) { dest[i] = source[i + 2]; dest[i + 1] = source[i + 1]; -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 4.4 01/11] staging: fwserial: Fix error handling in fwserial_create
From: Dinghao Liu [ Upstream commit f31559af97a0eabd467e4719253675b7dccb8a46 ] When fw_core_add_address_handler() fails, we need to destroy the port by tty_port_destroy(). Also we need to unregister the address handler by fw_core_remove_address_handler() on failure. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20201221122437.10274-1-dinghao@zju.edu.cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/fwserial/fwserial.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index b3ea4bb54e2c7..68ed97398fafb 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -2255,6 +2255,7 @@ static int fwserial_create(struct fw_unit *unit) err = fw_core_add_address_handler(>rx_handler, _high_memory_region); if (err) { + tty_port_destroy(>port); kfree(port); goto free_ports; } @@ -2337,6 +2338,7 @@ static int fwserial_create(struct fw_unit *unit) free_ports: for (--i; i >= 0; --i) { + fw_core_remove_address_handler(>ports[i]->rx_handler); tty_port_destroy(>ports[i]->port); kfree(serial->ports[i]); } -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 4.9 09/12] staging: most: sound: add sanity check for function argument
From: Christian Gromm [ Upstream commit 45b754ae5b82949dca2b6e74fa680313cefdc813 ] This patch checks the function parameter 'bytes' before doing the subtraction to prevent memory corruption. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1612282865-21846-1-git-send-email-christian.gr...@microchip.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/most/aim-sound/sound.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/most/aim-sound/sound.c b/drivers/staging/most/aim-sound/sound.c index e4198e5e064b5..288c7bf129457 100644 --- a/drivers/staging/most/aim-sound/sound.c +++ b/drivers/staging/most/aim-sound/sound.c @@ -92,6 +92,8 @@ static void swap_copy24(u8 *dest, const u8 *source, unsigned int bytes) { unsigned int i = 0; + if (bytes < 2) + return; while (i < bytes - 2) { dest[i] = source[i + 2]; dest[i + 1] = source[i + 1]; -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 4.9 01/12] staging: fwserial: Fix error handling in fwserial_create
From: Dinghao Liu [ Upstream commit f31559af97a0eabd467e4719253675b7dccb8a46 ] When fw_core_add_address_handler() fails, we need to destroy the port by tty_port_destroy(). Also we need to unregister the address handler by fw_core_remove_address_handler() on failure. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20201221122437.10274-1-dinghao@zju.edu.cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/fwserial/fwserial.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index 49c718b91e55a..16f6f35954fb5 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -2255,6 +2255,7 @@ static int fwserial_create(struct fw_unit *unit) err = fw_core_add_address_handler(>rx_handler, _high_memory_region); if (err) { + tty_port_destroy(>port); kfree(port); goto free_ports; } @@ -2337,6 +2338,7 @@ static int fwserial_create(struct fw_unit *unit) free_ports: for (--i; i >= 0; --i) { + fw_core_remove_address_handler(>ports[i]->rx_handler); tty_port_destroy(>ports[i]->port); kfree(serial->ports[i]); } -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 4.14 09/16] staging: most: sound: add sanity check for function argument
From: Christian Gromm [ Upstream commit 45b754ae5b82949dca2b6e74fa680313cefdc813 ] This patch checks the function parameter 'bytes' before doing the subtraction to prevent memory corruption. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1612282865-21846-1-git-send-email-christian.gr...@microchip.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/most/aim-sound/sound.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/most/aim-sound/sound.c b/drivers/staging/most/aim-sound/sound.c index ea1366a440083..e259bf4956ab6 100644 --- a/drivers/staging/most/aim-sound/sound.c +++ b/drivers/staging/most/aim-sound/sound.c @@ -92,6 +92,8 @@ static void swap_copy24(u8 *dest, const u8 *source, unsigned int bytes) { unsigned int i = 0; + if (bytes < 2) + return; while (i < bytes - 2) { dest[i] = source[i + 2]; dest[i + 1] = source[i + 1]; -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 4.14 01/16] staging: fwserial: Fix error handling in fwserial_create
From: Dinghao Liu [ Upstream commit f31559af97a0eabd467e4719253675b7dccb8a46 ] When fw_core_add_address_handler() fails, we need to destroy the port by tty_port_destroy(). Also we need to unregister the address handler by fw_core_remove_address_handler() on failure. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20201221122437.10274-1-dinghao@zju.edu.cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/fwserial/fwserial.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index 41a49c8194e50..b19c46bd2557c 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -2249,6 +2249,7 @@ static int fwserial_create(struct fw_unit *unit) err = fw_core_add_address_handler(>rx_handler, _high_memory_region); if (err) { + tty_port_destroy(>port); kfree(port); goto free_ports; } @@ -2331,6 +2332,7 @@ static int fwserial_create(struct fw_unit *unit) free_ports: for (--i; i >= 0; --i) { + fw_core_remove_address_handler(>ports[i]->rx_handler); tty_port_destroy(>ports[i]->port); kfree(serial->ports[i]); } -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 4.19 10/26] staging: most: sound: add sanity check for function argument
From: Christian Gromm [ Upstream commit 45b754ae5b82949dca2b6e74fa680313cefdc813 ] This patch checks the function parameter 'bytes' before doing the subtraction to prevent memory corruption. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1612282865-21846-1-git-send-email-christian.gr...@microchip.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/most/sound/sound.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c index 89b02fc305b8b..fd9245d7eeb9a 100644 --- a/drivers/staging/most/sound/sound.c +++ b/drivers/staging/most/sound/sound.c @@ -86,6 +86,8 @@ static void swap_copy24(u8 *dest, const u8 *source, unsigned int bytes) { unsigned int i = 0; + if (bytes < 2) + return; while (i < bytes - 2) { dest[i] = source[i + 2]; dest[i + 1] = source[i + 1]; -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 4.19 01/26] staging: fwserial: Fix error handling in fwserial_create
From: Dinghao Liu [ Upstream commit f31559af97a0eabd467e4719253675b7dccb8a46 ] When fw_core_add_address_handler() fails, we need to destroy the port by tty_port_destroy(). Also we need to unregister the address handler by fw_core_remove_address_handler() on failure. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20201221122437.10274-1-dinghao@zju.edu.cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/fwserial/fwserial.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index fa0dd425b4549..cd062628a46b0 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -2219,6 +2219,7 @@ static int fwserial_create(struct fw_unit *unit) err = fw_core_add_address_handler(>rx_handler, _high_memory_region); if (err) { + tty_port_destroy(>port); kfree(port); goto free_ports; } @@ -2301,6 +2302,7 @@ static int fwserial_create(struct fw_unit *unit) free_ports: for (--i; i >= 0; --i) { + fw_core_remove_address_handler(>ports[i]->rx_handler); tty_port_destroy(>ports[i]->port); kfree(serial->ports[i]); } -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 5.4 11/40] staging: bcm2835-audio: Replace unsafe strcpy() with strscpy()
From: Juerg Haefliger [ Upstream commit 4964a4300660d27907ceb655f219ac47e5941534 ] Replace strcpy() with strscpy() in bcm2835-audio/bcm2835.c to prevent the following when loading snd-bcm2835: [ 58.480634] [ cut here ] [ 58.485321] kernel BUG at lib/string.c:1149! [ 58.489650] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 58.495214] Modules linked in: snd_bcm2835(COE+) snd_pcm snd_timer snd dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua btsdio bluetooth ecdh_generic ecc bcm2835_v4l2(CE) bcm2835_codec(CE) brcmfmac bcm2835_isp(CE) bcm2835_mmal_vchiq(CE) brcmutil cfg80211 v4l2_mem2mem videobuf2_vmalloc videobuf2_dma_contig videobuf2_memops raspberrypi_hwmon videobuf2_v4l2 videobuf2_common videodev bcm2835_gpiomem mc vc_sm_cma(CE) rpivid_mem uio_pdrv_genirq uio sch_fq_codel drm ip_tables x_tables autofs4 btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq libcrc32c raid1 raid0 multipath linear dwc2 roles spidev udc_core crct10dif_ce xhci_pci xhci_pci_renesas phy_generic aes_neon_bs aes_neon_blk crypto_simd cryptd [ 58.563787] CPU: 3 PID: 1959 Comm: insmod Tainted: G C OE 5.11.0-1001-raspi #1 [ 58.572172] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT) [ 58.578086] pstate: 6045 (nZCv daif +PAN -UAO -TCO BTYPE=--) [ 58.584178] pc : fortify_panic+0x20/0x24 [ 58.588161] lr : fortify_panic+0x20/0x24 [ 58.592136] sp : 800010a83990 [ 58.595491] x29: 800010a83990 x28: 0002 [ 58.600879] x27: b0b07cb72928 x26: [ 58.606268] x25: 39e884973838 x24: b0b07cb74190 [ 58.611655] x23: b0b07cb72030 x22: [ 58.617042] x21: 39e884973014 x20: 39e88b793010 [ 58.622428] x19: b0b07cb72670 x18: 0030 [ 58.627814] x17: x16: b0b092ce2c1c [ 58.633200] x15: 39e88b901500 x14: 0720072007200720 [ 58.638588] x13: 0720072007200720 x12: 0720072007200720 [ 58.643979] x11: b0b0936cbdf0 x10: f000 [ 58.649366] x9 : b0b09220cfa8 x8 : [ 58.654752] x7 : b0b093673df0 x6 : b0b09364e000 [ 58.660140] x5 : x4 : 39e93b7db948 [ 58.665526] x3 : 39e93b7ebcf0 x2 : [ 58.670913] x1 : x0 : 0022 [ 58.676299] Call trace: [ 58.678775] fortify_panic+0x20/0x24 [ 58.682402] snd_bcm2835_alsa_probe+0x5b8/0x7d8 [snd_bcm2835] [ 58.688247] platform_probe+0x74/0xe4 [ 58.691963] really_probe+0xf0/0x510 [ 58.695585] driver_probe_device+0xe0/0x100 [ 58.699826] device_driver_attach+0xcc/0xd4 [ 58.704068] __driver_attach+0xb0/0x17c [ 58.707956] bus_for_each_dev+0x7c/0xd4 [ 58.711843] driver_attach+0x30/0x40 [ 58.715467] bus_add_driver+0x154/0x250 [ 58.719354] driver_register+0x84/0x140 [ 58.723242] __platform_driver_register+0x34/0x40 [ 58.728013] bcm2835_alsa_driver_init+0x30/0x1000 [snd_bcm2835] [ 58.734024] do_one_initcall+0x54/0x300 [ 58.737914] do_init_module+0x60/0x280 [ 58.741719] load_module+0x680/0x770 [ 58.745344] __do_sys_finit_module+0xbc/0x130 [ 58.749761] __arm64_sys_finit_module+0x2c/0x40 [ 58.754356] el0_svc_common.constprop.0+0x88/0x220 [ 58.759216] do_el0_svc+0x30/0xa0 [ 58.762575] el0_svc+0x28/0x70 [ 58.765669] el0_sync_handler+0x1a4/0x1b0 [ 58.769732] el0_sync+0x178/0x180 [ 58.773095] Code: aa0003e1 91366040 910003fd 97ffee21 (d421) [ 58.779275] ---[ end trace 29be5b17497bd898 ]--- [ 58.783955] note: insmod[1959] exited with preempt_count 1 [ 58.791921] [ cut here ] For the sake of it, replace all the other occurences of strcpy() under bcm2835-audio/ as well. Signed-off-by: Juerg Haefliger Link: https://lore.kernel.org/r/20210205072502.10907-1-jue...@canonical.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c | 6 +++--- drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 2 +- drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c index 4c2cae99776b9..3703409715dab 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c @@ -224,7 +224,7 @@ int snd_bcm2835_new_ctl(struct bcm2835_chip *chip) { int err; - strcpy(chip->card->mixername, "Broadcom Mixer"); + strscpy(chip->card->mixername, "Broadcom Mixer", sizeof(chip->card->mixername)); err = create_ctls(chip, ARRAY_SIZE(snd_bcm2835_ctl), snd_bcm2835_ctl); if (err < 0) return err; @@ -261,7 +261,7 @@ static const struct snd_kcontrol_new snd_bcm2835_headphones_ctl[] = { int
[PATCH AUTOSEL 5.4 10/40] staging: most: sound: add sanity check for function argument
From: Christian Gromm [ Upstream commit 45b754ae5b82949dca2b6e74fa680313cefdc813 ] This patch checks the function parameter 'bytes' before doing the subtraction to prevent memory corruption. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1612282865-21846-1-git-send-email-christian.gr...@microchip.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/most/sound/sound.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c index 79817061fcfa4..4225ee9fcf7bf 100644 --- a/drivers/staging/most/sound/sound.c +++ b/drivers/staging/most/sound/sound.c @@ -98,6 +98,8 @@ static void swap_copy24(u8 *dest, const u8 *source, unsigned int bytes) { unsigned int i = 0; + if (bytes < 2) + return; while (i < bytes - 2) { dest[i] = source[i + 2]; dest[i + 1] = source[i + 1]; -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 5.4 01/40] staging: fwserial: Fix error handling in fwserial_create
From: Dinghao Liu [ Upstream commit f31559af97a0eabd467e4719253675b7dccb8a46 ] When fw_core_add_address_handler() fails, we need to destroy the port by tty_port_destroy(). Also we need to unregister the address handler by fw_core_remove_address_handler() on failure. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20201221122437.10274-1-dinghao@zju.edu.cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/fwserial/fwserial.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index aec0f19597a94..4df6e3c1ea96c 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -2189,6 +2189,7 @@ static int fwserial_create(struct fw_unit *unit) err = fw_core_add_address_handler(>rx_handler, _high_memory_region); if (err) { + tty_port_destroy(>port); kfree(port); goto free_ports; } @@ -2271,6 +2272,7 @@ static int fwserial_create(struct fw_unit *unit) free_ports: for (--i; i >= 0; --i) { + fw_core_remove_address_handler(>ports[i]->rx_handler); tty_port_destroy(>ports[i]->port); kfree(serial->ports[i]); } -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 5.10 16/56] staging: bcm2835-audio: Replace unsafe strcpy() with strscpy()
From: Juerg Haefliger [ Upstream commit 4964a4300660d27907ceb655f219ac47e5941534 ] Replace strcpy() with strscpy() in bcm2835-audio/bcm2835.c to prevent the following when loading snd-bcm2835: [ 58.480634] [ cut here ] [ 58.485321] kernel BUG at lib/string.c:1149! [ 58.489650] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 58.495214] Modules linked in: snd_bcm2835(COE+) snd_pcm snd_timer snd dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua btsdio bluetooth ecdh_generic ecc bcm2835_v4l2(CE) bcm2835_codec(CE) brcmfmac bcm2835_isp(CE) bcm2835_mmal_vchiq(CE) brcmutil cfg80211 v4l2_mem2mem videobuf2_vmalloc videobuf2_dma_contig videobuf2_memops raspberrypi_hwmon videobuf2_v4l2 videobuf2_common videodev bcm2835_gpiomem mc vc_sm_cma(CE) rpivid_mem uio_pdrv_genirq uio sch_fq_codel drm ip_tables x_tables autofs4 btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq libcrc32c raid1 raid0 multipath linear dwc2 roles spidev udc_core crct10dif_ce xhci_pci xhci_pci_renesas phy_generic aes_neon_bs aes_neon_blk crypto_simd cryptd [ 58.563787] CPU: 3 PID: 1959 Comm: insmod Tainted: G C OE 5.11.0-1001-raspi #1 [ 58.572172] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT) [ 58.578086] pstate: 6045 (nZCv daif +PAN -UAO -TCO BTYPE=--) [ 58.584178] pc : fortify_panic+0x20/0x24 [ 58.588161] lr : fortify_panic+0x20/0x24 [ 58.592136] sp : 800010a83990 [ 58.595491] x29: 800010a83990 x28: 0002 [ 58.600879] x27: b0b07cb72928 x26: [ 58.606268] x25: 39e884973838 x24: b0b07cb74190 [ 58.611655] x23: b0b07cb72030 x22: [ 58.617042] x21: 39e884973014 x20: 39e88b793010 [ 58.622428] x19: b0b07cb72670 x18: 0030 [ 58.627814] x17: x16: b0b092ce2c1c [ 58.633200] x15: 39e88b901500 x14: 0720072007200720 [ 58.638588] x13: 0720072007200720 x12: 0720072007200720 [ 58.643979] x11: b0b0936cbdf0 x10: f000 [ 58.649366] x9 : b0b09220cfa8 x8 : [ 58.654752] x7 : b0b093673df0 x6 : b0b09364e000 [ 58.660140] x5 : x4 : 39e93b7db948 [ 58.665526] x3 : 39e93b7ebcf0 x2 : [ 58.670913] x1 : x0 : 0022 [ 58.676299] Call trace: [ 58.678775] fortify_panic+0x20/0x24 [ 58.682402] snd_bcm2835_alsa_probe+0x5b8/0x7d8 [snd_bcm2835] [ 58.688247] platform_probe+0x74/0xe4 [ 58.691963] really_probe+0xf0/0x510 [ 58.695585] driver_probe_device+0xe0/0x100 [ 58.699826] device_driver_attach+0xcc/0xd4 [ 58.704068] __driver_attach+0xb0/0x17c [ 58.707956] bus_for_each_dev+0x7c/0xd4 [ 58.711843] driver_attach+0x30/0x40 [ 58.715467] bus_add_driver+0x154/0x250 [ 58.719354] driver_register+0x84/0x140 [ 58.723242] __platform_driver_register+0x34/0x40 [ 58.728013] bcm2835_alsa_driver_init+0x30/0x1000 [snd_bcm2835] [ 58.734024] do_one_initcall+0x54/0x300 [ 58.737914] do_init_module+0x60/0x280 [ 58.741719] load_module+0x680/0x770 [ 58.745344] __do_sys_finit_module+0xbc/0x130 [ 58.749761] __arm64_sys_finit_module+0x2c/0x40 [ 58.754356] el0_svc_common.constprop.0+0x88/0x220 [ 58.759216] do_el0_svc+0x30/0xa0 [ 58.762575] el0_svc+0x28/0x70 [ 58.765669] el0_sync_handler+0x1a4/0x1b0 [ 58.769732] el0_sync+0x178/0x180 [ 58.773095] Code: aa0003e1 91366040 910003fd 97ffee21 (d421) [ 58.779275] ---[ end trace 29be5b17497bd898 ]--- [ 58.783955] note: insmod[1959] exited with preempt_count 1 [ 58.791921] [ cut here ] For the sake of it, replace all the other occurences of strcpy() under bcm2835-audio/ as well. Signed-off-by: Juerg Haefliger Link: https://lore.kernel.org/r/20210205072502.10907-1-jue...@canonical.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c | 6 +++--- drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 2 +- drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c index 4c2cae99776b9..3703409715dab 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c @@ -224,7 +224,7 @@ int snd_bcm2835_new_ctl(struct bcm2835_chip *chip) { int err; - strcpy(chip->card->mixername, "Broadcom Mixer"); + strscpy(chip->card->mixername, "Broadcom Mixer", sizeof(chip->card->mixername)); err = create_ctls(chip, ARRAY_SIZE(snd_bcm2835_ctl), snd_bcm2835_ctl); if (err < 0) return err; @@ -261,7 +261,7 @@ static const struct snd_kcontrol_new snd_bcm2835_headphones_ctl[] = { int
[PATCH AUTOSEL 5.10 15/56] staging: most: sound: add sanity check for function argument
From: Christian Gromm [ Upstream commit 45b754ae5b82949dca2b6e74fa680313cefdc813 ] This patch checks the function parameter 'bytes' before doing the subtraction to prevent memory corruption. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1612282865-21846-1-git-send-email-christian.gr...@microchip.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/most/sound/sound.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c index 8a449ab9bdce4..b7666a7b1760a 100644 --- a/drivers/staging/most/sound/sound.c +++ b/drivers/staging/most/sound/sound.c @@ -96,6 +96,8 @@ static void swap_copy24(u8 *dest, const u8 *source, unsigned int bytes) { unsigned int i = 0; + if (bytes < 2) + return; while (i < bytes - 2) { dest[i] = source[i + 2]; dest[i + 1] = source[i + 1]; -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 5.10 02/56] staging: fwserial: Fix error handling in fwserial_create
From: Dinghao Liu [ Upstream commit f31559af97a0eabd467e4719253675b7dccb8a46 ] When fw_core_add_address_handler() fails, we need to destroy the port by tty_port_destroy(). Also we need to unregister the address handler by fw_core_remove_address_handler() on failure. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20201221122437.10274-1-dinghao@zju.edu.cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/fwserial/fwserial.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index db83d34cd6779..c368082aae1aa 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -2189,6 +2189,7 @@ static int fwserial_create(struct fw_unit *unit) err = fw_core_add_address_handler(>rx_handler, _high_memory_region); if (err) { + tty_port_destroy(>port); kfree(port); goto free_ports; } @@ -2271,6 +2272,7 @@ static int fwserial_create(struct fw_unit *unit) free_ports: for (--i; i >= 0; --i) { + fw_core_remove_address_handler(>ports[i]->rx_handler); tty_port_destroy(>ports[i]->port); kfree(serial->ports[i]); } -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 5.11 20/67] staging: bcm2835-audio: Replace unsafe strcpy() with strscpy()
From: Juerg Haefliger [ Upstream commit 4964a4300660d27907ceb655f219ac47e5941534 ] Replace strcpy() with strscpy() in bcm2835-audio/bcm2835.c to prevent the following when loading snd-bcm2835: [ 58.480634] [ cut here ] [ 58.485321] kernel BUG at lib/string.c:1149! [ 58.489650] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 58.495214] Modules linked in: snd_bcm2835(COE+) snd_pcm snd_timer snd dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua btsdio bluetooth ecdh_generic ecc bcm2835_v4l2(CE) bcm2835_codec(CE) brcmfmac bcm2835_isp(CE) bcm2835_mmal_vchiq(CE) brcmutil cfg80211 v4l2_mem2mem videobuf2_vmalloc videobuf2_dma_contig videobuf2_memops raspberrypi_hwmon videobuf2_v4l2 videobuf2_common videodev bcm2835_gpiomem mc vc_sm_cma(CE) rpivid_mem uio_pdrv_genirq uio sch_fq_codel drm ip_tables x_tables autofs4 btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq libcrc32c raid1 raid0 multipath linear dwc2 roles spidev udc_core crct10dif_ce xhci_pci xhci_pci_renesas phy_generic aes_neon_bs aes_neon_blk crypto_simd cryptd [ 58.563787] CPU: 3 PID: 1959 Comm: insmod Tainted: G C OE 5.11.0-1001-raspi #1 [ 58.572172] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT) [ 58.578086] pstate: 6045 (nZCv daif +PAN -UAO -TCO BTYPE=--) [ 58.584178] pc : fortify_panic+0x20/0x24 [ 58.588161] lr : fortify_panic+0x20/0x24 [ 58.592136] sp : 800010a83990 [ 58.595491] x29: 800010a83990 x28: 0002 [ 58.600879] x27: b0b07cb72928 x26: [ 58.606268] x25: 39e884973838 x24: b0b07cb74190 [ 58.611655] x23: b0b07cb72030 x22: [ 58.617042] x21: 39e884973014 x20: 39e88b793010 [ 58.622428] x19: b0b07cb72670 x18: 0030 [ 58.627814] x17: x16: b0b092ce2c1c [ 58.633200] x15: 39e88b901500 x14: 0720072007200720 [ 58.638588] x13: 0720072007200720 x12: 0720072007200720 [ 58.643979] x11: b0b0936cbdf0 x10: f000 [ 58.649366] x9 : b0b09220cfa8 x8 : [ 58.654752] x7 : b0b093673df0 x6 : b0b09364e000 [ 58.660140] x5 : x4 : 39e93b7db948 [ 58.665526] x3 : 39e93b7ebcf0 x2 : [ 58.670913] x1 : x0 : 0022 [ 58.676299] Call trace: [ 58.678775] fortify_panic+0x20/0x24 [ 58.682402] snd_bcm2835_alsa_probe+0x5b8/0x7d8 [snd_bcm2835] [ 58.688247] platform_probe+0x74/0xe4 [ 58.691963] really_probe+0xf0/0x510 [ 58.695585] driver_probe_device+0xe0/0x100 [ 58.699826] device_driver_attach+0xcc/0xd4 [ 58.704068] __driver_attach+0xb0/0x17c [ 58.707956] bus_for_each_dev+0x7c/0xd4 [ 58.711843] driver_attach+0x30/0x40 [ 58.715467] bus_add_driver+0x154/0x250 [ 58.719354] driver_register+0x84/0x140 [ 58.723242] __platform_driver_register+0x34/0x40 [ 58.728013] bcm2835_alsa_driver_init+0x30/0x1000 [snd_bcm2835] [ 58.734024] do_one_initcall+0x54/0x300 [ 58.737914] do_init_module+0x60/0x280 [ 58.741719] load_module+0x680/0x770 [ 58.745344] __do_sys_finit_module+0xbc/0x130 [ 58.749761] __arm64_sys_finit_module+0x2c/0x40 [ 58.754356] el0_svc_common.constprop.0+0x88/0x220 [ 58.759216] do_el0_svc+0x30/0xa0 [ 58.762575] el0_svc+0x28/0x70 [ 58.765669] el0_sync_handler+0x1a4/0x1b0 [ 58.769732] el0_sync+0x178/0x180 [ 58.773095] Code: aa0003e1 91366040 910003fd 97ffee21 (d421) [ 58.779275] ---[ end trace 29be5b17497bd898 ]--- [ 58.783955] note: insmod[1959] exited with preempt_count 1 [ 58.791921] [ cut here ] For the sake of it, replace all the other occurences of strcpy() under bcm2835-audio/ as well. Signed-off-by: Juerg Haefliger Link: https://lore.kernel.org/r/20210205072502.10907-1-jue...@canonical.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c | 6 +++--- drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 2 +- drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c index 4c2cae99776b9..3703409715dab 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c @@ -224,7 +224,7 @@ int snd_bcm2835_new_ctl(struct bcm2835_chip *chip) { int err; - strcpy(chip->card->mixername, "Broadcom Mixer"); + strscpy(chip->card->mixername, "Broadcom Mixer", sizeof(chip->card->mixername)); err = create_ctls(chip, ARRAY_SIZE(snd_bcm2835_ctl), snd_bcm2835_ctl); if (err < 0) return err; @@ -261,7 +261,7 @@ static const struct snd_kcontrol_new snd_bcm2835_headphones_ctl[] = { int
[PATCH AUTOSEL 5.11 19/67] staging: most: sound: add sanity check for function argument
From: Christian Gromm [ Upstream commit 45b754ae5b82949dca2b6e74fa680313cefdc813 ] This patch checks the function parameter 'bytes' before doing the subtraction to prevent memory corruption. Signed-off-by: Christian Gromm Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1612282865-21846-1-git-send-email-christian.gr...@microchip.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/most/sound/sound.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c index 3a1a590580427..45befb8c11268 100644 --- a/drivers/staging/most/sound/sound.c +++ b/drivers/staging/most/sound/sound.c @@ -86,6 +86,8 @@ static void swap_copy24(u8 *dest, const u8 *source, unsigned int bytes) { unsigned int i = 0; + if (bytes < 2) + return; while (i < bytes - 2) { dest[i] = source[i + 2]; dest[i + 1] = source[i + 1]; -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH AUTOSEL 5.11 03/67] staging: fwserial: Fix error handling in fwserial_create
From: Dinghao Liu [ Upstream commit f31559af97a0eabd467e4719253675b7dccb8a46 ] When fw_core_add_address_handler() fails, we need to destroy the port by tty_port_destroy(). Also we need to unregister the address handler by fw_core_remove_address_handler() on failure. Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20201221122437.10274-1-dinghao@zju.edu.cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/fwserial/fwserial.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index db83d34cd6779..c368082aae1aa 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -2189,6 +2189,7 @@ static int fwserial_create(struct fw_unit *unit) err = fw_core_add_address_handler(>rx_handler, _high_memory_region); if (err) { + tty_port_destroy(>port); kfree(port); goto free_ports; } @@ -2271,6 +2272,7 @@ static int fwserial_create(struct fw_unit *unit) free_ports: for (--i; i >= 0; --i) { + fw_core_remove_address_handler(>ports[i]->rx_handler); tty_port_destroy(>ports[i]->port); kfree(serial->ports[i]); } -- 2.27.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v4 3/3] drm/bridge: anx7625: add MIPI DPI input feature support
On Wed, Feb 24, 2021 at 5:55 PM Hsin-Yi Wang wrote: > > On Thu, Jan 28, 2021 at 11:10 AM Xin Ji wrote: > > > > Add MIPI rx DPI input support > > > > Reported-by: kernel test robot > > Signed-off-by: Xin Ji > > --- > > drivers/gpu/drm/bridge/analogix/anx7625.c | 326 > > -- > > drivers/gpu/drm/bridge/analogix/anx7625.h | 20 +- > > 2 files changed, 285 insertions(+), 61 deletions(-) > > > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c > > b/drivers/gpu/drm/bridge/analogix/anx7625.c > > index 04536cc..628ae43 100644 > > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > > @@ -150,18 +150,18 @@ static int anx7625_write_and(struct anx7625_data *ctx, > > return anx7625_reg_write(ctx, client, offset, (val & (mask))); > > } > > > > -static int anx7625_write_and_or(struct anx7625_data *ctx, > > - struct i2c_client *client, > > - u8 offset, u8 and_mask, u8 or_mask) > > +static int anx7625_config_bit_matrix(struct anx7625_data *ctx) > > { > > - int val; > > + int i, ret; > > > > - val = anx7625_reg_read(ctx, client, offset); > > - if (val < 0) > > - return val; > > + ret = anx7625_write_or(ctx, ctx->i2c.tx_p2_client, > > + AUDIO_CONTROL_REGISTER, 0x80); > > + for (i = 0; i < 13; i++) > > + ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, > > +VIDEO_BIT_MATRIX_12 + i, > > +0x18 + i); > > > > - return anx7625_reg_write(ctx, client, > > -offset, (val & and_mask) | (or_mask)); > > + return ret; > > } > > > > static int anx7625_read_ctrl_status_p0(struct anx7625_data *ctx) > > @@ -195,6 +195,60 @@ static int wait_aux_op_finish(struct anx7625_data *ctx) > > return 0; > > } > > > > +static int anx7625_aux_dpcd_read(struct anx7625_data *ctx, > > +u8 addrh, u8 addrm, u8 addrl, > > +u8 len, u8 *buf) > > +{ > > + struct device *dev = >client->dev; > > + int ret; > > + u8 cmd; > > + > > + if (len > MAX_DPCD_BUFFER_SIZE) { > > + DRM_DEV_ERROR(dev, "exceed aux buffer len.\n"); > > + return -EINVAL; > > + } > > + > > + cmd = ((len - 1) << 4) | 0x09; > > + > > + /* Set command and length */ > > + ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > > + AP_AUX_COMMAND, cmd); > > + > > + /* Set aux access address */ > > + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > > +AP_AUX_ADDR_7_0, addrl); > > + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > > +AP_AUX_ADDR_15_8, addrm); > > + ret |= anx7625_write_and(ctx, ctx->i2c.rx_p0_client, > > +AP_AUX_ADDR_19_16, addrh); > > + > > + /* Enable aux access */ > > + ret |= anx7625_write_or(ctx, ctx->i2c.rx_p0_client, > > + AP_AUX_CTRL_STATUS, AP_AUX_CTRL_OP_EN); > > + > > + if (ret < 0) { > > + DRM_DEV_ERROR(dev, "cannot access aux related register.\n"); > > + return -EIO; > > + } > > + > > + usleep_range(2000, 2100); > > + > > + ret = wait_aux_op_finish(ctx); > > + if (ret) { > > + DRM_DEV_ERROR(dev, "aux IO error: wait aux op finish.\n"); > > + return ret; > > + } > > + > > + ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client, > > +AP_AUX_BUFF_START, len, buf); > > + if (ret < 0) { > > + DRM_DEV_ERROR(dev, "read dpcd register failed\n"); > > + return -EIO; > > + } > > + > > + return 0; > > +} > > + > > static int anx7625_video_mute_control(struct anx7625_data *ctx, > > u8 status) > > { > > @@ -219,38 +273,6 @@ static int anx7625_video_mute_control(struct > > anx7625_data *ctx, > > return ret; > > } > > > > -static int anx7625_config_audio_input(struct anx7625_data *ctx) > > -{ > > - struct device *dev = >client->dev; > > - int ret; > > - > > - /* Channel num */ > > - ret = anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, > > - AUDIO_CHANNEL_STATUS_6, I2S_CH_2 << 5); > > - > > - /* FS */ > > - ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, > > - AUDIO_CHANNEL_STATUS_4, > > - 0xf0, AUDIO_FS_48K); > > - /* Word length */ > > - ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, > > - AUDIO_CHANNEL_STATUS_5, > > -
Re: [PATCH 1/4] driver core: Use subdir-ccflags-* to inherit debug flag
On 2021/2/10 19:42, Daniel Thompson wrote: > On Mon, Feb 08, 2021 at 09:09:20PM +0800, Yicong Yang wrote: >> On 2021/2/8 18:47, Greg KH wrote: >>> On Mon, Feb 08, 2021 at 06:44:52PM +0800, Yicong Yang wrote: On 2021/2/5 17:53, Greg KH wrote: > What does this offer in benefit of the existing way? What is it fixing? > Why do this "churn"? currently we have added ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG in the Makefile of driver/base and driver/base/power, but not in the subdirectory driver/base/firmware_loader. we cannot turn the debug on for subdirectory firmware_loader if we config DEBUG_DRIVER and there is no kconfig option for the it. >>> >>> Is that necessary? Does that directory need it? >> >> there are several debug prints in firmware_loader/main.c: >> >> ./main.c:207: pr_debug("%s: fw-%s fw_priv=%p\n", __func__, fw_name, >> fw_priv); >> ./main.c:245: pr_debug("batched request - sharing the same >> struct fw_priv and lookup for multiple requests\n"); >> > > Even if these are not in scope for CONFIG_DEBUG_DRVIER there is a > config option that would allow you to observe them without changing > any code (CONFIG_DYNAMIC_DEBUG). > yes. they're two mechanisms of debug. i think it's the right thing to make both work properly. > > Daniel. > > . > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v4 3/3] drm/bridge: anx7625: add MIPI DPI input feature support
On Thu, Jan 28, 2021 at 11:10 AM Xin Ji wrote: > > Add MIPI rx DPI input support > > Reported-by: kernel test robot > Signed-off-by: Xin Ji > --- > drivers/gpu/drm/bridge/analogix/anx7625.c | 326 > -- > drivers/gpu/drm/bridge/analogix/anx7625.h | 20 +- > 2 files changed, 285 insertions(+), 61 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c > b/drivers/gpu/drm/bridge/analogix/anx7625.c > index 04536cc..628ae43 100644 > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > @@ -150,18 +150,18 @@ static int anx7625_write_and(struct anx7625_data *ctx, > return anx7625_reg_write(ctx, client, offset, (val & (mask))); > } > > -static int anx7625_write_and_or(struct anx7625_data *ctx, > - struct i2c_client *client, > - u8 offset, u8 and_mask, u8 or_mask) > +static int anx7625_config_bit_matrix(struct anx7625_data *ctx) > { > - int val; > + int i, ret; > > - val = anx7625_reg_read(ctx, client, offset); > - if (val < 0) > - return val; > + ret = anx7625_write_or(ctx, ctx->i2c.tx_p2_client, > + AUDIO_CONTROL_REGISTER, 0x80); > + for (i = 0; i < 13; i++) > + ret |= anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, > +VIDEO_BIT_MATRIX_12 + i, > +0x18 + i); > > - return anx7625_reg_write(ctx, client, > -offset, (val & and_mask) | (or_mask)); > + return ret; > } > > static int anx7625_read_ctrl_status_p0(struct anx7625_data *ctx) > @@ -195,6 +195,60 @@ static int wait_aux_op_finish(struct anx7625_data *ctx) > return 0; > } > > +static int anx7625_aux_dpcd_read(struct anx7625_data *ctx, > +u8 addrh, u8 addrm, u8 addrl, > +u8 len, u8 *buf) > +{ > + struct device *dev = >client->dev; > + int ret; > + u8 cmd; > + > + if (len > MAX_DPCD_BUFFER_SIZE) { > + DRM_DEV_ERROR(dev, "exceed aux buffer len.\n"); > + return -EINVAL; > + } > + > + cmd = ((len - 1) << 4) | 0x09; > + > + /* Set command and length */ > + ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > + AP_AUX_COMMAND, cmd); > + > + /* Set aux access address */ > + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > +AP_AUX_ADDR_7_0, addrl); > + ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > +AP_AUX_ADDR_15_8, addrm); > + ret |= anx7625_write_and(ctx, ctx->i2c.rx_p0_client, > +AP_AUX_ADDR_19_16, addrh); > + > + /* Enable aux access */ > + ret |= anx7625_write_or(ctx, ctx->i2c.rx_p0_client, > + AP_AUX_CTRL_STATUS, AP_AUX_CTRL_OP_EN); > + > + if (ret < 0) { > + DRM_DEV_ERROR(dev, "cannot access aux related register.\n"); > + return -EIO; > + } > + > + usleep_range(2000, 2100); > + > + ret = wait_aux_op_finish(ctx); > + if (ret) { > + DRM_DEV_ERROR(dev, "aux IO error: wait aux op finish.\n"); > + return ret; > + } > + > + ret = anx7625_reg_block_read(ctx, ctx->i2c.rx_p0_client, > +AP_AUX_BUFF_START, len, buf); > + if (ret < 0) { > + DRM_DEV_ERROR(dev, "read dpcd register failed\n"); > + return -EIO; > + } > + > + return 0; > +} > + > static int anx7625_video_mute_control(struct anx7625_data *ctx, > u8 status) > { > @@ -219,38 +273,6 @@ static int anx7625_video_mute_control(struct > anx7625_data *ctx, > return ret; > } > > -static int anx7625_config_audio_input(struct anx7625_data *ctx) > -{ > - struct device *dev = >client->dev; > - int ret; > - > - /* Channel num */ > - ret = anx7625_reg_write(ctx, ctx->i2c.tx_p2_client, > - AUDIO_CHANNEL_STATUS_6, I2S_CH_2 << 5); > - > - /* FS */ > - ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, > - AUDIO_CHANNEL_STATUS_4, > - 0xf0, AUDIO_FS_48K); > - /* Word length */ > - ret |= anx7625_write_and_or(ctx, ctx->i2c.tx_p2_client, > - AUDIO_CHANNEL_STATUS_5, > - 0xf0, AUDIO_W_LEN_24_24MAX); > - /* I2S */ > - ret |= anx7625_write_or(ctx, ctx->i2c.tx_p2_client, > - AUDIO_CHANNEL_STATUS_6, I2S_SLAVE_MODE); > - ret |= anx7625_write_and(ctx, ctx->i2c.tx_p2_client, > -AUDIO_CONTROL_REGISTER,
[PATCH] staging: rtl8712: unterminated string leads to read overflow
The memdup_user() function does not necessarily return a NUL terminated string so this can lead to a read overflow. Switch from memdup_user() to strndup_user() to fix this bug. Fixes: c6dc001f2add ("staging: r8712u: Merging Realtek's latest (v2.6.6). Various fixes.") Signed-off-by: Dan Carpenter --- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index 81de5a9e6b67..60dd798a6e51 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -924,7 +924,7 @@ static int r871x_wx_set_priv(struct net_device *dev, struct iw_point *dwrq = (struct iw_point *)awrq; len = dwrq->length; - ext = memdup_user(dwrq->pointer, len); + ext = strndup_user(dwrq->pointer, len); if (IS_ERR(ext)) return PTR_ERR(ext); -- 2.30.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel