[PATCH -next] staging: rtl8723bs: remove set but not used variable 'bEEPROMCheck'
Fixes gcc '-Wunused-but-set-variable' warning: drivers/staging/rtl8723bs//hal/odm_CfoTracking.c: In function 'odm_SetCrystalCap': drivers/staging/rtl8723bs//hal/odm_CfoTracking.c:14:7: warning: variable 'bEEPROMCheck' set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: YueHaibing --- drivers/staging/rtl8723bs/hal/odm_CfoTracking.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c index a733046..95edd14 100644 --- a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c +++ b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c @@ -11,11 +11,6 @@ static void odm_SetCrystalCap(void *pDM_VOID, u8 CrystalCap) { PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID; PCFO_TRACKING pCfoTrack = _Odm->DM_CfoTrack; - bool bEEPROMCheck; - struct adapter *Adapter = pDM_Odm->Adapter; - struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - - bEEPROMCheck = pHalData->EEPROMVersion >= 0x01; if (pCfoTrack->CrystalCap == CrystalCap) return; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 12/22] staging: erofs: drop __GFP_NOFAIL for managed inode
On 2019/7/31 23:57, Gao Xiang wrote: > For historical reasons, __GFP_NOFAIL was set for managed inode. > It's no need using that since EROFS can handle it properly. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 08/22] staging: erofs: kill CONFIG_EROFS_FS_IO_MAX_RETRIES
On 2019/7/31 23:57, Gao Xiang wrote: > CONFIG_EROFS_FS_IO_MAX_RETRIES seems a runtime setting > and users have no idea about the change in behaviour. > > Let's remove the setting currently and could turn it > into a module parameter if it's really needed. > > Suggested-by: David Sterba > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 07/22] staging: erofs: remove redundant #include "internal.h"
On 2019/7/31 23:57, Gao Xiang wrote: > Because #include "internal.h" is included in xattr.h > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 07/22] staging: erofs: remove redundant #include "internal.h"
On 2019/7/31 20:54, Gao Xiang wrote: > > > On 2019/7/31 20:07, Chao Yu wrote: >> Hi Xiang, >> >> On 2019/7/31 15:08, Gao Xiang wrote: >>> Hi Chao, >>> >>> On 2019/7/31 15:03, Chao Yu wrote: On 2019/7/29 14:51, Gao Xiang wrote: > Because #include "internal.h" is included in xattr.h I think it would be better to remove "internal.h" in xattr.h, and include them both in .c file in where we need xattr definition. >>> >>> It seems that all xattr related source files needing internal.h, >>> and we need "EROFS_V(inode)", "struct erofs_sb_info", ... stuffs in xattr.h, >>> which is defined in internal.h... >> >> Since I checked f2fs', it looks it's okay to don't include internal.h for >> xattr.h, if .c needs xattr.h, we can just include interanl.h and xattr.h in >> the >> head of it, it's safe. > > I think xattr.h should be used independently (all dependencies of xattr.h > should > be included in xattr.h, most of include files behave like that)... Maybe it is > not a good way to follow f2fs... Yes, I've confirmed it's fine to do this, let's go ahead. :) Thanks, > > Thanks, > Gao Xiang > >> >> Thanks, >> >>> >>> Thanks, >>> Gao Xiang >>> Thanks, >>> . >>> > . > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] net: mdio-octeon: Fix build error and Kconfig warning
On 7/31/19 2:55 PM, Randy Dunlap wrote: > On 7/31/19 11:50 AM, Nathan Chancellor wrote: >> arm allyesconfig warns: >> >> WARNING: unmet direct dependencies detected for MDIO_OCTEON >> Depends on [n]: NETDEVICES [=y] && MDIO_DEVICE [=y] && MDIO_BUS [=y] >> && 64BIT && HAS_IOMEM [=y] && OF_MDIO [=y] >> Selected by [y]: >> - OCTEON_ETHERNET [=y] && STAGING [=y] && (CAVIUM_OCTEON_SOC && >> NETDEVICES [=y] || COMPILE_TEST [=y]) >> >> and errors: >> >> In file included from ../drivers/net/phy/mdio-octeon.c:14: >> ../drivers/net/phy/mdio-octeon.c: In function 'octeon_mdiobus_probe': >> ../drivers/net/phy/mdio-cavium.h:111:36: error: implicit declaration of >> function 'writeq'; did you mean 'writeb'? >> [-Werror=implicit-function-declaration] >> 111 | #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) >> |^~ >> ../drivers/net/phy/mdio-octeon.c:56:2: note: in expansion of macro >> 'oct_mdio_writeq' >>56 | oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); >> | ^~~ >> cc1: some warnings being treated as errors >> >> This allows MDIO_OCTEON to be built with COMPILE_TEST as well and >> includes the proper header for readq/writeq. This does not address >> the several -Wint-to-pointer-cast and -Wpointer-to-int-cast warnings >> that appeared as a result of commit 171a9bae68c7 ("staging/octeon: >> Allow test build on !MIPS") in these files. >> >> Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") >> Reported-by: kbuild test robot >> Reported-by: Mark Brown >> Reported-by: Randy Dunlap >> Signed-off-by: Nathan Chancellor > > > With today's linux-next (20190731), I am still seeing a Kconfig warning and > build errors (building for i386): > > and applying Greg's "depends on NETDEVICES" patch and this patch: > > WARNING: unmet direct dependencies detected for MDIO_OCTEON > Depends on [n]: NETDEVICES [=y] && MDIO_DEVICE [=m] && MDIO_BUS [=m] && > (64BIT [=n] || COMPILE_TEST [=y]) && HAS_IOMEM [=y] && OF_MDIO [=n] > Selected by [m]: > - OCTEON_ETHERNET [=m] && STAGING [=y] && (CAVIUM_OCTEON_SOC || > COMPILE_TEST [=y]) && NETDEVICES [=y] > > ERROR: "cavium_mdiobus_write" [drivers/net/phy/mdio-octeon.ko] undefined! > ERROR: "cavium_mdiobus_read" [drivers/net/phy/mdio-octeon.ko] undefined! > > > kernel .config file is attached. > > Am I missing another patch? > > thanks. If I add this to drivers/staging/octeon/Kconfig: select MDIO_OCTEON + select MDIO_CAVIUM help then the build succeeds. This isn't being done by make *config because MDIO_OCTEON depends on OF_MDIO, which is not set in my .config file, so the "select MDIO_CAVIUM" in MDIO_OCTEON is not done. However, there are lots of type/cast warnings in both mdio-octeon and mdio-cavium: ../drivers/net/phy/mdio-octeon.c: In function ‘octeon_mdiobus_probe’: ../drivers/net/phy/mdio-octeon.c:48:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] (u64)devm_ioremap(>dev, mdio_phys, regsize); ^ In file included from ../drivers/net/phy/mdio-octeon.c:14:0: ../drivers/net/phy/mdio-cavium.h:113:48: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) ^ ../drivers/net/phy/mdio-octeon.c:56:2: note: in expansion of macro ‘oct_mdio_writeq’ oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); ^~~ ../drivers/net/phy/mdio-cavium.h:113:48: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) ^ ../drivers/net/phy/mdio-octeon.c:77:2: note: in expansion of macro ‘oct_mdio_writeq’ oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); ^~~ ../drivers/net/phy/mdio-octeon.c: In function ‘octeon_mdiobus_remove’: ../drivers/net/phy/mdio-cavium.h:113:48: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) ^ ../drivers/net/phy/mdio-octeon.c:91:2: note: in expansion of macro ‘oct_mdio_writeq’ oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); ^~~ and CC [M] drivers/net/phy/mdio-cavium.o In file included from ../drivers/net/phy/mdio-cavium.c:11:0: ../drivers/net/p
[PATCH] staging: wilc1000: remove unused function
From: Adham Abozaeid function wilc_resolve_disconnect_aberration isn't referenced, so removing it Signed-off-by: Adham Abozaeid --- drivers/staging/wilc1000/wilc_hif.c | 9 - drivers/staging/wilc1000/wilc_hif.h | 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_hif.c b/drivers/staging/wilc1000/wilc_hif.c index ca252a43cd8c..4d809804c784 100644 --- a/drivers/staging/wilc1000/wilc_hif.c +++ b/drivers/staging/wilc1000/wilc_hif.c @@ -798,15 +798,6 @@ int wilc_disconnect(struct wilc_vif *vif) return 0; } -void wilc_resolve_disconnect_aberration(struct wilc_vif *vif) -{ - if (!vif->hif_drv) - return; - if (vif->hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP || - vif->hif_drv->hif_state == HOST_IF_CONNECTING) - wilc_disconnect(vif); -} - int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats) { struct wid wid_list[5]; diff --git a/drivers/staging/wilc1000/wilc_hif.h b/drivers/staging/wilc1000/wilc_hif.h index 3bc305151651..ac5fe57f872b 100644 --- a/drivers/staging/wilc1000/wilc_hif.h +++ b/drivers/staging/wilc1000/wilc_hif.h @@ -222,7 +222,6 @@ void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg); int wilc_set_operation_mode(struct wilc_vif *vif, int index, u8 mode, u8 ifc_id); int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats); -void wilc_resolve_disconnect_aberration(struct wilc_vif *vif); int wilc_get_vif_idx(struct wilc_vif *vif); int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power); int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power); -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wilc1000: merge drv_handle and operation_mode wids
From: Adham Abozaeid wilc_set_wfi_drv_handler and wilc_set_operation_mode sends the same parameters to the FW, so it's better to combine them together. Kept wilc_set_wfi_drv_handler implementation since it sends all the required parameters, and renamed it to wilc_set_operation_mode to be more descriptive. Signed-off-by: Adham Abozaeid --- drivers/staging/wilc1000/wilc_hif.c | 29 ++- drivers/staging/wilc1000/wilc_hif.h | 5 ++-- drivers/staging/wilc1000/wilc_netdev.c| 6 ++-- .../staging/wilc1000/wilc_wfi_cfgoperations.c | 24 +++ drivers/staging/wilc1000/wilc_wlan_if.h | 3 +- 5 files changed, 20 insertions(+), 47 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_hif.c b/drivers/staging/wilc1000/wilc_hif.c index f8646ea3b0c4..ca252a43cd8c 100644 --- a/drivers/staging/wilc1000/wilc_hif.c +++ b/drivers/staging/wilc1000/wilc_hif.c @@ -1409,18 +1409,15 @@ int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel) return result; } -int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mode, -u8 ifc_id) +int wilc_set_operation_mode(struct wilc_vif *vif, int index, u8 mode, + u8 ifc_id) { struct wid wid; - struct host_if_drv *hif_drv = vif->hif_drv; int result; struct wilc_drv_handler drv; - if (!hif_drv) - return -EFAULT; - wid.id = WID_SET_DRV_HANDLER; + wid.id = WID_SET_OPERATION_MODE; wid.type = WID_STR; wid.size = sizeof(drv); wid.val = (u8 *) @@ -1435,26 +1432,6 @@ int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mode, return result; } -int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode) -{ - struct wid wid; - struct wilc_op_mode op_mode; - int result; - - wid.id = WID_SET_OPERATION_MODE; - wid.type = WID_INT; - wid.size = sizeof(op_mode); - wid.val = (u8 *)_mode; - - op_mode.mode = cpu_to_le32(mode); - - result = wilc_send_config_pkt(vif, WILC_SET_CFG, , 1); - if (result) - netdev_err(vif->ndev, "Failed to set operation mode\n"); - - return result; -} - s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac, u32 *out_val) { struct wid wid; diff --git a/drivers/staging/wilc1000/wilc_hif.h b/drivers/staging/wilc1000/wilc_hif.h index be1d2497cde9..3bc305151651 100644 --- a/drivers/staging/wilc1000/wilc_hif.h +++ b/drivers/staging/wilc1000/wilc_hif.h @@ -219,9 +219,8 @@ int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, void *user_arg); int wilc_listen_state_expired(struct wilc_vif *vif, u64 cookie); void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg); -int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mode, -u8 ifc_id); -int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode); +int wilc_set_operation_mode(struct wilc_vif *vif, int index, u8 mode, + u8 ifc_id); int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats); void wilc_resolve_disconnect_aberration(struct wilc_vif *vif); int wilc_get_vif_idx(struct wilc_vif *vif); diff --git a/drivers/staging/wilc1000/wilc_netdev.c b/drivers/staging/wilc1000/wilc_netdev.c index 68129a0ba55f..bd848fdf7f8a 100644 --- a/drivers/staging/wilc1000/wilc_netdev.c +++ b/drivers/staging/wilc1000/wilc_netdev.c @@ -626,10 +626,8 @@ static int wilc_mac_open(struct net_device *ndev) return ret; } - wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif), vif->iftype, -vif->idx); - wilc_set_operation_mode(vif, vif->iftype); - + wilc_set_operation_mode(vif, wilc_get_vif_idx(vif), +vif->iftype, vif->idx); wilc_get_mac_address(vif, mac_add); netdev_dbg(ndev, "Mac address: %pM\n", mac_add); ether_addr_copy(ndev->dev_addr, mac_add); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index e2d9efed36b0..cf661e8ab1c8 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1419,7 +1419,8 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, if (vif->iftype == WILC_AP_MODE || vif->iftype == WILC_GO_MODE) wilc_wfi_deinit_mon_interface(wl, true); vif->iftype = WILC_STATION_MODE; - wilc_set_operation_mode(vif, WILC_STATION_MODE); + wilc_set_operation_mode(vif, wilc_get_vif_idx(vif), +WILC_STATION_MODE, vif->idx); memset(priv->assoc_stainfo.sta_associated_bss, 0, WILC_MAX_NUM_STA * ETH_ALEN); @@ -1431,8 +1432,8 @@ static int
[PATCH v3 2/3] media: imx7-media-csi: add i.MX6UL support
i.MX7 and i.MX6UL/L have the same CSI controller. So add i.MX6UL/L support to imx7-media-csi driver. Signed-off-by: Sébastien Szymanski --- Changes for v3: - rebase on Linux v5.3-rc2 - remove csi_soc_id var as it's not needed anymore thanks to commit e0c76a7d3428 ("media: imx7-media-csi: get csi upstream endpoint") Changes for v2: - rebase on top of linuxtv/master - mention i.MX6UL/L in header and Kconfig help text - rename csi_type to csi_soc_id drivers/staging/media/imx/Kconfig | 4 +-- drivers/staging/media/imx/imx7-media-csi.c | 30 +++--- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index 4c726345dc25..f51476243016 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -22,11 +22,11 @@ config VIDEO_IMX_CSI A video4linux camera sensor interface driver for i.MX5/6. config VIDEO_IMX7_CSI - tristate "i.MX7 Camera Sensor Interface driver" + tristate "i.MX6UL/L / i.MX7 Camera Sensor Interface driver" depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C default y help Enable support for video4linux camera sensor interface driver for - i.MX7. + i.MX6UL/L or i.MX7. endmenu endif diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 500b4c08d967..4ca79ff4c9b3 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * V4L2 Capture CSI Subdev for Freescale i.MX7 SOC + * V4L2 Capture CSI Subdev for Freescale i.MX6UL/L / i.MX7 SOC * * Copyright (c) 2019 Linaro Ltd * @@ -765,6 +765,7 @@ static int imx7_csi_configure(struct imx7_csi *csi) struct v4l2_pix_format *out_pix = >fmt.fmt.pix; __u32 in_code = csi->format_mbus[IMX7_CSI_PAD_SINK].code; u32 cr1, cr18; + int width = out_pix->width; if (out_pix->field == V4L2_FIELD_INTERLACED) { imx7_csi_deinterlace_enable(csi, true); @@ -774,15 +775,27 @@ static int imx7_csi_configure(struct imx7_csi *csi) imx7_csi_buf_stride_set(csi, 0); } - imx7_csi_set_imagpara(csi, out_pix->width, out_pix->height); + cr18 = imx7_csi_reg_read(csi, CSI_CSICR18); + + if (!csi->is_csi2) { + if (out_pix->pixelformat == V4L2_PIX_FMT_UYVY || + out_pix->pixelformat == V4L2_PIX_FMT_YUYV) + width *= 2; + + imx7_csi_set_imagpara(csi, width, out_pix->height); + + cr18 |= (BIT_BASEADDR_SWITCH_EN | BIT_BASEADDR_SWITCH_SEL | + BIT_BASEADDR_CHG_ERR_EN); + imx7_csi_reg_write(csi, cr18, CSI_CSICR18); - if (!csi->is_csi2) return 0; + } + + imx7_csi_set_imagpara(csi, width, out_pix->height); cr1 = imx7_csi_reg_read(csi, CSI_CSICR1); cr1 &= ~BIT_GCLK_MODE; - cr18 = imx7_csi_reg_read(csi, CSI_CSICR18); cr18 &= BIT_MIPI_DATA_FORMAT_MASK; cr18 |= BIT_DATA_FROM_MIPI; @@ -817,11 +830,9 @@ static void imx7_csi_enable(struct imx7_csi *csi) { imx7_csi_sw_reset(csi); - if (csi->is_csi2) { - imx7_csi_dmareq_rff_enable(csi); - imx7_csi_hw_enable_irq(csi); - imx7_csi_hw_enable(csi); - } + imx7_csi_dmareq_rff_enable(csi); + imx7_csi_hw_enable_irq(csi); + imx7_csi_hw_enable(csi); } static void imx7_csi_disable(struct imx7_csi *csi) @@ -1302,6 +1313,7 @@ static int imx7_csi_remove(struct platform_device *pdev) static const struct of_device_id imx7_csi_of_match[] = { { .compatible = "fsl,imx7-csi" }, + { .compatible = "fsl,imx6ul-csi" }, { }, }; MODULE_DEVICE_TABLE(of, imx7_csi_of_match); -- 2.21.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[driver-core:driver-core-testing 11/17] htmldocs: include/linux/device.h:1357: warning: Function parameter or member 'state_synced' not described in 'device'
tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-testing head: 90eb808c54acbacfb76b408036dc0fc287b46901 commit: 46c5ea62709238df9b033991882358fba099aa55 [11/17] driver core: Add sync_state driver/bus callback reproduce: make htmldocs If you fix the issue, kindly add following tag Reported-by: kbuild test robot All warnings (new ones prefixed by >>): Warning: The Sphinx 'sphinx_rtd_theme' HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme. WARNING: dot(1) not found, for better output quality install graphviz from http://www.graphviz.org WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org) include/linux/w1.h:272: warning: Function parameter or member 'of_match_table' not described in 'w1_family' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quotactl' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quota_on' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_free_mnt_opts' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_eat_lsm_opts' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_kern_mount' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_show_options' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_add_mnt_opt' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'd_instantiate' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'getprocattr' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'setprocattr' not described in 'security_list_options' lib/genalloc.c:1: warning: 'gen_pool_add_virt' not found lib/genalloc.c:1: warning: 'gen_pool_alloc' not found lib/genalloc.c:1: warning: 'gen_pool_free' not found lib/genalloc.c:1: warning: 'gen_pool_alloc_algo' not found include/linux/i2c.h:337: warning: Function parameter or member 'init_irq' not described in 'i2c_client' include/linux/spi/spi.h:190: warning: Function parameter or member 'driver_override' not described in 'spi_device' drivers/usb/typec/bus.c:1: warning: 'typec_altmode_unregister_driver' not found drivers/usb/typec/bus.c:1: warning: 'typec_altmode_register_driver' not found drivers/usb/typec/class.c:1: warning: 'typec_altmode_unregister_notifier' not found drivers/usb/typec/class.c:1: warning: 'typec_altmode_register_notifier' not found include/linux/regulator/machine.h:196: warning: Function parameter or member 'max_uV_step' not described in 'regulation_constraints' include/linux/regulator/driver.h:223: warning: Function parameter or member 'resume' not described in 'regulator_ops' fs/direct-io.c:258: warning: Excess function parameter 'offset' description in 'dio_complete' fs/libfs.c:496: warning: Excess function parameter 'available' description in 'simple_write_end' fs/posix_acl.c:647: warning: Function parameter or member 'inode' not described in 'posix_acl_update_mode' fs/posix_acl.c:647: warning: Function parameter or member 'mode_p' not described in 'posix_acl_update_mode' fs/posix_acl.c:647: warning: Function parameter or member 'acl' not described in 'posix_acl_update_mode' include/linux/device.h:258: warning: Function parameter or member 'bus' not described in 'bus_find_next_device' include/linux/device.h:258: warning: Function parameter or member 'cur' not described in 'bus_find_next_device' include/linux/device.h:483: warning: Function parameter or member 'drv' not described in 'driver_find_device_by_name' include/linux/device.h:483: warning: Excess function parameter 'driver' description in 'driver_find_device_by_name' include/linux/device.h:496: warning: Function parameter or member 'drv' not described in 'driver_find_device_by_of_node' include/linux/device.h:496: warning: Excess function parameter 'driver' description in 'driver_find_device_by_of_node' include/linux/device.h:509: warning: Function parameter or member 'drv' not described in 'driver_find_device_by_fwnode' include/linux/device.h:509: warning: Excess function parameter 'driver' description in 'driver_find_device_by_fwnode' include/linux/device.h:521: warning: Function parameter or member 'drv' not described in 'driver_find_device_by_devt' include/linux/device.h:521: warning: Excess function parameter 'driver' description in
[PATCH] net: mdio-octeon: Fix build error and Kconfig warning
arm allyesconfig warns: WARNING: unmet direct dependencies detected for MDIO_OCTEON Depends on [n]: NETDEVICES [=y] && MDIO_DEVICE [=y] && MDIO_BUS [=y] && 64BIT && HAS_IOMEM [=y] && OF_MDIO [=y] Selected by [y]: - OCTEON_ETHERNET [=y] && STAGING [=y] && (CAVIUM_OCTEON_SOC && NETDEVICES [=y] || COMPILE_TEST [=y]) and errors: In file included from ../drivers/net/phy/mdio-octeon.c:14: ../drivers/net/phy/mdio-octeon.c: In function 'octeon_mdiobus_probe': ../drivers/net/phy/mdio-cavium.h:111:36: error: implicit declaration of function 'writeq'; did you mean 'writeb'? [-Werror=implicit-function-declaration] 111 | #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) |^~ ../drivers/net/phy/mdio-octeon.c:56:2: note: in expansion of macro 'oct_mdio_writeq' 56 | oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); | ^~~ cc1: some warnings being treated as errors This allows MDIO_OCTEON to be built with COMPILE_TEST as well and includes the proper header for readq/writeq. This does not address the several -Wint-to-pointer-cast and -Wpointer-to-int-cast warnings that appeared as a result of commit 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") in these files. Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") Reported-by: kbuild test robot Reported-by: Mark Brown Reported-by: Randy Dunlap Signed-off-by: Nathan Chancellor --- drivers/net/phy/Kconfig | 2 +- drivers/net/phy/mdio-cavium.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 20f14c5fbb7e..ed2edf4b5b0e 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -159,7 +159,7 @@ config MDIO_MSCC_MIIM config MDIO_OCTEON tristate "Octeon and some ThunderX SOCs MDIO buses" - depends on 64BIT + depends on 64BIT || COMPILE_TEST depends on HAS_IOMEM && OF_MDIO select MDIO_CAVIUM help diff --git a/drivers/net/phy/mdio-cavium.h b/drivers/net/phy/mdio-cavium.h index ed5f9bb5448d..b7f89ad27465 100644 --- a/drivers/net/phy/mdio-cavium.h +++ b/drivers/net/phy/mdio-cavium.h @@ -108,6 +108,8 @@ static inline u64 oct_mdio_readq(u64 addr) return cvmx_read_csr(addr); } #else +#include + #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) #define oct_mdio_readq(addr) readq((void *)addr) #endif -- 2.22.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging:kpc2000:Fix dubious x | !y sparse warning
Bitwise OR(|) operation with 0 always yield same result. It fixes dubious x | !y sparse warning. Signed-off-by: Harsh Jain --- drivers/staging/kpc2000/kpc2000_i2c.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c index b108da4..5f027d7c 100644 --- a/drivers/staging/kpc2000/kpc2000_i2c.c +++ b/drivers/staging/kpc2000/kpc2000_i2c.c @@ -536,29 +536,15 @@ static u32 i801_func(struct i2c_adapter *adapter) u32 f = I2C_FUNC_I2C | /* 0x0001 (I enabled this one) */ - !I2C_FUNC_10BIT_ADDR | /* 0x0002 */ - !I2C_FUNC_PROTOCOL_MANGLING | /* 0x0004 */ ((priv->features & FEATURE_SMBUS_PEC) ? I2C_FUNC_SMBUS_PEC : 0) | /* 0x0008 */ - !I2C_FUNC_SMBUS_BLOCK_PROC_CALL | /* 0x8000 */ I2C_FUNC_SMBUS_QUICK | /* 0x0001 */ - !I2C_FUNC_SMBUS_READ_BYTE| /* 0x0002 */ - !I2C_FUNC_SMBUS_WRITE_BYTE | /* 0x0004 */ - !I2C_FUNC_SMBUS_READ_BYTE_DATA | /* 0x0008 */ - !I2C_FUNC_SMBUS_WRITE_BYTE_DATA | /* 0x0010 */ - !I2C_FUNC_SMBUS_READ_WORD_DATA | /* 0x0020 */ - !I2C_FUNC_SMBUS_WRITE_WORD_DATA | /* 0x0040 */ - !I2C_FUNC_SMBUS_PROC_CALL| /* 0x0080 */ - !I2C_FUNC_SMBUS_READ_BLOCK_DATA | /* 0x0100 */ - !I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | /* 0x0200 */ ((priv->features & FEATURE_I2C_BLOCK_READ) ? I2C_FUNC_SMBUS_READ_I2C_BLOCK : 0) | /* 0x0400 */ I2C_FUNC_SMBUS_WRITE_I2C_BLOCK | /* 0x0800 */ I2C_FUNC_SMBUS_BYTE | /* _READ_BYTE _WRITE_BYTE */ I2C_FUNC_SMBUS_BYTE_DATA | /* _READ_BYTE_DATA _WRITE_BYTE_DATA */ I2C_FUNC_SMBUS_WORD_DATA | /* _READ_WORD_DATA _WRITE_WORD_DATA */ - I2C_FUNC_SMBUS_BLOCK_DATA| /* _READ_BLOCK_DATA _WRITE_BLOCK_DATA */ - !I2C_FUNC_SMBUS_I2C_BLOCK| /* _READ_I2C_BLOCK _WRITE_I2C_BLOCK */ - !I2C_FUNC_SMBUS_EMUL; /* _QUICK _BYTE _BYTE_DATA _WORD_DATA _PROC_CALL _WRITE_BLOCK_DATA _I2C_BLOCK _PEC */ + I2C_FUNC_SMBUS_BLOCK_DATA; /* _READ_BLOCK_DATA _WRITE_BLOCK_DATA */ return f; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[Patch v2 10/10] staging: rtl8723bs: core: Remove Macro "IS_MAC_ADDRESS_BROADCAST"
Remove unused macro IS_MAC_ADDRESS_BROADCAST. In future if one wants use it ,use generic API "is_broadcast_ether_addr" Signed-off-by: Hariprasad Kelam --- v2 - Add patch number drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c index 8eb0ff5..eb08569 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c @@ -9,13 +9,6 @@ #include #include -#define IS_MAC_ADDRESS_BROADCAST(addr) \ -(\ - ((addr[0] == 0xff) && (addr[1] == 0xff) && \ - (addr[2] == 0xff) && (addr[3] == 0xff) && \ - (addr[4] == 0xff) && (addr[5] == 0xff)) ? true : false \ -) - u8 rtw_validate_bssid(u8 *bssid) { u8 ret = true; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[Patch v2 09/10] staging: rtl8723bs: core: Remove unneeded variables sgi_20m,sgi_40m and sgi_80m
htpriv.sgi_* variables are of type u8 ,instead of storing them in local variables ,its better to read value directly from structure. Signed-off-by: Hariprasad Kelam --- v2 - Add patch number drivers/staging/rtl8723bs/core/rtw_xmit.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index b5dcb78..0690d5e 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -346,21 +346,18 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) u8 query_ra_short_GI(struct sta_info *psta) { - u8 sgi = false, sgi_20m = false, sgi_40m = false, sgi_80m = false; - - sgi_20m = psta->htpriv.sgi_20m; - sgi_40m = psta->htpriv.sgi_40m; + u8 sgi = false; switch (psta->bw_mode) { case CHANNEL_WIDTH_80: - sgi = sgi_80m; + sgi = false; break; case CHANNEL_WIDTH_40: - sgi = sgi_40m; + sgi = psta->htpriv.sgi_40m; break; case CHANNEL_WIDTH_20: default: - sgi = sgi_20m; + sgi = psta->htpriv.sgi_20m; break; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[Patch v2 08/10] staging: rtl8723bs: core: Remove unneeded extern WFD_OUI
Remove unneeded extern variable "extern unsigned char WFD_OUI" Signed-off-by: Hariprasad Kelam --- v2 - Add patch number drivers/staging/rtl8723bs/core/rtw_ap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c index 7bd5c61..2bb20762 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ap.c +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c @@ -13,7 +13,6 @@ extern unsigned char RTW_WPA_OUI[]; extern unsigned char WMM_OUI[]; extern unsigned char WPS_OUI[]; extern unsigned char P2P_OUI[]; -extern unsigned char WFD_OUI[]; void init_mlme_ap_info(struct adapter *padapter) { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[Patch v2 07/10] staging: rtl8723bs: Remove unneeded function argument for init_addba_retry_timer
init_addba_retry_timer does not use padapter, so only keep psta Signed-off-by: Hariprasad Kelam --- v2 - Add patch number drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 2 +- drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 2 +- drivers/staging/rtl8723bs/os_dep/mlme_linux.c| 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c index bdc52d8..39c3482 100644 --- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c @@ -262,7 +262,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) ) ); - init_addba_retry_timer(pstapriv->padapter, psta); + init_addba_retry_timer(psta); /* for A-MPDU Rx reordering buffer control */ for (i = 0; i < 16 ; i++) { diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h index fd3cf95..bdbf15f 100644 --- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h @@ -539,7 +539,7 @@ void init_mlme_ext_priv(struct adapter *padapter); int init_hw_mlme_ext(struct adapter *padapter); void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext); extern void init_mlme_ext_timer(struct adapter *padapter); -extern void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta); +extern void init_addba_retry_timer(struct sta_info *psta); extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv); /* void fill_fwpriv(struct adapter *padapter, struct fw_priv *pfwpriv); */ diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c index 52a5b31..038036d 100644 --- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c @@ -179,7 +179,7 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie) } } -void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta) +void init_addba_retry_timer(struct sta_info *psta) { timer_setup(>addba_retry_timer, addba_timer_hdl, 0); } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[Patch v2 06/10] staging: rtl8723bs: os_dep: Remove unused defines related to combo scan
Remove below defines WEXT_CSCAN_AMOUNT WEXT_CSCAN_BUF_LEN WEXT_CSCAN_NPROBE_SECTION Signed-off-by: Hariprasad Kelam --- v2 - Add patch number drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index 99e6b10..73b412e 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -21,13 +21,10 @@ #define RATE_COUNT 4 /* combo scan */ -#define WEXT_CSCAN_AMOUNT 9 -#define WEXT_CSCAN_BUF_LEN 360 #define WEXT_CSCAN_HEADER "CSCAN S\x01\x00\x00S\x00" #define WEXT_CSCAN_HEADER_SIZE 12 #define WEXT_CSCAN_SSID_SECTION'S' #define WEXT_CSCAN_CHANNEL_SECTION 'C' -#define WEXT_CSCAN_NPROBE_SECTION 'N' #define WEXT_CSCAN_ACTV_DWELL_SECTION 'A' #define WEXT_CSCAN_PASV_DWELL_SECTION 'P' #define WEXT_CSCAN_HOME_DWELL_SECTION 'H' -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[Patch v2 05/10] staging: rtl8723bs: os_dep: Remove unused defines
Remove below unused defines RTW_CH_MAX_2G_CHANNEL rtw_a_rates RTW_A_RATES_NUM RTW_5G_CHANNELS_NUM Signed-off-by: Hariprasad Kelam --- v2 - Add patch number drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 9bc6856..30165ca 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -19,8 +19,6 @@ #define RTW_MAX_REMAIN_ON_CHANNEL_DURATION 5000 /* ms */ #define RTW_MAX_NUM_PMKIDS 4 -#define RTW_CH_MAX_2G_CHANNEL 14 /* Max channel in 2G band */ - static const u32 rtw_cipher_suites[] = { WLAN_CIPHER_SUITE_WEP40, WLAN_CIPHER_SUITE_WEP104, @@ -73,13 +71,10 @@ static struct ieee80211_rate rtw_rates[] = { RATETAB_ENT(540, 0x800, 0), }; -#define rtw_a_rates(rtw_rates + 4) -#define RTW_A_RATES_NUM8 #define rtw_g_rates(rtw_rates + 0) #define RTW_G_RATES_NUM12 #define RTW_2G_CHANNELS_NUM 14 -#define RTW_5G_CHANNELS_NUM 37 static struct ieee80211_channel rtw_2ghz_channels[] = { CHAN2G(1, 2412, 0), -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[Patch v2 04/10] staging: rtl8723bs: hal: Remove function argument padapter
Remove function argument "padapter" in rtl8723bs_init_recv_priv function as its not being used Signed-off-by: Hariprasad Kelam --- v4 - Add patch number drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 4 ++-- drivers/staging/rtl8723bs/include/recv_osdep.h | 2 +- drivers/staging/rtl8723bs/os_dep/recv_linux.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c index 032d018..7fbe6c6 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c @@ -479,7 +479,7 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter) precvpriv->free_recv_buf_queue_cnt = 0; for (i = 0; i < n ; i++) { list_del_init(>list); - rtw_os_recvbuf_resource_free(padapter, precvbuf); + rtw_os_recvbuf_resource_free(precvbuf); precvbuf++; } precvpriv->precv_buf = NULL; @@ -518,7 +518,7 @@ void rtl8723bs_free_recv_priv(struct adapter *padapter) precvpriv->free_recv_buf_queue_cnt = 0; for (i = 0; i < n ; i++) { list_del_init(>list); - rtw_os_recvbuf_resource_free(padapter, precvbuf); + rtw_os_recvbuf_resource_free(precvbuf); precvbuf++; } precvpriv->precv_buf = NULL; diff --git a/drivers/staging/rtl8723bs/include/recv_osdep.h b/drivers/staging/rtl8723bs/include/recv_osdep.h index 1056f61..47689f6 100644 --- a/drivers/staging/rtl8723bs/include/recv_osdep.h +++ b/drivers/staging/rtl8723bs/include/recv_osdep.h @@ -29,7 +29,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv); void rtw_os_free_recvframe(union recv_frame *precvframe); -void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf); +void rtw_os_recvbuf_resource_free(struct recv_buf *precvbuf); _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata); void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt_attrib *pattrib); diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c index 643cacc..a5070fb 100644 --- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c @@ -43,7 +43,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv) } /* free os related resource in struct recv_buf */ -void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf) +void rtw_os_recvbuf_resource_free(struct recv_buf *precvbuf) { if (precvbuf->pskb) { dev_kfree_skb_any(precvbuf->pskb); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[Patch v2 03/10] staging: rtl8723bs: os_dep: Remove unused function argument sdio_device_id
Remove passing pdid as function argument to rtw_sdio_if1_init as it is not being used Signed-off-by: Hariprasad Kelam --- v3 - Add patch number drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c index 540a7ee..cefff1e 100644 --- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c +++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c @@ -315,7 +315,7 @@ static void sd_intf_stop(struct adapter *padapter) } -static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct sdio_device_id *pdid) +static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj) { int status = _FAIL; struct net_device *pnetdev; @@ -473,7 +473,7 @@ static int rtw_drv_init( goto exit; } - if1 = rtw_sdio_if1_init(dvobj, id); + if1 = rtw_sdio_if1_init(dvobj); if (if1 == NULL) { DBG_871X("rtw_init_primarystruct adapter Failed!\n"); goto free_dvobj; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[driver-core:driver-core-testing 9/17] htmldocs: include/linux/device.h:1336: warning: Function parameter or member 'has_edit_links' not described in 'device'
tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-testing head: 90eb808c54acbacfb76b408036dc0fc287b46901 commit: d4d28915bc4a5db5370387e2622b2cb5502d229a [9/17] driver core: Add edit_links() callback for drivers reproduce: make htmldocs If you fix the issue, kindly add following tag Reported-by: kbuild test robot All warnings (new ones prefixed by >>): Warning: The Sphinx 'sphinx_rtd_theme' HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme. WARNING: dot(1) not found, for better output quality install graphviz from http://www.graphviz.org WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org) include/linux/w1.h:272: warning: Function parameter or member 'of_match_table' not described in 'w1_family' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quotactl' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quota_on' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_free_mnt_opts' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_eat_lsm_opts' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_kern_mount' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_show_options' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_add_mnt_opt' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'd_instantiate' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'getprocattr' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'setprocattr' not described in 'security_list_options' lib/genalloc.c:1: warning: 'gen_pool_add_virt' not found lib/genalloc.c:1: warning: 'gen_pool_alloc' not found lib/genalloc.c:1: warning: 'gen_pool_free' not found lib/genalloc.c:1: warning: 'gen_pool_alloc_algo' not found include/linux/i2c.h:337: warning: Function parameter or member 'init_irq' not described in 'i2c_client' fs/direct-io.c:258: warning: Excess function parameter 'offset' description in 'dio_complete' fs/libfs.c:496: warning: Excess function parameter 'available' description in 'simple_write_end' fs/posix_acl.c:647: warning: Function parameter or member 'inode' not described in 'posix_acl_update_mode' fs/posix_acl.c:647: warning: Function parameter or member 'mode_p' not described in 'posix_acl_update_mode' fs/posix_acl.c:647: warning: Function parameter or member 'acl' not described in 'posix_acl_update_mode' include/linux/regulator/machine.h:196: warning: Function parameter or member 'max_uV_step' not described in 'regulation_constraints' include/linux/regulator/driver.h:223: warning: Function parameter or member 'resume' not described in 'regulator_ops' include/linux/spi/spi.h:190: warning: Function parameter or member 'driver_override' not described in 'spi_device' drivers/usb/typec/bus.c:1: warning: 'typec_altmode_register_driver' not found drivers/usb/typec/bus.c:1: warning: 'typec_altmode_unregister_driver' not found drivers/usb/typec/class.c:1: warning: 'typec_altmode_register_notifier' not found drivers/usb/typec/class.c:1: warning: 'typec_altmode_unregister_notifier' not found include/linux/device.h:248: warning: Function parameter or member 'bus' not described in 'bus_find_next_device' include/linux/device.h:248: warning: Function parameter or member 'cur' not described in 'bus_find_next_device' include/linux/device.h:465: warning: Function parameter or member 'drv' not described in 'driver_find_device_by_name' include/linux/device.h:465: warning: Excess function parameter 'driver' description in 'driver_find_device_by_name' include/linux/device.h:478: warning: Function parameter or member 'drv' not described in 'driver_find_device_by_of_node' include/linux/device.h:478: warning: Excess function parameter 'driver' description in 'driver_find_device_by_of_node' include/linux/device.h:491: warning: Function parameter or member 'drv' not described in 'driver_find_device_by_fwnode' include/linux/device.h:491: warning: Excess function parameter 'driver' description in 'driver_find_device_by_fwnode' include/linux/device.h:503: warning: Function parameter or member 'drv' not described in 'driver_find_device_by_devt' include/linux/device.h:503: warning: Excess function parameter 'driver' description in
[Patch v2 02/10] staging: rtl8723bs: os_dep: Move common code to func
Inthis file all functions has below common functionality 1.Check flag padapter->bSurpriseRemoved 2.Get sdio_func structure from intf_hdl. This patch introduces two new APIs rtw_isadapter_removed,rtw_sdio_get_func which helps to do above common functionality. Signed-off-by: Hariprasad Kelam --- v2 - Add patch number drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c | 149 ++ 1 file changed, 41 insertions(+), 108 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c index 50b8934..126429e 100644 --- a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c @@ -26,26 +26,38 @@ inline void rtw_sdio_set_irq_thd(struct dvobj_priv *dvobj, void *thd_hdl) sdio_data->sys_sdio_irq_thd = thd_hdl; } -u8 sd_f0_read8(struct intf_hdl *pintfhdl, u32 addr, s32 *err) +static s32 rtw_isadapter_removed(struct intf_hdl *pintfhdl) { struct adapter *padapter; + + padapter = pintfhdl->padapter; + return padapter->bSurpriseRemoved; +} + +static struct sdio_func *rtw_sdio_get_func(struct intf_hdl *pintfhdl) +{ struct dvobj_priv *psdiodev; struct sdio_data *psdio; + psdiodev = pintfhdl->pintf_dev; + psdio = >intf_data; + + return psdio->func; +} + +u8 sd_f0_read8(struct intf_hdl *pintfhdl, u32 addr, s32 *err) +{ u8 v = 0; struct sdio_func *func; bool claim_needed; - padapter = pintfhdl->padapter; - psdiodev = pintfhdl->pintf_dev; - psdio = >intf_data; - if (padapter->bSurpriseRemoved) { + if (rtw_isadapter_removed(pintfhdl)) { /* DBG_871X(" %s (padapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n", __func__); */ return v; } - func = psdio->func; + func = rtw_sdio_get_func(pintfhdl); claim_needed = rtw_sdio_claim_host_needed(func); if (claim_needed) @@ -65,23 +77,15 @@ u8 sd_f0_read8(struct intf_hdl *pintfhdl, u32 addr, s32 *err) */ s32 _sd_cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata) { - struct adapter *padapter; - struct dvobj_priv *psdiodev; - struct sdio_data *psdio; - int err = 0, i; struct sdio_func *func; - padapter = pintfhdl->padapter; - psdiodev = pintfhdl->pintf_dev; - psdio = >intf_data; - - if (padapter->bSurpriseRemoved) { + if (rtw_isadapter_removed(pintfhdl)) { /* DBG_871X(" %s (padapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n", __func__); */ return err; } - func = psdio->func; + func = rtw_sdio_get_func(pintfhdl); for (i = 0; i < cnt; i++) { pdata[i] = sdio_readb(func, addr+i, ); @@ -100,24 +104,16 @@ s32 _sd_cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata) */ s32 sd_cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata) { - struct adapter *padapter; - struct dvobj_priv *psdiodev; - struct sdio_data *psdio; - int err = 0; struct sdio_func *func; bool claim_needed; - padapter = pintfhdl->padapter; - psdiodev = pintfhdl->pintf_dev; - psdio = >intf_data; - - if (padapter->bSurpriseRemoved) { + if (rtw_isadapter_removed(pintfhdl)) { /* DBG_871X(" %s (padapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n", __func__); */ return err; } - func = psdio->func; + func = rtw_sdio_get_func(pintfhdl); claim_needed = rtw_sdio_claim_host_needed(func); if (claim_needed) @@ -135,23 +131,15 @@ s32 sd_cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata) */ s32 _sd_cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata) { - struct adapter *padapter; - struct dvobj_priv *psdiodev; - struct sdio_data *psdio; - int err = 0, i; struct sdio_func *func; - padapter = pintfhdl->padapter; - psdiodev = pintfhdl->pintf_dev; - psdio = >intf_data; - - if (padapter->bSurpriseRemoved) { + if (rtw_isadapter_removed(pintfhdl)) { /* DBG_871X(" %s (padapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n", __func__); */ return err; } - func = psdio->func; + func = rtw_sdio_get_func(pintfhdl); for (i = 0; i < cnt; i++) { sdio_writeb(func, pdata[i], addr+i, ); @@ -170,24 +158,16 @@ s32 _sd_cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata) */ s32 sd_cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pdata) { - struct adapter *padapter; - struct dvobj_priv *psdiodev; - struct sdio_data *psdio; - int err = 0; struct sdio_func *func; bool
[Patch v2 01/10] staging: rtl8723bs: os_dep: Remove function _rtw_regdomain_select
This function simply returns _regdom_rd . So replace this function with actual code Signed-off-by: Hariprasad Kelam --- v2 - Add patch number drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c index aa2f62a..bbd83b2 100644 --- a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c +++ b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c @@ -115,13 +115,6 @@ static int _rtw_reg_notifier_apply(struct wiphy *wiphy, return 0; } -static const struct ieee80211_regdomain *_rtw_regdomain_select(struct - rtw_regulatory - *reg) -{ - return _regdom_rd; -} - static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, struct wiphy *wiphy, void (*reg_notifier)(struct wiphy *wiphy, @@ -137,7 +130,7 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG; wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS; - regd = _rtw_regdomain_select(reg); + regd = _regdom_rd; wiphy_apply_custom_regulatory(wiphy, regd); /* Hard code flags */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 3/3] media: dt-bindings: imx7-csi: add i.MX6UL/L support
Document "fsl,imx6ul-csi" entry. Reviewed-by: Rob Herring Signed-off-by: Sébastien Szymanski --- Changes for v3: - none Changes for v2: - New patch to document new "fsl,imx6ul-csi" entry. Documentation/devicetree/bindings/media/imx7-csi.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/imx7-csi.txt b/Documentation/devicetree/bindings/media/imx7-csi.txt index 443aef07356e..d80ceefa0c00 100644 --- a/Documentation/devicetree/bindings/media/imx7-csi.txt +++ b/Documentation/devicetree/bindings/media/imx7-csi.txt @@ -9,7 +9,7 @@ to connect directly to external CMOS image sensors. Required properties: -- compatible: "fsl,imx7-csi"; +- compatible: "fsl,imx7-csi" or "fsl,imx6ul-csi"; - reg : base address and length of the register set for the device; - interrupts: should contain CSI interrupt; - clocks: list of clock specifiers, see -- 2.21.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: next/master build: 221 builds: 11 failed, 210 passed, 13 errors, 1174 warnings (next-20190731)
From: Nathan Chancellor Date: Wed, 31 Jul 2019 09:35:09 -0700 > In file included from ../drivers/net/phy/mdio-octeon.c:14: > ../drivers/net/phy/mdio-cavium.h:111:36: error: implicit declaration of > function 'writeq'; did you mean 'writeb'? > [-Werror=implicit-function-declaration] > 111 | #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) One of the hi-lo, lo-hi writeq/readq headers has to be included. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 1/3] ARM: dts: imx6ul: Add csi node
Add csi node for i.MX6UL SoC. Reviewed-by: Fabio Estevam Signed-off-by: Sébastien Szymanski --- Changes for v3: - none Changes for v2: - only "mclk" clock is required now. arch/arm/boot/dts/imx6ul.dtsi | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/imx6ul.dtsi b/arch/arm/boot/dts/imx6ul.dtsi index 81d4b4925127..56cfcf0e5084 100644 --- a/arch/arm/boot/dts/imx6ul.dtsi +++ b/arch/arm/boot/dts/imx6ul.dtsi @@ -957,6 +957,15 @@ }; }; + csi: csi@21c4000 { + compatible = "fsl,imx6ul-csi", "fsl,imx7-csi"; + reg = <0x021c4000 0x4000>; + interrupts = ; + clocks = < IMX6UL_CLK_CSI>; + clock-names = "mclk"; + status = "disabled"; + }; + lcdif: lcdif@21c8000 { compatible = "fsl,imx6ul-lcdif", "fsl,imx28-lcdif"; reg = <0x021c8000 0x4000>; -- 2.21.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: next/master build: 221 builds: 11 failed, 210 passed, 13 errors, 1174 warnings (next-20190731)
On Wed, Jul 31, 2019 at 06:00:43PM +0200, Greg KH wrote: > On Wed, Jul 31, 2019 at 08:48:24AM -0700, David Miller wrote: > > From: Greg Kroah-Hartman > > Date: Wed, 31 Jul 2019 13:35:22 +0200 > > > > > On Wed, Jul 31, 2019 at 12:24:41PM +0100, Mark Brown wrote: > > >> On Wed, Jul 31, 2019 at 04:07:41AM -0700, kernelci.org bot wrote: > > >> > > >> Today's -next fails to build an ARM allmodconfig due to: > > >> > > >> > allmodconfig (arm, gcc-8) ― FAIL, 1 error, 40 warnings, 0 section > > >> > mismatches > > >> > > > >> > Errors: > > >> > drivers/net/phy/mdio-cavium.h:111:36: error: implicit declaration > > >> > of function 'writeq'; did you mean 'writel'? > > >> > [-Werror=implicit-function-declaration] > > >> > > >> as a result of the changes that introduced: > > >> > > >> WARNING: unmet direct dependencies detected for MDIO_OCTEON > > >> Depends on [n]: NETDEVICES [=y] && MDIO_DEVICE [=m] && MDIO_BUS [=m] > > >> && 64BIT && HAS_IOMEM [=y] && OF_MDIO [=m] > > >> Selected by [m]: > > >> - OCTEON_ETHERNET [=m] && STAGING [=y] && (CAVIUM_OCTEON_SOC && > > >> NETDEVICES [=y] || COMPILE_TEST [=y]) > > >> > > >> which is triggered by the staging OCTEON_ETHERNET driver which misses a > > >> 64BIT dependency but added COMPILE_TEST in 171a9bae68c72f2 > > >> (staging/octeon: Allow test build on !MIPS). > > > > > > A patch was posted for this, but it needs to go through the netdev tree > > > as that's where the offending patches are coming from. > > > > I didn't catch that, was netdev CC:'d? > > Nope, just you :( > > I'll resend it now and cc: netdev. > > thanks, > > greg k-h If it is this patch: https://lore.kernel.org/netdev/20190731160219.ga2...@kroah.com/ It doesn't resolve that issue. I applied it and tested on next-20190731. $ make -j$(nproc) -s ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=out distclean allyesconfig drivers/net/phy/ WARNING: unmet direct dependencies detected for MDIO_OCTEON Depends on [n]: NETDEVICES [=y] && MDIO_DEVICE [=y] && MDIO_BUS [=y] && 64BIT && HAS_IOMEM [=y] && OF_MDIO [=y] Selected by [y]: - OCTEON_ETHERNET [=y] && STAGING [=y] && (CAVIUM_OCTEON_SOC || COMPILE_TEST [=y]) && NETDEVICES [=y] ../drivers/net/phy/mdio-octeon.c: In function 'octeon_mdiobus_probe': ../drivers/net/phy/mdio-octeon.c:48:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 48 | (u64)devm_ioremap(>dev, mdio_phys, regsize); | ^ In file included from ../drivers/net/phy/mdio-octeon.c:14: ../drivers/net/phy/mdio-cavium.h:111:36: error: implicit declaration of function 'writeq'; did you mean 'writeb'? [-Werror=implicit-function-declaration] 111 | #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) |^~ ../drivers/net/phy/mdio-octeon.c:56:2: note: in expansion of macro 'oct_mdio_writeq' 56 | oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); | ^~~ ../drivers/net/phy/mdio-cavium.h:111:48: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 111 | #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) |^ ../drivers/net/phy/mdio-octeon.c:56:2: note: in expansion of macro 'oct_mdio_writeq' 56 | oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); | ^~~ ../drivers/net/phy/mdio-cavium.h:111:48: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 111 | #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) |^ ../drivers/net/phy/mdio-octeon.c:77:2: note: in expansion of macro 'oct_mdio_writeq' 77 | oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); | ^~~ ../drivers/net/phy/mdio-octeon.c: In function 'octeon_mdiobus_remove': ../drivers/net/phy/mdio-cavium.h:111:48: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 111 | #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) |^ ../drivers/net/phy/mdio-octeon.c:91:2: note: in expansion of macro 'oct_mdio_writeq' 91 | oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); | ^~~ cc1: some warnings being treated as errors make[3]: *** [../scripts/Makefile.build:274: drivers/net/phy/mdio-octeon.o] Error 1 make[3]: *
Re: [PATCH v2] staging/octeon: Fix build error without CONFIG_NETDEVICES
From: Greg KH Date: Wed, 31 Jul 2019 18:02:19 +0200 > From: YueHaibing > > While do COMPILE_TEST build without CONFIG_NETDEVICES, > we get Kconfig warning: > > WARNING: unmet direct dependencies detected for PHYLIB > Depends on [n]: NETDEVICES [=n] > Selected by [y]: > - OCTEON_ETHERNET [=y] && STAGING [=y] && (CAVIUM_OCTEON_SOC && NETDEVICES > [=n] || COMPILE_TEST [=y]) > > Reported-by: Hulk Robot > Reported-by: Mark Brown > Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") > Signed-off-by: YueHaibing > Signed-off-by: Greg Kroah-Hartman Applied to net-next. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging/octeon: Fix build error without CONFIG_NETDEVICES
From: YueHaibing While do COMPILE_TEST build without CONFIG_NETDEVICES, we get Kconfig warning: WARNING: unmet direct dependencies detected for PHYLIB Depends on [n]: NETDEVICES [=n] Selected by [y]: - OCTEON_ETHERNET [=y] && STAGING [=y] && (CAVIUM_OCTEON_SOC && NETDEVICES [=n] || COMPILE_TEST [=y]) Reported-by: Hulk Robot Reported-by: Mark Brown Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") Signed-off-by: YueHaibing Signed-off-by: Greg Kroah-Hartman --- v2: cc: netdev and add another reported-by line. drivers/staging/octeon/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/octeon/Kconfig b/drivers/staging/octeon/Kconfig index 5b39946..5319909 100644 --- a/drivers/staging/octeon/Kconfig +++ b/drivers/staging/octeon/Kconfig @@ -1,7 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 config OCTEON_ETHERNET tristate "Cavium Networks Octeon Ethernet support" - depends on CAVIUM_OCTEON_SOC && NETDEVICES || COMPILE_TEST + depends on CAVIUM_OCTEON_SOC || COMPILE_TEST + depends on NETDEVICES select PHYLIB select MDIO_OCTEON help -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: next/master build: 221 builds: 11 failed, 210 passed, 13 errors, 1174 warnings (next-20190731)
On Wed, Jul 31, 2019 at 08:48:24AM -0700, David Miller wrote: > From: Greg Kroah-Hartman > Date: Wed, 31 Jul 2019 13:35:22 +0200 > > > On Wed, Jul 31, 2019 at 12:24:41PM +0100, Mark Brown wrote: > >> On Wed, Jul 31, 2019 at 04:07:41AM -0700, kernelci.org bot wrote: > >> > >> Today's -next fails to build an ARM allmodconfig due to: > >> > >> > allmodconfig (arm, gcc-8) ― FAIL, 1 error, 40 warnings, 0 section > >> > mismatches > >> > > >> > Errors: > >> > drivers/net/phy/mdio-cavium.h:111:36: error: implicit declaration of > >> > function 'writeq'; did you mean 'writel'? > >> > [-Werror=implicit-function-declaration] > >> > >> as a result of the changes that introduced: > >> > >> WARNING: unmet direct dependencies detected for MDIO_OCTEON > >> Depends on [n]: NETDEVICES [=y] && MDIO_DEVICE [=m] && MDIO_BUS [=m] && > >> 64BIT && HAS_IOMEM [=y] && OF_MDIO [=m] > >> Selected by [m]: > >> - OCTEON_ETHERNET [=m] && STAGING [=y] && (CAVIUM_OCTEON_SOC && > >> NETDEVICES [=y] || COMPILE_TEST [=y]) > >> > >> which is triggered by the staging OCTEON_ETHERNET driver which misses a > >> 64BIT dependency but added COMPILE_TEST in 171a9bae68c72f2 > >> (staging/octeon: Allow test build on !MIPS). > > > > A patch was posted for this, but it needs to go through the netdev tree > > as that's where the offending patches are coming from. > > I didn't catch that, was netdev CC:'d? Nope, just you :( I'll resend it now and cc: netdev. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 07/22] staging: erofs: remove redundant #include "internal.h"
Because #include "internal.h" is included in xattr.h Signed-off-by: Gao Xiang --- drivers/staging/erofs/namei.c | 1 - drivers/staging/erofs/super.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/erofs/namei.c b/drivers/staging/erofs/namei.c index 50816b4c05fc..8e06526da023 100644 --- a/drivers/staging/erofs/namei.c +++ b/drivers/staging/erofs/namei.c @@ -6,7 +6,6 @@ * http://www.huawei.com/ * Created by Gao Xiang */ -#include "internal.h" #include "xattr.h" #include diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index 55f51d2b3930..c20a94b035a7 100644 --- a/drivers/staging/erofs/super.c +++ b/drivers/staging/erofs/super.c @@ -11,7 +11,6 @@ #include #include #include -#include "internal.h" #include "xattr.h" #define CREATE_TRACE_POINTS -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 17/22] staging: erofs: tidy up decompression frontend
Although this patch has an amount of changes, it is hard to separate into smaller patches. Most changes are due to structure renaming for better understand and straightforward, z_erofs_vle_workgroup to z_erofs_pcluster since it represents a physical cluster; z_erofs_vle_work to z_erofs_collection since it represents a collection of logical pages; z_erofs_vle_work_builder to z_erofs_collector since it's used to fill z_erofs_{pcluster,collection}. struct z_erofs_vle_work_finder has no extra use compared with struct z_erofs_collector, delete it. FULL_LENGTH bit is integrated into .length of pcluster so that it can be updated with the corresponding length change in atomic. Minor, add comments for better description. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/zdata.c | 983 +++--- drivers/staging/erofs/zdata.h | 96 ++-- 2 files changed, 465 insertions(+), 614 deletions(-) diff --git a/drivers/staging/erofs/zdata.c b/drivers/staging/erofs/zdata.c index 88c8c4082498..6ebee2ca8dc5 100644 --- a/drivers/staging/erofs/zdata.c +++ b/drivers/staging/erofs/zdata.c @@ -18,7 +18,7 @@ */ #define PAGE_UNALLOCATED ((void *)0x5F0E4B1D) -/* how to allocate cached pages for a workgroup */ +/* how to allocate cached pages for a pcluster */ enum z_erofs_cache_alloctype { DONTALLOC, /* don't allocate any cached pages */ DELAYEDALLOC, /* delayed allocation (at the time of submitting io) */ @@ -34,156 +34,158 @@ typedef tagptr1_t compressed_page_t; tagptr_fold(compressed_page_t, page, 1) static struct workqueue_struct *z_erofs_workqueue __read_mostly; -static struct kmem_cache *z_erofs_workgroup_cachep __read_mostly; +static struct kmem_cache *pcluster_cachep __read_mostly; void z_erofs_exit_zip_subsystem(void) { destroy_workqueue(z_erofs_workqueue); - kmem_cache_destroy(z_erofs_workgroup_cachep); + kmem_cache_destroy(pcluster_cachep); } static inline int init_unzip_workqueue(void) { const unsigned int onlinecpus = num_possible_cpus(); + const unsigned int flags = WQ_UNBOUND | WQ_HIGHPRI | WQ_CPU_INTENSIVE; /* -* we don't need too many threads, limiting threads -* could improve scheduling performance. +* no need to spawn too many threads, limiting threads could minimum +* scheduling overhead, perhaps per-CPU threads should be better? */ - z_erofs_workqueue = - alloc_workqueue("erofs_unzipd", - WQ_UNBOUND | WQ_HIGHPRI | WQ_CPU_INTENSIVE, - onlinecpus + onlinecpus / 4); - + z_erofs_workqueue = alloc_workqueue("erofs_unzipd", flags, + onlinecpus + onlinecpus / 4); return z_erofs_workqueue ? 0 : -ENOMEM; } static void init_once(void *ptr) { - struct z_erofs_vle_workgroup *grp = ptr; - struct z_erofs_vle_work *const work = - z_erofs_vle_grab_primary_work(grp); + struct z_erofs_pcluster *pcl = ptr; + struct z_erofs_collection *cl = z_erofs_primarycollection(pcl); unsigned int i; - mutex_init(>lock); - work->nr_pages = 0; - work->vcnt = 0; + mutex_init(>lock); + cl->nr_pages = 0; + cl->vcnt = 0; for (i = 0; i < Z_EROFS_CLUSTER_MAX_PAGES; ++i) - grp->compressed_pages[i] = NULL; + pcl->compressed_pages[i] = NULL; } -static void init_always(struct z_erofs_vle_workgroup *grp) +static void init_always(struct z_erofs_pcluster *pcl) { - struct z_erofs_vle_work *const work = - z_erofs_vle_grab_primary_work(grp); + struct z_erofs_collection *cl = z_erofs_primarycollection(pcl); - atomic_set(>obj.refcount, 1); - grp->flags = 0; + atomic_set(>obj.refcount, 1); - DBG_BUGON(work->nr_pages); - DBG_BUGON(work->vcnt); + DBG_BUGON(cl->nr_pages); + DBG_BUGON(cl->vcnt); } int __init z_erofs_init_zip_subsystem(void) { - z_erofs_workgroup_cachep = - kmem_cache_create("erofs_compress", - Z_EROFS_WORKGROUP_SIZE, 0, - SLAB_RECLAIM_ACCOUNT, init_once); - - if (z_erofs_workgroup_cachep) { + pcluster_cachep = kmem_cache_create("erofs_compress", + Z_EROFS_WORKGROUP_SIZE, 0, + SLAB_RECLAIM_ACCOUNT, init_once); + if (pcluster_cachep) { if (!init_unzip_workqueue()) return 0; - kmem_cache_destroy(z_erofs_workgroup_cachep); + kmem_cache_destroy(pcluster_cachep); } return -ENOMEM; } -enum z_erofs_vle_work_role { - Z_EROFS_VLE_WORK_SECONDARY, - Z_EROFS_VLE_WORK_PRIMARY, +enum z_erofs_collectmode { +
[PATCH v2 05/22] staging: erofs: sunset erofs_workstn_{lock,unlock}
It was used for Linux backward compatibility, and no use for upstream kernel. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/internal.h | 3 --- drivers/staging/erofs/utils.c| 10 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index 501429ec0f91..ed487ee56f74 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -179,9 +179,6 @@ static inline void *erofs_kmalloc(struct erofs_sb_info *sbi, #define test_opt(sbi, option) ((sbi)->mount_opt & EROFS_MOUNT_##option) #ifdef CONFIG_EROFS_FS_ZIP -#define erofs_workstn_lock(sbi) xa_lock(&(sbi)->workstn_tree) -#define erofs_workstn_unlock(sbi) xa_unlock(&(sbi)->workstn_tree) - /* basic unit of the workstation of a super_block */ struct erofs_workgroup { /* the workgroup index in the workstation */ diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c index a68dbe375fa0..024806003297 100644 --- a/drivers/staging/erofs/utils.c +++ b/drivers/staging/erofs/utils.c @@ -102,14 +102,14 @@ int erofs_register_workgroup(struct super_block *sb, return err; sbi = EROFS_SB(sb); - erofs_workstn_lock(sbi); + xa_lock(>workstn_tree); grp = xa_tag_pointer(grp, tag); /* * Bump up reference count before making this workgroup * visible to other users in order to avoid potential UAF -* without serialized by erofs_workstn_lock. +* without serialized by workstn_lock. */ __erofs_workgroup_get(grp); @@ -122,7 +122,7 @@ int erofs_register_workgroup(struct super_block *sb, */ __erofs_workgroup_put(grp); - erofs_workstn_unlock(sbi); + xa_unlock(>workstn_tree); radix_tree_preload_end(); return err; } @@ -225,7 +225,7 @@ unsigned long erofs_shrink_workstation(struct erofs_sb_info *sbi, int i, found; repeat: - erofs_workstn_lock(sbi); + xa_lock(>workstn_tree); found = radix_tree_gang_lookup(>workstn_tree, batch, first_index, PAGEVEC_SIZE); @@ -243,7 +243,7 @@ unsigned long erofs_shrink_workstation(struct erofs_sb_info *sbi, if (unlikely(!--nr_shrink)) break; } - erofs_workstn_unlock(sbi); + xa_unlock(>workstn_tree); if (i && nr_shrink) goto repeat; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 01/22] staging: erofs: update source file headers
- Use the correct style for all SPDX License Identifiers; - Get rid of the unnecessary license boilerplate; - Use "GPL-2.0-only" instead of "GPL-2.0" suggested-by Stephen. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/Kconfig | 2 +- drivers/staging/erofs/Makefile | 2 +- drivers/staging/erofs/compress.h | 2 +- drivers/staging/erofs/data.c | 6 +- drivers/staging/erofs/decompressor.c | 2 +- drivers/staging/erofs/dir.c| 6 +- drivers/staging/erofs/erofs_fs.h | 8 ++-- drivers/staging/erofs/include/linux/tagptr.h | 6 +++--- drivers/staging/erofs/include/trace/events/erofs.h | 2 +- drivers/staging/erofs/inode.c | 6 +- drivers/staging/erofs/internal.h | 8 ++-- drivers/staging/erofs/namei.c | 6 +- drivers/staging/erofs/super.c | 6 +- drivers/staging/erofs/unzip_pagevec.h | 8 ++-- drivers/staging/erofs/unzip_vle.c | 6 +- drivers/staging/erofs/unzip_vle.h | 8 ++-- drivers/staging/erofs/utils.c | 7 +-- drivers/staging/erofs/xattr.c | 6 +- drivers/staging/erofs/xattr.h | 8 ++-- drivers/staging/erofs/zmap.c | 2 +- 20 files changed, 27 insertions(+), 80 deletions(-) diff --git a/drivers/staging/erofs/Kconfig b/drivers/staging/erofs/Kconfig index d04b798a8efb..2577cbb46a5b 100644 --- a/drivers/staging/erofs/Kconfig +++ b/drivers/staging/erofs/Kconfig @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: GPL-2.0 +# SPDX-License-Identifier: GPL-2.0-only config EROFS_FS tristate "EROFS filesystem support" diff --git a/drivers/staging/erofs/Makefile b/drivers/staging/erofs/Makefile index e704d9e51514..3ade87e78d06 100644 --- a/drivers/staging/erofs/Makefile +++ b/drivers/staging/erofs/Makefile @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: GPL-2.0 +# SPDX-License-Identifier: GPL-2.0-only EROFS_VERSION = "1.0pre1" diff --git a/drivers/staging/erofs/compress.h b/drivers/staging/erofs/compress.h index c43aa3374d28..043013f9ef1b 100644 --- a/drivers/staging/erofs/compress.h +++ b/drivers/staging/erofs/compress.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * linux/drivers/staging/erofs/compress.h * diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c index f73e4720cd3e..75b859e48084 100644 --- a/drivers/staging/erofs/data.c +++ b/drivers/staging/erofs/data.c @@ -1,14 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/staging/erofs/data.c * * Copyright (C) 2017-2018 HUAWEI, Inc. * http://www.huawei.com/ * Created by Gao Xiang - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of the Linux - * distribution for more details. */ #include "internal.h" #include diff --git a/drivers/staging/erofs/decompressor.c b/drivers/staging/erofs/decompressor.c index 1fb0abb98dff..b75524d0b322 100644 --- a/drivers/staging/erofs/decompressor.c +++ b/drivers/staging/erofs/decompressor.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/staging/erofs/decompressor.c * diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c index dbf6a151886c..2fbfc4935077 100644 --- a/drivers/staging/erofs/dir.c +++ b/drivers/staging/erofs/dir.c @@ -1,14 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * linux/drivers/staging/erofs/dir.c * * Copyright (C) 2017-2018 HUAWEI, Inc. * http://www.huawei.com/ * Created by Gao Xiang - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of the Linux - * distribution for more details. */ #include "internal.h" diff --git a/drivers/staging/erofs/erofs_fs.h b/drivers/staging/erofs/erofs_fs.h index 9f61abb7c1ca..9cd749d56920 100644 --- a/drivers/staging/erofs/erofs_fs.h +++ b/drivers/staging/erofs/erofs_fs.h @@ -1,14 +1,10 @@ -/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 - * +/* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */ +/* * linux/drivers/staging/erofs/erofs_fs.h * * Copyright (C) 2017-2018 HUAWEI, Inc. * http://www.huawei.com/ * Created by Gao Xiang - * - * This file is dual-licensed; you may select either the GNU General Public - * License version 2 or Apache License, Version 2.0. See the file COPYING - * in the main directory of the Linux distribution for more details. */ #ifndef __EROFS_FS_H #define __EROFS_FS_H diff --git
[PATCH v2 03/22] staging: erofs: fix dummy functions erofs_{get, list}xattr
dummy functions erofs_{get,list}xattr should be inlined without xattr enabled. Signed-off-by: Yue Hu [ Gao Xiang : this patch was "staging: erofs: remove needless dummy functions of erofs_{get,list}xattr. "] Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/xattr.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/erofs/xattr.h b/drivers/staging/erofs/xattr.h index fbcd57bdf886..63cc87e3d3f4 100644 --- a/drivers/staging/erofs/xattr.h +++ b/drivers/staging/erofs/xattr.h @@ -39,6 +39,7 @@ static inline unsigned int xattrblock_offset(struct erofs_sb_info *sbi, return (xattr_id * sizeof(__u32)) % EROFS_BLKSIZ; } +#ifdef CONFIG_EROFS_FS_XATTR extern const struct xattr_handler erofs_xattr_user_handler; extern const struct xattr_handler erofs_xattr_trusted_handler; #ifdef CONFIG_EROFS_FS_SECURITY @@ -64,25 +65,24 @@ static const struct xattr_handler *xattr_handler_map[] = { xattr_handler_map[idx] : NULL; } -#ifdef CONFIG_EROFS_FS_XATTR extern const struct xattr_handler *erofs_xattr_handlers[]; int erofs_getxattr(struct inode *, int, const char *, void *, size_t); ssize_t erofs_listxattr(struct dentry *, char *, size_t); #else -static int __maybe_unused erofs_getxattr(struct inode *inode, int index, - const char *name, - void *buffer, size_t buffer_size) +static inline int erofs_getxattr(struct inode *inode, int index, +const char *name, void *buffer, +size_t buffer_size) { return -ENOTSUPP; } -static ssize_t __maybe_unused erofs_listxattr(struct dentry *dentry, - char *buffer, size_t buffer_size) +static inline ssize_t erofs_listxattr(struct dentry *dentry, + char *buffer, size_t buffer_size) { return -ENOTSUPP; } -#endif +#endif /* !CONFIG_EROFS_FS_XATTR */ #ifdef CONFIG_EROFS_FS_POSIX_ACL struct posix_acl *erofs_get_acl(struct inode *inode, int type); -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 02/22] staging: erofs: rename source files for better understanding
Keep in line with erofs-outofstaging patchset as well, see https://lore.kernel.org/linux-fsdevel/20190725095658.155779-1-gaoxian...@huawei.com/ Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/Makefile | 2 +- drivers/staging/erofs/{include/linux => }/tagptr.h | 6 +++--- drivers/staging/erofs/{unzip_vle.c => zdata.c} | 4 ++-- drivers/staging/erofs/{unzip_vle.h => zdata.h} | 8 drivers/staging/erofs/{unzip_pagevec.h => zpvec.h} | 8 5 files changed, 14 insertions(+), 14 deletions(-) rename drivers/staging/erofs/{include/linux => }/tagptr.h (97%) rename drivers/staging/erofs/{unzip_vle.c => zdata.c} (99%) rename drivers/staging/erofs/{unzip_vle.h => zdata.h} (97%) rename drivers/staging/erofs/{unzip_pagevec.h => zpvec.h} (96%) diff --git a/drivers/staging/erofs/Makefile b/drivers/staging/erofs/Makefile index 3ade87e78d06..5cdae21cb5af 100644 --- a/drivers/staging/erofs/Makefile +++ b/drivers/staging/erofs/Makefile @@ -9,5 +9,5 @@ obj-$(CONFIG_EROFS_FS) += erofs.o ccflags-y += -I $(srctree)/$(src)/include erofs-objs := super.o inode.o data.o namei.o dir.o utils.o erofs-$(CONFIG_EROFS_FS_XATTR) += xattr.o -erofs-$(CONFIG_EROFS_FS_ZIP) += unzip_vle.o zmap.o decompressor.o +erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o diff --git a/drivers/staging/erofs/include/linux/tagptr.h b/drivers/staging/erofs/tagptr.h similarity index 97% rename from drivers/staging/erofs/include/linux/tagptr.h rename to drivers/staging/erofs/tagptr.h index b3f13773fb99..a72897c86744 100644 --- a/drivers/staging/erofs/include/linux/tagptr.h +++ b/drivers/staging/erofs/tagptr.h @@ -4,8 +4,8 @@ * * Copyright (C) 2018 Gao Xiang */ -#ifndef _LINUX_TAGPTR_H -#define _LINUX_TAGPTR_H +#ifndef __EROFS_FS_TAGPTR_H +#define __EROFS_FS_TAGPTR_H #include #include @@ -106,5 +106,5 @@ tagptr_init(o, cmpxchg(>v, o.v, n.v)); }) ptptr->v &= ~tags; \ *ptptr; }) -#endif +#endif /* __EROFS_FS_TAGPTR_H */ diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers/staging/erofs/zdata.c similarity index 99% rename from drivers/staging/erofs/unzip_vle.c rename to drivers/staging/erofs/zdata.c index 28a98e79c1e9..f7667628bbf1 100644 --- a/drivers/staging/erofs/unzip_vle.c +++ b/drivers/staging/erofs/zdata.c @@ -1,12 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * linux/drivers/staging/erofs/unzip_vle.c + * linux/drivers/staging/erofs/zdata.c * * Copyright (C) 2018 HUAWEI, Inc. * http://www.huawei.com/ * Created by Gao Xiang */ -#include "unzip_vle.h" +#include "zdata.h" #include "compress.h" #include diff --git a/drivers/staging/erofs/unzip_vle.h b/drivers/staging/erofs/zdata.h similarity index 97% rename from drivers/staging/erofs/unzip_vle.h rename to drivers/staging/erofs/zdata.h index d92515cd1c06..8d0119d697da 100644 --- a/drivers/staging/erofs/unzip_vle.h +++ b/drivers/staging/erofs/zdata.h @@ -1,16 +1,16 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * linux/drivers/staging/erofs/unzip_vle.h + * linux/drivers/staging/erofs/zdata.h * * Copyright (C) 2018 HUAWEI, Inc. * http://www.huawei.com/ * Created by Gao Xiang */ -#ifndef __EROFS_FS_UNZIP_VLE_H -#define __EROFS_FS_UNZIP_VLE_H +#ifndef __EROFS_FS_ZDATA_H +#define __EROFS_FS_ZDATA_H #include "internal.h" -#include "unzip_pagevec.h" +#include "zpvec.h" #define Z_EROFS_NR_INLINE_PAGEVECS 3 diff --git a/drivers/staging/erofs/unzip_pagevec.h b/drivers/staging/erofs/zpvec.h similarity index 96% rename from drivers/staging/erofs/unzip_pagevec.h rename to drivers/staging/erofs/zpvec.h index f07302c3c3f5..77bf6877bad8 100644 --- a/drivers/staging/erofs/unzip_pagevec.h +++ b/drivers/staging/erofs/zpvec.h @@ -1,15 +1,15 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * linux/drivers/staging/erofs/unzip_pagevec.h + * linux/drivers/staging/erofs/zpvec.h * * Copyright (C) 2018 HUAWEI, Inc. * http://www.huawei.com/ * Created by Gao Xiang */ -#ifndef __EROFS_UNZIP_PAGEVEC_H -#define __EROFS_UNZIP_PAGEVEC_H +#ifndef __EROFS_FS_ZPVEC_H +#define __EROFS_FS_ZPVEC_H -#include +#include "tagptr.h" /* page type in pagevec for unzip subsystem */ enum z_erofs_page_type { -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 06/22] staging: erofs: clean up internal.h
Tidy up relative order of variables / declarations in internal.h, move some local static functions out into other files and add tags at the end of #endif acrossing several lines. No logic change. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/decompressor.c | 27 + drivers/staging/erofs/internal.h | 157 --- drivers/staging/erofs/super.c| 2 +- drivers/staging/erofs/zdata.c| 8 +- drivers/staging/erofs/zdata.h| 13 +++ 5 files changed, 92 insertions(+), 115 deletions(-) diff --git a/drivers/staging/erofs/decompressor.c b/drivers/staging/erofs/decompressor.c index b75524d0b322..ee5762351f80 100644 --- a/drivers/staging/erofs/decompressor.c +++ b/drivers/staging/erofs/decompressor.c @@ -223,6 +223,33 @@ static void copy_from_pcpubuf(struct page **out, const char *dst, } } +static void *erofs_vmap(struct page **pages, unsigned int count) +{ +#ifdef CONFIG_EROFS_FS_USE_VM_MAP_RAM + int i = 0; + + while (1) { + void *addr = vm_map_ram(pages, count, -1, PAGE_KERNEL); + /* retry two more times (totally 3 times) */ + if (addr || ++i >= 3) + return addr; + vm_unmap_aliases(); + } + return NULL; +#else + return vmap(pages, count, VM_MAP, PAGE_KERNEL); +#endif +} + +static void erofs_vunmap(const void *mem, unsigned int count) +{ +#ifdef CONFIG_EROFS_FS_USE_VM_MAP_RAM + vm_unmap_ram(mem, count); +#else + vunmap(mem); +#endif +} + static int decompress_generic(struct z_erofs_decompress_req *rq, struct list_head *pagepool) { diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index ed487ee56f74..959bd0ae9d74 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -6,8 +6,8 @@ * http://www.huawei.com/ * Created by Gao Xiang */ -#ifndef __INTERNAL_H -#define __INTERNAL_H +#ifndef __EROFS_INTERNAL_H +#define __EROFS_INTERNAL_H #include #include @@ -28,15 +28,11 @@ #define infoln(x, ...) pr_info(x "\n", ##__VA_ARGS__) #ifdef CONFIG_EROFS_FS_DEBUG #define debugln(x, ...) pr_debug(x "\n", ##__VA_ARGS__) - -#define dbg_might_sleep might_sleep #define DBG_BUGON BUG_ON #else #define debugln(x, ...) ((void)0) - -#define dbg_might_sleep() ((void)0) #define DBG_BUGON(x)((void)(x)) -#endif +#endif /* !CONFIG_EROFS_FS_DEBUG */ enum { FAULT_KMALLOC, @@ -53,7 +49,7 @@ struct erofs_fault_info { unsigned int inject_rate; unsigned int inject_type; }; -#endif +#endif /* CONFIG_EROFS_FAULT_INJECTION */ #ifdef CONFIG_EROFS_FS_ZIP_CACHE_BIPOLAR #define EROFS_FS_ZIP_CACHE_LVL (2) @@ -71,6 +67,9 @@ struct erofs_fault_info { #define EROFS_SUPER_MAGIC EROFS_SUPER_MAGIC_V1 typedef u64 erofs_nid_t; +typedef u64 erofs_off_t; +/* data type for filesystem-wide blocks number */ +typedef u32 erofs_blk_t; struct erofs_sb_info { /* list for all registered superblocks, mainly for shrinker */ @@ -154,7 +153,7 @@ static inline bool time_to_inject(struct erofs_sb_info *sbi, int type) static inline void erofs_show_injection_info(int type) { } -#endif +#endif /* !CONFIG_EROFS_FAULT_INJECTION */ static inline void *erofs_kmalloc(struct erofs_sb_info *sbi, size_t size, gfp_t flags) @@ -179,6 +178,8 @@ static inline void *erofs_kmalloc(struct erofs_sb_info *sbi, #define test_opt(sbi, option) ((sbi)->mount_opt & EROFS_MOUNT_##option) #ifdef CONFIG_EROFS_FS_ZIP +#define EROFS_LOCKED_MAGIC (INT_MIN | 0xE0F510CCL) + /* basic unit of the workstation of a super_block */ struct erofs_workgroup { /* the workgroup index in the workstation */ @@ -188,8 +189,6 @@ struct erofs_workgroup { atomic_t refcount; }; -#define EROFS_LOCKED_MAGIC (INT_MIN | 0xE0F510CCL) - #if defined(CONFIG_SMP) static inline bool erofs_workgroup_try_to_freeze(struct erofs_workgroup *grp, int val) @@ -246,50 +245,24 @@ static inline int erofs_wait_on_workgroup_freezed(struct erofs_workgroup *grp) DBG_BUGON(v == EROFS_LOCKED_MAGIC); return v; } -#endif - -int erofs_workgroup_put(struct erofs_workgroup *grp); -struct erofs_workgroup *erofs_find_workgroup(struct super_block *sb, -pgoff_t index, bool *tag); -int erofs_register_workgroup(struct super_block *sb, -struct erofs_workgroup *grp, bool tag); -unsigned long erofs_shrink_workstation(struct erofs_sb_info *sbi, - unsigned long nr_shrink, bool cleanup); -void erofs_workgroup_free_rcu(struct erofs_workgroup *grp); - -#ifdef EROFS_FS_HAS_MANAGED_CACHE -int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi, -
[PATCH v2 13/22] staging: erofs: refine erofs_allocpage()
remove duplicated code in decompressor by introducing failable erofs_allocpage(). Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/decompressor.c | 12 +++- drivers/staging/erofs/internal.h | 2 +- drivers/staging/erofs/utils.c| 5 +++-- drivers/staging/erofs/zdata.c| 5 + 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/staging/erofs/decompressor.c b/drivers/staging/erofs/decompressor.c index ee5762351f80..744c43a456e9 100644 --- a/drivers/staging/erofs/decompressor.c +++ b/drivers/staging/erofs/decompressor.c @@ -74,15 +74,9 @@ static int lz4_prepare_destpages(struct z_erofs_decompress_req *rq, victim = availables[--top]; get_page(victim); } else { - if (!list_empty(pagepool)) { - victim = lru_to_page(pagepool); - list_del(>lru); - DBG_BUGON(page_ref_count(victim) != 1); - } else { - victim = alloc_pages(GFP_KERNEL, 0); - if (!victim) - return -ENOMEM; - } + victim = erofs_allocpage(pagepool, GFP_KERNEL, false); + if (unlikely(!victim)) + return -ENOMEM; victim->mapping = Z_EROFS_MAPPING_STAGING; } rq->out[i] = victim; diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index 5e1ef2b5a458..a631acd0dc62 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -516,7 +516,7 @@ int erofs_namei(struct inode *dir, struct qstr *name, extern const struct file_operations erofs_dir_fops; /* utils.c / zdata.c */ -struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp); +struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp, bool nofail); #if (EROFS_PCPUBUF_NR_PAGES > 0) void *erofs_get_pcpubuf(unsigned int pagenr); diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c index 0e86e44d60d0..260ea2970b4b 100644 --- a/drivers/staging/erofs/utils.c +++ b/drivers/staging/erofs/utils.c @@ -9,15 +9,16 @@ #include "internal.h" #include -struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp) +struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp, bool nofail) { struct page *page; if (!list_empty(pool)) { page = lru_to_page(pool); + DBG_BUGON(page_ref_count(page) != 1); list_del(>lru); } else { - page = alloc_pages(gfp | __GFP_NOFAIL, 0); + page = alloc_pages(gfp | (nofail ? __GFP_NOFAIL : 0), 0); } return page; } diff --git a/drivers/staging/erofs/zdata.c b/drivers/staging/erofs/zdata.c index bc478eebf509..3078510e350d 100644 --- a/drivers/staging/erofs/zdata.c +++ b/drivers/staging/erofs/zdata.c @@ -634,10 +634,7 @@ z_erofs_vle_work_iter_end(struct z_erofs_vle_work_builder *builder) static inline struct page *__stagingpage_alloc(struct list_head *pagepool, gfp_t gfp) { - struct page *page = erofs_allocpage(pagepool, gfp); - - if (unlikely(!page)) - return NULL; + struct page *page = erofs_allocpage(pagepool, gfp, true); page->mapping = Z_EROFS_MAPPING_STAGING; return page; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 20/22] staging: erofs: tidy up utils.c
Keep in line with erofs-outofstaging patchset: - Update comments in erofs_try_to_release_workgroup; - code style cleanup. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/utils.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c index 0e6308b15717..814c2ee037ae 100644 --- a/drivers/staging/erofs/utils.c +++ b/drivers/staging/erofs/utils.c @@ -114,8 +114,7 @@ int erofs_register_workgroup(struct super_block *sb, */ __erofs_workgroup_get(grp); - err = radix_tree_insert(>workstn_tree, - grp->index, grp); + err = radix_tree_insert(>workstn_tree, grp->index, grp); if (unlikely(err)) /* * it's safe to decrease since the workgroup isn't visible @@ -156,18 +155,18 @@ static bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi, bool cleanup) { /* -* for managed cache enabled, the refcount of workgroups -* themselves could be < 0 (freezed). So there is no guarantee -* that all refcount > 0 if managed cache is enabled. +* If managed cache is on, refcount of workgroups +* themselves could be < 0 (freezed). In other words, +* there is no guarantee that all refcounts > 0. */ if (!erofs_workgroup_try_to_freeze(grp, 1)) return false; /* -* note that all cached pages should be unlinked -* before delete it from the radix tree. -* Otherwise some cached pages of an orphan old workgroup -* could be still linked after the new one is available. +* Note that all cached pages should be unattached +* before deleted from the radix tree. Otherwise some +* cached pages could be still attached to the orphan +* old workgroup when the new one is available in the tree. */ if (erofs_try_to_free_all_cached_pages(sbi, grp)) { erofs_workgroup_unfreeze(grp, 1); @@ -175,7 +174,7 @@ static bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi, } /* -* it is impossible to fail after the workgroup is freezed, +* It's impossible to fail after the workgroup is freezed, * however in order to avoid some race conditions, add a * DBG_BUGON to observe this in advance. */ @@ -183,8 +182,8 @@ static bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi, grp->index)) != grp); /* -* if managed cache is enable, the last refcount -* should indicate the related workstation. +* If managed cache is on, last refcount should indicate +* the related workstation. */ erofs_workgroup_unfreeze_final(grp); return true; @@ -273,9 +272,9 @@ static unsigned long erofs_shrink_scan(struct shrinker *shrink, unsigned long freed = 0; spin_lock(_sb_list_lock); - do + do { run_no = ++shrinker_run_no; - while (run_no == 0); + } while (run_no == 0); /* Iterate over all mounted superblocks and try to shrink them */ p = erofs_sb_list.next; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 11/22] staging: erofs: kill all failure handling in fill_super()
.kill_sb() will do that instead in order to remove duplicated code. Note that the initialzation of managed_cache is now moved after s_root is assigned since it's more preferred to iput() in .put_super() and all inodes should be evicted before the end of generic_shutdown_super(sb). Suggested-by: Al Viro Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/super.c | 118 +++--- 1 file changed, 52 insertions(+), 66 deletions(-) diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index bfb6e1e09781..7c31030daf4e 100644 --- a/drivers/staging/erofs/super.c +++ b/drivers/staging/erofs/super.c @@ -343,12 +343,13 @@ static const struct address_space_operations managed_cache_aops = { .invalidatepage = managed_cache_invalidatepage, }; -static struct inode *erofs_init_managed_cache(struct super_block *sb) +static int erofs_init_managed_cache(struct super_block *sb) { - struct inode *inode = new_inode(sb); + struct erofs_sb_info *const sbi = EROFS_SB(sb); + struct inode *const inode = new_inode(sb); if (unlikely(!inode)) - return ERR_PTR(-ENOMEM); + return -ENOMEM; set_nlink(inode, 1); inode->i_size = OFFSET_MAX; @@ -357,37 +358,38 @@ static struct inode *erofs_init_managed_cache(struct super_block *sb) mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS | __GFP_HIGHMEM | __GFP_MOVABLE | __GFP_NOFAIL); - return inode; + sbi->managed_cache = inode; + return 0; } - +#else +static int erofs_init_managed_cache(struct super_block *sb) { return 0; } #endif static int erofs_fill_super(struct super_block *sb, void *data, int silent) { struct inode *inode; struct erofs_sb_info *sbi; - int err = -EINVAL; + int err; infoln("fill_super, device -> %s", sb->s_id); infoln("options -> %s", (char *)data); + sb->s_magic = EROFS_SUPER_MAGIC; + if (unlikely(!sb_set_blocksize(sb, EROFS_BLKSIZ))) { errln("failed to set erofs blksize"); - goto err; + return -EINVAL; } sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); - if (unlikely(!sbi)) { - err = -ENOMEM; - goto err; - } - sb->s_fs_info = sbi; + if (unlikely(!sbi)) + return -ENOMEM; + sb->s_fs_info = sbi; err = superblock_read(sb); if (err) - goto err_sbread; + return err; - sb->s_magic = EROFS_SUPER_MAGIC; sb->s_flags |= SB_RDONLY | SB_NOATIME; sb->s_maxbytes = MAX_LFS_FILESIZE; sb->s_time_gran = 1; @@ -397,13 +399,12 @@ static int erofs_fill_super(struct super_block *sb, void *data, int silent) #ifdef CONFIG_EROFS_FS_XATTR sb->s_xattr = erofs_xattr_handlers; #endif - /* set erofs default mount options */ default_options(sbi); err = parse_options(sb, data); - if (err) - goto err_parseopt; + if (unlikely(err)) + return err; if (!silent) infoln("root inode @ nid %llu", ROOT_NID(sbi)); @@ -417,93 +418,78 @@ static int erofs_fill_super(struct super_block *sb, void *data, int silent) INIT_RADIX_TREE(>workstn_tree, GFP_ATOMIC); #endif -#ifdef EROFS_FS_HAS_MANAGED_CACHE - sbi->managed_cache = erofs_init_managed_cache(sb); - if (IS_ERR(sbi->managed_cache)) { - err = PTR_ERR(sbi->managed_cache); - goto err_init_managed_cache; - } -#endif - /* get the root inode */ inode = erofs_iget(sb, ROOT_NID(sbi), true); - if (IS_ERR(inode)) { - err = PTR_ERR(inode); - goto err_iget; - } + if (IS_ERR(inode)) + return PTR_ERR(inode); - if (!S_ISDIR(inode->i_mode)) { + if (unlikely(!S_ISDIR(inode->i_mode))) { errln("rootino(nid %llu) is not a directory(i_mode %o)", ROOT_NID(sbi), inode->i_mode); - err = -EINVAL; iput(inode); - goto err_iget; + return -EINVAL; } sb->s_root = d_make_root(inode); - if (!sb->s_root) { - err = -ENOMEM; - goto err_iget; - } + if (unlikely(!sb->s_root)) + return -ENOMEM; erofs_shrinker_register(sb); + /* sb->s_umount is already locked, SB_ACTIVE and SB_BORN are not set */ + err = erofs_init_managed_cache(sb); + if (unlikely(err)) + return err; if (!silent) infoln("mounted on %s with opts: %s.", sb->s_id, (char *)data); return 0; - /* -* please add a label for each exit point and use -* the following name convention, thus new features -* can be integrated
[PATCH v2 18/22] staging: erofs: remove clusterbits in sbi
clustersize can now be set on per-file basis rather than per-filesystem basis. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/internal.h | 5 - drivers/staging/erofs/super.c| 9 - drivers/staging/erofs/zmap.c | 3 +-- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index a631acd0dc62..3176c350779e 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -77,8 +77,6 @@ struct erofs_sb_info { struct list_head list; struct mutex umount_mutex; - /* cluster size in bit shift */ - unsigned char clusterbits; /* the dedicated workstation for compression */ struct radix_tree_root workstn_tree; @@ -248,9 +246,6 @@ static inline int erofs_wait_on_workgroup_freezed(struct erofs_workgroup *grp) /* hard limit of pages per compressed cluster */ #define Z_EROFS_CLUSTER_MAX_PAGES (CONFIG_EROFS_FS_CLUSTER_PAGE_LIMIT) #define EROFS_PCPUBUF_NR_PAGES Z_EROFS_CLUSTER_MAX_PAGES - -/* page count of a compressed cluster */ -#define erofs_clusterpages(sbi) ((1 << (sbi)->clusterbits) / PAGE_SIZE) #else #define EROFS_PCPUBUF_NR_PAGES 0 #endif /* !CONFIG_EROFS_FS_ZIP */ diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index af5d87793e4d..dad5a3137988 100644 --- a/drivers/staging/erofs/super.c +++ b/drivers/staging/erofs/super.c @@ -124,15 +124,6 @@ static int superblock_read(struct super_block *sb) sbi->xattr_blkaddr = le32_to_cpu(layout->xattr_blkaddr); #endif sbi->islotbits = ffs(sizeof(struct erofs_inode_v1)) - 1; -#ifdef CONFIG_EROFS_FS_ZIP - /* TODO: clusterbits should be related to inode */ - sbi->clusterbits = blkszbits; - - if (1 << (sbi->clusterbits - PAGE_SHIFT) > Z_EROFS_CLUSTER_MAX_PAGES) - errln("clusterbits %u is not supported on this kernel", - sbi->clusterbits); -#endif - sbi->root_nid = le16_to_cpu(layout->root_nid); sbi->inos = le64_to_cpu(layout->inos); diff --git a/drivers/staging/erofs/zmap.c b/drivers/staging/erofs/zmap.c index 205e884ca4e0..aeed5c674d9e 100644 --- a/drivers/staging/erofs/zmap.c +++ b/drivers/staging/erofs/zmap.c @@ -13,13 +13,12 @@ int z_erofs_fill_inode(struct inode *inode) { struct erofs_vnode *const vi = EROFS_V(inode); - struct super_block *const sb = inode->i_sb; if (vi->datamode == EROFS_INODE_FLAT_COMPRESSION_LEGACY) { vi->z_advise = 0; vi->z_algorithmtype[0] = 0; vi->z_algorithmtype[1] = 0; - vi->z_logical_clusterbits = EROFS_SB(sb)->clusterbits; + vi->z_logical_clusterbits = LOG_BLOCK_SIZE; vi->z_physical_clusterbits[0] = vi->z_logical_clusterbits; vi->z_physical_clusterbits[1] = vi->z_logical_clusterbits; set_bit(EROFS_V_Z_INITED_BIT, >flags); -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 19/22] staging: erofs: turn cache strategies into mount options
Kill all kconfig cache strategies and turn them into mount options "cache_strategy={disable|readahead|readaround}". As the first step, cached pages can still be usable after cache is disabled by remounting, and these pages will be fallen out over time, which can be refined in the later version if some requirement is needed. Update related document as well. Suggested-by: Theodore Ts'o Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- .../erofs/Documentation/filesystems/erofs.txt | 10 +++ drivers/staging/erofs/Kconfig | 38 --- drivers/staging/erofs/internal.h | 25 +++- drivers/staging/erofs/super.c | 64 +-- drivers/staging/erofs/utils.c | 26 drivers/staging/erofs/zdata.c | 56 +++- drivers/staging/erofs/zdata.h | 6 -- 7 files changed, 85 insertions(+), 140 deletions(-) diff --git a/drivers/staging/erofs/Documentation/filesystems/erofs.txt b/drivers/staging/erofs/Documentation/filesystems/erofs.txt index 04cf47865c50..0eab600ca7ca 100644 --- a/drivers/staging/erofs/Documentation/filesystems/erofs.txt +++ b/drivers/staging/erofs/Documentation/filesystems/erofs.txt @@ -65,6 +65,16 @@ fault_injection=%d Enable fault injection in all supported types with by default if CONFIG_EROFS_FS_XATTR is selected. (no)aclSetup POSIX Access Control List. Note: acl is enabled by default if CONFIG_EROFS_FS_POSIX_ACL is selected. +cache_strategy=%s Select a strategy for cached decompression from now on: + disabled: In-place I/O decompression only; +readahead: Cache the last incomplete compressed physical + cluster for further reading. It still does + in-place I/O decompression for the rest + compressed physical clusters; + readaround: Cache the both ends of incomplete compressed + physical clusters for further reading. + It still does in-place I/O decompression + for the rest compressed physical clusters. Module parameters = diff --git a/drivers/staging/erofs/Kconfig b/drivers/staging/erofs/Kconfig index 788beebf3f7d..1a8e48943e50 100644 --- a/drivers/staging/erofs/Kconfig +++ b/drivers/staging/erofs/Kconfig @@ -94,41 +94,3 @@ config EROFS_FS_CLUSTER_PAGE_LIMIT than 2. Otherwise, the image cannot be mounted correctly on this kernel. -choice - prompt "EROFS VLE Data Decompression mode" - depends on EROFS_FS_ZIP - default EROFS_FS_ZIP_CACHE_BIPOLAR - help - EROFS supports three options for VLE decompression. - "In-place Decompression Only" consumes the minimum memory - with lowest random read. - - "Bipolar Cached Decompression" consumes the maximum memory - with highest random read. - - If unsure, select "Bipolar Cached Decompression" - -config EROFS_FS_ZIP_NO_CACHE - bool "In-place Decompression Only" - help - Read compressed data into page cache and do in-place - decompression directly. - -config EROFS_FS_ZIP_CACHE_UNIPOLAR - bool "Unipolar Cached Decompression" - help - For each request, it caches the last compressed page - for further reading. - It still decompresses in place for the rest compressed pages. - -config EROFS_FS_ZIP_CACHE_BIPOLAR - bool "Bipolar Cached Decompression" - help - For each request, it caches the both end compressed pages - for further reading. - It still decompresses in place for the rest compressed pages. - - Recommended for performance priority. - -endchoice - diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index 3176c350779e..118e7c7e4d4d 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -51,18 +51,6 @@ struct erofs_fault_info { }; #endif /* CONFIG_EROFS_FAULT_INJECTION */ -#ifdef CONFIG_EROFS_FS_ZIP_CACHE_BIPOLAR -#define EROFS_FS_ZIP_CACHE_LVL (2) -#elif defined(EROFS_FS_ZIP_CACHE_UNIPOLAR) -#define EROFS_FS_ZIP_CACHE_LVL (1) -#else -#define EROFS_FS_ZIP_CACHE_LVL (0) -#endif - -#if (!defined(EROFS_FS_HAS_MANAGED_CACHE) && (EROFS_FS_ZIP_CACHE_LVL > 0)) -#define EROFS_FS_HAS_MANAGED_CACHE -#endif - /* EROFS_SUPER_MAGIC_V1 to represent the whole file system */ #define EROFS_SUPER_MAGIC EROFS_SUPER_MAGIC_V1 @@ -85,10 +73,11 @@ struct erofs_sb_info { unsigned int shrinker_run_no; -#ifdef EROFS_FS_HAS_MANAGED_CACHE - struct inode *managed_cache; -#endif + /* current strategy of how to use managed cache */ + unsigned char cache_strategy; + /* pseudo inode to manage
[PATCH v2 04/22] staging: erofs: keep up erofs_fs.h with erofs-outofstaging patchset
The main change is to reserve all checksums except for superblock, since it's more useful to do block-based verity for read-only fs. Some comments change as well, which is minor. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/erofs_fs.h | 39 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/staging/erofs/erofs_fs.h b/drivers/staging/erofs/erofs_fs.h index 9cd749d56920..e82e833985e4 100644 --- a/drivers/staging/erofs/erofs_fs.h +++ b/drivers/staging/erofs/erofs_fs.h @@ -96,7 +96,7 @@ struct erofs_inode_v1 { /* 20 */__le32 i_ino; /* only used for 32-bit stat compatibility */ /* 24 */__le16 i_uid; /* 26 */__le16 i_gid; -/* 28 */__le32 i_checksum; +/* 28 */__le32 i_reserved2; } __packed; /* 32 bytes on-disk inode */ @@ -105,14 +105,14 @@ struct erofs_inode_v1 { #define EROFS_INODE_LAYOUT_V2 1 struct erofs_inode_v2 { - __le16 i_advise; +/* 0 */__le16 i_advise; - /* 1 header + n-1 * 4 bytes inline xattr to keep continuity */ - __le16 i_xattr_icount; - __le16 i_mode; - __le16 i_reserved; /* 8 bytes */ - __le64 i_size; /* 16 bytes */ - union { +/* 1 header + n-1 * 4 bytes inline xattr to keep continuity */ +/* 2 */__le16 i_xattr_icount; +/* 4 */__le16 i_mode; +/* 6 */__le16 i_reserved; +/* 8 */__le64 i_size; +/* 16 */union { /* file total compressed blocks for data mapping 1 */ __le32 compressed_blocks; __le32 raw_blkaddr; @@ -122,16 +122,15 @@ struct erofs_inode_v2 { } i_u __packed; /* only used for 32-bit stat compatibility */ - __le32 i_ino; /* 24 bytes */ - - __le32 i_uid; - __le32 i_gid; - __le64 i_ctime; /* 32 bytes */ - __le32 i_ctime_nsec; - __le32 i_nlink; - __u8 i_reserved2[12]; - __le32 i_checksum; /* 64 bytes */ -} __packed; +/* 20 */__le32 i_ino; + +/* 24 */__le32 i_uid; +/* 28 */__le32 i_gid; +/* 32 */__le64 i_ctime; +/* 40 */__le32 i_ctime_nsec; +/* 44 */__le32 i_nlink; +/* 48 */__u8 i_reserved2[16]; +} __packed; /* 64 bytes */ #define EROFS_MAX_SHARED_XATTRS (128) /* h_shared_count between 129 ... 255 are special # */ @@ -149,9 +148,9 @@ struct erofs_inode_v2 { * for read-only fs, no need to introduce h_refcount */ struct erofs_xattr_ibody_header { - __le32 h_checksum; + __le32 h_reserved; __u8 h_shared_count; - __u8 h_reserved[7]; + __u8 h_reserved2[7]; __le32 h_shared_xattrs[0]; /* shared xattr id array */ } __packed; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 10/22] staging: erofs: kill sbi->dev_name
As Al said, "the only use of sbi->dev_name is debugging printks and all of those have sb->s_id available, with device name stored in there. Which makes the whole thing bloody weird". sbi->dev_name was used for our debugging use and it's better to just use s_id in community and delete the whole erofs_mount_private stuff. Suggested-by: Al Viro Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/internal.h | 2 -- drivers/staging/erofs/super.c| 54 +--- 2 files changed, 7 insertions(+), 49 deletions(-) diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index e149cf9fc23f..5e1ef2b5a458 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -113,8 +113,6 @@ struct erofs_sb_info { u8 volume_name[16]; /* volume name */ u32 requirements; - char *dev_name; - unsigned int mount_opt; #ifdef CONFIG_EROFS_FAULT_INJECTION diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index 7e6fe9cd45e7..bfb6e1e09781 100644 --- a/drivers/staging/erofs/super.c +++ b/drivers/staging/erofs/super.c @@ -362,15 +362,13 @@ static struct inode *erofs_init_managed_cache(struct super_block *sb) #endif -static int erofs_read_super(struct super_block *sb, - const char *dev_name, - void *data, int silent) +static int erofs_fill_super(struct super_block *sb, void *data, int silent) { struct inode *inode; struct erofs_sb_info *sbi; int err = -EINVAL; - infoln("read_super, device -> %s", dev_name); + infoln("fill_super, device -> %s", sb->s_id); infoln("options -> %s", (char *)data); if (unlikely(!sb_set_blocksize(sb, EROFS_BLKSIZ))) { @@ -448,30 +446,16 @@ static int erofs_read_super(struct super_block *sb, goto err_iget; } - /* save the device name to sbi */ - sbi->dev_name = __getname(); - if (!sbi->dev_name) { - err = -ENOMEM; - goto err_devname; - } - - snprintf(sbi->dev_name, PATH_MAX, "%s", dev_name); - sbi->dev_name[PATH_MAX - 1] = '\0'; - erofs_shrinker_register(sb); if (!silent) - infoln("mounted on %s with opts: %s.", dev_name, - (char *)data); + infoln("mounted on %s with opts: %s.", sb->s_id, (char *)data); return 0; /* * please add a label for each exit point and use * the following name convention, thus new features * can be integrated easily without renaming labels. */ -err_devname: - dput(sb->s_root); - sb->s_root = NULL; err_iget: #ifdef EROFS_FS_HAS_MANAGED_CACHE iput(sbi->managed_cache); @@ -499,8 +483,7 @@ static void erofs_put_super(struct super_block *sb) WARN_ON(sb->s_magic != EROFS_SUPER_MAGIC); - infoln("unmounted for %s", sbi->dev_name); - __putname(sbi->dev_name); + infoln("unmounted for %s", sb->s_id); erofs_shrinker_unregister(sb); #ifdef EROFS_FS_HAS_MANAGED_CACHE @@ -510,33 +493,10 @@ static void erofs_put_super(struct super_block *sb) sb->s_fs_info = NULL; } - -struct erofs_mount_private { - const char *dev_name; - char *options; -}; - -/* support mount_bdev() with options */ -static int erofs_fill_super(struct super_block *sb, - void *_priv, int silent) -{ - struct erofs_mount_private *priv = _priv; - - return erofs_read_super(sb, priv->dev_name, - priv->options, silent); -} - -static struct dentry *erofs_mount( - struct file_system_type *fs_type, int flags, - const char *dev_name, void *data) +static struct dentry *erofs_mount(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data) { - struct erofs_mount_private priv = { - .dev_name = dev_name, - .options = data - }; - - return mount_bdev(fs_type, flags, dev_name, - , erofs_fill_super); + return mount_bdev(fs_type, flags, dev_name, data, erofs_fill_super); } static struct file_system_type erofs_fs_type = { -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 09/22] staging: erofs: clean up shrinker stuffs
- rename erofs_register_super / erofs_unregister_super to erofs_shrinker_register / erofs_shrinker_unregister; - fold the only erofs_shrink_workstation external call to erofs_shrinker_unregister; - localize erofs_shrink_workstation; - localize erofs_shrinker_info by introducing erofs_init_shrinker and erofs_exit_shrinker. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/internal.h | 50 +--- drivers/staging/erofs/super.c| 20 - drivers/staging/erofs/utils.c| 37 +++ 3 files changed, 56 insertions(+), 51 deletions(-) diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index a3b9fcdd0c27..e149cf9fc23f 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -72,34 +72,35 @@ typedef u64 erofs_off_t; typedef u32 erofs_blk_t; struct erofs_sb_info { +#ifdef CONFIG_EROFS_FS_ZIP /* list for all registered superblocks, mainly for shrinker */ struct list_head list; struct mutex umount_mutex; - u32 blocks; - u32 meta_blkaddr; -#ifdef CONFIG_EROFS_FS_XATTR - u32 xattr_blkaddr; -#endif - - /* inode slot unit size in bit shift */ - unsigned char islotbits; -#ifdef CONFIG_EROFS_FS_ZIP /* cluster size in bit shift */ unsigned char clusterbits; - /* the dedicated workstation for compression */ struct radix_tree_root workstn_tree; /* threshold for decompression synchronously */ unsigned int max_sync_decompress_pages; + unsigned int shrinker_run_no; + #ifdef EROFS_FS_HAS_MANAGED_CACHE struct inode *managed_cache; #endif +#endif /* CONFIG_EROFS_FS_ZIP */ + u32 blocks; + u32 meta_blkaddr; +#ifdef CONFIG_EROFS_FS_XATTR + u32 xattr_blkaddr; #endif + /* inode slot unit size in bit shift */ + unsigned char islotbits; + u32 build_time_nsec; u64 build_time; @@ -115,7 +116,6 @@ struct erofs_sb_info { char *dev_name; unsigned int mount_opt; - unsigned int shrinker_run_no; #ifdef CONFIG_EROFS_FAULT_INJECTION struct erofs_fault_info fault_info; /* For fault injection */ @@ -253,15 +253,8 @@ static inline int erofs_wait_on_workgroup_freezed(struct erofs_workgroup *grp) /* page count of a compressed cluster */ #define erofs_clusterpages(sbi) ((1 << (sbi)->clusterbits) / PAGE_SIZE) - -int __init z_erofs_init_zip_subsystem(void); -void z_erofs_exit_zip_subsystem(void); #else #define EROFS_PCPUBUF_NR_PAGES 0 - -/* dummy initializer/finalizer for the decompression subsystem */ -static inline int z_erofs_init_zip_subsystem(void) { return 0; } -static inline void z_erofs_exit_zip_subsystem(void) {} #endif /* !CONFIG_EROFS_FS_ZIP */ /* we strictly follow PAGE_SIZE and no buffer head yet */ @@ -525,8 +518,6 @@ int erofs_namei(struct inode *dir, struct qstr *name, extern const struct file_operations erofs_dir_fops; /* utils.c / zdata.c */ -extern struct shrinker erofs_shrinker_info; - struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp); #if (EROFS_PCPUBUF_NR_PAGES > 0) @@ -544,20 +535,31 @@ static inline void *erofs_get_pcpubuf(unsigned int pagenr) #define erofs_put_pcpubuf(buf) do {} while (0) #endif +#ifdef CONFIG_EROFS_FS_ZIP int erofs_workgroup_put(struct erofs_workgroup *grp); struct erofs_workgroup *erofs_find_workgroup(struct super_block *sb, pgoff_t index, bool *tag); int erofs_register_workgroup(struct super_block *sb, struct erofs_workgroup *grp, bool tag); -unsigned long erofs_shrink_workstation(struct erofs_sb_info *sbi, - unsigned long nr_shrink, bool cleanup); void erofs_workgroup_free_rcu(struct erofs_workgroup *grp); +void erofs_shrinker_register(struct super_block *sb); +void erofs_shrinker_unregister(struct super_block *sb); +int __init erofs_init_shrinker(void); +void erofs_exit_shrinker(void); +int __init z_erofs_init_zip_subsystem(void); +void z_erofs_exit_zip_subsystem(void); int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi, struct erofs_workgroup *egrp); int erofs_try_to_free_cached_page(struct address_space *mapping, struct page *page); -void erofs_register_super(struct super_block *sb); -void erofs_unregister_super(struct super_block *sb); +#else +static inline void erofs_shrinker_register(struct super_block *sb) {} +static inline void erofs_shrinker_unregister(struct super_block *sb) {} +static inline int erofs_init_shrinker(void) { return 0; } +static inline void erofs_exit_shrinker(void) {} +static inline int z_erofs_init_zip_subsystem(void) { return 0; } +static inline void z_erofs_exit_zip_subsystem(void) {} +#endif /* !CONFIG_EROFS_FS_ZIP */ #endif /* __EROFS_INTERNAL_H */ diff --git
[PATCH v2 12/22] staging: erofs: drop __GFP_NOFAIL for managed inode
For historical reasons, __GFP_NOFAIL was set for managed inode. It's no need using that since EROFS can handle it properly. Signed-off-by: Gao Xiang --- drivers/staging/erofs/super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index 7c31030daf4e..af5d87793e4d 100644 --- a/drivers/staging/erofs/super.c +++ b/drivers/staging/erofs/super.c @@ -356,8 +356,7 @@ static int erofs_init_managed_cache(struct super_block *sb) inode->i_mapping->a_ops = _cache_aops; mapping_set_gfp_mask(inode->i_mapping, -GFP_NOFS | __GFP_HIGHMEM | -__GFP_MOVABLE | __GFP_NOFAIL); +GFP_NOFS | __GFP_HIGHMEM | __GFP_MOVABLE); sbi->managed_cache = inode; return 0; } -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 22/22] staging: erofs: update Kconfig
Keep in line with erofs-outofstaging patchset: - turn on CONFIG_EROFS_FS_ZIP by default; - turn on CONFIG_EROFS_FS_SECURITY by default suggested by David; - update Kconfig description. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/Kconfig | 54 ++- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/drivers/staging/erofs/Kconfig b/drivers/staging/erofs/Kconfig index 1a8e48943e50..16316d1adca3 100644 --- a/drivers/staging/erofs/Kconfig +++ b/drivers/staging/erofs/Kconfig @@ -4,16 +4,16 @@ config EROFS_FS tristate "EROFS filesystem support" depends on BLOCK help - EROFS(Enhanced Read-Only File System) is a lightweight + EROFS (Enhanced Read-Only File System) is a lightweight read-only file system with modern designs (eg. page-sized blocks, inline xattrs/data, etc.) for scenarios which need - high-performance read-only requirements, eg. firmwares in - mobile phone or LIVECDs. + high-performance read-only requirements, e.g. Android OS + for mobile phones and LIVECDs. - It also provides VLE compression support, focusing on - random read improvements, keeping relatively lower - compression ratios, which is useful for high-performance - devices with limited memory and ROM space. + It also provides fixed-sized output compression support, + which improves storage density, keeps relatively higher + compression ratios, which is more useful to achieve high + performance for embedded devices with limited memory. If unsure, say N. @@ -21,11 +21,19 @@ config EROFS_FS_DEBUG bool "EROFS debugging feature" depends on EROFS_FS help - Print EROFS debugging messages and enable more BUG_ONs - which check the filesystem consistency aggressively. + Print debugging messages and enable more BUG_ONs which check + filesystem consistency and find potential issues aggressively, + which can be used for Android eng build, for example. For daily use, say N. +config EROFS_FAULT_INJECTION + bool "EROFS fault injection facility" + depends on EROFS_FS + help + Test EROFS to inject faults such as ENOMEM, EIO, and so on. + If unsure, say N. + config EROFS_FS_XATTR bool "EROFS extended attributes" depends on EROFS_FS @@ -54,6 +62,7 @@ config EROFS_FS_POSIX_ACL config EROFS_FS_SECURITY bool "EROFS Security Labels" depends on EROFS_FS_XATTR + default y help Security labels provide an access control facility to support Linux Security Models (LSMs) accepted by AppArmor, SELinux, Smack and TOMOYO @@ -63,22 +72,15 @@ config EROFS_FS_SECURITY If you are not using a security module, say N. -config EROFS_FAULT_INJECTION - bool "EROFS fault injection facility" - depends on EROFS_FS - help - Test EROFS to inject faults such as ENOMEM, EIO, and so on. - If unsure, say N. - config EROFS_FS_ZIP - bool "EROFS Data Compresssion Support" + bool "EROFS Data Compression Support" depends on EROFS_FS select LZ4_DECOMPRESS + default y help - Currently we support LZ4 VLE Compression only. - Play at your own risk. + Enable fixed-sized output compression for EROFS. - If you don't want to use compression feature, say N. + If you don't want to enable compression feature, say N. config EROFS_FS_CLUSTER_PAGE_LIMIT int "EROFS Cluster Pages Hard Limit" @@ -86,11 +88,11 @@ config EROFS_FS_CLUSTER_PAGE_LIMIT range 1 256 default "1" help - Indicates VLE compressed pages hard limit of a - compressed cluster. + Indicates maximum # of pages of a compressed + physical cluster. - For example, if files of a image are compressed - into 8k-unit, the hard limit should not be less - than 2. Otherwise, the image cannot be mounted - correctly on this kernel. + For example, if files in a image were compressed + into 8k-unit, hard limit should not be configured + less than 2. Otherwise, the image will be refused + to mount on this kernel. -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 15/22] staging: erofs: tidy up zpvec.h
- use shorter function names: z_erofs_pagevec_enqueue and z_erofs_pagevec_dequeue; - minor code cleanup. In order to keep in line with erofs-outofstaging patchset. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/zdata.c | 6 +++--- drivers/staging/erofs/zpvec.h | 25 + 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/drivers/staging/erofs/zdata.c b/drivers/staging/erofs/zdata.c index 3078510e350d..88c8c4082498 100644 --- a/drivers/staging/erofs/zdata.c +++ b/drivers/staging/erofs/zdata.c @@ -314,8 +314,8 @@ static int z_erofs_vle_work_add_page( try_to_reuse_as_compressed_page(builder, page)) return 0; - ret = z_erofs_pagevec_ctor_enqueue(>vector, - page, type, ); + ret = z_erofs_pagevec_enqueue(>vector, + page, type, ); builder->work->vcnt += (unsigned int)ret; return ret ? 0 : -EAGAIN; @@ -938,7 +938,7 @@ static int z_erofs_vle_unzip(struct super_block *sb, for (i = 0; i < work->vcnt; ++i) { unsigned int pagenr; - page = z_erofs_pagevec_ctor_dequeue(, _type); + page = z_erofs_pagevec_dequeue(, _type); /* all pages in pagevec ought to be valid */ DBG_BUGON(!page); diff --git a/drivers/staging/erofs/zpvec.h b/drivers/staging/erofs/zpvec.h index 77bf6877bad8..9798f5627786 100644 --- a/drivers/staging/erofs/zpvec.h +++ b/drivers/staging/erofs/zpvec.h @@ -11,7 +11,7 @@ #include "tagptr.h" -/* page type in pagevec for unzip subsystem */ +/* page type in pagevec for decompress subsystem */ enum z_erofs_page_type { /* including Z_EROFS_VLE_PAGE_TAIL_EXCLUSIVE */ Z_EROFS_PAGE_TYPE_EXCLUSIVE, @@ -103,16 +103,14 @@ static inline void z_erofs_pagevec_ctor_init(struct z_erofs_pagevec_ctor *ctor, z_erofs_pagevec_ctor_pagedown(ctor, false); } } - ctor->next = z_erofs_pagevec_ctor_next_page(ctor, i); ctor->index = i; } -static inline bool -z_erofs_pagevec_ctor_enqueue(struct z_erofs_pagevec_ctor *ctor, -struct page *page, -enum z_erofs_page_type type, -bool *occupied) +static inline bool z_erofs_pagevec_enqueue(struct z_erofs_pagevec_ctor *ctor, + struct page *page, + enum z_erofs_page_type type, + bool *occupied) { *occupied = false; if (unlikely(!ctor->next && type)) @@ -131,15 +129,13 @@ z_erofs_pagevec_ctor_enqueue(struct z_erofs_pagevec_ctor *ctor, ctor->next = page; *occupied = true; } - - ctor->pages[ctor->index++] = - tagptr_fold(erofs_vtptr_t, page, type); + ctor->pages[ctor->index++] = tagptr_fold(erofs_vtptr_t, page, type); return true; } static inline struct page * -z_erofs_pagevec_ctor_dequeue(struct z_erofs_pagevec_ctor *ctor, -enum z_erofs_page_type *type) +z_erofs_pagevec_dequeue(struct z_erofs_pagevec_ctor *ctor, + enum z_erofs_page_type *type) { erofs_vtptr_t t; @@ -156,11 +152,8 @@ z_erofs_pagevec_ctor_dequeue(struct z_erofs_pagevec_ctor *ctor, if (*type == (uintptr_t)ctor->next) ctor->next = tagptr_unfold_ptr(t); - ctor->pages[ctor->index++] = - tagptr_fold(erofs_vtptr_t, NULL, 0); - + ctor->pages[ctor->index++] = tagptr_fold(erofs_vtptr_t, NULL, 0); return tagptr_unfold_ptr(t); } - #endif -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 14/22] staging: erofs: kill CONFIG_EROFS_FS_USE_VM_MAP_RAM
Turn into a module parameter ("use_vmap") as it can be set at runtime. Suggested-by: David Sterba Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- .../erofs/Documentation/filesystems/erofs.txt | 4 drivers/staging/erofs/Kconfig | 8 --- drivers/staging/erofs/decompressor.c | 22 +++ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/erofs/Documentation/filesystems/erofs.txt b/drivers/staging/erofs/Documentation/filesystems/erofs.txt index 74cf84ac48a3..04cf47865c50 100644 --- a/drivers/staging/erofs/Documentation/filesystems/erofs.txt +++ b/drivers/staging/erofs/Documentation/filesystems/erofs.txt @@ -66,6 +66,10 @@ fault_injection=%d Enable fault injection in all supported types with (no)aclSetup POSIX Access Control List. Note: acl is enabled by default if CONFIG_EROFS_FS_POSIX_ACL is selected. +Module parameters += +use_vmap=[0|1] Use vmap() instead of vm_map_ram() (default 0). + On-disk details === diff --git a/drivers/staging/erofs/Kconfig b/drivers/staging/erofs/Kconfig index 747e9eebfaa5..788beebf3f7d 100644 --- a/drivers/staging/erofs/Kconfig +++ b/drivers/staging/erofs/Kconfig @@ -63,14 +63,6 @@ config EROFS_FS_SECURITY If you are not using a security module, say N. -config EROFS_FS_USE_VM_MAP_RAM - bool "EROFS VM_MAP_RAM Support" - depends on EROFS_FS - help - use vm_map_ram/vm_unmap_ram instead of vmap/vunmap. - - If you don't know what these are, say N. - config EROFS_FAULT_INJECTION bool "EROFS fault injection facility" depends on EROFS_FS diff --git a/drivers/staging/erofs/decompressor.c b/drivers/staging/erofs/decompressor.c index 744c43a456e9..5361a2bbedb6 100644 --- a/drivers/staging/erofs/decompressor.c +++ b/drivers/staging/erofs/decompressor.c @@ -7,6 +7,7 @@ * Created by Gao Xiang */ #include "compress.h" +#include #include #ifndef LZ4_DISTANCE_MAX /* history window size */ @@ -29,6 +30,10 @@ struct z_erofs_decompressor { char *name; }; +static bool use_vmap; +module_param(use_vmap, bool, 0444); +MODULE_PARM_DESC(use_vmap, "Use vmap() instead of vm_map_ram() (default 0)"); + static int lz4_prepare_destpages(struct z_erofs_decompress_req *rq, struct list_head *pagepool) { @@ -219,29 +224,28 @@ static void copy_from_pcpubuf(struct page **out, const char *dst, static void *erofs_vmap(struct page **pages, unsigned int count) { -#ifdef CONFIG_EROFS_FS_USE_VM_MAP_RAM int i = 0; + if (use_vmap) + return vmap(pages, count, VM_MAP, PAGE_KERNEL); + while (1) { void *addr = vm_map_ram(pages, count, -1, PAGE_KERNEL); + /* retry two more times (totally 3 times) */ if (addr || ++i >= 3) return addr; vm_unmap_aliases(); } return NULL; -#else - return vmap(pages, count, VM_MAP, PAGE_KERNEL); -#endif } static void erofs_vunmap(const void *mem, unsigned int count) { -#ifdef CONFIG_EROFS_FS_USE_VM_MAP_RAM - vm_unmap_ram(mem, count); -#else - vunmap(mem); -#endif + if (!use_vmap) + vm_unmap_ram(mem, count); + else + vunmap(mem); } static int decompress_generic(struct z_erofs_decompress_req *rq, -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 08/22] staging: erofs: kill CONFIG_EROFS_FS_IO_MAX_RETRIES
CONFIG_EROFS_FS_IO_MAX_RETRIES seems a runtime setting and users have no idea about the change in behaviour. Let's remove the setting currently and could turn it into a module parameter if it's really needed. Suggested-by: David Sterba Signed-off-by: Gao Xiang --- drivers/staging/erofs/Kconfig| 9 - drivers/staging/erofs/internal.h | 8 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/staging/erofs/Kconfig b/drivers/staging/erofs/Kconfig index 2577cbb46a5b..747e9eebfaa5 100644 --- a/drivers/staging/erofs/Kconfig +++ b/drivers/staging/erofs/Kconfig @@ -78,15 +78,6 @@ config EROFS_FAULT_INJECTION Test EROFS to inject faults such as ENOMEM, EIO, and so on. If unsure, say N. -config EROFS_FS_IO_MAX_RETRIES - int "EROFS IO Maximum Retries" - depends on EROFS_FS - default "5" - help - Maximum retry count of IO Errors. - - If unsure, leave the default value (5 retries, 6 IOs at most). - config EROFS_FS_ZIP bool "EROFS Data Compresssion Support" depends on EROFS_FS diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index 959bd0ae9d74..a3b9fcdd0c27 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -279,6 +279,8 @@ static inline void z_erofs_exit_zip_subsystem(void) {} #error erofs cannot be used in this platform #endif +#define EROFS_IO_MAX_RETRIES_NOFAIL 5 + #define ROOT_NID(sb) ((sb)->root_nid) #define erofs_blknr(addr) ((addr) / EROFS_BLKSIZ) @@ -467,12 +469,6 @@ static inline void __submit_bio(struct bio *bio, unsigned int op, submit_bio(bio); } -#ifndef CONFIG_EROFS_FS_IO_MAX_RETRIES -#define EROFS_IO_MAX_RETRIES_NOFAIL0 -#else -#define EROFS_IO_MAX_RETRIES_NOFAILCONFIG_EROFS_FS_IO_MAX_RETRIES -#endif - struct page *__erofs_get_meta_page(struct super_block *sb, erofs_blk_t blkaddr, bool prio, bool nofail); -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 21/22] staging: erofs: update super.c
Keep in line with erofs-outofstaging patchset: - "Chao Yu" is most commonly used in Linux community; - quoted string split across lines. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/super.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index a14fa5228bca..f65a1ff9f42f 100644 --- a/drivers/staging/erofs/super.c +++ b/drivers/staging/erofs/super.c @@ -326,8 +326,7 @@ static int parse_options(struct super_block *sb, char *options) return err; break; default: - errln("Unrecognized mount option \"%s\" " - "or missing value", p); + errln("Unrecognized mount option \"%s\" or missing value", p); return -EINVAL; } } @@ -662,6 +661,6 @@ module_init(erofs_module_init); module_exit(erofs_module_exit); MODULE_DESCRIPTION("Enhanced ROM File System"); -MODULE_AUTHOR("Gao Xiang, Yu Chao, Miao Xie, CONSUMER BG, HUAWEI Inc."); +MODULE_AUTHOR("Gao Xiang, Chao Yu, Miao Xie, CONSUMER BG, HUAWEI Inc."); MODULE_LICENSE("GPL"); -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 16/22] staging: erofs: remove redundant braces in inode.c
Remove redundant braces in inode.c since these are all single statements. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/inode.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index c13d66ccc74a..286729143365 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -35,16 +35,15 @@ static int read_inode(struct inode *inode, void *data) inode->i_mode = le16_to_cpu(v2->i_mode); if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || - S_ISLNK(inode->i_mode)) { + S_ISLNK(inode->i_mode)) vi->raw_blkaddr = le32_to_cpu(v2->i_u.raw_blkaddr); - } else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) { + else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) inode->i_rdev = new_decode_dev(le32_to_cpu(v2->i_u.rdev)); - } else if (S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) { + else if (S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) inode->i_rdev = 0; - } else { + else return -EIO; - } i_uid_write(inode, le32_to_cpu(v2->i_uid)); i_gid_write(inode, le32_to_cpu(v2->i_gid)); @@ -69,16 +68,15 @@ static int read_inode(struct inode *inode, void *data) inode->i_mode = le16_to_cpu(v1->i_mode); if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || - S_ISLNK(inode->i_mode)) { + S_ISLNK(inode->i_mode)) vi->raw_blkaddr = le32_to_cpu(v1->i_u.raw_blkaddr); - } else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) { + else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) inode->i_rdev = new_decode_dev(le32_to_cpu(v1->i_u.rdev)); - } else if (S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) { + else if (S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) inode->i_rdev = 0; - } else { + else return -EIO; - } i_uid_write(inode, le16_to_cpu(v1->i_uid)); i_gid_write(inode, le16_to_cpu(v1->i_gid)); -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 00/22] staging: erofs: updates according to erofs-outofstaging v4
changes from v1: (mainly address comments from Chao:) - keep EROFS_IO_MAX_RETRIES_NOFAIL; - add a new patch "drop __GFP_NOFAIL for managed inode"; - kill a redundant NULL check in "__stagingpage_alloc"; - add some description in document about "use_vmap"; - rearrange erofs_vmap of "staging: erofs: kill CONFIG_EROFS_FS_USE_VM_MAP_RAM"; - combine two similar patches about "cleaning up internal.h" since they rearrange the same file... 8< This patchset includes all meaningful modifications till now according to erofs-outofstaging v4: https://lore.kernel.org/linux-fsdevel/20190725095658.155779-1-gaoxian...@huawei.com/ Some empty lines which were add or delete are not included in this patchset, I will send erofs-outofstaging v5 later in order to keep main code bit-for-bit identical with this staging patchset. Thanks, Gao Xiang Gao Xiang (22): staging: erofs: update source file headers staging: erofs: rename source files for better understanding staging: erofs: fix dummy functions erofs_{get,list}xattr staging: erofs: keep up erofs_fs.h with erofs-outofstaging patchset staging: erofs: sunset erofs_workstn_{lock,unlock} staging: erofs: clean up internal.h staging: erofs: remove redundant #include "internal.h" staging: erofs: kill CONFIG_EROFS_FS_IO_MAX_RETRIES staging: erofs: clean up shrinker stuffs staging: erofs: kill sbi->dev_name staging: erofs: kill all failure handling in fill_super() staging: erofs: drop __GFP_NOFAIL for managed inode staging: erofs: refine erofs_allocpage() staging: erofs: kill CONFIG_EROFS_FS_USE_VM_MAP_RAM staging: erofs: tidy up zpvec.h staging: erofs: remove redundant braces in inode.c staging: erofs: tidy up decompression frontend staging: erofs: remove clusterbits in sbi staging: erofs: turn cache strategies into mount options staging: erofs: tidy up utils.c staging: erofs: update super.c staging: erofs: update Kconfig .../erofs/Documentation/filesystems/erofs.txt | 14 + drivers/staging/erofs/Kconfig | 111 +- drivers/staging/erofs/Makefile|4 +- drivers/staging/erofs/compress.h |2 +- drivers/staging/erofs/data.c |6 +- drivers/staging/erofs/decompressor.c | 45 +- drivers/staging/erofs/dir.c |6 +- drivers/staging/erofs/erofs_fs.h | 47 +- .../erofs/include/trace/events/erofs.h|2 +- drivers/staging/erofs/inode.c | 24 +- drivers/staging/erofs/internal.h | 246 +-- drivers/staging/erofs/namei.c |7 +- drivers/staging/erofs/super.c | 268 ++- .../erofs/{include/linux => }/tagptr.h| 12 +- drivers/staging/erofs/unzip_vle.c | 1591 - drivers/staging/erofs/utils.c | 112 +- drivers/staging/erofs/xattr.c |6 +- drivers/staging/erofs/xattr.h | 22 +- drivers/staging/erofs/zdata.c | 1405 +++ .../staging/erofs/{unzip_vle.h => zdata.h}| 119 +- drivers/staging/erofs/zmap.c |5 +- .../erofs/{unzip_pagevec.h => zpvec.h}| 41 +- 22 files changed, 1856 insertions(+), 2239 deletions(-) rename drivers/staging/erofs/{include/linux => }/tagptr.h (94%) delete mode 100644 drivers/staging/erofs/unzip_vle.c create mode 100644 drivers/staging/erofs/zdata.c rename drivers/staging/erofs/{unzip_vle.h => zdata.h} (56%) rename drivers/staging/erofs/{unzip_pagevec.h => zpvec.h} (78%) -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: next/master build: 221 builds: 11 failed, 210 passed, 13 errors, 1174 warnings (next-20190731)
From: Greg Kroah-Hartman Date: Wed, 31 Jul 2019 13:35:22 +0200 > On Wed, Jul 31, 2019 at 12:24:41PM +0100, Mark Brown wrote: >> On Wed, Jul 31, 2019 at 04:07:41AM -0700, kernelci.org bot wrote: >> >> Today's -next fails to build an ARM allmodconfig due to: >> >> > allmodconfig (arm, gcc-8) ― FAIL, 1 error, 40 warnings, 0 section >> > mismatches >> > >> > Errors: >> > drivers/net/phy/mdio-cavium.h:111:36: error: implicit declaration of >> > function 'writeq'; did you mean 'writel'? >> > [-Werror=implicit-function-declaration] >> >> as a result of the changes that introduced: >> >> WARNING: unmet direct dependencies detected for MDIO_OCTEON >> Depends on [n]: NETDEVICES [=y] && MDIO_DEVICE [=m] && MDIO_BUS [=m] && >> 64BIT && HAS_IOMEM [=y] && OF_MDIO [=m] >> Selected by [m]: >> - OCTEON_ETHERNET [=m] && STAGING [=y] && (CAVIUM_OCTEON_SOC && NETDEVICES >> [=y] || COMPILE_TEST [=y]) >> >> which is triggered by the staging OCTEON_ETHERNET driver which misses a >> 64BIT dependency but added COMPILE_TEST in 171a9bae68c72f2 >> (staging/octeon: Allow test build on !MIPS). > > A patch was posted for this, but it needs to go through the netdev tree > as that's where the offending patches are coming from. I didn't catch that, was netdev CC:'d? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4] staging: rtl8192u: null check the kzalloc
In rtl8192_init_priv_variable allocation for priv->pFirmware may fail, so a null check is necessary.priv->pFirmware is accessed later in rtl8192_adapter_start. I added the check and made appropriate changes to propagate the errno to the caller. Signed-off-by: Navid Emamdoost --- Update v2: fixed style errors Update V3: fixed prefix Update V4: fixed style --- drivers/staging/rtl8192u/r8192U_core.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index fe1f279ca368..569d02240bf5 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -2096,7 +2096,7 @@ static void rtl8192_SetWirelessMode(struct net_device *dev, u8 wireless_mode) } /* init priv variables here. only non_zero value should be initialized here. */ -static void rtl8192_init_priv_variable(struct net_device *dev) +static int rtl8192_init_priv_variable(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); u8 i; @@ -2223,6 +2223,8 @@ static void rtl8192_init_priv_variable(struct net_device *dev) priv->AcmControl = 0; priv->pFirmware = kzalloc(sizeof(rt_firmware), GFP_KERNEL); + if (!priv->pFirmware) + return -ENOMEM; /* rx related queue */ skb_queue_head_init(>rx_queue); @@ -2236,6 +2238,8 @@ static void rtl8192_init_priv_variable(struct net_device *dev) for (i = 0; i < MAX_QUEUE_SIZE; i++) skb_queue_head_init(>ieee80211->skb_drv_aggQ[i]); priv->rf_set_chan = rtl8192_phy_SwChnl; + + return 0; } /* init lock here */ @@ -2605,7 +2609,10 @@ static short rtl8192_init(struct net_device *dev) memcpy(priv->txqueue_to_outpipemap, queuetopipe, 9); } #endif - rtl8192_init_priv_variable(dev); + err = rtl8192_init_priv_variable(dev); + if (err) + return err; + rtl8192_init_priv_lock(priv); rtl8192_init_priv_task(dev); rtl8192_get_eeprom_size(dev); -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH -next] staging: rtl8723bs: remove set but not used variable 'FirstConnect'
Fixes gcc '-Wunused-but-set-variable' warning: drivers/staging/rtl8723bs/hal/odm.c: In function 'odm_RSSIMonitorCheckCE': drivers/staging/rtl8723bs/hal/odm.c:1258:7: warning: variable 'FirstConnect' set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Signed-off-by: YueHaibing --- drivers/staging/rtl8723bs/hal/odm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c index dd9a16f..aa6631e 100644 --- a/drivers/staging/rtl8723bs/hal/odm.c +++ b/drivers/staging/rtl8723bs/hal/odm.c @@ -1255,13 +1255,11 @@ void odm_RSSIMonitorCheckCE(PDM_ODM_T pDM_Odm) int tmpEntryMaxPWDB = 0, tmpEntryMinPWDB = 0xff; u8 sta_cnt = 0; u32 PWDB_rssi[NUM_STA] = {0};/* 0~15]:MACID, [16~31]:PWDB_rssi */ - bool FirstConnect = false; pRA_T pRA_Table = _Odm->DM_RA_Table; if (pDM_Odm->bLinked != true) return; - FirstConnect = (pDM_Odm->bLinked) && (pRA_Table->firstconnect == false); pRA_Table->firstconnect = pDM_Odm->bLinked; /* if (check_fwstate(>mlmepriv, WIFI_AP_STATE|WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE) == true) */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH -next] staging: rtl8723bs: remove set but not used variables 'prspbuf' and 'auth'
Fixes gcc '-Wunused-but-set-variable' warning: drivers/staging/rtl8723bs/core/rtw_cmd.c: In function rtw_cmd_thread: drivers/staging/rtl8723bs/core/rtw_cmd.c:405:16: warning: variable prspbuf set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/core/rtw_cmd.c: In function rtw_joinbss_cmd: drivers/staging/rtl8723bs/core/rtw_cmd.c:771:6: warning: variable auth set but not used [-Wunused-but-set-variable] They are never used, so can be removed. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- drivers/staging/rtl8723bs/core/rtw_cmd.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index addc557..c6565b0 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -402,7 +402,7 @@ int rtw_cmd_thread(void *context) { u8 ret; struct cmd_obj *pcmd; - u8 *pcmdbuf, *prspbuf; + u8 *pcmdbuf; unsigned long cmd_start_time; unsigned long cmd_process_time; u8 (*cmd_hdl)(struct adapter *padapter, u8 *pbuf); @@ -414,7 +414,6 @@ int rtw_cmd_thread(void *context) thread_enter("RTW_CMD_THREAD"); pcmdbuf = pcmdpriv->cmd_buf; - prspbuf = pcmdpriv->rsp_buf; pcmdpriv->stop_req = 0; atomic_set(&(pcmdpriv->cmdthd_running), true); @@ -768,7 +767,7 @@ int rtw_startbss_cmd(struct adapter *padapter, int flags) u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork) { - u8 *auth, res = _SUCCESS; + u8 res = _SUCCESS; uintt_len = 0; struct wlan_bssid_ex*psecnetwork; struct cmd_obj *pcmd; @@ -825,7 +824,6 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork) memcpy(psecnetwork, >network, get_wlan_bssid_ex_sz(>network)); - auth = >authenticator_ie[0]; psecuritypriv->authenticator_ie[0] = (unsigned char)psecnetwork->IELength; if ((psecnetwork->IELength-12) < (256-1)) { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v5 12/24] erofs: introduce tagged pointer
On 2019/7/31 21:20, Gao Xiang wrote: >struct b *ptr = tagptr_unfold_tags(tptr); > vs >struct b *ptr = (struct b *)((unsigned long)tptr & ~2); Sorry ... a too stupid typo issue, I mean struct b *ptr = tagptr_unfold_ptr(tptr); vs struct b *ptr = (struct b *)((unsigned long)tptr & ~3); Thanks, Gao Xiang ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: bcm2835-camera: Spelling s/conencted/connected/
Signed-off-by: Geert Uytterhoeven --- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h index f738e7f99e96e927..47897e81ec586fe9 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h @@ -56,7 +56,7 @@ struct vchiq_mmal_port { /* component port belongs to, allows simple deref */ struct vchiq_mmal_component *component; - struct vchiq_mmal_port *connected; /* port conencted to */ + struct vchiq_mmal_port *connected; /* port connected to */ /* buffer info */ struct vchiq_mmal_port_buffer minimum_buffer; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v5 12/24] erofs: introduce tagged pointer
On 2019/7/31 21:20, Gao Xiang wrote: > Yes, I think that is about coding style, but the legacy way we have to do > type cast as well, I think... > >struct b *ptr = tagptr_unfold_tags(tptr); > vs >struct b *ptr = (struct b *)((unsigned long)tptr & ~2); and we could do "typedef tagptr1_t tptrb;" and then use tptrb for tagged pointer rather than barely use tagptr1_t tagptr2_t ... as I mentioned in: https://lore.kernel.org/lkml/0c2cdd4f-8fe7-6084-9c2d-c2e475e68...@aol.com/ I think "tptrb" is enough for developers to know the original pointer type when they coding... OTOH, I think it could be better not to directly use "struct b *" to represent the whole tagged pointer since it seems unsafe to do dereference directly.. It could introduce some potential bugs... All in all, this approach is only used for EROFS for now... If there are some better implementation, I can switch to it in the later version :) Thanks, Gao Xiang ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v5 12/24] erofs: introduce tagged pointer
Hi Jan, On 2019/7/31 21:01, Jan Kara wrote: > On Tue 30-07-19 15:14:01, Gao Xiang wrote: >> Currently kernel has scattered tagged pointer usages >> hacked by hand in plain code, without a unique and >> portable functionset to highlight the tagged pointer >> itself and wrap these hacked code in order to clean up >> all over meaningless magic masks. >> >> This patch introduces simple generic methods to fold >> tags into a pointer integer. Currently it supports >> the last n bits of the pointer for tags, which can be >> selected by users. >> >> In addition, it will also be used for the upcoming EROFS >> filesystem, which heavily uses tagged pointer pproach >> to reduce extra memory allocation. >> >> Link: https://en.wikipedia.org/wiki/Tagged_pointer >> >> Signed-off-by: Gao Xiang > > I'm not sure the generic approach you take is really needed here... You can > rely on getting at most two unused bits in the pointer anyway (and on mk68 > architecture I've heard even that is not true but I guess you don't care). Yes, and currently erofs uses 1-bit tags at most... > So why not just define a single pointer type representing pointer with as > many tags as you can get? I think the primary use is to decide if the tag is beyond the bit boundary, such as use tag 2, 3 on tagptr1_t, we can BUG_ON or check it at compile time BTW, my first patch is the only one fixed tagged pointer type(2-bit even if m64k) as below: https://lore.kernel.org/lkml/1530176789-107541-1-git-send-email-gaoxian...@huawei.com/ and Willy raised another problem is about static variable, therefore I decided to leave multiple tagptr types for users to decide for specific situations... https://lore.kernel.org/lkml/20180628092303.gd7...@bombadil.infradead.org/ > Also what I find bad about your tagptr approach > is that the way you've implemented it you loose the information about the > original pointer type. Yes, I think that is about coding style, but the legacy way we have to do type cast as well, I think... struct b *ptr = tagptr_unfold_tags(tptr); vs struct b *ptr = (struct b *)((unsigned long)tptr & ~2); > So overall I'm not sure the benefits outweight the > downsides but I guess that's a matter of taste and ultimately your call as > a maintainer of this code. I think I wouldn't generalize this implementations in this series... It will be used for EROFS only for now :) Thanks, Gao Xiang > > Honza > >> --- >> fs/erofs/tagptr.h | 110 ++ >> 1 file changed, 110 insertions(+) >> create mode 100644 fs/erofs/tagptr.h >> >> diff --git a/fs/erofs/tagptr.h b/fs/erofs/tagptr.h >> new file mode 100644 >> index ..a72897c86744 >> --- /dev/null >> +++ b/fs/erofs/tagptr.h >> @@ -0,0 +1,110 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only */ >> +/* >> + * A tagged pointer implementation >> + * >> + * Copyright (C) 2018 Gao Xiang >> + */ >> +#ifndef __EROFS_FS_TAGPTR_H >> +#define __EROFS_FS_TAGPTR_H >> + >> +#include >> +#include >> + >> +/* >> + * the name of tagged pointer types are tagptr{1, 2, 3...}_t >> + * avoid directly using the internal structs __tagptr{1, 2, 3...} >> + */ >> +#define __MAKE_TAGPTR(n) \ >> +typedef struct __tagptr##n {\ >> +uintptr_t v;\ >> +} tagptr##n##_t; >> + >> +__MAKE_TAGPTR(1) >> +__MAKE_TAGPTR(2) >> +__MAKE_TAGPTR(3) >> +__MAKE_TAGPTR(4) >> + >> +#undef __MAKE_TAGPTR >> + >> +extern void __compiletime_error("bad tagptr tags") >> +__bad_tagptr_tags(void); >> + >> +extern void __compiletime_error("bad tagptr type") >> +__bad_tagptr_type(void); >> + >> +/* fix the broken usage of "#define tagptr2_t tagptr3_t" by users */ >> +#define __tagptr_mask_1(ptr, n) \ >> +__builtin_types_compatible_p(typeof(ptr), struct __tagptr##n) ? \ >> +(1UL << (n)) - 1 : >> + >> +#define __tagptr_mask(ptr) (\ >> +__tagptr_mask_1(ptr, 1) ( \ >> +__tagptr_mask_1(ptr, 2) ( \ >> +__tagptr_mask_1(ptr, 3) ( \ >> +__tagptr_mask_1(ptr, 4) ( \ >> +__bad_tagptr_type(), 0) >> + >> +/* generate a tagged pointer from a raw value */ >> +#define tagptr_init(type, val) \ >> +((typeof(type)){ .v = (uintptr_t)(val) }) >> + >> +/* >> + * directly cast a tagged pointer to the native pointer type, which >> + * could be used for backward compatibility of existing code. >> + */ >> +#define tagptr_cast_ptr(tptr) ((void *)(tptr).v) >> + >> +/* encode tagged pointers */ >> +#define tagptr_fold(type, ptr, _tags) ({ \ >> +const typeof(_tags) tags = (_tags); \ >> +if (__builtin_constant_p(tags) && (tags & ~__tagptr_mask(type))) \ >> +__bad_tagptr_tags(); \ >> +tagptr_init(type, (uintptr_t)(ptr) | tags); }) >> + >> +/* decode tagged pointers */ >> +#define tagptr_unfold_ptr(tptr) \ >> +((void *)((tptr).v & ~__tagptr_mask(tptr))) >> + >> +#define tagptr_unfold_tags(tptr) \ >> +((tptr).v & __tagptr_mask(tptr)) >> + >> +/* operations for
Re: [PATCH v5 12/24] erofs: introduce tagged pointer
On Tue 30-07-19 15:14:01, Gao Xiang wrote: > Currently kernel has scattered tagged pointer usages > hacked by hand in plain code, without a unique and > portable functionset to highlight the tagged pointer > itself and wrap these hacked code in order to clean up > all over meaningless magic masks. > > This patch introduces simple generic methods to fold > tags into a pointer integer. Currently it supports > the last n bits of the pointer for tags, which can be > selected by users. > > In addition, it will also be used for the upcoming EROFS > filesystem, which heavily uses tagged pointer pproach > to reduce extra memory allocation. > > Link: https://en.wikipedia.org/wiki/Tagged_pointer > > Signed-off-by: Gao Xiang I'm not sure the generic approach you take is really needed here... You can rely on getting at most two unused bits in the pointer anyway (and on mk68 architecture I've heard even that is not true but I guess you don't care). So why not just define a single pointer type representing pointer with as many tags as you can get? Also what I find bad about your tagptr approach is that the way you've implemented it you loose the information about the original pointer type. So overall I'm not sure the benefits outweight the downsides but I guess that's a matter of taste and ultimately your call as a maintainer of this code. Honza > --- > fs/erofs/tagptr.h | 110 ++ > 1 file changed, 110 insertions(+) > create mode 100644 fs/erofs/tagptr.h > > diff --git a/fs/erofs/tagptr.h b/fs/erofs/tagptr.h > new file mode 100644 > index ..a72897c86744 > --- /dev/null > +++ b/fs/erofs/tagptr.h > @@ -0,0 +1,110 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * A tagged pointer implementation > + * > + * Copyright (C) 2018 Gao Xiang > + */ > +#ifndef __EROFS_FS_TAGPTR_H > +#define __EROFS_FS_TAGPTR_H > + > +#include > +#include > + > +/* > + * the name of tagged pointer types are tagptr{1, 2, 3...}_t > + * avoid directly using the internal structs __tagptr{1, 2, 3...} > + */ > +#define __MAKE_TAGPTR(n) \ > +typedef struct __tagptr##n { \ > + uintptr_t v;\ > +} tagptr##n##_t; > + > +__MAKE_TAGPTR(1) > +__MAKE_TAGPTR(2) > +__MAKE_TAGPTR(3) > +__MAKE_TAGPTR(4) > + > +#undef __MAKE_TAGPTR > + > +extern void __compiletime_error("bad tagptr tags") > + __bad_tagptr_tags(void); > + > +extern void __compiletime_error("bad tagptr type") > + __bad_tagptr_type(void); > + > +/* fix the broken usage of "#define tagptr2_t tagptr3_t" by users */ > +#define __tagptr_mask_1(ptr, n) \ > + __builtin_types_compatible_p(typeof(ptr), struct __tagptr##n) ? \ > + (1UL << (n)) - 1 : > + > +#define __tagptr_mask(ptr) (\ > + __tagptr_mask_1(ptr, 1) ( \ > + __tagptr_mask_1(ptr, 2) ( \ > + __tagptr_mask_1(ptr, 3) ( \ > + __tagptr_mask_1(ptr, 4) ( \ > + __bad_tagptr_type(), 0) > + > +/* generate a tagged pointer from a raw value */ > +#define tagptr_init(type, val) \ > + ((typeof(type)){ .v = (uintptr_t)(val) }) > + > +/* > + * directly cast a tagged pointer to the native pointer type, which > + * could be used for backward compatibility of existing code. > + */ > +#define tagptr_cast_ptr(tptr) ((void *)(tptr).v) > + > +/* encode tagged pointers */ > +#define tagptr_fold(type, ptr, _tags) ({ \ > + const typeof(_tags) tags = (_tags); \ > + if (__builtin_constant_p(tags) && (tags & ~__tagptr_mask(type))) \ > + __bad_tagptr_tags(); \ > +tagptr_init(type, (uintptr_t)(ptr) | tags); }) > + > +/* decode tagged pointers */ > +#define tagptr_unfold_ptr(tptr) \ > + ((void *)((tptr).v & ~__tagptr_mask(tptr))) > + > +#define tagptr_unfold_tags(tptr) \ > + ((tptr).v & __tagptr_mask(tptr)) > + > +/* operations for the tagger pointer */ > +#define tagptr_eq(_tptr1, _tptr2) ({ \ > + typeof(_tptr1) tptr1 = (_tptr1); \ > + typeof(_tptr2) tptr2 = (_tptr2); \ > + (void)( == ); \ > +(tptr1).v == (tptr2).v; }) > + > +/* lock-free CAS operation */ > +#define tagptr_cmpxchg(_ptptr, _o, _n) ({ \ > + typeof(_ptptr) ptptr = (_ptptr); \ > + typeof(_o) o = (_o); \ > + typeof(_n) n = (_n); \ > + (void)( == ); \ > + (void)( == ptptr); \ > +tagptr_init(o, cmpxchg(>v, o.v, n.v)); }) > + > +/* wrap WRITE_ONCE if atomic update is needed */ > +#define tagptr_replace_tags(_ptptr, tags) ({ \ > + typeof(_ptptr) ptptr = (_ptptr); \ > + *ptptr = tagptr_fold(*ptptr, tagptr_unfold_ptr(*ptptr), tags); \ > +*ptptr; }) > + > +#define tagptr_set_tags(_ptptr, _tags) ({ \ > + typeof(_ptptr) ptptr = (_ptptr); \ > + const typeof(_tags) tags = (_tags); \ > + if (__builtin_constant_p(tags) && (tags & ~__tagptr_mask(*ptptr))) \ > + __bad_tagptr_tags(); \ > + ptptr->v |= tags; \ > +*ptptr; }) > + > +#define tagptr_clear_tags(_ptptr, _tags) ({ \ > + typeof(_ptptr) ptptr = (_ptptr); \ > + const
Re: [PATCH 08/22] staging: erofs: kill CONFIG_EROFS_FS_IO_MAX_RETRIES
On 2019/7/31 20:10, Chao Yu wrote: > Hi Xiang, > > On 2019/7/31 15:11, Gao Xiang wrote: >> Hi Chao, >> >> On 2019/7/31 15:05, Chao Yu wrote: >>> On 2019/7/29 14:51, Gao Xiang wrote: CONFIG_EROFS_FS_IO_MAX_RETRIES seems a runtime setting and users have no idea about the change in behaviour. Let's remove the setting currently and fold it into code, turn it into a module parameter if it's really needed. Suggested-by: David Sterba Signed-off-by: Gao Xiang >>> >>> It's fine to me, but I'd like to suggest to add this as a sys entry which >>> can be >>> more flexible for user to change. >> >> I think it can be added in the later version, the original view >> from David is that he had question how users using this option. >> >> Maybe we can use the default value and leave it to users who >> really need to modify this value (real requirement). > > I think we need to decide it in this version, otherwise it may face backward > compatibility issue if we change module argument to sys entry later. > > Maybe just leave it as an fixed macro is fine, since there is actually no > requirement on this. OK, will fix it --- leave the fixed macro. Thanks, Gao Xiang > > Thanks, > >> >> Thanks, >> Gao Xiang >> >>> >>> Thanks >>> >> . >> ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 07/22] staging: erofs: remove redundant #include "internal.h"
On 2019/7/31 20:07, Chao Yu wrote: > Hi Xiang, > > On 2019/7/31 15:08, Gao Xiang wrote: >> Hi Chao, >> >> On 2019/7/31 15:03, Chao Yu wrote: >>> On 2019/7/29 14:51, Gao Xiang wrote: Because #include "internal.h" is included in xattr.h >>> >>> I think it would be better to remove "internal.h" in xattr.h, and include >>> them >>> both in .c file in where we need xattr definition. >> >> It seems that all xattr related source files needing internal.h, >> and we need "EROFS_V(inode)", "struct erofs_sb_info", ... stuffs in xattr.h, >> which is defined in internal.h... > > Since I checked f2fs', it looks it's okay to don't include internal.h for > xattr.h, if .c needs xattr.h, we can just include interanl.h and xattr.h in > the > head of it, it's safe. I think xattr.h should be used independently (all dependencies of xattr.h should be included in xattr.h, most of include files behave like that)... Maybe it is not a good way to follow f2fs... Thanks, Gao Xiang > > Thanks, > >> >> Thanks, >> Gao Xiang >> >>> >>> Thanks, >>> >> . >> ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 11/22] staging: erofs: kill all failure handling in fill_super()
Hi Chao, On 2019/7/31 16:15, Chao Yu wrote: > On 2019/7/29 14:51, Gao Xiang wrote: >> .kill_sb() will do that instead in order to remove duplicated code. >> >> Note that the initialzation of managed_cache is now moved >> after s_root is assigned since it's more preferred to iput() >> in .put_super() and all inodes should be evicted before >> the end of generic_shutdown_super(sb). >> >> Suggested-by: Al Viro >> Signed-off-by: Gao Xiang >> --- >> drivers/staging/erofs/super.c | 121 +++--- >> 1 file changed, 53 insertions(+), 68 deletions(-) >> >> diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c >> index bfb6e1e09781..af5d87793e4d 100644 >> --- a/drivers/staging/erofs/super.c >> +++ b/drivers/staging/erofs/super.c >> @@ -343,51 +343,52 @@ static const struct address_space_operations >> managed_cache_aops = { >> .invalidatepage = managed_cache_invalidatepage, >> }; >> >> -static struct inode *erofs_init_managed_cache(struct super_block *sb) >> +static int erofs_init_managed_cache(struct super_block *sb) >> { >> -struct inode *inode = new_inode(sb); >> +struct erofs_sb_info *const sbi = EROFS_SB(sb); >> +struct inode *const inode = new_inode(sb); >> >> if (unlikely(!inode)) >> -return ERR_PTR(-ENOMEM); >> +return -ENOMEM; >> >> set_nlink(inode, 1); >> inode->i_size = OFFSET_MAX; >> >> inode->i_mapping->a_ops = _cache_aops; >> mapping_set_gfp_mask(inode->i_mapping, >> - GFP_NOFS | __GFP_HIGHMEM | >> - __GFP_MOVABLE | __GFP_NOFAIL); >> -return inode; >> + GFP_NOFS | __GFP_HIGHMEM | __GFP_MOVABLE); Seems so, I will add a new patch addressing on it if needed. Thanks, Gao Xiang > > It looks above change is not belong to this patch? > > Otherwise, it looks good to me. > > Reviewed-by: Chao Yu > > Thanks, > >> +sbi->managed_cache = inode; >> +return 0; >> } >> - >> +#else >> +static int erofs_init_managed_cache(struct super_block *sb) { return 0; } >> #endif >> >> static int erofs_fill_super(struct super_block *sb, void *data, int silent) >> { >> struct inode *inode; >> struct erofs_sb_info *sbi; >> -int err = -EINVAL; >> +int err; >> >> infoln("fill_super, device -> %s", sb->s_id); >> infoln("options -> %s", (char *)data); >> >> +sb->s_magic = EROFS_SUPER_MAGIC; >> + >> if (unlikely(!sb_set_blocksize(sb, EROFS_BLKSIZ))) { >> errln("failed to set erofs blksize"); >> -goto err; >> +return -EINVAL; >> } >> >> sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); >> -if (unlikely(!sbi)) { >> -err = -ENOMEM; >> -goto err; >> -} >> -sb->s_fs_info = sbi; >> +if (unlikely(!sbi)) >> +return -ENOMEM; >> >> +sb->s_fs_info = sbi; >> err = superblock_read(sb); >> if (err) >> -goto err_sbread; >> +return err; >> >> -sb->s_magic = EROFS_SUPER_MAGIC; >> sb->s_flags |= SB_RDONLY | SB_NOATIME; >> sb->s_maxbytes = MAX_LFS_FILESIZE; >> sb->s_time_gran = 1; >> @@ -397,13 +398,12 @@ static int erofs_fill_super(struct super_block *sb, >> void *data, int silent) >> #ifdef CONFIG_EROFS_FS_XATTR >> sb->s_xattr = erofs_xattr_handlers; >> #endif >> - >> /* set erofs default mount options */ >> default_options(sbi); >> >> err = parse_options(sb, data); >> -if (err) >> -goto err_parseopt; >> +if (unlikely(err)) >> +return err; >> >> if (!silent) >> infoln("root inode @ nid %llu", ROOT_NID(sbi)); >> @@ -417,93 +417,78 @@ static int erofs_fill_super(struct super_block *sb, >> void *data, int silent) >> INIT_RADIX_TREE(>workstn_tree, GFP_ATOMIC); >> #endif >> >> -#ifdef EROFS_FS_HAS_MANAGED_CACHE >> -sbi->managed_cache = erofs_init_managed_cache(sb); >> -if (IS_ERR(sbi->managed_cache)) { >> -err = PTR_ERR(sbi->managed_cache); >> -goto err_init_managed_cache; >> -} >> -#endif >> - >> /* get the root inode */ >> inode = erofs_iget(sb, ROOT_NID(sbi), true); >> -if (IS_ERR(inode)) { >> -err = PTR_ERR(inode); >> -goto err_iget; >> -} >> +if (IS_ERR(inode)) >> +return PTR_ERR(inode); >> >> -if (!S_ISDIR(inode->i_mode)) { >> +if (unlikely(!S_ISDIR(inode->i_mode))) { >> errln("rootino(nid %llu) is not a directory(i_mode %o)", >>ROOT_NID(sbi), inode->i_mode); >> -err = -EINVAL; >> iput(inode); >> -goto err_iget; >> +return -EINVAL; >> } >> >> sb->s_root = d_make_root(inode); >> -if (!sb->s_root) { >> -err = -ENOMEM; >> -goto err_iget; >> -} >> +if (unlikely(!sb->s_root)) >> +return -ENOMEM; >> >>
Re: [PATCH v7 0/4] HEVC/H.265 stateless support for V4L2 and Cedrus
Hi, On Tue 30 Jul 19, 09:27, Hans Verkuil wrote: > On 7/27/19 11:57 AM, Paul Kocialkowski wrote: > > Hi Hans, > > > > On Fri 26 Jul 19, 10:33, Hans Verkuil wrote: > >> On 7/25/19 8:55 PM, Paul Kocialkowski wrote: > >>> HEVC/H.265 stateless support for V4L2 and Cedrus > >>> > >>> This is early support for HEVC/H.265 stateless decoding in V4L2, > >>> including both definitions and driver support for the Cedrus VPU > >>> driver, which concerns Allwinner devices. > >>> > >>> A specific pixel format is introduced for the HEVC slice format and > >>> controls are provided to pass the bitstream metadata to the decoder. > >>> Some bitstream extensions are intentionally not supported at this point. > >>> > >>> Since this is the first proposal for stateless HEVC/H.265 support in > >>> V4L2, reviews and comments about the controls definitions are > >>> particularly welcome. > >>> > >>> On the Cedrus side, the H.265 implementation covers frame pictures > >>> with both uni-directional and bi-direction prediction modes (P/B > >>> slices). Field pictures (interleaved), scaling lists and 10-bit output > >>> are not supported at this point. > >>> > >>> Changes since v6: > >>> * Rebased on latest media tree from Hans; > >> > >> Which tree is that? Or are you just referring our media_tree master > >> branch? (which isn't 'my' tree :-) ) > > > > I'm usually rebasing on the tree you use to send PRs to Mauro, at: > > https://git.linuxtv.org/hverkuil/media_tree.git/ > > There are lots of branches there, and none are stable branches. > > Just base it on the master branch of git://linuxtv.org/media_tree.git. Understood, I will do that from now on. Either way, the series applies and builds as-is (with the initial patch out of the way, as it was merged already) on top of the common media tree. I just retested everything and it's good to go as far as I'm concerned! Cheers, Paul > Regards, > > Hans > > > > > which is usually the best up-to-date stateless codec support tree :) > > > > Cheers, > > > > Paul > > > >> Regards, > >> > >>Hans > >> > >>> * Reordered some fields to avoid holes and multi-padding; > >>> * Updated the documentation. > >>> > >>> Changes since v5: > >>> * Rebased atop latest next media tree; > >>> * Moved to flags instead of u8 fields; > >>> * Added padding to ensure 64-bit alignment > >>> (tested with GDB on 32 and 64-bit architectures); > >>> * Reworked cedrus H.265 driver support a bit for flags; > >>> * Split off codec-specific control validation and init; > >>> * Added HEVC controls fields cleanup at std_validate to allow reliable > >>> control comparison with memcmp; > >>> * Fixed various misc reported mistakes. > >>> > >>> Changes since v4: > >>> * Rebased atop latest H.254 series. > >>> > >>> Changes since v3: > >>> * Updated commit messages; > >>> * Updated CID base to avoid conflicts; > >>> * Used cpu_to_le32 for packed le32 data; > >>> * Fixed misc minor issues in the drive code; > >>> * Made it clear in the docs that the API will evolve; > >>> * Made the pixfmt private and split commits about it. > >>> > >>> Changes since v2: > >>> * Moved headers to non-public API; > >>> * Added H265 capability for A64 and H5; > >>> * Moved docs to ext-ctrls-codec.rst; > >>> * Mentionned sections of the spec in the docs; > >>> * Added padding to control structures for 32-bit alignment; > >>> * Made write function use void/size in bytes; > >>> * Reduced the number of arguments to helpers when possible; > >>> * Removed PHYS_OFFSET since we already set PFN_OFFSET; > >>> * Added comments where suggested; > >>> * Moved to timestamp for references instead of index; > >>> * Fixed some style issues reported by checkpatch. > >>> > >>> Changes since v1: > >>> * Added a H.265 capability to whitelist relevant platforms; > >>> * Switched over to tags instead of buffer indices in the DPB > >>> * Declared variable in their reduced scope as suggested; > >>> * Added the H.265/HEVC spec to the biblio; > >>> * Used in-doc references to the spec and the required APIs; > >>> * Removed debugging leftovers. > >>> > >>> Cheers! > >>> > >>> Paul Kocialkowski (4): > >>> media: v4l2-ctrl: Add a comment on why we zero out compound controls > >>> fields > >>> media: v4l: Add definitions for the HEVC slice controls > >>> media: pixfmt: Document the HEVC slice pixel format > >>> media: cedrus: Add HEVC/H.265 decoding support > >>> > >>> Documentation/media/uapi/v4l/biblio.rst | 9 + > >>> .../media/uapi/v4l/ext-ctrls-codec.rst| 486 +- > >>> .../media/uapi/v4l/pixfmt-compressed.rst | 21 + > >>> .../media/uapi/v4l/vidioc-queryctrl.rst | 18 + > >>> .../media/videodev2.h.rst.exceptions | 3 + > >>> drivers/media/v4l2-core/v4l2-ctrls.c | 93 +++ > >>> drivers/media/v4l2-core/v4l2-ioctl.c | 1 + > >>> drivers/staging/media/sunxi/cedrus/Makefile | 2 +- > >>> drivers/staging/media/sunxi/cedrus/cedrus.c | 31 +- > >>>
Re: [PATCH 08/22] staging: erofs: kill CONFIG_EROFS_FS_IO_MAX_RETRIES
Hi Xiang, On 2019/7/31 15:11, Gao Xiang wrote: > Hi Chao, > > On 2019/7/31 15:05, Chao Yu wrote: >> On 2019/7/29 14:51, Gao Xiang wrote: >>> CONFIG_EROFS_FS_IO_MAX_RETRIES seems a runtime setting >>> and users have no idea about the change in behaviour. >>> >>> Let's remove the setting currently and fold it into code, >>> turn it into a module parameter if it's really needed. >>> >>> Suggested-by: David Sterba >>> Signed-off-by: Gao Xiang >> >> It's fine to me, but I'd like to suggest to add this as a sys entry which >> can be >> more flexible for user to change. > > I think it can be added in the later version, the original view > from David is that he had question how users using this option. > > Maybe we can use the default value and leave it to users who > really need to modify this value (real requirement). I think we need to decide it in this version, otherwise it may face backward compatibility issue if we change module argument to sys entry later. Maybe just leave it as an fixed macro is fine, since there is actually no requirement on this. Thanks, > > Thanks, > Gao Xiang > >> >> Thanks >> > . > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 07/22] staging: erofs: remove redundant #include "internal.h"
Hi Xiang, On 2019/7/31 15:08, Gao Xiang wrote: > Hi Chao, > > On 2019/7/31 15:03, Chao Yu wrote: >> On 2019/7/29 14:51, Gao Xiang wrote: >>> Because #include "internal.h" is included in xattr.h >> >> I think it would be better to remove "internal.h" in xattr.h, and include >> them >> both in .c file in where we need xattr definition. > > It seems that all xattr related source files needing internal.h, > and we need "EROFS_V(inode)", "struct erofs_sb_info", ... stuffs in xattr.h, > which is defined in internal.h... Since I checked f2fs', it looks it's okay to don't include internal.h for xattr.h, if .c needs xattr.h, we can just include interanl.h and xattr.h in the head of it, it's safe. Thanks, > > Thanks, > Gao Xiang > >> >> Thanks, >> > . > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] staging: rtl8192u: null check the kzalloc
On Tue, Jul 30, 2019 at 05:01:39PM -0500, Navid Emamdoost wrote: > In rtl8192_init_priv_variable allocation for priv->pFirmware may fail, > so a null check is necessary.priv->pFirmware is accessed later in > rtl8192_adapter_start. I added the check and made appropriate changes > to propagate the errno to the caller. > > --- > Update v2: fixed style errors > Update V3: fixed prefix > > Signed-off-by: Navid Emamdoost So close, the signed-off-by goes above the --- line. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: next/master build: 221 builds: 11 failed, 210 passed, 13 errors, 1174 warnings (next-20190731)
On Wed, Jul 31, 2019 at 12:24:41PM +0100, Mark Brown wrote: > On Wed, Jul 31, 2019 at 04:07:41AM -0700, kernelci.org bot wrote: > > Today's -next fails to build an ARM allmodconfig due to: > > > allmodconfig (arm, gcc-8) — FAIL, 1 error, 40 warnings, 0 section mismatches > > > > Errors: > > drivers/net/phy/mdio-cavium.h:111:36: error: implicit declaration of > > function 'writeq'; did you mean 'writel'? > > [-Werror=implicit-function-declaration] > > as a result of the changes that introduced: > > WARNING: unmet direct dependencies detected for MDIO_OCTEON > Depends on [n]: NETDEVICES [=y] && MDIO_DEVICE [=m] && MDIO_BUS [=m] && > 64BIT && HAS_IOMEM [=y] && OF_MDIO [=m] > Selected by [m]: > - OCTEON_ETHERNET [=m] && STAGING [=y] && (CAVIUM_OCTEON_SOC && NETDEVICES > [=y] || COMPILE_TEST [=y]) > > which is triggered by the staging OCTEON_ETHERNET driver which misses a > 64BIT dependency but added COMPILE_TEST in 171a9bae68c72f2 > (staging/octeon: Allow test build on !MIPS). A patch was posted for this, but it needs to go through the netdev tree as that's where the offending patches are coming from. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: next/master build: 221 builds: 11 failed, 210 passed, 13 errors, 1174 warnings (next-20190731)
On Wed, Jul 31, 2019 at 04:07:41AM -0700, kernelci.org bot wrote: Today's -next fails to build an ARM allmodconfig due to: > allmodconfig (arm, gcc-8) — FAIL, 1 error, 40 warnings, 0 section mismatches > > Errors: > drivers/net/phy/mdio-cavium.h:111:36: error: implicit declaration of > function 'writeq'; did you mean 'writel'? > [-Werror=implicit-function-declaration] as a result of the changes that introduced: WARNING: unmet direct dependencies detected for MDIO_OCTEON Depends on [n]: NETDEVICES [=y] && MDIO_DEVICE [=m] && MDIO_BUS [=m] && 64BIT && HAS_IOMEM [=y] && OF_MDIO [=m] Selected by [m]: - OCTEON_ETHERNET [=m] && STAGING [=y] && (CAVIUM_OCTEON_SOC && NETDEVICES [=y] || COMPILE_TEST [=y]) which is triggered by the staging OCTEON_ETHERNET driver which misses a 64BIT dependency but added COMPILE_TEST in 171a9bae68c72f2 (staging/octeon: Allow test build on !MIPS). signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: indicate disconnection when disconnecting
The Realtek RTL8723BS only connects successfully at the very first time, then it always fails attempting to switch to another AP. No authentication/association observed from the air capture for each attempt due to the cfg80211 believes the device is still connected. Fix this by forcing to indicate the disconnection events during disconnection so the cfg80211_connect can connect to a different AP without problem. Signed-off-by: Chris Chiu --- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index db553f2e4c0b..f76a498f015f 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -2024,8 +2024,6 @@ static int cfg80211_rtw_leave_ibss(struct wiphy *wiphy, struct net_device *ndev) DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - padapter->mlmepriv.not_indic_disco = true; - old_type = rtw_wdev->iftype; rtw_set_to_roam(padapter, 0); @@ -2047,8 +2045,6 @@ static int cfg80211_rtw_leave_ibss(struct wiphy *wiphy, struct net_device *ndev) } leave_ibss: - padapter->mlmepriv.not_indic_disco = false; - return 0; } @@ -2246,8 +2242,6 @@ static int cfg80211_rtw_disconnect(struct wiphy *wiphy, struct net_device *ndev, DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - padapter->mlmepriv.not_indic_disco = true; - rtw_set_to_roam(padapter, 0); rtw_scan_abort(padapter); @@ -2261,8 +2255,6 @@ static int cfg80211_rtw_disconnect(struct wiphy *wiphy, struct net_device *ndev, rtw_free_assoc_resources(padapter, 1); rtw_pwr_wakeup(padapter); - padapter->mlmepriv.not_indic_disco = false; - DBG_871X(FUNC_NDEV_FMT" return 0\n", FUNC_NDEV_ARG(ndev)); return 0; } -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: remove redundant assignment to variable rtstatus
From: Colin Ian King Variable rtstatus is being initialized with a value that is never read and rtstatus is being re-assigned a little later on. The assignment is redundant and hence can be removed. Also, make rtstatus a bool to match the function return type. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index 11e0bb9c67d7..51882858fcf0 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -653,7 +653,7 @@ static bool config_parafile(struct adapter *adapt) bool rtl88eu_phy_bb_config(struct adapter *adapt) { - int rtstatus = true; + bool rtstatus; u32 regval; u8 crystal_cap; -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 22/22] staging: erofs: update Kconfig
On 2019/7/29 14:51, Gao Xiang wrote: > Keep in line with erofs-outofstaging patchset: > - turn on CONFIG_EROFS_FS_ZIP by default; > - turn on CONFIG_EROFS_FS_SECURITY by default suggested by David; > - update Kconfig description. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 21/22] staging: erofs: update super.c
On 2019/7/29 14:51, Gao Xiang wrote: > Keep in line with erofs-outofstaging patchset: > - "Chao Yu" is most commonly used in Linux community; Either is okay to me, anyway, thanks for the correction. :) BTW, I notice that .mailmap can map different email or name to single one on git-shortlog or git-blame, so developer and user can find the correct people to blame... I think we can change ours later. > - quoted string split across lines. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 20/22] staging: erofs: tidy up internal.h
On 2019/7/29 14:51, Gao Xiang wrote: > keep in line with erofs-outofstaging patchset: > - remove an extra #ifdef CONFIG_EROFS_FS_ZIP; > - add tags at the end of #endif acrossing several lines. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 19/22] staging: erofs: tidy up utils.c
On 2019/7/29 14:51, Gao Xiang wrote: > keep in line with erofs-outofstaging patchset: > - Update comments in erofs_try_to_release_workgroup; > - code style cleanup. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 18/22] staging: erofs: turn cache strategies into mount options
On 2019/7/29 14:51, Gao Xiang wrote: > Kill all kconfig cache strategies and turn them into mount options > "cache_strategy={disable|readahead|readaround}". > > As the first step, cached pages can still be usable after cache > is disabled by remounting, and these pages will be fallen out > over time, which can be refined in the later version if some > requirement is needed. Update related document as well. > > Suggested-by: Theodore Ts'o > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 17/22] staging: erofs: remove clusterbits in sbi
On 2019/7/29 14:51, Gao Xiang wrote: > clustersize can now be set on per-file basis > rather than per-filesystem basis. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 16/22] staging: erofs: tidy up decompression frontend
On 2019/7/29 14:51, Gao Xiang wrote: > Although this patch has an amount of changes, it is hard to > separate into smaller patches. > > Most changes are due to structure renaming for better understand > and straightforward, > z_erofs_vle_workgroup to z_erofs_pcluster > since it represents a physical cluster; > z_erofs_vle_work to z_erofs_collection > since it represents a collection of logical pages; > z_erofs_vle_work_builder to z_erofs_collector > since it's used to fill z_erofs_{pcluster,collection}. > > struct z_erofs_vle_work_finder has no extra use compared with > struct z_erofs_collector, delete it. > > FULL_LENGTH bit is integrated into .length of pcluster so that it > can be updated with the corresponding length change in atomic. > > Minor, add comments for better description. > > Signed-off-by: Gao Xiang I hope I don't miss anything, since this is so huge cleanup... Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v5 12/29] compat_ioctl: move drivers to compat_ptr_ioctl
On Tue, 30 Jul 2019 21:50:28 +0200 Arnd Bergmann wrote: > Each of these drivers has a copy of the same trivial helper function to > convert the pointer argument and then call the native ioctl handler. > > We now have a generic implementation of that, so use it. > > Acked-by: Greg Kroah-Hartman > Acked-by: Michael S. Tsirkin > Reviewed-by: Jarkko Sakkinen > Reviewed-by: Jason Gunthorpe > Reviewed-by: Jiri Kosina > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Arnd Bergmann > --- > drivers/vfio/vfio.c | 39 +++ vfio changes: Reviewed-by: Cornelia Huck ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 15/22] staging: erofs: remove redundant braces in inode.c
On 2019/7/29 14:51, Gao Xiang wrote: > Remove redundant braces in inode.c since > these are all single statements. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 14/22] staging: erofs: tidy up zpvec.h
On 2019/7/29 14:51, Gao Xiang wrote: > - use shorter function names: > z_erofs_pagevec_enqueue and z_erofs_pagevec_dequeue; > - minor code cleanup. > > In order to keep in line with erofs-outofstaging patchset. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 13/22] staging: erofs: kill CONFIG_EROFS_FS_USE_VM_MAP_RAM
On 2019/7/29 14:51, Gao Xiang wrote: > Turn into a module parameter ("use_vmap") as it > can be set at runtime. > > Suggested-by: David Sterba > Signed-off-by: Gao Xiang > --- > drivers/staging/erofs/Kconfig| 8 -- > drivers/staging/erofs/decompressor.c | 37 +++- > 2 files changed, 20 insertions(+), 25 deletions(-) > > diff --git a/drivers/staging/erofs/Kconfig b/drivers/staging/erofs/Kconfig > index 747e9eebfaa5..788beebf3f7d 100644 > --- a/drivers/staging/erofs/Kconfig > +++ b/drivers/staging/erofs/Kconfig > @@ -63,14 +63,6 @@ config EROFS_FS_SECURITY > > If you are not using a security module, say N. > > -config EROFS_FS_USE_VM_MAP_RAM > - bool "EROFS VM_MAP_RAM Support" > - depends on EROFS_FS > - help > - use vm_map_ram/vm_unmap_ram instead of vmap/vunmap. > - > - If you don't know what these are, say N. > - > config EROFS_FAULT_INJECTION > bool "EROFS fault injection facility" > depends on EROFS_FS > diff --git a/drivers/staging/erofs/decompressor.c > b/drivers/staging/erofs/decompressor.c > index 744c43a456e9..5352a50981cb 100644 > --- a/drivers/staging/erofs/decompressor.c > +++ b/drivers/staging/erofs/decompressor.c > @@ -7,6 +7,7 @@ > * Created by Gao Xiang > */ > #include "compress.h" > +#include > #include > > #ifndef LZ4_DISTANCE_MAX /* history window size */ > @@ -29,6 +30,10 @@ struct z_erofs_decompressor { > char *name; > }; > > +static bool use_vmap; > +module_param(use_vmap, bool, 0444); > +MODULE_PARM_DESC(use_vmap, "Use vmap() instead of vm_map_ram() (default 0)"); This should be documented in erofs.txt simply. > + > static int lz4_prepare_destpages(struct z_erofs_decompress_req *rq, >struct list_head *pagepool) > { > @@ -219,29 +224,27 @@ static void copy_from_pcpubuf(struct page **out, const > char *dst, > > static void *erofs_vmap(struct page **pages, unsigned int count) > { > -#ifdef CONFIG_EROFS_FS_USE_VM_MAP_RAM > - int i = 0; > - > - while (1) { > - void *addr = vm_map_ram(pages, count, -1, PAGE_KERNEL); > - /* retry two more times (totally 3 times) */ > - if (addr || ++i >= 3) > - return addr; > - vm_unmap_aliases(); > + if (!use_vmap) { Minor thing. if (use_vmap) return vmap(pages, count, VM_MAP, PAGE_KERNEL); while (1) { } return NULL; Otherwise, it looks good to me. Reviewed-by: Chao Yu Thanks, > + int i = 0; > + > + while (1) { > + void *addr = vm_map_ram(pages, count, -1, PAGE_KERNEL); > + /* retry two more times (totally 3 times) */ > + if (addr || ++i >= 3) > + return addr; > + vm_unmap_aliases(); > + } > + return NULL; > } > - return NULL; > -#else > return vmap(pages, count, VM_MAP, PAGE_KERNEL); > -#endif > } > > static void erofs_vunmap(const void *mem, unsigned int count) > { > -#ifdef CONFIG_EROFS_FS_USE_VM_MAP_RAM > - vm_unmap_ram(mem, count); > -#else > - vunmap(mem); > -#endif > + if (!use_vmap) > + vm_unmap_ram(mem, count); > + else > + vunmap(mem); > } > > static int decompress_generic(struct z_erofs_decompress_req *rq, > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 12/22] staging: erofs: refine erofs_allocpage()
On 2019/7/29 14:51, Gao Xiang wrote: > remove duplicated code in decompressor by introducing > failable erofs_allocpage(). > > Signed-off-by: Gao Xiang > --- > drivers/staging/erofs/decompressor.c | 12 +++- > drivers/staging/erofs/internal.h | 2 +- > drivers/staging/erofs/utils.c| 5 +++-- > drivers/staging/erofs/zdata.c| 2 +- > 4 files changed, 8 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/erofs/decompressor.c > b/drivers/staging/erofs/decompressor.c > index ee5762351f80..744c43a456e9 100644 > --- a/drivers/staging/erofs/decompressor.c > +++ b/drivers/staging/erofs/decompressor.c > @@ -74,15 +74,9 @@ static int lz4_prepare_destpages(struct > z_erofs_decompress_req *rq, > victim = availables[--top]; > get_page(victim); > } else { > - if (!list_empty(pagepool)) { > - victim = lru_to_page(pagepool); > - list_del(>lru); > - DBG_BUGON(page_ref_count(victim) != 1); > - } else { > - victim = alloc_pages(GFP_KERNEL, 0); > - if (!victim) > - return -ENOMEM; > - } > + victim = erofs_allocpage(pagepool, GFP_KERNEL, false); > + if (unlikely(!victim)) > + return -ENOMEM; > victim->mapping = Z_EROFS_MAPPING_STAGING; > } > rq->out[i] = victim; > diff --git a/drivers/staging/erofs/internal.h > b/drivers/staging/erofs/internal.h > index b206a85776b4..e35c7d8f75d2 100644 > --- a/drivers/staging/erofs/internal.h > +++ b/drivers/staging/erofs/internal.h > @@ -517,7 +517,7 @@ int erofs_namei(struct inode *dir, struct qstr *name, > extern const struct file_operations erofs_dir_fops; > > /* utils.c / zdata.c */ > -struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp); > +struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp, bool nofail); > > #if (EROFS_PCPUBUF_NR_PAGES > 0) > void *erofs_get_pcpubuf(unsigned int pagenr); > diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c > index 0e86e44d60d0..260ea2970b4b 100644 > --- a/drivers/staging/erofs/utils.c > +++ b/drivers/staging/erofs/utils.c > @@ -9,15 +9,16 @@ > #include "internal.h" > #include > > -struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp) > +struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp, bool nofail) > { > struct page *page; > > if (!list_empty(pool)) { > page = lru_to_page(pool); > + DBG_BUGON(page_ref_count(page) != 1); > list_del(>lru); > } else { > - page = alloc_pages(gfp | __GFP_NOFAIL, 0); > + page = alloc_pages(gfp | (nofail ? __GFP_NOFAIL : 0), 0); > } > return page; > } > diff --git a/drivers/staging/erofs/zdata.c b/drivers/staging/erofs/zdata.c > index bc478eebf509..02560b940558 100644 > --- a/drivers/staging/erofs/zdata.c > +++ b/drivers/staging/erofs/zdata.c > @@ -634,7 +634,7 @@ z_erofs_vle_work_iter_end(struct z_erofs_vle_work_builder > *builder) > static inline struct page *__stagingpage_alloc(struct list_head *pagepool, > gfp_t gfp) > { > - struct page *page = erofs_allocpage(pagepool, gfp); > + struct page *page = erofs_allocpage(pagepool, gfp, true); > > if (unlikely(!page)) > return NULL; Should remove it. Otherwise, it looks good to me. Reviewed-by: Chao Yu Thanks, > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 11/22] staging: erofs: kill all failure handling in fill_super()
On 2019/7/29 14:51, Gao Xiang wrote: > .kill_sb() will do that instead in order to remove duplicated code. > > Note that the initialzation of managed_cache is now moved > after s_root is assigned since it's more preferred to iput() > in .put_super() and all inodes should be evicted before > the end of generic_shutdown_super(sb). > > Suggested-by: Al Viro > Signed-off-by: Gao Xiang > --- > drivers/staging/erofs/super.c | 121 +++--- > 1 file changed, 53 insertions(+), 68 deletions(-) > > diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c > index bfb6e1e09781..af5d87793e4d 100644 > --- a/drivers/staging/erofs/super.c > +++ b/drivers/staging/erofs/super.c > @@ -343,51 +343,52 @@ static const struct address_space_operations > managed_cache_aops = { > .invalidatepage = managed_cache_invalidatepage, > }; > > -static struct inode *erofs_init_managed_cache(struct super_block *sb) > +static int erofs_init_managed_cache(struct super_block *sb) > { > - struct inode *inode = new_inode(sb); > + struct erofs_sb_info *const sbi = EROFS_SB(sb); > + struct inode *const inode = new_inode(sb); > > if (unlikely(!inode)) > - return ERR_PTR(-ENOMEM); > + return -ENOMEM; > > set_nlink(inode, 1); > inode->i_size = OFFSET_MAX; > > inode->i_mapping->a_ops = _cache_aops; > mapping_set_gfp_mask(inode->i_mapping, > - GFP_NOFS | __GFP_HIGHMEM | > - __GFP_MOVABLE | __GFP_NOFAIL); > - return inode; > + GFP_NOFS | __GFP_HIGHMEM | __GFP_MOVABLE); It looks above change is not belong to this patch? Otherwise, it looks good to me. Reviewed-by: Chao Yu Thanks, > + sbi->managed_cache = inode; > + return 0; > } > - > +#else > +static int erofs_init_managed_cache(struct super_block *sb) { return 0; } > #endif > > static int erofs_fill_super(struct super_block *sb, void *data, int silent) > { > struct inode *inode; > struct erofs_sb_info *sbi; > - int err = -EINVAL; > + int err; > > infoln("fill_super, device -> %s", sb->s_id); > infoln("options -> %s", (char *)data); > > + sb->s_magic = EROFS_SUPER_MAGIC; > + > if (unlikely(!sb_set_blocksize(sb, EROFS_BLKSIZ))) { > errln("failed to set erofs blksize"); > - goto err; > + return -EINVAL; > } > > sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); > - if (unlikely(!sbi)) { > - err = -ENOMEM; > - goto err; > - } > - sb->s_fs_info = sbi; > + if (unlikely(!sbi)) > + return -ENOMEM; > > + sb->s_fs_info = sbi; > err = superblock_read(sb); > if (err) > - goto err_sbread; > + return err; > > - sb->s_magic = EROFS_SUPER_MAGIC; > sb->s_flags |= SB_RDONLY | SB_NOATIME; > sb->s_maxbytes = MAX_LFS_FILESIZE; > sb->s_time_gran = 1; > @@ -397,13 +398,12 @@ static int erofs_fill_super(struct super_block *sb, > void *data, int silent) > #ifdef CONFIG_EROFS_FS_XATTR > sb->s_xattr = erofs_xattr_handlers; > #endif > - > /* set erofs default mount options */ > default_options(sbi); > > err = parse_options(sb, data); > - if (err) > - goto err_parseopt; > + if (unlikely(err)) > + return err; > > if (!silent) > infoln("root inode @ nid %llu", ROOT_NID(sbi)); > @@ -417,93 +417,78 @@ static int erofs_fill_super(struct super_block *sb, > void *data, int silent) > INIT_RADIX_TREE(>workstn_tree, GFP_ATOMIC); > #endif > > -#ifdef EROFS_FS_HAS_MANAGED_CACHE > - sbi->managed_cache = erofs_init_managed_cache(sb); > - if (IS_ERR(sbi->managed_cache)) { > - err = PTR_ERR(sbi->managed_cache); > - goto err_init_managed_cache; > - } > -#endif > - > /* get the root inode */ > inode = erofs_iget(sb, ROOT_NID(sbi), true); > - if (IS_ERR(inode)) { > - err = PTR_ERR(inode); > - goto err_iget; > - } > + if (IS_ERR(inode)) > + return PTR_ERR(inode); > > - if (!S_ISDIR(inode->i_mode)) { > + if (unlikely(!S_ISDIR(inode->i_mode))) { > errln("rootino(nid %llu) is not a directory(i_mode %o)", > ROOT_NID(sbi), inode->i_mode); > - err = -EINVAL; > iput(inode); > - goto err_iget; > + return -EINVAL; > } > > sb->s_root = d_make_root(inode); > - if (!sb->s_root) { > - err = -ENOMEM; > - goto err_iget; > - } > + if (unlikely(!sb->s_root)) > + return -ENOMEM; > > erofs_shrinker_register(sb); > + /* sb->s_umount is already locked, SB_ACTIVE and SB_BORN are not set */ > + err = erofs_init_managed_cache(sb); > + if (unlikely(err)) > + return err; >
Re: [PATCH 10/22] staging: erofs: kill sbi->dev_name
On 2019/7/29 14:51, Gao Xiang wrote: > As Al said, "the only use of sbi->dev_name is debugging > printks and all of those have sb->s_id available, with > device name stored in there. Which makes the whole > thing bloody weird". > > sbi->dev_name was used for our debugging use and it's > better to just use s_id in community and delete > the whole erofs_mount_private stuff. > > Suggested-by: Al Viro > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/22] staging: erofs: clean up shrinker stuffs
On 2019/7/29 14:51, Gao Xiang wrote: > - rename erofs_register_super / erofs_unregister_super > to erofs_shrinker_register / erofs_shrinker_unregister; > - fold the only erofs_shrink_workstation external call > to erofs_shrinker_unregister; > - localize erofs_shrink_workstation; > - localize erofs_shrinker_info by introducing > erofs_init_shrinker and erofs_exit_shrinker. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 08/22] staging: erofs: kill CONFIG_EROFS_FS_IO_MAX_RETRIES
Hi Chao, On 2019/7/31 15:05, Chao Yu wrote: > On 2019/7/29 14:51, Gao Xiang wrote: >> CONFIG_EROFS_FS_IO_MAX_RETRIES seems a runtime setting >> and users have no idea about the change in behaviour. >> >> Let's remove the setting currently and fold it into code, >> turn it into a module parameter if it's really needed. >> >> Suggested-by: David Sterba >> Signed-off-by: Gao Xiang > > It's fine to me, but I'd like to suggest to add this as a sys entry which can > be > more flexible for user to change. I think it can be added in the later version, the original view from David is that he had question how users using this option. Maybe we can use the default value and leave it to users who really need to modify this value (real requirement). Thanks, Gao Xiang > > Thanks > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 07/22] staging: erofs: remove redundant #include "internal.h"
Hi Chao, On 2019/7/31 15:03, Chao Yu wrote: > On 2019/7/29 14:51, Gao Xiang wrote: >> Because #include "internal.h" is included in xattr.h > > I think it would be better to remove "internal.h" in xattr.h, and include them > both in .c file in where we need xattr definition. It seems that all xattr related source files needing internal.h, and we need "EROFS_V(inode)", "struct erofs_sb_info", ... stuffs in xattr.h, which is defined in internal.h... Thanks, Gao Xiang > > Thanks, > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 08/22] staging: erofs: kill CONFIG_EROFS_FS_IO_MAX_RETRIES
On 2019/7/29 14:51, Gao Xiang wrote: > CONFIG_EROFS_FS_IO_MAX_RETRIES seems a runtime setting > and users have no idea about the change in behaviour. > > Let's remove the setting currently and fold it into code, > turn it into a module parameter if it's really needed. > > Suggested-by: David Sterba > Signed-off-by: Gao Xiang It's fine to me, but I'd like to suggest to add this as a sys entry which can be more flexible for user to change. Thanks ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 07/22] staging: erofs: remove redundant #include "internal.h"
On 2019/7/29 14:51, Gao Xiang wrote: > Because #include "internal.h" is included in xattr.h I think it would be better to remove "internal.h" in xattr.h, and include them both in .c file in where we need xattr definition. Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 06/22] staging: erofs: clean up internal.h
On 2019/7/29 14:51, Gao Xiang wrote: > Tidy up relative order of variables / declarations in internal.h, > and moving some local static functions out to other files. > > No logic change. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 05/22] staging: erofs: sunset erofs_workstn_{lock,unlock}
On 2019/7/29 14:51, Gao Xiang wrote: > It was used for Linux backward compatibility, and no use > for upstream kernel. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 04/22] staging: erofs: keep up erofs_fs.h with erofs-outofstaging patchset
On 2019/7/29 14:51, Gao Xiang wrote: > The main change is to reserve all checksums except for superblock, > since it's more useful to do block-based verity for read-only fs. > > Some comments change as well, which is minor. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 03/22] staging: erofs: fix dummy functions erofs_{get, list}xattr
On 2019/7/29 14:51, Gao Xiang wrote: > dummy functions erofs_{get,list}xattr should be inlined > without xattr enabled. > > Signed-off-by: Yue Hu > [ Gao Xiang : this patch was "staging: erofs: remove needless > dummy functions of erofs_{get,list}xattr. "] > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 02/22] staging: erofs: rename source files for better understanding
On 2019/7/29 14:51, Gao Xiang wrote: > Keep in line with erofs-outofstaging patchset as well, see > https://lore.kernel.org/linux-fsdevel/20190725095658.155779-1-gaoxian...@huawei.com/ > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/22] staging: erofs: update source file headers
On 2019/7/29 14:51, Gao Xiang wrote: > - Use the correct style for all SPDX License Identifiers; > - Get rid of the unnecessary license boilerplate; > - Use "GPL-2.0-only" instead of "GPL-2.0" suggested-by Stephen. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel