linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the y2038 tree with the staging tree
@ 2015-03-19  6:29 Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2015-03-19  6:29 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-next, linux-kernel, Tapasweni Pathak, Haneen Mohammed

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

Hi Arnd,

Today's linux-next merge of the y2038 tree got a conflict in
drivers/staging/media/lirc/lirc_parallel.c between commit 8126e17f8925
("Staging: media: Remove parentheses around right side an assignment")
from the staging tree and commit 77f0cbce579d ("staging: media: lirc:
Replace timeval with ktime_t in lirc_parallel.c") from the y2038 tree.

I fixed it up (I used the y2038 tree version as that also removed the
extra parentheses) and can carry the fix as necessary (no action is
required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* linux-next: manual merge of the y2038 tree with the staging tree
@ 2018-06-06 10:19 Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2018-06-06 10:19 UTC (permalink / raw)
  To: Arnd Bergmann, Greg KH
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Deepa Dinamani

[-- Attachment #1: Type: text/plain, Size: 964 bytes --]

Hi all,

Today's linux-next merge of the y2038 tree got conflicts in:

  drivers/staging/lustre/lustre/llite/llite_lib.c
  drivers/staging/lustre/lustre/llite/namei.c
  drivers/staging/lustre/lustre/lmv/lmv_obd.c
  drivers/staging/lustre/lustre/mdc/mdc_reint.c
  drivers/staging/lustre/lustre/obdclass/obdo.c

between commit:

  be65f9ed267f ("staging: lustre: delete the filesystem from the tree.")

from the staging tree and commit:

  18a592632e61 ("lustre: Use long long type to print inode time")

from the y2038 tree.

I fixed it up (I removed the files) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: linux-next: manual merge of the y2038 tree with the staging tree
  2015-11-01 14:44 Stephen Rothwell
@ 2015-11-01 18:03 ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2015-11-01 18:03 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnd Bergmann, linux-next, linux-kernel, Deepa Dinamani,
	Tapasweni Pathak

On Mon, Nov 02, 2015 at 01:44:49AM +1100, Stephen Rothwell wrote:
> Hi Arnd,
> 
> Today's linux-next merge of the y2038 tree got conflicts in:
> 
>   drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
>   drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
>   drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
>   drivers/staging/ft1000/ft1000.h
> 
> between commit:
> 
>   6512edec48b2 ("staging: ft1000: remove obsolete driver")
> 
> from the staging tree and commit:
> 
>   8b37bf430656 ("staging: ft1000: Replace timeval and time_t with time64_t")
> 
> from the y2038 tree.
> 
> I fixed it up (the former removed the files) and can carry the fix as
> necessary (no action is required).

Thanks for the fix, that sounds obviously correct :)

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* linux-next: manual merge of the y2038 tree with the staging tree
@ 2015-11-01 14:44 Stephen Rothwell
  2015-11-01 18:03 ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2015-11-01 14:44 UTC (permalink / raw)
  To: Arnd Bergmann, Greg KH
  Cc: linux-next, linux-kernel, Deepa Dinamani, Tapasweni Pathak

Hi Arnd,

Today's linux-next merge of the y2038 tree got conflicts in:

  drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
  drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
  drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
  drivers/staging/ft1000/ft1000.h

between commit:

  6512edec48b2 ("staging: ft1000: remove obsolete driver")

from the staging tree and commit:

  8b37bf430656 ("staging: ft1000: Replace timeval and time_t with time64_t")

from the y2038 tree.

I fixed it up (the former removed the files) and can carry the fix as
necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: linux-next: manual merge of the y2038 tree with the staging tree
  2014-11-06  4:48 Stephen Rothwell
@ 2014-11-06  4:51 ` Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2014-11-06  4:51 UTC (permalink / raw)
  To: Arnd Bergmann, Greg KH
  Cc: linux-next, linux-kernel, Tapasweni Pathak, Joe Perches

[-- Attachment #1: Type: text/plain, Size: 26711 bytes --]

Hi Arnd,

On Thu, 6 Nov 2014 15:48:15 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the y2038 tree got a conflict in
> drivers/staging/ft1000/ft1000-usb/ft1000_debug.c between commit
> ecdd21c7b982 ("staging: ft1000: Whitespace neatening") from the staging
> tree and commit 4115d2b27a50 ("staging: ft1000: Replace timeval and
> time_t with time64_t") from the y2038 tree.
> 
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).

Sorry, see below for proper diff.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
index c8d278229940,287c8b3c18fc..000000000000
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
@@@ -391,339 -394,344 +391,339 @@@ static unsigned int ft1000_poll_dev(str
  }
  
  /*
 -*---------------------------------------------------------------------------
 -* Function:    ft1000_ioctl
 -*
 -* Parameters:
 -*
 -* Description:
 -*
 -* Notes:
 -*
 -*---------------------------------------------------------------------------
 -*/
 + *---------------------------------------------------------------------------
 + * Function:    ft1000_ioctl
 + *
 + * Parameters:
 + *
 + * Description:
 + *
 + * Notes:
 + *
 + *---------------------------------------------------------------------------
 + */
  static long ft1000_ioctl(struct file *file, unsigned int command,
 -                           unsigned long argument)
 +			 unsigned long argument)
  {
 -    void __user *argp = (void __user *)argument;
 +	void __user *argp = (void __user *)argument;
  	struct ft1000_info *info;
 -    struct ft1000_usb *ft1000dev;
 -    int result=0;
 -    int cmd;
 -    int i;
 -    u16 tempword;
 -    unsigned long flags;
 +	struct ft1000_usb *ft1000dev;
 +	int result = 0;
 +	int cmd;
 +	int i;
 +	u16 tempword;
 +	unsigned long flags;
- 	struct timeval tv;
+ 	time64_t time;
  	struct IOCTL_GET_VER get_ver_data;
  	struct IOCTL_GET_DSP_STAT get_stat_data;
 -    u8 ConnectionMsg[] = {0x00,0x44,0x10,0x20,0x80,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x93,0x64,
 -                          0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x0a,
 -                          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 -                          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 -                          0x00,0x00,0x02,0x37,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x01,0x00,0x01,0x7f,0x00,
 -                          0x00,0x01,0x00,0x00};
 +	u8 ConnectionMsg[] = {0x00, 0x44, 0x10, 0x20, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x93, 0x64,
 +			      0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0a,
 +			      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 +			      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 +			      0x00, 0x00, 0x02, 0x37, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x7f, 0x00,
 +			      0x00, 0x01, 0x00, 0x00};
 +
 +	unsigned short ledStat = 0;
 +	unsigned short conStat = 0;
 +
 +	if (ft1000_flarion_cnt == 0) {
 +		pr_debug("called with ft1000_flarion_cnt of zero\n");
 +		return -EBADF;
 +	}
  
 -    unsigned short ledStat=0;
 -    unsigned short conStat=0;
 +	/* pr_debug("command = 0x%x argument = 0x%8x\n", command, (u32)argument); */
  
 -    /* DEBUG("ft1000_ioctl called\n"); */
 +	info = file->private_data;
 +	ft1000dev = info->priv;
 +	cmd = _IOC_NR(command);
 +	/* pr_debug("cmd = 0x%x\n", cmd); */
 +
 +	/* process the command */
 +	switch (cmd) {
 +	case IOCTL_REGISTER_CMD:
 +		pr_debug("IOCTL_FT1000_REGISTER called\n");
 +		result = get_user(tempword, (__u16 __user *)argp);
 +		if (result) {
 +			pr_debug("result = %d failed to get_user\n", result);
 +			break;
 +		}
 +		if (tempword == DSPBCMSGID) {
 +			/* Search for matching file object */
 +			for (i = 0; i < MAX_NUM_APP; i++) {
 +				if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
 +					ft1000dev->app_info[i].DspBCMsgFlag = 1;
 +					pr_debug("Registered for broadcast messages\n");
 +					break;
 +				}
 +			}
 +		}
 +		break;
  
 -    if (ft1000_flarion_cnt == 0) {
 -        DEBUG("FT1000:ft1000_ioctl called when ft1000_flarion_cnt is zero\n");
 -        return (-EBADF);
 -    }
 +	case IOCTL_GET_VER_CMD:
 +		pr_debug("IOCTL_FT1000_GET_VER called\n");
  
 -    /* DEBUG("FT1000:ft1000_ioctl:command = 0x%x argument = 0x%8x\n", command, (u32)argument); */
 +		get_ver_data.drv_ver = FT1000_DRV_VER;
  
 -	info = file->private_data;
 -	ft1000dev = info->priv;
 -    cmd = _IOC_NR(command);
 -    /* DEBUG("FT1000:ft1000_ioctl:cmd = 0x%x\n", cmd); */
 -
 -    /* process the command */
 -    switch (cmd) {
 -    case IOCTL_REGISTER_CMD:
 -            DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_REGISTER called\n");
 -            result = get_user(tempword, (__u16 __user*)argp);
 -            if (result) {
 -                DEBUG("result = %d failed to get_user\n", result);
 -                break;
 -            }
 -            if (tempword == DSPBCMSGID) {
 -                /* Search for matching file object */
 -                for (i=0; i<MAX_NUM_APP; i++) {
 -                    if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
 -                        ft1000dev->app_info[i].DspBCMsgFlag = 1;
 -                        DEBUG("FT1000:ft1000_ioctl:Registered for broadcast messages\n");
 -                        break;
 -                    }
 -                }
 -            }
 -            break;
 -
 -    case IOCTL_GET_VER_CMD:
 -        DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_VER called\n");
 -
 -        get_ver_data.drv_ver = FT1000_DRV_VER;
 -
 -        if (copy_to_user(argp, &get_ver_data, sizeof(get_ver_data))) {
 -            DEBUG("FT1000:ft1000_ioctl: copy fault occurred\n");
 -            result = -EFAULT;
 -            break;
 -        }
 -
 -        DEBUG("FT1000:ft1000_ioctl:driver version = 0x%x\n",(unsigned int)get_ver_data.drv_ver);
 -
 -        break;
 -    case IOCTL_CONNECT:
 -        /* Connect Message */
 -        DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_CONNECT\n");
 -        ConnectionMsg[79] = 0xfc;
 -			   result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
 -
 -        break;
 -    case IOCTL_DISCONNECT:
 -        /* Disconnect Message */
 -        DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_DISCONNECT\n");
 -        ConnectionMsg[79] = 0xfd;
 -			   result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
 -        break;
 -    case IOCTL_GET_DSP_STAT_CMD:
 -        /* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_DSP_STAT called\n"); */
 -	memset(&get_stat_data, 0, sizeof(get_stat_data));
 -        memcpy(get_stat_data.DspVer, info->DspVer, DSPVERSZ);
 -        memcpy(get_stat_data.HwSerNum, info->HwSerNum, HWSERNUMSZ);
 -        memcpy(get_stat_data.Sku, info->Sku, SKUSZ);
 -        memcpy(get_stat_data.eui64, info->eui64, EUISZ);
 -
 -            if (info->ProgConStat != 0xFF) {
 -                ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_LED, (u8 *)&ledStat, FT1000_MAG_DSP_LED_INDX);
 -                get_stat_data.LedStat = ntohs(ledStat);
 -                DEBUG("FT1000:ft1000_ioctl: LedStat = 0x%x\n", get_stat_data.LedStat);
 -                ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_CON_STATE, (u8 *)&conStat, FT1000_MAG_DSP_CON_STATE_INDX);
 -                get_stat_data.ConStat = ntohs(conStat);
 -                DEBUG("FT1000:ft1000_ioctl: ConStat = 0x%x\n", get_stat_data.ConStat);
 -            } else {
 -                get_stat_data.ConStat = 0x0f;
 -            }
 -
 -
 -        get_stat_data.nTxPkts = info->stats.tx_packets;
 -        get_stat_data.nRxPkts = info->stats.rx_packets;
 -        get_stat_data.nTxBytes = info->stats.tx_bytes;
 -        get_stat_data.nRxBytes = info->stats.rx_bytes;
 -	time = get_seconds();
 -	get_stat_data.ConTm = time - info->ConTm;
 -        DEBUG("Connection Time = %d\n", (int)get_stat_data.ConTm);
 -        if (copy_to_user(argp, &get_stat_data, sizeof(get_stat_data))) {
 -            DEBUG("FT1000:ft1000_ioctl: copy fault occurred\n");
 -            result = -EFAULT;
 -            break;
 -        }
 -        DEBUG("ft1000_chioctl: GET_DSP_STAT succeed\n");
 -        break;
 -    case IOCTL_SET_DPRAM_CMD:
 -        {
 +		if (copy_to_user(argp, &get_ver_data, sizeof(get_ver_data))) {
 +			pr_debug("copy fault occurred\n");
 +			result = -EFAULT;
 +			break;
 +		}
 +
 +		pr_debug("driver version = 0x%x\n",
 +			 (unsigned int)get_ver_data.drv_ver);
 +
 +		break;
 +	case IOCTL_CONNECT:
 +		/* Connect Message */
 +		pr_debug("IOCTL_FT1000_CONNECT\n");
 +		ConnectionMsg[79] = 0xfc;
 +		result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
 +
 +		break;
 +	case IOCTL_DISCONNECT:
 +		/* Disconnect Message */
 +		pr_debug("IOCTL_FT1000_DISCONNECT\n");
 +		ConnectionMsg[79] = 0xfd;
 +		result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
 +		break;
 +	case IOCTL_GET_DSP_STAT_CMD:
 +		/* pr_debug("IOCTL_FT1000_GET_DSP_STAT\n"); */
 +		memset(&get_stat_data, 0, sizeof(get_stat_data));
 +		memcpy(get_stat_data.DspVer, info->DspVer, DSPVERSZ);
 +		memcpy(get_stat_data.HwSerNum, info->HwSerNum, HWSERNUMSZ);
 +		memcpy(get_stat_data.Sku, info->Sku, SKUSZ);
 +		memcpy(get_stat_data.eui64, info->eui64, EUISZ);
 +
 +		if (info->ProgConStat != 0xFF) {
 +			ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_LED, (u8 *)&ledStat, FT1000_MAG_DSP_LED_INDX);
 +			get_stat_data.LedStat = ntohs(ledStat);
 +			pr_debug("LedStat = 0x%x\n", get_stat_data.LedStat);
 +			ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_CON_STATE, (u8 *)&conStat, FT1000_MAG_DSP_CON_STATE_INDX);
 +			get_stat_data.ConStat = ntohs(conStat);
 +			pr_debug("ConStat = 0x%x\n", get_stat_data.ConStat);
 +		} else {
 +			get_stat_data.ConStat = 0x0f;
 +		}
 +
 +
 +		get_stat_data.nTxPkts = info->stats.tx_packets;
 +		get_stat_data.nRxPkts = info->stats.rx_packets;
 +		get_stat_data.nTxBytes = info->stats.tx_bytes;
 +		get_stat_data.nRxBytes = info->stats.rx_bytes;
- 		do_gettimeofday(&tv);
- 		get_stat_data.ConTm = (u32)(tv.tv_sec - info->ConTm);
++		time = get_seconds();
++		get_stat_data.ConTm = time - info->ConTm;
 +		pr_debug("Connection Time = %d\n", (int)get_stat_data.ConTm);
 +		if (copy_to_user(argp, &get_stat_data, sizeof(get_stat_data))) {
 +			pr_debug("copy fault occurred\n");
 +			result = -EFAULT;
 +			break;
 +		}
 +		pr_debug("GET_DSP_STAT succeed\n");
 +		break;
 +	case IOCTL_SET_DPRAM_CMD:
 +	{
  		struct IOCTL_DPRAM_BLK *dpram_data = NULL;
  		/* struct IOCTL_DPRAM_COMMAND dpram_command; */
 -            u16 qtype;
 -            u16 msgsz;
 +		u16 qtype;
 +		u16 msgsz;
  		struct pseudo_hdr *ppseudo_hdr;
 -            u16 *pmsg;
 -            u16 total_len;
 -            u16 app_index;
 -            u16 status;
 +		u16 *pmsg;
 +		u16 total_len;
 +		u16 app_index;
 +		u16 status;
  
 -            /* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_SET_DPRAM called\n");*/
 +		/* pr_debug("IOCTL_FT1000_SET_DPRAM called\n");*/
  
  
 -            if (ft1000_flarion_cnt == 0) {
 -                return (-EBADF);
 -            }
 +		if (ft1000_flarion_cnt == 0)
 +			return -EBADF;
  
 -            if (ft1000dev->DrvMsgPend) {
 -                return (-ENOTTY);
 -            }
 +		if (ft1000dev->DrvMsgPend)
 +			return -ENOTTY;
  
 -            if (ft1000dev->fProvComplete == 0) {
 -                return (-EACCES);
 -            }
 +		if (ft1000dev->fProvComplete == 0)
 +			return -EACCES;
  
 -            ft1000dev->fAppMsgPend = 1;
 +		ft1000dev->fAppMsgPend = 1;
  
 -            if (info->CardReady) {
 +		if (info->CardReady) {
  
 -               /* DEBUG("FT1000:ft1000_ioctl: try to SET_DPRAM \n"); */
 +			/* pr_debug("try to SET_DPRAM\n"); */
  
 -                /* Get the length field to see how many bytes to copy */
 -                result = get_user(msgsz, (__u16 __user *)argp);
 -		if (result)
 -			break;
 -                msgsz = ntohs(msgsz);
 -                /* DEBUG("FT1000:ft1000_ioctl: length of message = %d\n", msgsz); */
 -
 -                if (msgsz > MAX_CMD_SQSIZE) {
 -                    DEBUG("FT1000:ft1000_ioctl: bad message length = %d\n", msgsz);
 -                    result = -EINVAL;
 -                    break;
 -                }
 -
 -		result = -ENOMEM;
 -		dpram_data = kmalloc(msgsz + 2, GFP_KERNEL);
 -		if (!dpram_data)
 -			break;
 +			/* Get the length field to see how many bytes to copy */
 +			result = get_user(msgsz, (__u16 __user *)argp);
 +			if (result)
 +				break;
 +			msgsz = ntohs(msgsz);
 +			/* pr_debug("length of message = %d\n", msgsz); */
 +
 +			if (msgsz > MAX_CMD_SQSIZE) {
 +				pr_debug("bad message length = %d\n", msgsz);
 +				result = -EINVAL;
 +				break;
 +			}
  
 -                if (copy_from_user(dpram_data, argp, msgsz+2)) {
 -                    DEBUG("FT1000:ft1000_ChIoctl: copy fault occurred\n");
 -                    result = -EFAULT;
 -                } else {
 -                    /* Check if this message came from a registered application */
 -                    for (i=0; i<MAX_NUM_APP; i++) {
 -                        if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
 -                            break;
 -                        }
 -                    }
 -                    if (i==MAX_NUM_APP) {
 -                        DEBUG("FT1000:No matching application fileobject\n");
 -                        result = -EINVAL;
 -			kfree(dpram_data);
 -                        break;
 -                    }
 -                    app_index = i;
 -
 -                    /* Check message qtype type which is the lower byte within qos_class */
 -                    qtype = ntohs(dpram_data->pseudohdr.qos_class) & 0xff;
 -                    /* DEBUG("FT1000_ft1000_ioctl: qtype = %d\n", qtype); */
 -                    if (qtype) {
 -                    } else {
 -                        /* Put message into Slow Queue */
 -                        /* Only put a message into the DPRAM if msg doorbell is available */
 -                        status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 -                        /* DEBUG("FT1000_ft1000_ioctl: READ REGISTER tempword=%x\n", tempword); */
 -                        if (tempword & FT1000_DB_DPRAM_TX) {
 -                            /* Suspend for 2ms and try again due to DSP doorbell busy */
 -                            mdelay(2);
 -                            status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 -                            if (tempword & FT1000_DB_DPRAM_TX) {
 -                                /* Suspend for 1ms and try again due to DSP doorbell busy */
 -                                mdelay(1);
 -                                status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 -                                if (tempword & FT1000_DB_DPRAM_TX) {
 -                                    status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 -                                    if (tempword & FT1000_DB_DPRAM_TX) {
 -                                        /* Suspend for 3ms and try again due to DSP doorbell busy */
 -                                        mdelay(3);
 -                                        status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 -                                        if (tempword & FT1000_DB_DPRAM_TX) {
 -                                            DEBUG("FT1000:ft1000_ioctl:Doorbell not available\n");
 -                                            result = -ENOTTY;
 -						kfree(dpram_data);
 -                                            break;
 -                                        }
 -                                    }
 -                                }
 -                            }
 -                        }
 -
 -                        /*DEBUG("FT1000_ft1000_ioctl: finished reading register\n"); */
 -
 -                        /* Make sure we are within the limits of the slow queue memory limitation */
 -                        if ((msgsz < MAX_CMD_SQSIZE) && (msgsz > PSEUDOSZ)) {
 -                            /* Need to put sequence number plus new checksum for message */
 -                            pmsg = (u16 *)&dpram_data->pseudohdr;
 -				ppseudo_hdr = (struct pseudo_hdr *)pmsg;
 -                            total_len = msgsz+2;
 -                            if (total_len & 0x1) {
 -                                total_len++;
 -                            }
 -
 -                            /* Insert slow queue sequence number */
 -                            ppseudo_hdr->seq_num = info->squeseqnum++;
 -                            ppseudo_hdr->portsrc = ft1000dev->app_info[app_index].app_id;
 -                            /* Calculate new checksum */
 -                            ppseudo_hdr->checksum = *pmsg++;
 -                            /* DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum); */
 -                            for (i=1; i<7; i++) {
 -                                ppseudo_hdr->checksum ^= *pmsg++;
 -                                /* DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum); */
 -                            }
 -                            pmsg++;
 -				ppseudo_hdr = (struct pseudo_hdr *)pmsg;
 -                           result = card_send_command(ft1000dev,(unsigned short*)dpram_data,total_len+2);
 -
 -
 -                            ft1000dev->app_info[app_index].nTxMsg++;
 -                        } else {
 -                            result = -EINVAL;
 -                        }
 -                    }
 -                }
 -            } else {
 -                DEBUG("FT1000:ft1000_ioctl: Card not ready take messages\n");
 -                result = -EACCES;
 -            }
 -	    kfree(dpram_data);
 -
 -        }
 -        break;
 -    case IOCTL_GET_DPRAM_CMD:
 -        {
 +			result = -ENOMEM;
 +			dpram_data = kmalloc(msgsz + 2, GFP_KERNEL);
 +			if (!dpram_data)
 +				break;
 +
 +			if (copy_from_user(dpram_data, argp, msgsz+2)) {
 +				pr_debug("copy fault occurred\n");
 +				result = -EFAULT;
 +			} else {
 +				/* Check if this message came from a registered application */
 +				for (i = 0; i < MAX_NUM_APP; i++) {
 +					if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
 +						break;
 +					}
 +				}
 +				if (i == MAX_NUM_APP) {
 +					pr_debug("No matching application fileobject\n");
 +					result = -EINVAL;
 +					kfree(dpram_data);
 +					break;
 +				}
 +				app_index = i;
 +
 +				/* Check message qtype type which is the lower byte within qos_class */
 +				qtype = ntohs(dpram_data->pseudohdr.qos_class) & 0xff;
 +				/* pr_debug("qtype = %d\n", qtype); */
 +				if (qtype) {
 +				} else {
 +					/* Put message into Slow Queue */
 +					/* Only put a message into the DPRAM if msg doorbell is available */
 +					status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 +					/* pr_debug("READ REGISTER tempword=%x\n", tempword); */
 +					if (tempword & FT1000_DB_DPRAM_TX) {
 +						/* Suspend for 2ms and try again due to DSP doorbell busy */
 +						mdelay(2);
 +						status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 +						if (tempword & FT1000_DB_DPRAM_TX) {
 +							/* Suspend for 1ms and try again due to DSP doorbell busy */
 +							mdelay(1);
 +							status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 +							if (tempword & FT1000_DB_DPRAM_TX) {
 +								status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 +								if (tempword & FT1000_DB_DPRAM_TX) {
 +									/* Suspend for 3ms and try again due to DSP doorbell busy */
 +									mdelay(3);
 +									status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 +									if (tempword & FT1000_DB_DPRAM_TX) {
 +										pr_debug("Doorbell not available\n");
 +										result = -ENOTTY;
 +										kfree(dpram_data);
 +										break;
 +									}
 +								}
 +							}
 +						}
 +					}
 +
 +					/*pr_debug("finished reading register\n"); */
 +
 +					/* Make sure we are within the limits of the slow queue memory limitation */
 +					if ((msgsz < MAX_CMD_SQSIZE) && (msgsz > PSEUDOSZ)) {
 +						/* Need to put sequence number plus new checksum for message */
 +						pmsg = (u16 *)&dpram_data->pseudohdr;
 +						ppseudo_hdr = (struct pseudo_hdr *)pmsg;
 +						total_len = msgsz+2;
 +						if (total_len & 0x1) {
 +							total_len++;
 +						}
 +
 +						/* Insert slow queue sequence number */
 +						ppseudo_hdr->seq_num = info->squeseqnum++;
 +						ppseudo_hdr->portsrc = ft1000dev->app_info[app_index].app_id;
 +						/* Calculate new checksum */
 +						ppseudo_hdr->checksum = *pmsg++;
 +						/* pr_debug("checksum = 0x%x\n", ppseudo_hdr->checksum); */
 +						for (i = 1; i < 7; i++) {
 +							ppseudo_hdr->checksum ^= *pmsg++;
 +							/* pr_debug("checksum = 0x%x\n", ppseudo_hdr->checksum); */
 +						}
 +						pmsg++;
 +						ppseudo_hdr = (struct pseudo_hdr *)pmsg;
 +						result = card_send_command(ft1000dev, (unsigned short *)dpram_data, total_len+2);
 +
 +
 +						ft1000dev->app_info[app_index].nTxMsg++;
 +					} else {
 +						result = -EINVAL;
 +					}
 +				}
 +			}
 +		} else {
 +			pr_debug("Card not ready take messages\n");
 +			result = -EACCES;
 +		}
 +		kfree(dpram_data);
 +
 +	}
 +	break;
 +	case IOCTL_GET_DPRAM_CMD:
 +	{
  		struct dpram_blk *pdpram_blk;
  		struct IOCTL_DPRAM_BLK __user *pioctl_dpram;
 -            int msglen;
 -
 -            /* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_DPRAM called\n"); */
 -
 -            if (ft1000_flarion_cnt == 0) {
 -                return (-EBADF);
 -            }
 -
 -            /* Search for matching file object */
 -            for (i=0; i<MAX_NUM_APP; i++) {
 -                if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
 -                    /*DEBUG("FT1000:ft1000_ioctl: Message is for AppId = %d\n", ft1000dev->app_info[i].app_id); */
 -                    break;
 -                }
 -            }
 -
 -            /* Could not find application info block */
 -            if (i == MAX_NUM_APP) {
 -                DEBUG("FT1000:ft1000_ioctl:Could not find application info block\n");
 -                result = -EBADF;
 -                break;
 -            }
 -
 -            result = 0;
 -            pioctl_dpram = argp;
 -            if (list_empty(&ft1000dev->app_info[i].app_sqlist) == 0) {
 -                /* DEBUG("FT1000:ft1000_ioctl:Message detected in slow queue\n"); */
 -                spin_lock_irqsave(&free_buff_lock, flags);
 -                pdpram_blk = list_entry(ft1000dev->app_info[i].app_sqlist.next, struct dpram_blk, list);
 -                list_del(&pdpram_blk->list);
 -                ft1000dev->app_info[i].NumOfMsg--;
 -                /* DEBUG("FT1000:ft1000_ioctl:NumOfMsg for app %d = %d\n", i, ft1000dev->app_info[i].NumOfMsg); */
 -                spin_unlock_irqrestore(&free_buff_lock, flags);
 -                msglen = ntohs(*(u16 *)pdpram_blk->pbuffer) + PSEUDOSZ;
 -                result = get_user(msglen, &pioctl_dpram->total_len);
 -		if (result)
 -			break;
 -		msglen = htons(msglen);
 -                /* DEBUG("FT1000:ft1000_ioctl:msg length = %x\n", msglen); */
 -                if (copy_to_user (&pioctl_dpram->pseudohdr, pdpram_blk->pbuffer, msglen)) {
 -					DEBUG("FT1000:ft1000_ioctl: copy fault occurred\n");
 -			result = -EFAULT;
 +		int msglen;
 +
 +		/* pr_debug("IOCTL_FT1000_GET_DPRAM called\n"); */
 +
 +		if (ft1000_flarion_cnt == 0)
 +			return -EBADF;
 +
 +		/* Search for matching file object */
 +		for (i = 0; i < MAX_NUM_APP; i++) {
 +			if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
 +				/*pr_debug("Message is for AppId = %d\n", ft1000dev->app_info[i].app_id); */
 +				break;
 +			}
 +		}
 +
 +		/* Could not find application info block */
 +		if (i == MAX_NUM_APP) {
 +			pr_debug("Could not find application info block\n");
 +			result = -EBADF;
  			break;
 -				}
 +		}
 +
 +		result = 0;
 +		pioctl_dpram = argp;
 +		if (list_empty(&ft1000dev->app_info[i].app_sqlist) == 0) {
 +			/* pr_debug("Message detected in slow queue\n"); */
 +			spin_lock_irqsave(&free_buff_lock, flags);
 +			pdpram_blk = list_entry(ft1000dev->app_info[i].app_sqlist.next, struct dpram_blk, list);
 +			list_del(&pdpram_blk->list);
 +			ft1000dev->app_info[i].NumOfMsg--;
 +			/* pr_debug("NumOfMsg for app %d = %d\n", i, ft1000dev->app_info[i].NumOfMsg); */
 +			spin_unlock_irqrestore(&free_buff_lock, flags);
 +			msglen = ntohs(*(u16 *)pdpram_blk->pbuffer) + PSEUDOSZ;
 +			result = get_user(msglen, &pioctl_dpram->total_len);
 +			if (result)
 +				break;
 +			msglen = htons(msglen);
 +			/* pr_debug("msg length = %x\n", msglen); */
 +			if (copy_to_user(&pioctl_dpram->pseudohdr, pdpram_blk->pbuffer, msglen)) {
 +				pr_debug("copy fault occurred\n");
 +				result = -EFAULT;
 +				break;
 +			}
 +
 +			ft1000_free_buffer(pdpram_blk, &freercvpool);
 +			result = msglen;
 +		}
 +		/* pr_debug("IOCTL_FT1000_GET_DPRAM no message\n"); */
 +	}
 +	break;
  
 -                ft1000_free_buffer(pdpram_blk, &freercvpool);
 -                result = msglen;
 -            }
 -            /* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_DPRAM no message\n"); */
 -        }
 -        break;
 -
 -    default:
 -        DEBUG("FT1000:ft1000_ioctl:unknown command: 0x%x\n", command);
 -        result = -ENOTTY;
 -        break;
 -    }
 -    ft1000dev->fAppMsgPend = 0;
 -    return result;
 +	default:
 +		pr_debug("unknown command: 0x%x\n", command);
 +		result = -ENOTTY;
 +		break;
 +	}
 +	ft1000dev->fAppMsgPend = 0;
 +	return result;
  }
  
  /*

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* linux-next: manual merge of the y2038 tree with the staging tree
@ 2014-11-06  4:48 Stephen Rothwell
  2014-11-06  4:51 ` Stephen Rothwell
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2014-11-06  4:48 UTC (permalink / raw)
  To: Arnd Bergmann, Greg KH
  Cc: linux-next, linux-kernel, Tapasweni Pathak, Joe Perches

[-- Attachment #1: Type: text/plain, Size: 26597 bytes --]

Hi Arnd,

Today's linux-next merge of the y2038 tree got a conflict in
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c between commit
ecdd21c7b982 ("staging: ft1000: Whitespace neatening") from the staging
tree and commit 4115d2b27a50 ("staging: ft1000: Replace timeval and
time_t with time64_t") from the y2038 tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
index c8d278229940,287c8b3c18fc..000000000000
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
@@@ -391,339 -394,344 +391,429 @@@ static unsigned int ft1000_poll_dev(str
  }
  
  /*
 -*---------------------------------------------------------------------------
 -* Function:    ft1000_ioctl
 -*
 -* Parameters:
 -*
 -* Description:
 -*
 -* Notes:
 -*
 -*---------------------------------------------------------------------------
 -*/
 + *---------------------------------------------------------------------------
 + * Function:    ft1000_ioctl
 + *
 + * Parameters:
 + *
 + * Description:
 + *
 + * Notes:
 + *
 + *---------------------------------------------------------------------------
 + */
  static long ft1000_ioctl(struct file *file, unsigned int command,
 -                           unsigned long argument)
 +			 unsigned long argument)
  {
 -    void __user *argp = (void __user *)argument;
 +	void __user *argp = (void __user *)argument;
  	struct ft1000_info *info;
 -    struct ft1000_usb *ft1000dev;
 -    int result=0;
 -    int cmd;
 -    int i;
 -    u16 tempword;
 -    unsigned long flags;
 +	struct ft1000_usb *ft1000dev;
 +	int result = 0;
 +	int cmd;
 +	int i;
 +	u16 tempword;
 +	unsigned long flags;
- 	struct timeval tv;
+ 	time64_t time;
  	struct IOCTL_GET_VER get_ver_data;
  	struct IOCTL_GET_DSP_STAT get_stat_data;
 -    u8 ConnectionMsg[] = {0x00,0x44,0x10,0x20,0x80,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x93,0x64,
 -                          0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x0a,
 -                          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 -                          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 -                          0x00,0x00,0x02,0x37,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x01,0x00,0x01,0x7f,0x00,
 -                          0x00,0x01,0x00,0x00};
 +	u8 ConnectionMsg[] = {0x00, 0x44, 0x10, 0x20, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x93, 0x64,
 +			      0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0a,
 +			      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 +			      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 +			      0x00, 0x00, 0x02, 0x37, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x7f, 0x00,
 +			      0x00, 0x01, 0x00, 0x00};
 +
 +	unsigned short ledStat = 0;
 +	unsigned short conStat = 0;
 +
 +	if (ft1000_flarion_cnt == 0) {
 +		pr_debug("called with ft1000_flarion_cnt of zero\n");
 +		return -EBADF;
 +	}
  
 -    unsigned short ledStat=0;
 -    unsigned short conStat=0;
 +	/* pr_debug("command = 0x%x argument = 0x%8x\n", command, (u32)argument); */
  
 -    /* DEBUG("ft1000_ioctl called\n"); */
 +	info = file->private_data;
 +	ft1000dev = info->priv;
 +	cmd = _IOC_NR(command);
 +	/* pr_debug("cmd = 0x%x\n", cmd); */
 +
 +	/* process the command */
 +	switch (cmd) {
 +	case IOCTL_REGISTER_CMD:
 +		pr_debug("IOCTL_FT1000_REGISTER called\n");
 +		result = get_user(tempword, (__u16 __user *)argp);
 +		if (result) {
 +			pr_debug("result = %d failed to get_user\n", result);
 +			break;
 +		}
 +		if (tempword == DSPBCMSGID) {
 +			/* Search for matching file object */
 +			for (i = 0; i < MAX_NUM_APP; i++) {
 +				if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
 +					ft1000dev->app_info[i].DspBCMsgFlag = 1;
 +					pr_debug("Registered for broadcast messages\n");
 +					break;
 +				}
 +			}
 +		}
 +		break;
  
 -    if (ft1000_flarion_cnt == 0) {
 -        DEBUG("FT1000:ft1000_ioctl called when ft1000_flarion_cnt is zero\n");
 -        return (-EBADF);
 -    }
 +	case IOCTL_GET_VER_CMD:
 +		pr_debug("IOCTL_FT1000_GET_VER called\n");
  
 -    /* DEBUG("FT1000:ft1000_ioctl:command = 0x%x argument = 0x%8x\n", command, (u32)argument); */
 +		get_ver_data.drv_ver = FT1000_DRV_VER;
  
++<<<<<<< HEAD
 +		if (copy_to_user(argp, &get_ver_data, sizeof(get_ver_data))) {
 +			pr_debug("copy fault occurred\n");
 +			result = -EFAULT;
 +			break;
 +		}
 +
 +		pr_debug("driver version = 0x%x\n",
 +			 (unsigned int)get_ver_data.drv_ver);
 +
 +		break;
 +	case IOCTL_CONNECT:
 +		/* Connect Message */
 +		pr_debug("IOCTL_FT1000_CONNECT\n");
 +		ConnectionMsg[79] = 0xfc;
 +		result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
 +
 +		break;
 +	case IOCTL_DISCONNECT:
 +		/* Disconnect Message */
 +		pr_debug("IOCTL_FT1000_DISCONNECT\n");
 +		ConnectionMsg[79] = 0xfd;
 +		result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
 +		break;
 +	case IOCTL_GET_DSP_STAT_CMD:
 +		/* pr_debug("IOCTL_FT1000_GET_DSP_STAT\n"); */
 +		memset(&get_stat_data, 0, sizeof(get_stat_data));
 +		memcpy(get_stat_data.DspVer, info->DspVer, DSPVERSZ);
 +		memcpy(get_stat_data.HwSerNum, info->HwSerNum, HWSERNUMSZ);
 +		memcpy(get_stat_data.Sku, info->Sku, SKUSZ);
 +		memcpy(get_stat_data.eui64, info->eui64, EUISZ);
 +
 +		if (info->ProgConStat != 0xFF) {
 +			ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_LED, (u8 *)&ledStat, FT1000_MAG_DSP_LED_INDX);
 +			get_stat_data.LedStat = ntohs(ledStat);
 +			pr_debug("LedStat = 0x%x\n", get_stat_data.LedStat);
 +			ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_CON_STATE, (u8 *)&conStat, FT1000_MAG_DSP_CON_STATE_INDX);
 +			get_stat_data.ConStat = ntohs(conStat);
 +			pr_debug("ConStat = 0x%x\n", get_stat_data.ConStat);
 +		} else {
 +			get_stat_data.ConStat = 0x0f;
 +		}
 +
 +
 +		get_stat_data.nTxPkts = info->stats.tx_packets;
 +		get_stat_data.nRxPkts = info->stats.rx_packets;
 +		get_stat_data.nTxBytes = info->stats.tx_bytes;
 +		get_stat_data.nRxBytes = info->stats.rx_bytes;
- 		do_gettimeofday(&tv);
- 		get_stat_data.ConTm = (u32)(tv.tv_sec - info->ConTm);
++		time = get_seconds();
++		get_stat_data.ConTm = time - info->ConTm;
 +		pr_debug("Connection Time = %d\n", (int)get_stat_data.ConTm);
 +		if (copy_to_user(argp, &get_stat_data, sizeof(get_stat_data))) {
 +			pr_debug("copy fault occurred\n");
 +			result = -EFAULT;
 +			break;
 +		}
 +		pr_debug("GET_DSP_STAT succeed\n");
 +		break;
 +	case IOCTL_SET_DPRAM_CMD:
 +	{
++=======
+ 	info = file->private_data;
+ 	ft1000dev = info->priv;
+     cmd = _IOC_NR(command);
+     /* DEBUG("FT1000:ft1000_ioctl:cmd = 0x%x\n", cmd); */
+ 
+     /* process the command */
+     switch (cmd) {
+     case IOCTL_REGISTER_CMD:
+             DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_REGISTER called\n");
+             result = get_user(tempword, (__u16 __user*)argp);
+             if (result) {
+                 DEBUG("result = %d failed to get_user\n", result);
+                 break;
+             }
+             if (tempword == DSPBCMSGID) {
+                 /* Search for matching file object */
+                 for (i=0; i<MAX_NUM_APP; i++) {
+                     if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
+                         ft1000dev->app_info[i].DspBCMsgFlag = 1;
+                         DEBUG("FT1000:ft1000_ioctl:Registered for broadcast messages\n");
+                         break;
+                     }
+                 }
+             }
+             break;
+ 
+     case IOCTL_GET_VER_CMD:
+         DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_VER called\n");
+ 
+         get_ver_data.drv_ver = FT1000_DRV_VER;
+ 
+         if (copy_to_user(argp, &get_ver_data, sizeof(get_ver_data))) {
+             DEBUG("FT1000:ft1000_ioctl: copy fault occurred\n");
+             result = -EFAULT;
+             break;
+         }
+ 
+         DEBUG("FT1000:ft1000_ioctl:driver version = 0x%x\n",(unsigned int)get_ver_data.drv_ver);
+ 
+         break;
+     case IOCTL_CONNECT:
+         /* Connect Message */
+         DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_CONNECT\n");
+         ConnectionMsg[79] = 0xfc;
+ 			   result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
+ 
+         break;
+     case IOCTL_DISCONNECT:
+         /* Disconnect Message */
+         DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_DISCONNECT\n");
+         ConnectionMsg[79] = 0xfd;
+ 			   result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c);
+         break;
+     case IOCTL_GET_DSP_STAT_CMD:
+         /* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_DSP_STAT called\n"); */
+ 	memset(&get_stat_data, 0, sizeof(get_stat_data));
+         memcpy(get_stat_data.DspVer, info->DspVer, DSPVERSZ);
+         memcpy(get_stat_data.HwSerNum, info->HwSerNum, HWSERNUMSZ);
+         memcpy(get_stat_data.Sku, info->Sku, SKUSZ);
+         memcpy(get_stat_data.eui64, info->eui64, EUISZ);
+ 
+             if (info->ProgConStat != 0xFF) {
+                 ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_LED, (u8 *)&ledStat, FT1000_MAG_DSP_LED_INDX);
+                 get_stat_data.LedStat = ntohs(ledStat);
+                 DEBUG("FT1000:ft1000_ioctl: LedStat = 0x%x\n", get_stat_data.LedStat);
+                 ft1000_read_dpram16(ft1000dev, FT1000_MAG_DSP_CON_STATE, (u8 *)&conStat, FT1000_MAG_DSP_CON_STATE_INDX);
+                 get_stat_data.ConStat = ntohs(conStat);
+                 DEBUG("FT1000:ft1000_ioctl: ConStat = 0x%x\n", get_stat_data.ConStat);
+             } else {
+                 get_stat_data.ConStat = 0x0f;
+             }
+ 
+ 
+         get_stat_data.nTxPkts = info->stats.tx_packets;
+         get_stat_data.nRxPkts = info->stats.rx_packets;
+         get_stat_data.nTxBytes = info->stats.tx_bytes;
+         get_stat_data.nRxBytes = info->stats.rx_bytes;
 -	time = get_seconds();
 -	get_stat_data.ConTm = time - info->ConTm;
+         DEBUG("Connection Time = %d\n", (int)get_stat_data.ConTm);
+         if (copy_to_user(argp, &get_stat_data, sizeof(get_stat_data))) {
+             DEBUG("FT1000:ft1000_ioctl: copy fault occurred\n");
+             result = -EFAULT;
+             break;
+         }
+         DEBUG("ft1000_chioctl: GET_DSP_STAT succeed\n");
+         break;
+     case IOCTL_SET_DPRAM_CMD:
+         {
++>>>>>>> y2038/y2038
  		struct IOCTL_DPRAM_BLK *dpram_data = NULL;
  		/* struct IOCTL_DPRAM_COMMAND dpram_command; */
 -            u16 qtype;
 -            u16 msgsz;
 +		u16 qtype;
 +		u16 msgsz;
  		struct pseudo_hdr *ppseudo_hdr;
 -            u16 *pmsg;
 -            u16 total_len;
 -            u16 app_index;
 -            u16 status;
 -
 -            /* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_SET_DPRAM called\n");*/
 +		u16 *pmsg;
 +		u16 total_len;
 +		u16 app_index;
 +		u16 status;
  
 +		/* pr_debug("IOCTL_FT1000_SET_DPRAM called\n");*/
  
 -            if (ft1000_flarion_cnt == 0) {
 -                return (-EBADF);
 -            }
  
 -            if (ft1000dev->DrvMsgPend) {
 -                return (-ENOTTY);
 -            }
 +		if (ft1000_flarion_cnt == 0)
 +			return -EBADF;
  
 -            if (ft1000dev->fProvComplete == 0) {
 -                return (-EACCES);
 -            }
 +		if (ft1000dev->DrvMsgPend)
 +			return -ENOTTY;
  
 -            ft1000dev->fAppMsgPend = 1;
 +		if (ft1000dev->fProvComplete == 0)
 +			return -EACCES;
  
 -            if (info->CardReady) {
 +		ft1000dev->fAppMsgPend = 1;
  
 -               /* DEBUG("FT1000:ft1000_ioctl: try to SET_DPRAM \n"); */
 +		if (info->CardReady) {
  
 -                /* Get the length field to see how many bytes to copy */
 -                result = get_user(msgsz, (__u16 __user *)argp);
 -		if (result)
 -			break;
 -                msgsz = ntohs(msgsz);
 -                /* DEBUG("FT1000:ft1000_ioctl: length of message = %d\n", msgsz); */
 +			/* pr_debug("try to SET_DPRAM\n"); */
  
 -                if (msgsz > MAX_CMD_SQSIZE) {
 -                    DEBUG("FT1000:ft1000_ioctl: bad message length = %d\n", msgsz);
 -                    result = -EINVAL;
 -                    break;
 -                }
 +			/* Get the length field to see how many bytes to copy */
 +			result = get_user(msgsz, (__u16 __user *)argp);
 +			if (result)
 +				break;
 +			msgsz = ntohs(msgsz);
 +			/* pr_debug("length of message = %d\n", msgsz); */
  
 -		result = -ENOMEM;
 -		dpram_data = kmalloc(msgsz + 2, GFP_KERNEL);
 -		if (!dpram_data)
 -			break;
 +			if (msgsz > MAX_CMD_SQSIZE) {
 +				pr_debug("bad message length = %d\n", msgsz);
 +				result = -EINVAL;
 +				break;
 +			}
  
 -                if (copy_from_user(dpram_data, argp, msgsz+2)) {
 -                    DEBUG("FT1000:ft1000_ChIoctl: copy fault occurred\n");
 -                    result = -EFAULT;
 -                } else {
 -                    /* Check if this message came from a registered application */
 -                    for (i=0; i<MAX_NUM_APP; i++) {
 -                        if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
 -                            break;
 -                        }
 -                    }
 -                    if (i==MAX_NUM_APP) {
 -                        DEBUG("FT1000:No matching application fileobject\n");
 -                        result = -EINVAL;
 -			kfree(dpram_data);
 -                        break;
 -                    }
 -                    app_index = i;
 -
 -                    /* Check message qtype type which is the lower byte within qos_class */
 -                    qtype = ntohs(dpram_data->pseudohdr.qos_class) & 0xff;
 -                    /* DEBUG("FT1000_ft1000_ioctl: qtype = %d\n", qtype); */
 -                    if (qtype) {
 -                    } else {
 -                        /* Put message into Slow Queue */
 -                        /* Only put a message into the DPRAM if msg doorbell is available */
 -                        status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 -                        /* DEBUG("FT1000_ft1000_ioctl: READ REGISTER tempword=%x\n", tempword); */
 -                        if (tempword & FT1000_DB_DPRAM_TX) {
 -                            /* Suspend for 2ms and try again due to DSP doorbell busy */
 -                            mdelay(2);
 -                            status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 -                            if (tempword & FT1000_DB_DPRAM_TX) {
 -                                /* Suspend for 1ms and try again due to DSP doorbell busy */
 -                                mdelay(1);
 -                                status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 -                                if (tempword & FT1000_DB_DPRAM_TX) {
 -                                    status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 -                                    if (tempword & FT1000_DB_DPRAM_TX) {
 -                                        /* Suspend for 3ms and try again due to DSP doorbell busy */
 -                                        mdelay(3);
 -                                        status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 -                                        if (tempword & FT1000_DB_DPRAM_TX) {
 -                                            DEBUG("FT1000:ft1000_ioctl:Doorbell not available\n");
 -                                            result = -ENOTTY;
 -						kfree(dpram_data);
 -                                            break;
 -                                        }
 -                                    }
 -                                }
 -                            }
 -                        }
 -
 -                        /*DEBUG("FT1000_ft1000_ioctl: finished reading register\n"); */
 -
 -                        /* Make sure we are within the limits of the slow queue memory limitation */
 -                        if ((msgsz < MAX_CMD_SQSIZE) && (msgsz > PSEUDOSZ)) {
 -                            /* Need to put sequence number plus new checksum for message */
 -                            pmsg = (u16 *)&dpram_data->pseudohdr;
 -				ppseudo_hdr = (struct pseudo_hdr *)pmsg;
 -                            total_len = msgsz+2;
 -                            if (total_len & 0x1) {
 -                                total_len++;
 -                            }
 -
 -                            /* Insert slow queue sequence number */
 -                            ppseudo_hdr->seq_num = info->squeseqnum++;
 -                            ppseudo_hdr->portsrc = ft1000dev->app_info[app_index].app_id;
 -                            /* Calculate new checksum */
 -                            ppseudo_hdr->checksum = *pmsg++;
 -                            /* DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum); */
 -                            for (i=1; i<7; i++) {
 -                                ppseudo_hdr->checksum ^= *pmsg++;
 -                                /* DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum); */
 -                            }
 -                            pmsg++;
 -				ppseudo_hdr = (struct pseudo_hdr *)pmsg;
 -                           result = card_send_command(ft1000dev,(unsigned short*)dpram_data,total_len+2);
 -
 -
 -                            ft1000dev->app_info[app_index].nTxMsg++;
 -                        } else {
 -                            result = -EINVAL;
 -                        }
 -                    }
 -                }
 -            } else {
 -                DEBUG("FT1000:ft1000_ioctl: Card not ready take messages\n");
 -                result = -EACCES;
 -            }
 -	    kfree(dpram_data);
 +			result = -ENOMEM;
 +			dpram_data = kmalloc(msgsz + 2, GFP_KERNEL);
 +			if (!dpram_data)
 +				break;
 +
 +			if (copy_from_user(dpram_data, argp, msgsz+2)) {
 +				pr_debug("copy fault occurred\n");
 +				result = -EFAULT;
 +			} else {
 +				/* Check if this message came from a registered application */
 +				for (i = 0; i < MAX_NUM_APP; i++) {
 +					if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
 +						break;
 +					}
 +				}
 +				if (i == MAX_NUM_APP) {
 +					pr_debug("No matching application fileobject\n");
 +					result = -EINVAL;
 +					kfree(dpram_data);
 +					break;
 +				}
 +				app_index = i;
 +
 +				/* Check message qtype type which is the lower byte within qos_class */
 +				qtype = ntohs(dpram_data->pseudohdr.qos_class) & 0xff;
 +				/* pr_debug("qtype = %d\n", qtype); */
 +				if (qtype) {
 +				} else {
 +					/* Put message into Slow Queue */
 +					/* Only put a message into the DPRAM if msg doorbell is available */
 +					status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 +					/* pr_debug("READ REGISTER tempword=%x\n", tempword); */
 +					if (tempword & FT1000_DB_DPRAM_TX) {
 +						/* Suspend for 2ms and try again due to DSP doorbell busy */
 +						mdelay(2);
 +						status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 +						if (tempword & FT1000_DB_DPRAM_TX) {
 +							/* Suspend for 1ms and try again due to DSP doorbell busy */
 +							mdelay(1);
 +							status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 +							if (tempword & FT1000_DB_DPRAM_TX) {
 +								status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 +								if (tempword & FT1000_DB_DPRAM_TX) {
 +									/* Suspend for 3ms and try again due to DSP doorbell busy */
 +									mdelay(3);
 +									status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
 +									if (tempword & FT1000_DB_DPRAM_TX) {
 +										pr_debug("Doorbell not available\n");
 +										result = -ENOTTY;
 +										kfree(dpram_data);
 +										break;
 +									}
 +								}
 +							}
 +						}
 +					}
 +
 +					/*pr_debug("finished reading register\n"); */
 +
 +					/* Make sure we are within the limits of the slow queue memory limitation */
 +					if ((msgsz < MAX_CMD_SQSIZE) && (msgsz > PSEUDOSZ)) {
 +						/* Need to put sequence number plus new checksum for message */
 +						pmsg = (u16 *)&dpram_data->pseudohdr;
 +						ppseudo_hdr = (struct pseudo_hdr *)pmsg;
 +						total_len = msgsz+2;
 +						if (total_len & 0x1) {
 +							total_len++;
 +						}
 +
 +						/* Insert slow queue sequence number */
 +						ppseudo_hdr->seq_num = info->squeseqnum++;
 +						ppseudo_hdr->portsrc = ft1000dev->app_info[app_index].app_id;
 +						/* Calculate new checksum */
 +						ppseudo_hdr->checksum = *pmsg++;
 +						/* pr_debug("checksum = 0x%x\n", ppseudo_hdr->checksum); */
 +						for (i = 1; i < 7; i++) {
 +							ppseudo_hdr->checksum ^= *pmsg++;
 +							/* pr_debug("checksum = 0x%x\n", ppseudo_hdr->checksum); */
 +						}
 +						pmsg++;
 +						ppseudo_hdr = (struct pseudo_hdr *)pmsg;
 +						result = card_send_command(ft1000dev, (unsigned short *)dpram_data, total_len+2);
 +
 +
 +						ft1000dev->app_info[app_index].nTxMsg++;
 +					} else {
 +						result = -EINVAL;
 +					}
 +				}
 +			}
 +		} else {
 +			pr_debug("Card not ready take messages\n");
 +			result = -EACCES;
 +		}
 +		kfree(dpram_data);
  
 -        }
 -        break;
 -    case IOCTL_GET_DPRAM_CMD:
 -        {
 +	}
 +	break;
 +	case IOCTL_GET_DPRAM_CMD:
 +	{
  		struct dpram_blk *pdpram_blk;
  		struct IOCTL_DPRAM_BLK __user *pioctl_dpram;
 -            int msglen;
 -
 -            /* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_DPRAM called\n"); */
 +		int msglen;
  
 -            if (ft1000_flarion_cnt == 0) {
 -                return (-EBADF);
 -            }
 +		/* pr_debug("IOCTL_FT1000_GET_DPRAM called\n"); */
  
 -            /* Search for matching file object */
 -            for (i=0; i<MAX_NUM_APP; i++) {
 -                if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
 -                    /*DEBUG("FT1000:ft1000_ioctl: Message is for AppId = %d\n", ft1000dev->app_info[i].app_id); */
 -                    break;
 -                }
 -            }
 +		if (ft1000_flarion_cnt == 0)
 +			return -EBADF;
  
 -            /* Could not find application info block */
 -            if (i == MAX_NUM_APP) {
 -                DEBUG("FT1000:ft1000_ioctl:Could not find application info block\n");
 -                result = -EBADF;
 -                break;
 -            }
 +		/* Search for matching file object */
 +		for (i = 0; i < MAX_NUM_APP; i++) {
 +			if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
 +				/*pr_debug("Message is for AppId = %d\n", ft1000dev->app_info[i].app_id); */
 +				break;
 +			}
 +		}
  
 -            result = 0;
 -            pioctl_dpram = argp;
 -            if (list_empty(&ft1000dev->app_info[i].app_sqlist) == 0) {
 -                /* DEBUG("FT1000:ft1000_ioctl:Message detected in slow queue\n"); */
 -                spin_lock_irqsave(&free_buff_lock, flags);
 -                pdpram_blk = list_entry(ft1000dev->app_info[i].app_sqlist.next, struct dpram_blk, list);
 -                list_del(&pdpram_blk->list);
 -                ft1000dev->app_info[i].NumOfMsg--;
 -                /* DEBUG("FT1000:ft1000_ioctl:NumOfMsg for app %d = %d\n", i, ft1000dev->app_info[i].NumOfMsg); */
 -                spin_unlock_irqrestore(&free_buff_lock, flags);
 -                msglen = ntohs(*(u16 *)pdpram_blk->pbuffer) + PSEUDOSZ;
 -                result = get_user(msglen, &pioctl_dpram->total_len);
 -		if (result)
 +		/* Could not find application info block */
 +		if (i == MAX_NUM_APP) {
 +			pr_debug("Could not find application info block\n");
 +			result = -EBADF;
  			break;
 -		msglen = htons(msglen);
 -                /* DEBUG("FT1000:ft1000_ioctl:msg length = %x\n", msglen); */
 -                if (copy_to_user (&pioctl_dpram->pseudohdr, pdpram_blk->pbuffer, msglen)) {
 -					DEBUG("FT1000:ft1000_ioctl: copy fault occurred\n");
 -			result = -EFAULT;
 -			break;
 -				}
 +		}
  
 -                ft1000_free_buffer(pdpram_blk, &freercvpool);
 -                result = msglen;
 -            }
 -            /* DEBUG("FT1000:ft1000_ioctl: IOCTL_FT1000_GET_DPRAM no message\n"); */
 -        }
 -        break;
 +		result = 0;
 +		pioctl_dpram = argp;
 +		if (list_empty(&ft1000dev->app_info[i].app_sqlist) == 0) {
 +			/* pr_debug("Message detected in slow queue\n"); */
 +			spin_lock_irqsave(&free_buff_lock, flags);
 +			pdpram_blk = list_entry(ft1000dev->app_info[i].app_sqlist.next, struct dpram_blk, list);
 +			list_del(&pdpram_blk->list);
 +			ft1000dev->app_info[i].NumOfMsg--;
 +			/* pr_debug("NumOfMsg for app %d = %d\n", i, ft1000dev->app_info[i].NumOfMsg); */
 +			spin_unlock_irqrestore(&free_buff_lock, flags);
 +			msglen = ntohs(*(u16 *)pdpram_blk->pbuffer) + PSEUDOSZ;
 +			result = get_user(msglen, &pioctl_dpram->total_len);
 +			if (result)
 +				break;
 +			msglen = htons(msglen);
 +			/* pr_debug("msg length = %x\n", msglen); */
 +			if (copy_to_user(&pioctl_dpram->pseudohdr, pdpram_blk->pbuffer, msglen)) {
 +				pr_debug("copy fault occurred\n");
 +				result = -EFAULT;
 +				break;
 +			}
  
 -    default:
 -        DEBUG("FT1000:ft1000_ioctl:unknown command: 0x%x\n", command);
 -        result = -ENOTTY;
 -        break;
 -    }
 -    ft1000dev->fAppMsgPend = 0;
 -    return result;
 +			ft1000_free_buffer(pdpram_blk, &freercvpool);
 +			result = msglen;
 +		}
 +		/* pr_debug("IOCTL_FT1000_GET_DPRAM no message\n"); */
 +	}
 +	break;
 +
 +	default:
 +		pr_debug("unknown command: 0x%x\n", command);
 +		result = -ENOTTY;
 +		break;
 +	}
 +	ft1000dev->fAppMsgPend = 0;
 +	return result;
  }
  
  /*

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* linux-next: manual merge of the y2038 tree with the staging tree
@ 2014-11-06  4:43 Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2014-11-06  4:43 UTC (permalink / raw)
  To: Arnd Bergmann, Greg KH
  Cc: linux-next, linux-kernel, Tapasweni Pathak, Joe Perches

[-- Attachment #1: Type: text/plain, Size: 2017 bytes --]

Hi Arnd,

Today's linux-next merge of the y2038 tree got a conflict in
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c between commit
ecdd21c7b982 ("staging: ft1000: Whitespace neatening") from the staging
tree and commit 4115d2b27a50 ("staging: ft1000: Replace timeval and
time_t with time64_t") from the y2038 tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
index 11dbe369e18b,9a9655cdc64d..000000000000
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
@@@ -1019,29 -1055,19 +1019,29 @@@ static void ft1000_proc_drvmsg(struct n
  			info->CardReady = 1;
  			break;
  		case MEDIA_STATE:
 -			pmediamsg = (struct media_msg *) & cmdbuffer[0];
 +			pmediamsg = (struct media_msg *)&cmdbuffer[0];
  			if (info->ProgConStat != 0xFF) {
 -			if (pmediamsg->state) {
 -				DEBUG(1, "Media is up\n");
 -				if (info->mediastate == 0) {
 -					netif_carrier_on(dev);
 -					netif_wake_queue(dev);
 -					info->mediastate = 1;
 -					time = get_seconds();
 -					info->ConTm = time;
 +				if (pmediamsg->state) {
 +					pr_debug("Media is up\n");
 +					if (info->mediastate == 0) {
 +						netif_carrier_on(dev);
 +						netif_wake_queue(dev);
 +						info->mediastate = 1;
- 						do_gettimeofday(&tv);
- 						info->ConTm = tv.tv_sec;
++						time = get_seconds();
++						info->ConTm = time;
 +					}
 +				} else {
 +					pr_debug("Media is down\n");
 +					if (info->mediastate == 1) {
 +						info->mediastate = 0;
 +						netif_carrier_off(dev);
 +						netif_stop_queue(dev);
 +						info->ConTm = 0;
 +					}
  				}
 -			} else {
 -				DEBUG(1, "Media is down\n");
 +			}
 +			else {
 +				pr_debug("Media is down\n");
  				if (info->mediastate == 1) {
  					info->mediastate = 0;
  					netif_carrier_off(dev);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-06 10:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19  6:29 linux-next: manual merge of the y2038 tree with the staging tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2018-06-06 10:19 Stephen Rothwell
2015-11-01 14:44 Stephen Rothwell
2015-11-01 18:03 ` Greg KH
2014-11-06  4:48 Stephen Rothwell
2014-11-06  4:51 ` Stephen Rothwell
2014-11-06  4:43 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).