RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation
From: Richard Weinberger [mailto:rich...@nod.at] Sent: Monday, July 21, 2014 2:55 PM Yue, Am 21.07.2014 04:44, schrieb Yue Zhang (OSTC DEV): From: Richard Weinberger [mailto:richard.weinber...@gmail.com] Why 10? Is this a random number which works by accident for ifplugd? What about other networking implementations, is 10 also ok for them? -- Thanks, //richard Hi, Richard I checked ifplugd's code. The deferring time is 5 seconds. That's how comes the 10s. I agree with you this is a magic number and should be avoid. However, this is the only feasible solution right now. If there is a better solution, I will be glad to switch to it. I tested the fix in Redhat, Ubuntu and SUSE and it works in all of them. The problem I see is that there is no good way to trigger a DHCP renew from a network device drivers. You're on the wrong layer. 10 seconds may work but this is IMHO a hack which can easily break. There are also more networking implementations than ifplugd. Specially the systemd implementation looks promising. Can't you propagate the RNDIS_STATUS_NETWORK_CHANGE event to userspace? IIRC on HyperV guests already have a guest daemon. Let the daemon handle the event such that distros can install their own hooks... Thanks, //richard Hi, Richard The problem of systemd implementation is that in different distros, the ways to restart service are different. Propagating the event to userspace also doesn't help for this issue. The advantage of current solution is that it simulates a cable plugging in/out event. IMHO, in all the distros, this simulated event has already been well handled. It is a dup effect to implement new hooks. Thanks Yue ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation
Yue, Am 21.07.2014 10:05, schrieb Yue Zhang (OSTC DEV): The problem of systemd implementation is that in different distros, the ways to restart service are different. Propagating the event to userspace also doesn't help for this issue. This way each distro can provide their own restart script. Same as every distro has custom start scripts, etc... The advantage of current solution is that it simulates a cable plugging in/out event. IMHO, in all the distros, this simulated event has already been well handled. It is a dup effect to implement new hooks. Iff the current solution works for _all_ networking implementations. Thanks, //richard ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation
From: Richard Weinberger [mailto:rich...@nod.at] Sent: Monday, July 21, 2014 4:18 PM Yue, Am 21.07.2014 10:05, schrieb Yue Zhang (OSTC DEV): The problem of systemd implementation is that in different distros, the ways to restart service are different. Propagating the event to userspace also doesn't help for this issue. This way each distro can provide their own restart script. Same as every distro has custom start scripts, etc... The advantage of current solution is that it simulates a cable plugging in/out event. IMHO, in all the distros, this simulated event has already been well handled. It is a dup effect to implement new hooks. Iff the current solution works for _all_ networking implementations. Thanks, //richard Hi, Richard IMHO, all networking implementations should handle the cable offline event. Consider this situation. I unplugged the network cable and connect it to a new network switch after 10 seconds. If the DHCP renew is not triggered, the network will break. I think in normal cases, it should already been handled properly. Unless there is a strong justification for not doing this. In that case, we shouldn't renew DHCP anyway. Thanks Yue ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation
Yue, Am 21.07.2014 10:44, schrieb Yue Zhang (OSTC DEV): Hi, Richard IMHO, all networking implementations should handle the cable offline event. Consider this situation. I unplugged the network cable and connect it to a new network switch after 10 seconds. If the DHCP renew is not triggered, the network will break. I think in normal cases, it should already been handled properly. Unless there is a strong justification for not doing this. In that case, we shouldn't renew DHCP anyway. I agree that they should handle the cable offline event. My concern is that 10 seconds is maybe not a the right choice. (As we cannot know all implementations) Thanks, //richard ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation
On Mon, Jul 21, Richard Weinberger wrote: My concern is that 10 seconds is maybe not a the right choice. (As we cannot know all implementations) Until someone reports an issue with it, 10 is fine. Just like 20 or 666. Olaf ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/29] staging: rtl8723au: Remove no-op function dm_CheckStatistics()
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/rtl8723a_dm.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c index 4a3d2e1..3fb54fc 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c @@ -34,10 +34,6 @@ /* Global var */ /* */ -static void dm_CheckStatistics(struct rtw_adapter *Adapter) -{ -} - static void dm_CheckPbcGPIO(struct rtw_adapter *padapter) { u8 tmp1byte; @@ -225,9 +221,6 @@ rtl8723a_HalDmWatchDog( bFwPSAwake = rtl8723a_get_fwlps_rf_on(Adapter); if (!bFwCurrentInPSMode bFwPSAwake) { - /* Calculate Tx/Rx statistics. */ - dm_CheckStatistics(Adapter); - /* Read REG_INIDATA_RATE_SEL value for TXDESC. */ if (check_fwstate(Adapter-mlmepriv, WIFI_STATION_STATE)) { pdmpriv-INIDATA_RATE[0] = rtl8723au_read8(Adapter, REG_INIDATA_RATE_SEL) 0x3f; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/29] staging: rtl8723au: Eliminate ODM_CMNINFO_POWER_SAVING usage
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/odm.c | 8 ++-- drivers/staging/rtl8723au/hal/rtl8723a_dm.c | 4 drivers/staging/rtl8723au/include/odm.h | 3 --- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index eadf2ed..754b816 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -291,6 +291,7 @@ void ODM_DMWatchdog23a(struct rtw_adapter *adapter) { struct hal_data_8723a *pHalData = GET_HAL_DATA(adapter); struct dm_odm_t *pDM_Odm = pHalData-odmpriv; + struct pwrctrl_priv *pwrctrlpriv = adapter-pwrctrlpriv; /* 2012.05.03 Luke: For all IC series */ odm_CmnInfoHook_Debug23a(pDM_Odm); @@ -313,7 +314,7 @@ void ODM_DMWatchdog23a(struct rtw_adapter *adapter) odm_CCKPacketDetectionThresh23a(pDM_Odm); - if (*(pDM_Odm-pbPowerSaving)) + if (pwrctrlpriv-bpower_saving) return; odm_RefreshRateAdaptiveMask23a(pDM_Odm); @@ -418,9 +419,6 @@ void ODM23a_CmnInfoHook(struct dm_odm_t *pDM_Odm, /* Hook call by reference pointer. */ switch (CmnInfo) { /* Dynamic call by reference pointer. */ - caseODM_CMNINFO_POWER_SAVING: - pDM_Odm-pbPowerSaving = (bool *)pValue; - break; /* To remove the compiler warning, must add an empty default statement to handle the other values. */ default: /* do nothing */ @@ -541,8 +539,6 @@ void odm_CmnInfoInit_Debug23a(struct dm_odm_t *pDM_Odm) void odm_CmnInfoHook_Debug23a(struct dm_odm_t *pDM_Odm) { ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (odm_CmnInfoHook_Debug23a ==\n)); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (pbPowerSaving =%d\n, *(pDM_Odm-pbPowerSaving))); } void odm_CmnInfoUpdate_Debug23a(struct dm_odm_t *pDM_Odm) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c index 22dec5c..fa3e5aa 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c @@ -133,7 +133,6 @@ static void Init_ODM_ComInfo_8723a(struct rtw_adapter *Adapter) static void Update_ODM_ComInfo_8723a(struct rtw_adapter *Adapter) { - struct pwrctrl_priv *pwrctrlpriv = Adapter-pwrctrlpriv; struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); struct dm_odm_t *pDM_Odm = pHalData-odmpriv; struct dm_priv *pdmpriv = pHalData-dmpriv; @@ -151,9 +150,6 @@ static void Update_ODM_ComInfo_8723a(struct rtw_adapter *Adapter) /* Pointer reference */ rtl8723a_odm_support_ability_set(Adapter, DYNAMIC_ALL_FUNC_ENABLE); - ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_POWER_SAVING, - pwrctrlpriv-bpower_saving); - for (i = 0; i NUM_STA; i++) ODM_CmnInfoPtrArrayHook23a(pDM_Odm, ODM_CMNINFO_STA_STATUS, i, NULL); } diff --git a/drivers/staging/rtl8723au/include/odm.h b/drivers/staging/rtl8723au/include/odm.h index 300f8fb..58875f4 100644 --- a/drivers/staging/rtl8723au/include/odm.h +++ b/drivers/staging/rtl8723au/include/odm.h @@ -319,7 +319,6 @@ enum odm_cmninfo { /* */ /* Dynamic value: */ /* */ - ODM_CMNINFO_POWER_SAVING, ODM_CMNINFO_MP_MODE, ODM_CMNINFO_WIFI_DIRECT, @@ -683,8 +682,6 @@ struct dm_odm_t { boolbool_temp; struct rtw_adapter *PADAPTER_temp; - /* Common info for Status */ - bool*pbPowerSaving; /* POINTER REFERENCE--- */ /* */ /* CALL BY VALUE- */ -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/29] staging: rtl8723au: Remove write-only struct dm_priv-DM_Type variable
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/rtl8723a_dm.c | 1 - drivers/staging/rtl8723au/include/rtl8723a_dm.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c index 3fb54fc..b7ed764 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c @@ -185,7 +185,6 @@ void rtl8723a_InitHalDm(struct rtw_adapter *Adapter) struct dm_odm_t *pDM_Odm = pHalData-odmpriv; u8 i; - pdmpriv-DM_Type = DM_Type_ByDriver; pdmpriv-DMFlag = DYNAMIC_FUNC_DISABLE; #ifdef CONFIG_8723AU_BT_COEXIST diff --git a/drivers/staging/rtl8723au/include/rtl8723a_dm.h b/drivers/staging/rtl8723au/include/rtl8723a_dm.h index 57be347..5ee3af4 100644 --- a/drivers/staging/rtl8723au/include/rtl8723a_dm.h +++ b/drivers/staging/rtl8723au/include/rtl8723a_dm.h @@ -39,7 +39,6 @@ enum{ /* duplicate code,will move to ODM # */ struct dm_priv { - u8 DM_Type; u8 DMFlag; u8 InitDMFlag; u32 InitODMFlag; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 28/29] staging: rtl8723au: Fold rtw_resume_process23a() into rtw_resume()
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/include/hal_intf.h | 1 - drivers/staging/rtl8723au/os_dep/usb_intf.c | 9 - 2 files changed, 10 deletions(-) diff --git a/drivers/staging/rtl8723au/include/hal_intf.h b/drivers/staging/rtl8723au/include/hal_intf.h index 396decb..404acb5 100644 --- a/drivers/staging/rtl8723au/include/hal_intf.h +++ b/drivers/staging/rtl8723au/include/hal_intf.h @@ -101,7 +101,6 @@ enum hardware_type { void rtw_hal_def_value_init23a(struct rtw_adapter *padapter); int pm_netdev_open23a(struct net_device *pnetdev, u8 bnormal); -int rtw_resume_process23a(struct rtw_adapter *padapter); int rtl8723au_hal_init(struct rtw_adapter *padapter); int rtl8723au_hal_deinit(struct rtw_adapter *padapter); diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c b/drivers/staging/rtl8723au/os_dep/usb_intf.c index aeaedcd..c75427f 100644 --- a/drivers/staging/rtl8723au/os_dep/usb_intf.c +++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c @@ -488,15 +488,6 @@ static int rtw_resume(struct usb_interface *pusb_intf) { struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf); struct rtw_adapter *padapter = dvobj-if1; - int ret; - - ret = rtw_resume_process23a(padapter); - - return ret; -} - -int rtw_resume_process23a(struct rtw_adapter *padapter) -{ struct net_device *pnetdev; struct pwrctrl_priv *pwrpriv = NULL; int ret = -1; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/29] staging: rtl8723au: Eliminate ODM_CMNINFO_BW usage
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/odm.c | 19 --- drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 3 ++- drivers/staging/rtl8723au/hal/rtl8723a_dm.c | 2 -- drivers/staging/rtl8723au/hal/usb_halinit.c | 4 ++-- drivers/staging/rtl8723au/include/odm.h | 17 +++-- 5 files changed, 15 insertions(+), 30 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index aa310a3..a15a8cb 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -417,9 +417,6 @@ void ODM23a_CmnInfoHook(struct dm_odm_t *pDM_Odm, /* Hook call by reference pointer. */ switch (CmnInfo) { /* Dynamic call by reference pointer. */ - caseODM_CMNINFO_BW: - pDM_Odm-pBandWidth = (u8 *)pValue; - break; caseODM_CMNINFO_CHNL: pDM_Odm-pChannel = (u8 *)pValue; break; @@ -506,7 +503,7 @@ static void odm_CommonInfoSelfUpdate(struct hal_data_8723a *pHalData) u8 EntryCnt = 0; u8 i; - if (*(pDM_Odm-pBandWidth) == ODM_BW40M) { + if (pHalData-CurrentChannelBW == HT_CHANNEL_WIDTH_40) { if (pHalData-nCur40MhzPrimeSC == 1) pDM_Odm-ControlChannel = *(pDM_Odm-pChannel) - 2; else if (pHalData-nCur40MhzPrimeSC == 2) @@ -549,7 +546,6 @@ void odm_CmnInfoInit_Debug23a(struct dm_odm_t *pDM_Odm) void odm_CmnInfoHook_Debug23a(struct dm_odm_t *pDM_Odm) { ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (odm_CmnInfoHook_Debug23a ==\n)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (pBandWidth =%d\n, *(pDM_Odm-pBandWidth))); ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (pChannel =%d\n, *(pDM_Odm-pChannel))); ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (pbScanInProcess =%d\n, *(pDM_Odm-pbScanInProcess))); @@ -1137,11 +1133,10 @@ void odm_RateAdaptiveMaskInit23a(struct dm_odm_t *pDM_Odm) pOdmRA-LowRSSIThresh = 20; } -u32 ODM_Get_Rate_Bitmap23a(struct dm_odm_t *pDM_Odm, - u32 macid, - u32 ra_mask, - u8 rssi_level) +u32 ODM_Get_Rate_Bitmap23a(struct hal_data_8723a *pHalData, u32 macid, + u32 ra_mask, u8 rssi_level) { + struct dm_odm_t *pDM_Odm = pHalData-odmpriv; struct sta_info *pEntry; u32 rate_bitmap = 0x0fff; u8 WirelessMode; @@ -1181,7 +1176,8 @@ u32 ODM_Get_Rate_Bitmap23a(struct dm_odm_t *pDM_Odm, } else if (rssi_level == DM_RATR_STA_MIDDLE) { rate_bitmap = 0x000ff000; } else { - if (*(pDM_Odm-pBandWidth) == ODM_BW40M) + if (pHalData-CurrentChannelBW == + HT_CHANNEL_WIDTH_40) rate_bitmap = 0x000ff015; else rate_bitmap = 0x000ff005; @@ -1192,7 +1188,8 @@ u32 ODM_Get_Rate_Bitmap23a(struct dm_odm_t *pDM_Odm, } else if (rssi_level == DM_RATR_STA_MIDDLE) { rate_bitmap = 0x0f8ff000; } else { - if (*(pDM_Odm-pBandWidth) == ODM_BW40M) + if (pHalData-CurrentChannelBW == + HT_CHANNEL_WIDTH_40) rate_bitmap = 0x0f8ff015; else rate_bitmap = 0x0f8ff005; diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c index 7dd62b3..271c33d 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c @@ -151,7 +151,8 @@ void rtl8723a_add_rateatid(struct rtw_adapter *pAdapter, u32 bitmap, u8 arg, u8 bitmap = 0x0fff; if (rssi_level != DM_RATR_STA_INIT) - bitmap = ODM_Get_Rate_Bitmap23a(pHalData-odmpriv, macid, bitmap, rssi_level); + bitmap = ODM_Get_Rate_Bitmap23a(pHalData, macid, bitmap, + rssi_level); bitmap |= ((raid28)0xf000); diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c index 89ae2f2..dfed57e 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c @@ -152,8 +152,6 @@ static void Update_ODM_ComInfo_8723a(struct rtw_adapter *Adapter) /* Pointer reference */ rtl8723a_odm_support_ability_set(Adapter, DYNAMIC_ALL_FUNC_ENABLE); - ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_BW, -
[PATCH 03/29] staging: rtl8723au: bDMInitialGainEnable is always true
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/odm.c | 10 -- drivers/staging/rtl8723au/include/odm.h | 1 - 2 files changed, 11 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index dd02585..ed6d3af 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -717,10 +717,6 @@ void odm_DIG23aInit(struct dm_odm_t *pDM_Odm) pDM_DigTable-DIG_Dynamic_MIN_1 = DM_DIG_MIN_NIC; pDM_DigTable-bMediaConnect_0 = false; pDM_DigTable-bMediaConnect_1 = false; - - /* To Initialize pDM_Odm-bDMInitialGainEnable == false to avoid DIG error */ - pDM_Odm-bDMInitialGainEnable = true; - } void odm_DIG23a(struct dm_odm_t *pDM_Odm) @@ -747,12 +743,6 @@ void odm_DIG23a(struct dm_odm_t *pDM_Odm) return; } - /* add by Neil Chen to avoid PSD is processing */ - if (!pDM_Odm-bDMInitialGainEnable) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, (odm_DIG23a() Return: PSD is Processing \n)); - return; - } - DIG_Dynamic_MIN = pDM_DigTable-DIG_Dynamic_MIN_0; FirstConnect = (pDM_Odm-bLinked) (!pDM_DigTable-bMediaConnect_0); FirstDisConnect = (!pDM_Odm-bLinked) (pDM_DigTable-bMediaConnect_0); diff --git a/drivers/staging/rtl8723au/include/odm.h b/drivers/staging/rtl8723au/include/odm.h index b2f661e..9c8e7d8 100644 --- a/drivers/staging/rtl8723au/include/odm.h +++ b/drivers/staging/rtl8723au/include/odm.h @@ -818,7 +818,6 @@ struct dm_odm_t { boolbUserAssignLevel; u8 RSSI_BT;/* come from BT */ boolbPSDinProcess; - boolbDMInitialGainEnable; /* for rate adaptive, in fact, 88c/92c fw will handle this */ u8 bUseRAMask; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/29] staging: rtl8723au: Merge Init_ODM_ComInfo_8723a() into rtl8723a_init_dm_priv()
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/rtl8723a_dm.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c index fa3e5aa..fa826b0 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c @@ -82,16 +82,15 @@ static void dm_CheckPbcGPIO(struct rtw_adapter *padapter) /* Initialize GPIO setting registers */ /* functions */ -static void Init_ODM_ComInfo_8723a(struct rtw_adapter *Adapter) -{ +void rtl8723a_init_dm_priv(struct rtw_adapter *Adapter) +{ struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); + struct dm_priv *pdmpriv = pHalData-dmpriv; struct dm_odm_t *pDM_Odm = pHalData-odmpriv; - u8 cut_ver, fab_ver; + u8 cut_ver, fab_ver; - /* */ - /* Init Value */ - /* */ + memset(pdmpriv, 0, sizeof(struct dm_priv)); memset(pDM_Odm, 0, sizeof(*pDM_Odm)); pDM_Odm-Adapter = Adapter; @@ -212,12 +211,3 @@ skip_dm: /* Check Hardware Radio ON/OFF or not */ dm_CheckPbcGPIO(Adapter); } - -void rtl8723a_init_dm_priv(struct rtw_adapter *Adapter) -{ - struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); - struct dm_priv *pdmpriv = pHalData-dmpriv; - - memset(pdmpriv, 0, sizeof(struct dm_priv)); - Init_ODM_ComInfo_8723a(Adapter); -} -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 26/29] staging: rtl8723au: Fold rtl8723a_set_nav_upper() into rtl8723au_hal_init()
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/hal_com.c | 18 -- drivers/staging/rtl8723au/hal/usb_halinit.c | 4 +++- drivers/staging/rtl8723au/include/hal_com.h | 1 - 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/hal_com.c b/drivers/staging/rtl8723au/hal/hal_com.c index 4a66ed5..8f299ec 100644 --- a/drivers/staging/rtl8723au/hal/hal_com.c +++ b/drivers/staging/rtl8723au/hal/hal_com.c @@ -818,24 +818,6 @@ void rtl8723a_set_rxdma_agg_pg_th(struct rtw_adapter *padapter, u8 val) rtl8723au_write8(padapter, REG_RXDMA_AGG_PG_TH, val); } -void rtl8723a_set_nav_upper(struct rtw_adapter *padapter, u32 usNavUpper) -{ - if (usNavUpper HAL_8723A_NAV_UPPER_UNIT * 0xFF) { - RT_TRACE(_module_hal_init_c_, _drv_notice_, -(The setting value (0x%08X us) of NAV_UPPER - is larger than (%d * 0xFF)!!!\n, - usNavUpper, HAL_8723A_NAV_UPPER_UNIT)); - return; - } - - /* The value of ((usNavUpper + HAL_8723A_NAV_UPPER_UNIT - 1) / - HAL_8723A_NAV_UPPER_UNIT) */ - /* is getting the upper integer. */ - usNavUpper = (usNavUpper + HAL_8723A_NAV_UPPER_UNIT - 1) / - HAL_8723A_NAV_UPPER_UNIT; - rtl8723au_write8(padapter, REG_NAV_UPPER, (u8) usNavUpper); -} - void rtl8723a_set_initial_gain(struct rtw_adapter *padapter, u32 rx_gain) { struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c index b51762a..d896d06 100644 --- a/drivers/staging/rtl8723au/hal/usb_halinit.c +++ b/drivers/staging/rtl8723au/hal/usb_halinit.c @@ -780,7 +780,9 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter) rtl8723a_InitHalDm(Adapter); - rtl8723a_set_nav_upper(Adapter, WiFiNavUpperUs); + val8 = ((WiFiNavUpperUs + HAL_8723A_NAV_UPPER_UNIT - 1) / + HAL_8723A_NAV_UPPER_UNIT); + rtl8723au_write8(Adapter, REG_NAV_UPPER, val8); /* 2011/03/09 MH debug only, UMC-B cut pass 2500 S5 test, but we need to fin root cause. */ if (((rtl8723au_read32(Adapter, rFPGA0_RFMOD) 0xFF00) != diff --git a/drivers/staging/rtl8723au/include/hal_com.h b/drivers/staging/rtl8723au/include/hal_com.h index 6c2ca4f..7c31865 100644 --- a/drivers/staging/rtl8723au/include/hal_com.h +++ b/drivers/staging/rtl8723au/include/hal_com.h @@ -197,7 +197,6 @@ void rtl8723a_set_ac_param_vi(struct rtw_adapter *padapter, u32 vi); void rtl8723a_set_ac_param_be(struct rtw_adapter *padapter, u32 be); void rtl8723a_set_ac_param_bk(struct rtw_adapter *padapter, u32 bk); void rtl8723a_set_rxdma_agg_pg_th(struct rtw_adapter *padapter, u8 val); -void rtl8723a_set_nav_upper(struct rtw_adapter *padapter, u32 usNavUpper); void rtl8723a_set_initial_gain(struct rtw_adapter *padapter, u32 rx_gain); void rtl8723a_odm_support_ability_write(struct rtw_adapter *padapter, u32 val); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/29] staging: rtl8723au: Remove no-op rtl8723a_deinit_dm_priv()
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/rtl8723a_dm.c | 4 drivers/staging/rtl8723au/include/rtl8723a_dm.h | 1 - drivers/staging/rtl8723au/os_dep/os_intfs.c | 2 -- 3 files changed, 7 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c index bf1db90..4a3d2e1 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c @@ -260,7 +260,3 @@ void rtl8723a_init_dm_priv(struct rtw_adapter *Adapter) memset(pdmpriv, 0, sizeof(struct dm_priv)); Init_ODM_ComInfo_8723a(Adapter); } - -void rtl8723a_deinit_dm_priv(struct rtw_adapter *Adapter) -{ -} diff --git a/drivers/staging/rtl8723au/include/rtl8723a_dm.h b/drivers/staging/rtl8723au/include/rtl8723a_dm.h index ccac672..57be347 100644 --- a/drivers/staging/rtl8723au/include/rtl8723a_dm.h +++ b/drivers/staging/rtl8723au/include/rtl8723a_dm.h @@ -134,7 +134,6 @@ struct dm_priv /* */ void rtl8723a_init_dm_priv(struct rtw_adapter *padapter); -void rtl8723a_deinit_dm_priv(struct rtw_adapter *padapter); void rtl8723a_InitHalDm(struct rtw_adapter *padapter); void rtl8723a_HalDmWatchDog(struct rtw_adapter *padapter); diff --git a/drivers/staging/rtl8723au/os_dep/os_intfs.c b/drivers/staging/rtl8723au/os_dep/os_intfs.c index d72305d..a081e7a 100644 --- a/drivers/staging/rtl8723au/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723au/os_dep/os_intfs.c @@ -557,8 +557,6 @@ void rtw_cancel_all_timer23a(struct rtw_adapter *padapter) (%s:cancel set_scan_deny_timer!\n, __func__)); del_timer_sync(padapter-recvpriv.signal_stat_timer); - /* cancel dm timer */ - rtl8723a_deinit_dm_priv(padapter); } int rtw_free_drv_sw23a(struct rtw_adapter *padapter) -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 29/29] staging: rtl8723au: rtw_resume(): release semaphore before exit on error
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/os_dep/usb_intf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c b/drivers/staging/rtl8723au/os_dep/usb_intf.c index c75427f..06c885f 100644 --- a/drivers/staging/rtl8723au/os_dep/usb_intf.c +++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c @@ -505,8 +505,10 @@ static int rtw_resume(struct usb_interface *pusb_intf) pwrpriv-bkeepfwalive = false; DBG_8723A(bkeepfwalive(%x)\n, pwrpriv-bkeepfwalive); - if (pm_netdev_open23a(pnetdev, true) != 0) + if (pm_netdev_open23a(pnetdev, true) != 0) { + up(pwrpriv-lock); goto exit; + } netif_device_attach(pnetdev); netif_carrier_on(pnetdev); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/29] staging: rtl8723au: Reduce wrapper layers around hal_{de, }init() calls
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/usb_halinit.c | 52 +++- drivers/staging/rtl8723au/include/hal_intf.h | 4 +-- drivers/staging/rtl8723au/os_dep/os_intfs.c | 6 ++-- drivers/staging/rtl8723au/os_dep/usb_intf.c | 2 +- 4 files changed, 19 insertions(+), 45 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c index d896d06..681810e 100644 --- a/drivers/staging/rtl8723au/hal/usb_halinit.c +++ b/drivers/staging/rtl8723au/hal/usb_halinit.c @@ -534,7 +534,7 @@ enum rt_rf_power_state RfOnOffDetect23a(struct rtw_adapter *pAdapter) void _ps_open_RF23a(struct rtw_adapter *padapter); -static int rtl8723au_hal_init(struct rtw_adapter *Adapter) +int rtl8723au_hal_init(struct rtw_adapter *Adapter) { u8 val8 = 0; u32 boundary; @@ -545,6 +545,8 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter) unsigned long init_start_time = jiffies; + Adapter-hw_init_completed = false; + if (Adapter-pwrctrlpriv.bkeepfwalive) { _ps_open_RF23a(Adapter); @@ -796,6 +798,13 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter) rtl8723au_read32(Adapter, REG_FWHW_TXQ_CTRL)|BIT(12)); exit: + if (status == _SUCCESS) { + Adapter-hw_init_completed = true; + + if (Adapter-registrypriv.notch_filter == 1) + rtl8723a_notch_filter(Adapter, 1); + } + DBG_8723A(%s in %dms\n, __func__, jiffies_to_msecs(jiffies - init_start_time)); return status; @@ -1105,7 +1114,7 @@ static void CardDisableRTL8723U(struct rtw_adapter *Adapter) rtl8723au_write8(Adapter, REG_RSV_CTRL, 0x0e); } -static int rtl8723au_hal_deinit(struct rtw_adapter *padapter) +int rtl8723au_hal_deinit(struct rtw_adapter *padapter) { DBG_8723A(== %s\n, __func__); @@ -1118,6 +1127,8 @@ static int rtl8723au_hal_deinit(struct rtw_adapter *padapter) /* IC. Accord to johnny's opinion, only RU need the support. */ CardDisableRTL8723U(padapter); + padapter-hw_init_completed = false; + return _SUCCESS; } @@ -1543,40 +1554,3 @@ void rtl8723a_update_ramask(struct rtw_adapter *padapter, /* set correct initial date rate for each mac_id */ pdmpriv-INIDATA_RATE[mac_id] = init_rate; } - -int rtw_hal_init23a(struct rtw_adapter *padapter) -{ - int status; - - padapter-hw_init_completed = false; - - status = rtl8723au_hal_init(padapter); - - if (status == _SUCCESS) { - padapter-hw_init_completed = true; - - if (padapter-registrypriv.notch_filter == 1) - rtl8723a_notch_filter(padapter, 1); - } else { - padapter-hw_init_completed = false; - DBG_8723A(rtw_hal_init23a: hal__init fail\n); - } - - RT_TRACE(_module_hal_init_c_, _drv_err_, -(-rtl871x_hal_init:status = 0x%x\n, status)); - - return status; -} - -int rtw_hal_deinit23a(struct rtw_adapter *padapter) -{ - int status; - - status = rtl8723au_hal_deinit(padapter); - - if (status == _SUCCESS) - padapter-hw_init_completed = false; - else - DBG_8723A(\n rtw_hal_deinit23a: hal_init fail\n); - return status; -} diff --git a/drivers/staging/rtl8723au/include/hal_intf.h b/drivers/staging/rtl8723au/include/hal_intf.h index 04223b5..396decb 100644 --- a/drivers/staging/rtl8723au/include/hal_intf.h +++ b/drivers/staging/rtl8723au/include/hal_intf.h @@ -103,8 +103,8 @@ void rtw_hal_def_value_init23a(struct rtw_adapter *padapter); int pm_netdev_open23a(struct net_device *pnetdev, u8 bnormal); int rtw_resume_process23a(struct rtw_adapter *padapter); -int rtw_hal_init23a(struct rtw_adapter *padapter); -int rtw_hal_deinit23a(struct rtw_adapter *padapter); +int rtl8723au_hal_init(struct rtw_adapter *padapter); +int rtl8723au_hal_deinit(struct rtw_adapter *padapter); void rtw_hal_stop(struct rtw_adapter *padapter); void rtw_hal_update_ra_mask23a(struct sta_info *psta, u8 rssi_level); diff --git a/drivers/staging/rtl8723au/os_dep/os_intfs.c b/drivers/staging/rtl8723au/os_dep/os_intfs.c index a081e7a..b34eaec 100644 --- a/drivers/staging/rtl8723au/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723au/os_dep/os_intfs.c @@ -666,7 +666,7 @@ int netdev_open23a(struct net_device *pnetdev) padapter-bSurpriseRemoved = false; padapter-bCardDisableWOHSM = false; - status = rtw_hal_init23a(padapter); + status = rtl8723au_hal_init(padapter); if (status == _FAIL) { RT_TRACE(_module_os_intfs_c_, _drv_err_, (rtl871x_hal_init(): Can't init h/w!\n)); @@ -735,7 +735,7 @@ static int
[PATCH 24/29] staging: rtl8723au: odm_CommonInfoSelfInit23a(): Use proper register defines
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/odm.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index 1b39cbe..4e7a198 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -463,8 +463,10 @@ void ODM_CmnInfoUpdate23a(struct dm_odm_t *pDM_Odm, u32 CmnInfo, u64 Value) void odm_CommonInfoSelfInit23a(struct dm_odm_t *pDM_Odm ) { - pDM_Odm-bCckHighPower = (bool) ODM_GetBBReg(pDM_Odm, 0x824, BIT(9)); - pDM_Odm-RFPathRxEnable = (u8) ODM_GetBBReg(pDM_Odm, 0xc04, 0x0F); + pDM_Odm-bCckHighPower = + (bool) ODM_GetBBReg(pDM_Odm, rFPGA0_XA_HSSIParameter2, BIT(9)); + pDM_Odm-RFPathRxEnable = + (u8) ODM_GetBBReg(pDM_Odm, rOFDM0_TRxPathEnable, 0x0F); if (pDM_Odm-SupportICType ODM_RTL8723A) pDM_Odm-AntDivType = CGCS_RX_SW_ANTDIV; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/29] staging: rtl8723au: Declare odm_EdcaTurbo*() functions static
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/odm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index 3292b5f..dd02585 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -238,8 +238,8 @@ void odm_TXPowerTrackingCheckMP(struct dm_odm_t *pDM_Odm); void odm_TXPowerTrackingCheckCE23a(struct dm_odm_t *pDM_Odm); -void odm_EdcaTurboCheck23a(struct dm_odm_t *pDM_Odm); -void ODM_EdcaTurboInit23a(struct dm_odm_t *pDM_Odm); +static void odm_EdcaTurboCheck23a(struct dm_odm_t *pDM_Odm); +static void ODM_EdcaTurboInit23a(struct dm_odm_t *pDM_Odm); #defineRxDefaultAnt1 0x65a9 #defineRxDefaultAnt2 0x569a @@ -1609,7 +1609,7 @@ void odm_HwAntDiv23a(struct dm_odm_t *pDM_Odm) } /* EDCA Turbo */ -void ODM_EdcaTurboInit23a(struct dm_odm_t *pDM_Odm) +static void ODM_EdcaTurboInit23a(struct dm_odm_t *pDM_Odm) { struct rtw_adapter *Adapter = pDM_Odm-Adapter; @@ -1624,7 +1624,7 @@ void ODM_EdcaTurboInit23a(struct dm_odm_t *pDM_Odm) } /* ODM_InitEdcaTurbo */ -void odm_EdcaTurboCheck23a(struct dm_odm_t *pDM_Odm) +static void odm_EdcaTurboCheck23a(struct dm_odm_t *pDM_Odm) { struct rtw_adapter *Adapter = pDM_Odm-Adapter; struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/29] staging: rtl8723au: Eliminate ODM_CMNINFO_CHNL usage
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/odm.c | 10 +++--- drivers/staging/rtl8723au/hal/rtl8723a_dm.c | 2 -- drivers/staging/rtl8723au/include/odm.h | 4 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index a15a8cb..ac9be21 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -417,9 +417,6 @@ void ODM23a_CmnInfoHook(struct dm_odm_t *pDM_Odm, /* Hook call by reference pointer. */ switch (CmnInfo) { /* Dynamic call by reference pointer. */ - caseODM_CMNINFO_CHNL: - pDM_Odm-pChannel = (u8 *)pValue; - break; caseODM_CMNINFO_SCAN: pDM_Odm-pbScanInProcess = (bool *)pValue; break; @@ -505,11 +502,11 @@ static void odm_CommonInfoSelfUpdate(struct hal_data_8723a *pHalData) if (pHalData-CurrentChannelBW == HT_CHANNEL_WIDTH_40) { if (pHalData-nCur40MhzPrimeSC == 1) - pDM_Odm-ControlChannel = *(pDM_Odm-pChannel) - 2; + pDM_Odm-ControlChannel = pHalData-CurrentChannel - 2; else if (pHalData-nCur40MhzPrimeSC == 2) - pDM_Odm-ControlChannel = *(pDM_Odm-pChannel) + 2; + pDM_Odm-ControlChannel = pHalData-CurrentChannel + 2; } else { - pDM_Odm-ControlChannel = *(pDM_Odm-pChannel); + pDM_Odm-ControlChannel = pHalData-CurrentChannel; } for (i = 0; i ODM_ASSOCIATE_ENTRY_NUM; i++) { @@ -546,7 +543,6 @@ void odm_CmnInfoInit_Debug23a(struct dm_odm_t *pDM_Odm) void odm_CmnInfoHook_Debug23a(struct dm_odm_t *pDM_Odm) { ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (odm_CmnInfoHook_Debug23a ==\n)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (pChannel =%d\n, *(pDM_Odm-pChannel))); ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (pbScanInProcess =%d\n, *(pDM_Odm-pbScanInProcess))); ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (pbPowerSaving =%d\n, *(pDM_Odm-pbPowerSaving))); diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c index dfed57e..d1e4231 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c @@ -152,8 +152,6 @@ static void Update_ODM_ComInfo_8723a(struct rtw_adapter *Adapter) /* Pointer reference */ rtl8723a_odm_support_ability_set(Adapter, DYNAMIC_ALL_FUNC_ENABLE); - ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_CHNL, - pHalData-CurrentChannel); ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SCAN, pmlmepriv-bScanInProcess); ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_POWER_SAVING, pwrctrlpriv-bpower_saving); diff --git a/drivers/staging/rtl8723au/include/odm.h b/drivers/staging/rtl8723au/include/odm.h index be0b84f..022387b 100644 --- a/drivers/staging/rtl8723au/include/odm.h +++ b/drivers/staging/rtl8723au/include/odm.h @@ -319,8 +319,6 @@ enum odm_cmninfo { /* */ /* Dynamic value: */ /* */ - ODM_CMNINFO_CHNL, - ODM_CMNINFO_SCAN, ODM_CMNINFO_POWER_SAVING, ODM_CMNINFO_MP_MODE, @@ -686,8 +684,6 @@ struct dm_odm_t { boolbool_temp; struct rtw_adapter *PADAPTER_temp; - /* Central channel location Ch1/Ch2/ */ - u8 *pChannel; /* central channel number */ /* Common info for Status */ bool*pbScanInProcess; bool*pbPowerSaving; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/29] staging: rtl8723au: Eliminate obsolete odm_CmnInfoHook_Debug23a()
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/odm.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index 754b816..d420f33 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -170,8 +170,6 @@ static void odm_CommonInfoSelfUpdate(struct hal_data_8723a *pHalData); void odm_CmnInfoInit_Debug23a(struct dm_odm_t *pDM_Odm); -void odm_CmnInfoHook_Debug23a(struct dm_odm_t *pDM_Odm); - void odm_CmnInfoUpdate_Debug23a(struct dm_odm_t *pDM_Odm); /* START---DIG--- */ @@ -294,7 +292,6 @@ void ODM_DMWatchdog23a(struct rtw_adapter *adapter) struct pwrctrl_priv *pwrctrlpriv = adapter-pwrctrlpriv; /* 2012.05.03 Luke: For all IC series */ - odm_CmnInfoHook_Debug23a(pDM_Odm); odm_CmnInfoUpdate_Debug23a(pDM_Odm); odm_CommonInfoSelfUpdate(pHalData); odm_FalseAlarmCounterStatistics23a(pDM_Odm); @@ -536,11 +533,6 @@ void odm_CmnInfoInit_Debug23a(struct dm_odm_t *pDM_Odm) } -void odm_CmnInfoHook_Debug23a(struct dm_odm_t *pDM_Odm) -{ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (odm_CmnInfoHook_Debug23a ==\n)); -} - void odm_CmnInfoUpdate_Debug23a(struct dm_odm_t *pDM_Odm) { ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (odm_CmnInfoUpdate_Debug23a ==\n)); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/29] staging: rtl8723au: We don't need two APIs to set pHalData-odmpriv.SupportAbility
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/odm.c | 6 -- drivers/staging/rtl8723au/hal/rtl8723a_dm.c | 3 +-- drivers/staging/rtl8723au/include/odm.h | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index 491ba9c..c239b52 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -344,9 +344,6 @@ void ODM_CmnInfoInit23a(struct dm_odm_t *pDM_Odm, /* */ switch (CmnInfo) { /* Fixed ODM value. */ - caseODM_CMNINFO_ABILITY: - pDM_Odm-SupportAbility = (u32)Value; - break; caseODM_CMNINFO_PLATFORM: break; caseODM_CMNINFO_INTERFACE: @@ -461,9 +458,6 @@ void ODM_CmnInfoUpdate23a(struct dm_odm_t *pDM_Odm, u32 CmnInfo, u64 Value) { /* This init variable may be changed in run time. */ switch (CmnInfo) { - caseODM_CMNINFO_ABILITY: - pDM_Odm-SupportAbility = (u32)Value; - break; caseODM_CMNINFO_RF_TYPE: pDM_Odm-RFType = (u8)Value; break; diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c index 4383c43..204b4ad 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c @@ -150,8 +150,7 @@ static void Update_ODM_ComInfo_8723a(struct rtw_adapter *Adapter) ODM_RF_TX_PWR_TRACK | ODM_RF_CALIBRATION; /* Pointer reference */ - - ODM_CmnInfoUpdate23a(pDM_Odm, ODM_CMNINFO_ABILITY, pdmpriv-InitODMFlag); + rtl8723a_odm_support_ability_set(Adapter, DYNAMIC_ALL_FUNC_ENABLE); ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SEC_CHNL_OFFSET, pHalData-nCur40MhzPrimeSC); diff --git a/drivers/staging/rtl8723au/include/odm.h b/drivers/staging/rtl8723au/include/odm.h index 7598e61..546cbb5 100644 --- a/drivers/staging/rtl8723au/include/odm.h +++ b/drivers/staging/rtl8723au/include/odm.h @@ -300,7 +300,6 @@ enum odm_cmninfo { /* */ ODM_CMNINFO_PLATFORM = 0, - ODM_CMNINFO_ABILITY,/* enum odm_ability */ ODM_CMNINFO_INTERFACE, /* enum odm_interface_def */ ODM_CMNINFO_MP_TEST_CHIP, ODM_CMNINFO_IC_TYPE,/* enum odm_ic_type_def */ -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/29] staging: rtl8723au: Remove obsolete ODM23a_CmnInfoHook()
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/odm.c | 15 --- drivers/staging/rtl8723au/include/odm.h | 2 -- 2 files changed, 17 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index d420f33..1b39cbe 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -408,21 +408,6 @@ void ODM_CmnInfoInit23a(struct dm_odm_t *pDM_Odm, } -void ODM23a_CmnInfoHook(struct dm_odm_t *pDM_Odm, - enum odm_cmninfo CmnInfo, - void *pValue - ) -{ - /* Hook call by reference pointer. */ - switch (CmnInfo) { - /* Dynamic call by reference pointer. */ - /* To remove the compiler warning, must add an empty default statement to handle the other values. */ - default: - /* do nothing */ - break; - } -} - void ODM_CmnInfoPtrArrayHook23a(struct dm_odm_t *pDM_Odm, enum odm_cmninfo CmnInfo, u16 Index, void *pValue) { diff --git a/drivers/staging/rtl8723au/include/odm.h b/drivers/staging/rtl8723au/include/odm.h index 58875f4..80aa215 100644 --- a/drivers/staging/rtl8723au/include/odm.h +++ b/drivers/staging/rtl8723au/include/odm.h @@ -981,8 +981,6 @@ void ODM_DMWatchdog23a(struct rtw_adapter *adapter); void ODM_CmnInfoInit23a(struct dm_odm_t *pDM_Odm, enum odm_cmninfo CmnInfo, u32 Value); -void ODM23a_CmnInfoHook(struct dm_odm_t *pDM_Odm, enum odm_cmninfo CmnInfo, void *pValue); - void ODM_CmnInfoPtrArrayHook23a(struct dm_odm_t *pDM_Odm, enum odm_cmninfo CmnInfo, u16 Index, void *pValue); void ODM_CmnInfoUpdate23a(struct dm_odm_t *pDM_Odm, u32 CmnInfo, u64 Value); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/29] staging: rtl8723au: Remove useless ODM_CMNINFO_{WM_MODE, BAND} related code
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/hal/odm.c | 8 drivers/staging/rtl8723au/hal/rtl8723a_dm.c | 2 -- drivers/staging/rtl8723au/include/odm.h | 6 -- 3 files changed, 16 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index 4f25606..d931169 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -421,12 +421,6 @@ void ODM23a_CmnInfoHook(struct dm_odm_t *pDM_Odm, caseODM_CMNINFO_MAC_PHY_MODE: pDM_Odm-pMacPhyMode = (u8 *)pValue; break; - caseODM_CMNINFO_WM_MODE: - pDM_Odm-pWirelessMode = (u8 *)pValue; - break; - caseODM_CMNINFO_BAND: - pDM_Odm-pBandType = (u8 *)pValue; - break; caseODM_CMNINFO_SEC_CHNL_OFFSET: pDM_Odm-pSecChOffset = (u8 *)pValue; break; @@ -594,7 +588,6 @@ void odm_CmnInfoInit_Debug23a(struct dm_odm_t *pDM_Odm) void odm_CmnInfoHook_Debug23a(struct dm_odm_t *pDM_Odm) { ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (odm_CmnInfoHook_Debug23a ==\n)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (pWirelessMode = 0x%x\n, *(pDM_Odm-pWirelessMode))); ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (pSecChOffset =%d\n, *(pDM_Odm-pSecChOffset))); ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (pSecurity =%d\n, *(pDM_Odm-pSecurity))); ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (pBandWidth =%d\n, *(pDM_Odm-pBandWidth))); @@ -1193,7 +1186,6 @@ u32 ODM_Get_Rate_Bitmap23a(struct dm_odm_t *pDM_Odm, struct sta_info *pEntry; u32 rate_bitmap = 0x0fff; u8 WirelessMode; - /* u8 WirelessMode =*(pDM_Odm-pWirelessMode); */ pEntry = pDM_Odm-pODM_StaInfo[macid]; if (!pEntry) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c index 37a11c3..fe4754f 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_dm.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_dm.c @@ -154,8 +154,6 @@ static void Update_ODM_ComInfo_8723a(struct rtw_adapter *Adapter) ODM_CmnInfoUpdate23a(pDM_Odm, ODM_CMNINFO_ABILITY, pdmpriv-InitODMFlag); - ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_WM_MODE, - pmlmeext-cur_wireless_mode); ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SEC_CHNL_OFFSET, pHalData-nCur40MhzPrimeSC); ODM23a_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SEC_MODE, diff --git a/drivers/staging/rtl8723au/include/odm.h b/drivers/staging/rtl8723au/include/odm.h index d549b7f..6fa7de6 100644 --- a/drivers/staging/rtl8723au/include/odm.h +++ b/drivers/staging/rtl8723au/include/odm.h @@ -321,8 +321,6 @@ enum odm_cmninfo { /* Dynamic value: */ /* */ ODM_CMNINFO_MAC_PHY_MODE, /* enum odm_mac_phy_mode */ - ODM_CMNINFO_WM_MODE,/* enum odm_wireless_mode */ - ODM_CMNINFO_BAND, /* enum odm_band_type */ ODM_CMNINFO_SEC_CHNL_OFFSET,/* enum odm_sec_chnl_offset */ ODM_CMNINFO_SEC_MODE, /* enum odm_security */ ODM_CMNINFO_BW, /* enum odm_band_width */ @@ -713,10 +711,6 @@ struct dm_odm_t { /* MAC PHY Mode SMSP/DMSP/DMDP = 0/1/2 */ u8 *pMacPhyMode; - /* Wireless mode B/G/A/N = BIT0/BIT1/BIT2/BIT3 */ - u8 *pWirelessMode; /* enum odm_wireless_mode */ - /* Frequence band 2.4G/5G = 0/1 */ - u8 *pBandType; /* Secondary channel offset don't_care/below/above = 0/1/2 */ u8 *pSecChOffset; /* Security mode Open/WEP/AES/TKIP = 0/1/2/3 */ -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation
On Fri, Jul 18, 2014 at 12:55 PM, Yue Zhang yue...@microsoft.com wrote: From: Yue Zhang yue...@microsoft.com This patch addresses the comment from Olaf Hering and Greg KH for a previous commit 3a494e710367 (hyperv: Add handler for RNDIS_STATUS_NETWORK_CHANGE event) In previous solution, the driver calls network restart to force a DHCP renew when the host is back from hibernation. In this fix, the driver will keep network carrier offline for 10 seconds and then bring it back. So that ifplugd daemon will notice this change and refresh DHCP lease. Cc: Haiyang Zhang haiya...@microsoft.com Cc: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Yue Zhang yue...@microsoft.com --- drivers/net/hyperv/netvsc_drv.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index a9c5eaa..559c97d 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -33,6 +33,7 @@ #include linux/if_vlan.h #include linux/in.h #include linux/slab.h +#include linux/delay.h #include net/arp.h #include net/route.h #include net/sock.h @@ -792,8 +793,7 @@ static void netvsc_link_change(struct work_struct *w) struct netvsc_device *net_device; struct rndis_device *rdev; bool notify, refresh = false; - char *argv[] = { /etc/init.d/network, restart, NULL }; - char *envp[] = { HOME=/, PATH=/sbin:/usr/sbin:/bin:/usr/bin, NULL }; + int delay; rtnl_lock(); @@ -816,8 +816,21 @@ static void netvsc_link_change(struct work_struct *w) rtnl_unlock(); - if (refresh) - call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC); + if (refresh) { + /* +* Keep the carrier offline for 10 seconds +* to notify ifplugd daemon network change +*/ + for (delay = 0; delay 10; delay++) { + rtnl_lock(); + netif_carrier_off(net); + rtnl_unlock(); + ssleep(1); + } + rtnl_lock(); + netif_carrier_on(net); + rtnl_unlock(); + } Why is it necessary to wait for ten seconds? Why not just: if (refresh) { rtnl_lock(); netif_carrier_off(net); netif_carrier_on(net); rtnl_unlock(); } At least systemd-networkd will renew the dhcp lease as long as it gets NEWLINK messages indicating that the carrier was lost and regained, regardless of the time between events. Is there any reason not to do this? Cheers, Tom if (notify) netdev_notify_peers(net); -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 1/3] staging: lustre: lov: Cleanup lov_check_set() in lov_request.c
Make the code clearer by introducing a local variable and removing the unnecessary 'if' statement. Signed-off-by: Riccardo Lucchese riccardo.lucch...@gmail.com Acked-by: Julia Lawall julia.law...@lip6.fr --- Changes in v3: - Renamed the local variable 'desc' to 'tgt' to be consistent with other definitions in the driver. Changes in v2: - Improved the commit message: - changed the subject line to follow the same convention used by previous commits to the same file. - rewrote the message body using a more formal language. - Introduced a local variable to make the code clearer. - Added Acked-by - Julia. drivers/staging/lustre/lustre/lov/lov_request.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c index ce830e4..da424de 100644 --- a/drivers/staging/lustre/lustre/lov/lov_request.c +++ b/drivers/staging/lustre/lustre/lov/lov_request.c @@ -140,14 +140,14 @@ void lov_set_add_req(struct lov_request *req, struct lov_request_set *set) static int lov_check_set(struct lov_obd *lov, int idx) { - int rc = 0; + int rc; + struct lov_tgt_desc *tgt; mutex_lock(lov-lov_lock); - if (lov-lov_tgts[idx] == NULL || - lov-lov_tgts[idx]-ltd_active || - (lov-lov_tgts[idx]-ltd_exp != NULL -class_exp2cliimp(lov-lov_tgts[idx]-ltd_exp)-imp_connect_tried)) - rc = 1; + tgt = lov-lov_tgts[idx]; + rc = !tgt || tgt-ltd_active || + (tgt-ltd_exp +class_exp2cliimp(tgt-ltd_exp)-imp_connect_tried); mutex_unlock(lov-lov_lock); return rc; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
staging: lustre: lov: Cleanup style issues in lov_request.c
Hello, This patch series contains one cleanup and two coding style fixes for lov_request.c. This iteration addresses the review comments received by v2. Changes in v3: - Renamed the local variable introduced in v2-1/3 to be consistent with other definitions in the driver. Changes in v2: - Improved the commit messages. - Introduced a local variable in lov_check_set() to make the code clearer. Thanks, riccardo ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 3/3] staging: lustre: lov: Add a space before open braces '{' in lov_request.c
Fix the following checkpatch.pl issue in lov_request.c: ERROR: space required before the open brace '{' Signed-off-by: Riccardo Lucchese riccardo.lucch...@gmail.com Acked-by: Julia Lawall julia.law...@lip6.fr --- No changes in v3. Changes in v2: - Changed the subject line to follow the same convention used by previous commits to the same file. - Added Acked-by - Julia. drivers/staging/lustre/lustre/lov/lov_request.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c index 887b4b0..e4bb02a 100644 --- a/drivers/staging/lustre/lustre/lov/lov_request.c +++ b/drivers/staging/lustre/lustre/lov/lov_request.c @@ -478,7 +478,7 @@ int lov_prep_match_set(struct obd_export *exp, struct obd_info *oinfo, GOTO(out_set, rc = -ENOMEM); lockh-cookie = set-set_lockh-llh_handle.h_cookie; - for (i = 0; i lsm-lsm_stripe_count; i++){ + for (i = 0; i lsm-lsm_stripe_count; i++) { struct lov_oinfo *loi; struct lov_request *req; obd_off start, end; @@ -566,7 +566,7 @@ int lov_prep_cancel_set(struct obd_export *exp, struct obd_info *oinfo, } lockh-cookie = set-set_lockh-llh_handle.h_cookie; - for (i = 0; i lsm-lsm_stripe_count; i++){ + for (i = 0; i lsm-lsm_stripe_count; i++) { struct lov_request *req; struct lustre_handle *lov_lockhp; struct lov_oinfo *loi = lsm-lsm_oinfo[i]; @@ -734,7 +734,7 @@ int lov_prep_brw_set(struct obd_export *exp, struct obd_info *oinfo, /* alloc and initialize lov request */ shift = 0; - for (i = 0; i oinfo-oi_md-lsm_stripe_count; i++){ + for (i = 0; i oinfo-oi_md-lsm_stripe_count; i++) { struct lov_oinfo *loi = NULL; struct lov_request *req; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH] Hyperv: Trigger DHCP renew after host hibernation
From: Tom Gundersen [mailto:t...@jklm.no] Sent: Monday, July 21, 2014 5:42 PM On Fri, Jul 18, 2014 at 12:55 PM, Yue Zhang yue...@microsoft.com wrote: From: Yue Zhang yue...@microsoft.com This patch addresses the comment from Olaf Hering and Greg KH for a previous commit 3a494e710367 (hyperv: Add handler for RNDIS_STATUS_NETWORK_CHANGE event) In previous solution, the driver calls network restart to force a DHCP renew when the host is back from hibernation. In this fix, the driver will keep network carrier offline for 10 seconds and then bring it back. So that ifplugd daemon will notice this change and refresh DHCP lease. Cc: Haiyang Zhang haiya...@microsoft.com Cc: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Yue Zhang yue...@microsoft.com --- drivers/net/hyperv/netvsc_drv.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index a9c5eaa..559c97d 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -33,6 +33,7 @@ #include linux/if_vlan.h #include linux/in.h #include linux/slab.h +#include linux/delay.h #include net/arp.h #include net/route.h #include net/sock.h @@ -792,8 +793,7 @@ static void netvsc_link_change(struct work_struct *w) struct netvsc_device *net_device; struct rndis_device *rdev; bool notify, refresh = false; - char *argv[] = { /etc/init.d/network, restart, NULL }; - char *envp[] = { HOME=/, PATH=/sbin:/usr/sbin:/bin:/usr/bin, NULL }; + int delay; rtnl_lock(); @@ -816,8 +816,21 @@ static void netvsc_link_change(struct work_struct *w) rtnl_unlock(); - if (refresh) - call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC); + if (refresh) { + /* +* Keep the carrier offline for 10 seconds +* to notify ifplugd daemon network change +*/ + for (delay = 0; delay 10; delay++) { + rtnl_lock(); + netif_carrier_off(net); + rtnl_unlock(); + ssleep(1); + } + rtnl_lock(); + netif_carrier_on(net); + rtnl_unlock(); + } Why is it necessary to wait for ten seconds? Why not just: if (refresh) { rtnl_lock(); netif_carrier_off(net); netif_carrier_on(net); rtnl_unlock(); } At least systemd-networkd will renew the dhcp lease as long as it gets NEWLINK messages indicating that the carrier was lost and regained, regardless of the time between events. Is there any reason not to do this? Cheers, Tom Hi, Tom Some network monitoring daemon, like ifplugd has a deferring mechanism. When it detects carriers is offline, it doesn't trigger DHCP renew immediately. Instead it will wait for another 5 seconds to check whether carrier is back to online status. In that case, it will avoid renew DHCP lease. And also there is some optimization in Linux's network stack. If link state flipped so quickly, like the code you proposed. It is very likely the event won't be delivered to user space. Thanks --- Yue ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/7] staging: comedi: core: checkpatch.pl --strict cleanup
On 2014-07-18 22:28, H Hartley Sweeten wrote: comedi_fops.c also still has a couple: CHECK: if this code is redundant consider removing it Two of them deal with #if 0'ed code in do_lock_ioctl() and do_unlock_ioctl(). The disabled code would call the subdevice (*lock_f) and (*unlock) callbacks. I'm not sure why this code is disabled. Hopefully Ian can provide some info. It was added in comedi-0.7.6 back in June 1999 and has always been commented out. Should be safe to remove it! There is also some disabled code in do_chaninfo_ioctl() that does a copy_to_user(). Again, I'm not sure why this is disabled. It was replaced by the code above it in comedi-0.7.40, although the format of the rangelist[] values returned to the user changed in comedi-0.7.43. I need to check what uses the various bits of the rangelist[] elements. Putting the minor device number in there doesn't seem terribly useful, for example, especially as only 4 bits are provided to hold it. -- -=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: drivers: remove unnecessary *_{IO, MEM}SIZE defines
On 2014-07-19 01:23, H Hartley Sweeten wrote: Some of the legacy comedi drivers have a *_{IO,MEM}SIZE define that is only passed to comedi_request_region() to specify the size of the region. For aesthetics, remove these defines. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gr...@linuxfoundation.org --- drivers/staging/comedi/drivers/dmm32at.c | 5 + drivers/staging/comedi/drivers/dt2801.c | 5 + drivers/staging/comedi/drivers/rti800.c | 4 +--- 3 files changed, 3 insertions(+), 11 deletions(-) Reviewed-by: Ian Abbott abbo...@mev.co.uk -- -=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 7/9] staging: comedi: drivers: remove unnecessary *_SIZE defines
On 2014-07-19 01:01, H Hartley Sweeten wrote: Some of the legacy comedi drivers have a *_SIZE define that is only passed to comedi_request_region() to specify the size of the region. Some of the pnp drivers (pci, etc.) also have a *_SIZE define which is unused. For aesthetics, remove these defines. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gr...@linuxfoundation.org The patch is fine, although the non-power-of-2 wacko sizes in the original code ought to be rounded up. diff --git a/drivers/staging/comedi/drivers/dt2817.c b/drivers/staging/comedi/drivers/dt2817.c index bf58993..5131dee 100644 --- a/drivers/staging/comedi/drivers/dt2817.c +++ b/drivers/staging/comedi/drivers/dt2817.c @@ -36,8 +36,6 @@ Configuration options: #include linux/module.h #include ../comedidev.h -#define DT2817_SIZE 5 - #define DT2817_CR 0 #define DT2817_DATA 1 @@ -114,7 +112,7 @@ static int dt2817_attach(struct comedi_device *dev, struct comedi_devconfig *it) int ret; struct comedi_subdevice *s; - ret = comedi_request_region(dev, it-options[0], DT2817_SIZE); + ret = comedi_request_region(dev, it-options[0], 0x5); if (ret) return ret; I.e., that one should be rounded up to 8. diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c b/drivers/staging/comedi/drivers/ni_at_a2150.c index 76fed31..de67161 100644 --- a/drivers/staging/comedi/drivers/ni_at_a2150.c +++ b/drivers/staging/comedi/drivers/ni_at_a2150.c @@ -71,7 +71,6 @@ TRIG_WAKE_EOS #include 8253.h #include comedi_fc.h -#define A2150_SIZE 28 #define A2150_DMA_BUFFER_SIZE 0xff00 /* size in bytes of dma buffer */ /* Registers and bits */ @@ -702,7 +701,7 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it) if (!devpriv) return -ENOMEM; - ret = comedi_request_region(dev, it-options[0], A2150_SIZE); + ret = comedi_request_region(dev, it-options[0], 0x1c); if (ret) return ret; And that one should be rounded up to 0x20. -- -=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags
On Sun, Jul 20, 2014 at 08:33:42PM -0700, K. Y. Srinivasan wrote: Add blist flags to permit the reading of the VPD pages even when the target may claim SPC-2 compliance. MSFT targets currently claim SPC-2 compliance while they implement post SPC-2 features. With this patch we can correctly handle WRITE_SAME_16 issues. Signed-off-by: K. Y. Srinivasan k...@microsoft.com This looks way to complicated - should be a single line added to your slave_configure function, maybe plus a comment stating what you do in your commit message: sdev-sdev_bflags |= BLIST_TRY_VPD_PAGES; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/9] staging: comedi: misc. cleanup
On 2014-07-19 01:01, H Hartley Sweeten wrote: Some misc. cleanup for comedi that I have had sitting around... H Hartley Sweeten (9): staging: comedi: drivers: cleanup cmd-flags use staging: comedi: ni_at_a2150: remove forward declarations staging: comedi: ni_pcidio: remove forward declarations staging: comedi: pcm3724: use default (*io) callback from 8255 module staging: comedi: pcl816: remove forward declaration staging: comedi: drivers: remove unnecessary PCI_DEVICE_ID_* defines staging: comedi: drivers: remove unnecessary *_SIZE defines staging: comedi: drivers: remove unnecessary DRIVER_NAME defines staging: comedi: drivers: use dev-board_name in request_irq() Reminds me I need to work on some of those Amplicon drivers! Reviewed-by: Ian Abbott abbo...@mev.co.uk -- -=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/nvec: Pass proper resource to mfd_add_devices()
From: Thierry Reding tred...@nvidia.com The mfd_add_devices() parameter takes a struct resource * as fifth argument, but the nvec driver passes in a void __iomem *. The driver gets away with it because none of the subdevices ever directly access the registers. While at it, use platform_get_irq() instead of platform_get_resource() to get the device's interrupt. This makes it easier to pass in the register region since the variable is no longer reused. Signed-off-by: Thierry Reding tred...@nvidia.com --- Alternatively we could simply pass NULL into mfd_add_devices(), which might be a slightly more accurate representation of what's going on. Marc, Greg, any preferences? drivers/staging/nvec/nvec.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index d32504844896..11f9e1c3447c 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -821,8 +821,8 @@ static int tegra_nvec_probe(struct platform_device *pdev) if (IS_ERR(base)) return PTR_ERR(base); - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!res) { + nvec-irq = platform_get_irq(pdev, 0); + if (nvec-irq 0) { dev_err(pdev-dev, no irq resource?\n); return -ENODEV; } @@ -840,7 +840,6 @@ static int tegra_nvec_probe(struct platform_device *pdev) } nvec-base = base; - nvec-irq = res-start; nvec-i2c_clk = i2c_clk; nvec-rx = nvec-msg_pool[0]; @@ -893,7 +892,7 @@ static int tegra_nvec_probe(struct platform_device *pdev) } ret = mfd_add_devices(nvec-dev, -1, nvec_devices, - ARRAY_SIZE(nvec_devices), base, 0, NULL); + ARRAY_SIZE(nvec_devices), res, 0, NULL); if (ret) dev_err(nvec-dev, error adding subdevices\n); -- 2.0.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/nvec: Remove double const qualifier
From: Thierry Reding tred...@nvidia.com The SIMPLE_DEV_PM_OPS macro already uses the const qualifier, so there's no need to repeat it. Signed-off-by: Thierry Reding tred...@nvidia.com --- drivers/staging/nvec/nvec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 11f9e1c3447c..aef52306620a 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -959,7 +959,7 @@ static int nvec_resume(struct device *dev) } #endif -static const SIMPLE_DEV_PM_OPS(nvec_pm_ops, nvec_suspend, nvec_resume); +static SIMPLE_DEV_PM_OPS(nvec_pm_ops, nvec_suspend, nvec_resume); /* Match table for of_platform binding */ static const struct of_device_id nvidia_nvec_of_match[] = { -- 2.0.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags
-Original Message- From: Christoph Hellwig [mailto:h...@infradead.org] Sent: Monday, July 21, 2014 4:27 AM To: KY Srinivasan Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; oher...@suse.com; a...@canonical.com; jasow...@redhat.com; jbottom...@parallels.com; h...@infradead.org; linux-s...@vger.kernel.org Subject: Re: [PATCH 1/1] Drivers: scsi: storvsc: Add blist flags On Sun, Jul 20, 2014 at 08:33:42PM -0700, K. Y. Srinivasan wrote: Add blist flags to permit the reading of the VPD pages even when the target may claim SPC-2 compliance. MSFT targets currently claim SPC-2 compliance while they implement post SPC-2 features. With this patch we can correctly handle WRITE_SAME_16 issues. Signed-off-by: K. Y. Srinivasan k...@microsoft.com This looks way to complicated - should be a single line added to your slave_configure function, maybe plus a comment stating what you do in your commit message: sdev-sdev_bflags |= BLIST_TRY_VPD_PAGES; Thanks Christoph. We can go with this. I will re-send the patch. K. Y ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/8] staging: unisys: add toolaction to sysfs
On Sat, 2014-07-19 at 09:36 -0700, Greg KH wrote: /* /sys/devices/platform/visorchipset */ static struct platform_device Visorchipset_platform_device = { .name = visorchipset, .id = -1, + .dev.groups = visorchipset_dev_groups, Only create this device when ControlVm_channel is present in the system, that should take out your check for it in the show/store function. Same goes for the rest of these patches. thanks, greg k-h I'm not sure I understand. Do you mean that we should only create sysfs devices dynamically, and not use a static here? I assume that any other sysfs devices in our driver set created this way would have the same issue? -- Ben Romer | Software Engineer | Virtual Systems Development Unisys Corporation | 2476 Swedesford Rd | Malvern, PA 19355 | 610-648-7140 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: ni_65xx: don't invert outputs by default
This driver currently inverts the outputs for the DO (digital output) subdevice for some of the boards it supports, indicated by the `invert_outputs` member in the board-specific data being initialized to 1. It seems this driver shouldn't really be inverting outputs for these boards at all, but has done so since the driver was first written back in October 2006. I've had confirmation that for the PCI-6515 at least, the output voltage levels are opposite to the values set by the user program. The driver by Jon Grierson originally supported only PCI-6514 and PXI-6514 (and was originally called ni_6514). The driver was based on ni_6527, which is where the inversion of outputs appears to have come from. Over a period of a few days, the driver was enhanced by Frank Mori Hess to support other boards. Some of these plainly didn't require inverted outputs and some guesswork was used to decide which boards should have inverted outputs. Some of the boards in question are described in the manual as having Sink Outputs and others are described as having Source Outputs, but this does not correspond in any way with which boards are marked as having inverted outputs, so the criterion that Frank used is a bit of a mystery! Change the driver so it doesn't invert the outputs of these by boards by default, but add a module parameter, legacy_invert_outputs, that can be set to 'true' to restore the old behaviour. Also rename the `invert_outputs` member of `struct ni_65xx_board` to `legacy_invert`. Signed-off-by: Ian Abbott abbo...@mev.co.uk --- drivers/staging/comedi/drivers/ni_65xx.c | 47 ++-- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c index cad2c28..aba6fbb 100644 --- a/drivers/staging/comedi/drivers/ni_65xx.c +++ b/drivers/staging/comedi/drivers/ni_65xx.c @@ -47,13 +47,21 @@ * (National Instruments) PXI-6521 [ni_65xx] * (National Instruments) PCI-6528 [ni_65xx] * (National Instruments) PXI-6528 [ni_65xx] - * Updated: Wed Oct 18 08:59:11 EDT 2006 + * Updated: Mon, 21 Jul 2014 12:49:58 + * * Configuration Options: not applicable, uses PCI auto config * * Based on the PCI-6527 driver by ds. * The interrupt subdevice (subdevice 3) is probably broken for all * boards except maybe the 6514. + * + * This driver previously inverted the outputs on PCI-6513 through to + * PCI-6519 and on PXI-6513 through to PXI-6515. It no longer inverts + * outputs on those cards by default as it didn't make much sense. If + * you require the outputs to be inverted on those cards for legacy + * reasons, set the module parameter legacy_invert_outputs=true when + * loading the module, or set ni_65xx.legacy_invert_outputs=true on + * the kernel command line if the driver is built in to the kernel. */ /* @@ -163,7 +171,7 @@ struct ni_65xx_board { unsigned num_dio_ports; unsigned num_di_ports; unsigned num_do_ports; - unsigned invert_outputs:1; + unsigned legacy_invert:1; }; static const struct ni_65xx_board ni_65xx_boards[] = { @@ -198,58 +206,58 @@ static const struct ni_65xx_board ni_65xx_boards[] = { [BOARD_PCI6513] = { .name = pci-6513, .num_do_ports = 8, - .invert_outputs = 1, + .legacy_invert = 1, }, [BOARD_PXI6513] = { .name = pxi-6513, .num_do_ports = 8, - .invert_outputs = 1, + .legacy_invert = 1, }, [BOARD_PCI6514] = { .name = pci-6514, .num_di_ports = 4, .num_do_ports = 4, - .invert_outputs = 1, + .legacy_invert = 1, }, [BOARD_PXI6514] = { .name = pxi-6514, .num_di_ports = 4, .num_do_ports = 4, - .invert_outputs = 1, + .legacy_invert = 1, }, [BOARD_PCI6515] = { .name = pci-6515, .num_di_ports = 4, .num_do_ports = 4, - .invert_outputs = 1, + .legacy_invert = 1, }, [BOARD_PXI6515] = { .name = pxi-6515, .num_di_ports = 4, .num_do_ports = 4, - .invert_outputs = 1, + .legacy_invert = 1, }, [BOARD_PCI6516] = { .name = pci-6516, .num_do_ports = 4, - .invert_outputs = 1, + .legacy_invert = 1, }, [BOARD_PCI6517] = { .name = pci-6517, .num_do_ports = 4, - .invert_outputs = 1, + .legacy_invert = 1, }, [BOARD_PCI6518] = {
Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation
On Mon, Jul 21, 2014 at 12:21 PM, Yue Zhang (OSTC DEV) yue...@microsoft.com wrote: From: Tom Gundersen [mailto:t...@jklm.no] Sent: Monday, July 21, 2014 5:42 PM On Fri, Jul 18, 2014 at 12:55 PM, Yue Zhang yue...@microsoft.com wrote: From: Yue Zhang yue...@microsoft.com This patch addresses the comment from Olaf Hering and Greg KH for a previous commit 3a494e710367 (hyperv: Add handler for RNDIS_STATUS_NETWORK_CHANGE event) In previous solution, the driver calls network restart to force a DHCP renew when the host is back from hibernation. In this fix, the driver will keep network carrier offline for 10 seconds and then bring it back. So that ifplugd daemon will notice this change and refresh DHCP lease. Cc: Haiyang Zhang haiya...@microsoft.com Cc: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Yue Zhang yue...@microsoft.com --- drivers/net/hyperv/netvsc_drv.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index a9c5eaa..559c97d 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -33,6 +33,7 @@ #include linux/if_vlan.h #include linux/in.h #include linux/slab.h +#include linux/delay.h #include net/arp.h #include net/route.h #include net/sock.h @@ -792,8 +793,7 @@ static void netvsc_link_change(struct work_struct *w) struct netvsc_device *net_device; struct rndis_device *rdev; bool notify, refresh = false; - char *argv[] = { /etc/init.d/network, restart, NULL }; - char *envp[] = { HOME=/, PATH=/sbin:/usr/sbin:/bin:/usr/bin, NULL }; + int delay; rtnl_lock(); @@ -816,8 +816,21 @@ static void netvsc_link_change(struct work_struct *w) rtnl_unlock(); - if (refresh) - call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC); + if (refresh) { + /* +* Keep the carrier offline for 10 seconds +* to notify ifplugd daemon network change +*/ + for (delay = 0; delay 10; delay++) { + rtnl_lock(); + netif_carrier_off(net); + rtnl_unlock(); + ssleep(1); + } + rtnl_lock(); + netif_carrier_on(net); + rtnl_unlock(); + } Why is it necessary to wait for ten seconds? Why not just: if (refresh) { rtnl_lock(); netif_carrier_off(net); netif_carrier_on(net); rtnl_unlock(); } At least systemd-networkd will renew the dhcp lease as long as it gets NEWLINK messages indicating that the carrier was lost and regained, regardless of the time between events. Is there any reason not to do this? Cheers, Tom Hi, Tom Some network monitoring daemon, like ifplugd has a deferring mechanism. When it detects carriers is offline, it doesn't trigger DHCP renew immediately. Instead it will wait for another 5 seconds to check whether carrier is back to online status. In that case, it will avoid renew DHCP lease. And also there is some optimization in Linux's network stack. If link state flipped so quickly, like the code you proposed. It is very likely the event won't be delivered to user space. Ah, ok, I don't know the kernel side of this too well, you may need some sort of flush or sync between the calls I suggested. At any rate, I would say that the solution should be to send a lower down followed immediately by lower up and never have any sort of timeout. All the drivers I have tried send out such events immediately when the machine is resumed, so I guess most network software should know how to deal with that. I really think the policy of what to do in response to the various events should be left to userspace to figure out. Cheers, Tom ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/8] staging: unisys: add toolaction to sysfs
On Mon, Jul 21, 2014 at 08:36:02AM -0500, Romer, Benjamin M wrote: On Sat, 2014-07-19 at 09:36 -0700, Greg KH wrote: /* /sys/devices/platform/visorchipset */ static struct platform_device Visorchipset_platform_device = { .name = visorchipset, .id = -1, + .dev.groups = visorchipset_dev_groups, Only create this device when ControlVm_channel is present in the system, that should take out your check for it in the show/store function. Same goes for the rest of these patches. thanks, greg k-h I'm not sure I understand. Do you mean that we should only create sysfs devices dynamically, and not use a static here? Ideally yes. But that's not what I was referring to. Only create this sysfs device when ControlVm_channel is created, that way you will not have to check for it in your sysfs show/store functions. I assume that any other sysfs devices in our driver set created this way would have the same issue? yes. thanks greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: comedi: ni_6527: support INSN_CONFIG_DIGITAL_TRIG
The edge detection interrupt subdevice supports the `INSN_CONFIG_CHANGE_NOTIFY` comedi instruction which is only supported by one other driver. The `INSN_CONFIG_DIGITAL_TRIG` comedi instruction is more flexible as it supports both edge and level detection, but is not currently supported by this driver. Add partial support for `INSN_CONFIG_DIGITAL_TRIG`, but only for edge detection. Make use of the `ni6527_set_edge_detection()` used for `INSN_CONFIG_CHANGE_NOTIFY`, but add a parameter holding a mask of the rising and falling edges to be updated and preserve the unmasked edges when updating. Signed-off-by: Ian Abbott abbo...@mev.co.uk --- drivers/staging/comedi/drivers/ni_6527.c | 72 +++- 1 file changed, 61 insertions(+), 11 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_6527.c b/drivers/staging/comedi/drivers/ni_6527.c index c8b1fa7..57d8d4c 100644 --- a/drivers/staging/comedi/drivers/ni_6527.c +++ b/drivers/staging/comedi/drivers/ni_6527.c @@ -299,21 +299,38 @@ static int ni6527_intr_insn_bits(struct comedi_device *dev, } static void ni6527_set_edge_detection(struct comedi_device *dev, + unsigned int mask, unsigned int rising, unsigned int falling) { struct ni6527_private *devpriv = dev-private; void __iomem *mmio = devpriv-mmio_base; - - /* enable rising-edge detection channels */ - writeb(rising 0xff, mmio + NI6527_RISING_EDGE_REG(0)); - writeb((rising 8) 0xff, mmio + NI6527_RISING_EDGE_REG(1)); - writeb((rising 16) 0xff, mmio + NI6527_RISING_EDGE_REG(2)); - - /* enable falling-edge detection channels */ - writeb(falling 0xff, mmio + NI6527_FALLING_EDGE_REG(0)); - writeb((falling 8) 0xff, mmio + NI6527_FALLING_EDGE_REG(1)); - writeb((falling 16) 0xff, mmio + NI6527_FALLING_EDGE_REG(2)); + unsigned int i; + + rising = mask; + falling = mask; + for (i = 0; i 2; i++) { + if (mask 0xff) { + if (~mask 0xff) { + /* preserve rising-edge detection channels */ + rising |= readb(mmio + + NI6527_RISING_EDGE_REG(i)) + (~mask 0xff); + /* preserve falling-edge detection channels */ + falling |= readb(mmio + +NI6527_FALLING_EDGE_REG(i)) + (~mask 0xff); + } + /* update rising-edge detection channels */ + writeb(rising 0xff, mmio + NI6527_RISING_EDGE_REG(i)); + /* update falling-edge detection channels */ + writeb(falling 0xff, + mmio + NI6527_FALLING_EDGE_REG(i)); + } + rising = 8; + falling = 8; + mask = 8; + } } static int ni6527_intr_insn_config(struct comedi_device *dev, @@ -321,12 +338,45 @@ static int ni6527_intr_insn_config(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { + unsigned int mask = 0x; + unsigned int rising, falling, shift; + switch (data[0]) { case INSN_CONFIG_CHANGE_NOTIFY: /* check_insn_config_length() does not check this instruction */ if (insn-n != 3) return -EINVAL; - ni6527_set_edge_detection(dev, data[1], data[2]); + rising = data[1]; + falling = data[2]; + ni6527_set_edge_detection(dev, mask, rising, falling); + break; + case INSN_CONFIG_DIGITAL_TRIG: + /* check trigger number */ + if (data[1] != 0) + return -EINVAL; + /* check digital trigger operation */ + switch (data[2]) { + case COMEDI_DIGITAL_TRIG_DISABLE: + rising = 0; + falling = 0; + break; + case COMEDI_DIGITAL_TRIG_ENABLE_EDGES: + /* check shift amount */ + shift = data[3]; + if (shift = s-n_chan) { + mask = 0; + rising = 0; + falling = 0; + } else { + mask = shift; + rising = data[4] shift; + falling = data[5] shift; + } + break; + default: + return -EINVAL; +
[PATCH 0/2] staging: comedi: ni_6527 edge detection changes
Add partial support for INSN_CONFIG_DIGITAL_TRIG as an alternative to INSN_CONFIG_CHANGE_NOTIFY, and initialize the edge detection registers. 1) staging: comedi: ni_6527: support INSN_CONFIG_DIGITAL_TRIG 2) staging: comedi: ni_6527: reset edge detection registers drivers/staging/comedi/drivers/ni_6527.c | 75 +++- 1 file changed, 64 insertions(+), 11 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: comedi: ni_6527: reset edge detection registers
`ni6527_reset()` is called to reset various registers when the device is being initialized or deinitialized. The edge detection interrupt is disabled by this function, but the rising and falling edge detection registers are currently left alone. Call `ni6527_set_edge_detection()` to set them to a known, disabled state. Signed-off-by: Ian Abbott abbo...@mev.co.uk --- drivers/staging/comedi/drivers/ni_6527.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/comedi/drivers/ni_6527.c b/drivers/staging/comedi/drivers/ni_6527.c index 57d8d4c..8ea93b5 100644 --- a/drivers/staging/comedi/drivers/ni_6527.c +++ b/drivers/staging/comedi/drivers/ni_6527.c @@ -393,6 +393,9 @@ static void ni6527_reset(struct comedi_device *dev) /* disable deglitch filters on all channels */ ni6527_set_filter_enable(dev, 0); + /* disable edge detection */ + ni6527_set_edge_detection(dev, 0x, 0, 0); + writeb(NI6527_CLR_IRQS | NI6527_CLR_RESET_FILT, mmio + NI6527_CLR_REG); writeb(NI6527_CTRL_DISABLE_IRQS, mmio + NI6527_CTRL_REG); -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation
On Mon, 2014-07-21 at 15:11 +0200, Lennart Poettering wrote: On Mon, 21.07.14 10:21, Yue Zhang (OSTC DEV) (yue...@microsoft.com) wrote: Some network monitoring daemon, like ifplugd has a deferring mechanism. When it detects carriers is offline, it doesn't trigger DHCP renew immediately. Instead it will wait for another 5 seconds to check whether carrier is back to online status. In that case, it will avoid renew DHCP lease. ifplugd doesn't renew DHCP leases anyway, one of the scripts it invokes does. ifplugd is obsolete software. I wrote it more than 10 years ago, and haven't really updated it since. it's sounds seriously wrong to add multi-second waits to the kernel just to make this crappy, obsolete software work. Please fix this properly, and work with the PM guys, so that we get a sane userspace how the kernel can notify userspace about suspends/hibernations triggered from the outside, so that userspace daemons can subscribe to that and then refresh the DHCP leases on their own. Yeah, like I've said before, there have been other cases where a hey, my L3 address might be wrong now, so please confirm it message would be useful. Carrier on/off doesn't necessarily mean that, but even if it did, the off interval is a really bad mechanism for that too. So I'd really like some kind of event for this that's distinct from carrier that userspace could use. Dan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: comedi: comedi_fops: remove disabled subdevice lock/unlock callback
According to Ian Abbott, this code was added in comedi-0.7.6 back in June 1999 and has always been disabled. The 'lock_f' and 'unlock' members don't even exist in the comedi_subdevice. Just remove the disabled code. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/comedi_fops.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 01fb31d..84a1e42 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -1660,14 +1660,6 @@ static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg, s-lock = file; spin_unlock_irqrestore(s-spin_lock, flags); -#if 0 - if (ret 0) - return ret; - - if (s-lock_f) - ret = s-lock_f(dev, s); -#endif - return ret; } @@ -1702,14 +1694,8 @@ static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg, if (s-lock s-lock != file) return -EACCES; - if (s-lock == file) { -#if 0 - if (s-unlock) - s-unlock(dev, s); -#endif - + if (s-lock == file) s-lock = NULL; - } return 0; } -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] staging: comedi: remove unused subdevice lock/unlock
The subdevice lock/unlock callbacks have been disbled ever since the code was merged. It's also broken due to the core member names in the struct not matching the calls in the core. Just remove it. H Hartley Sweeten (2): staging: comedi: comedi_fops: remove disabled subdevice lock/unlock callback staging: comedi: comedidev.h: remove unused callbacks from comedi_subdevice drivers/staging/comedi/comedi_fops.c | 16 +--- drivers/staging/comedi/comedidev.h | 3 --- 2 files changed, 1 insertion(+), 18 deletions(-) -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: comedi: comedidev.h: remove unused callbacks from comedi_subdevice
The 'do_lock' and 'do_unlock' callbacks are not used be any of the comedi drivers or the comedi core. Just remove them. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/comedidev.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index ec2be35..6bf5616 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -75,9 +75,6 @@ struct comedi_subdevice { struct comedi_cmd *); int (*poll)(struct comedi_device *, struct comedi_subdevice *); int (*cancel)(struct comedi_device *, struct comedi_subdevice *); - /* int (*do_lock)(struct comedi_device *, struct comedi_subdevice *); */ - /* int (*do_unlock)(struct comedi_device *, \ - struct comedi_subdevice *); */ /* called when the buffer changes */ int (*buf_change)(struct comedi_device *dev, -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: unisys: remove virthba proc
This patch removes all proc entries, directories, and functions Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 206 --- 1 file changed, 206 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 4d1347a..b9cbcf2 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -50,7 +50,6 @@ #include scsi/scsi_cmnd.h #include scsi/scsi_device.h #include asm/param.h -#include linux/proc_fs.h #include linux/types.h #include virthba.h @@ -106,15 +105,6 @@ static int virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state); static void doDiskAddRemove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); -static ssize_t info_proc_read(struct file *file, char __user *buf, - size_t len, loff_t *offset); -static ssize_t rqwu_proc_write(struct file *file, const char __user *buffer, - size_t count, loff_t *ppos); -static ssize_t enable_ints_read(struct file *file, char __user *buffer, - size_t count, loff_t *ppos); -static ssize_t enable_ints_write(struct file *file, const char __user *buffer, -size_t count, loff_t *ppos); - /*/ /* Globals */ /*/ @@ -208,7 +198,6 @@ struct diskaddremove { static DEVICE_ATTRIBUTE *virthba_shost_attrs[]; static struct scsi_host_template virthba_driver_template = { .name = Unisys Virtual HBA, - .proc_name = uisvirthba, .info = virthba_get_info, .ioctl = virthba_ioctl, .queuecommand = virthba_queue_command, @@ -232,31 +221,9 @@ struct virthba_devices_open { struct virthba_info *virthbainfo; }; -static const struct file_operations proc_info_fops = { - .read = info_proc_read, -}; - -static const struct file_operations proc_rqwu_fops = { - .write = rqwu_proc_write, -}; - -static const struct file_operations proc_enable_ints_fops = { - .read = enable_ints_read, - .write = enable_ints_write, -}; - - #define VIRTHBASOPENMAX 1 /* array of open devices maintained by open() and close(); */ static struct virthba_devices_open VirtHbasOpen[VIRTHBASOPENMAX]; -static struct proc_dir_entry *virthba_proc_dir; -static struct proc_dir_entry *info_proc_entry; -static struct proc_dir_entry *rqwaitus_proc_entry; -static struct proc_dir_entry *enable_ints_proc_entry; -#define INFO_PROC_ENTRY_FN info -#define ENABLE_INTS_ENTRY_FN enable_ints -#define RQWU_PROC_ENTRY_FN rqwait_usecs -#define DIR_PROC_ENTRY virthba /*/ /* Local Functions */ @@ -1375,156 +1342,6 @@ process_incoming_rsps(void *v) complete_and_exit(dc-threadinfo.has_stopped, 0); } -/*/ -/* proc filesystem functions*/ -/*/ - -static ssize_t -info_proc_read(struct file *file, char __user *buf, size_t len, loff_t *offset) -{ - int length = 0; - U64 phys_flags_addr; - int i; - struct virthba_info *virthbainfo; - char *vbuf; - loff_t pos = *offset; - - if (pos 0) - return -EINVAL; - - if (pos 0 || !len) - return 0; - - vbuf = kzalloc(len, GFP_KERNEL); - if (!vbuf) - return -ENOMEM; - - for (i = 0; i VIRTHBASOPENMAX; i++) { - if (VirtHbasOpen[i].virthbainfo == NULL) - continue; - - virthbainfo = VirtHbasOpen[i].virthbainfo; - length += sprintf(vbuf + length, CHANSOCK is not defined.\n); - - length += sprintf(vbuf + length, MaxBuffLen:%u\n, MaxBuffLen); - - length += sprintf(vbuf + length, \nvirthba result queue poll wait:%d usecs.\n, - rsltq_wait_usecs); - - length += sprintf(vbuf + length, \ninterrupts_rcvd = %llu, interrupts_disabled = %llu\n, - virthbainfo-interrupts_rcvd, - virthbainfo-interrupts_disabled); - length += sprintf(vbuf + length, \ninterrupts_notme = %llu,\n, - virthbainfo-interrupts_notme); - phys_flags_addr = virt_to_phys((__force void *) - virthbainfo-flags_addr); - length += sprintf(vbuf + length, flags_addr = %p, phys_flags_addr=0x%016llx, FeatureFlags=%llu\n, - virthbainfo-flags_addr, phys_flags_addr,
[PATCH 1/4] staging: unisys: remove virthba proc
This patch removes all proc entries, directories, and functions Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 206 --- 1 file changed, 206 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 4d1347a..b9cbcf2 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -50,7 +50,6 @@ #include scsi/scsi_cmnd.h #include scsi/scsi_device.h #include asm/param.h -#include linux/proc_fs.h #include linux/types.h #include virthba.h @@ -106,15 +105,6 @@ static int virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state); static void doDiskAddRemove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); -static ssize_t info_proc_read(struct file *file, char __user *buf, - size_t len, loff_t *offset); -static ssize_t rqwu_proc_write(struct file *file, const char __user *buffer, - size_t count, loff_t *ppos); -static ssize_t enable_ints_read(struct file *file, char __user *buffer, - size_t count, loff_t *ppos); -static ssize_t enable_ints_write(struct file *file, const char __user *buffer, -size_t count, loff_t *ppos); - /*/ /* Globals */ /*/ @@ -208,7 +198,6 @@ struct diskaddremove { static DEVICE_ATTRIBUTE *virthba_shost_attrs[]; static struct scsi_host_template virthba_driver_template = { .name = Unisys Virtual HBA, - .proc_name = uisvirthba, .info = virthba_get_info, .ioctl = virthba_ioctl, .queuecommand = virthba_queue_command, @@ -232,31 +221,9 @@ struct virthba_devices_open { struct virthba_info *virthbainfo; }; -static const struct file_operations proc_info_fops = { - .read = info_proc_read, -}; - -static const struct file_operations proc_rqwu_fops = { - .write = rqwu_proc_write, -}; - -static const struct file_operations proc_enable_ints_fops = { - .read = enable_ints_read, - .write = enable_ints_write, -}; - - #define VIRTHBASOPENMAX 1 /* array of open devices maintained by open() and close(); */ static struct virthba_devices_open VirtHbasOpen[VIRTHBASOPENMAX]; -static struct proc_dir_entry *virthba_proc_dir; -static struct proc_dir_entry *info_proc_entry; -static struct proc_dir_entry *rqwaitus_proc_entry; -static struct proc_dir_entry *enable_ints_proc_entry; -#define INFO_PROC_ENTRY_FN info -#define ENABLE_INTS_ENTRY_FN enable_ints -#define RQWU_PROC_ENTRY_FN rqwait_usecs -#define DIR_PROC_ENTRY virthba /*/ /* Local Functions */ @@ -1375,156 +1342,6 @@ process_incoming_rsps(void *v) complete_and_exit(dc-threadinfo.has_stopped, 0); } -/*/ -/* proc filesystem functions*/ -/*/ - -static ssize_t -info_proc_read(struct file *file, char __user *buf, size_t len, loff_t *offset) -{ - int length = 0; - U64 phys_flags_addr; - int i; - struct virthba_info *virthbainfo; - char *vbuf; - loff_t pos = *offset; - - if (pos 0) - return -EINVAL; - - if (pos 0 || !len) - return 0; - - vbuf = kzalloc(len, GFP_KERNEL); - if (!vbuf) - return -ENOMEM; - - for (i = 0; i VIRTHBASOPENMAX; i++) { - if (VirtHbasOpen[i].virthbainfo == NULL) - continue; - - virthbainfo = VirtHbasOpen[i].virthbainfo; - length += sprintf(vbuf + length, CHANSOCK is not defined.\n); - - length += sprintf(vbuf + length, MaxBuffLen:%u\n, MaxBuffLen); - - length += sprintf(vbuf + length, \nvirthba result queue poll wait:%d usecs.\n, - rsltq_wait_usecs); - - length += sprintf(vbuf + length, \ninterrupts_rcvd = %llu, interrupts_disabled = %llu\n, - virthbainfo-interrupts_rcvd, - virthbainfo-interrupts_disabled); - length += sprintf(vbuf + length, \ninterrupts_notme = %llu,\n, - virthbainfo-interrupts_notme); - phys_flags_addr = virt_to_phys((__force void *) - virthbainfo-flags_addr); - length += sprintf(vbuf + length, flags_addr = %p, phys_flags_addr=0x%016llx, FeatureFlags=%llu\n, - virthbainfo-flags_addr, phys_flags_addr, -
[PATCH 2/4] staging: unisys: added virthba debugfs dir and info entry
This patch adds virthba debugfs directory and info entry Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 79 1 file changed, 79 insertions(+) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index b9cbcf2..121cc05 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -50,6 +50,7 @@ #include scsi/scsi_cmnd.h #include scsi/scsi_device.h #include asm/param.h +#include linux/debugfs.h #include linux/types.h #include virthba.h @@ -66,6 +67,11 @@ /* NOTE: L1_CACHE_BYTES =128 */ #define DEVICE_ATTRIBUTE struct device_attribute + /* MAX_BUF = 6 lines x 10 MAXVHBA x 80 characters + * = 4800 bytes ~ 2^13 = 8192 bytes + */ +#define MAX_BUF 8192 + /*/ /* Forward declarations */ /*/ @@ -104,6 +110,8 @@ static int virthba_serverup(struct virtpci_dev *virtpcidev); static int virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state); static void doDiskAddRemove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); +static ssize_t info_debugfs_read(struct file *file, char __user *buf, + size_t len, loff_t *offset); /*/ /* Globals */ @@ -221,9 +229,18 @@ struct virthba_devices_open { struct virthba_info *virthbainfo; }; +static const struct file_operations debugfs_info_fops = { + .read = info_debugfs_read, +}; + +/*/ +/* Structs */ +/*/ + #define VIRTHBASOPENMAX 1 /* array of open devices maintained by open() and close(); */ static struct virthba_devices_open VirtHbasOpen[VIRTHBASOPENMAX]; +static struct dentry *virthba_debugfs_dir; /*/ /* Local Functions */ @@ -1342,6 +1359,62 @@ process_incoming_rsps(void *v) complete_and_exit(dc-threadinfo.has_stopped, 0); } +/*/ +/* Debugfs filesystem functions */ +/*/ + +static ssize_t info_debugfs_read(struct file *file, + char __user *buf, size_t len, loff_t *offset) +{ + ssize_t bytes_read = 0; + int str_pos = 0; + U64 phys_flags_addr; + int i; + struct virthba_info *virthbainfo; + char *vbuf; + + if (len MAX_BUF) + len = MAX_BUF; + vbuf = kzalloc(len, GFP_KERNEL); + if (!vbuf) + return -ENOMEM; + + for (i = 0; i VIRTHBASOPENMAX; i++) { + if (VirtHbasOpen[i].virthbainfo == NULL) + continue; + + virthbainfo = VirtHbasOpen[i].virthbainfo; + + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, MaxBuffLen:%u\n, MaxBuffLen); + + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + \nvirthba result queue poll wait:%d usecs.\n, + rsltq_wait_usecs); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + \ninterrupts_rcvd = %llu, interrupts_disabled = %llu\n, + virthbainfo-interrupts_rcvd, + virthbainfo-interrupts_disabled); + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, \ninterrupts_notme = %llu,\n, + virthbainfo-interrupts_notme); + phys_flags_addr = virt_to_phys((__force void *) + virthbainfo-flags_addr); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + flags_addr = %p, phys_flags_addr=0x%016llx, FeatureFlags=%llu\n, + virthbainfo-flags_addr, phys_flags_addr, + (__le64)readq(virthbainfo-flags_addr)); + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, acquire_failed_cnt:%llu\n, + virthbainfo-acquire_failed_cnt); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, \n); + } + + bytes_read = simple_read_from_buffer(buf, len, offset, vbuf, str_pos); + kfree(vbuf); + return bytes_read; +} + /* As per VirtpciFunc returns 1 for success and 0 for failure */ static int virthba_serverup(struct virtpci_dev *virtpcidev) @@ -1526,6 +1599,10 @@ virthba_mod_init(void)
[PATCH 3/4] staging: unisys: added virthba rqwait entry
This patch adds the rqwait entry into the virthba debugfs directory Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 121cc05..857de11 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -1603,6 +1603,8 @@ virthba_mod_init(void) virthba_debugfs_dir = debugfs_create_dir(virthba, NULL); debugfs_create_file(info, S_IRUSR, virthba_debugfs_dir, NULL, debugfs_info_fops); + debugfs_create_u32(rqwait_usecs, S_IRUSR | S_IWUSR, + virthba_debugfs_dir, rsltq_wait_usecs); /* Initialize DARWorkQ */ INIT_WORK(DARWorkQ, doDiskAddRemove); spin_lock_init(DARWorkQLock); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: unisys: added virthba debugfs dir and info entry
This patch adds virthba debugfs directory and info entry Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 79 1 file changed, 79 insertions(+) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index b9cbcf2..121cc05 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -50,6 +50,7 @@ #include scsi/scsi_cmnd.h #include scsi/scsi_device.h #include asm/param.h +#include linux/debugfs.h #include linux/types.h #include virthba.h @@ -66,6 +67,11 @@ /* NOTE: L1_CACHE_BYTES =128 */ #define DEVICE_ATTRIBUTE struct device_attribute + /* MAX_BUF = 6 lines x 10 MAXVHBA x 80 characters + * = 4800 bytes ~ 2^13 = 8192 bytes + */ +#define MAX_BUF 8192 + /*/ /* Forward declarations */ /*/ @@ -104,6 +110,8 @@ static int virthba_serverup(struct virtpci_dev *virtpcidev); static int virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state); static void doDiskAddRemove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); +static ssize_t info_debugfs_read(struct file *file, char __user *buf, + size_t len, loff_t *offset); /*/ /* Globals */ @@ -221,9 +229,18 @@ struct virthba_devices_open { struct virthba_info *virthbainfo; }; +static const struct file_operations debugfs_info_fops = { + .read = info_debugfs_read, +}; + +/*/ +/* Structs */ +/*/ + #define VIRTHBASOPENMAX 1 /* array of open devices maintained by open() and close(); */ static struct virthba_devices_open VirtHbasOpen[VIRTHBASOPENMAX]; +static struct dentry *virthba_debugfs_dir; /*/ /* Local Functions */ @@ -1342,6 +1359,62 @@ process_incoming_rsps(void *v) complete_and_exit(dc-threadinfo.has_stopped, 0); } +/*/ +/* Debugfs filesystem functions */ +/*/ + +static ssize_t info_debugfs_read(struct file *file, + char __user *buf, size_t len, loff_t *offset) +{ + ssize_t bytes_read = 0; + int str_pos = 0; + U64 phys_flags_addr; + int i; + struct virthba_info *virthbainfo; + char *vbuf; + + if (len MAX_BUF) + len = MAX_BUF; + vbuf = kzalloc(len, GFP_KERNEL); + if (!vbuf) + return -ENOMEM; + + for (i = 0; i VIRTHBASOPENMAX; i++) { + if (VirtHbasOpen[i].virthbainfo == NULL) + continue; + + virthbainfo = VirtHbasOpen[i].virthbainfo; + + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, MaxBuffLen:%u\n, MaxBuffLen); + + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + \nvirthba result queue poll wait:%d usecs.\n, + rsltq_wait_usecs); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + \ninterrupts_rcvd = %llu, interrupts_disabled = %llu\n, + virthbainfo-interrupts_rcvd, + virthbainfo-interrupts_disabled); + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, \ninterrupts_notme = %llu,\n, + virthbainfo-interrupts_notme); + phys_flags_addr = virt_to_phys((__force void *) + virthbainfo-flags_addr); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + flags_addr = %p, phys_flags_addr=0x%016llx, FeatureFlags=%llu\n, + virthbainfo-flags_addr, phys_flags_addr, + (__le64)readq(virthbainfo-flags_addr)); + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, acquire_failed_cnt:%llu\n, + virthbainfo-acquire_failed_cnt); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, \n); + } + + bytes_read = simple_read_from_buffer(buf, len, offset, vbuf, str_pos); + kfree(vbuf); + return bytes_read; +} + /* As per VirtpciFunc returns 1 for success and 0 for failure */ static int virthba_serverup(struct virtpci_dev *virtpcidev) @@
[PATCH 4/4] staging: unisys: added virthba enable_ints entry
This patch adds enable_ints entry to virthba directory Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 63 1 file changed, 63 insertions(+) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 857de11..65a75c8 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -112,6 +112,8 @@ static void doDiskAddRemove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); static ssize_t info_debugfs_read(struct file *file, char __user *buf, size_t len, loff_t *offset); +static ssize_t enable_ints_write(struct file *file, + const char __user *buffer, size_t count, loff_t *ppos); /*/ /* Globals */ @@ -233,6 +235,10 @@ static const struct file_operations debugfs_info_fops = { .read = info_debugfs_read, }; +static const struct file_operations debugfs_enable_ints_fops = { + .write = enable_ints_write, +}; + /*/ /* Structs */ /*/ @@ -1415,6 +1421,60 @@ static ssize_t info_debugfs_read(struct file *file, return bytes_read; } +static ssize_t enable_ints_write(struct file *file, + const char __user *buffer, size_t count, loff_t *ppos) +{ + char buf[4]; + int i, new_value; + struct virthba_info *virthbainfo; + + U64 __iomem *Features_addr; + U64 mask; + + if (count = ARRAY_SIZE(buf)) + return -EINVAL; + + buf[count] = '\0'; + if (copy_from_user(buf, buffer, count)) { + LOGERR(copy_from_user failed. buf%.*s count%lu\n, + (int) count, buf, count); + return -EFAULT; + } + + i = kstrtoint(buf, 10 , new_value); + + if (i != 0) { + LOGERR(Failed to scan value for enable_ints, buf%.*s, + (int) count, buf); + return -EFAULT; + } + + /*set all counts to new_value usually 0*/ + for (i = 0; i VIRTHBASOPENMAX; i++) { + if (VirtHbasOpen[i].virthbainfo != NULL) { + virthbainfo = VirtHbasOpen[i].virthbainfo; + Features_addr = + virthbainfo-chinfo.queueinfo-chan-Features; + if (new_value == 1) { + mask = ~(ULTRA_IO_CHANNEL_IS_POLLING | +ULTRA_IO_DRIVER_DISABLES_INTS); + uisqueue_InterlockedAnd(Features_addr, mask); + mask = ULTRA_IO_DRIVER_ENABLES_INTS; + uisqueue_InterlockedOr(Features_addr, mask); + rsltq_wait_usecs = 400; + } else { + mask = ~(ULTRA_IO_DRIVER_ENABLES_INTS | +ULTRA_IO_DRIVER_DISABLES_INTS); + uisqueue_InterlockedAnd(Features_addr, mask); + mask = ULTRA_IO_CHANNEL_IS_POLLING; + uisqueue_InterlockedOr(Features_addr, mask); + rsltq_wait_usecs = 4000; + } + } + } + return count; +} + /* As per VirtpciFunc returns 1 for success and 0 for failure */ static int virthba_serverup(struct virtpci_dev *virtpcidev) @@ -1605,6 +1665,9 @@ virthba_mod_init(void) NULL, debugfs_info_fops); debugfs_create_u32(rqwait_usecs, S_IRUSR | S_IWUSR, virthba_debugfs_dir, rsltq_wait_usecs); + debugfs_create_file(enable_ints, S_IWUSR, + virthba_debugfs_dir, NULL, + debugfs_enable_ints_fops); /* Initialize DARWorkQ */ INIT_WORK(DARWorkQ, doDiskAddRemove); spin_lock_init(DARWorkQLock); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: unisys: added virthba enable_ints entry
This patch adds enable_ints entry to virthba directory Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 63 1 file changed, 63 insertions(+) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 857de11..65a75c8 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -112,6 +112,8 @@ static void doDiskAddRemove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); static ssize_t info_debugfs_read(struct file *file, char __user *buf, size_t len, loff_t *offset); +static ssize_t enable_ints_write(struct file *file, + const char __user *buffer, size_t count, loff_t *ppos); /*/ /* Globals */ @@ -233,6 +235,10 @@ static const struct file_operations debugfs_info_fops = { .read = info_debugfs_read, }; +static const struct file_operations debugfs_enable_ints_fops = { + .write = enable_ints_write, +}; + /*/ /* Structs */ /*/ @@ -1415,6 +1421,60 @@ static ssize_t info_debugfs_read(struct file *file, return bytes_read; } +static ssize_t enable_ints_write(struct file *file, + const char __user *buffer, size_t count, loff_t *ppos) +{ + char buf[4]; + int i, new_value; + struct virthba_info *virthbainfo; + + U64 __iomem *Features_addr; + U64 mask; + + if (count = ARRAY_SIZE(buf)) + return -EINVAL; + + buf[count] = '\0'; + if (copy_from_user(buf, buffer, count)) { + LOGERR(copy_from_user failed. buf%.*s count%lu\n, + (int) count, buf, count); + return -EFAULT; + } + + i = kstrtoint(buf, 10 , new_value); + + if (i != 0) { + LOGERR(Failed to scan value for enable_ints, buf%.*s, + (int) count, buf); + return -EFAULT; + } + + /*set all counts to new_value usually 0*/ + for (i = 0; i VIRTHBASOPENMAX; i++) { + if (VirtHbasOpen[i].virthbainfo != NULL) { + virthbainfo = VirtHbasOpen[i].virthbainfo; + Features_addr = + virthbainfo-chinfo.queueinfo-chan-Features; + if (new_value == 1) { + mask = ~(ULTRA_IO_CHANNEL_IS_POLLING | +ULTRA_IO_DRIVER_DISABLES_INTS); + uisqueue_InterlockedAnd(Features_addr, mask); + mask = ULTRA_IO_DRIVER_ENABLES_INTS; + uisqueue_InterlockedOr(Features_addr, mask); + rsltq_wait_usecs = 400; + } else { + mask = ~(ULTRA_IO_DRIVER_ENABLES_INTS | +ULTRA_IO_DRIVER_DISABLES_INTS); + uisqueue_InterlockedAnd(Features_addr, mask); + mask = ULTRA_IO_CHANNEL_IS_POLLING; + uisqueue_InterlockedOr(Features_addr, mask); + rsltq_wait_usecs = 4000; + } + } + } + return count; +} + /* As per VirtpciFunc returns 1 for success and 0 for failure */ static int virthba_serverup(struct virtpci_dev *virtpcidev) @@ -1605,6 +1665,9 @@ virthba_mod_init(void) NULL, debugfs_info_fops); debugfs_create_u32(rqwait_usecs, S_IRUSR | S_IWUSR, virthba_debugfs_dir, rsltq_wait_usecs); + debugfs_create_file(enable_ints, S_IWUSR, + virthba_debugfs_dir, NULL, + debugfs_enable_ints_fops); /* Initialize DARWorkQ */ INIT_WORK(DARWorkQ, doDiskAddRemove); spin_lock_init(DARWorkQLock); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: unisys: added virthba rqwait entry
This patch adds the rqwait entry into the virthba debugfs directory Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 121cc05..857de11 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -1603,6 +1603,8 @@ virthba_mod_init(void) virthba_debugfs_dir = debugfs_create_dir(virthba, NULL); debugfs_create_file(info, S_IRUSR, virthba_debugfs_dir, NULL, debugfs_info_fops); + debugfs_create_u32(rqwait_usecs, S_IRUSR | S_IWUSR, + virthba_debugfs_dir, rsltq_wait_usecs); /* Initialize DARWorkQ */ INIT_WORK(DARWorkQ, doDiskAddRemove); spin_lock_init(DARWorkQLock); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Disregard temporary files in patch submission
Hi Greg, I accidentally sent the temporary files(.patch~) in my patch submission. Please disregard the files that have not been signed off by Benjamin. Sorry for the inconvenience, Erik Arfvidson ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Disregard temporary files in patch submission
On Mon, Jul 21, 2014 at 02:33:16PM -0400, Erik Arfvidson wrote: Hi Greg, I accidentally sent the temporary files(.patch~) in my patch submission. What patch submission? Please be more specific, with a Subject: and all of that, or just respond to the patches themselves. Remember, I _average_ about 1000 emails a day to process, please be specific. Please disregard the files that have not been signed off by Benjamin. How about just resending the whole series properly? I'll dig though my inbox and just delete any prior patches from you, and wait for them to be resent... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: unisys: added virthba rqwait entry
This patch adds the rqwait entry into the virthba debugfs directory Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 121cc05..857de11 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -1603,6 +1603,8 @@ virthba_mod_init(void) virthba_debugfs_dir = debugfs_create_dir(virthba, NULL); debugfs_create_file(info, S_IRUSR, virthba_debugfs_dir, NULL, debugfs_info_fops); + debugfs_create_u32(rqwait_usecs, S_IRUSR | S_IWUSR, + virthba_debugfs_dir, rsltq_wait_usecs); /* Initialize DARWorkQ */ INIT_WORK(DARWorkQ, doDiskAddRemove); spin_lock_init(DARWorkQLock); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: unisys: added virthba debugfs dir and info entry
This patch adds virthba debugfs directory and info entry Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 79 1 file changed, 79 insertions(+) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index b9cbcf2..121cc05 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -50,6 +50,7 @@ #include scsi/scsi_cmnd.h #include scsi/scsi_device.h #include asm/param.h +#include linux/debugfs.h #include linux/types.h #include virthba.h @@ -66,6 +67,11 @@ /* NOTE: L1_CACHE_BYTES =128 */ #define DEVICE_ATTRIBUTE struct device_attribute + /* MAX_BUF = 6 lines x 10 MAXVHBA x 80 characters + * = 4800 bytes ~ 2^13 = 8192 bytes + */ +#define MAX_BUF 8192 + /*/ /* Forward declarations */ /*/ @@ -104,6 +110,8 @@ static int virthba_serverup(struct virtpci_dev *virtpcidev); static int virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state); static void doDiskAddRemove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); +static ssize_t info_debugfs_read(struct file *file, char __user *buf, + size_t len, loff_t *offset); /*/ /* Globals */ @@ -221,9 +229,18 @@ struct virthba_devices_open { struct virthba_info *virthbainfo; }; +static const struct file_operations debugfs_info_fops = { + .read = info_debugfs_read, +}; + +/*/ +/* Structs */ +/*/ + #define VIRTHBASOPENMAX 1 /* array of open devices maintained by open() and close(); */ static struct virthba_devices_open VirtHbasOpen[VIRTHBASOPENMAX]; +static struct dentry *virthba_debugfs_dir; /*/ /* Local Functions */ @@ -1342,6 +1359,62 @@ process_incoming_rsps(void *v) complete_and_exit(dc-threadinfo.has_stopped, 0); } +/*/ +/* Debugfs filesystem functions */ +/*/ + +static ssize_t info_debugfs_read(struct file *file, + char __user *buf, size_t len, loff_t *offset) +{ + ssize_t bytes_read = 0; + int str_pos = 0; + U64 phys_flags_addr; + int i; + struct virthba_info *virthbainfo; + char *vbuf; + + if (len MAX_BUF) + len = MAX_BUF; + vbuf = kzalloc(len, GFP_KERNEL); + if (!vbuf) + return -ENOMEM; + + for (i = 0; i VIRTHBASOPENMAX; i++) { + if (VirtHbasOpen[i].virthbainfo == NULL) + continue; + + virthbainfo = VirtHbasOpen[i].virthbainfo; + + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, MaxBuffLen:%u\n, MaxBuffLen); + + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + \nvirthba result queue poll wait:%d usecs.\n, + rsltq_wait_usecs); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + \ninterrupts_rcvd = %llu, interrupts_disabled = %llu\n, + virthbainfo-interrupts_rcvd, + virthbainfo-interrupts_disabled); + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, \ninterrupts_notme = %llu,\n, + virthbainfo-interrupts_notme); + phys_flags_addr = virt_to_phys((__force void *) + virthbainfo-flags_addr); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + flags_addr = %p, phys_flags_addr=0x%016llx, FeatureFlags=%llu\n, + virthbainfo-flags_addr, phys_flags_addr, + (__le64)readq(virthbainfo-flags_addr)); + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, acquire_failed_cnt:%llu\n, + virthbainfo-acquire_failed_cnt); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, \n); + } + + bytes_read = simple_read_from_buffer(buf, len, offset, vbuf, str_pos); + kfree(vbuf); + return bytes_read; +} + /* As per VirtpciFunc returns 1 for success and 0 for failure */ static int virthba_serverup(struct virtpci_dev *virtpcidev) @@
[PATCH] staging: comedi: comedidev.h: remove 'new_size' param from subdevice (*buf_change)
This parameter is never used by any of the comedi drivers that provide a (*buf_change) callback. If the 'new_size' is needed in the callback it can be found from the 's-async-prealloc_bufsz' as done in the ni_pcidio driver. Remove the unused parameter. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ian Abbott abbo...@mev.co.uk Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/staging/comedi/comedi_fops.c | 2 +- drivers/staging/comedi/comedidev.h | 3 +-- drivers/staging/comedi/drivers.c | 2 +- drivers/staging/comedi/drivers/ni_660x.c | 3 +-- drivers/staging/comedi/drivers/ni_pcidio.c | 2 +- drivers/staging/comedi/drivers/ni_pcimio.c | 15 +-- 6 files changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 84a1e42..2182c74 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -268,7 +268,7 @@ static int resize_async_buffer(struct comedi_device *dev, return retval; if (s-buf_change) { - retval = s-buf_change(dev, s, new_size); + retval = s-buf_change(dev, s); if (retval 0) return retval; } diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 6bf5616..f3999f5 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -77,8 +77,7 @@ struct comedi_subdevice { int (*cancel)(struct comedi_device *, struct comedi_subdevice *); /* called when the buffer changes */ - int (*buf_change)(struct comedi_device *dev, - struct comedi_subdevice *s, unsigned long new_size); + int (*buf_change)(struct comedi_device *, struct comedi_subdevice *); void (*munge)(struct comedi_device *dev, struct comedi_subdevice *s, void *data, unsigned int num_bytes, diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index 6ec4a41..42ddf13 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c @@ -320,7 +320,7 @@ static int __comedi_device_postconfig_async(struct comedi_device *dev, return -ENOMEM; } if (s-buf_change) { - ret = s-buf_change(dev, s, buf_size); + ret = s-buf_change(dev, s); if (ret 0) return ret; } diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 6b8c702..20fe692 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -825,8 +825,7 @@ static int ni_660x_input_poll(struct comedi_device *dev, } static int ni_660x_buf_change(struct comedi_device *dev, - struct comedi_subdevice *s, - unsigned long new_size) + struct comedi_subdevice *s) { struct ni_660x_private *devpriv = dev-private; struct ni_gpct *counter = s-private; diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c index 2bf8691..352c60f 100644 --- a/drivers/staging/comedi/drivers/ni_pcidio.c +++ b/drivers/staging/comedi/drivers/ni_pcidio.c @@ -787,7 +787,7 @@ static int ni_pcidio_cancel(struct comedi_device *dev, } static int ni_pcidio_change(struct comedi_device *dev, - struct comedi_subdevice *s, unsigned long new_size) + struct comedi_subdevice *s) { struct nidio96_private *devpriv = dev-private; int ret; diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index a902a38..22c0e95 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -977,8 +977,7 @@ static const struct ni_board_struct ni_boards[] = { #include ni_mio_common.c static int pcimio_ai_change(struct comedi_device *dev, - struct comedi_subdevice *s, - unsigned long new_size) + struct comedi_subdevice *s) { struct ni_private *devpriv = dev-private; int ret; @@ -991,8 +990,7 @@ static int pcimio_ai_change(struct comedi_device *dev, } static int pcimio_ao_change(struct comedi_device *dev, - struct comedi_subdevice *s, - unsigned long new_size) + struct comedi_subdevice *s) { struct ni_private *devpriv = dev-private; int ret; @@ -1005,8 +1003,7 @@ static int pcimio_ao_change(struct comedi_device *dev, } static int pcimio_gpct0_change(struct comedi_device *dev, - struct comedi_subdevice *s, - unsigned long
Re: [PATCH 00/29] staging: rtl8723au: Remove bad layer API
On Mon, Jul 21, 2014 at 11:24:40AM +0200, jes.soren...@redhat.com wrote: From: Jes Sorensen jes.soren...@redhat.com Greg, Another set of rtl8723au changes - this was meant to be a 'I'll just fix this little issue' but snowballed into a fair bit more, as I realized just how bad the original code was (patch 10 onwards). The bulk of this set removes a bad layered API. The original driver is trying to moduralize different components (RF handling, baseband handling, 80211 handling etc). They try to create layer independant types they can pass around (which is bad enough by itself), but in this particular case they registered pointers to the original values and derefenced those, losing all type checking in the process and kept multiple defines of the same constants to use in each layer (patch 17). In addition there are a few other remove empty function fixes, and patch 29/29 fixes a locking issue that could be relevant for 3.16. The set is clean against staging-next as of this morning. All applied, thanks. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Disregard temporary files in patch submission
That works, I'm sending them again right now Thanks, Erik Arfvidson On 07/21/2014 02:38 PM, gre...@linuxfoundation.org wrote: On Mon, Jul 21, 2014 at 02:33:16PM -0400, Erik Arfvidson wrote: Hi Greg, I accidentally sent the temporary files(.patch~) in my patch submission. What patch submission? Please be more specific, with a Subject: and all of that, or just respond to the patches themselves. Remember, I _average_ about 1000 emails a day to process, please be specific. Please disregard the files that have not been signed off by Benjamin. How about just resending the whole series properly? I'll dig though my inbox and just delete any prior patches from you, and wait for them to be resent... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/4] staging: sep: Solves some problems reported by checkpatch
On Sat, Jul 19, 2014 at 07:34:39PM +0200, LABBE Corentin wrote: Signed-off-by: LABBE Corentin clabbe.montj...@gmail.com --- drivers/staging/sep/sep_main.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) _which_ specific problems are fixed here? Please be specific and provide a valid changelog entry in the body of the email, changelogs without any information other than the subject: are generally frowned apon. Can you please fix this up and resend? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/nvec: Pass proper resource to mfd_add_devices()
Hi Thierry, On Mon, 21 Jul 2014 13:52:41 +0200 Thierry Reding thierry.red...@gmail.com wrote: From: Thierry Reding tred...@nvidia.com The mfd_add_devices() parameter takes a struct resource * as fifth argument, but the nvec driver passes in a void __iomem *. The driver gets away with it because none of the subdevices ever directly access the registers. you are right, this one looked bogus. While at it, use platform_get_irq() instead of platform_get_resource() to get the device's interrupt. This makes it easier to pass in the register region since the variable is no longer reused. Signed-off-by: Thierry Reding tred...@nvidia.com --- Alternatively we could simply pass NULL into mfd_add_devices(), which might be a slightly more accurate representation of what's going on. Marc, Greg, any preferences? I just tested with NULL as base and it seems to produce no harm. Even if we may get rid of mfd_add_devices in the future, passing NULL is cleaner for now and no children will ever make use of it. So please send a new version with this change. Otherwise, thanks for looking and cleaning up. Marc drivers/staging/nvec/nvec.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index d32504844896..11f9e1c3447c 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -821,8 +821,8 @@ static int tegra_nvec_probe(struct platform_device *pdev) if (IS_ERR(base)) return PTR_ERR(base); - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!res) { + nvec-irq = platform_get_irq(pdev, 0); + if (nvec-irq 0) { dev_err(pdev-dev, no irq resource?\n); return -ENODEV; } @@ -840,7 +840,6 @@ static int tegra_nvec_probe(struct platform_device *pdev) } nvec-base = base; - nvec-irq = res-start; nvec-i2c_clk = i2c_clk; nvec-rx = nvec-msg_pool[0]; @@ -893,7 +892,7 @@ static int tegra_nvec_probe(struct platform_device *pdev) } ret = mfd_add_devices(nvec-dev, -1, nvec_devices, - ARRAY_SIZE(nvec_devices), base, 0, NULL); + ARRAY_SIZE(nvec_devices), res, 0, NULL); if (ret) dev_err(nvec-dev, error adding subdevices\n); -- 2.0.1 -- Marc Dietrich marvi...@gmx.de ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/nvec: Remove double const qualifier
On Mon, 21 Jul 2014 13:54:41 +0200 Thierry Reding thierry.red...@gmail.com wrote: From: Thierry Reding tred...@nvidia.com The SIMPLE_DEV_PM_OPS macro already uses the const qualifier, so there's no need to repeat it. Signed-off-by: Thierry Reding tred...@nvidia.com Acked-by: Marc Dietrich marvi...@gmx.de --- drivers/staging/nvec/nvec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 11f9e1c3447c..aef52306620a 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -959,7 +959,7 @@ static int nvec_resume(struct device *dev) } #endif -static const SIMPLE_DEV_PM_OPS(nvec_pm_ops, nvec_suspend, nvec_resume); +static SIMPLE_DEV_PM_OPS(nvec_pm_ops, nvec_suspend, nvec_resume); /* Match table for of_platform binding */ static const struct of_device_id nvidia_nvec_of_match[] = { -- 2.0.1 -- Marc Dietrich marvi...@gmx.de ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: vt6655: remove redundant comments
On Sun, Jul 20, 2014 at 08:41:50AM +0300, Igor Bezukh wrote: Clean redundant comments in the code. You also messed with some strings :( Which would have been fine, in a separate patch. Please break this up into at least 2 different patches, each only doing one type of thing. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/nvec: Pass proper resource to mfd_add_devices()
On Mon, Jul 21, 2014 at 01:52:41PM +0200, Thierry Reding wrote: From: Thierry Reding tred...@nvidia.com The mfd_add_devices() parameter takes a struct resource * as fifth argument, but the nvec driver passes in a void __iomem *. The driver gets away with it because none of the subdevices ever directly access the registers. While at it, use platform_get_irq() instead of platform_get_resource() to get the device's interrupt. This makes it easier to pass in the register region since the variable is no longer reused. Signed-off-by: Thierry Reding tred...@nvidia.com --- Alternatively we could simply pass NULL into mfd_add_devices(), which might be a slightly more accurate representation of what's going on. Marc, Greg, any preferences? None from me, Marc? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/4] staging: unisys: remove virthba proc
On Mon, Jul 21, 2014 at 02:47:42PM -0400, Erik Arfvidson wrote: This patch removes all proc entries, directories, and functions A better Subject would be: staging: unisys: remove virthba proc files right? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/4] staging: unisys: added virthba debugfs dir and info entry
On Mon, Jul 21, 2014 at 02:47:43PM -0400, Erik Arfvidson wrote: This patch adds virthba debugfs directory and info entry Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 79 1 file changed, 79 insertions(+) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index b9cbcf2..121cc05 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -50,6 +50,7 @@ #include scsi/scsi_cmnd.h #include scsi/scsi_device.h #include asm/param.h +#include linux/debugfs.h #include linux/types.h #include virthba.h @@ -66,6 +67,11 @@ /* NOTE: L1_CACHE_BYTES =128 */ #define DEVICE_ATTRIBUTE struct device_attribute + /* MAX_BUF = 6 lines x 10 MAXVHBA x 80 characters + * = 4800 bytes ~ 2^13 = 8192 bytes + */ +#define MAX_BUF 8192 + /*/ /* Forward declarations */ /*/ @@ -104,6 +110,8 @@ static int virthba_serverup(struct virtpci_dev *virtpcidev); static int virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state); static void doDiskAddRemove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); +static ssize_t info_debugfs_read(struct file *file, char __user *buf, + size_t len, loff_t *offset); /*/ /* Globals */ @@ -221,9 +229,18 @@ struct virthba_devices_open { struct virthba_info *virthbainfo; }; +static const struct file_operations debugfs_info_fops = { + .read = info_debugfs_read, +}; + +/*/ +/* Structs */ +/*/ + #define VIRTHBASOPENMAX 1 /* array of open devices maintained by open() and close(); */ static struct virthba_devices_open VirtHbasOpen[VIRTHBASOPENMAX]; +static struct dentry *virthba_debugfs_dir; /*/ /* Local Functions*/ @@ -1342,6 +1359,62 @@ process_incoming_rsps(void *v) complete_and_exit(dc-threadinfo.has_stopped, 0); } +/*/ +/* Debugfs filesystem functions */ +/*/ + +static ssize_t info_debugfs_read(struct file *file, + char __user *buf, size_t len, loff_t *offset) +{ + ssize_t bytes_read = 0; + int str_pos = 0; + U64 phys_flags_addr; + int i; + struct virthba_info *virthbainfo; + char *vbuf; + + if (len MAX_BUF) + len = MAX_BUF; + vbuf = kzalloc(len, GFP_KERNEL); + if (!vbuf) + return -ENOMEM; + + for (i = 0; i VIRTHBASOPENMAX; i++) { + if (VirtHbasOpen[i].virthbainfo == NULL) + continue; + + virthbainfo = VirtHbasOpen[i].virthbainfo; + + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, MaxBuffLen:%u\n, MaxBuffLen); + + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + \nvirthba result queue poll wait:%d usecs.\n, + rsltq_wait_usecs); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + \ninterrupts_rcvd = %llu, interrupts_disabled = %llu\n, + virthbainfo-interrupts_rcvd, + virthbainfo-interrupts_disabled); + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, \ninterrupts_notme = %llu,\n, + virthbainfo-interrupts_notme); + phys_flags_addr = virt_to_phys((__force void *) +virthbainfo-flags_addr); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, + flags_addr = %p, phys_flags_addr=0x%016llx, FeatureFlags=%llu\n, + virthbainfo-flags_addr, phys_flags_addr, + (__le64)readq(virthbainfo-flags_addr)); + str_pos += scnprintf(vbuf + str_pos, + len - str_pos, acquire_failed_cnt:%llu\n, + virthbainfo-acquire_failed_cnt); + str_pos += scnprintf(vbuf + str_pos, len - str_pos, \n); + } + + bytes_read = simple_read_from_buffer(buf, len, offset, vbuf, str_pos); + kfree(vbuf); + return bytes_read; +} + /* As per VirtpciFunc returns 1
Re: [PATCH 4/4] staging: unisys: added virthba enable_ints entry
On Mon, Jul 21, 2014 at 02:47:45PM -0400, Erik Arfvidson wrote: This patch adds enable_ints entry to virthba directory Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/virthba/virthba.c | 63 1 file changed, 63 insertions(+) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 857de11..65a75c8 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -112,6 +112,8 @@ static void doDiskAddRemove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); static ssize_t info_debugfs_read(struct file *file, char __user *buf, size_t len, loff_t *offset); +static ssize_t enable_ints_write(struct file *file, + const char __user *buffer, size_t count, loff_t *ppos); /*/ /* Globals */ @@ -233,6 +235,10 @@ static const struct file_operations debugfs_info_fops = { .read = info_debugfs_read, }; +static const struct file_operations debugfs_enable_ints_fops = { + .write = enable_ints_write, +}; + /*/ /* Structs */ /*/ @@ -1415,6 +1421,60 @@ static ssize_t info_debugfs_read(struct file *file, return bytes_read; } +static ssize_t enable_ints_write(struct file *file, + const char __user *buffer, size_t count, loff_t *ppos) +{ + char buf[4]; + int i, new_value; + struct virthba_info *virthbainfo; + + U64 __iomem *Features_addr; + U64 mask; + + if (count = ARRAY_SIZE(buf)) + return -EINVAL; + + buf[count] = '\0'; + if (copy_from_user(buf, buffer, count)) { + LOGERR(copy_from_user failed. buf%.*s count%lu\n, +(int) count, buf, count); + return -EFAULT; + } + + i = kstrtoint(buf, 10 , new_value); + + if (i != 0) { + LOGERR(Failed to scan value for enable_ints, buf%.*s, +(int) count, buf); + return -EFAULT; Careful with allowing userspace to flood the log :( + } + + /*set all counts to new_value usually 0*/ We don't have a lack of ' ' characters available to us, please use them... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Hyperv: Trigger DHCP renew after host hibernation
From: Olaf Hering o...@aepfle.de Date: Mon, 21 Jul 2014 11:18:51 +0200 On Mon, Jul 21, Richard Weinberger wrote: My concern is that 10 seconds is maybe not a the right choice. (As we cannot know all implementations) Until someone reports an issue with it, 10 is fine. Just like 20 or 666. Wrong, this is policy and belongs in userspace. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 2/3] Staging: rts5208: Use dev_dbg and %*ph specifier to dump memory
Use dev_dbg with %*ph format specifier to dump memory instead of relying on custom macro. Signed-off-by: Fabio Falzoi fabio.falzo...@gmail.com --- drivers/staging/rts5208/ms.c| 4 ++-- drivers/staging/rts5208/rtsx_chip.c | 4 ++-- drivers/staging/rts5208/rtsx_scsi.c | 7 +++ drivers/staging/rts5208/sd.c| 6 +++--- drivers/staging/rts5208/trace.h | 8 5 files changed, 10 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index b1349e8..757b284 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -305,7 +305,7 @@ static int ms_read_bytes(struct rtsx_chip *chip, if ((tpc == PRO_READ_SHORT_DATA) (data_len == 8)) { dev_dbg(rtsx_dev(chip), Read format progress:\n); - RTSX_DUMP(ptr, cnt); + dev_dbg(rtsx_dev(chip), %*ph\n, cnt, ptr); } return STATUS_SUCCESS; @@ -1913,7 +1913,7 @@ RE_SEARCH: ptr = rtsx_get_cmd_data(chip); dev_dbg(rtsx_dev(chip), Boot block data:\n); - RTSX_DUMP(ptr, 16); + dev_dbg(rtsx_dev(chip), %*ph\n, 16, ptr); /* Block ID error * HEADER_ID0, HEADER_ID1 diff --git a/drivers/staging/rts5208/rtsx_chip.c b/drivers/staging/rts5208/rtsx_chip.c index 6ef0fc6..89993bb 100644 --- a/drivers/staging/rts5208/rtsx_chip.c +++ b/drivers/staging/rts5208/rtsx_chip.c @@ -1311,8 +1311,8 @@ int rtsx_write_cfg_seq(struct rtsx_chip *chip, u8 func, u16 addr, u8 *buf, } } - RTSX_DUMP(mask, dw_len * 4); - RTSX_DUMP(data, dw_len * 4); + dev_dbg(rtsx_dev(chip), %*ph\n, dw_len * 4, mask); + dev_dbg(rtsx_dev(chip), %*ph\n, dw_len * 4, data); for (i = 0; i dw_len; i++) { retval = rtsx_write_cfg_dw(chip, func, aligned_addr + i * 4, diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c index 8312cd6..5cfa9cf 100644 --- a/drivers/staging/rts5208/rtsx_scsi.c +++ b/drivers/staging/rts5208/rtsx_scsi.c @@ -39,7 +39,7 @@ void scsi_show_command(struct rtsx_chip *chip) { struct scsi_cmnd *srb = chip-srb; char *what = NULL; - int i, unknown_cmd = 0; + int unknown_cmd = 0, len; switch (srb-cmnd[0]) { case TEST_UNIT_READY: @@ -319,9 +319,8 @@ void scsi_show_command(struct rtsx_chip *chip) what, srb-cmd_len); if (unknown_cmd) { - for (i = 0; i srb-cmd_len i 16; i++) - dev_dbg(rtsx_dev(chip), %02x, srb-cmnd[i]); - dev_dbg(rtsx_dev(chip), \n); + len = min_t(unsigned short, srb-cmd_len, 16); + dev_dbg(rtsx_dev(chip), %*ph\n, len, srb-cmnd); } } diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index 31aa438..ee70ed2 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -427,7 +427,7 @@ static int sd_check_csd(struct rtsx_chip *chip, char check_wp) memcpy(sd_card-raw_csd, rsp + 1, 15); dev_dbg(rtsx_dev(chip), CSD Response:\n); - RTSX_DUMP(sd_card-raw_csd, 16); + dev_dbg(rtsx_dev(chip), %*ph\n, 16, sd_card-raw_csd); csd_ver = (rsp[1] 0xc0) 6; dev_dbg(rtsx_dev(chip), csd_ver = %d\n, csd_ver); @@ -1060,7 +1060,7 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode, TRACE_RET(chip, STATUS_FAIL); } - RTSX_DUMP(buf, 64); + dev_dbg(rtsx_dev(chip), %*ph\n, 64, buf); if (func_group == NO_ARGUMENT) { sd_card-func_group1_mask = buf[0x0D]; @@ -2119,7 +2119,7 @@ static int sd_check_wp_state(struct rtsx_chip *chip) } dev_dbg(rtsx_dev(chip), ACMD13:\n); - RTSX_DUMP(buf, 64); + dev_dbg(rtsx_dev(chip), %*ph\n, 64, buf); sd_card_type = ((u16)buf[2] 8) | buf[3]; dev_dbg(rtsx_dev(chip), sd_card_type = 0x%04x\n, sd_card_type); diff --git a/drivers/staging/rts5208/trace.h b/drivers/staging/rts5208/trace.h index fbb304a..a9ab407 100644 --- a/drivers/staging/rts5208/trace.h +++ b/drivers/staging/rts5208/trace.h @@ -84,12 +84,4 @@ static inline char *filename(char *path) #define TRACE_GOTO(chip, label)goto label #endif -#ifdef CONFIG_RTS5208_DEBUG -#define RTSX_DUMP(buf, buf_len)\ - print_hex_dump(KERN_DEBUG, KBUILD_MODNAME : , \ - DUMP_PREFIX_NONE, 16, 1, (buf), (buf_len), false) -#else -#define RTSX_DUMP(buf, buf_len) -#endif - #endif /* __REALTEK_RTSX_TRACE_H */ -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 0/3] Staging: rts5208: Use standard debug features
Use standard debug features instead of relying on the custom configuration option CONFIG_RTS5208_DEBUG and a series of home grown macros. Changes in v4: * use dev_dbg instead of pr_debug * use dev_dbg with %*ph modifier instead of print_hex_dump_bytes Changes in v3: * defined rtsx_hex_dump as a static inline function to avoid checkpatch errors Changes in v2: * defined rtsx_hex_dump macro to produce output only if DEBUG is defined Fabio Falzoi (3): Staging: rts5208: Replace custom macro with dev_dbg Staging: rts5208: Use dev_dbg and %*ph specifier to dump memory Staging: rts5208: Remove CONFIG_RTS5208_DEBUG option drivers/staging/rts5208/Kconfig | 7 -- drivers/staging/rts5208/debug.h | 43 --- drivers/staging/rts5208/ms.c | 130 +++-- drivers/staging/rts5208/rtsx.c | 6 +- drivers/staging/rts5208/rtsx.h | 1 - drivers/staging/rts5208/rtsx_card.c | 73 ++-- drivers/staging/rts5208/rtsx_card.h | 1 - drivers/staging/rts5208/rtsx_chip.c | 139 -- drivers/staging/rts5208/rtsx_chip.h | 5 + drivers/staging/rts5208/rtsx_scsi.c | 47 drivers/staging/rts5208/rtsx_scsi.h | 2 +- drivers/staging/rts5208/rtsx_transport.c | 55 + drivers/staging/rts5208/sd.c | 194 +-- drivers/staging/rts5208/spi.c| 7 +- drivers/staging/rts5208/trace.h | 14 +-- drivers/staging/rts5208/xd.c | 113 ++ 16 files changed, 424 insertions(+), 413 deletions(-) delete mode 100644 drivers/staging/rts5208/debug.h -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 3/3] Staging: rts5208: Remove CONFIG_RTS5208_DEBUG option
CONFIG_RTS5208_DEBUG is no more needed, we rely on dynamic debug config options instead. Signed-off-by: Fabio Falzoi fabio.falzo...@gmail.com --- drivers/staging/rts5208/Kconfig | 7 --- drivers/staging/rts5208/sd.c| 5 + 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/staging/rts5208/Kconfig b/drivers/staging/rts5208/Kconfig index 055655c..05c990f 100644 --- a/drivers/staging/rts5208/Kconfig +++ b/drivers/staging/rts5208/Kconfig @@ -6,10 +6,3 @@ config RTS5208 PCI-E card reader rts5208/rts5288. If this driver is compiled as a module, it will be named rts5208. - -config RTS5208_DEBUG - bool Realtek PCI-E Card Reader RTS5208/5288 verbose debug - depends on RTS5208 - help - Say Y here in order to have the rts5208 code generate - verbose debugging messages. diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index ee70ed2..f9ac886 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -812,12 +812,10 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 sample_point, u8 tune_dir) PHASE_NOT_RESET); RTSX_WRITE_REG(chip, CLK_CTL, CHANGE_CLK, 0); } else { -#ifdef CONFIG_RTS5208_DEBUG rtsx_read_register(chip, SD_VP_CTL, val); dev_dbg(rtsx_dev(chip), SD_VP_CTL: 0x%x\n, val); rtsx_read_register(chip, SD_DCMPS_CTL, val); dev_dbg(rtsx_dev(chip), SD_DCMPS_CTL: 0x%x\n, val); -#endif if (ddr_rx) { RTSX_WRITE_REG(chip, SD_VP_CTL, PHASE_CHANGE, @@ -863,12 +861,11 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 sample_point, u8 tune_dir) return STATUS_SUCCESS; Fail: -#ifdef CONFIG_RTS5208_DEBUG rtsx_read_register(chip, SD_VP_CTL, val); dev_dbg(rtsx_dev(chip), SD_VP_CTL: 0x%x\n, val); rtsx_read_register(chip, SD_DCMPS_CTL, val); dev_dbg(rtsx_dev(chip), SD_DCMPS_CTL: 0x%x\n, val); -#endif + rtsx_write_register(chip, SD_DCMPS_CTL, DCMPS_CHANGE, 0); rtsx_write_register(chip, SD_VP_CTL, PHASE_CHANGE, 0); wait_timeout(10); -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/nvec: Pass proper resource to mfd_add_devices()
On Mon, Jul 21, 2014 at 10:01:36PM +0200, Marc Dietrich wrote: Hi Thierry, On Mon, 21 Jul 2014 13:52:41 +0200 Thierry Reding thierry.red...@gmail.com wrote: From: Thierry Reding tred...@nvidia.com The mfd_add_devices() parameter takes a struct resource * as fifth argument, but the nvec driver passes in a void __iomem *. The driver gets away with it because none of the subdevices ever directly access the registers. you are right, this one looked bogus. While at it, use platform_get_irq() instead of platform_get_resource() to get the device's interrupt. This makes it easier to pass in the register region since the variable is no longer reused. Signed-off-by: Thierry Reding tred...@nvidia.com --- Alternatively we could simply pass NULL into mfd_add_devices(), which might be a slightly more accurate representation of what's going on. Marc, Greg, any preferences? I just tested with NULL as base and it seems to produce no harm. Even if we may get rid of mfd_add_devices in the future, passing NULL is cleaner for now and no children will ever make use of it. So please send a new version with this change. Otherwise, thanks for looking and cleaning up. Ok, can I get your ack for this patch then? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging/nvec: Pass proper resource to mfd_add_devices()
On Mon, Jul 21, 2014 at 02:39:15PM -0700, Greg Kroah-Hartman wrote: On Mon, Jul 21, 2014 at 10:01:36PM +0200, Marc Dietrich wrote: Hi Thierry, On Mon, 21 Jul 2014 13:52:41 +0200 Thierry Reding thierry.red...@gmail.com wrote: From: Thierry Reding tred...@nvidia.com The mfd_add_devices() parameter takes a struct resource * as fifth argument, but the nvec driver passes in a void __iomem *. The driver gets away with it because none of the subdevices ever directly access the registers. you are right, this one looked bogus. While at it, use platform_get_irq() instead of platform_get_resource() to get the device's interrupt. This makes it easier to pass in the register region since the variable is no longer reused. Signed-off-by: Thierry Reding tred...@nvidia.com --- Alternatively we could simply pass NULL into mfd_add_devices(), which might be a slightly more accurate representation of what's going on. Marc, Greg, any preferences? I just tested with NULL as base and it seems to produce no harm. Even if we may get rid of mfd_add_devices in the future, passing NULL is cleaner for now and no children will ever make use of it. So please send a new version with this change. Otherwise, thanks for looking and cleaning up. Ok, can I get your ack for this patch then? I'll resend a patch which passes in NULL as base tomorrow as requested by Marc. Thierry pgpIoxMuG8nHX.pgp Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] Drivers: scsi: storvsc: Add blist flags
Add blist flags to permit the reading of the VPD pages even when the target may claim SPC-2 compliance. MSFT targets currently claim SPC-2 compliance while they implement post SPC-2 features. With this patch we can correctly handle WRITE_SAME_16 issues. Signed-off-by: K. Y. Srinivasan k...@microsoft.com --- drivers/scsi/storvsc_drv.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 29d0329..15ba695 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -327,6 +327,8 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, Ring buffer size (bytes)); */ static int storvsc_timeout = 180; +static int msft_blist_flags = BLIST_TRY_VPD_PAGES; + #define STORVSC_MAX_IO_REQUESTS200 static void storvsc_on_channel_callback(void *context); @@ -1449,6 +1451,14 @@ static int storvsc_device_configure(struct scsi_device *sdevice) sdevice-no_write_same = 1; + /* +* Add blist flags to permit the reading of the VPD pages even when +* the target may claim SPC-2 compliance. MSFT targets currently +* claim SPC-2 compliance while they implement post SPC-2 features. +* With this patch we can correctly handle WRITE_SAME_16 issues. +*/ + sdevice-sdev_bflags |= msft_blist_flags; + return 0; } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/25] Replace DEFINE_PCI_DEVICE_TABLE macro use
[+cc Jingoo] On Fri, Jul 18, 2014 at 12:50 PM, James Bottomley james.bottom...@hansenpartnership.com wrote: On Fri, 2014-07-18 at 11:17 -0700, Greg KH wrote: On Fri, Jul 18, 2014 at 09:54:32AM -0700, James Bottomley wrote: On Fri, 2014-07-18 at 09:43 -0700, Greg KH wrote: On Fri, Jul 18, 2014 at 12:22:13PM -0400, John W. Linville wrote: On Fri, Jul 18, 2014 at 05:26:47PM +0200, Benoit Taine wrote: We should prefer `const struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to meet kernel coding style guidelines. This issue was reported by checkpatch. Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead? The macro is horrid, no other bus has this type of thing just to save a few characters in typing OK, so this is the macro: #define DEFINE_PCI_DEVICE_TABLE(_table) \ const struct pci_device_id _table[] Could you explain what's so horrible? The reason it's useful today is that people forget the const (and sometimes the [] making it a true table instead of a pointer). If you use the DEFINE_PCI_DEVICE_TABLE macro, the compile breaks if you use it wrongly (good) and you automatically get the correct annotations. We have almost 1000 more uses of the non-macro version than the macro version in the kernel today: $ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep const struct pci_device_id | wc -l 1254 My big complaint is that we need to be consistant, either pick one or the other and stick to it. As the macro is the least used, it's easiest to fix up, and it also is more consistant with all other kernel subsystems which do not have such a macro. I've a weak preference for consistency, but not at the expense of hundreds of patches churning the kernel to remove an innocuous macro. Churn costs time and effort. As there is no need for the __init macro mess anymore, there's no real need for the DEFINE_PCI_DEVICE_TABLE macro either. I think checkpatch will catch the use of non-const users for the id table already today, it catches lots of other uses like this already. , so why should PCI be special in this regard anymore? I think the PCI usage dwarfs most other bus types now, so you could turn the question around. However, I don't think majority voting is a good guide to best practise; lets debate the merits for their own sake. Not really dwarf, USB is close with over 700 such structures: $ git grep const struct usb_device_id | wc -l 725 And i2c is almost just as big as PCI: $ git grep const struct i2c_device_id | wc -l 1223 So again, this macro is not consistent with the majority of PCI drivers, nor with any other type of device id declaration in the kernel, which is why I feel it should be removed. And finally, the PCI documentation itself says to not use this macro, so this isn't a new thing. From Documentation/PCI/pci.txt: The ID table is an array of struct pci_device_id entries ending with an all-zero entry. Definitions with static const are generally preferred. Use of the deprecated macro DEFINE_PCI_DEVICE_TABLE should be avoided. That wording went into the file last December, when we last talked about this and everyone in that discussion agreed to remove the macro for the above reasons. Consistency matters. In this case, I don't think it does that much ... a cut and paste either way (from a macro or non-macro based driver) yields correct code. Since there's no bug here and no apparent way to misuse the macro, why bother? Anyway, it's PCI code ... let the PCI maintainer decide. However, if he does want this do it as one big bang patch via either the PCI or Trivial tree (latter because Jiří has experience doing this, but the former might be useful so the decider feels the pain ...) I don't feel strongly either way, so I guess I'm OK with this, and in the spirit of feeling the pain, I'm willing to handle it. Jingoo proposed similar patches, so it might be nice to give him some credit. Benoit, how about if you wait until about half-way through the merge window after v3.16 releases, generate an up-to-date single patch, and post that? Then we can try to get it in before v3.17-rc1 to minimize merge hassles. Bjorn ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: llite: rw.c: use gfp_t to store GFP flags
Use gfp_t to store GPF_* flags instead of unsigned int. This was reported by sparse. Signed-off-by: Guillaume Morin guilla...@morinfr.org --- drivers/staging/lustre/lustre/llite/rw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index 5616210..3554272 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -496,7 +496,7 @@ static int ll_read_ahead_page(const struct lu_env *env, struct cl_io *io, struct cl_object *clob = ll_i2info(mapping-host)-lli_clob; struct cl_page *page; enum ra_stat which = _NR_RA_STAT; /* keep gcc happy */ - unsigned int gfp_mask; + gfp_t gfp_mask; intrc= 0; const char *msg = NULL; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: llite: rw.c: use gfp_t to store GFP flags
On Tue, Jul 22, 2014 at 02:57:57AM +0200, Guillaume Morin wrote: Use gfp_t to store GPF_* flags instead of unsigned int. This was reported by sparse. Signed-off-by: Guillaume Morin guilla...@morinfr.org --- drivers/staging/lustre/lustre/llite/rw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index 5616210..3554272 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -496,7 +496,7 @@ static int ll_read_ahead_page(const struct lu_env *env, struct cl_io *io, struct cl_object *clob = ll_i2info(mapping-host)-lli_clob; struct cl_page *page; enum ra_stat which = _NR_RA_STAT; /* keep gcc happy */ - unsigned int gfp_mask; + gfp_t gfp_mask; Odd thing is, that function doesn't seem to even use that variable anywhere... Can you just remove it entirely? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Realtek RTL8821ae driver
On Mon, Jul 21, 2014 at 08:50:26PM -0400, Chris Murphy wrote: Problem: On Asus TX201LA running 15.6 kernel x86_64, driver repeatedly disconnects and reconnects. Dual boot same machine on Win 8.1 is very stable. Behavior starts as soon as Linux is booted and logged in. Saw same behavior on 13.32 and earlier kernel versions. Using the latest bios upgrade. Keywords: RTL8821AE, TX201LA, Asus Trio In addition to the environment info below, I include a copy of dmesg which shows the behavior. Linux version 3.15.6-031506-generic (apw@gomeisa) (gcc version 4.6.3 (Ubuntu/ Linaro 4.6.3-1ubuntu5) ) #201407172034 SMP Fri Jul 18 00:36:12 UTC 2014 This is a horrid driver, people are working on making it better for later kernels by rewriting it entirely. I think that driver will be merged in the 3.17 kernel release, can you look in the linux-next release to see if it is there? Larry, what's the status of your rewrite for this code? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: llite: rw.c: remove gfp_mask
sparse reported that gfp_mask was of the wrong type to store gfp flags. The variable is not used so it can be removed. Signed-off-by: Guillaume Morin guilla...@morinfr.org Suggested-by: gre...@linuxfoundation.org --- v2: remove the variable instead of just fixing the type since it is not used drivers/staging/lustre/lustre/llite/rw.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index 5616210..1b5416f 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -496,14 +496,9 @@ static int ll_read_ahead_page(const struct lu_env *env, struct cl_io *io, struct cl_object *clob = ll_i2info(mapping-host)-lli_clob; struct cl_page *page; enum ra_stat which = _NR_RA_STAT; /* keep gcc happy */ - unsigned int gfp_mask; intrc= 0; const char *msg = NULL; - gfp_mask = GFP_HIGHUSER ~__GFP_WAIT; -#ifdef __GFP_NOWARN - gfp_mask |= __GFP_NOWARN; -#endif vmpage = grab_cache_page_nowait(mapping, index); if (vmpage != NULL) { /* Check if vmpage was truncated or reclaimed */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: llite: rw.c: use gfp_t to store GFP flags
On 21 Jul 19:08, Greg KH wrote: Odd thing is, that function doesn't seem to even use that variable anywhere... Can you just remove it entirely? Oh that's right. Resubmitted. Thanks Guillaume. -- Guillaume Morin guilla...@morinfr.org ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] Staging: comedi: amcc_s5933: a style issue fixed
A 'line over 80 characters' fixed by removing comment to the previous line. Signed-off-by: Sam Asadi asadi.sam...@gmail.com --- drivers/staging/comedi/drivers/amcc_s5933.h |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/amcc_s5933.h b/drivers/staging/comedi/drivers/amcc_s5933.h index 089b71f..c9f2afa 100644 --- a/drivers/staging/comedi/drivers/amcc_s5933.h +++ b/drivers/staging/comedi/drivers/amcc_s5933.h @@ -54,7 +54,8 @@ #define INTCSR_INBOX_FULL_INT 0x1000 /* enable inbox full interrupt */ /* read, or write clear inbox full interrupt */ #define INTCSR_INBOX_INTR_STATUS 0x2 -#define INTCSR_INTR_ASSERTED 0x80/* read only, interrupt asserted */ +/* read only, interrupt asserted */ +#define INTCSR_INTR_ASSERTED 0x80 // /* AMCC - PCI non-volatile ram command register (byte 3 of master control/status register) */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] Staging: comedi: amcc_s5933: a line over 80 fixed
A 'line over 80 characters' fixed by removing comment to previous line. Signed-off-by: Sam Asadi asadi.sam...@gmail.com --- drivers/staging/comedi/drivers/amcc_s5933.h |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/amcc_s5933.h b/drivers/staging/comedi/drivers/amcc_s5933.h index 2ba7364..089b71f 100644 --- a/drivers/staging/comedi/drivers/amcc_s5933.h +++ b/drivers/staging/comedi/drivers/amcc_s5933.h @@ -52,7 +52,8 @@ #define INTCSR_INBOX_BYTE(x) (((x) 0x3) 8) #define INTCSR_INBOX_SELECT(x) (((x) 0x3) 10) #define INTCSR_INBOX_FULL_INT 0x1000 /* enable inbox full interrupt */ -#define INTCSR_INBOX_INTR_STATUS 0x2 /* read, or write clear inbox full interrupt */ +/* read, or write clear inbox full interrupt */ +#define INTCSR_INBOX_INTR_STATUS 0x2 #define INTCSR_INTR_ASSERTED 0x80/* read only, interrupt asserted */ // -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Realtek RTL8821ae driver
On 07/21/2014 09:10 PM, Greg KH wrote: On Mon, Jul 21, 2014 at 08:50:26PM -0400, Chris Murphy wrote: Problem: On Asus TX201LA running 15.6 kernel x86_64, driver repeatedly disconnects and reconnects. Dual boot same machine on Win 8.1 is very stable. Behavior starts as soon as Linux is booted and logged in. Saw same behavior on 13.32 and earlier kernel versions. Using the latest bios upgrade. Keywords: RTL8821AE, TX201LA, Asus Trio In addition to the environment info below, I include a copy of dmesg which shows the behavior. Linux version 3.15.6-031506-generic (apw@gomeisa) (gcc version 4.6.3 (Ubuntu/ Linaro 4.6.3-1ubuntu5) ) #201407172034 SMP Fri Jul 18 00:36:12 UTC 2014 This is a horrid driver, people are working on making it better for later kernels by rewriting it entirely. I think that driver will be merged in the 3.17 kernel release, can you look in the linux-next release to see if it is there? Larry, what's the status of your rewrite for this code? It is taking longer than I had hoped. Kernel 3.18 is a more realistic time. Larry ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel