[scsi:misc-base 244/307] drivers/scsi/bfa/bfad_bsg.c:3380:34: sparse: sparse: incorrect type in argument 2 (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git misc-base
head:   bf1a28f92a8b00ee8ce48cc11338980e31ddb7b3
commit: 3bbd8ef9f780749426d4e52be0dfa3f70656d92b [244/307] scsi: bfa: Staticify all local functions
config: x86_64-randconfig-s022-20200806 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-117-g8c7aee71-dirty
        git checkout 3bbd8ef9f780749426d4e52be0dfa3f70656d92b
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

   drivers/scsi/bfa/bfad_bsg.c:2391:25: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2391:25: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2391:25: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2391:25: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2391:25: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2391:25: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2414:38: sparse: sparse: cast to restricted __be16
   drivers/scsi/bfa/bfad_bsg.c:2414:38: sparse: sparse: cast to restricted __be16
   drivers/scsi/bfa/bfad_bsg.c:2414:38: sparse: sparse: cast to restricted __be16
   drivers/scsi/bfa/bfad_bsg.c:2414:38: sparse: sparse: cast to restricted __be16
   drivers/scsi/bfa/bfad_bsg.c:2415:38: sparse: sparse: cast to restricted __be16
   drivers/scsi/bfa/bfad_bsg.c:2415:38: sparse: sparse: cast to restricted __be16
   drivers/scsi/bfa/bfad_bsg.c:2415:38: sparse: sparse: cast to restricted __be16
   drivers/scsi/bfa/bfad_bsg.c:2415:38: sparse: sparse: cast to restricted __be16
   drivers/scsi/bfa/bfad_bsg.c:2417:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2417:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2417:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2417:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2417:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2417:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/bfa/bfad_bsg.c:2551:9: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] scan_flags @@     got restricted blist_flags_t @@
   drivers/scsi/bfa/bfad_bsg.c:2551:9: sparse:     expected unsigned int [usertype] scan_flags
   drivers/scsi/bfa/bfad_bsg.c:2551:9: sparse:     got restricted blist_flags_t
   drivers/scsi/bfa/bfad_bsg.c:2551:9: sparse: sparse: invalid assignment: |=
   drivers/scsi/bfa/bfad_bsg.c:2551:9: sparse:    left side has type restricted blist_flags_t
   drivers/scsi/bfa/bfad_bsg.c:2551:9: sparse:    right side has type unsigned int
   drivers/scsi/bfa/bfad_bsg.c:2551:9: sparse: sparse: invalid assignment: &=
   drivers/scsi/bfa/bfad_bsg.c:2551:9: sparse:    left side has type restricted blist_flags_t
   drivers/scsi/bfa/bfad_bsg.c:2551:9: sparse:    right side has type unsigned int
   drivers/scsi/bfa/bfad_bsg.c:2555:17: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] scan_flags @@     got restricted blist_flags_t @@
   drivers/scsi/bfa/bfad_bsg.c:2555:17: sparse:     expected unsigned int [usertype] scan_flags
   drivers/scsi/bfa/bfad_bsg.c:2555:17: sparse:     got restricted blist_flags_t
   drivers/scsi/bfa/bfad_bsg.c:2555:17: sparse: sparse: invalid assignment: |=
   drivers/scsi/bfa/bfad_bsg.c:2555:17: sparse:    left side has type restricted blist_flags_t
   drivers/scsi/bfa/bfad_bsg.c:2555:17: sparse:    right side has type unsigned int
   drivers/scsi/bfa/bfad_bsg.c:2555:17: sparse: sparse: invalid assignment: &=
   drivers/scsi/bfa/bfad_bsg.c:2555:17: sparse:    left side has type restricted blist_flags_t
   drivers/scsi/bfa/bfad_bsg.c:2555:17: sparse:    right side has type unsigned int
>> drivers/scsi/bfa/bfad_bsg.c:3380:34: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] <asn:1> *from @@     got void * @@
>> drivers/scsi/bfa/bfad_bsg.c:3380:34: sparse:     expected void const [noderef] <asn:1> *from
   drivers/scsi/bfa/bfad_bsg.c:3380:34: sparse:     got void *
   drivers/scsi/bfa/bfad_bsg.c:3412:37: sparse: sparse: Using plain integer as NULL pointer
>> drivers/scsi/bfa/bfad_bsg.c:3534:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] <asn:1> *to @@     got void * @@
>> drivers/scsi/bfa/bfad_bsg.c:3534:27: sparse:     expected void [noderef] <asn:1> *to
   drivers/scsi/bfa/bfad_bsg.c:3534:27: sparse:     got void *

vim +3380 drivers/scsi/bfa/bfad_bsg.c

b85daafe46eeb0 Krishna Gudipati   2011-06-13  3340  
3bbd8ef9f78074 Lee Jones          2020-07-21  3341  static int
75cc8cfc6e13d4 Johannes Thumshirn 2016-11-17  3342  bfad_im_bsg_els_ct_request(struct bsg_job *job)
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3343  {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3344  	struct bfa_bsg_data *bsg_data;
45349821ab3a8d Johannes Thumshirn 2017-11-28  3345  	struct Scsi_Host *shost = fc_bsg_to_shost(job);
48d83282db077f Arnd Bergmann      2017-12-06  3346  	struct bfad_im_port_s *im_port = bfad_get_im_port(shost);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3347  	struct bfad_s *bfad = im_port->bfad;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3348  	bfa_bsg_fcpt_t *bsg_fcpt;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3349  	struct bfad_fcxp    *drv_fcxp;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3350  	struct bfa_fcs_lport_s *fcs_port;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3351  	struct bfa_fcs_rport_s *fcs_rport;
4633773799940b Johannes Thumshirn 2017-01-10  3352  	struct fc_bsg_request *bsg_request = job->request;
01e0e15c8b3b32 Johannes Thumshirn 2016-11-17  3353  	struct fc_bsg_reply *bsg_reply = job->reply;
01e0e15c8b3b32 Johannes Thumshirn 2016-11-17  3354  	uint32_t command_type = bsg_request->msgcode;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3355  	unsigned long flags;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3356  	struct bfad_buf_info *rsp_buf_info;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3357  	void *req_kbuf = NULL, *rsp_kbuf = NULL;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3358  	int rc = -EINVAL;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3359  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3360  	job->reply_len  = sizeof(uint32_t);	/* Atleast uint32_t reply_len */
01e0e15c8b3b32 Johannes Thumshirn 2016-11-17  3361  	bsg_reply->reply_payload_rcv_len = 0;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3362  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3363  	/* Get the payload passed in from userspace */
01e0e15c8b3b32 Johannes Thumshirn 2016-11-17  3364  	bsg_data = (struct bfa_bsg_data *) (((char *)bsg_request) +
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3365  					    sizeof(struct fc_bsg_request));
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3366  	if (bsg_data == NULL)
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3367  		goto out;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3368  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3369  	/*
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3370  	 * Allocate buffer for bsg_fcpt and do a copy_from_user op for payload
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3371  	 * buffer of size bsg_data->payload_len
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3372  	 */
64b8aa75bc101e Jesper Juhl        2012-01-28  3373  	bsg_fcpt = kzalloc(bsg_data->payload_len, GFP_KERNEL);
529f9a765509c2 Krishna Gudipati   2012-07-13  3374  	if (!bsg_fcpt) {
529f9a765509c2 Krishna Gudipati   2012-07-13  3375  		rc = -ENOMEM;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3376  		goto out;
529f9a765509c2 Krishna Gudipati   2012-07-13  3377  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3378  
bccd2683df56dd Vijaya Mohan Guvva 2013-05-13  3379  	if (copy_from_user((uint8_t *)bsg_fcpt,
bccd2683df56dd Vijaya Mohan Guvva 2013-05-13 @3380  				(void *)(unsigned long)bsg_data->payload,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3381  				bsg_data->payload_len)) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3382  		kfree(bsg_fcpt);
529f9a765509c2 Krishna Gudipati   2012-07-13  3383  		rc = -EIO;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3384  		goto out;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3385  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3386  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3387  	drv_fcxp = kzalloc(sizeof(struct bfad_fcxp), GFP_KERNEL);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3388  	if (drv_fcxp == NULL) {
64b8aa75bc101e Jesper Juhl        2012-01-28  3389  		kfree(bsg_fcpt);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3390  		rc = -ENOMEM;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3391  		goto out;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3392  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3393  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3394  	spin_lock_irqsave(&bfad->bfad_lock, flags);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3395  	fcs_port = bfa_fcs_lookup_port(&bfad->bfa_fcs, bsg_fcpt->vf_id,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3396  					bsg_fcpt->lpwwn);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3397  	if (fcs_port == NULL) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3398  		bsg_fcpt->status = BFA_STATUS_UNKNOWN_LWWN;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3399  		spin_unlock_irqrestore(&bfad->bfad_lock, flags);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3400  		goto out_free_mem;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3401  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3402  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3403  	/* Check if the port is online before sending FC Passthru cmd */
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3404  	if (!bfa_fcs_lport_is_online(fcs_port)) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3405  		bsg_fcpt->status = BFA_STATUS_PORT_OFFLINE;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3406  		spin_unlock_irqrestore(&bfad->bfad_lock, flags);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3407  		goto out_free_mem;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3408  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3409  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3410  	drv_fcxp->port = fcs_port->bfad_port;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3411  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3412  	if (drv_fcxp->port->bfad == 0)
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3413  		drv_fcxp->port->bfad = bfad;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3414  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3415  	/* Fetch the bfa_rport - if nexus needed */
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3416  	if (command_type == FC_BSG_HST_ELS_NOLOGIN ||
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3417  	    command_type == FC_BSG_HST_CT) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3418  		/* BSG HST commands: no nexus needed */
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3419  		drv_fcxp->bfa_rport = NULL;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3420  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3421  	} else if (command_type == FC_BSG_RPT_ELS ||
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3422  		   command_type == FC_BSG_RPT_CT) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3423  		/* BSG RPT commands: nexus needed */
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3424  		fcs_rport = bfa_fcs_lport_get_rport_by_pwwn(fcs_port,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3425  							    bsg_fcpt->dpwwn);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3426  		if (fcs_rport == NULL) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3427  			bsg_fcpt->status = BFA_STATUS_UNKNOWN_RWWN;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3428  			spin_unlock_irqrestore(&bfad->bfad_lock, flags);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3429  			goto out_free_mem;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3430  		}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3431  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3432  		drv_fcxp->bfa_rport = fcs_rport->bfa_rport;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3433  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3434  	} else { /* Unknown BSG msgcode; return -EINVAL */
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3435  		spin_unlock_irqrestore(&bfad->bfad_lock, flags);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3436  		goto out_free_mem;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3437  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3438  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3439  	spin_unlock_irqrestore(&bfad->bfad_lock, flags);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3440  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3441  	/* allocate memory for req / rsp buffers */
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3442  	req_kbuf = kzalloc(job->request_payload.payload_len, GFP_KERNEL);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3443  	if (!req_kbuf) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3444  		printk(KERN_INFO "bfa %s: fcpt request buffer alloc failed\n",
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3445  				bfad->pci_name);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3446  		rc = -ENOMEM;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3447  		goto out_free_mem;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3448  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3449  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3450  	rsp_kbuf = kzalloc(job->reply_payload.payload_len, GFP_KERNEL);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3451  	if (!rsp_kbuf) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3452  		printk(KERN_INFO "bfa %s: fcpt response buffer alloc failed\n",
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3453  				bfad->pci_name);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3454  		rc = -ENOMEM;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3455  		goto out_free_mem;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3456  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3457  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3458  	/* map req sg - copy the sg_list passed in to the linear buffer */
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3459  	sg_copy_to_buffer(job->request_payload.sg_list,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3460  			  job->request_payload.sg_cnt, req_kbuf,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3461  			  job->request_payload.payload_len);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3462  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3463  	drv_fcxp->reqbuf_info = bfad_fcxp_map_sg(bfad, req_kbuf,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3464  					job->request_payload.payload_len,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3465  					&drv_fcxp->num_req_sgles);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3466  	if (!drv_fcxp->reqbuf_info) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3467  		printk(KERN_INFO "bfa %s: fcpt request fcxp_map_sg failed\n",
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3468  				bfad->pci_name);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3469  		rc = -ENOMEM;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3470  		goto out_free_mem;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3471  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3472  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3473  	drv_fcxp->req_sge = (struct bfa_sge_s *)
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3474  			    (((uint8_t *)drv_fcxp->reqbuf_info) +
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3475  			    (sizeof(struct bfad_buf_info) *
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3476  					drv_fcxp->num_req_sgles));
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3477  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3478  	/* map rsp sg */
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3479  	drv_fcxp->rspbuf_info = bfad_fcxp_map_sg(bfad, rsp_kbuf,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3480  					job->reply_payload.payload_len,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3481  					&drv_fcxp->num_rsp_sgles);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3482  	if (!drv_fcxp->rspbuf_info) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3483  		printk(KERN_INFO "bfa %s: fcpt response fcxp_map_sg failed\n",
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3484  				bfad->pci_name);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3485  		rc = -ENOMEM;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3486  		goto out_free_mem;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3487  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3488  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3489  	rsp_buf_info = (struct bfad_buf_info *)drv_fcxp->rspbuf_info;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3490  	drv_fcxp->rsp_sge = (struct bfa_sge_s  *)
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3491  			    (((uint8_t *)drv_fcxp->rspbuf_info) +
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3492  			    (sizeof(struct bfad_buf_info) *
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3493  					drv_fcxp->num_rsp_sgles));
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3494  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3495  	/* fcxp send */
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3496  	init_completion(&drv_fcxp->comp);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3497  	rc = bfad_fcxp_bsg_send(job, drv_fcxp, bsg_fcpt);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3498  	if (rc == BFA_STATUS_OK) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3499  		wait_for_completion(&drv_fcxp->comp);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3500  		bsg_fcpt->status = drv_fcxp->req_status;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3501  	} else {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3502  		bsg_fcpt->status = rc;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3503  		goto out_free_mem;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3504  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3505  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3506  	/* fill the job->reply data */
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3507  	if (drv_fcxp->req_status == BFA_STATUS_OK) {
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3508  		job->reply_len = drv_fcxp->rsp_len;
01e0e15c8b3b32 Johannes Thumshirn 2016-11-17  3509  		bsg_reply->reply_payload_rcv_len = drv_fcxp->rsp_len;
01e0e15c8b3b32 Johannes Thumshirn 2016-11-17  3510  		bsg_reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3511  	} else {
01e0e15c8b3b32 Johannes Thumshirn 2016-11-17  3512  		bsg_reply->reply_payload_rcv_len =
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3513  					sizeof(struct fc_bsg_ctels_reply);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3514  		job->reply_len = sizeof(uint32_t);
01e0e15c8b3b32 Johannes Thumshirn 2016-11-17  3515  		bsg_reply->reply_data.ctels_reply.status =
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3516  						FC_CTELS_STATUS_REJECT;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3517  	}
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3518  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3519  	/* Copy the response data to the reply_payload sg list */
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3520  	sg_copy_from_buffer(job->reply_payload.sg_list,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3521  			    job->reply_payload.sg_cnt,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3522  			    (uint8_t *)rsp_buf_info->virt,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3523  			    job->reply_payload.payload_len);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3524  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3525  out_free_mem:
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3526  	bfad_fcxp_free_mem(bfad, drv_fcxp->rspbuf_info,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3527  			   drv_fcxp->num_rsp_sgles);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3528  	bfad_fcxp_free_mem(bfad, drv_fcxp->reqbuf_info,
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3529  			   drv_fcxp->num_req_sgles);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3530  	kfree(req_kbuf);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3531  	kfree(rsp_kbuf);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3532  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3533  	/* Need a copy to user op */
bccd2683df56dd Vijaya Mohan Guvva 2013-05-13 @3534  	if (copy_to_user((void *)(unsigned long)bsg_data->payload,
bccd2683df56dd Vijaya Mohan Guvva 2013-05-13  3535  			(void *)bsg_fcpt, bsg_data->payload_len))
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3536  		rc = -EIO;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3537  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3538  	kfree(bsg_fcpt);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3539  	kfree(drv_fcxp);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3540  out:
01e0e15c8b3b32 Johannes Thumshirn 2016-11-17  3541  	bsg_reply->result = rc;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3542  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3543  	if (rc == BFA_STATUS_OK)
06548160dfecd1 Johannes Thumshirn 2016-11-17  3544  		bsg_job_done(job, bsg_reply->result,
1abaede71560fa Johannes Thumshirn 2016-11-17  3545  			       bsg_reply->reply_payload_rcv_len);
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3546  
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3547  	return rc;
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3548  }
b85daafe46eeb0 Krishna Gudipati   2011-06-13  3549  

:::::: The code at line 3380 was first introduced by commit
:::::: bccd2683df56ddce98964f93f6984df743004240 [SCSI] bfa: driver compatibility with 32bit libs

:::::: TO: Vijaya Mohan Guvva <vmohan@xxxxxxxxxxx>
:::::: CC: James Bottomley <JBottomley@xxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux