Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: fnic: Rename fnic_scsi_fcpio_reset()

The function has no dependency on SCSI/FCP, so rename it to
fnic_fcpio_reset() and move it to fnic_fcs.c

Tested-by: Karan Tilak Kumar <kartilak@cisco.com>
Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com>
Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com>
Reviewed-by: Arun Easi <aeasi@cisco.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
Co-developed-by: Hannes Reinecke <hare@kernel.org>
Link: https://patch.msgid.link/20260217223943.7938-3-kartilak@cisco.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Karan Tilak Kumar and committed by
Martin K. Petersen
31eda39b a59d1caf

+55 -58
+2 -2
drivers/scsi/fnic/fdls_disc.c
··· 4613 4613 if (!iport->usefip) { 4614 4614 if (iport->flags & FNIC_FIRST_LINK_UP) { 4615 4615 spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags); 4616 - fnic_scsi_fcpio_reset(iport->fnic); 4616 + fnic_fcpio_reset(iport->fnic); 4617 4617 spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags); 4618 4618 4619 4619 iport->flags &= ~FNIC_FIRST_LINK_UP; ··· 5072 5072 iport->fabric.flags = 0; 5073 5073 5074 5074 spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags); 5075 - fnic_scsi_fcpio_reset(iport->fnic); 5075 + fnic_fcpio_reset(iport->fnic); 5076 5076 spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags); 5077 5077 list_for_each_entry_safe(tport, next, &iport->tport_list, links) { 5078 5078 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
+1 -1
drivers/scsi/fnic/fip.c
··· 737 737 if (memcmp(iport->selected_fcf.fcf_mac, zmac, ETH_ALEN) != 0) { 738 738 739 739 if (iport->flags & FNIC_FIRST_LINK_UP) { 740 - fnic_scsi_fcpio_reset(iport->fnic); 740 + fnic_fcpio_reset(iport->fnic); 741 741 iport->flags &= ~FNIC_FIRST_LINK_UP; 742 742 } 743 743
-1
drivers/scsi/fnic/fnic.h
··· 513 513 void fnic_reset(struct Scsi_Host *shost); 514 514 int fnic_issue_fc_host_lip(struct Scsi_Host *shost); 515 515 void fnic_get_host_port_state(struct Scsi_Host *shost); 516 - void fnic_scsi_fcpio_reset(struct fnic *fnic); 517 516 int fnic_wq_copy_cmpl_handler(struct fnic *fnic, int copy_work_to_do, unsigned int cq_index); 518 517 int fnic_wq_cmpl_handler(struct fnic *fnic, int); 519 518 int fnic_flogi_reg_handler(struct fnic *fnic, u32);
+50
drivers/scsi/fnic/fnic_fcs.c
··· 1128 1128 spin_unlock_irqrestore(&reset_fnic_list_lock, 1129 1129 reset_fnic_list_lock_flags); 1130 1130 } 1131 + 1132 + void fnic_fcpio_reset(struct fnic *fnic) 1133 + { 1134 + unsigned long flags; 1135 + enum fnic_state old_state; 1136 + struct fnic_iport_s *iport = &fnic->iport; 1137 + DECLARE_COMPLETION_ONSTACK(fw_reset_done); 1138 + int time_remain; 1139 + 1140 + /* issue fw reset */ 1141 + spin_lock_irqsave(&fnic->fnic_lock, flags); 1142 + if (unlikely(fnic->state == FNIC_IN_FC_TRANS_ETH_MODE)) { 1143 + /* fw reset is in progress, poll for its completion */ 1144 + spin_unlock_irqrestore(&fnic->fnic_lock, flags); 1145 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 1146 + "fnic is in unexpected state: %d for fw_reset\n", 1147 + fnic->state); 1148 + return; 1149 + } 1150 + 1151 + old_state = fnic->state; 1152 + fnic->state = FNIC_IN_FC_TRANS_ETH_MODE; 1153 + 1154 + fnic_update_mac_locked(fnic, iport->hwmac); 1155 + fnic->fw_reset_done = &fw_reset_done; 1156 + spin_unlock_irqrestore(&fnic->fnic_lock, flags); 1157 + 1158 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 1159 + "Issuing fw reset\n"); 1160 + if (fnic_fw_reset_handler(fnic)) { 1161 + spin_lock_irqsave(&fnic->fnic_lock, flags); 1162 + if (fnic->state == FNIC_IN_FC_TRANS_ETH_MODE) 1163 + fnic->state = old_state; 1164 + spin_unlock_irqrestore(&fnic->fnic_lock, flags); 1165 + } else { 1166 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 1167 + "Waiting for fw completion\n"); 1168 + time_remain = wait_for_completion_timeout(&fw_reset_done, 1169 + msecs_to_jiffies(FNIC_FW_RESET_TIMEOUT)); 1170 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 1171 + "Woken up after fw completion timeout\n"); 1172 + if (time_remain == 0) { 1173 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 1174 + "FW reset completion timed out after %d ms\n", 1175 + FNIC_FW_RESET_TIMEOUT); 1176 + } 1177 + atomic64_inc(&fnic->fnic_stats.reset_stats.fw_reset_timeouts); 1178 + } 1179 + fnic->fw_reset_done = NULL; 1180 + }
+1 -1
drivers/scsi/fnic/fnic_fdls.h
··· 410 410 void fnic_fdls_remove_tport(struct fnic_iport_s *iport, 411 411 struct fnic_tport_s *tport, 412 412 unsigned long flags); 413 + void fnic_fcpio_reset(struct fnic *fnic); 413 414 414 415 /* fip.c */ 415 416 void fnic_fcoe_send_vlan_req(struct fnic *fnic); ··· 423 422 extern void fdls_fabric_timer_callback(struct timer_list *t); 424 423 425 424 /* fnic_scsi.c */ 426 - void fnic_scsi_fcpio_reset(struct fnic *fnic); 427 425 extern void fdls_fabric_timer_callback(struct timer_list *t); 428 426 void fnic_rport_exch_reset(struct fnic *fnic, u32 fcid); 429 427 int fnic_fdls_register_portid(struct fnic_iport_s *iport, u32 port_id,
+1 -53
drivers/scsi/fnic/fnic_scsi.c
··· 1975 1975 spin_unlock_irqrestore(&fnic->fnic_lock, flags); 1976 1976 1977 1977 if (fdls_get_state(&fnic->iport.fabric) != FDLS_STATE_INIT) 1978 - fnic_scsi_fcpio_reset(fnic); 1979 - 1978 + fnic_fcpio_reset(fnic); 1980 1979 spin_lock_irqsave(&fnic->fnic_lock, flags); 1981 1980 fnic->in_remove = 1; 1982 1981 spin_unlock_irqrestore(&fnic->fnic_lock, flags); ··· 3038 3039 3039 3040 ret = fnic_host_reset(shost); 3040 3041 return ret; 3041 - } 3042 - 3043 - 3044 - void fnic_scsi_fcpio_reset(struct fnic *fnic) 3045 - { 3046 - unsigned long flags; 3047 - enum fnic_state old_state; 3048 - struct fnic_iport_s *iport = &fnic->iport; 3049 - DECLARE_COMPLETION_ONSTACK(fw_reset_done); 3050 - int time_remain; 3051 - 3052 - /* issue fw reset */ 3053 - spin_lock_irqsave(&fnic->fnic_lock, flags); 3054 - if (unlikely(fnic->state == FNIC_IN_FC_TRANS_ETH_MODE)) { 3055 - /* fw reset is in progress, poll for its completion */ 3056 - spin_unlock_irqrestore(&fnic->fnic_lock, flags); 3057 - FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3058 - "fnic is in unexpected state: %d for fw_reset\n", 3059 - fnic->state); 3060 - return; 3061 - } 3062 - 3063 - old_state = fnic->state; 3064 - fnic->state = FNIC_IN_FC_TRANS_ETH_MODE; 3065 - 3066 - fnic_update_mac_locked(fnic, iport->hwmac); 3067 - fnic->fw_reset_done = &fw_reset_done; 3068 - spin_unlock_irqrestore(&fnic->fnic_lock, flags); 3069 - 3070 - FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3071 - "Issuing fw reset\n"); 3072 - if (fnic_fw_reset_handler(fnic)) { 3073 - spin_lock_irqsave(&fnic->fnic_lock, flags); 3074 - if (fnic->state == FNIC_IN_FC_TRANS_ETH_MODE) 3075 - fnic->state = old_state; 3076 - spin_unlock_irqrestore(&fnic->fnic_lock, flags); 3077 - } else { 3078 - FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3079 - "Waiting for fw completion\n"); 3080 - time_remain = wait_for_completion_timeout(&fw_reset_done, 3081 - msecs_to_jiffies(FNIC_FW_RESET_TIMEOUT)); 3082 - FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3083 - "Woken up after fw completion timeout\n"); 3084 - if (time_remain == 0) { 3085 - FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3086 - "FW reset completion timed out after %d ms)\n", 3087 - FNIC_FW_RESET_TIMEOUT); 3088 - } 3089 - atomic64_inc(&fnic->fnic_stats.reset_stats.fw_reset_timeouts); 3090 - } 3091 - fnic->fw_reset_done = NULL; 3092 3042 }