[PATCH 2/4] staging: wilc1000: remove define DISABLE_PWRSAVE_AND_SCAN_DURING_IP
The driver will use define DISABLE_PWRSAVE_AND_SCAN_DURING_IP always. So remove the ifdef line and define in Makefile. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/Makefile | 2 +- drivers/staging/wilc1000/host_interface.c | 22 -- drivers/staging/wilc1000/linux_wlan.c | 14 -- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 16 4 files changed, 1 insertion(+), 53 deletions(-) diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index bdeffea..afae7d6 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -10,7 +10,7 @@ ccflags-y += -DSTA_FIRMWARE=\"atmel/wilc1000_fw.bin\" \ ccflags-y += -I$(src)/ -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \ -DPLL_WORKAROUND -DCONNECT_DIRECT -DAGING_ALG \ - -DWILC_PARSE_SCAN_IN_HOST -DDISABLE_PWRSAVE_AND_SCAN_DURING_IP \ + -DWILC_PARSE_SCAN_IN_HOST \ -Wno-unused-function -DWILC_DEBUGFS #ccflags-y += -DTCP_ACK_FILTER diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 158d8b8..5d1c7f4 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4,9 +4,7 @@ extern u8 connecting; -#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP extern struct timer_list hDuringIpTimer; -#endif extern u8 g_wilc_initialized; /*/ @@ -518,9 +516,7 @@ typedef enum { static tstrWILC_WFIDrv *wfidrv_list[NUM_CONCURRENT_IFC + 1]; tstrWILC_WFIDrv *terminated_handle; tstrWILC_WFIDrv *gWFiDrvHandle; -#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP bool g_obtainingIP = false; -#endif u8 P2P_LISTEN_STATE; static struct task_struct *HostIFthreadHandler; static WILC_MsgQueueHandle gMsgQHostIF; @@ -1307,14 +1303,12 @@ static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler, goto ERRORHANDLER; } - #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP if (g_obtainingIP || connecting) { PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until IP adresss is obtained\n"); PRINT_ER("Don't do obss scan\n"); s32Error = -EBUSY; goto ERRORHANDLER; } - #endif PRINT_D(HOSTINF_DBG, "Setting SCAN params\n"); @@ -2525,20 +2519,15 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler, * else change state to IDLE */ if ((u8MacStatus == MAC_CONNECTED) && (strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE)) { - #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP - host_int_set_power_mgmt(pstrWFIDrv, 0, 0); - #endif PRINT_D(HOSTINF_DBG, "MAC status : CONNECTED and Connect Status : Successful\n"); pstrWFIDrv->enuHostIFstate = HOST_IF_CONNECTED; - #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP PRINT_D(GENERIC_DBG, "Obtaining an IP, Disable Scan\n"); g_obtainingIP = true; mod_timer(&hDuringIpTimer, jiffies + msecs_to_jiffies(1)); - #endif #ifdef WILC_PARSE_SCAN_IN_HOST /* open a BA session if possible */ @@ -2601,11 +2590,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler, strDisconnectNotifInfo.ie_len = 0; if (pstrWFIDrv->strWILC_UsrConnReq.pfUserConnectResult != NULL) { - #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP - g_obtainingIP = false; host_int_set_power_mgmt(pstrWFIDrv, 0, 0); - #endif pstrWFIDrv->strWILC_UsrConnReq.pfUserConnectResult(CONN_DISCONN_EVENT_DISCONN_NOTIF, NULL, @@ -3076,11 +3062,8 @@ static void Handle_Disconnect(tstrWILC_WFIDrv *drvHandler) PRINT_D(HOSTINF_DBG, "Sending disconnect request\n"); - #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP - g_obtainingIP = false; host_int_set_power_mgmt(pstrWFIDrv, 0, 0); - #endif memset(u8ConnectedSSID, 0, ETH_ALEN); @@ -3806,13 +3789,11 @@ static int Handle_RemainOnChan(tstrWILC_WFIDrv *drvHandler, goto ERRORHANDLER; } - #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP if (g_obtainingIP || connecting) { PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do ob
[PATCH 3/4] staging: wilc1000: remove define WILC_PARSE_SCAN_IN_HOST
The define WILC_PARSE_SCAN_IN_HOST is always used in the driver, so just delete ifdef WILC_PARSE_SCAN_IN_HOST line, ifndef WILC_PARSE_SCAN_IN_HOST line and it's related codes. Finally, remove define in Makefile. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/Makefile | 1 - drivers/staging/wilc1000/host_interface.c | 62 --- drivers/staging/wilc1000/wilc_wlan_if.h | 3 +- 3 files changed, 1 insertion(+), 65 deletions(-) diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index afae7d6..ac15e5a 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -10,7 +10,6 @@ ccflags-y += -DSTA_FIRMWARE=\"atmel/wilc1000_fw.bin\" \ ccflags-y += -I$(src)/ -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \ -DPLL_WORKAROUND -DCONNECT_DIRECT -DAGING_ALG \ - -DWILC_PARSE_SCAN_IN_HOST \ -Wno-unused-function -DWILC_DEBUGFS #ccflags-y += -DTCP_ACK_FILTER diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 5d1c7f4..98a99d6 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -462,7 +462,6 @@ typedef struct _tstrWidJoinReqExt { } tstrWidJoinReqExt; #endif -#ifdef WILC_PARSE_SCAN_IN_HOST /*Struct containg joinParam of each AP*/ typedef struct _tstrJoinBssParam { BSSTYPE_T bss_type; @@ -499,7 +498,6 @@ typedef struct _tstrBssTable { tstrJoinBssParam *head; tstrJoinBssParam *tail; } tstrBssTable; -#endif /*WILC_PARSE_SCAN_IN_HOST*/ typedef enum { SCAN_TIMER = 0, @@ -559,9 +557,7 @@ tstrWILC_WFIDrv *gu8FlushedJoinReqDrvHandler; #define FLUSHED_JOIN_REQ 1 #define FLUSHED_BYTE_POS 79 /* Position the byte indicating flushing in the flushed request */ -#ifdef WILC_PARSE_SCAN_IN_HOST static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo); -#endif /*WILC_PARSE_SCAN_IN_HOST*/ extern void chip_sleep_manually(u32 u32SleepTime); extern int linux_wlan_get_num_conn_ifcs(void); @@ -1516,10 +1512,7 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, wid_site_survey_reslts_s *pstrSurveyResults = NULL; #else u8 *pu8CurrByte = NULL; - #ifdef WILC_PARSE_SCAN_IN_HOST tstrJoinBssParam *ptstrJoinBssParam; - #endif /*WILC_PARSE_SCAN_IN_HOST*/ - #endif PRINT_D(GENERIC_DBG, "Handling connect request\n"); @@ -1691,14 +1684,12 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, PRINT_INFO(HOSTINF_DBG, "Saving connection parameters in global structure\n"); - #ifdef WILC_PARSE_SCAN_IN_HOST ptstrJoinBssParam = (tstrJoinBssParam *)pstrHostIFconnectAttr->pJoinParams; if (ptstrJoinBssParam == NULL) { PRINT_ER("Required BSSID not found\n"); s32Error = -ENOENT; goto ERRORHANDLER; } - #endif /*WILC_PARSE_SCAN_IN_HOST*/ if (pstrHostIFconnectAttr->pu8bssid != NULL) { pstrWFIDrv->strWILC_UsrConnReq.pu8bssid = kmalloc(6, GFP_KERNEL); @@ -1794,40 +1785,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, PRINT_D(HOSTINF_DBG, "Connecting to network of SSID %s on channel %d\n", pstrWFIDrv->strWILC_UsrConnReq.pu8ssid, pstrHostIFconnectAttr->u8channel); - -#ifndef WILC_PARSE_SCAN_IN_HOST - strWIDList[u32WidsCount].u16WIDid = (u16)WID_JOIN_REQ_EXTENDED; - strWIDList[u32WidsCount].enuWIDtype = WID_STR; - strWIDList[u32WidsCount].s32ValueSize = MAX_SSID_LEN + 7; - strWIDList[u32WidsCount].ps8WidVal = kmalloc(strWIDList[u32WidsCount].s32ValueSize, GFP_KERNEL); - - if (strWIDList[u32WidsCount].ps8WidVal == NULL) { - s32Error = -EFAULT; - goto ERRORHANDLER; - } - - pu8CurrByte = strWIDList[u32WidsCount].ps8WidVal; - - if (pstrHostIFconnectAttr->pu8ssid != NULL) { - memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8ssid, pstrHostIFconnectAttr->ssidLen); - pu8CurrByte[pstrHostIFconnectAttr->ssidLen] = '\0'; - } - pu8CurrByte += MAX_SSID_LEN; - if ((pstrHostIFconnectAttr->u8channel >= 1) && (pstrHostIFconnectAttr->u8channel <= 14)) { - *(pu8CurrByte++) = pstrHostIFconnectAttr->u8channel; - } else { - PRINT_ER("Channel out of range\n"); - *(pu8CurrByte++) = 0xFF; - } - if (pstrHostIFconnectAttr->pu8bssid != NULL) - memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8bssid, 6); - pu8CurrByte += 6; - - /* keep the buffer at the start of the allocated pointer to use it with the free*/ - pu8CurrByte = strWIDList[u32WidsCount].ps8WidVal; - - #else - strWIDList[u32WidsCount].u16WIDid = (u16)WID_JOIN_REQ_EXTENDED; strWIDList[u32WidsCount].enuWIDtype = WID_STR; @@ -1957,9 +1914,6 @@ static s32 Handle_Connect
[PATCH 1/4] staging: wilc1000: remove ifdef OLD_FPGA_BITFILE line
OLD_FPGA_BITFILE is not used in the driver. Just delete ifdef line and it's related codes. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 18 -- 1 file changed, 18 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 0a930ec..9f5b5e6 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1500,22 +1500,6 @@ static int wilc_wlan_start(void) /** * Set the host interface **/ -#ifdef OLD_FPGA_BITFILE - acquire_bus(ACQUIRE_ONLY); - ret = p->hif_func.hif_read_reg(WILC_VMM_CORE_CTL, ®); - if (!ret) { - wilc_debug(N_ERR, "[wilc start]: fail read reg vmm_core_ctl...\n"); - release_bus(RELEASE_ALLOW_SLEEP); - return ret; - } - reg |= (p->io_func.io_type << 2); - ret = p->hif_func.hif_write_reg(WILC_VMM_CORE_CTL, reg); - if (!ret) { - wilc_debug(N_ERR, "[wilc start]: fail write reg vmm_core_ctl...\n"); - release_bus(RELEASE_ONLY); - return ret; - } -#else if (p->io_func.io_type == HIF_SDIO) { reg = 0; reg |= (1 << 3); /* bug 4456 and 4557 */ @@ -1572,8 +1556,6 @@ static int wilc_wlan_start(void) ret = -5; return ret; } -#endif - /** * Bus related -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: wilc1000: remove define CONNECT_DIRECT
The driver use CONNECT_DIRECT define as always. No need to provide as feature. This patch removes ifdef/ifndef CONNECT_DIRECT line and it's related codes inside ifndef CONNECT_DIRECT. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/Makefile | 2 +- drivers/staging/wilc1000/coreconfigurator.c | 70 - drivers/staging/wilc1000/coreconfigurator.h | 20 --- drivers/staging/wilc1000/host_interface.c | 233 drivers/staging/wilc1000/host_interface.h | 40 - 5 files changed, 1 insertion(+), 364 deletions(-) diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index ac15e5a..e965df9 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -9,7 +9,7 @@ ccflags-y += -DSTA_FIRMWARE=\"atmel/wilc1000_fw.bin\" \ -DP2P_CONCURRENCY_FIRMWARE=\"atmel/wilc1000_p2p_fw.bin\" ccflags-y += -I$(src)/ -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \ - -DPLL_WORKAROUND -DCONNECT_DIRECT -DAGING_ALG \ + -DPLL_WORKAROUND -DAGING_ALG \ -Wno-unused-function -DWILC_DEBUGFS #ccflags-y += -DTCP_ACK_FILTER diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 14e8efc..3e89c16 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -649,76 +649,6 @@ s32 DeallocateAssocRespInfo(tstrConnectRespInfo *pstrConnectRespInfo) return s32Error; } -#ifndef CONNECT_DIRECT -s32 ParseSurveyResults(u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZE], - wid_site_survey_reslts_s **ppstrSurveyResults, - u32 *pu32SurveyResultsCount) -{ - s32 s32Error = 0; - wid_site_survey_reslts_s *pstrSurveyResults = NULL; - u32 u32SurveyResultsCount = 0; - u32 u32SurveyBytesLength = 0; - u8 *pu8BufferPtr; - u32 u32RcvdSurveyResultsNum = 2; - u8 u8ReadSurveyResFragNum; - u32 i; - u32 j; - - for (i = 0; i < u32RcvdSurveyResultsNum; i++) { - u32SurveyBytesLength = ppu8RcvdSiteSurveyResults[i][0]; - - - for (j = 0; j < u32SurveyBytesLength; j += SURVEY_RESULT_LENGTH) { - u32SurveyResultsCount++; - } - } - - pstrSurveyResults = kmalloc_array(u32SurveyResultsCount, - sizeof(wid_site_survey_reslts_s), GFP_KERNEL); - if (!pstrSurveyResults) - return -ENOMEM; - - memset((void *)(pstrSurveyResults), 0, u32SurveyResultsCount * sizeof(wid_site_survey_reslts_s)); - - u32SurveyResultsCount = 0; - - for (i = 0; i < u32RcvdSurveyResultsNum; i++) { - pu8BufferPtr = ppu8RcvdSiteSurveyResults[i]; - - u32SurveyBytesLength = pu8BufferPtr[0]; - - /* TODO: mostafa: pu8BufferPtr[1] contains the fragment num */ - u8ReadSurveyResFragNum = pu8BufferPtr[1]; - - pu8BufferPtr += 2; - - for (j = 0; j < u32SurveyBytesLength; j += SURVEY_RESULT_LENGTH) { - memcpy(&pstrSurveyResults[u32SurveyResultsCount], pu8BufferPtr, SURVEY_RESULT_LENGTH); - pu8BufferPtr += SURVEY_RESULT_LENGTH; - u32SurveyResultsCount++; - } - } - -ERRORHANDLER: - *ppstrSurveyResults = pstrSurveyResults; - *pu32SurveyResultsCount = u32SurveyResultsCount; - - return s32Error; -} - - -s32 DeallocateSurveyResults(wid_site_survey_reslts_s *pstrSurveyResults) -{ - s32 s32Error = 0; - - if (pstrSurveyResults != NULL) { - kfree(pstrSurveyResults); - } - - return s32Error; -} -#endif - /** * @brief Deinitializes the Core Configurator * @details diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 8439066..0cecd0c 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -143,19 +143,6 @@ typedef struct { size_t ie_len; } tstrDisconnectNotifInfo; -#ifndef CONNECT_DIRECT -typedef struct wid_site_survey_reslts { - char SSID[MAX_SSID_LEN]; - u8 BssType; - u8 Channel; - u8 SecurityStatus; - u8 BSSID[6]; - char RxPower; - u8 Reserved; - -} wid_site_survey_reslts_s; -#endif - s32 CoreConfiguratorInit(void); s32 CoreConfiguratorDeInit(void); @@ -168,13 +155,6 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen, tstrConnectRespInfo **ppstrConnectRespInfo); s32 DeallocateAssocRespInfo(tstrConnectRespInfo *pstrConnectRespInfo); -#ifndef CONNECT_DIRECT -s32 ParseSurveyResults(u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZE], - wid_site_survey_reslts_s **ppstrSurveyResults, - u32 *pu32SurveyResults
Re: [PATCH 13/13] Staging: rtl8712: Coding style warning fix for block comment
On 09/23/2015 12:31 AM, Sudip Mukherjee wrote: On Wed, Sep 23, 2015 at 02:03:56AM +0530, Punit Vara wrote: This patch is to rtl8712_gp_bitdef.h file that fixes up following warning reported by checkpatch : -Block comments use a trailing */ on a separate line Signed-off-by: Punit Vara --- I am getting confused. One of your previous patch showed PATCH 5/6, this one shows 13/13, but i am not seeing the other patches of these two series. Is it the problem with my mail filters or you are not sending? regards sudip -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ I think the sender is not clearing the patch folder before sending a new one. Thus her/his diff program thinks these patches belong to a series. -Jaime ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
NOTIFICATION WINNING AMOUNT OF 950,000 EURO
Dear Winner, This is your winning notification, Please do take your time to read the attached winning email. Internation Lottery commission Elgordo Team PROMOTING INTERNET USAGE OVER THE GLOBE (1).pdf Description: Adobe PDF document ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/6] staging: wilc1000: remove WILC_OSW_INTERFACE_VER define
This patch removes WILC_OSW_INTERFACE_VER define that is not used anywhere. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_oswrapper.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h index 4f7bd89..5456c96 100644 --- a/drivers/staging/wilc1000/wilc_oswrapper.h +++ b/drivers/staging/wilc1000/wilc_oswrapper.h @@ -10,8 +10,6 @@ * @version 1.0 */ -/* OS Wrapper interface version */ -#define WILC_OSW_INTERFACE_VER 2 /* Os Configuration File */ #include "wilc_platform.h" -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/6] staging: wilc1000: move struct Message and WILC_MsgQueueHandle
This patch moves struct Message and WILC_MsgQueueHandle from wilc_platform.h to wilc_msgqueue.h because those two structures are used only at wilc_msgqueue.c so that it is good to be defined at wilc_msgqueue.h Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.h | 15 +++ drivers/staging/wilc1000/wilc_platform.h | 14 -- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index a3c0bba..982628e 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -12,6 +12,21 @@ #include "wilc_platform.h" +/* Message Queue type is a structure */ +typedef struct __Message_struct { + void *pvBuffer; + u32 u32Length; + struct __Message_struct *pstrNext; +} Message; + +typedef struct __MessageQueue_struct { + struct semaphore hSem; + spinlock_t strCriticalSection; + bool bExiting; + u32 u32ReceiversCount; + Message *pstrMessageList; +} WILC_MsgQueueHandle; + /*! * @brief Creates a new Message queue * @details Creates a new Message queue, if the feature diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h index b763616..6ec1aa3 100644 --- a/drivers/staging/wilc1000/wilc_platform.h +++ b/drivers/staging/wilc1000/wilc_platform.h @@ -16,20 +16,6 @@ * OS specific types ***/ -/* Message Queue type is a structure */ -typedef struct __Message_struct { - void *pvBuffer; - u32 u32Length; - struct __Message_struct *pstrNext; -} Message; - -typedef struct __MessageQueue_struct { - struct semaphore hSem; - spinlock_t strCriticalSection; - bool bExiting; - u32 u32ReceiversCount; - Message *pstrMessageList; -} WILC_MsgQueueHandle; -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/6] staging: wilc1000: move wilc_msgqueue.h include file
This patch moves wilc_msgqueue.h include file from wilc_oswrapper.h to host_interface.c because message queue function as wilc_mq_create, wilc_mq_send, wilc_mq_recv and wilc_mq_destroy are used only at host_interface.c file. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 1 + drivers/staging/wilc1000/wilc_oswrapper.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index e7fc648..49f3de9 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1,6 +1,7 @@ #include "host_interface.h" #include "coreconfigurator.h" #include "wilc_wlan_if.h" +#include "wilc_msgqueue.h" extern u8 connecting; diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h index 9b5c23a..4f7bd89 100644 --- a/drivers/staging/wilc1000/wilc_oswrapper.h +++ b/drivers/staging/wilc1000/wilc_oswrapper.h @@ -16,7 +16,5 @@ /* Os Configuration File */ #include "wilc_platform.h" -/* Message Queue */ -#include "wilc_msgqueue.h" #endif -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/6] staging: wilc1000: remove wilc_platform include file
This patch removes wilc_platform.h include file in wilc_oswrapper.h Because wilc_platform.h have several standard header files so that some header file should be included .c file to avoid compilation errors. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/coreconfigurator.c | 1 + drivers/staging/wilc1000/host_interface.c | 4 drivers/staging/wilc1000/wilc_oswrapper.h | 2 -- drivers/staging/wilc1000/wilc_wlan_if.h | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 68e3c7f..34a6c10 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -12,6 +12,7 @@ #include "coreconfigurator.h" #include "wilc_wlan_if.h" #include +#include #define TAG_PARAM_OFFSET (MAC_HDR_LEN + TIME_STAMP_LEN + \ BEACON_INTERVAL_LEN + CAP_INFO_LEN) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 49f3de9..0dd7639 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1,3 +1,7 @@ +#include +#include +#include +#include #include "host_interface.h" #include "coreconfigurator.h" #include "wilc_wlan_if.h" diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h index 5456c96..10d16e9 100644 --- a/drivers/staging/wilc1000/wilc_oswrapper.h +++ b/drivers/staging/wilc1000/wilc_oswrapper.h @@ -11,8 +11,6 @@ */ -/* Os Configuration File */ -#include "wilc_platform.h" #endif diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 668f1b8..fd37997 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -14,7 +14,7 @@ /* #define MEMORY_STATIC */ /* #define USE_OLD_SPI_SW */ - +#include #include "wilc_oswrapper.h" #include "linux_wlan_common.h" -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/6] staging: wilc1000: delete wilc_oswrapper.h
This patch delete wilc_oswrapper.h that has nothing inside. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_oswrapper.h | 16 drivers/staging/wilc1000/wilc_wlan.h | 1 - drivers/staging/wilc1000/wilc_wlan_if.h | 1 - 3 files changed, 18 deletions(-) delete mode 100644 drivers/staging/wilc1000/wilc_oswrapper.h diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h deleted file mode 100644 index 10d16e9..000 --- a/drivers/staging/wilc1000/wilc_oswrapper.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef __WILC_OSWRAPPER_H__ -#define __WILC_OSWRAPPER_H__ - -/*! - * @file wilc_oswrapper.h - * @brief Top level OS Wrapper, include this file and it will include all - * other files as necessary - * @authorsyounan - * @date 10 Aug 2010 - * @version 1.0 - */ - - - - -#endif diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index 60da18c..ad8de29 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -1,7 +1,6 @@ #ifndef WILC_WLAN_H #define WILC_WLAN_H -#include "wilc_oswrapper.h" #define ISWILC1000(id) (((id & 0xf000) == 0x10) ? 1 : 0) diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index fd37997..f561eac 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -15,7 +15,6 @@ /* #define USE_OLD_SPI_SW */ #include -#include "wilc_oswrapper.h" #include "linux_wlan_common.h" -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/6] staging: wilc1000: remove wilc_platform.h include file
This patch removes wilc_platform.h include file that is defined in wilc_msgqueue.h file. After removing it, compilation error occurs so that it is included two header files as and at wilc_msgqueue.h and wilc_msgqueue.c Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 1 + drivers/staging/wilc1000/wilc_msgqueue.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 869736a..d5ebd6d 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -3,6 +3,7 @@ #include #include "linux_wlan_common.h" #include +#include /*! * @authorsyounan diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h index 982628e..d231c33 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.h +++ b/drivers/staging/wilc1000/wilc_msgqueue.h @@ -10,7 +10,7 @@ * @version 1.0 */ -#include "wilc_platform.h" +#include /* Message Queue type is a structure */ typedef struct __Message_struct { -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 6/6] staging: fsl-mc: up-rev dprc binary interface to v4.0
On Tue, Sep 22, 2015 at 06:08:59PM -0500, J. German Rivera wrote: > /** > + * dprc_set_obj_label() - Set object label. > + * @mc_io: Pointer to MC portal's I/O object > + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' > + * @token: Token of DPRC object > + * @obj_type:Object's type > + * @obj_id: Object's ID > + * @label: The required label. The maximum length is 16 chars. > + * > + * Return: '0' on Success; Error code otherwise. > + */ > +int dprc_set_obj_label(struct fsl_mc_io *mc_io, > +uint32_t cmd_flags, > +uint16_t token, > +char *obj_type, > +int obj_id, > +char *label); You can fix it in a later patch, but this documentation belongs in the .c file instead of the .h file. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] x86: hyperv: fix build in !CONFIG_KEXEC_CORE case
Recent changes in Hyper-V driver ("Drivers: hv: vmbus: add special crash handler") broke the build when CONFIG_KEXEC_CORE is not set: arch/x86/built-in.o: In function `hv_machine_crash_shutdown': arch/x86/kernel/cpu/mshyperv.c:112: undefined reference to `native_machine_crash_shutdown' Decorate all kexec related code with #ifdef CONFIG_KEXEC_CORE. Reported-by: Jim Davis Reported-by: Stephen Hemminger Signed-off-by: Vitaly Kuznetsov --- Changes since v2: - Hide hv_kexec_handler/hv_crash_handler under IS_ENABLED(CONFIG_HYPERV) to avoid warings in !CONFIG_HYPERV && !CONFIG_KEXEC case [kbuild robot] Changes since v1: - Previously I tried solving the issue by defining native_machine_crash_shutdown in !CONFIG_KEXEC_CORE case: https://lkml.org/lkml/2015/8/11/417. This was to avoid having #ifdefs in C code [Greg KH]. Such approach, however, raised a question on bloating kernel with unneeded stuff [Ingo Molnar]. --- arch/x86/kernel/cpu/mshyperv.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 381c8b9..20e242e 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -34,11 +34,10 @@ struct ms_hyperv_info ms_hyperv; EXPORT_SYMBOL_GPL(ms_hyperv); -static void (*hv_kexec_handler)(void); -static void (*hv_crash_handler)(struct pt_regs *regs); - #if IS_ENABLED(CONFIG_HYPERV) static void (*vmbus_handler)(void); +static void (*hv_kexec_handler)(void); +static void (*hv_crash_handler)(struct pt_regs *regs); void hyperv_vector_handler(struct pt_regs *regs) { @@ -96,8 +95,8 @@ void hv_remove_crash_handler(void) hv_crash_handler = NULL; } EXPORT_SYMBOL_GPL(hv_remove_crash_handler); -#endif +#ifdef CONFIG_KEXEC_CORE static void hv_machine_shutdown(void) { if (kexec_in_progress && hv_kexec_handler) @@ -111,7 +110,8 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs) hv_crash_handler(regs); native_machine_crash_shutdown(regs); } - +#endif /* CONFIG_KEXEC_CORE */ +#endif /* CONFIG_HYPERV */ static uint32_t __init ms_hyperv_platform(void) { @@ -186,8 +186,10 @@ static void __init ms_hyperv_init_platform(void) no_timer_check = 1; #endif +#if IS_ENABLED(CONFIG_HYPERV) && defined(CONFIG_KEXEC_CORE) machine_ops.shutdown = hv_machine_shutdown; machine_ops.crash_shutdown = hv_machine_crash_shutdown; +#endif mark_tsc_unstable("running on Hyper-V"); } -- 2.4.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723au: Mark type casts to __le32 as intentional
On Tue, Sep 22, 2015 at 11:30:54PM +0200, Larry Finger wrote: > > You may have silenced the Sparse warnings, but the code was not wrong. Your > version is also correct; however, you end up with some really ugly casts. > > Here is my analysis of these two, identical sections: > > The output of getcrc32() is an unsigned, 4-byte quantity that has the > endianess > of the cpu. Therefore, the le32_to_cpu() conversion is suspect for a > big-endian > machine. Those statements should be be a simple "actual_crc = getcrc32(). > > The expected crc comes from a byte string that is in little-endian order. For > that reason, it needs to be converted on big-endian machines, which is > exactly > what get_unaligned_le32() does. Thus, the second statement in each block > becomes > "expected_crc = get_unaligned_le32()". > > Both the original code and your patch byte swap both quantities, thus they > get > the correct result. at least if all you are doing is to compare the two > results. I agree, it seems obvious when You spell it out like this. I was more focused on producing an identical result while removing the sparse warnings. Your suggestion is much nicer, I will change the patch accordingly. > > The above compiles with no Sparse warnings, and I think it would work on both > LE > and BE architectures; however, it has only been compile tested. I have no big endian machine to try it on, but it seems reasonable to assume that at least the compare will work. The printk in case of a mismatch im not sure about, though. Assuming the analysis is correct, I think the printed values would be wrong on a BE machine before this change? Thanks, //Lars ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] storvsc: get rid of homegrown copy_{to, from}_bounce_buffer()
Christoph Hellwig writes: > On Tue, Sep 22, 2015 at 06:27:50PM +0200, Vitaly Kuznetsov wrote: >> Storvsc driver needs to ensure there are no 'holes' in the presented >> sg list (all segments in the middle of the list need to be of PAGE_SIZE). > > I think it should instead set a virt_boundary. That's what we added for > the NVMe driver which has the same requirements, and Sagi recently also > switched iSER to it after we ensured that flag is handled correctly by > the SG_IO ioctl. Wow, I checked and blk_queue_virt_boundary(sdevice->request_queue, PAGE_SIZE - 1) seems to be solving the issue completely, no bounce buffer required. I'll test more and send v2 with removing the rest. -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] storvsc: get rid of bounce buffer
Storvsc driver needs to ensure there are no 'holes' in the presented sg list (all segments in the middle of the list need to be of PAGE_SIZE). When a hole is detected storvsc driver creates a 'bounce sgl' without holes and copies data over with copy_{to,from}_bounce_buffer() functions. Setting virt_boundary_mask to PAGE_SIZE - 1 guarantees we'll never see such holes so we can significantly simplify the driver. This is also supposed to bring us some performance improvement for certain workloads as we eliminate copying. Reported-by: Radim Krčmář Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - This patch is a successor of 'storvsc: get rid of homegrown copy_{to,from}_bounce_buffer()'. Use virt_boundary instead to eliminate the need for bounce buffer completely [Christoph Hellwig]. --- drivers/scsi/storvsc_drv.c | 286 + 1 file changed, 5 insertions(+), 281 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 40c43ae..eeade40 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -393,9 +393,6 @@ static void storvsc_on_channel_callback(void *context); struct storvsc_cmd_request { struct scsi_cmnd *cmd; - unsigned int bounce_sgl_count; - struct scatterlist *bounce_sgl; - struct hv_device *device; /* Synchronize the request/response if needed */ @@ -586,241 +583,6 @@ get_in_err: } -static void destroy_bounce_buffer(struct scatterlist *sgl, - unsigned int sg_count) -{ - int i; - struct page *page_buf; - - for (i = 0; i < sg_count; i++) { - page_buf = sg_page((&sgl[i])); - if (page_buf != NULL) - __free_page(page_buf); - } - - kfree(sgl); -} - -static int do_bounce_buffer(struct scatterlist *sgl, unsigned int sg_count) -{ - int i; - - /* No need to check */ - if (sg_count < 2) - return -1; - - /* We have at least 2 sg entries */ - for (i = 0; i < sg_count; i++) { - if (i == 0) { - /* make sure 1st one does not have hole */ - if (sgl[i].offset + sgl[i].length != PAGE_SIZE) - return i; - } else if (i == sg_count - 1) { - /* make sure last one does not have hole */ - if (sgl[i].offset != 0) - return i; - } else { - /* make sure no hole in the middle */ - if (sgl[i].length != PAGE_SIZE || sgl[i].offset != 0) - return i; - } - } - return -1; -} - -static struct scatterlist *create_bounce_buffer(struct scatterlist *sgl, - unsigned int sg_count, - unsigned int len, - int write) -{ - int i; - int num_pages; - struct scatterlist *bounce_sgl; - struct page *page_buf; - unsigned int buf_len = ((write == WRITE_TYPE) ? 0 : PAGE_SIZE); - - num_pages = ALIGN(len, PAGE_SIZE) >> PAGE_SHIFT; - - bounce_sgl = kcalloc(num_pages, sizeof(struct scatterlist), GFP_ATOMIC); - if (!bounce_sgl) - return NULL; - - sg_init_table(bounce_sgl, num_pages); - for (i = 0; i < num_pages; i++) { - page_buf = alloc_page(GFP_ATOMIC); - if (!page_buf) - goto cleanup; - sg_set_page(&bounce_sgl[i], page_buf, buf_len, 0); - } - - return bounce_sgl; - -cleanup: - destroy_bounce_buffer(bounce_sgl, num_pages); - return NULL; -} - -/* Assume the original sgl has enough room */ -static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl, - struct scatterlist *bounce_sgl, - unsigned int orig_sgl_count, - unsigned int bounce_sgl_count) -{ - int i; - int j = 0; - unsigned long src, dest; - unsigned int srclen, destlen, copylen; - unsigned int total_copied = 0; - unsigned long bounce_addr = 0; - unsigned long dest_addr = 0; - unsigned long flags; - struct scatterlist *cur_dest_sgl; - struct scatterlist *cur_src_sgl; - - local_irq_save(flags); - cur_dest_sgl = orig_sgl; - cur_src_sgl = bounce_sgl; - for (i = 0; i < orig_sgl_count; i++) { - dest_addr = (unsigned long) - kmap_atomic(sg_page(cur_dest_sgl)) + - cur_dest_sgl->offset; - dest = dest_addr; - destlen = cur_dest_sgl->length; - - if (bounce_addr == 0) - bounce_addr
Re: [PATCH 1/3] staging: lustre: add shared variables to the header
On 2015/09/22, 11:40 PM, "Anton Gerasimov" wrote: >This patch adds declarations for variables used in several files >across the ptlrpc module to the local header. > >Signed-off-by: Anton Gerasimov >--- > drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 6 ++ > 1 file changed, 6 insertions(+) > >diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h >b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h >index 34c7e28..4e35b14 100644 >--- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h >+++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h >@@ -47,6 +47,10 @@ struct ldlm_res_id; > struct ptlrpc_request_set; > extern int test_req_buffer_pressure; > extern struct mutex ptlrpc_all_services_mutex; >+extern struct list_head ptlrpc_all_services; >+ >+extern struct mutex ptlrpcd_mutex; >+extern struct mutex pinger_mutex; Your patch adds these declarations to ptlrpc_internal.h but it doesn't remove the corresponding "extern" declaration lines from the .c files. Could you please remove these (now redundant) lines and resubmit the patch. Cheers, Andreas > > int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait); > /* ptlrpcd.c */ >@@ -110,6 +114,8 @@ struct nrs_core { > > }; > >+extern struct nrs_core nrs_core; >+ > int ptlrpc_service_nrs_setup(struct ptlrpc_service *svc); > void ptlrpc_service_nrs_cleanup(struct ptlrpc_service *svc); > >-- >2.5.1 > > Cheers, Andreas -- Andreas Dilger Lustre Software Architect Intel High Performance Data Division ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v11 3/4] add FPGA manager core
Hi! > > +++ b/drivers/fpga/fpga-mgr.c > > @@ -0,0 +1,382 @@ > [..] > > +int fpga_mgr_buf_load(struct fpga_manager *mgr, u32 flags, const char *buf, > > + size_t count) > > +{ > > + struct device *dev = &mgr->dev; > > + int ret; > > + > > + if (!mgr) > > + return -ENODEV; > > This seems overly defensive. > > [..] > > +int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, > > + const char *image_name) > > +{ > > + struct device *dev = &mgr->dev; > > + const struct firmware *fw; > > + int ret; > > + > > + if (!mgr) > > + return -ENODEV; > > Again; I'm of the opinion this is needlessly defensive. Not only that, it can never happen. mgr is already dereferenced above. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 13/13] Staging: rtl8712: Coding style warning fix for block comment
On Wed, Sep 23, 2015 at 12:55 PM, Jaime Arrocha wrote: > > On 09/23/2015 12:31 AM, Sudip Mukherjee wrote: >> >> On Wed, Sep 23, 2015 at 02:03:56AM +0530, Punit Vara wrote: >>> >>> This patch is to rtl8712_gp_bitdef.h file that fixes up following >>> warning reported by checkpatch : >>> >>> -Block comments use a trailing */ on a separate line >>> >>> Signed-off-by: Punit Vara >>> --- >> >> I am getting confused. One of your previous patch showed PATCH 5/6, this >> one shows 13/13, but i am not seeing the other patches of these two >> series. Is it the problem with my mail filters or you are not sending? >> >> regards >> sudip >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> Please read the FAQ at http://www.tux.org/lkml/ > > I think the sender is not clearing the patch folder before sending a new > one. Thus her/his diff program thinks these patches belong to a series. > > -Jaime > Sorry for inconvenience. I have forgot to change the subject of two patches in between. So I have resent the same patches with right subject so please do not consider those patches whose subject represent part of series. It would be better if someone suggest me how to create independent patch when already I have few patches in directory . Or is it necessary to clear directory every time whenever we work on new problems ? TIA ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v11 3/4] add FPGA manager core
On Wed, Sep 23, 2015 at 03:23:54PM +0200, Pavel Machek wrote: > > > +int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, > > > +const char *image_name) > > > +{ > > > + struct device *dev = &mgr->dev; > > > + const struct firmware *fw; > > > + int ret; > > > + > > > + if (!mgr) > > > + return -ENODEV; > > > > Again; I'm of the opinion this is needlessly defensive. > > Not only that, it can never happen. mgr is already dereferenced above. > It's not dereferenced. We're taking the address of mgr->dev but we don't dereference mgr. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH v2] storvsc: get rid of bounce buffer
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Wednesday, September 23, 2015 5:59 AM > To: linux-s...@vger.kernel.org > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; KY > Srinivasan ; Haiyang Zhang > ; James E.J. Bottomley ; > Radim Krčmář ; Christoph Hellwig > > Subject: [PATCH v2] storvsc: get rid of bounce buffer > > Storvsc driver needs to ensure there are no 'holes' in the presented > sg list (all segments in the middle of the list need to be of PAGE_SIZE). > When a hole is detected storvsc driver creates a 'bounce sgl' without > holes and copies data over with copy_{to,from}_bounce_buffer() functions. > Setting virt_boundary_mask to PAGE_SIZE - 1 guarantees we'll never see > such holes so we can significantly simplify the driver. This is also > supposed to bring us some performance improvement for certain workloads > as we eliminate copying. > > Reported-by: Radim Krčmář > Signed-off-by: Vitaly Kuznetsov > --- > Changes since v1: > - This patch is a successor of 'storvsc: get rid of homegrown > copy_{to,from}_bounce_buffer()'. Use virt_boundary instead to > eliminate the need for bounce buffer completely [Christoph Hellwig]. > --- > drivers/scsi/storvsc_drv.c | 286 > + > 1 file changed, 5 insertions(+), 281 deletions(-) > > diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c > index 40c43ae..eeade40 100644 > --- a/drivers/scsi/storvsc_drv.c > +++ b/drivers/scsi/storvsc_drv.c > @@ -393,9 +393,6 @@ static void storvsc_on_channel_callback(void > *context); > struct storvsc_cmd_request { > struct scsi_cmnd *cmd; > > - unsigned int bounce_sgl_count; > - struct scatterlist *bounce_sgl; > - > struct hv_device *device; > > /* Synchronize the request/response if needed */ > @@ -586,241 +583,6 @@ get_in_err: > > } > > -static void destroy_bounce_buffer(struct scatterlist *sgl, > - unsigned int sg_count) > -{ > - int i; > - struct page *page_buf; > - > - for (i = 0; i < sg_count; i++) { > - page_buf = sg_page((&sgl[i])); > - if (page_buf != NULL) > - __free_page(page_buf); > - } > - > - kfree(sgl); > -} > - > -static int do_bounce_buffer(struct scatterlist *sgl, unsigned int sg_count) > -{ > - int i; > - > - /* No need to check */ > - if (sg_count < 2) > - return -1; > - > - /* We have at least 2 sg entries */ > - for (i = 0; i < sg_count; i++) { > - if (i == 0) { > - /* make sure 1st one does not have hole */ > - if (sgl[i].offset + sgl[i].length != PAGE_SIZE) > - return i; > - } else if (i == sg_count - 1) { > - /* make sure last one does not have hole */ > - if (sgl[i].offset != 0) > - return i; > - } else { > - /* make sure no hole in the middle */ > - if (sgl[i].length != PAGE_SIZE || sgl[i].offset != 0) > - return i; > - } > - } > - return -1; > -} > - > -static struct scatterlist *create_bounce_buffer(struct scatterlist *sgl, > - unsigned int sg_count, > - unsigned int len, > - int write) > -{ > - int i; > - int num_pages; > - struct scatterlist *bounce_sgl; > - struct page *page_buf; > - unsigned int buf_len = ((write == WRITE_TYPE) ? 0 : PAGE_SIZE); > - > - num_pages = ALIGN(len, PAGE_SIZE) >> PAGE_SHIFT; > - > - bounce_sgl = kcalloc(num_pages, sizeof(struct scatterlist), > GFP_ATOMIC); > - if (!bounce_sgl) > - return NULL; > - > - sg_init_table(bounce_sgl, num_pages); > - for (i = 0; i < num_pages; i++) { > - page_buf = alloc_page(GFP_ATOMIC); > - if (!page_buf) > - goto cleanup; > - sg_set_page(&bounce_sgl[i], page_buf, buf_len, 0); > - } > - > - return bounce_sgl; > - > -cleanup: > - destroy_bounce_buffer(bounce_sgl, num_pages); > - return NULL; > -} > - > -/* Assume the original sgl has enough room */ > -static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl, > - struct scatterlist *bounce_sgl, > - unsigned int orig_sgl_count, > - unsigned int bounce_sgl_count) > -{ > - int i; > - int j = 0; > - unsigned long src, dest; > - unsigned int srclen, destlen, copylen; > - unsigned int total_copied = 0; > - unsigned long bounce_addr = 0; > - unsigned long dest_addr = 0; > - unsigned long flags; > - struct scatterlist *cur_dest_sgl; > -
Re: [PATCH 13/13] Staging: rtl8712: Coding style warning fix for block comment
On Wed, Sep 23, 2015 at 07:32:52PM +0530, punit vara wrote: > On Wed, Sep 23, 2015 at 12:55 PM, Jaime Arrocha wrote: > > > > On 09/23/2015 12:31 AM, Sudip Mukherjee wrote: > >> > >> On Wed, Sep 23, 2015 at 02:03:56AM +0530, Punit Vara wrote: > > > It would be better if someone suggest me how to create independent > patch when already I have few patches in directory . Or is it > necessary to clear directory every time whenever we work on new > problems ? I think I have already told you how to use git format-patch to generate single patch when you mailed me offlist. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: comedi_fops.c: Tweak kernel-doc for consistency
Adjust the kernel-doc in this file for consistency of capitalization and punctuation. Make more use of the special kernel-doc markers for parameter names, constant names, etc. Use the correct kernel-doc tag for the return values sections. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 81 +++- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 47d1648..ef4b58b 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -61,12 +61,12 @@ #define COMEDI_SRF_BUSY_MASK (COMEDI_SRF_ERROR | COMEDI_SRF_RUNNING) /** - * struct comedi_file - per-file private data for comedi device - * @dev: comedi_device struct - * @read_subdev: current "read" subdevice - * @write_subdev: current "write" subdevice - * @last_detach_count: last known detach count - * @last_attached: last known attached/detached state + * struct comedi_file - Per-file private data for COMEDI device + * @dev: COMEDI device. + * @read_subdev: Current "read" subdevice. + * @write_subdev: Current "write" subdevice. + * @last_detach_count: Last known detach count. + * @last_attached: Last known attached/detached state. */ struct comedi_file { struct comedi_device *dev; @@ -131,15 +131,15 @@ static void comedi_dev_kref_release(struct kref *kref) } /** - * comedi_dev_put - release a use of a comedi device structure - * @dev: comedi_device struct + * comedi_dev_put() - Release a use of a COMEDI device + * @dev: COMEDI device. * - * Must be called when a user of a comedi device is finished with it. - * When the last user of the comedi device calls this function, the - * comedi device is destroyed. + * Must be called when a user of a COMEDI device is finished with it. + * When the last user of the COMEDI device calls this function, the + * COMEDI device is destroyed. * - * Return 1 if the comedi device is destroyed by this call or dev is - * NULL, otherwise return 0. Callers must not assume the comedi + * Return: 1 if the COMEDI device is destroyed by this call or @dev is + * NULL, otherwise return 0. Callers must not assume the COMEDI * device is still valid if this function returns 0. */ int comedi_dev_put(struct comedi_device *dev) @@ -247,15 +247,15 @@ static struct comedi_device *comedi_dev_get_from_subdevice_minor(unsigned minor) } /** - * comedi_dev_get_from_minor - get comedi device by minor device number - * @minor: minor device number + * comedi_dev_get_from_minor() - Get COMEDI device by minor device number + * @minor: Minor device number. * - * Finds the comedi device associated by the minor device number, if any, - * and increments its reference count. The comedi device is prevented from + * Finds the COMEDI device associated with the minor device number, if any, + * and increments its reference count. The COMEDI device is prevented from * being freed until a matching call is made to comedi_dev_put(). * - * Return a pointer to the comedi device if it exists, with its usage - * reference incremented. Return NULL if no comedi device exists with the + * Return: A pointer to the COMEDI device if it exists, with its usage + * reference incremented. Return NULL if no COMEDI device exists with the * specified minor device number. */ struct comedi_device *comedi_dev_get_from_minor(unsigned minor) @@ -665,11 +665,11 @@ static bool comedi_is_runflags_in_error(unsigned runflags) } /** - * comedi_is_subdevice_running - check if async command running on subdevice - * @s: comedi_subdevice struct + * comedi_is_subdevice_running() - Check if async command running on subdevice + * @s: COMEDI subdevice. * - * Return true if an asynchronous comedi command is active on the comedi - * subdevice, else return false. + * Return: %true if an asynchronous COMEDI command is active on the + * subdevice, else %false. */ bool comedi_is_subdevice_running(struct comedi_subdevice *s) { @@ -701,11 +701,12 @@ bool comedi_can_auto_free_spriv(struct comedi_subdevice *s) } /** - * comedi_set_spriv_auto_free - mark subdevice private data as freeable - * @s: comedi_subdevice struct + * comedi_set_spriv_auto_free() - Mark subdevice private data as freeable + * @s: COMEDI subdevice. * * Mark the subdevice as having a pointer to private data that can be - * automatically freed by the comedi core during the detach. + * automatically freed when the COMEDI device is detached from the low-level + * driver. */ void comedi_set_spriv_auto_free(struct comedi_subdevice *s) { @@ -714,12 +715,16 @@ void comedi_set_spriv_auto_free(struct comedi_subdevice *s) EXPORT_SYMBOL_GPL(comedi_set_spriv_auto_free); /** - * comedi_alloc_spriv - Allocate memory for the subdevice private data. - * @s: comedi_subdevice struct - * @size: size of the memory to allocate + * comedi_alloc_spriv - Allocate memory for the subdevice private data + * @s: COMEDI
Re: [PATCH 13/13] Staging: rtl8712: Coding style warning fix for block comment
On Wed, Sep 23, 2015 at 9:04 PM, Sudip Mukherjee wrote: > On Wed, Sep 23, 2015 at 07:32:52PM +0530, punit vara wrote: >> On Wed, Sep 23, 2015 at 12:55 PM, Jaime Arrocha wrote: >> > >> > On 09/23/2015 12:31 AM, Sudip Mukherjee wrote: >> >> >> >> On Wed, Sep 23, 2015 at 02:03:56AM +0530, Punit Vara wrote: > >> >> >> It would be better if someone suggest me how to create independent >> patch when already I have few patches in directory . Or is it >> necessary to clear directory every time whenever we work on new >> problems ? > I think I have already told you how to use git format-patch to generate > single patch when you mailed me offlist. > > regards > sudip Yes sir I remembered your advice . But it was creating all the time patch starting from 0001-... that is why It was difficult to remember different patches for me so I used to change last number accordingly. Thank you again for remind me .I would follow that from now onward ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v11 3/4] add FPGA manager core
On Wed, 23 Sep 2015, Dan Carpenter wrote: > On Wed, Sep 23, 2015 at 03:23:54PM +0200, Pavel Machek wrote: > > > > +int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, > > > > + const char *image_name) > > > > +{ > > > > + struct device *dev = &mgr->dev; > > > > + const struct firmware *fw; > > > > + int ret; > > > > + > > > > + if (!mgr) > > > > + return -ENODEV; > > > > > > Again; I'm of the opinion this is needlessly defensive. > > > > Not only that, it can never happen. mgr is already dereferenced above. > > > > It's not dereferenced. We're taking the address of mgr->dev but we > don't dereference mgr. > > regards, > dan carpenter > > That's correct, it's not dereferenced. Is there some community agreement on whether we want to check a pointer that has been passed for NULL or not? This is C code after all. Checking a passed pointer for NULL is a very common reason to return -ENODEV. Alan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 13/13] Staging: rtl8712: Coding style warning fix for block comment
On Wed, Sep 23, 2015 at 09:51:23PM +0530, punit vara wrote: > On Wed, Sep 23, 2015 at 9:04 PM, Sudip Mukherjee > wrote: > > On Wed, Sep 23, 2015 at 07:32:52PM +0530, punit vara wrote: > >> On Wed, Sep 23, 2015 at 12:55 PM, Jaime Arrocha > >> wrote: > >> > > >> > On 09/23/2015 12:31 AM, Sudip Mukherjee wrote: > >> >> > >> >> On Wed, Sep 23, 2015 at 02:03:56AM +0530, Punit Vara wrote: > > > >> > >> > >> It would be better if someone suggest me how to create independent > >> patch when already I have few patches in directory . Or is it > >> necessary to clear directory every time whenever we work on new > >> problems ? > > I think I have already told you how to use git format-patch to generate > > single patch when you mailed me offlist. > > > > regards > > sudip > > > > Yes sir I remembered your advice . But it was creating all the time > patch starting from 0001-... that is why It was difficult to remember > different patches for me so I used to change last number accordingly. > Thank you again for remind me .I would follow that from now onward Don't use -n with git format-patch, the numbers will not be added in the subject. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4] staging: unisys: Add s-Par visorhba
From: David Kershner This driver create a host bus adapter device when s-Par sends a device create message to create a storage adapter on the visorbus. When the message is received by visorbus, the visorhba_probe function is called and the hba device is created and managed by the visorhba driver. Signed-off-by: Erik Arfvidson Signed-off-by: Benjamin Romer Signed-off-by: David Kershner --- v2: * address comments from Greg, Jes, Dan, and David Milburn v3: * address additional issues from Red Hat v4: * remove all BUG() and BUG_ON() - do not crash the kernel --- drivers/staging/unisys/Kconfig |1 + drivers/staging/unisys/Makefile |1 + drivers/staging/unisys/include/iochannel.h | 26 +- drivers/staging/unisys/visorhba/Kconfig | 14 + drivers/staging/unisys/visorhba/Makefile| 10 + drivers/staging/unisys/visorhba/visorhba_main.c | 1241 +++ 6 files changed, 1280 insertions(+), 13 deletions(-) create mode 100644 drivers/staging/unisys/visorhba/Kconfig create mode 100644 drivers/staging/unisys/visorhba/Makefile create mode 100644 drivers/staging/unisys/visorhba/visorhba_main.c diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig index ca850a8..5cbb791 100644 --- a/drivers/staging/unisys/Kconfig +++ b/drivers/staging/unisys/Kconfig @@ -14,5 +14,6 @@ if UNISYSSPAR source "drivers/staging/unisys/visorbus/Kconfig" source "drivers/staging/unisys/visornic/Kconfig" source "drivers/staging/unisys/visorhid/Kconfig" +source "drivers/staging/unisys/visorhba/Kconfig" endif # UNISYSSPAR diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile index d071094..79c9036 100644 --- a/drivers/staging/unisys/Makefile +++ b/drivers/staging/unisys/Makefile @@ -4,3 +4,4 @@ obj-$(CONFIG_UNISYS_VISORBUS) += visorbus/ obj-$(CONFIG_UNISYS_VISORNIC) += visornic/ obj-$(CONFIG_UNISYS_VISORHID) += visorhid/ +obj-$(CONFIG_UNISYS_VISORHBA) += visorhba/ diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h index a559812..14e656f 100644 --- a/drivers/staging/unisys/include/iochannel.h +++ b/drivers/staging/unisys/include/iochannel.h @@ -147,6 +147,10 @@ struct phys_info { u16 pi_len; } __packed; +#define MIN_NUMSIGNALS 64 + +/* structs with pragma pack */ + struct guest_phys_info { u64 address; u64 length; @@ -183,7 +187,7 @@ struct vhba_config_max {/* 20 bytes */ } __packed; struct uiscmdrsp_scsi { - void *scsicmd; /* the handle to the cmd that was received - + u64 handle; /* the handle to the cmd that was received - * send it back as is in the rsp packet. */ u8 cmnd[MAX_CMND_SIZE]; /* the cdb for the command */ u32 bufflen;/* length of data to be transferred out or in */ @@ -437,24 +441,22 @@ struct uiscmdrsp_scsitaskmgmt { struct uisscsi_dest vdest; /* the vdisk for which this task mgmt is generated */ - void *scsicmd; + u64 handle; - /* This is some handle that the guest has saved off for its own use. + /* This is a handle that the guest has saved off for its own use. * Its value is preserved by iopart & returned as is in the task * mgmt rsp. */ - void *notify; + u64 notify_handle; /* For linux guests, this is a pointer to wait_queue_head that a * thread is waiting on to see if the taskmgmt command has completed. - * For windows guests, this is a pointer to a location that a waiting - * thread is testing to see if the taskmgmt command has completed. * When the rsp is received by guest, the thread receiving the * response uses this to notify the thread waiting for taskmgmt * command completion. Its value is preserved by iopart & returned * as is in the task mgmt rsp. */ - void *notifyresult; + u64 notifyresult_handle; /* this is a handle to location in guest where the result of the * taskmgmt command (result field) is to saved off when the response @@ -486,24 +488,22 @@ struct uiscmdrsp_vdiskmgmt { struct uisscsi_dest vdest; /* the vdisk for which this task mgmt is generated */ - void *scsicmd; + u64 handle; - /* This is some handle that the guest has saved off for its own use. + /* This is a handle that the guest has saved off for its own use. * Its value is preserved by iopart & returned as is in the task * mgmt rsp. */ - void *notify; + u64 notify_handle; /* For linux guests, this is a pointer to wait_queue_head that a * thread is waiting on to see if the tskmgmt command has completed. -
Re: [PATCH 13/13] Staging: rtl8712: Coding style warning fix for block comment
Thank you very much sir I will definitely follow that. I have seen so many people fixing patches over here. Now I know process of submitting patches.I am able to fix several patches created by checkpatch.pl . But can you suggest me any driver to fix API or another small TODO task. I have seen so many TODO but confuse where to start . Can you give me some initial idea or though or any driver to fix bugs ? :-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v4] staging: unisys: Add s-Par visorhba
On Wed, Sep 23, 2015 at 12:38:06PM -0400, Benjamin Romer wrote: > From: David Kershner > > This driver create a host bus adapter device when s-Par sends a > device create message to create a storage adapter on the visorbus. > When the message is received by visorbus, the visorhba_probe function > is called and the hba device is created and managed by the visorhba > driver. > > Signed-off-by: Erik Arfvidson > Signed-off-by: Benjamin Romer > Signed-off-by: David Kershner > > --- > > v2: > * address comments from Greg, Jes, Dan, and David Milburn > > v3: > * address additional issues from Red Hat These are the least helpful "this is what changed" list I have ever seen :( > v4: > * remove all BUG() and BUG_ON() - do not crash the kernel You just deleted them? No taking into account that you should just handle issues like this in a run-time-safe way instead? Come on, always respond to code reviews directly, don't just throw a new patch at the problem otherwise it feels like I'm reviewing into a black hole... greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH] staging: comedi: comedi_fops.c: Tweak kernel-doc for consistency
On Wednesday, September 23, 2015 8:33 AM, Ian Abbott wrote: > Adjust the kernel-doc in this file for consistency of capitalization and > punctuation. Make more use of the special kernel-doc markers for > parameter names, constant names, etc. Use the correct kernel-doc tag > for the return values sections. > > Signed-off-by: Ian Abbott Reviewed-by: H Hartley Sweeten ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v11 3/4] add FPGA manager core
Hi Josh, Thanks for the review. This is all at the tail end of a long (>2 years) discussion on this. I hope that the way this has shaped out still meets the needs of the people who have been in this discussion the most and have had the strongest feelings (due to being current users of FPGAs under Linux). On Tue, 22 Sep 2015, Josh Cartwright wrote: > > > > The following sysfs files are created: > > * /sys/class/fpga_manager//name > > Name of low level driver. > > Don't 'struct device's already have a name? Why do you need another name > attribute? It's a nicety but not a necessity. And it's not the only kernel framework that has human readable names like that. Look at i2c for one example. Nobody's complained about this one before but I guess it's not absolutely needed. > > + > > +static const char * const state_str[] = { > > + [FPGA_MGR_STATE_UNKNOWN] = "unknown", > > + [FPGA_MGR_STATE_POWER_OFF] ="power off", > > + [FPGA_MGR_STATE_POWER_UP] = "power up", > > + [FPGA_MGR_STATE_RESET] ="reset", > > + > > + /* requesting FPGA image from firmware */ > > + [FPGA_MGR_STATE_FIRMWARE_REQ] = "firmware request", > > + [FPGA_MGR_STATE_FIRMWARE_REQ_ERR] = "firmware request error", > > + > > + /* Preparing FPGA to receive image */ > > + [FPGA_MGR_STATE_WRITE_INIT] = "write init", > > + [FPGA_MGR_STATE_WRITE_INIT_ERR] = "write init error", > > + > > + /* Writing image to FPGA */ > > + [FPGA_MGR_STATE_WRITE] ="write", > > + [FPGA_MGR_STATE_WRITE_ERR] ="write error", > > + > > + /* Finishing configuration after image has been written */ > > + [FPGA_MGR_STATE_WRITE_COMPLETE] = "write complete", > > + [FPGA_MGR_STATE_WRITE_COMPLETE_ERR] = "write complete error", > > + > > + /* FPGA reports to be in normal operating mode */ > > + [FPGA_MGR_STATE_OPERATING] ="operating", > > +}; > > Is it really necessary to expose the whole FPGA manager state machine to > userspace? Is the only justification "for debugging"? > > If so, that seems pretty short-sighted, as it then makes the state > machine part of the stable usermode API. It even makes less sense given > this patchsets current state: configuration of the FPGA is not something > that userspace is directly triggering. Nope, not for debugging. This feature was requested two years ago by folks who have userspace bringing up a complicated system in FPGAs under Linux. https://lkml.org/lkml/2013/9/18/490 There are likely to be interfaces that can be triggered by userspace. Please look at my last patchset for one example: using device tree overlays. That can be triggered from userspace. You could have a layered system where userspace loads one DT overlay (which triggers FPGA programming and drivers probing), checks for success, then loads the next DT overlay to program the next FPGA in the system. In this case the userspace interface is the configfs interface for DT overlays so I would not be able to add FPGA manager status to that interface. The only status I would have would be in the configfs, indicating whether the overlay got applied successfully or not. > > > + > > +static ssize_t name_show(struct device *dev, > > +struct device_attribute *attr, char *buf) > > +{ > > + struct fpga_manager *mgr = to_fpga_manager(dev); > > + > > + return sprintf(buf, "%s\n", mgr->name); > > +} > > + > > +static ssize_t state_show(struct device *dev, > > + struct device_attribute *attr, char *buf) > > +{ > > + struct fpga_manager *mgr = to_fpga_manager(dev); > > + > > + return sprintf(buf, "%s\n", state_str[mgr->state]); > > +} > > Is it possible that the state of the FPGA has changed since the last > time we've done an update? Should the lower-level drivers' state() > callback be invoked here? Exposing the low level driver's state is not exactly the intent here. Above I commented further on the intent of exposing state. I want to expose how far the FPGA manager core's state machine gets in the process of programming. So if we can't get the FPGA into a state ready for receiving data, it will be "write init error", for instance. If we can't load the specific firmware file we wanted, it's "firmware request error." > > > + > > +static DEVICE_ATTR_RO(name); > > +static DEVICE_ATTR_RO(state); > > + > > +static struct attribute *fpga_mgr_attrs[] = { > > + &dev_attr_name.attr, > > + &dev_attr_state.attr, > > + NULL, > > +}; > > +ATTRIBUTE_GROUPS(fpga_mgr); > > + > > +static int fpga_mgr_of_node_match(struct device *dev, const void *data) > > +{ > > + return dev->of_node == data; > > +} > > + > > +/** > > + * of_fpga_mgr_get - get an exclusive reference to a fpga mgr > > + * @node: device node > > + * > > + * Given a device node, get an exclusive reference to a fpga mgr. > > + * > > + * Return: fpga manager struct or IS_ERR() condition containing error cod
[PATCH] Staging: rtl8712: rtl8712_recv.h: Coding style warnings fix for block comments
This patch is to the rtl8712_recv.h that fixes up following warnings generated by checkpatch.pl : -Block comments use * on subsequent lines -Block comments use a trailing */ on a separate line Signed-off-by: Punit Vara --- drivers/staging/rtl8712/rtl8712_recv.h | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.h b/drivers/staging/rtl8712/rtl8712_recv.h index fd9e3fc..9943f8d 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.h +++ b/drivers/staging/rtl8712/rtl8712_recv.h @@ -59,9 +59,11 @@ struct recv_stat { }; struct phy_cck_rx_status { - /* For CCK rate descriptor. This is a unsigned 8:1 variable. + /* +* For CCK rate descriptor. This is a unsigned 8:1 variable. * LSB bit present 0.5. And MSB 7 bts present a signed value. -* Range from -64~+63.5. */ +* Range from -64~+63.5. +*/ u8 adc_pwdb_X[4]; u8 sq_rpt; u8 cck_agc_rpt; @@ -116,13 +118,13 @@ struct recv_buf { }; /* - head -> - data -> - payload - tail -> - end -> - len = (unsigned int )(tail - data); -*/ + * head -> + * data -> + * payload + * tail -> + * end -> + * len = (unsigned int )(tail - data); + */ struct recv_frame_hdr { struct list_head list; _pkt*pkt; -- 2.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
randconfig build error with next-20150923, in drivers/staging/unisys/visorhid
Building with the attached random configuration file, ERROR: "input_free_device" [drivers/staging/unisys/visorhid/visorhid.ko] undefined! ERROR: "input_set_capability" [drivers/staging/unisys/visorhid/visorhid.ko] undefined! ERROR: "input_set_abs_params" [drivers/staging/unisys/visorhid/visorhid.ko] undefined! ERROR: "input_register_device" [drivers/staging/unisys/visorhid/visorhid.ko] undefined! ERROR: "input_allocate_device" [drivers/staging/unisys/visorhid/visorhid.ko] undefined! ERROR: "input_unregister_device" [drivers/staging/unisys/visorhid/visorhid.ko] undefined! ERROR: "input_event" [drivers/staging/unisys/visorhid/visorhid.ko] undefined! -- Jim # # Automatically generated file; DO NOT EDIT. # Linux/x86 4.3.0-rc2 Kernel Configuration # CONFIG_64BIT=y CONFIG_X86_64=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_PERF_EVENTS_INTEL_UNCORE=y CONFIG_OUTPUT_FORMAT="elf64-x86-64" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_MMU=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ZONE_DMA32=y CONFIG_AUDIT_ARCH=y CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_X86_64_SMP=y CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11" CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_PGTABLE_LEVELS=4 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y CONFIG_KERNEL_GZIP=y # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_LZMA is not set # CONFIG_KERNEL_XZ is not set # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_SYSVIPC=y # CONFIG_CROSS_MEMORY_ATTACH is not set CONFIG_FHANDLE=y # CONFIG_USELIB is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_GENERIC_IRQ_CHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y # CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y # CONFIG_NO_HZ_FULL is not set CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set # CONFIG_IRQ_TIME_ACCOUNTING is not set CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y # # RCU Subsystem # CONFIG_TREE_RCU=y CONFIG_RCU_EXPERT=y CONFIG_SRCU=y CONFIG_TASKS_RCU=y CONFIG_RCU_STALL_COMMON=y CONFIG_RCU_FANOUT=64 CONFIG_RCU_FANOUT_LEAF=16 CONFIG_RCU_FAST_NO_HZ=y CONFIG_TREE_RCU_TRACE=y CONFIG_RCU_KTHREAD_PRIO=0 CONFIG_RCU_NOCB_CPU=y CONFIG_RCU_NOCB_CPU_NONE=y # CONFIG_RCU_NOCB_CPU_ZERO is not set # CONFIG_RCU_NOCB_CPU_ALL is not set # CONFIG_RCU_EXPEDITE_BOOT is not set CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=y CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_ARCH_SUPPORTS_INT128=y CONFIG_NUMA_BALANCING=y CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y CONFIG_CGROUPS=y CONFIG_CGROUP_DEBUG=y # CONFIG_CGROUP_FREEZER is not set # CONFIG_CGROUP_PIDS is not set # CONFIG_CGROUP_DEVICE is not set # CONFIG_CPUSETS is not set CONFIG_CGROUP_CPUACCT=y CONFIG_PAGE_COUNTER=y # CONFIG_MEMCG is not set CONFIG_CGROUP_HUGETLB=y CONFIG_CGROUP_PERF=y # CONFIG_CGROUP_SCHED is not set CONFIG_CHECKPOINT_RESTORE=y CONFIG_NAMESPACES=y # CONFIG_UTS_NS is not set CONFIG_IPC_NS=y CONFIG_USER_NS=y CONFIG_PID_NS=y # CONFIG_SCHED_AUTOGROUP is not set CONFIG_SYSFS_DEPRECATED=y # CONFIG_SYSFS_DEPRECATED_V2 is not set # CONFIG_RELAY is not set CONF
RE: randconfig build error with next-20150923, in drivers/staging/unisys/visorhid
> -Original Message- > From: Jim Davis [mailto:jim.ep...@gmail.com] > Sent: Wednesday, September 23, 2015 1:29 PM > To: Stephen Rothwell; linux-next; linux-kernel; Greg Kroah-Hartman; > Romer, Benjamin M; Kershner, David A; *S-Par-Maintainer; devel > Subject: randconfig build error with next-20150923, in > drivers/staging/unisys/visorhid > > Building with the attached random configuration file, > > ERROR: "input_free_device" > [drivers/staging/unisys/visorhid/visorhid.ko] undefined! > ERROR: "input_set_capability" > [drivers/staging/unisys/visorhid/visorhid.ko] undefined! > ERROR: "input_set_abs_params" > [drivers/staging/unisys/visorhid/visorhid.ko] undefined! > ERROR: "input_register_device" > [drivers/staging/unisys/visorhid/visorhid.ko] undefined! > ERROR: "input_allocate_device" > [drivers/staging/unisys/visorhid/visorhid.ko] undefined! > ERROR: "input_unregister_device" > [drivers/staging/unisys/visorhid/visorhid.ko] undefined! > ERROR: "input_event" [drivers/staging/unisys/visorhid/visorhid.ko] > undefined! > > > -- > Jim We have a patch that we will be submitting up soon that adds "INPUT" to the "depends on" list in our Kconfig that should fix this. Thanks. - Tim Sell ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] staging: comedi: rti800: minor cleanups
H Hartley Sweeten (2): staging: comedi: rti800: prefer using the BIT macro staging: comedi: rti800: use comedi_offset_munge() drivers/staging/comedi/drivers/rti800.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: comedi: rti800: prefer using the BIT macro
Use the BIT macro to define the register bits. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rti800.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/comedi/drivers/rti800.c b/drivers/staging/comedi/drivers/rti800.c index 340ac77..528e069 100644 --- a/drivers/staging/comedi/drivers/rti800.c +++ b/drivers/staging/comedi/drivers/rti800.c @@ -57,14 +57,14 @@ * Register map */ #define RTI800_CSR 0x00 -#define RTI800_CSR_BUSY(1 << 7) -#define RTI800_CSR_DONE(1 << 6) -#define RTI800_CSR_OVERRUN (1 << 5) -#define RTI800_CSR_TCR (1 << 4) -#define RTI800_CSR_DMA_ENAB(1 << 3) -#define RTI800_CSR_INTR_TC (1 << 2) -#define RTI800_CSR_INTR_EC (1 << 1) -#define RTI800_CSR_INTR_OVRN (1 << 0) +#define RTI800_CSR_BUSYBIT(7) +#define RTI800_CSR_DONEBIT(6) +#define RTI800_CSR_OVERRUN BIT(5) +#define RTI800_CSR_TCR BIT(4) +#define RTI800_CSR_DMA_ENABBIT(3) +#define RTI800_CSR_INTR_TC BIT(2) +#define RTI800_CSR_INTR_EC BIT(1) +#define RTI800_CSR_INTR_OVRN BIT(0) #define RTI800_MUXGAIN 0x01 #define RTI800_CONVERT 0x02 #define RTI800_ADCLO 0x03 -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: comedi: rti800: use comedi_offset_munge()
Use the comedi_offset_munge() helper to do the two's complement to comedi offset binary and comedi offset binary to two's complement conversions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rti800.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/rti800.c b/drivers/staging/comedi/drivers/rti800.c index 528e069..cd61d26 100644 --- a/drivers/staging/comedi/drivers/rti800.c +++ b/drivers/staging/comedi/drivers/rti800.c @@ -189,17 +189,21 @@ static int rti800_ai_insn_read(struct comedi_device *dev, } for (i = 0; i < insn->n; i++) { + unsigned int val; + outb(0, dev->iobase + RTI800_CONVERT); ret = comedi_timeout(dev, s, insn, rti800_ai_eoc, 0); if (ret) return ret; - data[i] = inb(dev->iobase + RTI800_ADCLO); - data[i] |= (inb(dev->iobase + RTI800_ADCHI) & 0xf) << 8; + val = inb(dev->iobase + RTI800_ADCLO); + val |= (inb(dev->iobase + RTI800_ADCHI) & 0xf) << 8; if (devpriv->adc_2comp) - data[i] ^= 0x800; + val = comedi_offset_munge(s, val); + + data[i] = val; } return insn->n; @@ -222,7 +226,7 @@ static int rti800_ao_insn_write(struct comedi_device *dev, s->readback[chan] = val; if (devpriv->dac_2comp[chan]) - val ^= 0x800; + val = comedi_offset_munge(s, val); outb(val & 0xff, dev->iobase + reg_lo); outb((val >> 8) & 0xff, dev->iobase + reg_hi); -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 13/13] Staging: rtl8712: Coding style warning fix for block comment
On Wed, Sep 23, 2015 at 10:25 PM, punit vara wrote: > Thank you very much sir I will definitely follow that. I have seen so > many people fixing patches over here. Now I know process of submitting > patches.I am able to fix several patches created by checkpatch.pl . > But can you suggest me any driver to fix API or another small TODO > task. I have seen so many TODO but confuse where to start . Can you > give me some initial idea or though or any driver to fix bugs ? :-) Dear Sudip sir, I have used git format-patch master..my_local_branch But It also produce numbers in subject of patch. Now I have used git format-patch master..my_local_branch -N ..It does not generate any number in patch even if you have previous patches ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: rtl8712: rtl8712_spec.h: Coding Style warning fix for block comment
This patch is to the rtl8712_spec.h file that fixes up following warning reported by checkpatch.pl : -Block comments use a trailing */ on a separate line Signed-off-by: Punit Vara --- drivers/staging/rtl8712/rtl8712_spec.h | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_spec.h b/drivers/staging/rtl8712/rtl8712_spec.h index af11b44..1ce6f83 100644 --- a/drivers/staging/rtl8712/rtl8712_spec.h +++ b/drivers/staging/rtl8712/rtl8712_spec.h @@ -81,9 +81,11 @@ #defineDID_WLAN_FIFO 3 /* 1 1*/ #define DID_UNDEFINE (-1) -#define CMD_ADDR_MAPPING_SHIFT 2 /*SDIO CMD ADDR MAPPING, -*shift 2 bit for match -* offset[14:2]*/ +#define CMD_ADDR_MAPPING_SHIFT 2 /* +* SDIO CMD ADDR MAPPING, +* shift 2 bit for match +* offset[14:2] +*/ /*Offset for SDIO LOCAL*/ #defineOFFSET_SDIO_LOCAL 0x0FFF -- 2.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v4] staging: unisys: Add s-Par visorhba
On 09/23/2015 01:00 PM, Greg KH wrote: v4: * remove all BUG() and BUG_ON() - do not crash the kernel You just deleted them? No taking into account that you should just handle issues like this in a run-time-safe way instead? Removing them altogether was a better way to handle the problems overall. In both spots, the BUG_ON() was catching things on the client side of the driver that were actually a problem for the I/O service partition - bad values going in which could cause the service partition to crash. Obviously, crashing the guest was a bad solution, and it left an opening where someone could crash the service partition on purpose, so we needed to be able to handle things the right way. I apologize for the lack of information in the versioning. I will collect up all of the changes from each version, and send a v5 with comprehensive information. :) -- Ben ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
randconfig build error with next-20150923, in drivers/staging/rtl8188eu/os_dep/mon.c
Building with the attached random configuration file, drivers/built-in.o: In function `mon_recv_decrypted': mon.c:(.text+0x31befb): undefined reference to `ieee80211_hdrlen' -- Jim # # Automatically generated file; DO NOT EDIT. # Linux/x86 4.3.0-rc2 Kernel Configuration # CONFIG_64BIT=y CONFIG_X86_64=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_OUTPUT_FORMAT="elf64-x86-64" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_MMU=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ZONE_DMA32=y CONFIG_AUDIT_ARCH=y CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_X86_64_SMP=y CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11" CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_PGTABLE_LEVELS=4 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_CONSTRUCTORS=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" CONFIG_COMPILE_TEST=y CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y CONFIG_KERNEL_GZIP=y # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_LZMA is not set # CONFIG_KERNEL_XZ is not set # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y CONFIG_CROSS_MEMORY_ATTACH=y # CONFIG_FHANDLE is not set # CONFIG_USELIB is not set CONFIG_AUDIT=y CONFIG_HAVE_ARCH_AUDITSYSCALL=y # CONFIG_AUDITSYSCALL is not set # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y # CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_HZ_PERIODIC=y # CONFIG_NO_HZ_IDLE is not set # CONFIG_NO_HZ_FULL is not set # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set # CONFIG_IRQ_TIME_ACCOUNTING is not set # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set # # RCU Subsystem # CONFIG_TREE_RCU=y # CONFIG_RCU_EXPERT is not set CONFIG_SRCU=y # CONFIG_TASKS_RCU is not set CONFIG_RCU_STALL_COMMON=y # CONFIG_TREE_RCU_TRACE is not set # CONFIG_RCU_EXPEDITE_BOOT is not set CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=y CONFIG_LOG_BUF_SHIFT=17 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_ARCH_SUPPORTS_INT128=y CONFIG_CGROUPS=y CONFIG_CGROUP_DEBUG=y CONFIG_CGROUP_FREEZER=y CONFIG_CGROUP_PIDS=y # CONFIG_CGROUP_DEVICE is not set CONFIG_CPUSETS=y # CONFIG_PROC_PID_CPUSET is not set # CONFIG_CGROUP_CPUACCT is not set CONFIG_PAGE_COUNTER=y CONFIG_MEMCG=y # CONFIG_MEMCG_KMEM is not set CONFIG_CGROUP_HUGETLB=y CONFIG_CGROUP_PERF=y CONFIG_CGROUP_SCHED=y CONFIG_FAIR_GROUP_SCHED=y # CONFIG_CFS_BANDWIDTH is not set # CONFIG_RT_GROUP_SCHED is not set # CONFIG_CHECKPOINT_RESTORE is not set CONFIG_NAMESPACES=y CONFIG_UTS_NS=y CONFIG_IPC_NS=y # CONFIG_USER_NS is not set # CONFIG_PID_NS is not set CONFIG_NET_NS=y CONFIG_SCHED_AUTOGROUP=y # CONFIG_SYSFS_DEPRECATED is not set # CONFIG_RELAY is not set # CONFIG_BLK_DEV_INITRD is not set # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_ANON_INODES=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_HAVE_PCSPKR_PLATFORM=y CONFIG_BPF=y CONFIG_EXPERT=y CONFIG_MULTIUSER=y # CONFIG_SGETMASK_SYSCALL is not set # CONFIG_SYSFS_SYSCALL is not set CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_PCSPKR_PLATFORM=y # CONFIG_BASE_FULL is not set # CONFIG_FUTEX is not set # CONFIG_EPOLL is not set CONFIG_SIGNALFD=y # CONFIG_TIMERFD is not set CONFIG_EVENTFD=y # CONFIG_BPF_SYSCALL is not set # CONFIG_SHMEM is not set CONFIG_AIO=y CON
[PATCH] Staging: rtl8712: rtl8712_syscfg_bitdef.h: Coding style warnings fix for block comments
This patch is to the rtl8712_syscfg_bitdef.h file that fixes up following warning reported by checkpatch.pl : -Block comments use a trailing */ on a separate line Signed-off-by: Punit Vara --- drivers/staging/rtl8712/rtl8712_syscfg_bitdef.h | 54 - 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_syscfg_bitdef.h b/drivers/staging/rtl8712/rtl8712_syscfg_bitdef.h index eed09c8..071b4b7 100644 --- a/drivers/staging/rtl8712/rtl8712_syscfg_bitdef.h +++ b/drivers/staging/rtl8712/rtl8712_syscfg_bitdef.h @@ -67,12 +67,16 @@ #define SYS_CLKSEL_SHT 0 #define SYS_CLKSEL BIT(SYS_CLKSEL_SHT) /* System Clock 80MHz*/ #define PS_CLKSEL_SHT 1 -#define PS_CLKSEL BIT(PS_CLKSEL_SHT) /*System power save - * clock select.*/ +#define PS_CLKSEL BIT(PS_CLKSEL_SHT) /* + * System power save + * clock select. + */ #define CPU_CLKSEL_SHT 2 -#define CPU_CLKSEL BIT(CPU_CLKSEL_SHT) /* System Clock select, +#define CPU_CLKSEL BIT(CPU_CLKSEL_SHT) /* +* System Clock select, * 1: AFE source, -* 0: System clock(L-Bus)*/ +* 0: System clock(L-Bus) +*/ #define INT32K_EN_SHT 3 #define INT32K_EN BIT(INT32K_EN_SHT) #define MACSLP_SHT 4 @@ -84,11 +88,15 @@ #define RING_CLK_EN_SHT13 #define RING_CLK_ENBIT(RING_CLK_EN_SHT) #define SWHW_SEL_SHT 14 -#define SWHW_SEL BIT(SWHW_SEL_SHT) /* Load done, - * control path switch.*/ +#define SWHW_SEL BIT(SWHW_SEL_SHT) /* + * Load done, + * control path switch. + */ #define FWHW_SEL_SHT 15 -#define FWHW_SEL BIT(FWHW_SEL_SHT) /* Sleep exit, - * control path switch.*/ +#define FWHW_SEL BIT(FWHW_SEL_SHT) /* + * Sleep exit, + * control path switch. + */ /*9346CR*/ #define_VPDIDX_MSK 0xFF00 @@ -117,11 +125,15 @@ #defineAFE_MISC_E32_EN_SHT 2 #defineAFE_MISC_E32_EN BIT(AFE_MISC_E32_EN_SHT) #defineAFE_MISC_MBEN_SHT 1 -#defineAFE_MISC_MBEN BIT(AFE_MISC_MBEN_SHT)/* Enable AFE Macro - * Block's Mbias.*/ +#defineAFE_MISC_MBEN BIT(AFE_MISC_MBEN_SHT)/* + * Enable AFE Macro + * Block's Mbias. + */ #defineAFE_MISC_BGEN_SHT 0 -#defineAFE_MISC_BGEN BIT(AFE_MISC_BGEN_SHT)/* Enable AFE Macro - * Block's Bandgap.*/ +#defineAFE_MISC_BGEN BIT(AFE_MISC_BGEN_SHT)/* + * Enable AFE Macro + * Block's Bandgap. + */ /*--*/ @@ -148,11 +160,15 @@ /* EFUSE_CTRL*/ -#define EF_FLAGBIT(31) /* Access Flag, Write:1; -* Read:0*/ +#define EF_FLAGBIT(31) /* +* Access Flag, Write:1; +* Read:0 +*/ #define EF_PGPD0x7000 /* E-fuse Program time*/ -#define EF_RDT 0x0F00 /* E-fuse read time: in the -* unit of cycle time*/ +#define EF_RDT 0x0F00 /* +* E-fuse read time: in the +* unit of cycle time +*/ #define EF_PDN_EN BIT(19) /* EFuse Power down enable*/ #define ALD_EN BIT(18)
[PATCH] Staging: rtl8712: rtl8712_xmit.c: Coding style warnings fix for block comments
This patch is the rtl8712_xmit.c that fixes up following warnings reported by checkpatch.pl : -Block comments use a trailing */ on a separate line Signed-off-by: Punit Vara --- drivers/staging/rtl8712/rtl8712_xmit.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c index 86206d3..07cff1c 100644 --- a/drivers/staging/rtl8712/rtl8712_xmit.c +++ b/drivers/staging/rtl8712/rtl8712_xmit.c @@ -523,13 +523,15 @@ static void update_txdesc(struct xmit_frame *pxmitframe, uint *pmem, int sz) ptxdesc->txdw2 |= cpu_to_le32(BMC); /*offset 12*/ - /* f/w will increase the seqnum by itself, driver pass the + /* +* f/w will increase the seqnum by itself, driver pass the * correct priority to fw * fw will check the correct priority for increasing the * seqnum per tid. about usb using 4-endpoint, qsel points out * the correct mapping between AC&Endpoint, * the purpose is that correct mapping lets the MAC release -* the AC Queue list correctly. */ +* the AC Queue list correctly. +*/ ptxdesc->txdw3 = cpu_to_le32((pattrib->priority << SEQ_SHT) & 0x0fff); if ((pattrib->ether_type != 0x888e) && @@ -574,13 +576,15 @@ static void update_txdesc(struct xmit_frame *pxmitframe, uint *pmem, int sz) if (bmcst) ptxdesc->txdw2 |= cpu_to_le32(BMC); /* offset 12 */ - /* f/w will increase the seqnum by itself, driver pass the + /* +* f/w will increase the seqnum by itself, driver pass the * correct priority to fw * fw will check the correct priority for increasing the seqnum * per tid. about usb using 4-endpoint, qsel points out the * correct mapping between AC&Endpoint, * the purpose is that correct mapping let the MAC releases -* the AC Queue list correctly. */ +* the AC Queue list correctly. +*/ ptxdesc->txdw3 = cpu_to_le32((pattrib->priority << SEQ_SHT) & 0x0fff); /* offset 16 */ @@ -679,8 +683,10 @@ int r8712_xmitframe_complete(struct _adapter *padapter, if (pxmitframe->attrib.priority <= 15) res = r8712_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe); - /* always return ndis_packet after -* r8712_xmitframe_coalesce */ + /* +* always return ndis_packet after +* r8712_xmitframe_coalesce +*/ r8712_xmit_complete(padapter, pxmitframe); } if (res == _SUCCESS) -- 2.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: comedi_pci.c: improve function documentation
Expand the descriptions of the functions and document the return values. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_pci.c | 108 ++-- 1 file changed, 80 insertions(+), 28 deletions(-) diff --git a/drivers/staging/comedi/comedi_pci.c b/drivers/staging/comedi/comedi_pci.c index 027f0f4..0601049 100644 --- a/drivers/staging/comedi/comedi_pci.c +++ b/drivers/staging/comedi/comedi_pci.c @@ -22,8 +22,14 @@ #include "comedi_pci.h" /** - * comedi_to_pci_dev() - comedi_device pointer to pci_dev pointer. - * @dev: comedi_device struct + * comedi_to_pci_dev() - Return PCI device attached to COMEDI device + * @dev: COMEDI device. + * + * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a + * a &struct device embedded in a &struct pci_dev. + * + * Returns: Attached PCI device if @dev->hw_dev is non-%NULL. + * Returns %NULL if @dev->hw_dev is %NULL. */ struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev) { @@ -32,8 +38,22 @@ struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev) EXPORT_SYMBOL_GPL(comedi_to_pci_dev); /** - * comedi_pci_enable() - Enable the PCI device and request the regions. - * @dev: comedi_device struct + * comedi_pci_enable() - Enable the PCI device and request the regions + * @dev: COMEDI device. + * + * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a + * a &struct device embedded in a &struct pci_dev. Enable the PCI device + * and request its regions. Set @dev->ioenabled to %true if successful, + * otherwise undo what was done. + * + * Calls to comedi_pci_enable() and comedi_pci_disable() cannot be nested. + * + * Returns: + * 0 on success, + * -%ENODEV if @dev->hw_dev is %NULL, + * -%EBUSY if regions busy, + * or some negative error number if failed to enable PCI device. + * */ int comedi_pci_enable(struct comedi_device *dev) { @@ -58,8 +78,13 @@ int comedi_pci_enable(struct comedi_device *dev) EXPORT_SYMBOL_GPL(comedi_pci_enable); /** - * comedi_pci_disable() - Release the regions and disable the PCI device. - * @dev: comedi_device struct + * comedi_pci_disable() - Release the regions and disable the PCI device + * @dev: COMEDI device. + * + * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a + * a &struct device embedded in a &struct pci_dev. If the earlier call + * to comedi_pci_enable() was successful, release the PCI device's regions + * and disable it. Reset @dev->ioenabled back to %false. */ void comedi_pci_disable(struct comedi_device *dev) { @@ -74,8 +99,18 @@ void comedi_pci_disable(struct comedi_device *dev) EXPORT_SYMBOL_GPL(comedi_pci_disable); /** - * comedi_pci_detach() - A generic (*detach) function for PCI drivers. - * @dev: comedi_device struct + * comedi_pci_detach() - A generic "detach" handler for PCI COMEDI drivers + * @dev: COMEDI device. + * + * COMEDI drivers for PCI devices that need no special clean-up of private data + * and have no ioremapped regions other than that pointed to by @dev->mmio may + * use this function as its "detach" handler called by the COMEDI core when a + * COMEDI device is being detached from the low-level driver. It may be also + * called from a more specific "detach" handler that does additional clean-up. + * + * Free the IRQ if @dev->irq is non-zero, iounmap @dev->mmio if it is + * non-%NULL, and call comedi_pci_disable() to release the PCI device's regions + * and disable it. */ void comedi_pci_detach(struct comedi_device *dev) { @@ -97,12 +132,19 @@ void comedi_pci_detach(struct comedi_device *dev) EXPORT_SYMBOL_GPL(comedi_pci_detach); /** - * comedi_pci_auto_config() - Configure/probe a comedi PCI driver. - * @pcidev: pci_dev struct - * @driver: comedi_driver struct - * @context: driver specific data, passed to comedi_auto_config() + * comedi_pci_auto_config() - Configure/probe a PCI COMEDI device + * @pcidev: PCI device. + * @driver: Registered COMEDI driver. + * @context: Driver specific data, passed to comedi_auto_config(). * - * Typically called from the pci_driver (*probe) function. + * Typically called from the pci_driver (*probe) function. Auto-configure + * a COMEDI device, using the &struct device embedded in *@pcidev as the + * hardware device. The @context value gets passed through to @driver's + * "auto_attach" handler. The "auto_attach" handler may call + * comedi_to_pci_dev() on the passed in COMEDI device to recover @pcidev. + * + * Returns: The result of calling comedi_auto_config() (0 on success, or + * a negative error number on failure). */ int comedi_pci_auto_config(struct pci_dev *pcidev, struct comedi_driver *driver, @@ -113,10 +155,18 @@ int comedi_pci_auto_config(struct pci_dev *pcidev, EXPORT_SYMBOL_GPL(comedi_pci_auto_config); /** - * comedi_pci_auto_unconfig() - Unconfigure/remove a comedi PCI driver. - * @pcidev: pci_dev struct + * comedi_pci_auto_unconfig() - Unconfigure/remove a PCI COMEDI dev
Re: [PATCH 0/2] staging: comedi: rti800: minor cleanups
On 23/09/15 18:43, H Hartley Sweeten wrote: H Hartley Sweeten (2): staging: comedi: rti800: prefer using the BIT macro staging: comedi: rti800: use comedi_offset_munge() drivers/staging/comedi/drivers/rti800.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) Thanks. Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: rtl8712: rtl871x_cmd.c: Coding style warnings fix for block comments
This patch is to the rtl871x_cmd.c that fixes up following warnings reported by checkpatch.pl : -Block comments use a trailing */ on a separate line -Block comments use * on subsequent lines Signed-off-by: Punit Vara --- drivers/staging/rtl8712/rtl871x_cmd.c | 38 ++- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index ef71829..501a951 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -51,9 +51,9 @@ #include "mlme_osdep.h" /* -Caller and the r8712_cmd_thread can protect cmd_q by spin_lock. -No irqsave is necessary. -*/ + * Caller and the r8712_cmd_thread can protect cmd_q by spin_lock. + * No irqsave is necessary. + */ static sint _init_cmd_priv(struct cmd_priv *pcmdpriv) { @@ -110,14 +110,14 @@ static void _free_cmd_priv(struct cmd_priv *pcmdpriv) } /* -Calling Context: - -_enqueue_cmd can only be called between kernel thread, -since only spin_lock is used. - -ISR/Call-Back functions can't call this sub-function. - -*/ + * Calling Context: + * + * _enqueue_cmd can only be called between kernel thread, + * since only spin_lock is used. + * + * ISR/Call-Back functions can't call this sub-function. + * + */ static sint _enqueue_cmd(struct __queue *queue, struct cmd_obj *obj) { @@ -214,11 +214,11 @@ void r8712_free_cmd_obj(struct cmd_obj *pcmd) } /* -r8712_sitesurvey_cmd(~) - ### NOTE: () - MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, -YOU SHOULD HAVE LOCKED pmlmepriv->lock -*/ + * r8712_sitesurvey_cmd(~) + * ### NOTE: () + * MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, + * YOU SHOULD HAVE LOCKED pmlmepriv->lock + */ u8 r8712_sitesurvey_cmd(struct _adapter *padapter, struct ndis_802_11_ssid *pssid) { @@ -953,8 +953,10 @@ void r8712_createbss_cmd_callback(struct _adapter *padapter, (r8712_get_wlan_bssid_ex_sz(pnetwork))); if (pmlmepriv->fw_state & _FW_UNDER_LINKING) pmlmepriv->fw_state ^= _FW_UNDER_LINKING; - /* we will set _FW_LINKED when there is one more sat to -* join us (stassoc_event_callback) */ + /* +* we will set _FW_LINKED when there is one more sat to +* join us (stassoc_event_callback) +*/ } createbss_cmd_fail: spin_unlock_irqrestore(&pmlmepriv->lock, irqL); -- 2.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: rtl8712: rtl871x_cmd.h: Fix typo error "ture"
This patch is to the rtl8712_cmd.h that fixes up typo error in comment for word "true". Signed-off-by: Punit Vara --- drivers/staging/rtl8712/rtl871x_cmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8712/rtl871x_cmd.h b/drivers/staging/rtl8712/rtl871x_cmd.h index 2514bfd..f204321 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.h +++ b/drivers/staging/rtl8712/rtl871x_cmd.h @@ -436,7 +436,7 @@ struct getrfintfs_parm { * * mac[0] == 0 * ==> CMD mode, return H2C_SUCCESS. - * The following condition must be ture under CMD mode + * The following condition must be true under CMD mode * mac[1] == mac[4], mac[2] == mac[3], mac[0]=mac[5]= 0; * s0 == 0x1234, s1 == 0xabcd, w0 == 0x78563412, w1 == 0x5aa5def7; * s2 == (b1 << 8 | b0); -- 2.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: rtl8712: rtl871x_cmd.h: Coding style warnings fix for block comments
This patch is to the rtl871x_cmd.h file that fixes up following warnings reported by checkpatch.pl : -Block comments use * on subsequent lines -Block comments use a trailing */ on a separate line Signed-off-by: Punit Vara --- drivers/staging/rtl8712/rtl871x_cmd.h | 282 +- 1 file changed, 144 insertions(+), 138 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_cmd.h b/drivers/staging/rtl8712/rtl871x_cmd.h index 818cd88..2514bfd 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.h +++ b/drivers/staging/rtl8712/rtl871x_cmd.h @@ -184,11 +184,15 @@ struct setauth_parm { * when 802.1x ==> keyid > 2 ==> unicast key */ struct setkey_parm { - u8 algorithm; /* encryption algorithm, could be none, wep40, -* TKIP, CCMP, wep104 */ + u8 algorithm; /* +* encryption algorithm, could be none, wep40, +* TKIP, CCMP, wep104 +*/ u8 keyid; - u8 grpkey; /* 1: this is the grpkey for 802.1x. -* 0: this is the unicast key for 802.1x */ + u8 grpkey; /* +* 1: this is the grpkey for 802.1x. +* 0: this is the unicast key for 802.1x +*/ u8 key[16];/* this could be 40 or 104 */ }; @@ -215,15 +219,15 @@ struct SetMacAddr_param { }; /* -Caller Ad-Hoc/AP - -Command -Rsp(AID == CAMID) mode - -This is to force fw to add an sta_data entry per driver's request. - -FW will write an cam entry associated with it. - -*/ + * Caller Ad-Hoc/AP + * + * Command -Rsp(AID == CAMID) mode + * + * This is to force fw to add an sta_data entry per driver's request. + * + * FW will write an cam entry associated with it. + * + */ struct set_assocsta_parm { u8 addr[ETH_ALEN]; }; @@ -234,27 +238,27 @@ struct set_assocsta_rsp { }; /* - Caller Ad-Hoc/AP - - Command mode - - This is to force fw to del an sta_data entry per driver's request - - FW will invalidate the cam entry associated with it. - -*/ + * Caller Ad-Hoc/AP + * + * Command mode + * + * This is to force fw to del an sta_data entry per driver's request + * + * FW will invalidate the cam entry associated with it. + * + */ struct del_assocsta_parm { u8 addr[ETH_ALEN]; }; /* -Caller Mode: AP/Ad-HoC(M) - -Notes: To notify fw that given staid has changed its power state - -Command Mode - -*/ + * Caller Mode: AP/Ad-HoC(M) + * + * Notes: To notify fw that given staid has changed its power state + * + * Command Mode + * + */ struct setstapwrstate_parm { u8 staid; u8 status; @@ -262,25 +266,25 @@ struct setstapwrstate_parm { }; /* -Caller Mode: Any - -Notes: To setup the basic rate of RTL8711 - -Command Mode - -*/ + * Caller Mode: Any + * + * Notes: To setup the basic rate of RTL8711 + * + * Command Mode + * + */ struct setbasicrate_parm { u8 basicrates[NumRates]; }; /* -Caller Mode: Any - -Notes: To read the current basic rate - -Command-Rsp Mode - -*/ + * Caller Mode: Any + * + * Notes: To read the current basic rate + * + * Command-Rsp Mode + * + */ struct getbasicrate_parm { u32 rsvd; }; @@ -290,13 +294,13 @@ struct getbasicrate_rsp { }; /* -Caller Mode: Any - -Notes: To setup the data rate of RTL8711 - -Command Mode - -*/ + * Caller Mode: Any + * + * Notes: To setup the data rate of RTL8711 + * + * Command Mode + * + */ struct setdatarate_parm { u8 mac_id; u8 datarates[NumRates]; @@ -332,13 +336,13 @@ struct SetChannelPlan_param { }; /* -Caller Mode: Any - -Notes: To read the current data rate - -Command-Rsp Mode - -*/ + * Caller Mode: Any + * + * Notes: To read the current data rate + * + * Command-Rsp Mode + * + */ struct getdatarate_parm { u32 rsvd; @@ -349,36 +353,36 @@ struct getdatarate_rsp { /* -Caller Mode: Any -AP: AP can use the info for the contents of beacon frame -Infra: STA can use the info when sitesurveying -Ad-HoC(M): Like AP -Ad-HoC(C): Like STA - - -Notes: To set the phy capability of the NIC - -Command Mode - -*/ + * Caller Mode: Any + * AP: AP can use the info for the contents of beacon frame + * Infra: STA can use the info when sitesurveying + * Ad-HoC(M): Like AP + * Ad-HoC(C): Like STA + * + * + * Notes: To set the phy capability of the NIC + * + * Command Mode + * + */ /* -Caller Mode: Any - -Notes: To set the channel/modem/band -This command will be used when channel/modem/band is changed. - -Command Mode - -*/ + * Caller Mode: Any + * + * Notes: To set the channel/modem/band + * This command will be used when channel/modem/band is changed. + * + * Command Mode + * + */ /* -Caller Mode: Any - -Notes: To get the current setting of channel/modem/band - -Command-Rsp Mode - -*/ + * Caller M
[PATCH 00/11] staging: comedi: rtd520: tidy up driver
Tidy up this driver and fix all the checkpatch.pl issues. H Hartley Sweeten (11): staging: comedi: rtd520: prefer using the BIT macro staging: comedi: rtd520: fix logical continuations staging: comedi: rtd529: usleep_range is preferred over udelay staging: comedi: rtd520: rename rtd520Boards staging: comedi: rtd520: move constants to right side of comparisons staging: comedi: rtd520: remove unnecessary comments from rtd_ao_winsn() staging: comedi: rtd520: convert DAC register defines to macros staging: comedi: rtd520: tidy up rtd_ao_winsn() staging: comedi: rtd520: remove unnecessary function desc. block comments staging: comedi: rtd520: tidy up block comments staging: comedi: rtd520: use DIV_ROUND_CLOSEST and DIV_ROUND_UP macros drivers/staging/comedi/drivers/rtd520.c | 257 ++-- 1 file changed, 108 insertions(+), 149 deletions(-) -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/11] staging: comedi: rtd520: fix logical continuations
Fix the checkpatch.pl issues about: CHECK: Logical continuations should be on the previous line Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rtd520.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index 9485e84..ea594e6 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -959,8 +959,8 @@ static int rtd_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) switch (cmd->stop_src) { case TRIG_COUNT:/* stop after N scans */ devpriv->ai_count = cmd->stop_arg * cmd->chanlist_len; - if ((devpriv->xfer_count > 0) - && (devpriv->xfer_count > devpriv->ai_count)) { + if ((devpriv->xfer_count > 0) && + (devpriv->xfer_count > devpriv->ai_count)) { devpriv->xfer_count = devpriv->ai_count; } break; @@ -1074,8 +1074,7 @@ static int rtd_ao_winsn(struct comedi_device *dev, /* VERIFY: comedi range and offset conversions */ - if ((range > 1) /* bipolar */ - && (data[i] < 2048)) { + if ((range > 1) && (data[i] < 2048)) { /* bipolar */ /* offset and sign extend */ val = (((int)data[i]) - 2048) << 3; } else {/* unipolor */ -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/11] staging: comedi: rtd520: prefer using the BIT macro
Use the BIT macro to define the register bits. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rtd520.c | 54 - 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index 4c13f5e..9485e84 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -106,39 +106,39 @@ */ #define LAS0_USER_IO 0x0008 /* User I/O */ #define LAS0_ADC 0x0010 /* FIFO Status/Software A/D Start */ -#define FS_DAC1_NOT_EMPTY (1 << 0)/* DAC1 FIFO not empty */ -#define FS_DAC1_HEMPTY (1 << 1)/* DAC1 FIFO half empty */ -#define FS_DAC1_NOT_FULL (1 << 2)/* DAC1 FIFO not full */ -#define FS_DAC2_NOT_EMPTY (1 << 4)/* DAC2 FIFO not empty */ -#define FS_DAC2_HEMPTY (1 << 5)/* DAC2 FIFO half empty */ -#define FS_DAC2_NOT_FULL (1 << 6)/* DAC2 FIFO not full */ -#define FS_ADC_NOT_EMPTY (1 << 8)/* ADC FIFO not empty */ -#define FS_ADC_HEMPTY (1 << 9)/* ADC FIFO half empty */ -#define FS_ADC_NOT_FULL(1 << 10) /* ADC FIFO not full */ -#define FS_DIN_NOT_EMPTY (1 << 12) /* DIN FIFO not empty */ -#define FS_DIN_HEMPTY (1 << 13) /* DIN FIFO half empty */ -#define FS_DIN_NOT_FULL(1 << 14) /* DIN FIFO not full */ +#define FS_DAC1_NOT_EMPTY BIT(0) /* DAC1 FIFO not empty */ +#define FS_DAC1_HEMPTY BIT(1) /* DAC1 FIFO half empty */ +#define FS_DAC1_NOT_FULL BIT(2) /* DAC1 FIFO not full */ +#define FS_DAC2_NOT_EMPTY BIT(4) /* DAC2 FIFO not empty */ +#define FS_DAC2_HEMPTY BIT(5) /* DAC2 FIFO half empty */ +#define FS_DAC2_NOT_FULL BIT(6) /* DAC2 FIFO not full */ +#define FS_ADC_NOT_EMPTY BIT(8) /* ADC FIFO not empty */ +#define FS_ADC_HEMPTY BIT(9) /* ADC FIFO half empty */ +#define FS_ADC_NOT_FULLBIT(10) /* ADC FIFO not full */ +#define FS_DIN_NOT_EMPTY BIT(12) /* DIN FIFO not empty */ +#define FS_DIN_HEMPTY BIT(13) /* DIN FIFO half empty */ +#define FS_DIN_NOT_FULLBIT(14) /* DIN FIFO not full */ #define LAS0_DAC1 0x0014 /* Software D/A1 Update (w) */ #define LAS0_DAC2 0x0018 /* Software D/A2 Update (w) */ #define LAS0_DAC 0x0024 /* Software Simultaneous Update (w) */ #define LAS0_PACER 0x0028 /* Software Pacer Start/Stop */ #define LAS0_TIMER 0x002c /* Timer Status/HDIN Software Trig. */ #define LAS0_IT0x0030 /* Interrupt Status/Enable */ -#define IRQM_ADC_FIFO_WRITE(1 << 0)/* ADC FIFO Write */ -#define IRQM_CGT_RESET (1 << 1)/* Reset CGT */ -#define IRQM_CGT_PAUSE (1 << 3)/* Pause CGT */ -#define IRQM_ADC_ABOUT_CNT (1 << 4)/* About Counter out */ -#define IRQM_ADC_DELAY_CNT (1 << 5)/* Delay Counter out */ -#define IRQM_ADC_SAMPLE_CNT(1 << 6)/* ADC Sample Counter */ -#define IRQM_DAC1_UCNT (1 << 7)/* DAC1 Update Counter */ -#define IRQM_DAC2_UCNT (1 << 8)/* DAC2 Update Counter */ -#define IRQM_UTC1 (1 << 9)/* User TC1 out */ -#define IRQM_UTC1_INV (1 << 10) /* User TC1 out, inverted */ -#define IRQM_UTC2 (1 << 11) /* User TC2 out */ -#define IRQM_DIGITAL_IT(1 << 12) /* Digital Interrupt */ -#define IRQM_EXTERNAL_IT (1 << 13) /* External Interrupt */ -#define IRQM_ETRIG_RISING (1 << 14) /* Ext Trigger rising-edge */ -#define IRQM_ETRIG_FALLING (1 << 15) /* Ext Trigger falling-edge */ +#define IRQM_ADC_FIFO_WRITEBIT(0) /* ADC FIFO Write */ +#define IRQM_CGT_RESET BIT(1) /* Reset CGT */ +#define IRQM_CGT_PAUSE BIT(3) /* Pause CGT */ +#define IRQM_ADC_ABOUT_CNT BIT(4) /* About Counter out */ +#define IRQM_ADC_DELAY_CNT BIT(5) /* Delay Counter out */ +#define IRQM_ADC_SAMPLE_CNTBIT(6) /* ADC Sample Counter */ +#define IRQM_DAC1_UCNT BIT(7) /* DAC1 Update Counter */ +#define IRQM_DAC2_UCNT BIT(8) /* DAC2 Update Counter */ +#define IRQM_UTC1 BIT(9) /* User TC1 out */ +#define IRQM_UTC1_INV BIT(10) /* User TC1 out, inverted */ +#define IRQM_UTC2 BIT(11) /* User TC2 out */ +#define IRQM_DIGITAL_ITBIT(12) /* Digital Interrupt */ +#define IRQM_EXTERNAL_IT BIT(13) /* External Interrupt */ +#define IRQM_ETRIG_RISING BIT(14) /* Ext Trigger rising-edge */ +#define IRQM_ETRIG_FALLING BIT(15) /* Ext Trigger falling-edge */ #define LAS0_CLEAR 0x0034 /* Clear/Set Interrupt Clear Mask */ #define LAS0_OVERRUN 0x0038 /* Pending interrupts/Clear Overrun */ #define LAS
[PATCH 03/11] staging: comedi: rtd529: usleep_range is preferred over udelay
Fix checkpatch issue: "CHECK: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt". `udelay()` is only used in the firmware upload process. Replace them with `usleep_range()` with a reasonable upper limit. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rtd520.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index ea594e6..49cbf48 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -513,7 +513,7 @@ static int rtd520_probe_fifo_depth(struct comedi_device *dev) unsigned fifo_status; /* trigger conversion */ writew(0, dev->mmio + LAS0_ADC); - udelay(1); + usleep_range(1, 1000); fifo_status = readl(dev->mmio + LAS0_ADC); if ((fifo_status & FS_ADC_HEMPTY) == 0) { fifo_size = 2 * i; @@ -1142,7 +1142,7 @@ static void rtd_reset(struct comedi_device *dev) struct rtd_private *devpriv = dev->private; writel(0, dev->mmio + LAS0_BOARD_RESET); - udelay(100);/* needed? */ + usleep_range(100, 1000);/* needed? */ writel(0, devpriv->lcfg + PLX_INTRCS_REG); writew(0, dev->mmio + LAS0_IT); writew(~0, dev->mmio + LAS0_CLEAR); -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/11] staging: comedi: rtd520: rename rtd520Boards
For aesthetics, rename this CamelCase array. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rtd520.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index 49cbf48..f93a6e3 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -352,7 +352,7 @@ struct rtd_boardinfo { const struct comedi_lrange *ai_range; }; -static const struct rtd_boardinfo rtd520Boards[] = { +static const struct rtd_boardinfo rtd520_boards[] = { [BOARD_DM7520] = { .name = "DM7520", .range_bip10= 6, @@ -1195,8 +1195,8 @@ static int rtd_auto_attach(struct comedi_device *dev, struct comedi_subdevice *s; int ret; - if (context < ARRAY_SIZE(rtd520Boards)) - board = &rtd520Boards[context]; + if (context < ARRAY_SIZE(rtd520_boards)) + board = &rtd520_boards[context]; if (!board) return -ENODEV; dev->board_ptr = board; -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/11] staging: comedi: rtd520: move constants to right side of comparisons
Fix the checkpatch.pl issues about: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rtd520.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index f93a6e3..b4d8f59 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -608,7 +608,7 @@ static int ai_read_n(struct comedi_device *dev, struct comedi_subdevice *s, unsigned int range = CR_RANGE(cmd->chanlist[async->cur_chan]); unsigned short d; - if (0 == devpriv->ai_count) { /* done */ + if (devpriv->ai_count == 0) { /* done */ d = readw(devpriv->las1 + LAS1_ADC_FIFO); continue; } @@ -655,7 +655,7 @@ static irqreturn_t rtd_interrupt(int irq, void *d) status = readw(dev->mmio + LAS0_IT); /* if interrupt was not caused by our board, or handled above */ - if (0 == status) + if (status == 0) return IRQ_HANDLED; if (status & IRQM_ADC_ABOUT_CNT) { /* sample count -> read FIFO */ @@ -670,7 +670,7 @@ static irqreturn_t rtd_interrupt(int irq, void *d) if (ai_read_n(dev, s, devpriv->fifosz / 2) < 0) goto xfer_abort; - if (0 == devpriv->ai_count) + if (devpriv->ai_count == 0) goto xfer_done; } else if (devpriv->xfer_count > 0) { if (fifo_status & FS_ADC_NOT_EMPTY) { @@ -678,7 +678,7 @@ static irqreturn_t rtd_interrupt(int irq, void *d) if (ai_read_n(dev, s, devpriv->xfer_count) < 0) goto xfer_abort; - if (0 == devpriv->ai_count) + if (devpriv->ai_count == 0) goto xfer_done; } } @@ -760,7 +760,7 @@ static int rtd_ai_cmdtest(struct comedi_device *dev, if (cmd->scan_begin_src == TRIG_TIMER) { /* Note: these are time periods, not actual rates */ - if (1 == cmd->chanlist_len) { /* no scanning */ + if (cmd->chanlist_len == 1) { /* no scanning */ if (comedi_check_trigger_arg_min(&cmd->scan_begin_arg, RTD_MAX_SPEED_1)) { rtd_ns_to_timer(&cmd->scan_begin_arg, @@ -795,7 +795,7 @@ static int rtd_ai_cmdtest(struct comedi_device *dev, } if (cmd->convert_src == TRIG_TIMER) { - if (1 == cmd->chanlist_len) { /* no scanning */ + if (cmd->chanlist_len == 1) { /* no scanning */ if (comedi_check_trigger_arg_min(&cmd->convert_arg, RTD_MAX_SPEED_1)) { rtd_ns_to_timer(&cmd->convert_arg, @@ -907,7 +907,7 @@ static int rtd_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) } writel((devpriv->fifosz / 2 - 1) & 0x, dev->mmio + LAS0_ACNT); - if (TRIG_TIMER == cmd->scan_begin_src) { + if (cmd->scan_begin_src == TRIG_TIMER) { /* scan_begin_arg is in nanoseconds */ /* find out how many samples to wait before transferring */ if (cmd->flags & CMDF_WAKE_EOS) { -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/11] staging: comedi: rtd520: remove unnecessary comments from rtd_ao_winsn()
These comments are cut-and-paste from the old skeleton driver. Remove them. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rtd520.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index b4d8f59..02dcb22 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -1067,8 +1067,6 @@ static int rtd_ao_winsn(struct comedi_device *dev, writew(range & 7, dev->mmio + ((chan == 0) ? LAS0_DAC1_CTRL : LAS0_DAC2_CTRL)); - /* Writing a list of values to an AO channel is probably not -* very useful, but that's how the interface is defined. */ for (i = 0; i < insn->n; ++i) { int val = data[i] << 3; @@ -1081,7 +1079,6 @@ static int rtd_ao_winsn(struct comedi_device *dev, val = data[i] << 3; } - /* a typical programming sequence */ writew(val, devpriv->las1 + ((chan == 0) ? LAS1_DAC1_FIFO : LAS1_DAC2_FIFO)); writew(0, dev->mmio + ((chan == 0) ? LAS0_DAC1 : LAS0_DAC2)); @@ -1093,7 +1090,6 @@ static int rtd_ao_winsn(struct comedi_device *dev, return ret; } - /* return the number of samples read/written */ return i; } -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/37] staging/lustre: use 64-bit timestamps in procfs output
Some lustre procfs files contain the current time. Make sure we use a format here that does not overflow in 2038. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/osc/lproc_osc.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c index c504d1503fda..515003d9602e 100644 --- a/drivers/staging/lustre/lustre/osc/lproc_osc.c +++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c @@ -597,18 +597,18 @@ static struct lprocfs_vars lprocfs_osc_obd_vars[] = { static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v) { - struct timeval now; + struct timespec64 now; struct obd_device *dev = seq->private; struct client_obd *cli = &dev->u.cli; unsigned long read_tot = 0, write_tot = 0, read_cum, write_cum; int i; - do_gettimeofday(&now); + ktime_get_real_ts64(&now); client_obd_list_lock(&cli->cl_loi_list_lock); - seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n", - now.tv_sec, (unsigned long)now.tv_usec); + seq_printf(seq, "snapshot_time: %llu.%9lu (secs.usecs)\n", + (s64)now.tv_sec, (unsigned long)now.tv_nsec); seq_printf(seq, "read RPCs in flight: %d\n", cli->cl_r_in_flight); seq_printf(seq, "write RPCs in flight: %d\n", @@ -714,14 +714,14 @@ LPROC_SEQ_FOPS(osc_rpc_stats); static int osc_stats_seq_show(struct seq_file *seq, void *v) { - struct timeval now; + struct timespec64 now; struct obd_device *dev = seq->private; struct osc_stats *stats = &obd2osc_dev(dev)->od_stats; - do_gettimeofday(&now); + ktime_get_real_ts64(&now); - seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n", - now.tv_sec, (unsigned long)now.tv_usec); + seq_printf(seq, "snapshot_time: %llu.%9lu (secs.usecs)\n", + (s64)now.tv_sec, (unsigned long)now.tv_nsec); seq_printf(seq, "lockless_write_bytes\t\t%llu\n", stats->os_lockless_writes); seq_printf(seq, "lockless_read_bytes\t\t%llu\n", -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/37] staging/lustre: use 64-bit times for lnet_shuffle_seed
This function uses do_gettimeofday() to get a pseudo-random number. There is no bug here, but changing it to use ktime_get_ts64() gets us closer to deprecating do_gettimeofday() and makes slightly more random. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lnet/lnet/router.c | 6 +++--- drivers/staging/lustre/lustre/llite/super25.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/lustre_handles.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 75ff382b9342..2cdda3f0067e 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -237,7 +237,7 @@ static void lnet_shuffle_seed(void) { static int seeded; int lnd_type, seed[2]; - struct timeval tv; + struct timespec64 ts; lnet_ni_t *ni; struct list_head *tmp; @@ -256,8 +256,8 @@ static void lnet_shuffle_seed(void) seed[0] ^= (LNET_NIDADDR(ni->ni_nid) | lnd_type); } - do_gettimeofday(&tv); - cfs_srand(tv.tv_sec ^ seed[0], tv.tv_usec ^ seed[1]); + ktime_get_ts64(&ts); + cfs_srand(ts.tv_sec ^ seed[0], ts.tv_nsec ^ seed[1]); seeded = 1; } diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c index 4cf7af226ad7..a0de99f9e26c 100644 --- a/drivers/staging/lustre/lustre/llite/super25.c +++ b/drivers/staging/lustre/lustre/llite/super25.c @@ -90,7 +90,7 @@ void lustre_register_client_process_config(int (*cpc)(struct lustre_cfg *lcfg)); static int __init init_lustre_lite(void) { lnet_process_id_t lnet_id; - struct timeval tv; + struct timespec64 ts; int i, rc, seed[2]; CLASSERT(sizeof(LUSTRE_VOLATILE_HDR) == LUSTRE_VOLATILE_HDR_LEN + 1); @@ -152,8 +152,8 @@ static int __init init_lustre_lite(void) seed[0] ^= LNET_NIDADDR(lnet_id.nid); } - do_gettimeofday(&tv); - cfs_srand(tv.tv_sec ^ seed[0], tv.tv_usec ^ seed[1]); + ktime_get_ts64(&ts); + cfs_srand(ts.tv_sec ^ seed[0], ts.tv_nsec ^ seed[1]); setup_timer(&ll_capa_timer, ll_capa_timer_callback, 0); rc = ll_capa_thread_start(); if (rc != 0) diff --git a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c index 35a94a8f4fd3..97d79dab2835 100644 --- a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c +++ b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c @@ -193,7 +193,7 @@ EXPORT_SYMBOL(class_handle_free_cb); int class_handle_init(void) { struct handle_bucket *bucket; - struct timeval tv; + struct timespec64 ts; int seed[2]; LASSERT(handle_hash == NULL); @@ -212,8 +212,8 @@ int class_handle_init(void) /** bug 21430: add randomness to the initial base */ cfs_get_random_bytes(seed, sizeof(seed)); - do_gettimeofday(&tv); - cfs_srand(tv.tv_sec ^ seed[0], tv.tv_usec ^ seed[1]); + ktime_get_ts64(&ts); + cfs_srand(ts.tv_sec ^ seed[0], ts.tv_nsec ^ seed[1]); cfs_get_random_bytes(&handle_base, sizeof(handle_base)); LASSERT(handle_base != 0ULL); -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/11] staging: comedi: rtd520: convert DAC register defines to macros
For aesthetics, convert the defines for the various DAC registers into macros that take the comedi channel and return the correct offset. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rtd520.c | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index 02dcb22..5fe92c4 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -118,8 +118,7 @@ #define FS_DIN_NOT_EMPTY BIT(12) /* DIN FIFO not empty */ #define FS_DIN_HEMPTY BIT(13) /* DIN FIFO half empty */ #define FS_DIN_NOT_FULLBIT(14) /* DIN FIFO not full */ -#define LAS0_DAC1 0x0014 /* Software D/A1 Update (w) */ -#define LAS0_DAC2 0x0018 /* Software D/A2 Update (w) */ +#define LAS0_UPDATE_DAC(x) (0x0014 + ((x) * 0x4)) /* D/Ax Update (w) */ #define LAS0_DAC 0x0024 /* Software Simultaneous Update (w) */ #define LAS0_PACER 0x0028 /* Software Pacer Start/Stop */ #define LAS0_TIMER 0x002c /* Timer Status/HDIN Software Trig. */ @@ -177,16 +176,11 @@ #define LAS0_CGT_PAUSE 0x0144 /* Table Pause Enable */ #define LAS0_CGT_RESET 0x0148 /* Reset Channel Gain Table */ #define LAS0_CGT_CLEAR 0x014c /* Clear Channel Gain Table */ -#define LAS0_DAC1_CTRL 0x0150 /* D/A1 output type/range */ -#define LAS0_DAC1_SRC 0x0154 /* D/A1 update source */ -#define LAS0_DAC1_CYCLE0x0158 /* D/A1 cycle mode */ -#define LAS0_DAC1_RESET0x015c /* D/A1 FIFO reset */ -#define LAS0_DAC1_FIFO_CLEAR 0x0160 /* D/A1 FIFO clear */ -#define LAS0_DAC2_CTRL 0x0164 /* D/A2 output type/range */ -#define LAS0_DAC2_SRC 0x0168 /* D/A2 update source */ -#define LAS0_DAC2_CYCLE0x016c /* D/A2 cycle mode */ -#define LAS0_DAC2_RESET0x0170 /* D/A2 FIFO reset */ -#define LAS0_DAC2_FIFO_CLEAR 0x0174 /* D/A2 FIFO clear */ +#define LAS0_DAC_CTRL(x) (0x0150 + ((x) * 0x14)) /* D/Ax type/range */ +#define LAS0_DAC_SRC(x)(0x0154 + ((x) * 0x14)) /* D/Ax update source */ +#define LAS0_DAC_CYCLE(x) (0x0158 + ((x) * 0x14)) /* D/Ax cycle mode */ +#define LAS0_DAC_RESET(x) (0x015c + ((x) * 0x14)) /* D/Ax FIFO reset */ +#define LAS0_DAC_FIFO_CLEAR(x) (0x0160 + ((x) * 0x14)) /* D/Ax FIFO clear */ #define LAS0_ADC_SCNT_SRC 0x0178 /* A/D Sample Counter Source select */ #define LAS0_PACER_SELECT 0x0180 /* Pacer Clock select */ #define LAS0_SBUS0_SRC 0x0184 /* SyncBus 0 Source select */ @@ -213,8 +207,7 @@ */ #define LAS1_ADC_FIFO 0x /* A/D FIFO (16bit) */ #define LAS1_HDIO_FIFO 0x0004 /* HiSpd DI FIFO (16bit) */ -#define LAS1_DAC1_FIFO 0x0008 /* D/A1 FIFO (16bit) */ -#define LAS1_DAC2_FIFO 0x000c /* D/A2 FIFO (16bit) */ +#define LAS1_DAC_FIFO(x) (0x0008 + ((x) * 0x4)) /* D/Ax FIFO (16bit) */ /*== Driver specific stuff (tunable) @@ -1064,8 +1057,7 @@ static int rtd_ao_winsn(struct comedi_device *dev, int ret; /* Configure the output range (table index matches the range values) */ - writew(range & 7, - dev->mmio + ((chan == 0) ? LAS0_DAC1_CTRL : LAS0_DAC2_CTRL)); + writew(range & 7, dev->mmio + LAS0_DAC_CTRL(chan)); for (i = 0; i < insn->n; ++i) { int val = data[i] << 3; @@ -1079,9 +1071,8 @@ static int rtd_ao_winsn(struct comedi_device *dev, val = data[i] << 3; } - writew(val, devpriv->las1 + - ((chan == 0) ? LAS1_DAC1_FIFO : LAS1_DAC2_FIFO)); - writew(0, dev->mmio + ((chan == 0) ? LAS0_DAC1 : LAS0_DAC2)); + writew(val, devpriv->las1 + LAS1_DAC_FIFO(chan)); + writew(0, dev->mmio + LAS0_UPDATE_DAC(chan)); s->readback[chan] = data[i]; @@ -1156,8 +1147,8 @@ static void rtd_init_board(struct comedi_device *dev) writel(0, dev->mmio + LAS0_OVERRUN); writel(0, dev->mmio + LAS0_CGT_CLEAR); writel(0, dev->mmio + LAS0_ADC_FIFO_CLEAR); - writel(0, dev->mmio + LAS0_DAC1_RESET); - writel(0, dev->mmio + LAS0_DAC2_RESET); + writel(0, dev->mmio + LAS0_DAC_RESET(0)); + writel(0, dev->mmio + LAS0_DAC_RESET(1)); /* clear digital IO fifo */ writew(0, dev->mmio + LAS0_DIO_STATUS); writeb((0 << 6) | 0x30, dev->mmio + LAS0_UTC_CTRL); -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/37] staging/lustre: use 64-bit time for adaptive timeout
The adaptive timeout handling stores absolute times in 32-bit time_t quantities, which will overflow in 2038. This changes it to use time64_t. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/include/lustre_import.h | 6 +++--- drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 8 drivers/staging/lustre/lustre/ptlrpc/import.c | 8 drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 8 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h index 99606387f904..cd6244ecd0c7 100644 --- a/drivers/staging/lustre/lustre/include/lustre_import.h +++ b/drivers/staging/lustre/lustre/include/lustre_import.h @@ -61,12 +61,12 @@ #define AT_FLG_NOHIST 0x1/* use last reported value only */ struct adaptive_timeout { - time_t at_binstart; /* bin start time */ + time64_tat_binstart; /* bin start time */ unsigned intat_hist[AT_BINS];/* timeout history bins */ unsigned intat_flags; unsigned intat_current; /* current timeout value */ unsigned intat_worst_ever; /* worst-ever timeout value */ - time_t at_worst_time; /* worst-ever timeout timestamp */ + time64_tat_worst_time; /* worst-ever timeout timestamp */ spinlock_t at_lock; }; @@ -351,7 +351,7 @@ static inline void at_reset(struct adaptive_timeout *at, int val) spin_lock(&at->at_lock); at->at_current = val; at->at_worst_ever = val; - at->at_worst_time = get_seconds(); + at->at_worst_time = ktime_get_real_seconds(); spin_unlock(&at->at_lock); } static inline void at_init(struct adaptive_timeout *at, int val, int flags) diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index 9887ce1d51e4..7cc0f54f9cd4 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -890,8 +890,8 @@ int lprocfs_rd_timeouts(struct seq_file *m, void *data) worst = imp->imp_at.iat_net_latency.at_worst_ever; worstt = imp->imp_at.iat_net_latency.at_worst_time; s2dhms(&ts, now - worstt); - seq_printf(m, "%-10s : cur %3u worst %3u (at %ld, "DHMS_FMT" ago) ", - "network", cur, worst, worstt, DHMS_VARS(&ts)); + seq_printf(m, "%-10s : cur %3u worst %3u (at %lld, "DHMS_FMT" ago) ", + "network", cur, worst, (s64)worstt, DHMS_VARS(&ts)); lprocfs_at_hist_helper(m, &imp->imp_at.iat_net_latency); for (i = 0; i < IMP_AT_MAX_PORTALS; i++) { @@ -901,9 +901,9 @@ int lprocfs_rd_timeouts(struct seq_file *m, void *data) worst = imp->imp_at.iat_service_estimate[i].at_worst_ever; worstt = imp->imp_at.iat_service_estimate[i].at_worst_time; s2dhms(&ts, now - worstt); - seq_printf(m, "portal %-2d : cur %3u worst %3u (at %ld, " + seq_printf(m, "portal %-2d : cur %3u worst %3u (at %lld, " DHMS_FMT" ago) ", imp->imp_at.iat_portal[i], - cur, worst, worstt, DHMS_VARS(&ts)); + cur, worst, (s64)worstt, DHMS_VARS(&ts)); lprocfs_at_hist_helper(m, &imp->imp_at.iat_service_estimate[i]); } diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index b6f38cbbc295..3fc49ee66d8b 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -1523,12 +1523,12 @@ extern unsigned int at_min, at_max, at_history; int at_measured(struct adaptive_timeout *at, unsigned int val) { unsigned int old = at->at_current; - time_t now = get_seconds(); - time_t binlimit = max_t(time_t, at_history / AT_BINS, 1); + time64_t now = ktime_get_real_seconds(); + long binlimit = max_t(long, at_history / AT_BINS, 1); LASSERT(at); CDEBUG(D_OTHER, "add %u to %p time=%lu v=%u (%u %u %u %u)\n", - val, at, now - at->at_binstart, at->at_current, + val, at, (long)(now - at->at_binstart), at->at_current, at->at_hist[0], at->at_hist[1], at->at_hist[2], at->at_hist[3]); if (val == 0) @@ -1553,7 +1553,7 @@ int at_measured(struct adaptive_timeout *at, unsigned int val) int i, shift; unsigned int maxv = val; /* move bins over */ - shift = (now - at->at_binstart) / binlimit; + shift = (u32)(now - at->at_binstart) / binlimit; LASSERT(shift > 0); for (i = AT_BINS - 1; i >= 0; i--) { if (i >= shift) { diff --git a
[PATCH 06/37] staging/lustre: use time64_t for l_last_activity
The l_last_activity struct member is used to keep track lock hold times, and it is printed for debugging purposes. For the elapsed time, we can use 'long' here, but it's better to use time64_t for storing the real time to avoid an overflow in 2038. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 29 +- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 92b24be7c21e..796a997ec94c 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -749,7 +749,7 @@ struct ldlm_lock { * Seconds. It will be updated if there is any activity related to * the lock, e.g. enqueue the lock or send blocking AST. */ - unsigned long l_last_activity; + time64_tl_last_activity; /** * Time last used by e.g. being matched by lock match. diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index cd340fc8ceab..12eb5ac3b3d8 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -1564,7 +1564,7 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns, ldlm_error_t rc = ELDLM_OK; struct ldlm_interval *node = NULL; - lock->l_last_activity = get_seconds(); + lock->l_last_activity = ktime_get_real_seconds(); /* policies are not executed on the client or during replay */ if ((*flags & (LDLM_FL_HAS_INTENT|LDLM_FL_REPLAY)) == LDLM_FL_HAS_INTENT && !local && ns->ns_policy) { diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index b5ee9bd9875f..1eeb4af1134f 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -97,15 +97,13 @@ int ldlm_expired_completion_wait(void *data) if (lock->l_conn_export == NULL) { static unsigned long next_dump, last_dump; - LCONSOLE_WARN("lock timed out (enqueued at "CFS_TIME_T", " - CFS_DURATION_T"s ago)\n", - lock->l_last_activity, - cfs_time_sub(get_seconds(), - lock->l_last_activity)); - LDLM_DEBUG(lock, "lock timed out (enqueued at " CFS_TIME_T ", " CFS_DURATION_T "s ago); not entering recovery in server code, just going back to sleep", - lock->l_last_activity, - cfs_time_sub(get_seconds(), - lock->l_last_activity)); + LCONSOLE_WARN("lock timed out (enqueued at %lld, %llds ago)\n", + (s64)lock->l_last_activity, + (s64)(ktime_get_real_seconds() - + lock->l_last_activity)); + LDLM_DEBUG(lock, "lock timed out (enqueued at %lld, %llds ago); not entering recovery in server code, just going back to sleep", + (s64)lock->l_last_activity, + (s64)(ktime_get_real_seconds() - lock->l_last_activity)); if (cfs_time_after(cfs_time_current(), next_dump)) { last_dump = next_dump; next_dump = cfs_time_shift(300); @@ -120,10 +118,9 @@ int ldlm_expired_completion_wait(void *data) obd = lock->l_conn_export->exp_obd; imp = obd->u.cli.cl_import; ptlrpc_fail_import(imp, lwd->lwd_conn_cnt); - LDLM_ERROR(lock, "lock timed out (enqueued at "CFS_TIME_T", " - CFS_DURATION_T"s ago), entering recovery for %s@%s", - lock->l_last_activity, - cfs_time_sub(get_seconds(), lock->l_last_activity), + LDLM_ERROR(lock, "lock timed out (enqueued at %lld, %llds ago), entering recovery for %s@%s", + (s64)lock->l_last_activity, + (s64)(ktime_get_real_seconds() - lock->l_last_activity), obd2cli_tgt(obd), imp->imp_connection->c_remote_uuid.uuid); return 0; @@ -159,10 +156,8 @@ static int ldlm_completion_tail(struct ldlm_lock *lock) LDLM_DEBUG(lock, "client-side enqueue: destroyed"); result = -EIO; } else { - delay = cfs_time_sub(get_seconds(), -lock->l_last_activity); - LDLM_DEBUG(lock, "client-side enqueue: granted after " - CFS_DURATION_T"s", delay); + delay = ktime_get_real_seconds() - lock->l_last_activity; + LDLM_
[PATCH 00/37] staging/lustre: y2038 rework
First of all, sorry for the overly long series that this turned into. I'm currently doing a survey of all code using time_t/timeval/timespec to get an idea of what work needs to be done where, in particular in terms of user interface changes. Lustre is by far the most pervasive user of time types and functions, and I could not even find my way through the code to see what needs to be done other than actually doing that work. On most other subsystems, we try to use montonic times where possible for in-kernel uses. I did not do that here but kept using wall-clock times, in order to leave the debug output and procfs files untouched. A follow-up series could convert a lot of the ktime_get_real_*() to ktime_get_*() to change that if we don't care about the format. There are a couple of things that I left unchanged: - Socket timestamps in drivers/staging/lustre/lnet/lnet/lib-socket.c need to wait for the socket API to be changed first - inode timestamps need to be changed in VFS, which is a larger work - The conrpc selftest has a user interface based on timeval that is hard to change. All patches are based on staging-testing and built-tested on 32-bit arm and x86 as well as 64-bit arm. Arnd Bergmann (37): staging/lustre: use jiffies for lp_last_query times staging/lustre: use 64-bit inode timestamps internally staging/lustre: obd: remove unused data structures staging/lustre: tracefile: use 64-bit seconds staging/lustre: use 64-bit timestamps in procfs output staging/lustre: use time64_t for l_last_activity staging/lustre: use ktime_t for calculating elapsed time staging/lustre: change rq_at_index type staging/lustre: avoid unnecessary timeval conversion staging/lustre: use 64-bit time LNetCtl() staging/lustre: use 'long' return type for cfs_duration_sec() staging/lustre: use jiffies_to_timeval() instead of cfs_duration_usec staging/lustre: use 64-bit ibn_incarnation computation staging/lustre: use 64-bit times for lnet_shuffle_seed staging/lustre: use 64-bit computation in s2dhms() staging/lustre: use 64-bit timestamps for selftest staging/lustre: use 64-bit time for pl_recalc staging/lustre: use 64-bit time for obd eviction staging/lustre: use 64-bit time for procfs output staging/lustre: use 64-bit time for adaptive timeout staging/lustre: use 64-bit llite procfs timestamps staging/lustre: use 64-bit times for ksnd_connd staging/lustre: use 64-bit time for ni_last_alive staging/lustre: use 64-bit time for selftest staging/lustre: partially use time64_t for capa expiry staging/lustre: use 64-bit times in ptlrpc_enc_page_pool staging/lustre: use 64-bit times in debug print staging/lustre: use 64-bit times in another debug print staging/lustre: use 64-bit timestamps for mdc staging/lustre: use 64-bit times for ptlrpc sec expiry staging/lustre: use 64-bit times for ptlrpc_sec staging/lustre: use 64-bit times for exp_last_request_time staging/lustre: use 64-bit times for request times staging/lustre: remove a bit of dead code staging/lustre: remove wrappers for timer functions staging/lustre: remove unused time handling functions staging/lustre: remove CFS_TIME_T definition .../lustre/include/linux/libcfs/libcfs_debug.h | 4 +- .../lustre/include/linux/libcfs/libcfs_prim.h | 13 -- .../lustre/include/linux/libcfs/libcfs_time.h | 49 .../lustre/include/linux/libcfs/linux/linux-time.h | 35 +- .../staging/lustre/include/linux/lnet/lib-lnet.h | 2 +- .../staging/lustre/include/linux/lnet/lib-types.h | 2 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c| 6 +- .../staging/lustre/lnet/klnds/socklnd/socklnd.c| 2 +- .../staging/lustre/lnet/klnds/socklnd/socklnd.h| 6 +- .../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 8 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 6 +- drivers/staging/lustre/lnet/lnet/config.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-eq.c | 9 +- drivers/staging/lustre/lnet/lnet/lib-move.c| 4 +- drivers/staging/lustre/lnet/lnet/router.c | 10 +- drivers/staging/lustre/lnet/lnet/router_proc.c | 2 +- drivers/staging/lustre/lnet/selftest/conctl.c | 2 +- drivers/staging/lustre/lnet/selftest/conrpc.c | 10 +- drivers/staging/lustre/lnet/selftest/console.c | 2 +- drivers/staging/lustre/lnet/selftest/console.h | 2 +- drivers/staging/lustre/lnet/selftest/framework.c | 5 +- drivers/staging/lustre/lnet/selftest/ping_test.c | 12 +- drivers/staging/lustre/lnet/selftest/rpc.c | 9 +- drivers/staging/lustre/lnet/selftest/selftest.h| 2 +- drivers/staging/lustre/lnet/selftest/timer.c | 14 +-- drivers/staging/lustre/lnet/selftest/timer.h | 2 +- drivers/staging/lustre/lustre/include/cl_object.h | 6 +- .../staging/lustre/lustre/include/lprocfs_status.h | 6 +- .../lustre/lustre/include/lustre/lustre_idl.h | 1 + .../
[PATCH 13/37] staging/lustre: use 64-bit ibn_incarnation computation
ibn_incarnation is a 64-bit value, but using timeval to compute it will cause an overflow in 2038. This changes it to use ktime_get_real_ts64() instead. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index faa70f0b9b1e..5a157a744a7d 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -2749,7 +2749,7 @@ int kiblnd_startup(lnet_ni_t *ni) char *ifname; kib_dev_t *ibdev = NULL; kib_net_t *net; - struct timeval tv; + struct timespec64 tv; unsigned long flags; int rc; int newdev; @@ -2767,8 +2767,8 @@ int kiblnd_startup(lnet_ni_t *ni) if (net == NULL) goto net_failed; - do_gettimeofday(&tv); - net->ibn_incarnation = (((__u64)tv.tv_sec) * 100) + tv.tv_usec; + ktime_get_real_ts64(&tv); + net->ibn_incarnation = tv.tv_sec * USEC_PER_SEC + tv.tv_nsec / NSEC_PER_USEC; ni->ni_peertimeout= *kiblnd_tunables.kib_peertimeout; ni->ni_maxtxcredits = *kiblnd_tunables.kib_credits; -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/37] staging/lustre: change rq_at_index type
The rq_at_index member of ptlrpc_request is incorrectly declared as time_t, when it is only used as an index into an array, and assigned from a __u32 variable. This changes the type to u32, so we can kill off another use of time_t. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/include/lustre_net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index c9c21d289e92..44adee134563 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -1292,7 +1292,7 @@ struct ptlrpc_request { struct ptlrpc_nrs_request rq_nrq; /** @} nrs */ /** the index of service's srv_at_array into which request is linked */ - time_t rq_at_index; + u32 rq_at_index; /** Lock to protect request flags and some other important bits, like * rq_list */ -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/37] staging/lustre: use 64-bit inode timestamps internally
Lustre has 64-bit timestamps in its network data structures, but on 32 bit systems, it converts them directly into time_t, which is 32 bit wide. This changes the code to use 64-bit time stamps for files. The Linux VFS code still uses time_t though, and will be changed in a separate patch series. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/include/cl_object.h| 6 +++--- drivers/staging/lustre/lustre/llite/llite_internal.h | 2 +- drivers/staging/lustre/lustre/llite/vvp_io.c | 4 ++-- drivers/staging/lustre/lustre/llite/vvp_object.c | 12 ++-- drivers/staging/lustre/lustre/osc/osc_io.c | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/cl_object.h b/drivers/staging/lustre/lustre/include/cl_object.h index 04dcb5111756..90fbaa22e510 100644 --- a/drivers/staging/lustre/lustre/include/cl_object.h +++ b/drivers/staging/lustre/lustre/include/cl_object.h @@ -173,11 +173,11 @@ struct cl_attr { */ loff_t cat_kms; /** Modification time. Measured in seconds since epoch. */ - time_t cat_mtime; + time64_t cat_mtime; /** Access time. Measured in seconds since epoch. */ - time_t cat_atime; + time64_t cat_atime; /** Change time. Measured in seconds since epoch. */ - time_t cat_ctime; + time64_t cat_ctime; /** * Blocks allocated to this cl_object on the server file system. * diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index 37bf331be5c2..fdd0a58286c1 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -851,7 +851,7 @@ struct vvp_io { * Inode modification time that is checked across DLM * lock request. */ - time_t ft_mtime; + time64_tft_mtime; struct vm_area_struct *ft_vma; /** * locked page returned from vvp_io diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c index 75a8ea21bc24..cf264de0e531 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_io.c +++ b/drivers/staging/lustre/lustre/llite/vvp_io.c @@ -109,7 +109,7 @@ static int vvp_io_fault_iter_init(const struct lu_env *env, LASSERT(inode == file_inode(cl2ccc_io(env, ios)->cui_fd->fd_file)); - vio->u.fault.ft_mtime = LTIME_S(inode->i_mtime); + vio->u.fault.ft_mtime = inode->i_mtime.tv_sec; return 0; } @@ -661,7 +661,7 @@ static int vvp_io_fault_start(const struct lu_env *env, pgoff_t last; /* last page in a file data region */ if (fio->ft_executable && - LTIME_S(inode->i_mtime) != vio->u.fault.ft_mtime) + inode->i_mtime.tv_sec != vio->u.fault.ft_mtime) CWARN("binary "DFID " changed while waiting for the page fault lock\n", PFID(lu_object_fid(&obj->co_lu))); diff --git a/drivers/staging/lustre/lustre/llite/vvp_object.c b/drivers/staging/lustre/lustre/llite/vvp_object.c index b6f6d4cb6e41..cb2811b9aae7 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_object.c +++ b/drivers/staging/lustre/lustre/llite/vvp_object.c @@ -87,9 +87,9 @@ static int vvp_attr_get(const struct lu_env *env, struct cl_object *obj, */ attr->cat_size = i_size_read(inode); - attr->cat_mtime = LTIME_S(inode->i_mtime); - attr->cat_atime = LTIME_S(inode->i_atime); - attr->cat_ctime = LTIME_S(inode->i_ctime); + attr->cat_mtime = inode->i_mtime.tv_sec; + attr->cat_atime = inode->i_atime.tv_sec; + attr->cat_ctime = inode->i_ctime.tv_sec; attr->cat_blocks = inode->i_blocks; attr->cat_uid = from_kuid(&init_user_ns, inode->i_uid); attr->cat_gid = from_kgid(&init_user_ns, inode->i_gid); @@ -107,11 +107,11 @@ static int vvp_attr_set(const struct lu_env *env, struct cl_object *obj, if (valid & CAT_GID) inode->i_gid = make_kgid(&init_user_ns, attr->cat_gid); if (valid & CAT_ATIME) - LTIME_S(inode->i_atime) = attr->cat_atime; + inode->i_atime.tv_sec = attr->cat_atime; if (valid & CAT_MTIME) - LTIME_S(inode->i_mtime) = attr->cat_mtime; + inode->i_mtime.tv_sec = attr->cat_mtime; if (valid & CAT_CTIME) - LTIME_S(inode->i_ctime) = attr->cat_ctime; + inode->i_ctime.tv_sec = attr->cat_ctime; if (0 && valid & CAT_SIZE) cl_isize_write_nolock(inode, attr->cat_size); /* not currently necessary */ diff --git a/drivers/staging/lustre/lustre/osc/osc_io.c b/drivers/staging/lustre/lustre/osc/osc_io
[PATCH 03/37] staging/lustre: obd: remove unused data structures
We want to get rid of all uses of time_t, and it turns out that obd.h contains a bunch of them that are completely unused. This removes those structures, along with a couple of other structures and functions in the same file that also turned out to be unused. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/include/obd.h| 33 -- drivers/staging/lustre/lustre/include/obd_class.h | 2 +- drivers/staging/lustre/lustre/llite/file.c | 2 +- drivers/staging/lustre/lustre/llite/llite_lib.c| 2 +- drivers/staging/lustre/lustre/lov/lov_obd.c| 2 +- .../staging/lustre/lustre/obdclass/obd_config.c| 1 - .../staging/lustre/lustre/obdecho/echo_client.c| 4 +-- drivers/staging/lustre/lustre/osc/osc_io.c | 2 +- 8 files changed, 7 insertions(+), 41 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index bafef4e6fe94..0dbac3f53f01 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -144,10 +144,6 @@ typedef int (*obd_enqueue_update_f)(void *cookie, int rc); /* obd info for a particular level (lov, osc). */ struct obd_info { - /* Lock policy. It keeps an extent which is specific for a particular -* OSC. (e.g. lov_prep_enqueue_set initialises extent of the policy, -* and osc_enqueue passes it into ldlm_lock_match & ldlm_cli_enqueue. */ - ldlm_policy_data_t oi_policy; /* Flags used for set request specific flags: - while lock handling, the flags obtained on the enqueue request are set here. @@ -155,8 +151,6 @@ struct obd_info { - while setattr, the flags used for distinguish punch operation */ __u64 oi_flags; - /* Lock handle specific for every OSC lock. */ - struct lustre_handle *oi_lockh; /* lsm data specific for every OSC. */ struct lov_stripe_md *oi_md; /* obdo data specific for every OSC, if needed at all. */ @@ -171,8 +165,6 @@ struct obd_info { /* oss capability, its type is obd_capa in client to avoid copy. * in contrary its type is lustre_capa in OSS. */ void *oi_capa; - /* transfer jobid from ost_sync() to filter_sync()... */ - char *oi_jobid; }; /* compare all relevant fields. */ @@ -455,25 +447,6 @@ struct echo_client_obd { __u64 ec_unique; }; -struct lov_qos_oss { - struct obd_uuid lqo_uuid; /* ptlrpc's c_remote_uuid */ - struct list_head lqo_oss_list; /* link to lov_qos */ - __u64 lqo_bavail; /* total bytes avail on OSS */ - __u64 lqo_penalty;/* current penalty */ - __u64 lqo_penalty_per_obj;/* penalty decrease every obj*/ - time_tlqo_used; /* last used time, seconds */ - __u32 lqo_ost_count; /* number of osts on this oss */ -}; - -struct ltd_qos { - struct lov_qos_oss *ltq_oss; /* oss info */ - __u64 ltq_penalty; /* current penalty */ - __u64 ltq_penalty_per_obj; /* penalty decrease every obj*/ - __u64 ltq_weight; /* net weighting */ - time_tltq_used; /* last used time, seconds */ - unsigned intltq_usable:1;/* usable for striping */ -}; - /* Generic subset of OSTs */ struct ost_pool { __u32 *op_array; /* array of index of @@ -524,7 +497,6 @@ struct lov_tgt_desc { struct obd_uuid ltd_uuid; struct obd_device *ltd_obd; struct obd_export *ltd_exp; - struct ltd_qos ltd_qos; /* qos info per target */ __u32 ltd_gen; __u32 ltd_index; /* index in lov_obd->tgts */ unsigned long ltd_active:1,/* is this target up for requests */ @@ -883,12 +855,7 @@ struct obd_device { int obd_requests_queued_for_recovery; wait_queue_head_t obd_next_transno_waitq; /* protected by obd_recovery_task_lock */ - struct timer_list obd_recovery_timer; - time_t obd_recovery_start; /* seconds */ - time_t obd_recovery_end; /* seconds, for lprocfs_status */ - int obd_recovery_time_hard; int obd_recovery_timeout; - int obd_recovery_ir_factor; /* new recovery stuff from CMD2 */ struct target_recovery_data obd_recovery_data; diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index ce6fa55aded7..7308cda6f5e6 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -1114,7 +1114,7 @@ static inline int obd_statf
[PATCH 24/37] staging/lustre: use 64-bit time for selftest
The lustre selftest code has multiple time stamps that are kept as 'time_t' or 'unsigned long' and can therefore overflow on 32-bit systems. This changes the code to use time64_t instead. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lnet/selftest/brw_test.c | 6 +++--- drivers/staging/lustre/lnet/selftest/conctl.c| 2 +- drivers/staging/lustre/lnet/selftest/conrpc.c| 15 +++ drivers/staging/lustre/lnet/selftest/console.c | 2 +- drivers/staging/lustre/lnet/selftest/console.h | 2 +- drivers/staging/lustre/lnet/selftest/framework.c | 3 +-- drivers/staging/lustre/lnet/selftest/rpc.c | 9 - drivers/staging/lustre/lnet/selftest/selftest.h | 2 +- drivers/staging/lustre/lnet/selftest/timer.c | 14 +++--- drivers/staging/lustre/lnet/selftest/timer.h | 2 +- 10 files changed, 27 insertions(+), 30 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c index de11f1bc8be7..0605c651f797 100644 --- a/drivers/staging/lustre/lnet/selftest/brw_test.c +++ b/drivers/staging/lustre/lnet/selftest/brw_test.c @@ -134,14 +134,14 @@ brw_client_init(sfw_test_instance_t *tsi) static int brw_inject_one_error(void) { - struct timeval tv; + struct timespec64 ts; if (brw_inject_errors <= 0) return 0; - do_gettimeofday(&tv); + ktime_get_ts64(&ts); - if ((tv.tv_usec & 1) == 0) + if (((ts.tv_nsec / NSEC_PER_USEC) & 1) == 0) return 0; return brw_inject_errors--; diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index 1a7870e91f23..817396638652 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -837,7 +837,7 @@ lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data) mutex_lock(&console_session.ses_mutex); - console_session.ses_laststamp = get_seconds(); + console_session.ses_laststamp = ktime_get_real_seconds(); if (console_session.ses_shutdown) { rc = -ESHUTDOWN; diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index bf2968310516..b70680b8bdbe 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -1176,7 +1176,7 @@ lstcon_rpc_pinger(void *arg) srpc_debug_reqst_t *drq; lstcon_ndlink_t *ndl; lstcon_node_t *nd; - time_t intv; + int intv; int count = 0; int rc; @@ -1191,8 +1191,8 @@ lstcon_rpc_pinger(void *arg) } if (!console_session.ses_expired && - get_seconds() - console_session.ses_laststamp > - (time_t)console_session.ses_timeout) + ktime_get_real_seconds() - console_session.ses_laststamp > + (time64_t)console_session.ses_timeout) console_session.ses_expired = 1; trans = console_session.ses_ping; @@ -1248,9 +1248,8 @@ lstcon_rpc_pinger(void *arg) if (nd->nd_state != LST_NODE_ACTIVE) continue; - intv = cfs_duration_sec(cfs_time_sub(cfs_time_current(), -nd->nd_stamp)); - if (intv < (time_t)nd->nd_timeout / 2) + intv = (jiffies - nd->nd_stamp) / HZ; + if (intv < nd->nd_timeout / 2) continue; rc = lstcon_rpc_init(nd, SRPC_SERVICE_DEBUG, @@ -1278,7 +1277,7 @@ lstcon_rpc_pinger(void *arg) CDEBUG(D_NET, "Ping %d nodes in session\n", count); - ptimer->stt_expires = (unsigned long)(get_seconds() + LST_PING_INTERVAL); + ptimer->stt_expires = ktime_get_real_seconds() + LST_PING_INTERVAL; stt_add_timer(ptimer); mutex_unlock(&console_session.ses_mutex); @@ -1301,7 +1300,7 @@ lstcon_rpc_pinger_start(void) } ptimer = &console_session.ses_ping_timer; - ptimer->stt_expires = (unsigned long)(get_seconds() + LST_PING_INTERVAL); + ptimer->stt_expires = ktime_get_real_seconds() + LST_PING_INTERVAL; stt_add_timer(ptimer); diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 5c624e19eaa1..024aaee76b7f 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -2004,7 +2004,7 @@ lstcon_console_init(void) console_session.ses_expired = 0; console_session.ses_feats_updated = 0; console_session.ses_features = LST_FEATS_MASK; - console_session.ses_laststamp = get_seconds(); + console_session.ses_laststamp = ktime_get_real_seconds(); mutex_init(&console_session.ses_mutex); diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/d
[PATCH 17/37] staging/lustre: use 64-bit time for pl_recalc
The ldlm pool calculates elapsed time by comparing the previous and current get_seconds() values, which is unsafe on 32-bit machines after 2038. This changes the code to use time64_t and ktime_get_real_seconds(), keeping the 'real' instead of 'monotonic' time because of the debug prints. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/include/lustre_dlm.h | 4 +-- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 30 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 796a997ec94c..1ac08e1c0559 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -256,9 +256,9 @@ struct ldlm_pool { * server_slv * lock_volume_factor. */ atomic_tpl_lock_volume_factor; /** Time when last SLV from server was obtained. */ - time_t pl_recalc_time; + time64_tpl_recalc_time; /** Recalculation period for pool. */ - time_t pl_recalc_period; + time64_tpl_recalc_period; /** Recalculation and shrink operations. */ const struct ldlm_pool_ops *pl_ops; /** Number of planned locks for next period. */ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index c234acb85f10..6be7b8fc4a51 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -330,14 +330,14 @@ static void ldlm_srv_pool_push_slv(struct ldlm_pool *pl) */ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl) { - time_t recalc_interval_sec; + time64_t recalc_interval_sec; - recalc_interval_sec = get_seconds() - pl->pl_recalc_time; + recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time; if (recalc_interval_sec < pl->pl_recalc_period) return 0; spin_lock(&pl->pl_lock); - recalc_interval_sec = get_seconds() - pl->pl_recalc_time; + recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time; if (recalc_interval_sec < pl->pl_recalc_period) { spin_unlock(&pl->pl_lock); return 0; @@ -358,7 +358,7 @@ static int ldlm_srv_pool_recalc(struct ldlm_pool *pl) */ ldlm_pool_recalc_grant_plan(pl); - pl->pl_recalc_time = get_seconds(); + pl->pl_recalc_time = ktime_get_real_seconds(); lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT, recalc_interval_sec); spin_unlock(&pl->pl_lock); @@ -467,10 +467,10 @@ static void ldlm_cli_pool_pop_slv(struct ldlm_pool *pl) */ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl) { - time_t recalc_interval_sec; + time64_t recalc_interval_sec; int ret; - recalc_interval_sec = get_seconds() - pl->pl_recalc_time; + recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time; if (recalc_interval_sec < pl->pl_recalc_period) return 0; @@ -478,7 +478,7 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl) /* * Check if we need to recalc lists now. */ - recalc_interval_sec = get_seconds() - pl->pl_recalc_time; + recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time; if (recalc_interval_sec < pl->pl_recalc_period) { spin_unlock(&pl->pl_lock); return 0; @@ -513,7 +513,7 @@ out: * Time of LRU resizing might be longer than period, * so update after LRU resizing rather than before it. */ - pl->pl_recalc_time = get_seconds(); + pl->pl_recalc_time = ktime_get_real_seconds(); lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT, recalc_interval_sec); spin_unlock(&pl->pl_lock); @@ -571,10 +571,10 @@ static const struct ldlm_pool_ops ldlm_cli_pool_ops = { */ int ldlm_pool_recalc(struct ldlm_pool *pl) { - time_t recalc_interval_sec; + u32 recalc_interval_sec; int count; - recalc_interval_sec = get_seconds() - pl->pl_recalc_time; + recalc_interval_sec = ktime_get_seconds() - pl->pl_recalc_time; if (recalc_interval_sec <= 0) goto recalc; @@ -599,14 +599,14 @@ int ldlm_pool_recalc(struct ldlm_pool *pl) lprocfs_counter_add(pl->pl_stats, LDLM_POOL_RECALC_STAT, count); } - recalc_interval_sec = pl->pl_recalc_time - get_seconds() + + recalc_interval_sec = pl->pl_recalc_time - ktime_get_seconds() + pl->pl_recalc_period; if (recalc_interval_sec <= 0) { /* Prevent too frequent recalculation. */ - CDEBUG(D_DLMT
[PATCH 19/37] staging/lustre: use 64-bit time for procfs output
This time is only printed in procfs, and can be easily converted to 64-bit to avoid overflowing on 32-bit systems in 2038. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/include/lustre_import.h | 4 ++-- .../staging/lustre/lustre/obdclass/lprocfs_status.c | 19 +-- drivers/staging/lustre/lustre/ptlrpc/events.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/import.c | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h index c8b89a359518..99606387f904 100644 --- a/drivers/staging/lustre/lustre/include/lustre_import.h +++ b/drivers/staging/lustre/lustre/include/lustre_import.h @@ -148,7 +148,7 @@ struct obd_import_conn { #define IMP_STATE_HIST_LEN 16 struct import_state_hist { enum lustre_imp_state ish_state; - time_t ish_time; + time64_tish_time; }; /** @@ -307,7 +307,7 @@ struct obd_import { __u32imp_msghdr_flags; /* adjusted based on server capability */ struct imp_atimp_at; /* adaptive timeout data */ - time_t imp_last_reply_time;/* for health check */ + time64_t imp_last_reply_time;/* for health check */ }; typedef void (*obd_import_callback)(struct obd_import *imp, void *closure, diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index 8d2a523ea7cf..9887ce1d51e4 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -846,8 +846,7 @@ int lprocfs_rd_state(struct seq_file *m, void *data) &imp->imp_state_hist[(k + j) % IMP_STATE_HIST_LEN]; if (ish->ish_state == 0) continue; - seq_printf(m, " - ["CFS_TIME_T", %s]\n", - ish->ish_time, + seq_printf(m, " - [%lld, %s]\n", (s64)ish->ish_time, ptlrpc_import_state_name(ish->ish_state)); } @@ -872,7 +871,7 @@ int lprocfs_rd_timeouts(struct seq_file *m, void *data) struct obd_device *obd = (struct obd_device *)data; struct obd_import *imp; unsigned int cur, worst; - time_t now, worstt; + time64_t now, worstt; struct dhms ts; int i; @@ -880,12 +879,12 @@ int lprocfs_rd_timeouts(struct seq_file *m, void *data) LPROCFS_CLIMP_CHECK(obd); imp = obd->u.cli.cl_import; - now = get_seconds(); + now = ktime_get_real_seconds(); /* Some network health info for kicks */ s2dhms(&ts, now - imp->imp_last_reply_time); - seq_printf(m, "%-10s : %ld, "DHMS_FMT" ago\n", - "last reply", imp->imp_last_reply_time, DHMS_VARS(&ts)); + seq_printf(m, "%-10s : %lld, "DHMS_FMT" ago\n", + "last reply", (s64)imp->imp_last_reply_time, DHMS_VARS(&ts)); cur = at_get(&imp->imp_at.iat_net_latency); worst = imp->imp_at.iat_net_latency.at_worst_ever; @@ -1190,11 +1189,11 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v) int idx= *(loff_t *)v; if (idx == 0) { - struct timeval now; - do_gettimeofday(&now); - seq_printf(p, "%-25s %lu.%lu secs.usecs\n", + struct timespec64 now; + ktime_get_real_ts64(&now); + seq_printf(p, "%-25s %llu.%9lu secs.usecs\n", "snapshot_time", - now.tv_sec, (unsigned long)now.tv_usec); + (s64)now.tv_sec, (unsigned long)now.tv_nsec); } hdr = &stats->ls_cnt_header[idx]; diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c b/drivers/staging/lustre/lustre/ptlrpc/events.c index c8ef9e578263..53f6b6278403 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/events.c +++ b/drivers/staging/lustre/lustre/ptlrpc/events.c @@ -158,7 +158,7 @@ void reply_in_callback(lnet_event_t *ev) ev->mlength, ev->offset, req->rq_replen); } - req->rq_import->imp_last_reply_time = get_seconds(); + req->rq_import->imp_last_reply_time = ktime_get_real_seconds(); out_wake: /* NB don't unlock till after wakeup; req can disappear under us diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index c52ceef989d5..b6f38cbbc295 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -79,7 +79,7 @@ static void __import_set_state(struct obd_import *imp, imp->imp_state = state; imp->imp_state_hist[imp->imp_state_hist_idx].ish_state = state; imp->imp_state_hist[imp->imp_st
[PATCH 25/37] staging/lustre: partially use time64_t for capa expiry
Here, we actually have a problem in 2038 or at the latest in 2106 when the lc_expiry variable on the wire protocol overflows, including on 64-bit architectures. I'm changing the internal implementation so it only compares the lower 31 bits of the current time, using the algorithm from time_before(), which should work as long as nothing tries to directly access lc_expiry. Signed-off-by: Arnd Bergmann --- .../staging/lustre/lustre/include/lustre/lustre_idl.h| 1 + drivers/staging/lustre/lustre/include/lustre_capa.h | 16 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index d20e199eb770..e0cec23e8344 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -3478,6 +3478,7 @@ struct lustre_capa { __u32 lc_flags; /** HMAC algorithm & flags */ __u32 lc_keyid; /** key# used for the capability */ __u32 lc_timeout; /** capa timeout value (sec) */ +/* FIXME: y2038 time_t overflow: */ __u32 lc_expiry; /** expiry time (sec) */ __u8lc_hmac[CAPA_HMAC_MAX_LEN]; /** HMAC */ } __attribute__((packed)); diff --git a/drivers/staging/lustre/lustre/include/lustre_capa.h b/drivers/staging/lustre/lustre/include/lustre_capa.h index 11bcdb935443..b75f7308d777 100644 --- a/drivers/staging/lustre/lustre/include/lustre_capa.h +++ b/drivers/staging/lustre/lustre/include/lustre_capa.h @@ -266,20 +266,24 @@ static inline __u64 capa_open_opc(int mode) static inline void set_capa_expiry(struct obd_capa *ocapa) { - unsigned long expiry = cfs_time_sub((unsigned long)ocapa->c_capa.lc_expiry, -get_seconds()); - ocapa->c_expiry = cfs_time_add(cfs_time_current(), - cfs_time_seconds(expiry)); + u32 expiry = ocapa->c_capa.lc_expiry - (u32)ktime_get_real_seconds(); + ocapa->c_expiry = jiffies + expiry * HZ; } static inline int capa_is_expired_sec(struct lustre_capa *capa) { - return (capa->lc_expiry - get_seconds() <= 0); + /* +* workaround for y2038 problem: do the same as time_before, but +* use 32-bit arithmetic, because lc_expiry is transmitted as a 32-bit +* variable on the wire +*/ + s32 diff = capa->lc_expiry - (u32)ktime_get_real_seconds(); + return diff <= 0; } static inline int capa_is_expired(struct obd_capa *ocapa) { - return time_before_eq(ocapa->c_expiry, cfs_time_current()); + return time_before_eq(ocapa->c_expiry, jiffies); } static inline int capa_opc_supported(struct lustre_capa *capa, __u64 opc) -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 37/37] staging/lustre: remove CFS_TIME_T definition
The CFS_TIME_T macro serves no real purpose as we stopped using time_t and changed over to time64_t, so we can remove the last remaining uses of this. Two uses of this macro are incorrect and refer to jiffies values rather than time_t, and one refers to an inode timespec that gets changed separately. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h | 1 - drivers/staging/lustre/lustre/mdc/mdc_reint.c | 3 +-- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 7 +++ drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c| 5 ++--- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h index 09c59f080ca3..ed8764b11c80 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h @@ -106,7 +106,6 @@ static inline int cfs_time_beforeq_64(__u64 t1, __u64 t2) */ #define CFS_TICK (1) -#define CFS_TIME_T "%lu" #define CFS_DURATION_T "%ld" #endif /* __LIBCFS_LINUX_LINUX_TIME_H__ */ diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c index 47051c0799f8..79e4fd48a96a 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_reint.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_reint.c @@ -144,8 +144,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data, rpc_lock = obd->u.cli.cl_rpc_lock; if (op_data->op_attr.ia_valid & (ATTR_MTIME | ATTR_CTIME)) - CDEBUG(D_INODE, "setting mtime "CFS_TIME_T - ", ctime "CFS_TIME_T"\n", + CDEBUG(D_INODE, "setting mtime %ld, ctime %ld\n", LTIME_S(op_data->op_attr.ia_mtime), LTIME_S(op_data->op_attr.ia_ctime)); mdc_setattr_pack(req, op_data, ea, ealen, ea2, ea2len); diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index 76eecb02d1fc..b13aaa2660f7 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -275,10 +275,9 @@ static int ptlrpc_pinger_main(void *arg) next ping time to next_ping + .01 sec, which means we will SKIP the next ping at next_ping, and the ping will get sent 2 timeouts from now! Beware. */ - CDEBUG(D_INFO, "next wakeup in "CFS_DURATION_T" (" - CFS_TIME_T")\n", time_to_next_wake, - cfs_time_add(this_ping, - cfs_time_seconds(PING_INTERVAL))); + CDEBUG(D_INFO, "next wakeup in "CFS_DURATION_T" (%ld)\n", + time_to_next_wake, cfs_time_add(this_ping, + cfs_time_seconds(PING_INTERVAL))); if (time_to_next_wake > 0) { lwi = LWI_TIMEOUT(max_t(long, time_to_next_wake, cfs_time_seconds(1)), diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c index 56dab9db4157..c18b71c71181 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c @@ -145,7 +145,7 @@ int sptlrpc_proc_enc_pool_seq_show(struct seq_file *m, void *v) "cache missing: %lu\n" "low free mark: %lu\n" "max waitqueue depth: %u\n" - "max wait time: " CFS_TIME_T "/%u\n", + "max wait time: %ld/%u\n", totalram_pages, PAGES_PER_POOL, page_pools.epp_max_pages, @@ -768,8 +768,7 @@ void sptlrpc_enc_pool_fini(void) if (page_pools.epp_st_access > 0) { CDEBUG(D_SEC, - "max pages %lu, grows %u, grow fails %u, shrinks %u, access %lu, missing %lu, max qlen %u, max wait " - CFS_TIME_T"/%d\n", + "max pages %lu, grows %u, grow fails %u, shrinks %u, access %lu, missing %lu, max qlen %u, max wait %ld/%d\n", page_pools.epp_st_max_pages, page_pools.epp_st_grows, page_pools.epp_st_grow_fails, page_pools.epp_st_shrinks, page_pools.epp_st_access, -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 31/37] staging/lustre: use 64-bit times for ptlrpc_sec
Here we use an unsigned long to store the timeout for gc, which is probably safe until 2106, but this patch converts it to use ktime_get_real_seconds() and time64_t for consistency. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/include/lustre_sec.h | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 6 +++--- drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_sec.h b/drivers/staging/lustre/lustre/include/lustre_sec.h index 707ff69717c6..871185cd52b3 100644 --- a/drivers/staging/lustre/lustre/include/lustre_sec.h +++ b/drivers/staging/lustre/lustre/include/lustre_sec.h @@ -833,7 +833,7 @@ struct ptlrpc_sec { */ struct list_head ps_gc_list; unsigned long ps_gc_interval; /* in seconds */ - unsigned long ps_gc_next; /* in seconds */ + time64_t ps_gc_next; /* in seconds */ }; static inline int sec_is_reverse(struct ptlrpc_sec *sec) diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c index cdad608bdb8d..c3ad1dabced8 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c @@ -69,7 +69,7 @@ void sptlrpc_gc_add_sec(struct ptlrpc_sec *sec) LASSERT(sec->ps_gc_interval > 0); LASSERT(list_empty(&sec->ps_gc_list)); - sec->ps_gc_next = get_seconds() + sec->ps_gc_interval; + sec->ps_gc_next = ktime_get_real_seconds() + sec->ps_gc_interval; spin_lock(&sec_gc_list_lock); list_add_tail(&sec_gc_list, &sec->ps_gc_list); @@ -154,11 +154,11 @@ static void sec_do_gc(struct ptlrpc_sec *sec) CDEBUG(D_SEC, "check on sec %p(%s)\n", sec, sec->ps_policy->sp_name); - if (cfs_time_after(sec->ps_gc_next, get_seconds())) + if (sec->ps_gc_next > ktime_get_real_seconds()) return; sec->ps_policy->sp_cops->gc_ctx(sec); - sec->ps_gc_next = get_seconds() + sec->ps_gc_interval; + sec->ps_gc_next = ktime_get_real_seconds() + sec->ps_gc_interval; } static int sec_gc_main(void *arg) diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c index 68fcac14b3ee..a74e2f01e5be 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c @@ -98,9 +98,9 @@ static int sptlrpc_info_lprocfs_seq_show(struct seq_file *seq, void *v) atomic_read(&sec->ps_refcount)); seq_printf(seq, "nctx:%d\n", atomic_read(&sec->ps_nctx)); seq_printf(seq, "gc internal%ld\n", sec->ps_gc_interval); - seq_printf(seq, "gc next%ld\n", + seq_printf(seq, "gc next%lld\n", sec->ps_gc_interval ? - sec->ps_gc_next - get_seconds() : 0); + (s64)(sec->ps_gc_next - ktime_get_real_seconds()) : 0ll); sptlrpc_sec_put(sec); out: -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/37] staging/lustre: use 64-bit times in debug print
This adapts the format string and get_seconds() call to not overflow in 2038 in the libcfs_debug_dumplog_internal() function. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/libcfs/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c index e93f556fac0d..ae325f750eeb 100644 --- a/drivers/staging/lustre/lustre/libcfs/debug.c +++ b/drivers/staging/lustre/lustre/libcfs/debug.c @@ -452,8 +452,8 @@ void libcfs_debug_dumplog_internal(void *arg) if (strncmp(libcfs_debug_file_path_arr, "NONE", 4) != 0) { snprintf(debug_file_name, sizeof(debug_file_name) - 1, -"%s.%ld.%ld", libcfs_debug_file_path_arr, -get_seconds(), (long_ptr_t)arg); +"%s.%lld.%ld", libcfs_debug_file_path_arr, +(s64)ktime_get_real_seconds(), (long_ptr_t)arg); pr_alert("LustreError: dumping log to %s\n", debug_file_name); cfs_tracefile_dump_all_pages(debug_file_name); -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/37] staging/lustre: use 64-bit computation in s2dhms()
The s2dhms computes the day/hour/minute/second values from a time_t, which stops working in 2038. This changes the code to take a time64_t argument, and use div_u64_rem() to implement the first division. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/include/lprocfs_status.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 213666b03f7c..36c0690361fb 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -359,10 +359,10 @@ struct obd_histogram; struct dhms { int d, h, m, s; }; -static inline void s2dhms(struct dhms *ts, time_t secs) +static inline void s2dhms(struct dhms *ts, time64_t secs64) { - ts->d = secs / 86400; - secs = secs % 86400; + unsigned int secs; + ts->d = div_u64_rem(secs64, 86400, &secs); ts->h = secs / 3600; secs = secs % 3600; ts->m = secs / 60; -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/37] staging/lustre: use jiffies for lp_last_query times
The recently introduced lnet_peer_set_alive() function uses get_seconds() to read the current time into a shared variable, but all other uses of that variable compare it to jiffies values. This changes the current use to jiffies as well for consistency. This likely changes behavior, and should be reviewed by the folks that reviewed the original patch that introduced the unusual behavior and was itself a bug fix. Signed-off-by: Arnd Bergmann Fixes: af3fa7c71bf ("staging/lustre/lnet: peer aliveness status and NI status") Cc: Liang Zhen Cc: James Simmons Cc: Isaac Huang Cc: Oleg Drokin --- drivers/staging/lustre/include/linux/lnet/lib-lnet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 22d54b209528..b61d5045a566 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -680,7 +680,7 @@ void lnet_debug_peer(lnet_nid_t nid); static inline void lnet_peer_set_alive(lnet_peer_t *lp) { - lp->lp_last_alive = lp->lp_last_query = get_seconds(); + lp->lp_last_alive = lp->lp_last_query = jiffies; if (!lp->lp_alive) lnet_notify_locked(lp, 0, 1, lp->lp_last_alive); } -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/37] staging/lustre: tracefile: use 64-bit seconds
The lustre tracefile has a timestamp defined as __u32 ph_sec; __u64 ph_usec; which seems completely backwards, as the microsecond portion of a time stamp will always fit into a __u32 value, while the second portion will overflow in 2038 or 2106 (in case of unsigned seconds). This rectifies the situation by swapping out the types to have 64-bit seconds like everything else. While this constitutes an ABI change, it seems to be reasonable for a debugging interface to change and is likely what was originally intended. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h | 4 ++-- drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c | 8 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index a3aa644154e2..dfb81022397d 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -73,8 +73,8 @@ struct ptldebug_header { __u32 ph_mask; __u16 ph_cpu_id; __u16 ph_type; - __u32 ph_sec; - __u64 ph_usec; + __u64 ph_sec; + __u32 ph_nsec; __u32 ph_stack; __u32 ph_pid; __u32 ph_extern_pid; diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c index 87d844953522..fad272d559c4 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c @@ -191,16 +191,16 @@ cfs_set_ptldebug_header(struct ptldebug_header *header, struct libcfs_debug_msg_data *msgdata, unsigned long stack) { - struct timeval tv; + struct timespec64 ts; - do_gettimeofday(&tv); + ktime_get_real_ts64(&ts); header->ph_subsys = msgdata->msg_subsys; header->ph_mask = msgdata->msg_mask; header->ph_cpu_id = smp_processor_id(); header->ph_type = cfs_trace_buf_idx_get(); - header->ph_sec = (__u32)tv.tv_sec; - header->ph_usec = tv.tv_usec; + header->ph_sec = ts.tv_sec; + header->ph_nsec = ts.tv_nsec; header->ph_stack = stack; header->ph_pid = current->pid; header->ph_line_num = msgdata->msg_line; -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 36/37] staging/lustre: remove unused time handling functions
A bunch of API functions deal with time values but are now completely unused in lustre. This removes them in order to remove all references to time_t from the header files. Signed-off-by: Arnd Bergmann --- .../lustre/include/linux/libcfs/libcfs_time.h | 49 -- .../lustre/include/linux/libcfs/linux/linux-time.h | 17 2 files changed, 66 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h index 5de6da085712..2c7ec2d28f38 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h @@ -68,55 +68,6 @@ static inline unsigned long cfs_time_shift(int seconds) return cfs_time_add(cfs_time_current(), cfs_time_seconds(seconds)); } -static inline long cfs_timeval_sub(struct timeval *large, struct timeval *small, - struct timeval *result) -{ - long r = (long)( - (large->tv_sec - small->tv_sec) * ONE_MILLION + - (large->tv_usec - small->tv_usec)); - if (result != NULL) { - result->tv_usec = r % ONE_MILLION; - result->tv_sec = r / ONE_MILLION; - } - return r; -} - -static inline void cfs_slow_warning(unsigned long now, int seconds, char *msg) -{ - if (cfs_time_after(cfs_time_current(), - cfs_time_add(now, cfs_time_seconds(15 - CERROR("slow %s "CFS_TIME_T" sec\n", msg, - cfs_duration_sec(cfs_time_sub(cfs_time_current(), now))); -} - -#define CFS_RATELIMIT(seconds) \ -({ \ - /*\ -* XXX nikita: non-portable initializer \ -*/ \ - static time_t __next_message; \ - int result; \ - \ - if (cfs_time_after(cfs_time_current(), __next_message)) \ - result = 1; \ - else {\ - __next_message = cfs_time_shift(seconds); \ - result = 0; \ - } \ - result; \ -}) - -/* - * helper function similar to do_gettimeofday() of Linux kernel - */ -static inline void cfs_fs_timeval(struct timeval *tv) -{ - struct timespec time; - - cfs_fs_time_current(&time); - cfs_fs_time_usec(&time, tv); -} - /* * return valid time-out based on user supplied one. Currently we only check * that time-out is not shorted than allowed. diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h index f193f8bdee6e..09c59f080ca3 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h @@ -59,13 +59,6 @@ #include - -static inline void cfs_fs_time_usec(struct timespec *t, struct timeval *v) -{ - v->tv_sec = t->tv_sec; - v->tv_usec = t->tv_nsec / 1000; -} - /* * Generic kernel stuff */ @@ -75,16 +68,6 @@ static inline unsigned long cfs_time_current(void) return jiffies; } -static inline void cfs_fs_time_current(struct timespec *t) -{ - *t = CURRENT_TIME; -} - -static inline time_t cfs_fs_time_sec(struct timespec *t) -{ - return t->tv_sec; -} - static inline long cfs_time_seconds(int seconds) { return ((long)seconds) * HZ; -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 35/37] staging/lustre: remove wrappers for timer functions
This is a simple cleanup that I did after noticing that the abstraction for the timer functions in completely pointless, and the one user (ptlrpc) can just as well call the native Linux functions. For good measure, this also removes the empty libcfs_arch_init() and libcfs_arch_cleanup() functions that are defined in the same file. Signed-off-by: Arnd Bergmann --- .../staging/lustre/include/linux/libcfs/libcfs.h | 3 - .../lustre/include/linux/libcfs/libcfs_prim.h | 12 .../lustre/lustre/libcfs/linux/linux-prim.c| 64 -- drivers/staging/lustre/lustre/libcfs/module.c | 3 - drivers/staging/lustre/lustre/ptlrpc/service.c | 11 ++-- 5 files changed, 6 insertions(+), 87 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 259a33658d3f..385ced15c742 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -62,9 +62,6 @@ static inline int __is_po2(unsigned long long val) #include -int libcfs_arch_init(void); -void libcfs_arch_cleanup(void); - /* need both kernel and user-land acceptor */ #define LNET_ACCEPTOR_MIN_RESERVED_PORT512 #define LNET_ACCEPTOR_MAX_RESERVED_PORT1023 diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h index 62ade0809264..082fe6de90e4 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h @@ -40,20 +40,8 @@ #ifndef __LIBCFS_PRIM_H__ #define __LIBCFS_PRIM_H__ -/* - * Timer - */ -typedef void (cfs_timer_func_t)(ulong_ptr_t); - void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *); -void cfs_init_timer(struct timer_list *t); -void cfs_timer_init(struct timer_list *t, cfs_timer_func_t *func, void *arg); -void cfs_timer_arm(struct timer_list *t, unsigned long deadline); -void cfs_timer_disarm(struct timer_list *t); -int cfs_timer_is_armed(struct timer_list *t); -unsigned long cfs_timer_deadline(struct timer_list *t); - /* * Memory */ diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c index 12b6af4cac3e..89084460231a 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c @@ -70,55 +70,6 @@ add_wait_queue_exclusive_head(wait_queue_head_t *waitq, wait_queue_t *link) } EXPORT_SYMBOL(add_wait_queue_exclusive_head); -void cfs_init_timer(struct timer_list *t) -{ - init_timer(t); -} -EXPORT_SYMBOL(cfs_init_timer); - -void cfs_timer_init(struct timer_list *t, cfs_timer_func_t *func, void *arg) -{ - init_timer(t); - t->function = func; - t->data = (unsigned long)arg; -} -EXPORT_SYMBOL(cfs_timer_init); - -void cfs_timer_arm(struct timer_list *t, unsigned long deadline) -{ - mod_timer(t, deadline); -} -EXPORT_SYMBOL(cfs_timer_arm); - -void cfs_timer_disarm(struct timer_list *t) -{ - del_timer(t); -} -EXPORT_SYMBOL(cfs_timer_disarm); - -int cfs_timer_is_armed(struct timer_list *t) -{ - return timer_pending(t); -} -EXPORT_SYMBOL(cfs_timer_is_armed); - -unsigned long cfs_timer_deadline(struct timer_list *t) -{ - return t->expires; -} -EXPORT_SYMBOL(cfs_timer_deadline); - -void cfs_enter_debugger(void) -{ -#if defined(CONFIG_KGDB) - /* BREAKPOINT(); */ -#else - /* nothing */ -#endif -} -EXPORT_SYMBOL(cfs_enter_debugger); - - sigset_t cfs_block_allsigs(void) { @@ -194,18 +145,3 @@ cfs_clear_sigpending(void) spin_unlock_irqrestore(¤t->sighand->siglock, flags); } EXPORT_SYMBOL(cfs_clear_sigpending); - -int -libcfs_arch_init(void) -{ - return 0; -} -EXPORT_SYMBOL(libcfs_arch_init); - -void -libcfs_arch_cleanup(void) -{ - return; -} -EXPORT_SYMBOL(libcfs_arch_cleanup); - diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c index a19f5796b642..5e4262a2e6f3 100644 --- a/drivers/staging/lustre/lustre/libcfs/module.c +++ b/drivers/staging/lustre/lustre/libcfs/module.c @@ -701,7 +701,6 @@ static int init_libcfs_module(void) { int rc; - libcfs_arch_init(); libcfs_init_nidstrings(); rc = libcfs_debug_init(5 * 1024 * 1024); @@ -777,8 +776,6 @@ static void exit_libcfs_module(void) rc = libcfs_debug_cleanup(); if (rc) pr_err("LustreError: libcfs_debug_cleanup: %d\n", rc); - - libcfs_arch_cleanup(); } MODULE_VERSION("1.0.0"); diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index 3fac9756dcc0..623871beb5aa 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -649,7 +649,8 @@ ptlrpc_service_part_init(struct ptlrpc_service
[PATCH 32/37] staging/lustre: use 64-bit times for exp_last_request_time
The last request time is stored as an 'unsigned long', which is good enough until 2106, but it is then converted to 'long' in some places, which overflows in 2038. This changes the type to time64_t to avoid those problems. Signed-off-by: Arnd Bergmann --- .../staging/lustre/lustre/include/lustre_export.h | 5 ++--- drivers/staging/lustre/lustre/obdclass/genops.c| 6 +++--- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 22 +++--- drivers/staging/lustre/lustre/ptlrpc/service.c | 10 +- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h index e02a39a721d6..b06ee9ff22ae 100644 --- a/drivers/staging/lustre/lustre/include/lustre_export.h +++ b/drivers/staging/lustre/lustre/include/lustre_export.h @@ -180,7 +180,7 @@ struct obd_export { /** Last committed transno for this export */ __u64exp_last_committed; /** When was last request received */ - unsigned long exp_last_request_time; + time64_texp_last_request_time; /** On replay all requests waiting for replay are linked here */ struct list_headexp_req_replay_queue; /** @@ -268,8 +268,7 @@ static inline int exp_connect_multibulk(struct obd_export *exp) static inline int exp_expired(struct obd_export *exp, long age) { LASSERT(exp->exp_delayed); - return time_before(cfs_time_add(exp->exp_last_request_time, age), - get_seconds()); + return exp->exp_last_request_time + age < ktime_get_real_seconds(); } static inline int exp_connect_cancelset(struct obd_export *exp) diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index 594955d359ec..a27932502f2a 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -846,7 +846,7 @@ struct obd_export *class_new_export(struct obd_device *obd, INIT_LIST_HEAD(&export->exp_handle.h_link); INIT_LIST_HEAD(&export->exp_hp_rpcs); class_handle_hash(&export->exp_handle, &export_handle_ops); - export->exp_last_request_time = get_seconds(); + export->exp_last_request_time = ktime_get_real_seconds(); spin_lock_init(&export->exp_lock); spin_lock_init(&export->exp_rpc_lock); INIT_HLIST_NODE(&export->exp_uuid_hash); @@ -1266,9 +1266,9 @@ static void class_disconnect_export_list(struct list_head *list, } class_export_get(exp); - CDEBUG(D_HA, "%s: disconnecting export at %s (%p), last request at " CFS_TIME_T "\n", + CDEBUG(D_HA, "%s: disconnecting export at %s (%p), last request at %lld\n", exp->exp_obd->obd_name, obd_export_nid2str(exp), - exp, exp->exp_last_request_time); + exp, (s64)exp->exp_last_request_time); /* release one export reference anyway */ rc = obd_disconnect(exp); diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index 6cd4cfa58c27..76eecb02d1fc 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -572,7 +572,7 @@ static int ping_evictor_main(void *arg) struct obd_device *obd; struct obd_export *exp; struct l_wait_info lwi = { 0 }; - time_t expire_time; + time64_t expire_time; unshare_fs_struct(); @@ -594,10 +594,10 @@ static int ping_evictor_main(void *arg) obd_evict_list); spin_unlock(&pet_lock); - expire_time = get_seconds() - PING_EVICT_TIMEOUT; + expire_time = ktime_get_real_seconds() - PING_EVICT_TIMEOUT; - CDEBUG(D_HA, "evicting all exports of obd %s older than %ld\n", - obd->obd_name, expire_time); + CDEBUG(D_HA, "evicting all exports of obd %s older than %lld\n", + obd->obd_name, (s64)expire_time); /* Exports can't be deleted out of the list while we hold * the obd lock (class_unlink_export), which means we can't @@ -611,17 +611,17 @@ static int ping_evictor_main(void *arg) if (expire_time > exp->exp_last_request_time) { class_export_get(exp); spin_unlock(&obd->obd_dev_lock); - LCONSOLE_WARN("%s: haven't heard from client %s (at %s) in %ld seconds. I think it's dead, and I am evicting it. exp %p, cur %ld expire %ld last %ld\n", + LCONSOLE_WARN("%s: haven't heard from client %s (at %s) in %ld seconds. I think it's dead, and I am evicting it. exp %p, cu
[PATCH 28/37] staging/lustre: use 64-bit times in another debug print
The ll_setattr_raw() function prints the new inode timestamps along with the current time using '%lu', which overflows in 2106. This changes the printing of the current time for now, the other two will change when we migrate the VFS code to use 64-bit timestamps. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/llite/llite_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 8dc3de11bb74..524fcc9fc188 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -1324,9 +1324,9 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import) } if (attr->ia_valid & (ATTR_MTIME | ATTR_CTIME)) - CDEBUG(D_INODE, "setting mtime %lu, ctime %lu, now = %lu\n", + CDEBUG(D_INODE, "setting mtime %lu, ctime %lu, now = %llu\n", LTIME_S(attr->ia_mtime), LTIME_S(attr->ia_ctime), - get_seconds()); + (s64)ktime_get_real_seconds()); /* If we are changing file size, file content is modified, flag it. */ if (attr->ia_valid & ATTR_SIZE) { -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/37] staging/lustre: use ktime_t for calculating elapsed time
process_param2_config() tries to print how much time has passed across a call_usermodehelper() function, and uses struct timeval for that. We want to remove this structure, so this is better expressed in terms of ktime_t and ktime_us_delta(). Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/obdclass/obd_config.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index b86a47c54029..3bbc80623b3a 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -1021,8 +1021,8 @@ static int process_param2_config(struct lustre_cfg *lcfg) [2] = param, [3] = NULL }; - struct timeval start; - struct timeval end; + ktime_t start; + ktime_t end; int rc; @@ -1032,19 +1032,19 @@ static int process_param2_config(struct lustre_cfg *lcfg) return -EINVAL; } - do_gettimeofday(&start); + start = ktime_get(); rc = call_usermodehelper(argv[0], argv, NULL, 1); - do_gettimeofday(&end); + end = ktime_get(); if (rc < 0) { CERROR( "lctl: error invoking upcall %s %s %s: rc = %d; time %ldus\n", argv[0], argv[1], argv[2], rc, - cfs_timeval_sub(&end, &start, NULL)); + (long)ktime_us_delta(end, start)); } else { CDEBUG(D_HA, "lctl: invoked upcall %s %s %s, time %ldus\n", argv[0], argv[1], argv[2], - cfs_timeval_sub(&end, &start, NULL)); + (long)ktime_us_delta(end, start)); rc = 0; } -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 26/37] staging/lustre: use 64-bit times in ptlrpc_enc_page_pool
ptlrpc_enc_page_pool computes time deltas using 'long' values from get_seconds(). This is probably safe beyond y2038, but it's better to go use monotonic times and 64-bit here for consistency. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c index 2ee3e8b2e879..56dab9db4157 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c @@ -92,8 +92,8 @@ static struct ptlrpc_enc_page_pool { unsigned longepp_idle_idx; /* last shrink time due to mem tight */ - long epp_last_shrink; - long epp_last_access; + time64_t epp_last_shrink; + time64_t epp_last_access; /* * in-pool pages bookkeeping @@ -153,8 +153,8 @@ int sptlrpc_proc_enc_pool_seq_show(struct seq_file *m, void *v) page_pools.epp_total_pages, page_pools.epp_free_pages, page_pools.epp_idle_idx, - get_seconds() - page_pools.epp_last_shrink, - get_seconds() - page_pools.epp_last_access, + (long)(ktime_get_seconds() - page_pools.epp_last_shrink), + (long)(ktime_get_seconds() - page_pools.epp_last_access), page_pools.epp_st_max_pages, page_pools.epp_st_grows, page_pools.epp_st_grow_fails, @@ -226,7 +226,7 @@ static unsigned long enc_pools_shrink_count(struct shrinker *s, * if no pool access for a long time, we consider it's fully idle. * a little race here is fine. */ - if (unlikely(get_seconds() - page_pools.epp_last_access > + if (unlikely(ktime_get_seconds() - page_pools.epp_last_access > CACHE_QUIESCENT_PERIOD)) { spin_lock(&page_pools.epp_lock); page_pools.epp_idle_idx = IDLE_IDX_MAX; @@ -253,7 +253,7 @@ static unsigned long enc_pools_shrink_scan(struct shrinker *s, (long)sc->nr_to_scan, page_pools.epp_free_pages); page_pools.epp_st_shrinks++; - page_pools.epp_last_shrink = get_seconds(); + page_pools.epp_last_shrink = ktime_get_seconds(); } spin_unlock(&page_pools.epp_lock); @@ -261,7 +261,7 @@ static unsigned long enc_pools_shrink_scan(struct shrinker *s, * if no pool access for a long time, we consider it's fully idle. * a little race here is fine. */ - if (unlikely(get_seconds() - page_pools.epp_last_access > + if (unlikely(ktime_get_seconds() - page_pools.epp_last_access > CACHE_QUIESCENT_PERIOD)) { spin_lock(&page_pools.epp_lock); page_pools.epp_idle_idx = IDLE_IDX_MAX; @@ -457,7 +457,7 @@ static inline void enc_pools_wakeup(void) } } -static int enc_pools_should_grow(int page_needed, long now) +static int enc_pools_should_grow(int page_needed, time64_t now) { /* don't grow if someone else is growing the pools right now, * or the pools has reached its full capacity @@ -521,7 +521,7 @@ again: if (tick == 0) tick = cfs_time_current(); - now = get_seconds(); + now = ktime_get_seconds(); page_pools.epp_st_missings++; page_pools.epp_pages_short += desc->bd_iov_count; @@ -600,7 +600,7 @@ again: this_idle) / (IDLE_IDX_WEIGHT + 1); - page_pools.epp_last_access = get_seconds(); + page_pools.epp_last_access = ktime_get_seconds(); spin_unlock(&page_pools.epp_lock); return 0; @@ -725,8 +725,8 @@ int sptlrpc_enc_pool_init(void) page_pools.epp_growing = 0; page_pools.epp_idle_idx = 0; - page_pools.epp_last_shrink = get_seconds(); - page_pools.epp_last_access = get_seconds(); + page_pools.epp_last_shrink = ktime_get_seconds(); + page_pools.epp_last_access = ktime_get_seconds(); spin_lock_init(&page_pools.epp_lock); page_pools.epp_total_pages = 0; -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/37] staging/lustre: use 64-bit timestamps for selftest
The wire protocol for the ping uses a 64-bit seconds/microseconds pair, but this won't work when one side uses a 32-bit timeval to look up the current time beyond 2038. This changes the code to use ktime_get_real_ts64() to create a timestamp that has the right format on all machines. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lnet/selftest/ping_test.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c index 1dab9984c58e..3a342fded1ba 100644 --- a/drivers/staging/lustre/lnet/selftest/ping_test.c +++ b/drivers/staging/lustre/lnet/selftest/ping_test.c @@ -92,7 +92,7 @@ ping_client_prep_rpc(sfw_test_unit_t *tsu, srpc_ping_reqst_t *req; sfw_test_instance_t *tsi = tsu->tsu_instance; sfw_session_t *sn = tsi->tsi_batch->bat_session; - struct timeval tv; + struct timespec64 ts; int rc; LASSERT(sn != NULL); @@ -110,9 +110,9 @@ ping_client_prep_rpc(sfw_test_unit_t *tsu, req->pnr_seq = lst_ping_data.pnd_counter++; spin_unlock(&lst_ping_data.pnd_lock); - cfs_fs_timeval(&tv); - req->pnr_time_sec = tv.tv_sec; - req->pnr_time_usec = tv.tv_usec; + ktime_get_real_ts64(&ts); + req->pnr_time_sec = ts.tv_sec; + req->pnr_time_usec = ts.tv_nsec / NSEC_PER_USEC; return rc; } @@ -124,7 +124,7 @@ ping_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc) sfw_session_t *sn = tsi->tsi_batch->bat_session; srpc_ping_reqst_t *reqst = &rpc->crpc_reqstmsg.msg_body.ping_reqst; srpc_ping_reply_t *reply = &rpc->crpc_replymsg.msg_body.ping_reply; - struct timeval tv; + struct timespec64 ts; LASSERT(sn != NULL); @@ -161,10 +161,10 @@ ping_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc) return; } - cfs_fs_timeval(&tv); + ktime_get_real_ts64(&ts); CDEBUG(D_NET, "%d reply in %u usec\n", reply->pnr_seq, - (unsigned)((tv.tv_sec - (unsigned)reqst->pnr_time_sec) * 100 - + (tv.tv_usec - reqst->pnr_time_usec))); + (unsigned)((ts.tv_sec - reqst->pnr_time_sec) * 100 + + (ts.tv_nsec / NSEC_PER_USEC - reqst->pnr_time_usec))); return; } -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/37] staging/lustre: use 64-bit time for obd eviction
The obd_eviction_timer will overflow in 2038 on 32-bit systems, so replace it with a 64-bit time and ktime_get_real_seconds(). Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/include/obd.h| 2 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index 0dbac3f53f01..f09a0405ff97 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -841,7 +841,7 @@ struct obd_device { struct obd_export *obd_self_export; /* list of exports in LRU order, for ping evictor, with obd_dev_lock */ struct list_head obd_exports_timed; - time_tobd_eviction_timer; /* for ping evictor */ + time64_t obd_eviction_timer; /* for ping evictor */ int obd_max_recoverable_clients; atomic_t obd_connected_clients; diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index 40de622450ee..c7c6cff80450 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -1085,13 +1085,13 @@ static void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay) * other PING_INTERVAL (see note in ptlrpc_pinger_main), * we better wait for 3. */ exp->exp_obd->obd_eviction_timer = - get_seconds() + 3 * PING_INTERVAL; + ktime_get_real_seconds() + 3 * PING_INTERVAL; CDEBUG(D_HA, "%s: Think about evicting %s from "CFS_TIME_T"\n", exp->exp_obd->obd_name, obd_export_nid2str(oldest_exp), oldest_time); } } else { - if (get_seconds() > + if (ktime_get_real_seconds() > (exp->exp_obd->obd_eviction_timer + extra_delay)) { /* The evictor won't evict anyone who we've heard from * recently, so we don't have to check before we start -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/37] staging/lustre: use 64-bit time for ni_last_alive
The ni_last_alive member of lnet_ni uses a 'long' to store a timestamp, which breaks on 32-bit systems in 2038. This changes it to use time64_t and the respective functions for it. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/include/linux/lnet/lib-types.h | 2 +- drivers/staging/lustre/lnet/lnet/config.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-move.c | 4 ++-- drivers/staging/lustre/lnet/lnet/router.c | 4 ++-- drivers/staging/lustre/lnet/lnet/router_proc.c| 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index 81a63dbdea25..d792c4adb0ca 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -264,7 +264,7 @@ typedef struct lnet_ni { lnd_t*ni_lnd; /* procedural interface */ struct lnet_tx_queue**ni_tx_queues; /* percpt TX queues */ int **ni_refs; /* percpt reference count */ - long ni_last_alive;/* when I was last alive */ + time64_t ni_last_alive;/* when I was last alive */ lnet_ni_status_t *ni_status;/* my health status */ /* equivalent interfaces to use */ char *ni_interfaces[LNET_MAX_INTERFACES]; diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 9c576ce2f455..b09a438c49d6 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -166,7 +166,7 @@ lnet_ni_alloc(__u32 net, struct cfs_expr_list *el, struct list_head *nilist) /* LND will fill in the address part of the NID */ ni->ni_nid = LNET_MKNID(net, 0); - ni->ni_last_alive = get_seconds(); + ni->ni_last_alive = ktime_get_real_seconds(); list_add_tail(&ni->ni_list, nilist); return ni; failed: diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 433faae9a2ff..6badfec4c6a0 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -1768,11 +1768,11 @@ lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t from_nid, } if (the_lnet.ln_routing && - ni->ni_last_alive != get_seconds()) { + ni->ni_last_alive != ktime_get_real_seconds()) { lnet_ni_lock(ni); /* NB: so far here is the only place to set NI status to "up */ - ni->ni_last_alive = get_seconds(); + ni->ni_last_alive = ktime_get_real_seconds(); if (ni->ni_status != NULL && ni->ni_status->ns_status == LNET_NI_STATUS_DOWN) ni->ni_status->ns_status = LNET_NI_STATUS_UP; diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 2cdda3f0067e..0357b051401f 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -789,7 +789,7 @@ static void lnet_update_ni_status_locked(void) { lnet_ni_t *ni; - long now; + time64_t now; int timeout; LASSERT(the_lnet.ln_routing); @@ -797,7 +797,7 @@ lnet_update_ni_status_locked(void) timeout = router_ping_timeout + max(live_router_check_interval, dead_router_check_interval); - now = get_seconds(); + now = ktime_get_real_seconds(); list_for_each_entry(ni, &the_lnet.ln_nis, ni_list) { if (ni->ni_lnd->lnd_type == LOLND) continue; diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c index a9f4cbf2fcfe..396c7c4e5c83 100644 --- a/drivers/staging/lustre/lnet/lnet/router_proc.c +++ b/drivers/staging/lustre/lnet/lnet/router_proc.c @@ -692,7 +692,7 @@ static int proc_lnet_nis(struct ctl_table *table, int write, if (ni != NULL) { struct lnet_tx_queue *tq; char *stat; - long now = get_seconds(); + time64_t now = ktime_get_real_seconds(); int last_alive = -1; int i; int j; -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/37] staging/lustre: avoid unnecessary timeval conversion
The lnet_eq_wait_locked tries to wait for time to pass or an event to wake up the wait queue. The entire logic seems to be a very elaborate reimplementation of wait_event(). I'm not trying to clean up the entire logic here, but this at least gets rid of the multi-way conversion between miliseconds, timeval and jiffies. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lnet/lnet/lib-eq.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/lib-eq.c b/drivers/staging/lustre/lnet/lnet/lib-eq.c index f19ce9ae6a9a..8b843c5e71a5 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-eq.c +++ b/drivers/staging/lustre/lnet/lnet/lib-eq.c @@ -341,12 +341,9 @@ __must_hold(&the_lnet.ln_eq_wait_lock) schedule(); } else { - struct timeval tv; - - now = cfs_time_current(); - schedule_timeout(cfs_time_seconds(tms) / 1000); - cfs_duration_usec(cfs_time_sub(cfs_time_current(), now), &tv); - tms -= (int)(tv.tv_sec * 1000 + tv.tv_usec / 1000); + now = jiffies; + schedule_timeout(msecs_to_jiffies(tms)); + tms -= jiffies_to_msecs(jiffies - now); if (tms < 0) /* no more wait but may have new event */ tms = 0; } -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/11] staging: comedi: rtd520: remove unnecessary function desc. block comments
These function description comments are cut-and-paste cruft from the old skeleton driver. Remove them. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rtd520.c | 30 -- 1 file changed, 30 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index 2df8494..7a3df41 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -583,12 +583,6 @@ static int rtd_ai_rinsn(struct comedi_device *dev, return n; } -/* - Get what we know is there Fast! - This uses 1/2 the bus cycles of read_dregs (below). - - The manual claims that we can do a lword read, but it doesn't work here. -*/ static int ai_read_n(struct comedi_device *dev, struct comedi_subdevice *s, int count) { @@ -623,12 +617,6 @@ static int ai_read_n(struct comedi_device *dev, struct comedi_subdevice *s, return 0; } -/* - Handle all rtd520 interrupts. - Runs atomically and is never re-entered. - This is a "slow handler"; other interrupts may be active. - The data conversion may someday happen in a "bottom half". -*/ static irqreturn_t rtd_interrupt(int irq, void *d) { struct comedi_device *dev = d; @@ -708,15 +696,6 @@ xfer_done: return IRQ_HANDLED; } -/* - cmdtest tests a particular command to see if it is valid. - Using the cmdtest ioctl, a user can create a valid cmd - and then have it executed by the cmd ioctl (asynchronously). - - cmdtest returns 1,2,3,4 or 0, depending on which tests - the command passes. -*/ - static int rtd_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_cmd *cmd) { @@ -859,12 +838,6 @@ static int rtd_ai_cmdtest(struct comedi_device *dev, return 0; } -/* - Execute a analog in command with many possible triggering options. - The data get stored in the async structure of the subdevice. - This is usually done by an interrupt handler. - Userland gets to the data using read calls. -*/ static int rtd_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) { struct rtd_private *devpriv = dev->private; @@ -1014,9 +987,6 @@ static int rtd_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) return 0; } -/* - Stop a running data acquisition. -*/ static int rtd_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s) { struct rtd_private *devpriv = dev->private; -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 29/37] staging/lustre: use 64-bit timestamps for mdc
These three are timestamps that are sent over the wire in mdc_lib and the obd logging 64-bit values, but are generated using the 32-bit get_seconds() function, which will eventually overflow. Changing them to use 64-bit ktime_get_real_seconds() solves the problem. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/llog.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 524fcc9fc188..a0ae892872f5 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -2218,7 +2218,7 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data, op_data->op_name = name; op_data->op_namelen = namelen; op_data->op_mode = mode; - op_data->op_mod_time = get_seconds(); + op_data->op_mod_time = ktime_get_real_seconds(); op_data->op_fsuid = from_kuid(&init_user_ns, current_fsuid()); op_data->op_fsgid = from_kgid(&init_user_ns, current_fsgid()); op_data->op_cap = cfs_curproc_cap_pack(); diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index d32ae761c05f..fd6fc10349c3 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -402,7 +402,7 @@ static int mdc_xattr_common(struct obd_export *exp, rec->sx_suppgid2 = -1; rec->sx_fid= *fid; rec->sx_valid = valid | OBD_MD_FLCTIME; - rec->sx_time = get_seconds(); + rec->sx_time = ktime_get_real_seconds(); rec->sx_size = output_size; rec->sx_flags = flags; diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index 78d92269aab6..8cad47080456 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -188,7 +188,7 @@ static int llog_read_header(const struct lu_env *env, llh->llh_hdr.lrh_type = LLOG_HDR_MAGIC; llh->llh_hdr.lrh_len = llh->llh_tail.lrt_len = LLOG_CHUNK_SIZE; llh->llh_hdr.lrh_index = llh->llh_tail.lrt_index = 0; - llh->llh_timestamp = get_seconds(); + llh->llh_timestamp = ktime_get_real_seconds(); if (uuid) memcpy(&llh->llh_tgtuuid, uuid, sizeof(llh->llh_tgtuuid)); -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 30/37] staging/lustre: use 64-bit times for ptlrpc sec expiry
The exp_flvr_expire and imp_sec_expire are defined as 'unsigned long', which doesn't overflow until 2106, but to be on the safe side, this changes the code to use time64_t like we do everywhere else. Signed-off-by: Arnd Bergmann --- .../staging/lustre/lustre/include/lustre_export.h | 2 +- .../staging/lustre/lustre/include/lustre_import.h | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec.c | 28 ++ drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h index 5189fad0b73c..e02a39a721d6 100644 --- a/drivers/staging/lustre/lustre/include/lustre_export.h +++ b/drivers/staging/lustre/lustre/include/lustre_export.h @@ -216,7 +216,7 @@ struct obd_export { enum lustre_sec_part exp_sp_peer; struct sptlrpc_flavor exp_flvr; /* current */ struct sptlrpc_flavor exp_flvr_old[2]; /* about-to-expire */ - unsigned long exp_flvr_expire[2]; /* seconds */ + time64_t exp_flvr_expire[2]; /* seconds */ /** protects exp_hp_rpcs */ spinlock_texp_rpc_lock; diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h index cd6244ecd0c7..3ae97e2ece1c 100644 --- a/drivers/staging/lustre/lustre/include/lustre_import.h +++ b/drivers/staging/lustre/lustre/include/lustre_import.h @@ -200,7 +200,7 @@ struct obd_import { */ struct ptlrpc_sec *imp_sec; struct mutex imp_sec_mutex; - unsigned long imp_sec_expire; + time64_timp_sec_expire; /** @} */ /** Wait queue for those who need to wait for recovery completion */ diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c b/drivers/staging/lustre/lustre/ptlrpc/sec.c index b9821db22904..5ee6641ea023 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c @@ -343,7 +343,7 @@ static int import_sec_check_expire(struct obd_import *imp) spin_lock(&imp->imp_lock); if (imp->imp_sec_expire && - imp->imp_sec_expire < get_seconds()) { + imp->imp_sec_expire < ktime_get_real_seconds()) { adapt = 1; imp->imp_sec_expire = 0; } @@ -1779,7 +1779,7 @@ int sptlrpc_target_export_check(struct obd_export *exp, exp->exp_flvr_old[1] = exp->exp_flvr_old[0]; exp->exp_flvr_expire[1] = exp->exp_flvr_expire[0]; exp->exp_flvr_old[0] = exp->exp_flvr; - exp->exp_flvr_expire[0] = get_seconds() + + exp->exp_flvr_expire[0] = ktime_get_real_seconds() + EXP_FLVR_UPDATE_EXPIRE; exp->exp_flvr = flavor; @@ -1853,14 +1853,14 @@ int sptlrpc_target_export_check(struct obd_export *exp, } if (exp->exp_flvr_expire[0]) { - if (exp->exp_flvr_expire[0] >= get_seconds()) { + if (exp->exp_flvr_expire[0] >= ktime_get_real_seconds()) { if (flavor_allowed(&exp->exp_flvr_old[0], req)) { - CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the middle one (" CFS_DURATION_T ")\n", exp, + CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the middle one (%lld)\n", exp, exp->exp_flvr.sf_rpc, exp->exp_flvr_old[0].sf_rpc, exp->exp_flvr_old[1].sf_rpc, - exp->exp_flvr_expire[0] - - get_seconds()); + (s64)(exp->exp_flvr_expire[0] - + ktime_get_real_seconds())); spin_unlock(&exp->exp_lock); return 0; } @@ -1877,15 +1877,15 @@ int sptlrpc_target_export_check(struct obd_export *exp, /* now it doesn't match the current flavor, the only chance we can * accept it is match the old flavors which is not expired. */ if (exp->exp_flvr_changed == 0 && exp->exp_flvr_expire[1]) { - if (exp->exp_flvr_expire[1] >= get_seconds()) { + if (exp->exp_flvr_expire[1] >= ktime_get_real_seconds()) { if (flavor_allowed(&exp->exp_flvr_old[1], req)) { - CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the oldest one (" CFS_DURATION_T ")\n", + CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the oldest one (%lld)\n", exp, exp->exp_flvr.sf_rpc,
[PATCH 33/37] staging/lustre: use 64-bit times for request times
All request timestamps and deadlines in lustre are recorded in time_t and timeval units, which overflow in 2038 on 32-bit systems. In this patch, I'm converting them to time64_t and timespec64, respectively. Unfortunately, this makes a relatively large patch, but I could not find an obvious way to split it up some more without breaking atomicity of the change. Also unfortunately, this introduces two instances of div_u64_rem() in the request path, which can be slow on 32-bit architectures. This can probably be avoided by a larger restructuring of the code, but it is unlikely that lustre is used in performance critical setups on 32-bit architectures, so it seems better to optimize for correctness rather than speed here. Signed-off-by: Arnd Bergmann --- .../staging/lustre/lustre/include/lustre_import.h | 2 +- drivers/staging/lustre/lustre/include/lustre_net.h | 22 ++--- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c| 4 +- drivers/staging/lustre/lustre/ptlrpc/client.c | 48 - drivers/staging/lustre/lustre/ptlrpc/events.c | 6 +- drivers/staging/lustre/lustre/ptlrpc/import.c | 4 +- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c| 8 +- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 10 +- .../staging/lustre/lustre/ptlrpc/pack_generic.c| 6 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 110 +++-- 12 files changed, 113 insertions(+), 111 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h index 3ae97e2ece1c..079db528ba74 100644 --- a/drivers/staging/lustre/lustre/include/lustre_import.h +++ b/drivers/staging/lustre/lustre/include/lustre_import.h @@ -74,7 +74,7 @@ struct ptlrpc_at_array { struct list_head *paa_reqs_array; /** array to hold requests */ __u32paa_size; /** the size of array */ __u32paa_count; /** the total count of reqs */ - time_t paa_deadline; /** the earliest deadline of reqs */ + time64_t paa_deadline; /** the earliest deadline of reqs */ __u32 *paa_reqs_count; /** the count of reqs in each entry */ }; diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index 44adee134563..0db7810f7d6f 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -1440,7 +1440,7 @@ struct ptlrpc_request { /* server-side... */ /** request arrival time */ - struct timeval rq_arrival_time; + struct timespec64 rq_arrival_time; /** separated reply state */ struct ptlrpc_reply_state *rq_reply_state; /** incoming request buffer */ @@ -1477,18 +1477,18 @@ struct ptlrpc_request { /** * when request/reply sent (secs), or time when request should be sent */ - time_t rq_sent; + time64_t rq_sent; /** time for request really sent out */ - time_t rq_real_sent; + time64_t rq_real_sent; /** when request must finish. volatile * so that servers' early reply updates to the deadline aren't * kept in per-cpu cache */ - volatile time_t rq_deadline; + volatile time64_t rq_deadline; /** when req reply unlink must finish. */ - time_t rq_reply_deadline; + time64_t rq_reply_deadline; /** when req bulk unlink must finish. */ - time_t rq_bulk_deadline; + time64_t rq_bulk_deadline; /** * service time estimate (secs) * If the requestsis not served by this time, it is marked as timed out. @@ -2323,7 +2323,7 @@ static inline int ptlrpc_client_bulk_active(struct ptlrpc_request *req) desc = req->rq_bulk; if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_BULK_UNLINK) && - req->rq_bulk_deadline > get_seconds()) + req->rq_bulk_deadline > ktime_get_real_seconds()) return 1; if (!desc) @@ -2727,7 +2727,7 @@ static inline int ptlrpc_client_early(struct ptlrpc_request *req) { if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK) && - req->rq_reply_deadline > get_seconds()) + req->rq_reply_deadline > ktime_get_real_seconds()) return 0; return req->rq_early; } @@ -2739,7 +2739,7 @@ static inline int ptlrpc_client_replied(struct ptlrpc_request *req) { if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK) && - req->rq_reply_deadline > get_seconds()) + req->rq_reply_deadline > ktime_get_real_seconds()) return 0; return req->rq_replied; } @@ -2749,7 +2749,7 @@ static inline int ptlrpc_client_recv(struct ptlrpc_request *req) { if (OBD_FAIL_CHECK(OBD
[PATCH 11/37] staging/lustre: use 'long' return type for cfs_duration_sec()
The cfs_duration_sec() converts a relative jiffies value into seconds, and returns that number as a time_t. We know that a 32-bit type is enough here, because the result is order of magnitudes smaller than the difference in jiffies that is also expressed as a 'long', so we can safely replace the time_t type with long as well. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h index 0fc490bac2b5..b0af90907020 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h @@ -90,7 +90,7 @@ static inline long cfs_time_seconds(int seconds) return ((long)seconds) * HZ; } -static inline time_t cfs_duration_sec(long d) +static inline long cfs_duration_sec(long d) { return d / HZ; } -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 34/37] staging/lustre: remove a bit of dead code
These three functions have not been in used for a long time, so lets just remove them. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/include/obd.h | 62 - 1 file changed, 62 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index f09a0405ff97..57b5e1123b4f 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -167,68 +167,6 @@ struct obd_info { void *oi_capa; }; -/* compare all relevant fields. */ -static inline int lov_stripe_md_cmp(struct lov_stripe_md *m1, - struct lov_stripe_md *m2) -{ - /* -* ->lsm_wire contains padding, but it should be zeroed out during -* allocation. -*/ - return memcmp(&m1->lsm_wire, &m2->lsm_wire, sizeof(m1->lsm_wire)); -} - -static inline int lov_lum_lsm_cmp(struct lov_user_md *lum, - struct lov_stripe_md *lsm) -{ - if (lsm->lsm_magic != lum->lmm_magic) - return 1; - if ((lsm->lsm_stripe_count != 0) && (lum->lmm_stripe_count != 0) && - (lsm->lsm_stripe_count != lum->lmm_stripe_count)) - return 2; - if ((lsm->lsm_stripe_size != 0) && (lum->lmm_stripe_size != 0) && - (lsm->lsm_stripe_size != lum->lmm_stripe_size)) - return 3; - if ((lsm->lsm_pattern != 0) && (lum->lmm_pattern != 0) && - (lsm->lsm_pattern != lum->lmm_pattern)) - return 4; - if ((lsm->lsm_magic == LOV_MAGIC_V3) && - (strncmp(lsm->lsm_pool_name, -((struct lov_user_md_v3 *)lum)->lmm_pool_name, -LOV_MAXPOOLNAME) != 0)) - return 5; - return 0; -} - -static inline int lov_lum_swab_if_needed(struct lov_user_md_v3 *lumv3, -int *lmm_magic, -struct lov_user_md *lum) -{ - if (lum && copy_from_user(lumv3, lum, sizeof(struct lov_user_md_v1))) - return -EFAULT; - - *lmm_magic = lumv3->lmm_magic; - - if (*lmm_magic == __swab32(LOV_USER_MAGIC_V1)) { - lustre_swab_lov_user_md_v1((struct lov_user_md_v1 *)lumv3); - *lmm_magic = LOV_USER_MAGIC_V1; - } else if (*lmm_magic == LOV_USER_MAGIC_V3) { - if (lum && copy_from_user(lumv3, lum, sizeof(*lumv3))) - return -EFAULT; - } else if (*lmm_magic == __swab32(LOV_USER_MAGIC_V3)) { - if (lum && copy_from_user(lumv3, lum, sizeof(*lumv3))) - return -EFAULT; - lustre_swab_lov_user_md_v3(lumv3); - *lmm_magic = LOV_USER_MAGIC_V3; - } else if (*lmm_magic != LOV_USER_MAGIC_V1) { - CDEBUG(D_IOCTL, - "bad userland LOV MAGIC: %#08x != %#08x nor %#08x\n", - *lmm_magic, LOV_USER_MAGIC_V1, LOV_USER_MAGIC_V3); - return -EINVAL; - } - return 0; -} - void lov_stripe_lock(struct lov_stripe_md *md); void lov_stripe_unlock(struct lov_stripe_md *md); -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/37] staging/lustre: use 64-bit time LNetCtl()
This ioctl function passes a 64-bit time argument but then performs a computation with a 32-bit get_seconds() value. In order to avoid overflow here, this changes the code to use 64-bit math and ktime_get_real_seconds(). Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lnet/lnet/api-ni.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 7fab03bee1ea..c368cf561b9d 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1343,6 +1343,7 @@ LNetCtl(unsigned int cmd, void *arg) lnet_process_id_t id = {0}; lnet_ni_t *ni; int rc; + unsigned long secs_passed; LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); @@ -1370,10 +1371,9 @@ LNetCtl(unsigned int cmd, void *arg) &data->ioc_nid, &data->ioc_flags, &data->ioc_priority); case IOC_LIBCFS_NOTIFY_ROUTER: + secs_passed = (ktime_get_real_seconds() - data->ioc_u64[0]); return lnet_notify(NULL, data->ioc_nid, data->ioc_flags, - cfs_time_current() - - cfs_time_seconds(get_seconds() - - (time_t)data->ioc_u64[0])); + jiffies - secs_passed * HZ); case IOC_LIBCFS_PORTALS_COMPATIBILITY: /* This can be removed once lustre stops calling it */ -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/37] staging/lustre: use 64-bit times for ksnd_connd
The connection starting/failing time stamps will overflow in 2038 on 32-bit machines, so we need to use time64_t and ktime_get_real_seconds() instead. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c| 2 +- drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h| 6 +++--- drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 8 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c index 22f4cd0173c1..904d15837cbb 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c @@ -2426,7 +2426,7 @@ ksocknal_base_startup(void) ksocknal_data.ksnd_connd_starting = 0; ksocknal_data.ksnd_connd_failed_stamp = 0; - ksocknal_data.ksnd_connd_starting_stamp = get_seconds(); + ksocknal_data.ksnd_connd_starting_stamp = ktime_get_real_seconds(); /* must have at least 2 connds to remain responsive to accepts while * connecting */ if (*ksocknal_tunables.ksnd_nconnds < SOCKNAL_CONND_RESV + 1) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index a0fcbc39f86b..b349847f9cf9 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -216,13 +216,13 @@ typedef struct { wait_queue_head_t ksnd_connd_waitq; /* connds sleep here */ int ksnd_connd_connecting; /* # connds connecting */ - longksnd_connd_failed_stamp;/* time stamp of the + time64_tksnd_connd_failed_stamp;/* time stamp of the * last failed * connecting attempt */ - unsignedksnd_connd_starting;/* # starting connd */ - longksnd_connd_starting_stamp;/* time stamp of the + time64_tksnd_connd_starting_stamp;/* time stamp of the * last starting connd */ + unsignedksnd_connd_starting;/* # starting connd */ unsignedksnd_connd_running; /* # running connd */ spinlock_t ksnd_connd_lock;/* serialise */ diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c index 6d87731c539d..354c8105f9a0 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c @@ -1998,7 +1998,7 @@ ksocknal_connect (ksock_route_t *route) * running out of resource. */ static int -ksocknal_connd_check_start(long sec, long *timeout) +ksocknal_connd_check_start(time64_t sec, long *timeout) { char name[16]; int rc; @@ -2048,7 +2048,7 @@ ksocknal_connd_check_start(long sec, long *timeout) /* we tried ... */ LASSERT(ksocknal_data.ksnd_connd_starting > 0); ksocknal_data.ksnd_connd_starting--; - ksocknal_data.ksnd_connd_failed_stamp = get_seconds(); + ksocknal_data.ksnd_connd_failed_stamp = ktime_get_real_seconds(); return 1; } @@ -2060,7 +2060,7 @@ ksocknal_connd_check_start(long sec, long *timeout) * again to recheck these conditions. */ static int -ksocknal_connd_check_stop(long sec, long *timeout) +ksocknal_connd_check_stop(time64_t sec, long *timeout) { int val; @@ -2141,7 +2141,7 @@ ksocknal_connd (void *arg) while (!ksocknal_data.ksnd_shuttingdown) { ksock_route_t *route = NULL; - long sec = get_seconds(); + time64_t sec = ktime_get_real_seconds(); long timeout = MAX_SCHEDULE_TIMEOUT; int dropped_lock = 0; -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/37] staging/lustre: use jiffies_to_*() instead of cfs_duration_usec
The cfs_duration_usec() function has a timeval as its output, which we want to avoid in general because of the y2038 problem. There are only two locations remaining in lustre, so we can for now replace one with jiffies_to_timeval(), which is a generic kernel function that does the same thing, the other can just use jiffies_to_usecs() and completely avoid the timeval. This is not a full solution yet, but it's a small step that lets use build a larger portion of lustre without this reference to timeval in a header file, and avoid triggering automated checking tools that want to warn about timeval. Signed-off-by: Arnd Bergmann --- .../lustre/include/linux/libcfs/linux/linux-time.h| 15 --- drivers/staging/lustre/lnet/selftest/conrpc.c | 2 +- drivers/staging/lustre/lnet/selftest/framework.c | 6 +- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h index b0af90907020..f193f8bdee6e 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h @@ -95,21 +95,6 @@ static inline long cfs_duration_sec(long d) return d / HZ; } -static inline void cfs_duration_usec(long d, struct timeval *s) -{ -#if (BITS_PER_LONG == 32) && (HZ > 4096) - __u64 t; - - s->tv_sec = d / HZ; - t = (d - (long)s->tv_sec * HZ) * ONE_MILLION; - do_div(t, HZ); - s->tv_usec = t; -#else - s->tv_sec = d / HZ; - s->tv_usec = ((d - (long)s->tv_sec * HZ) * ONE_MILLION) / HZ; -#endif -} - #define cfs_time_current_64 get_jiffies_64 static inline __u64 cfs_time_add_64(__u64 t, __u64 d) diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index a1a4e08f7391..bf2968310516 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -505,7 +505,7 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans, dur = (long)cfs_time_sub(crpc->crp_stamp, (unsigned long)console_session.ses_id.ses_stamp); - cfs_duration_usec(dur, &tv); + jiffies_to_timeval(dur, &tv); if (copy_to_user(&ent->rpe_peer, &nd->nd_id, sizeof(lnet_process_id_t)) || diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c index 257de3537671..c448037a3c9f 100644 --- a/drivers/staging/lustre/lnet/selftest/framework.c +++ b/drivers/staging/lustre/lnet/selftest/framework.c @@ -372,7 +372,6 @@ sfw_get_stats(srpc_stat_reqst_t *request, srpc_stat_reply_t *reply) sfw_session_t *sn = sfw_data.fw_session; sfw_counters_t *cnt = &reply->str_fw; sfw_batch_t *bat; - struct timeval tv; reply->str_sid = (sn == NULL) ? LST_INVALID_SID : sn->sn_id; @@ -391,10 +390,7 @@ sfw_get_stats(srpc_stat_reqst_t *request, srpc_stat_reply_t *reply) /* send over the msecs since the session was started - with 32 bits to send, this is ~49 days */ - cfs_duration_usec(cfs_time_sub(cfs_time_current(), - sn->sn_started), &tv); - - cnt->running_ms = (__u32)(tv.tv_sec * 1000 + tv.tv_usec / 1000); + cnt->running_ms = jiffies_to_msecs(jiffies - sn->sn_started); cnt->brw_errors = atomic_read(&sn->sn_brw_errors); cnt->ping_errors = atomic_read(&sn->sn_ping_errors); cnt->zombie_sessions = atomic_read(&sfw_data.fw_nzombies); -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/37] staging/lustre: use 64-bit llite procfs timestamps
The llite procfs interface contains timestamps that are computed from timeval, which overflows in 2038 on 32-bit systems. This changes the output to use a timespec64 type to avoid the overflow. I also change the format to print the sub-second portion as 9 digits (nanoseconds) for clarity, rather than printing six digits without leading zeroes. Signed-off-by: Arnd Bergmann --- drivers/staging/lustre/lustre/llite/lproc_llite.c | 24 +++ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c index 427a34b00e85..08d32027d7be 100644 --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c @@ -1140,20 +1140,20 @@ static void ll_display_extents_info(struct ll_rw_extents_info *io_extents, static int ll_rw_extents_stats_pp_seq_show(struct seq_file *seq, void *v) { - struct timeval now; + struct timespec64 now; struct ll_sb_info *sbi = seq->private; struct ll_rw_extents_info *io_extents = &sbi->ll_rw_extents_info; int k; - do_gettimeofday(&now); + ktime_get_real_ts64(&now); if (!sbi->ll_rw_stats_on) { seq_printf(seq, "disabled\n" "write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n"); return 0; } - seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n", - now.tv_sec, (unsigned long)now.tv_usec); + seq_printf(seq, "snapshot_time: %llu.%09lu (secs.usecs)\n", + (s64)now.tv_sec, (unsigned long)now.tv_nsec); seq_printf(seq, "%15s %19s | %20s\n", " ", "read", "write"); seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n", "extents", "calls", "%", "cum%", @@ -1219,19 +1219,19 @@ LPROC_SEQ_FOPS(ll_rw_extents_stats_pp); static int ll_rw_extents_stats_seq_show(struct seq_file *seq, void *v) { - struct timeval now; + struct timespec64 now; struct ll_sb_info *sbi = seq->private; struct ll_rw_extents_info *io_extents = &sbi->ll_rw_extents_info; - do_gettimeofday(&now); + ktime_get_real_ts64(&now); if (!sbi->ll_rw_stats_on) { seq_printf(seq, "disabled\n" "write anything in this file to activate, then 0 or \"[D/d]isabled\" to deactivate\n"); return 0; } - seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n", - now.tv_sec, (unsigned long)now.tv_usec); + seq_printf(seq, "snapshot_time: %llu.%09lu (secs.usecs)\n", + (u64)now.tv_sec, (unsigned long)now.tv_nsec); seq_printf(seq, "%15s %19s | %20s\n", " ", "read", "write"); seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n", @@ -1396,13 +1396,13 @@ void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid, static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v) { - struct timeval now; + struct timespec64 now; struct ll_sb_info *sbi = seq->private; struct ll_rw_process_info *offset = sbi->ll_rw_offset_info; struct ll_rw_process_info *process = sbi->ll_rw_process_info; int i; - do_gettimeofday(&now); + ktime_get_real_ts64(&now); if (!sbi->ll_rw_stats_on) { seq_printf(seq, "disabled\n" @@ -1411,8 +1411,8 @@ static int ll_rw_offset_stats_seq_show(struct seq_file *seq, void *v) } spin_lock(&sbi->ll_process_lock); - seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n", - now.tv_sec, (unsigned long)now.tv_usec); + seq_printf(seq, "snapshot_time: %llu.%09lu (secs.usecs)\n", + (s64)now.tv_sec, (unsigned long)now.tv_nsec); seq_printf(seq, "%3s %10s %14s %14s %17s %17s %14s\n", "R/W", "PID", "RANGE START", "RANGE END", "SMALLEST EXTENT", "LARGEST EXTENT", "OFFSET"); -- 2.1.0.rc2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/11] staging: comedi: rtd520: tidy up rtd_ao_winsn()
For aesthetics, rename this function and tidy it up a bit. Use the comedi_range_is_bipolar() and comedi_offset_munge() helpers to handle the 2's complement munging. Save the readback value after the conversion is complete. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rtd520.c | 35 - 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index 5fe92c4..2df8494 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -1046,42 +1046,41 @@ static int rtd_ao_eoc(struct comedi_device *dev, return -EBUSY; } -static int rtd_ao_winsn(struct comedi_device *dev, - struct comedi_subdevice *s, struct comedi_insn *insn, - unsigned int *data) +static int rtd_ao_insn_write(struct comedi_device *dev, +struct comedi_subdevice *s, +struct comedi_insn *insn, +unsigned int *data) { struct rtd_private *devpriv = dev->private; - int i; - int chan = CR_CHAN(insn->chanspec); - int range = CR_RANGE(insn->chanspec); + unsigned int chan = CR_CHAN(insn->chanspec); + unsigned int range = CR_RANGE(insn->chanspec); int ret; + int i; /* Configure the output range (table index matches the range values) */ writew(range & 7, dev->mmio + LAS0_DAC_CTRL(chan)); for (i = 0; i < insn->n; ++i) { - int val = data[i] << 3; + unsigned int val = data[i]; - /* VERIFY: comedi range and offset conversions */ + /* bipolar ranges use 2's complement values */ + if (comedi_range_is_bipolar(s, range)) + val = comedi_offset_munge(s, val); - if ((range > 1) && (data[i] < 2048)) { /* bipolar */ - /* offset and sign extend */ - val = (((int)data[i]) - 2048) << 3; - } else {/* unipolor */ - val = data[i] << 3; - } + /* the 12-bit data is left justified to 16-bits */ + val <<= 3; writew(val, devpriv->las1 + LAS1_DAC_FIFO(chan)); writew(0, dev->mmio + LAS0_UPDATE_DAC(chan)); - s->readback[chan] = data[i]; - ret = comedi_timeout(dev, s, insn, rtd_ao_eoc, 0); if (ret) return ret; + + s->readback[chan] = data[i]; } - return i; + return insn->n; } static int rtd_dio_insn_bits(struct comedi_device *dev, @@ -1240,7 +1239,7 @@ static int rtd_auto_attach(struct comedi_device *dev, s->n_chan = 2; s->maxdata = 0x0fff; s->range_table = &rtd_ao_range; - s->insn_write = rtd_ao_winsn; + s->insn_write = rtd_ao_insn_write; ret = comedi_alloc_subdev_readback(s); if (ret) -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/11] staging: comedi: rtd520: tidy up block comments
Use the preferred block command style. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rtd520.c | 68 + 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index 7a3df41..c62fead 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -209,12 +209,14 @@ #define LAS1_HDIO_FIFO 0x0004 /* HiSpd DI FIFO (16bit) */ #define LAS1_DAC_FIFO(x) (0x0008 + ((x) * 0x4)) /* D/Ax FIFO (16bit) */ -/*== - Driver specific stuff (tunable) -==*/ +/* + * Driver specific stuff (tunable) + */ -/* We really only need 2 buffers. More than that means being much - smarter about knowing which ones are full. */ +/* + * We really only need 2 buffers. More than that means being much + * smarter about knowing which ones are full. + */ #define DMA_CHAIN_COUNT 2 /* max DMA segments/buffers in a ring (min 2) */ /* Target period for periodic transfers. This sets the user read latency. */ @@ -226,9 +228,9 @@ /* The board support a channel list up to the FIFO length (1K or 8K) */ #define RTD_MAX_CHANLIST 128 /* max channel list that we allow */ -/*== - Board specific stuff -==*/ +/* + * Board specific stuff + */ #define RTD_CLOCK_RATE 800 /* 8Mhz onboard clock */ #define RTD_CLOCK_BASE 125 /* clock period in ns */ @@ -257,9 +259,9 @@ /* interrupt at end of block */ | PLX_INTR_TERM_COUNT \ /* from board to PCI */| PLX_XFER_LOCAL_TO_PCI) -/*== - Comedi specific stuff -==*/ +/* + * Comedi specific stuff + */ /* * The board has 3 input modes and the gains of 1,2,4,...32 (, 64, 128) @@ -377,11 +379,11 @@ struct rtd_private { #define DMA1_ACTIVE0x04/* DMA1 is active */ /* - Given a desired period and the clock period (both in ns), - return the proper counter value (divider-1). - Sets the original period to be the true value. - Note: you have to check if the value is larger than the counter range! -*/ + * Given a desired period and the clock period (both in ns), return the + * proper counter value (divider-1). Sets the original period to be the + * true value. + * Note: you have to check if the value is larger than the counter range! + */ static int rtd_ns_to_timer_base(unsigned int *nanosec, unsigned int flags, int base) { @@ -402,26 +404,26 @@ static int rtd_ns_to_timer_base(unsigned int *nanosec, if (divider < 2) divider = 2;/* min is divide by 2 */ - /* Note: we don't check for max, because different timers - have different ranges */ + /* +* Note: we don't check for max, because different timers +* have different ranges +*/ *nanosec = base * divider; return divider - 1; /* countdown is divisor+1 */ } /* - Given a desired period (in ns), - return the proper counter value (divider-1) for the internal clock. - Sets the original period to be the true value. -*/ + * Given a desired period (in ns), return the proper counter value + * (divider-1) for the internal clock. Sets the original period to + * be the true value. + */ static int rtd_ns_to_timer(unsigned int *ns, unsigned int flags) { return rtd_ns_to_timer_base(ns, flags, RTD_CLOCK_BASE); } -/* - Convert a single comedi channel-gain entry to a RTD520 table entry -*/ +/* Convert a single comedi channel-gain entry to a RTD520 table entry */ static unsigned short rtd_convert_chan_gain(struct comedi_device *dev, unsigned int chanspec, int index) { @@ -466,9 +468,7 @@ static unsigned short rtd_convert_chan_gain(struct comedi_device *dev, return r; } -/* - Setup the channel-gain table from a comedi list -*/ +/* Setup the channel-gain table from a comedi list */ static void rtd_load_channelgain_list(struct comedi_device *dev, unsigned int n_chan, unsigned int *list) { @@ -488,8 +488,10 @@ static void rtd_load_channelgain_list(struct comedi_device *dev, } } -/* determine fifo size by doing adc conversions until the fifo half -empty status flag clears */ +/* + * Determine fifo size by doing adc conversions until the fifo half + * empty status flag clears. + */ static int rtd520_probe_fifo_depth(struct comedi_device *dev) { unsigned int chanspec = CR_PACK(0, 0, AREF_GROUND); @@ -972,8 +974,10 @@ static
[PATCH] Staging: rtl8712: rtl871x_ht.h: Coding style warning fix for block comment
This patch is to the rtl871x_ht.h that fixes up following warning reported by checkpatch.pl : -Block comments use a trailing */ on a separate line Signed-off-by: Punit Vara --- drivers/staging/rtl8712/rtl871x_ht.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_ht.h b/drivers/staging/rtl8712/rtl871x_ht.h index 41872d9..2dd8672 100644 --- a/drivers/staging/rtl8712/rtl871x_ht.h +++ b/drivers/staging/rtl8712/rtl871x_ht.h @@ -35,8 +35,10 @@ struct ht_priv { unsigned char baddbareq_issued[16]; unsigned inttx_amsdu_enable;/*for enable Tx A-MSDU */ unsigned inttx_amdsu_maxlen; /* 1: 8k, 0:4k ; default:8k, for tx */ - unsigned intrx_ampdu_maxlen; /* for rx reordering ctrl win_sz, - * updated when join_callback. */ + unsigned intrx_ampdu_maxlen; /* + * for rx reordering ctrl win_sz, + * updated when join_callback. + */ struct ieee80211_ht_cap ht_cap; }; -- 2.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/11] staging: comedi: rtd520: use DIV_ROUND_CLOSEST and DIV_ROUND_UP macros
Use the macros to clarify the divisor calculations. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/rtd520.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index c62fead..7afdcbe 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -392,13 +392,13 @@ static int rtd_ns_to_timer_base(unsigned int *nanosec, switch (flags & CMDF_ROUND_MASK) { case CMDF_ROUND_NEAREST: default: - divider = (*nanosec + base / 2) / base; + divider = DIV_ROUND_CLOSEST(*nanosec, base); break; case CMDF_ROUND_DOWN: divider = (*nanosec) / base; break; case CMDF_ROUND_UP: - divider = (*nanosec + base - 1) / base; + divider = DIV_ROUND_UP(*nanosec, base); break; } if (divider < 2) -- 2.5.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel