Re: [PATCH 1/9] staging: wilc1000: revert fix related to vif index
This patch was very confusing to review... >From a process perspective, you really should fold patches 1 and 2 together. Otherwise we're re-introducing a bug. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/9] staging: wilc1000: fix to set the correct value for 'vif_num'
On Thu, Feb 07, 2019 at 07:22:25AM +, ajay.kat...@microchip.com wrote: > From: Ajay Singh > > Set correct interface count value in '->vif_num'. > 'vif_num' was incorrectly set one less than total number of interfaces > because 'i' is used to set its value, which starts from 0. > > Fixes: 735bb39ca3be ("staging: wilc1000: simplify vif[i]->ndev accesses") > Cc: # v4.10 > Signed-off-by: Ajay Singh > --- > drivers/staging/wilc1000/linux_wlan.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/wilc1000/linux_wlan.c > b/drivers/staging/wilc1000/linux_wlan.c > index 648b658..8fa5f90 100644 > --- a/drivers/staging/wilc1000/linux_wlan.c > +++ b/drivers/staging/wilc1000/linux_wlan.c > @@ -1021,7 +1021,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device > *dev, int io_type, The line before the diff looks like this: vif->idx = wl->vif_num; can we can change that to: vif->idx = i; It's the same thing, but more clear. > vif->wilc = *wilc; > vif->ndev = ndev; > wl->vif[i] = vif; > - wl->vif_num = i; > + wl->vif_num = i + 1; > ndev->netdev_ops = &wilc_netdev_ops; regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/9] staging: wilc1000: revert fix related to vif index
Hi Dan, On 2/7/2019 1:42 PM, Dan Carpenter wrote: > This patch was very confusing to review... Apologies for the confusion. > From a process perspective, you really should fold patches 1 and 2 > together. Otherwise we're re-introducing a bug. Patch 1 and Patch 2 both are required if commit 0e490657c721 ("staging: wilc1000: Fix problem with wrong vif index") is applied else Patch 2 is enough for complete fix. For the above reason, I have divided the fixes into 2 patches. Please suggest, if I should go ahead and submit this in a single patch. Should I put 2 'Fixes:' tag in that merge commit or only 0e490657c721 commit is enough. Regards, Ajay ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/9] staging: wilc1000: revert fix related to vif index
On Thu, Feb 07, 2019 at 09:39:54AM +, ajay.kat...@microchip.com wrote: > Hi Dan, > > On 2/7/2019 1:42 PM, Dan Carpenter wrote: > > This patch was very confusing to review... > > Apologies for the confusion. > > > From a process perspective, you really should fold patches 1 and 2 > > together. Otherwise we're re-introducing a bug. > > Patch 1 and Patch 2 both are required if commit 0e490657c721 ("staging: > wilc1000: Fix problem with wrong vif index") is applied else Patch 2 is > enough for complete fix. For the above reason, I have divided the fixes > into 2 patches. > Please suggest, if I should go ahead and submit this in a single patch. > Should I put 2 'Fixes:' tag in that merge commit or only 0e490657c721 > commit is enough. > I always just go with the oldest one. Another option is to include both. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 8/8] staging: wilc1000: rename linux_wlan.c and linux_mon.c
From: Ajay Singh Rename linux_wlan.c and linux_mon.c to wilc_netdev.c and wilc_mon.c to include 'wilc_' prefix. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/Makefile| 2 +- drivers/staging/wilc1000/{linux_mon.c => wilc_mon.c} | 0 drivers/staging/wilc1000/{linux_wlan.c => wilc_netdev.c} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename drivers/staging/wilc1000/{linux_mon.c => wilc_mon.c} (100%) rename drivers/staging/wilc1000/{linux_wlan.c => wilc_netdev.c} (100%) diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index 72a4daa..2ad3fee 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -4,7 +4,7 @@ obj-$(CONFIG_WILC1000) += wilc1000.o ccflags-y += -DFIRMWARE_1002=\"atmel/wilc1002_firmware.bin\" \ -DFIRMWARE_1003=\"atmel/wilc1003_firmware.bin\" -wilc1000-objs := wilc_wfi_cfgoperations.o linux_wlan.o linux_mon.o \ +wilc1000-objs := wilc_wfi_cfgoperations.o wilc_netdev.o wilc_mon.o \ host_interface.o wilc_wlan_cfg.o wilc_wlan.o obj-$(CONFIG_WILC1000_SDIO) += wilc1000-sdio.o diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/wilc_mon.c similarity index 100% rename from drivers/staging/wilc1000/linux_mon.c rename to drivers/staging/wilc1000/wilc_mon.c diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/wilc_netdev.c similarity index 100% rename from drivers/staging/wilc1000/linux_wlan.c rename to drivers/staging/wilc1000/wilc_netdev.c -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 6/8] staging: wilc1000: rename wilc_frmw_to_linux()
From: Ajay Singh Rename wilc_frmw_to_linux() to wilc_frmw_to_host() to be remove the _linux suffix. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_wlan.c | 3 ++- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 1ebf2b8..1e2f6f4 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -803,7 +803,8 @@ static int wilc_mac_close(struct net_device *ndev) return 0; } -void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset) +void wilc_frmw_to_host(struct wilc *wilc, u8 *buff, u32 size, + u32 pkt_offset) { unsigned int frame_len = 0; int stats; diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 2b9b8b5..df00762 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -281,7 +281,7 @@ struct wilc_wfi_mon_priv { struct net_device *real_ndev; }; -void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset); +void wilc_frmw_to_host(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset); void wilc_mac_indicate(struct wilc *wilc); void wilc_netdev_cleanup(struct wilc *wilc); int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index af1c4d8..c238969 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -717,9 +717,8 @@ static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size) } else { if (!is_cfg_packet) { if (pkt_len > 0) { - wilc_frmw_to_linux(wilc, buff_ptr, - pkt_len, - pkt_offset); + wilc_frmw_to_host(wilc, buff_ptr, + pkt_len, pkt_offset); } } else { struct wilc_cfg_rsp rsp; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 7/8] staging: wilc1000: remove 'linux_' prefix in function names
From: Ajay Singh Remove 'linux_' prefix and replace it with 'wilc_' namespace. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_wlan.c | 17 - drivers/staging/wilc1000/wilc_sdio.c | 10 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 1e2f6f4..1787154 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -139,7 +139,7 @@ int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc) return ret_val; } -static int linux_wlan_txq_task(void *vp) +static int wilc_txq_task(void *vp) { int ret; u32 txq_count; @@ -202,7 +202,7 @@ static int wilc_wlan_get_firmware(struct net_device *dev) return ret; } -static int linux_wlan_start_firmware(struct net_device *dev) +static int wilc_start_firmware(struct net_device *dev) { struct wilc_vif *vif = netdev_priv(dev); struct wilc *wilc = vif->wilc; @@ -243,8 +243,7 @@ static int wilc1000_firmware_download(struct net_device *dev) return 0; } -static int linux_wlan_init_fw_config(struct net_device *dev, -struct wilc_vif *vif) +static int wilc_init_fw_config(struct net_device *dev, struct wilc_vif *vif) { struct wilc_priv *priv; struct host_if_drv *hif_drv; @@ -502,7 +501,7 @@ static int wlan_initialize_threads(struct net_device *dev) struct wilc_vif *vif = netdev_priv(dev); struct wilc *wilc = vif->wilc; - wilc->txq_thread = kthread_run(linux_wlan_txq_task, (void *)dev, + wilc->txq_thread = kthread_run(wilc_txq_task, (void *)dev, "K_TXQ_TASK"); if (IS_ERR(wilc->txq_thread)) { netdev_err(dev, "couldn't create TXQ thread\n"); @@ -560,7 +559,7 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif) goto fail_irq_enable; } - ret = linux_wlan_start_firmware(dev); + ret = wilc_start_firmware(dev); if (ret < 0) { ret = -EIO; goto fail_irq_enable; @@ -576,7 +575,7 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif) firmware_ver[size] = '\0'; netdev_dbg(dev, "Firmware Ver = %s\n", firmware_ver); } - ret = linux_wlan_init_fw_config(dev, vif); + ret = wilc_init_fw_config(dev, vif); if (ret < 0) { netdev_err(dev, "Failed to configure firmware\n"); @@ -726,7 +725,7 @@ static void wilc_set_multicast_list(struct net_device *dev) kfree(mc_list); } -static void linux_wlan_tx_complete(void *priv, int status) +static void wilc_tx_complete(void *priv, int status) { struct tx_complete_data *pv_data = priv; @@ -762,7 +761,7 @@ netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) tx_data->bssid = wilc->vif[vif->idx]->bssid; queue_count = wilc_wlan_txq_add_net_pkt(ndev, (void *)tx_data, tx_data->buff, tx_data->size, - linux_wlan_tx_complete); + wilc_tx_complete); if (queue_count > FLOW_CONTROL_UPPER_THRESHOLD) { if (wilc->vif[0]->mac_opened) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 2ca6757..b789c57 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -117,8 +117,8 @@ static int wilc_sdio_cmd53(struct wilc *wilc, struct sdio_cmd53 *cmd) return ret; } -static int linux_sdio_probe(struct sdio_func *func, - const struct sdio_device_id *id) +static int wilc_sdio_probe(struct sdio_func *func, + const struct sdio_device_id *id) { struct wilc *wilc; int ret; @@ -156,7 +156,7 @@ static int linux_sdio_probe(struct sdio_func *func, return 0; } -static void linux_sdio_remove(struct sdio_func *func) +static void wilc_sdio_remove(struct sdio_func *func) { struct wilc *wilc = sdio_get_drvdata(func); @@ -1127,8 +1127,8 @@ static const struct dev_pm_ops wilc_sdio_pm_ops = { static struct sdio_driver wilc_sdio_driver = { .name = SDIO_MODALIAS, .id_table = wilc_sdio_ids, - .probe = linux_sdio_probe, - .remove = linux_sdio_remove, + .probe = wilc_sdio_probe, + .remove = wilc_sdio_remove, .drv = { .pm = &wilc_sdio_pm_ops, .of_match_table = wilc_of_match, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http:/
[PATCH v2 5/8] staging: wilc1000: added 'wilc_' prefix for function in wilc_sdio.c file
From: Ajay Singh Cleanup patch to have proper follow clear namespace in wilc_sdio.c file. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_sdio.c | 92 ++-- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index a62eabe..2ca6757 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -166,7 +166,7 @@ static void linux_sdio_remove(struct sdio_func *func) wilc_netdev_cleanup(wilc); } -static int sdio_reset(struct wilc *wilc) +static int wilc_sdio_reset(struct wilc *wilc) { struct sdio_cmd52 cmd; int ret; @@ -201,7 +201,7 @@ static int wilc_sdio_suspend(struct device *dev) chip_allow_sleep(wilc); } - ret = sdio_reset(wilc); + ret = wilc_sdio_reset(wilc); if (ret) { dev_err(&func->dev, "Fail reset sdio\n"); return ret; @@ -245,7 +245,7 @@ static void wilc_sdio_disable_interrupt(struct wilc *dev) * / -static int sdio_set_func0_csa_address(struct wilc *wilc, u32 adr) +static int wilc_sdio_set_func0_csa_address(struct wilc *wilc, u32 adr) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); struct sdio_cmd52 cmd; @@ -286,7 +286,7 @@ static int sdio_set_func0_csa_address(struct wilc *wilc, u32 adr) return 0; } -static int sdio_set_func0_block_size(struct wilc *wilc, u32 block_size) +static int wilc_sdio_set_func0_block_size(struct wilc *wilc, u32 block_size) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); struct sdio_cmd52 cmd; @@ -322,7 +322,7 @@ static int sdio_set_func0_block_size(struct wilc *wilc, u32 block_size) * / -static int sdio_set_func1_block_size(struct wilc *wilc, u32 block_size) +static int wilc_sdio_set_func1_block_size(struct wilc *wilc, u32 block_size) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); struct sdio_cmd52 cmd; @@ -356,7 +356,7 @@ static int sdio_set_func1_block_size(struct wilc *wilc, u32 block_size) * Sdio interfaces * / -static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data) +static int wilc_sdio_write_reg(struct wilc *wilc, u32 addr, u32 data) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); struct wilc_sdio *sdio_priv = wilc->bus_data; @@ -384,7 +384,7 @@ static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data) /** * set the AHB address **/ - if (!sdio_set_func0_csa_address(wilc, addr)) + if (!wilc_sdio_set_func0_csa_address(wilc, addr)) goto fail; cmd.read_write = 1; @@ -410,7 +410,7 @@ static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data) return 0; } -static int sdio_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size) +static int wilc_sdio_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); struct wilc_sdio *sdio_priv = wilc->bus_data; @@ -459,7 +459,7 @@ static int sdio_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size) cmd.buffer = buf; cmd.block_size = block_size; if (addr > 0) { - if (!sdio_set_func0_csa_address(wilc, addr)) + if (!wilc_sdio_set_func0_csa_address(wilc, addr)) goto fail; } ret = wilc_sdio_cmd53(wilc, &cmd); @@ -482,7 +482,7 @@ static int sdio_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size) cmd.block_size = block_size; if (addr > 0) { - if (!sdio_set_func0_csa_address(wilc, addr)) + if (!wilc_sdio_set_func0_csa_address(wilc, addr)) goto fail; } ret = wilc_sdio_cmd53(wilc, &cmd); @@ -500,7 +500,7 @@ static int sdio_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size) return 0; } -static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data) +static int wilc_sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data) { struct sdio_func *func = dev_to_sdio_func(wilc->dev); struct wilc_sdio *sdio_priv = wilc->bus_data; @@ -523,7 +523,7 @@ static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data) } else { struct sdio_cmd53 cmd; - if (!sdio_set_func0_csa_address(wilc, addr)) + if (!wilc_sdio_set_func0_csa_address(wilc, addr)) goto fail; cmd.read_write = 0; @@ -552,7 +552,7 @@ static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data) return 0
[PATCH v2 3/8] staging: wilc1000: move macro and function prototype from wilc_wlan_if.h file
From: Ajay Singh Move data structure and function prototype from 'wilc_wlan_if.h file. Now, this file contains constant specific to the firmware. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 1 + drivers/staging/wilc1000/host_interface.h | 11 ++ drivers/staging/wilc1000/linux_wlan.c | 2 ++ drivers/staging/wilc1000/wilc_wlan.h | 9 drivers/staging/wilc1000/wilc_wlan_if.h | 36 --- 5 files changed, 23 insertions(+), 36 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 9abe341..50dc2dd 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -10,6 +10,7 @@ #define WILC_HIF_CONNECT_TIMEOUT_MS 9500 #define WILC_FALSE_FRMWR_CHANNEL 100 +#define WILC_MAX_RATES_SUPPORTED 12 struct wilc_rcvd_mac_info { u8 status; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index a007625..678e623 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -97,6 +97,17 @@ enum conn_event { CONN_DISCONN_EVENT_FORCE_32BIT = 0x }; +enum { + WILC_HIF_SDIO = 0, + WILC_HIF_SPI = BIT(0) +}; + +enum { + WILC_MAC_STATUS_INIT = -1, + WILC_MAC_STATUS_DISCONNECTED = 0, + WILC_MAC_STATUS_CONNECTED = 1 +}; + struct wilc_rcvd_net_info { s8 rssi; u8 ch; diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index f3e52af..1ebf2b8 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -12,6 +12,8 @@ #include "wilc_wfi_cfgoperations.h" +#define WILC_MULTICAST_TABLE_SIZE 8 + static irqreturn_t isr_uh_routine(int irq, void *user_data) { struct net_device *dev = user_data; diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index d8fabe8..1a27f62 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -250,6 +250,13 @@ struct wilc_hif_func { #define WILC_MAX_CFG_FRAME_SIZE1468 +struct tx_complete_data { + int size; + void *buff; + u8 *bssid; + struct sk_buff *skb; +}; + struct wilc_cfg_cmd_hdr { u8 cmd_type; u8 seq_no; @@ -301,4 +308,6 @@ void chip_allow_sleep(struct wilc *wilc); void chip_wakeup(struct wilc *wilc); int wilc_send_config_pkt(struct wilc_vif *vif, u8 mode, struct wid *wids, u32 count, u32 drv); +int wilc_wlan_init(struct net_device *dev); +u32 wilc_get_chipid(struct wilc *wilc, bool update); #endif diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 9b8cce8..b15de36 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -11,41 +11,9 @@ / * - * Host Interface Defines - * - / - -enum { - WILC_HIF_SDIO = 0, - WILC_HIF_SPI = BIT(0) -}; - -/ - * - * Wlan Interface Defines - * - / - -enum { - WILC_MAC_STATUS_INIT = -1, - WILC_MAC_STATUS_DISCONNECTED = 0, - WILC_MAC_STATUS_CONNECTED = 1 -}; - -struct tx_complete_data { - int size; - void *buff; - u8 *bssid; - struct sk_buff *skb; -}; - -/ - * * Wlan Configuration ID * / -#define WILC_MULTICAST_TABLE_SIZE 8 -#define WILC_MAX_RATES_SUPPORTED 12 enum bss_types { WILC_FW_BSS_TYPE_INFRA = 0, @@ -832,8 +800,4 @@ enum { WID_MAX = 0x }; -struct wilc; -int wilc_wlan_init(struct net_device *dev); -u32 wilc_get_chipid(struct wilc *wilc, bool update); - #endif -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/8] staging: wilc1000: fix to set correct value for 'vif_num'
From: Ajay Singh Set correct value in '->vif_num' for the total number of interfaces and set '->idx' value using 'i'. Fixes: 735bb39ca3be ("staging: wilc1000: simplify vif[i]->ndev accesses") Fixes: 0e490657c721 ("staging: wilc1000: Fix problem with wrong vif index") Cc: Suggested-by: Dan Carpenter Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index f096f9e..f3e52af 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1020,8 +1020,8 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, vif->wilc = *wilc; vif->ndev = ndev; wl->vif[i] = vif; - wl->vif_num = i; - vif->idx = wl->vif_num; + wl->vif_num = i + 1; + vif->idx = i; ndev->netdev_ops = &wilc_netdev_ops; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/8] staging: wilc1000: fixes & changes for mainline review comments
From: Ajay Singh This series contains the following changes: - fix to set 'vif_num' value correctly. - use 'wilc_' prefix for variables and function names. - avoid use of unnecessary 'linux_' prefix from file names. Changes since v1: - merged patch 1 & 2 and added modification as suggested by Dan. Ajay Singh (8): staging: wilc1000: fix to set correct value for 'vif_num' staging: wilc1000: add 'wilc_' prefix to have proper namespace staging: wilc1000: move macro and function prototype from wilc_wlan_if.h file staging: wilc1000: avoid function forward declaration in wilc_sdio.c file staging: wilc1000: added 'wilc_' prefix for function in wilc_sdio.c file staging: wilc1000: rename wilc_frmw_to_linux() staging: wilc1000: remove 'linux_' prefix in function names staging: wilc1000: rename linux_wlan.c and linux_mon.c drivers/staging/wilc1000/Makefile | 2 +- drivers/staging/wilc1000/host_interface.c | 55 +++--- drivers/staging/wilc1000/host_interface.h | 23 ++- .../staging/wilc1000/{linux_mon.c => wilc_mon.c} | 0 .../wilc1000/{linux_wlan.c => wilc_netdev.c} | 26 +-- drivers/staging/wilc1000/wilc_sdio.c | 187 ++--- drivers/staging/wilc1000/wilc_spi.c| 4 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 22 +-- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 13 +- drivers/staging/wilc1000/wilc_wlan.h | 17 +- drivers/staging/wilc1000/wilc_wlan_cfg.c | 12 +- drivers/staging/wilc1000/wilc_wlan_if.h| 36 13 files changed, 190 insertions(+), 209 deletions(-) rename drivers/staging/wilc1000/{linux_mon.c => wilc_mon.c} (100%) rename drivers/staging/wilc1000/{linux_wlan.c => wilc_netdev.c} (97%) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 4/8] staging: wilc1000: avoid function forward declaration in wilc_sdio.c file
From: Ajay Singh Cleanup patch to avoid function forward declaration by reordering the function. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_sdio.c | 91 +--- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index e2f739f..a62eabe 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -51,10 +51,6 @@ struct sdio_cmd53 { static const struct wilc_hif_func wilc_hif_sdio; -static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data); -static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data); -static int sdio_init(struct wilc *wilc, bool resume); - static void wilc_sdio_interrupt(struct sdio_func *func) { sdio_release_host(func); @@ -215,50 +211,6 @@ static int wilc_sdio_suspend(struct device *dev) return 0; } -static int wilc_sdio_resume(struct device *dev) -{ - struct sdio_func *func = dev_to_sdio_func(dev); - struct wilc *wilc = sdio_get_drvdata(func); - - dev_info(dev, "sdio resume\n"); - sdio_release_host(func); - chip_wakeup(wilc); - sdio_init(wilc, true); - - if (wilc->suspend_event) - host_wakeup_notify(wilc); - - chip_allow_sleep(wilc); - - return 0; -} - -static const struct of_device_id wilc_of_match[] = { - { .compatible = "microchip,wilc1000-sdio", }, - { /* sentinel */ } -}; -MODULE_DEVICE_TABLE(of, wilc_of_match); - -static const struct dev_pm_ops wilc_sdio_pm_ops = { - .suspend = wilc_sdio_suspend, - .resume = wilc_sdio_resume, -}; - -static struct sdio_driver wilc_sdio_driver = { - .name = SDIO_MODALIAS, - .id_table = wilc_sdio_ids, - .probe = linux_sdio_probe, - .remove = linux_sdio_remove, - .drv = { - .pm = &wilc_sdio_pm_ops, - .of_match_table = wilc_of_match, - } -}; -module_driver(wilc_sdio_driver, - sdio_register_driver, - sdio_unregister_driver); -MODULE_LICENSE("GPL"); - static int wilc_sdio_enable_interrupt(struct wilc *dev) { struct sdio_func *func = container_of(dev->dev, struct sdio_func, dev); @@ -1143,3 +1095,46 @@ static const struct wilc_hif_func wilc_hif_sdio = { .disable_interrupt = wilc_sdio_disable_interrupt, }; +static int wilc_sdio_resume(struct device *dev) +{ + struct sdio_func *func = dev_to_sdio_func(dev); + struct wilc *wilc = sdio_get_drvdata(func); + + dev_info(dev, "sdio resume\n"); + sdio_release_host(func); + chip_wakeup(wilc); + sdio_init(wilc, true); + + if (wilc->suspend_event) + host_wakeup_notify(wilc); + + chip_allow_sleep(wilc); + + return 0; +} + +static const struct of_device_id wilc_of_match[] = { + { .compatible = "microchip,wilc1000-sdio", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, wilc_of_match); + +static const struct dev_pm_ops wilc_sdio_pm_ops = { + .suspend = wilc_sdio_suspend, + .resume = wilc_sdio_resume, +}; + +static struct sdio_driver wilc_sdio_driver = { + .name = SDIO_MODALIAS, + .id_table = wilc_sdio_ids, + .probe = linux_sdio_probe, + .remove = linux_sdio_remove, + .drv = { + .pm = &wilc_sdio_pm_ops, + .of_match_table = wilc_of_match, + } +}; +module_driver(wilc_sdio_driver, + sdio_register_driver, + sdio_unregister_driver); +MODULE_LICENSE("GPL"); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/8] staging: wilc1000: add 'wilc_' prefix to have proper namespace
From: Ajay Singh Cleanup patch to rename data structure and function name to have 'wilc_' prefix. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 54 +++ drivers/staging/wilc1000/host_interface.h | 12 ++--- drivers/staging/wilc1000/wilc_spi.c | 4 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 22 - drivers/staging/wilc1000/wilc_wlan.c | 8 ++-- drivers/staging/wilc1000/wilc_wlan.h | 8 ++-- drivers/staging/wilc1000/wilc_wlan_cfg.c | 12 ++--- drivers/staging/wilc1000/wilc_wlan_if.h | 2 +- 8 files changed, 61 insertions(+), 61 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 0fb6ca3..9abe341 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -9,7 +9,7 @@ #define WILC_HIF_SCAN_TIMEOUT_MS4000 #define WILC_HIF_CONNECT_TIMEOUT_MS 9500 -#define FALSE_FRMWR_CHANNEL100 +#define WILC_FALSE_FRMWR_CHANNEL 100 struct wilc_rcvd_mac_info { u8 status; @@ -21,7 +21,7 @@ struct wilc_set_multicast { u8 *mc_list; }; -struct del_all_sta { +struct wilc_del_all_sta { u8 assoc_sta; u8 mac[WILC_MAX_NUM_STA][ETH_ALEN]; }; @@ -68,16 +68,16 @@ struct wilc_gtk_key { u8 key[0]; } __packed; -union message_body { +union wilc_message_body { struct wilc_rcvd_net_info net_info; struct wilc_rcvd_mac_info mac_info; struct wilc_set_multicast mc_info; - struct remain_ch remain_on_ch; + struct wilc_remain_ch remain_on_ch; char *data; }; struct host_if_msg { - union message_body body; + union wilc_message_body body; struct wilc_vif *vif; struct work_struct work; void (*fn)(struct work_struct *ws); @@ -110,7 +110,7 @@ struct wilc_join_bss_param { u8 bssid[ETH_ALEN]; __le16 beacon_period; u8 dtim_period; - u8 supp_rates[MAX_RATES_SUPPORTED + 1]; + u8 supp_rates[WILC_MAX_RATES_SUPPORTED + 1]; u8 wmm_cap; u8 uapsd_cap; u8 ht_capable; @@ -195,7 +195,7 @@ static int handle_scan_done(struct wilc_vif *vif, enum scan_event evt) u8 abort_running_scan; struct wid wid; struct host_if_drv *hif_drv = vif->hif_drv; - struct user_scan_req *scan_req; + struct wilc_user_scan_req *scan_req; if (evt == SCAN_EVENT_ABORTED) { abort_running_scan = 1; @@ -475,8 +475,8 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss, supp_rates_ie = cfg80211_find_ie(WLAN_EID_EXT_SUPP_RATES, ies->data, ies->len); if (supp_rates_ie) { - if (supp_rates_ie[1] > (MAX_RATES_SUPPORTED - rates_len)) - param->supp_rates[0] = MAX_RATES_SUPPORTED; + if (supp_rates_ie[1] > (WILC_MAX_RATES_SUPPORTED - rates_len)) + param->supp_rates[0] = WILC_MAX_RATES_SUPPORTED; else param->supp_rates[0] += supp_rates_ie[1]; @@ -563,7 +563,7 @@ static void handle_rcvd_ntwrk_info(struct work_struct *work) { struct host_if_msg *msg = container_of(work, struct host_if_msg, work); struct wilc_rcvd_net_info *rcvd_info = &msg->body.net_info; - struct user_scan_req *scan_req = &msg->vif->hif_drv->usr_scan_req; + struct wilc_user_scan_req *scan_req = &msg->vif->hif_drv->usr_scan_req; const u8 *ch_elm; u8 *ies; int ies_len; @@ -758,7 +758,7 @@ int wilc_disconnect(struct wilc_vif *vif) { struct wid wid; struct host_if_drv *hif_drv = vif->hif_drv; - struct user_scan_req *scan_req; + struct wilc_user_scan_req *scan_req; struct wilc_conn_info *conn_info; int result; u16 dummy_reason_code = 0; @@ -911,7 +911,7 @@ static void wilc_hif_pack_sta_param(u8 *cur_byte, const u8 *mac, } static int handle_remain_on_chan(struct wilc_vif *vif, -struct remain_ch *hif_remain_ch) +struct wilc_remain_ch *hif_remain_ch) { int result; u8 remain_on_chan_flag; @@ -957,7 +957,7 @@ static void handle_listen_state_expired(struct work_struct *work) { struct host_if_msg *msg = container_of(work, struct host_if_msg, work); struct wilc_vif *vif = msg->vif; - struct remain_ch *hif_remain_ch = &msg->body.remain_on_ch; + struct wilc_remain_ch *hif_remain_ch = &msg->body.remain_on_ch; u8 remain_on_chan_flag; struct wid wid; int result; @@ -975,7 +975,7 @@ static void handle_listen_state_expired(struct work_struct *work) goto free_msg; wid.val[0] = remain_on_chan_flag; - wid.val[1] = FALSE_FRMWR_
Re: [PATCH v2 1/8] staging: wilc1000: fix to set correct value for 'vif_num'
Thanks so much! Reviewed-by: Dan Carpenter regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: android: formatting change in ashmem.c
On Tue, Feb 05, 2019 at 11:53:54PM -0500, K Hodges wrote: > Resolved "Line over 80 characters" warning from checkpatch > > Signed-off-by: K Hodges We need a "full" name here, unless you really do sign legal documents with just "K"? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: wlan-ng: formatting change in cfg80211.c
On Tue, Feb 05, 2019 at 05:49:03AM -0500, K Hodges wrote: > Resolve "Line over 80 characters" warning from checkpatch > > Signed-off-by: K Hodges Same name question here. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 3/8] staging: wilc1000: move macro and function prototype from wilc_wlan_if.h file
On 07.02.2019 13:29, ajay.kat...@microchip.com wrote: > From: Ajay Singh > > Move data structure and function prototype from 'wilc_wlan_if.h file. > Now, this file contains constant specific to the firmware. > > Signed-off-by: Ajay Singh > --- > drivers/staging/wilc1000/host_interface.c | 1 + > drivers/staging/wilc1000/host_interface.h | 11 ++ > drivers/staging/wilc1000/linux_wlan.c | 2 ++ > drivers/staging/wilc1000/wilc_wlan.h | 9 > drivers/staging/wilc1000/wilc_wlan_if.h | 36 > --- > 5 files changed, 23 insertions(+), 36 deletions(-) > > diff --git a/drivers/staging/wilc1000/host_interface.c > b/drivers/staging/wilc1000/host_interface.c > index 9abe341..50dc2dd 100644 > --- a/drivers/staging/wilc1000/host_interface.c > +++ b/drivers/staging/wilc1000/host_interface.c > @@ -10,6 +10,7 @@ > #define WILC_HIF_CONNECT_TIMEOUT_MS 9500 > > #define WILC_FALSE_FRMWR_CHANNEL 100 > +#define WILC_MAX_RATES_SUPPORTED 12 > > struct wilc_rcvd_mac_info { > u8 status; > diff --git a/drivers/staging/wilc1000/host_interface.h > b/drivers/staging/wilc1000/host_interface.h > index a007625..678e623 100644 > --- a/drivers/staging/wilc1000/host_interface.h > +++ b/drivers/staging/wilc1000/host_interface.h > @@ -97,6 +97,17 @@ enum conn_event { > CONN_DISCONN_EVENT_FORCE_32BIT = 0x > }; > > +enum { > + WILC_HIF_SDIO = 0, > + WILC_HIF_SPI = BIT(0) BIT(0)=1, so you can remove it and use simply: enum { WILC_HIF_SDIO, WILC_HIF_SPI, }; > +}; > + > +enum { > + WILC_MAC_STATUS_INIT = -1, > + WILC_MAC_STATUS_DISCONNECTED = 0, > + WILC_MAC_STATUS_CONNECTED = 1 > +}; > + > struct wilc_rcvd_net_info { > s8 rssi; > u8 ch; > diff --git a/drivers/staging/wilc1000/linux_wlan.c > b/drivers/staging/wilc1000/linux_wlan.c > index f3e52af..1ebf2b8 100644 > --- a/drivers/staging/wilc1000/linux_wlan.c > +++ b/drivers/staging/wilc1000/linux_wlan.c > @@ -12,6 +12,8 @@ > > #include "wilc_wfi_cfgoperations.h" > > +#define WILC_MULTICAST_TABLE_SIZE8 > + > static irqreturn_t isr_uh_routine(int irq, void *user_data) > { > struct net_device *dev = user_data; > diff --git a/drivers/staging/wilc1000/wilc_wlan.h > b/drivers/staging/wilc1000/wilc_wlan.h > index d8fabe8..1a27f62 100644 > --- a/drivers/staging/wilc1000/wilc_wlan.h > +++ b/drivers/staging/wilc1000/wilc_wlan.h > @@ -250,6 +250,13 @@ struct wilc_hif_func { > > #define WILC_MAX_CFG_FRAME_SIZE 1468 > > +struct tx_complete_data { > + int size; > + void *buff; > + u8 *bssid; > + struct sk_buff *skb; > +}; > + > struct wilc_cfg_cmd_hdr { > u8 cmd_type; > u8 seq_no; > @@ -301,4 +308,6 @@ void chip_allow_sleep(struct wilc *wilc); > void chip_wakeup(struct wilc *wilc); > int wilc_send_config_pkt(struct wilc_vif *vif, u8 mode, struct wid *wids, >u32 count, u32 drv); > +int wilc_wlan_init(struct net_device *dev); > +u32 wilc_get_chipid(struct wilc *wilc, bool update); > #endif > diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h > b/drivers/staging/wilc1000/wilc_wlan_if.h > index 9b8cce8..b15de36 100644 > --- a/drivers/staging/wilc1000/wilc_wlan_if.h > +++ b/drivers/staging/wilc1000/wilc_wlan_if.h > @@ -11,41 +11,9 @@ > > / > * > - * Host Interface Defines > - * > - / > - > -enum { > - WILC_HIF_SDIO = 0, > - WILC_HIF_SPI = BIT(0) > -}; > - > -/ > - * > - * Wlan Interface Defines > - * > - / > - > -enum { > - WILC_MAC_STATUS_INIT = -1, > - WILC_MAC_STATUS_DISCONNECTED = 0, > - WILC_MAC_STATUS_CONNECTED = 1 > -}; > - > -struct tx_complete_data { > - int size; > - void *buff; > - u8 *bssid; > - struct sk_buff *skb; > -}; > - > -/ > - * > * Wlan Configuration ID > * > / > -#define WILC_MULTICAST_TABLE_SIZE8 > -#define WILC_MAX_RATES_SUPPORTED 12 > > enum bss_types { > WILC_FW_BSS_TYPE_INFRA = 0, > @@ -832,8 +800,4 @@ enum { > WID_MAX = 0x > }; > > -struct wilc; > -int wilc_wlan_init(struct net_device *dev); > -u32 wilc_get_chipid(struct wilc *wilc, bool update); > - > #endif > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/3] sched/wait: use freezable_schedule when possible
Hi, > > The result is a potential performance gain during freeze, since less > > tasks have to be awaken. > > I'm curious did you try the freezing process and see if pointless wakeups are > reduced? That would be an added bonus if you did. Test env: fresh Debian QEMU vm with 4.19 stable kernel. Test process: - Added two debug logs to freeze_task: bool freeze_task(struct task_struct *p) { unsigned long flags; [snip] pr_info("freezing a task"); [snip] if (freezer_should_skip(p)) { pr_info("skeeping a task"); return false; } [snip] } - Triggered manual freeze: # echo freezer > /sys/power/pm_test # echo test_resume > /sys/power/disk # echo disk > /sys/power/state - grep -c to get the number of "freezing a task" and "skeeping a task" lines in kern.log. Results: Without my patch: 448 calls freeze_task, 12 skipped. With my patch: 448 calls, 32 skipped. 2.6x more tasks skipped. Not sure this is the best way to test this patch, though. Any advice? regards, Hugo -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/3] sched/wait: use freezable_schedule when possible
On Thu, Feb 07, 2019 at 12:30:50AM +0100, Hugo Lefeuvre wrote: > Hi Joel, > > > I'm curious did you try the freezing process and see if pointless wakeups > > are > > reduced? That would be an added bonus if you did. > > I'm currently testing these changes. I hope to be able to come back with > more concrete results soon. > > Also, I just noticed that the third patch removes a necessary #include > . I will submit an updated version tomorrow. > > Thanks for the review! Sure, add these test results to the patch as well showing reduced wakeups. I would say submit the freezable_schedule as a single separate patch independent of the vsoc series since it can go in separately, and also benefits other things than vsoc. Also CC Rafael (power maintainer) on it. Thank you! - Joel ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V3 1/3] x86/Hyper-V: Set x2apic destination mode to physical when x2apic is available
From: Lan Tianyu Hyper-V doesn't provide irq remapping for IO-APIC. To enable x2apic, set x2apic destination mode to physcial mode when x2apic is available and Hyper-V IOMMU driver makes sure cpus assigned with IO-APIC irqs have 8-bit APIC id. Signed-off-by: Lan Tianyu --- Change since v2: - Fix compile error due to x2apic_phys - Fix comment indent Change since v1: - Remove redundant extern for x2apic_phys --- arch/x86/kernel/cpu/mshyperv.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index e81a2db..0c29e4e 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -328,6 +328,16 @@ static void __init ms_hyperv_init_platform(void) # ifdef CONFIG_SMP smp_ops.smp_prepare_boot_cpu = hv_smp_prepare_boot_cpu; # endif + + /* +* Hyper-V doesn't provide irq remapping for IO-APIC. To enable x2apic, +* set x2apic destination mode to physcial mode when x2apic is available +* and Hyper-V IOMMU driver makes sure cpus assigned with IO-APIC irqs +* have 8-bit APIC id. +*/ + if (IS_ENABLED(CONFIG_X86_X2APIC) && x2apic_supported()) + x2apic_phys = 1; + #endif } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V3 0/3] x86/Hyper-V/IOMMU: Add Hyper-V IOMMU driver to support x2apic mode
From: Lan Tianyu On the bare metal, enabling X2APIC mode requires interrupt remapping function which helps to deliver irq to cpu with 32-bit APIC ID. Hyper-V doesn't provide interrupt remapping function so far and Hyper-V MSI protocol already supports to deliver interrupt to the CPU whose virtual processor index is more than 255. IO-APIC interrupt still has 8-bit APIC ID limitation. This patchset is to add Hyper-V stub IOMMU driver in order to enable X2APIC mode successfully in Hyper-V Linux guest. The driver returns X2APIC interrupt remapping capability when X2APIC mode is available. X2APIC destination mode is set to physical by PATCH 1 when X2APIC is available. Hyper-V IOMMU driver will scan cpu 0~255 and set cpu into IO-APIC MAX cpu affinity cpumask if its APIC ID is 8-bit. Driver creates a Hyper-V irq domain to limit IO-APIC interrupts' affinity and make sure cpus assigned with IO-APIC interrupt are in the scope of IO-APIC MAX cpu affinity. Lan Tianyu (3): x86/Hyper-V: Set x2apic destination mode to physical when x2apic is available HYPERV/IOMMU: Add Hyper-V stub IOMMU driver MAINTAINERS: Add Hyper-V IOMMU driver into Hyper-V CORE AND DRIVERS scope MAINTAINERS| 1 + arch/x86/kernel/cpu/mshyperv.c | 10 +++ drivers/iommu/Kconfig | 8 ++ drivers/iommu/Makefile | 1 + drivers/iommu/hyperv-iommu.c | 194 + drivers/iommu/irq_remapping.c | 3 + drivers/iommu/irq_remapping.h | 1 + 7 files changed, 218 insertions(+) create mode 100644 drivers/iommu/hyperv-iommu.c -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Linaro-mm-sig] [PATCH 2/4] staging: android: ion: Restrict cache maintenance to dma mapped memory
On Wed, Feb 06, 2019 at 11:31:04PM -0800, Christoph Hellwig wrote: > The CPU may only access DMA mapped memory if ownership has been > transferred back to the CPU using dma_sync_{single,sg}_to_cpu, and then > before the device can access it again ownership needs to be transferred > back to the device using dma_sync_{single,sg}_to_device. > > > I've run some testing, and this patch does indeed fix the crash in > > dma_sync_sg_for_cpu when it tried to use the 0 dma_address from the sg > > list. > > > > Tested-by: Ørjan Eide > > > > I tested this on an older kernel, v4.14, since the dma-mapping code > > moved, in v4.19, to ignore the dma_address and instead use sg_phys() to > > get a valid address from the page, which is always valid in the ion sg > > lists. While this wouldn't crash on newer kernels, it's still good to > > avoid the unnecessary work when no CMO is needed. > > Can you also test is with CONFIG_DMA_API_DEBUG enabled, as that should > catch all the usual mistakes in DMA API usage, including the one found? I checked again with CONFIG_DMA_API_DEBUG=y, both with and without this patch, and I didn't get any dma-mapping errors. The issue I hit, without this patch, is when a CPU access starts after a device have attached, which caused ion to create a copy of the buffer's sg list with dma_address zeroed, but before the device have mapped the buffer. -- Ørjan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] PCI: hv: Add hv_pci_remove_slots() when we unload the driver
When we unload pci-hyperv, the host doesn't send us a PCI_EJECT message. In this case we also need to make sure the sysfs pci slot directory is removed, otherwise "cat /sys/bus/pci/slots/2/address" will trigger "BUG: unable to handle kernel paging request". And, if we unload/reload the driver several times, we'll have multiple pci slot directories in /sys/bus/pci/slots/ like this: root@localhost:~# ls -rtl /sys/bus/pci/slots/ total 0 drwxr-xr-x 2 root root 0 Feb 7 10:49 2 drwxr-xr-x 2 root root 0 Feb 7 10:49 2-1 drwxr-xr-x 2 root root 0 Feb 7 10:51 2-2 The patch adds the missing code, and in hv_eject_device_work() it also moves pci_destroy_slot() to an earlier place where we hold the pci lock. Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot information") Signed-off-by: Dexuan Cui Cc: sta...@vger.kernel.org Cc: Stephen Hemminger --- drivers/pci/controller/pci-hyperv.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 9ba4d12c179c..6b4773727525 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -1491,6 +1491,21 @@ static void hv_pci_assign_slots(struct hv_pcibus_device *hbus) } } +/* + * Remove entries in sysfs pci slot directory. + */ +static void hv_pci_remove_slots(struct hv_pcibus_device *hbus) +{ + struct hv_pci_dev *hpdev; + + list_for_each_entry(hpdev, &hbus->children, list_entry) { + if (!hpdev->pci_slot) + continue; + pci_destroy_slot(hpdev->pci_slot); + hpdev->pci_slot = NULL; + } +} + /** * create_root_hv_pci_bus() - Expose a new root PCI bus * @hbus: Root PCI bus, as understood by this driver @@ -1887,6 +1902,10 @@ static void hv_eject_device_work(struct work_struct *work) pci_lock_rescan_remove(); pci_stop_and_remove_bus_device(pdev); pci_dev_put(pdev); + if (hpdev->pci_slot) { + pci_destroy_slot(hpdev->pci_slot); + hpdev->pci_slot = NULL; + } pci_unlock_rescan_remove(); } @@ -1894,9 +1913,6 @@ static void hv_eject_device_work(struct work_struct *work) list_del(&hpdev->list_entry); spin_unlock_irqrestore(&hpdev->hbus->device_list_lock, flags); - if (hpdev->pci_slot) - pci_destroy_slot(hpdev->pci_slot); - memset(&ctxt, 0, sizeof(ctxt)); ejct_pkt = (struct pci_eject_response *)&ctxt.pkt.message; ejct_pkt->message_type.type = PCI_EJECTION_COMPLETE; @@ -2682,6 +2698,7 @@ static int hv_pci_remove(struct hv_device *hdev) pci_lock_rescan_remove(); pci_stop_root_bus(hbus->pci_bus); pci_remove_root_bus(hbus->pci_bus); + hv_pci_remove_slots(hbus); pci_unlock_rescan_remove(); hbus->state = hv_pcibus_removed; } -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[driver-core:debugfs_cleanup 124/124] drivers/platform/x86/intel_pmc_core.c:721:2: warning: 'return' with a value, in function returning void
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git debugfs_cleanup head: 3ec9bc11e2cea5023fd7bda21dd0c942f4a67b67 commit: 3ec9bc11e2cea5023fd7bda21dd0c942f4a67b67 [124/124] platform/x86: fix changelog config: i386-randconfig-a2-201905 (attached as .config) compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4 reproduce: git checkout 3ec9bc11e2cea5023fd7bda21dd0c942f4a67b67 # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): drivers/platform/x86/intel_pmc_core.c: In function 'pmc_core_dbgfs_register': >> drivers/platform/x86/intel_pmc_core.c:721:2: warning: 'return' with a value, >> in function returning void return 0; ^ drivers/platform/x86/intel_pmc_core.c: In function 'pmc_core_probe': drivers/platform/x86/intel_pmc_core.c:754:6: warning: unused variable 'err' [-Wunused-variable] int err; ^ vim +/return +721 drivers/platform/x86/intel_pmc_core.c b740d2e9 Rajneesh Bhardwaj 2016-05-26 684 3ec9bc11 Greg Kroah-Hartman 2019-02-07 685 static void pmc_core_dbgfs_register(struct pmc_dev *pmcdev) b740d2e9 Rajneesh Bhardwaj 2016-05-26 686 { 750e0f57 Rajneesh Bhardwaj 2018-01-19 687 struct dentry *dir; b740d2e9 Rajneesh Bhardwaj 2016-05-26 688 b740d2e9 Rajneesh Bhardwaj 2016-05-26 689 dir = debugfs_create_dir("pmc_core", NULL); b740d2e9 Rajneesh Bhardwaj 2016-05-26 690 pmcdev->dbgfs_dir = dir; 9c2ee199 Rajneesh Bhardwaj 2016-10-07 691 750e0f57 Rajneesh Bhardwaj 2018-01-19 692 debugfs_create_file("slp_s0_residency_usec", 0444, dir, pmcdev, 750e0f57 Rajneesh Bhardwaj 2018-01-19 693 &pmc_core_dev_state); 750e0f57 Rajneesh Bhardwaj 2018-01-19 694 750e0f57 Rajneesh Bhardwaj 2018-01-19 695 debugfs_create_file("pch_ip_power_gating_status", 0444, dir, pmcdev, 3b1f9955 Yangtao Li 2018-12-05 696 &pmc_core_ppfear_fops); 750e0f57 Rajneesh Bhardwaj 2018-01-19 697 750e0f57 Rajneesh Bhardwaj 2018-01-19 698 debugfs_create_file("ltr_ignore", 0644, dir, pmcdev, 9c2ee199 Rajneesh Bhardwaj 2016-10-07 699 &pmc_core_ltr_ignore_ops); 9c2ee199 Rajneesh Bhardwaj 2016-10-07 700 2eb15055 Rajneesh Bhardwaj 2018-11-09 701 debugfs_create_file("ltr_show", 0644, dir, pmcdev, &pmc_core_ltr_fops); 2eb15055 Rajneesh Bhardwaj 2018-11-09 702 750e0f57 Rajneesh Bhardwaj 2018-01-19 703 if (pmcdev->map->pll_sts) 750e0f57 Rajneesh Bhardwaj 2018-01-19 704 debugfs_create_file("pll_status", 0444, dir, pmcdev, 3b1f9955 Yangtao Li 2018-12-05 705 &pmc_core_pll_fops); 750e0f57 Rajneesh Bhardwaj 2018-01-19 706 750e0f57 Rajneesh Bhardwaj 2018-01-19 707 if (pmcdev->map->mphy_sts) 750e0f57 Rajneesh Bhardwaj 2018-01-19 708 debugfs_create_file("mphy_core_lanes_power_gating_status", 750e0f57 Rajneesh Bhardwaj 2018-01-19 709 0444, dir, pmcdev, 3b1f9955 Yangtao Li 2018-12-05 710 &pmc_core_mphy_pg_fops); 0bdfaf42 Rajneesh Bhardwaj 2016-10-07 711 4cf2afd6 Box, David E 2018-06-08 712 if (pmcdev->map->slps0_dbg_maps) { 4cf2afd6 Box, David E 2018-06-08 713 debugfs_create_file("slp_s0_debug_status", 0444, 4cf2afd6 Box, David E 2018-06-08 714 dir, pmcdev, 4cf2afd6 Box, David E 2018-06-08 715 &pmc_core_slps0_dbg_fops); 4cf2afd6 Box, David E 2018-06-08 716 4cf2afd6 Box, David E 2018-06-08 717 debugfs_create_bool("slp_s0_dbg_latch", 0644, 4cf2afd6 Box, David E 2018-06-08 718 dir, &slps0_dbg_latch); 4cf2afd6 Box, David E 2018-06-08 719 } 4cf2afd6 Box, David E 2018-06-08 720 fe748227 Rajneesh Bhardwaj 2016-10-07 @721 return 0; b740d2e9 Rajneesh Bhardwaj 2016-05-26 722 } 0bdfaf42 Rajneesh Bhardwaj 2016-10-07 723 #else 0bdfaf42 Rajneesh Bhardwaj 2016-10-07 724 static inline int pmc_core_dbgfs_register(struct pmc_dev *pmcdev) 0bdfaf42 Rajneesh Bhardwaj 2016-10-07 725 { b740d2e9 Rajneesh Bhardwaj 2016-05-26 726 } b740d2e9 Rajneesh Bhardwaj 2016-05-26 727 :: The code at line 721 was first introduced by commit :: fe748227570107abaa4767c39be3eff934bdaf5c platform/x86: intel_pmc_core: Add MPHY PLL clock gating status :: TO: Rajneesh Bhardwaj :: CC: Darren Hart --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/2] sched/wait, staging/android: simplification of freeze related code
This patchset introduces a new wait_event_freezable_hrtimeout method to the wait api. wait_event_freezable_hrtimeout is then used to greatly simplify handle_vsoc_cond_wait in the android vsoc driver, reducing the size of the vsoc driver. Changes since v1 [1]: - Delete "[1/3] sched/wait: use freezable_schedule when possible", it was submitted separately. - Patch 3/3 (now 2/2): Fix removal of a necessary linux/freezer.h include and improve commit message. [1] v1: https://lkml.org/lkml/2019/2/1/19 Hugo Lefeuvre (2): sched/wait: introduce wait_event_freezable_hrtimeout staging/android: simplify handle_vsoc_cond_wait drivers/staging/android/vsoc.c | 68 +- include/linux/wait.h | 25 +++-- 2 files changed, 31 insertions(+), 62 deletions(-) -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] sched/wait: introduce wait_event_freezable_hrtimeout
introduce wait_event_freezable_hrtimeout, an interruptible and freezable version of wait_event_hrtimeout. This helper will allow for simplifications in staging/android/vsoc.c, among others. Signed-off-by: Hugo Lefeuvre --- Changes in v2: - No change. include/linux/wait.h | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/include/linux/wait.h b/include/linux/wait.h index 5f3efabc36f4..c4cf5113f58a 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -483,7 +483,7 @@ do { \ __ret; \ }) -#define __wait_event_hrtimeout(wq_head, condition, timeout, state) \ +#define __wait_event_hrtimeout(wq_head, condition, timeout, state, cmd) \ ({ \ int __ret = 0; \ struct hrtimer_sleeper __t; \ @@ -500,7 +500,7 @@ do { \ __ret = -ETIME; \ break; \ } \ - schedule()); \ + cmd); \ \ hrtimer_cancel(&__t.timer); \ destroy_hrtimer_on_stack(&__t.timer); \ @@ -529,7 +529,23 @@ do { \ might_sleep(); \ if (!(condition)) \ __ret = __wait_event_hrtimeout(wq_head, condition, timeout, \ - TASK_UNINTERRUPTIBLE); \ + TASK_UNINTERRUPTIBLE, \ + schedule()); \ + __ret; \ +}) + +/* + * like wait_event_hrtimeout() -- except it uses TASK_INTERRUPTIBLE to avoid + * increasing load and is freezable. + */ +#define wait_event_freezable_hrtimeout(wq_head, condition, timeout) \ +({ \ + int __ret = 0; \ + might_sleep(); \ + if (!(condition)) \ + __ret = __wait_event_hrtimeout(wq_head, condition, timeout, \ + TASK_INTERRUPTIBLE, \ + freezable_schedule()); \ __ret; \ }) @@ -555,7 +571,8 @@ do { \ might_sleep(); \ if (!(condition)) \ __ret = __wait_event_hrtimeout(wq, condition, timeout, \ - TASK_INTERRUPTIBLE); \ + TASK_INTERRUPTIBLE, \ + schedule()); \ __ret; \ }) -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[driver-core:debugfs_cleanup 124/124] drivers/platform/x86/acer-wmi.c:2172:1: warning: no return statement in function returning non-void
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git debugfs_cleanup head: 3ec9bc11e2cea5023fd7bda21dd0c942f4a67b67 commit: 3ec9bc11e2cea5023fd7bda21dd0c942f4a67b67 [124/124] platform/x86: fix changelog config: x86_64-rhel (attached as .config) compiler: gcc-8 (Debian 8.2.0-14) 8.2.0 reproduce: git checkout 3ec9bc11e2cea5023fd7bda21dd0c942f4a67b67 # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): drivers/platform/x86/acer-wmi.c: In function 'create_debugfs': >> drivers/platform/x86/acer-wmi.c:2172:1: warning: no return statement in >> function returning non-void [-Wreturn-type] } ^ vim +2172 drivers/platform/x86/acer-wmi.c 81143522 drivers/misc/acer-wmi.c Carlos Corbacho2008-06-21 2165 76d51dd9 drivers/platform/x86/acer-wmi.c Mathias Krause 2014-07-16 2166 static int __init create_debugfs(void) 81143522 drivers/misc/acer-wmi.c Carlos Corbacho2008-06-21 2167 { 81143522 drivers/misc/acer-wmi.c Carlos Corbacho2008-06-21 2168 interface->debug.root = debugfs_create_dir("acer-wmi", NULL); 81143522 drivers/misc/acer-wmi.c Carlos Corbacho2008-06-21 2169 3ec9bc11 drivers/platform/x86/acer-wmi.c Greg Kroah-Hartman 2019-02-07 2170 debugfs_create_u32("devices", S_IRUGO, interface->debug.root, 81143522 drivers/misc/acer-wmi.c Carlos Corbacho2008-06-21 2171 &interface->debug.wmid_devices); 81143522 drivers/misc/acer-wmi.c Carlos Corbacho2008-06-21 @2172 } 81143522 drivers/misc/acer-wmi.c Carlos Corbacho2008-06-21 2173 :: The code at line 2172 was first introduced by commit :: 81143522aa823036c4aa35bdd3b2e41966cf6e15 acer-wmi: Add debugfs file for device detection :: TO: Carlos Corbacho :: CC: Andi Kleen --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging/android: simplify handle_vsoc_cond_wait
simplify handle_vsoc_cond_wait (drivers/staging/android/vsoc.c) using newly added wait_event_freezable_hrtimeout helper and remove duplicate include. Signed-off-by: Hugo Lefeuvre --- Changes in v2: - Fix removal of necessary linux/freezer.h include. - Make commit message more precise about the include removal. drivers/staging/android/vsoc.c | 68 +- 1 file changed, 10 insertions(+), 58 deletions(-) diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c index 22571abcaa4e..f2bb18158e5b 100644 --- a/drivers/staging/android/vsoc.c +++ b/drivers/staging/android/vsoc.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include "uapi/vsoc_shm.h" @@ -401,7 +400,6 @@ static int handle_vsoc_cond_wait(struct file *filp, struct vsoc_cond_wait *arg) DEFINE_WAIT(wait); u32 region_number = iminor(file_inode(filp)); struct vsoc_region_data *data = vsoc_dev.regions_data + region_number; - struct hrtimer_sleeper timeout, *to = NULL; int ret = 0; struct vsoc_device_region *region_p = vsoc_region_from_filep(filp); atomic_t *address = NULL; @@ -420,69 +418,23 @@ static int handle_vsoc_cond_wait(struct file *filp, struct vsoc_cond_wait *arg) /* Ensure that the type of wait is valid */ switch (arg->wait_type) { case VSOC_WAIT_IF_EQUAL: + ret = wait_event_freezable(data->futex_wait_queue, + arg->wakes++ && + atomic_read(address) != arg->value); break; case VSOC_WAIT_IF_EQUAL_TIMEOUT: - to = &timeout; - break; - default: - return -EINVAL; - } - - if (to) { - /* Copy the user-supplied timesec into the kernel structure. -* We do things this way to flatten differences between 32 bit -* and 64 bit timespecs. -*/ if (arg->wake_time_nsec >= NSEC_PER_SEC) return -EINVAL; wake_time = ktime_set(arg->wake_time_sec, arg->wake_time_nsec); - - hrtimer_init_on_stack(&to->timer, CLOCK_MONOTONIC, - HRTIMER_MODE_ABS); - hrtimer_set_expires_range_ns(&to->timer, wake_time, -current->timer_slack_ns); - - hrtimer_init_sleeper(to, current); + ret = wait_event_freezable_hrtimeout(data->futex_wait_queue, +arg->wakes++ && +atomic_read(address) != arg->value, +wake_time); + break; + default: + return -EINVAL; } - while (1) { - prepare_to_wait(&data->futex_wait_queue, &wait, - TASK_INTERRUPTIBLE); - /* -* Check the sentinel value after prepare_to_wait. If the value -* changes after this check the writer will call signal, -* changing the task state from INTERRUPTIBLE to RUNNING. That -* will ensure that schedule() will eventually schedule this -* task. -*/ - if (atomic_read(address) != arg->value) { - ret = 0; - break; - } - if (to) { - hrtimer_start_expires(&to->timer, HRTIMER_MODE_ABS); - if (likely(to->task)) - freezable_schedule(); - hrtimer_cancel(&to->timer); - if (!to->task) { - ret = -ETIMEDOUT; - break; - } - } else { - freezable_schedule(); - } - /* Count the number of times that we woke up. This is useful -* for unit testing. -*/ - ++arg->wakes; - if (signal_pending(current)) { - ret = -EINTR; - break; - } - } - finish_wait(&data->futex_wait_queue, &wait); - if (to) - destroy_hrtimer_on_stack(&to->timer); return ret; } -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/3] sched/wait: use freezable_schedule when possible
> Sure, add these test results to the patch as well showing reduced wakeups. > > I would say submit the freezable_schedule as a single separate patch > independent of the vsoc series since it can go in separately, and also > benefits other things than vsoc. > > Also CC Rafael (power maintainer) on it. Thanks, I have splitted the patch set[0][1] and submitted the freezable_schedule patch separately (only cc-ing people responsible for the wait api + Rafael). regards, Hugo [0] https://lkml.org/lkml/2019/2/7/802 [1] https://lkml.org/lkml/2019/2/7/870 -- Hugo Lefeuvre (hle)|www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] media: imx: Set capture compose rectangle in capture_device_set_format
From: Steve Longerbeam The capture compose rectangle was not getting updated when setting the source subdevice's source pad format. This causes the compose window to be zero (or not updated) at stream start unless the capture device format was set explicitly at the capture device node. Fix by moving the calculation of the capture compose rectangle to imx_media_mbus_fmt_to_pix_fmt(), and pass the rectangle to imx_media_capture_device_set_format(). Fixes: 439d8186fb23 ("media: imx: add capture compose rectangle") Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/imx-ic-prpencvf.c | 5 ++-- drivers/staging/media/imx/imx-media-capture.c | 24 +-- drivers/staging/media/imx/imx-media-csi.c | 5 ++-- drivers/staging/media/imx/imx-media-utils.c | 20 drivers/staging/media/imx/imx-media.h | 6 +++-- 5 files changed, 37 insertions(+), 23 deletions(-) diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c index 376b504e8a42..5c8e6ad8c025 100644 --- a/drivers/staging/media/imx/imx-ic-prpencvf.c +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c @@ -912,6 +912,7 @@ static int prp_set_fmt(struct v4l2_subdev *sd, const struct imx_media_pixfmt *cc; struct v4l2_pix_format vdev_fmt; struct v4l2_mbus_framefmt *fmt; + struct v4l2_rect vdev_compose; int ret = 0; if (sdformat->pad >= PRPENCVF_NUM_PADS) @@ -953,11 +954,11 @@ static int prp_set_fmt(struct v4l2_subdev *sd, priv->cc[sdformat->pad] = cc; /* propagate output pad format to capture device */ - imx_media_mbus_fmt_to_pix_fmt(&vdev_fmt, + imx_media_mbus_fmt_to_pix_fmt(&vdev_fmt, &vdev_compose, &priv->format_mbus[PRPENCVF_SRC_PAD], priv->cc[PRPENCVF_SRC_PAD]); mutex_unlock(&priv->lock); - imx_media_capture_device_set_format(vdev, &vdev_fmt); + imx_media_capture_device_set_format(vdev, &vdev_fmt, &vdev_compose); return 0; out: diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index f92edee63aa6..9703c85b19c4 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -205,7 +205,8 @@ static int capture_g_fmt_vid_cap(struct file *file, void *fh, static int __capture_try_fmt_vid_cap(struct capture_priv *priv, struct v4l2_subdev_format *fmt_src, -struct v4l2_format *f) +struct v4l2_format *f, +struct v4l2_rect *compose) { const struct imx_media_pixfmt *cc, *cc_src; @@ -245,7 +246,8 @@ static int __capture_try_fmt_vid_cap(struct capture_priv *priv, } } - imx_media_mbus_fmt_to_pix_fmt(&f->fmt.pix, &fmt_src->format, cc); + imx_media_mbus_fmt_to_pix_fmt(&f->fmt.pix, compose, + &fmt_src->format, cc); return 0; } @@ -263,7 +265,7 @@ static int capture_try_fmt_vid_cap(struct file *file, void *fh, if (ret) return ret; - return __capture_try_fmt_vid_cap(priv, &fmt_src, f); + return __capture_try_fmt_vid_cap(priv, &fmt_src, f, NULL); } static int capture_s_fmt_vid_cap(struct file *file, void *fh, @@ -271,6 +273,7 @@ static int capture_s_fmt_vid_cap(struct file *file, void *fh, { struct capture_priv *priv = video_drvdata(file); struct v4l2_subdev_format fmt_src; + struct v4l2_rect compose; int ret; if (vb2_is_busy(&priv->q)) { @@ -284,17 +287,14 @@ static int capture_s_fmt_vid_cap(struct file *file, void *fh, if (ret) return ret; - ret = __capture_try_fmt_vid_cap(priv, &fmt_src, f); + ret = __capture_try_fmt_vid_cap(priv, &fmt_src, f, &compose); if (ret) return ret; priv->vdev.fmt.fmt.pix = f->fmt.pix; priv->vdev.cc = imx_media_find_format(f->fmt.pix.pixelformat, CS_SEL_ANY, true); - priv->vdev.compose.left = 0; - priv->vdev.compose.top = 0; - priv->vdev.compose.width = fmt_src.format.width; - priv->vdev.compose.height = fmt_src.format.height; + priv->vdev.compose = compose; return 0; } @@ -655,7 +655,8 @@ static struct video_device capture_videodev = { }; void imx_media_capture_device_set_format(struct imx_media_video_dev *vdev, -struct v4l2_pix_format *pix) +const struct v4l2_pix_format *pix, +const struct v4l2_rect *compose) { struct capture_priv *priv = to_capture_priv(vdev); @@ -663,6 +664,7 @@ void imx_media_capture_device_set_format(struct imx_media
Re: [PATCH] PCI: hv: Add hv_pci_remove_slots() when we unload the driver
On Thu, 7 Feb 2019 20:36:32 + Dexuan Cui wrote: > When we unload pci-hyperv, the host doesn't send us a PCI_EJECT message. > In this case we also need to make sure the sysfs pci slot directory > is removed, otherwise "cat /sys/bus/pci/slots/2/address" will trigger > "BUG: unable to handle kernel paging request". And, if we unload/reload > the driver several times, we'll have multiple pci slot directories in > /sys/bus/pci/slots/ like this: > > root@localhost:~# ls -rtl /sys/bus/pci/slots/ > total 0 > drwxr-xr-x 2 root root 0 Feb 7 10:49 2 > drwxr-xr-x 2 root root 0 Feb 7 10:49 2-1 > drwxr-xr-x 2 root root 0 Feb 7 10:51 2-2 > > The patch adds the missing code, and in hv_eject_device_work() it also > moves pci_destroy_slot() to an earlier place where we hold the pci lock. > > Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot > information") > Signed-off-by: Dexuan Cui > Cc: sta...@vger.kernel.org > Cc: Stephen Hemminger Acked-by: Stephen Hemminger ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[driver-core:debugfs_cleanup 124/124] drivers/platform/x86/acer-wmi.c:2166:15: warning: return type defaults to 'int'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git debugfs_cleanup head: 3cc275229e713135bfacb30ea82112f15a03d74f commit: 3cc275229e713135bfacb30ea82112f15a03d74f [124/124] platform/x86: fix up changelog config: x86_64-rhel (attached as .config) compiler: gcc-8 (Debian 8.2.0-14) 8.2.0 reproduce: git checkout 3cc275229e713135bfacb30ea82112f15a03d74f # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): >> drivers/platform/x86/acer-wmi.c:2166:15: warning: return type defaults to >> 'int' [-Wreturn-type] static __init create_debugfs(void) ^~ drivers/platform/x86/acer-wmi.c: In function 'create_debugfs': >> drivers/platform/x86/acer-wmi.c:2172:1: warning: control reaches end of >> non-void function [-Wreturn-type] } ^ vim +/int +2166 drivers/platform/x86/acer-wmi.c 2165 > 2166 static __init create_debugfs(void) 2167 { 2168 interface->debug.root = debugfs_create_dir("acer-wmi", NULL); 2169 2170 debugfs_create_u32("devices", S_IRUGO, interface->debug.root, 2171 &interface->debug.wmid_devices); > 2172 } 2173 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 3/8] staging: wilc1000: move macro and function prototype from wilc_wlan_if.h file
On 2/7/2019 6:21 PM, Claudiu Beznea - M18063 wrote: > > > On 07.02.2019 13:29, ajay.kat...@microchip.com wrote: >> From: Ajay Singh >> >> Move data structure and function prototype from 'wilc_wlan_if.h file. >> Now, this file contains constant specific to the firmware. >> >> Signed-off-by: Ajay Singh >> --- >> drivers/staging/wilc1000/host_interface.c | 1 + >> drivers/staging/wilc1000/host_interface.h | 11 ++ >> drivers/staging/wilc1000/linux_wlan.c | 2 ++ >> drivers/staging/wilc1000/wilc_wlan.h | 9 >> drivers/staging/wilc1000/wilc_wlan_if.h | 36 >> --- >> 5 files changed, 23 insertions(+), 36 deletions(-) >> >> diff --git a/drivers/staging/wilc1000/host_interface.c >> b/drivers/staging/wilc1000/host_interface.c >> index 9abe341..50dc2dd 100644 >> --- a/drivers/staging/wilc1000/host_interface.c >> +++ b/drivers/staging/wilc1000/host_interface.c >> @@ -10,6 +10,7 @@ >> #define WILC_HIF_CONNECT_TIMEOUT_MS 9500 >> >> #define WILC_FALSE_FRMWR_CHANNEL100 >> +#define WILC_MAX_RATES_SUPPORTED12 >> >> struct wilc_rcvd_mac_info { >> u8 status; >> diff --git a/drivers/staging/wilc1000/host_interface.h >> b/drivers/staging/wilc1000/host_interface.h >> index a007625..678e623 100644 >> --- a/drivers/staging/wilc1000/host_interface.h >> +++ b/drivers/staging/wilc1000/host_interface.h >> @@ -97,6 +97,17 @@ enum conn_event { >> CONN_DISCONN_EVENT_FORCE_32BIT = 0x >> }; >> >> +enum { >> +WILC_HIF_SDIO = 0, >> +WILC_HIF_SPI = BIT(0) > > BIT(0)=1, so you can remove it and use simply: > > enum { > WILC_HIF_SDIO, > WILC_HIF_SPI, > }; > Thanks Claudiu, Sure, I will be taking care of it in future patches. > >> +}; >> + >> +enum { >> +WILC_MAC_STATUS_INIT = -1, >> +WILC_MAC_STATUS_DISCONNECTED = 0, >> +WILC_MAC_STATUS_CONNECTED = 1 >> +}; >> + >> struct wilc_rcvd_net_info { >> s8 rssi; >> u8 ch; >> diff --git a/drivers/staging/wilc1000/linux_wlan.c >> b/drivers/staging/wilc1000/linux_wlan.c >> index f3e52af..1ebf2b8 100644 >> --- a/drivers/staging/wilc1000/linux_wlan.c >> +++ b/drivers/staging/wilc1000/linux_wlan.c >> @@ -12,6 +12,8 @@ >> >> #include "wilc_wfi_cfgoperations.h" >> >> +#define WILC_MULTICAST_TABLE_SIZE 8 >> + >> static irqreturn_t isr_uh_routine(int irq, void *user_data) >> { >> struct net_device *dev = user_data; >> diff --git a/drivers/staging/wilc1000/wilc_wlan.h >> b/drivers/staging/wilc1000/wilc_wlan.h >> index d8fabe8..1a27f62 100644 >> --- a/drivers/staging/wilc1000/wilc_wlan.h >> +++ b/drivers/staging/wilc1000/wilc_wlan.h >> @@ -250,6 +250,13 @@ struct wilc_hif_func { >> >> #define WILC_MAX_CFG_FRAME_SIZE 1468 >> >> +struct tx_complete_data { >> +int size; >> +void *buff; >> +u8 *bssid; >> +struct sk_buff *skb; >> +}; >> + >> struct wilc_cfg_cmd_hdr { >> u8 cmd_type; >> u8 seq_no; >> @@ -301,4 +308,6 @@ void chip_allow_sleep(struct wilc *wilc); >> void chip_wakeup(struct wilc *wilc); >> int wilc_send_config_pkt(struct wilc_vif *vif, u8 mode, struct wid *wids, >> u32 count, u32 drv); >> +int wilc_wlan_init(struct net_device *dev); >> +u32 wilc_get_chipid(struct wilc *wilc, bool update); >> #endif >> diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h >> b/drivers/staging/wilc1000/wilc_wlan_if.h >> index 9b8cce8..b15de36 100644 >> --- a/drivers/staging/wilc1000/wilc_wlan_if.h >> +++ b/drivers/staging/wilc1000/wilc_wlan_if.h >> @@ -11,41 +11,9 @@ >> >> / >> * >> - * Host Interface Defines >> - * >> - / >> - >> -enum { >> -WILC_HIF_SDIO = 0, >> -WILC_HIF_SPI = BIT(0) >> -}; >> - >> -/ >> - * >> - * Wlan Interface Defines >> - * >> - / >> - >> -enum { >> -WILC_MAC_STATUS_INIT = -1, >> -WILC_MAC_STATUS_DISCONNECTED = 0, >> -WILC_MAC_STATUS_CONNECTED = 1 >> -}; >> - >> -struct tx_complete_data { >> -int size; >> -void *buff; >> -u8 *bssid; >> -struct sk_buff *skb; >> -}; >> - >> -/ >> - * >> * Wlan Configuration ID >> * >> / >> -#define WILC_MULTICAST_TABLE_SIZE 8 >> -#define WILC_MAX_RATES_SUPPORTED 12 >> >> enum bss_types { >> WILC_FW_BSS_TYPE_INFRA = 0, >> @@ -832,8 +800,4 @@ enum { >> WID_MAX = 0x >> }; >> >> -struct wilc; >> -int wilc_wlan_init(struct net_device *dev); >> -u32 wilc_get_chipid(struct wilc *wilc, bool update); >> - >> #endif >> ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel