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.

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"Fixes all in drivers.

ufs and megaraid_sas are small and obvious.

The large diffstat in fnic comes from two pieces: the addition of
quite a bit of logging (no change to function) and the reworking of
the timeout allocation path for the two conditions that can occur
simultaneously to prevent reusing the same abort frame and then both
trying to free it"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: fnic: Fix missing DMA mapping error in fnic_send_frame()
scsi: fnic: Set appropriate logging level for log message
scsi: fnic: Add and improve logs in FDMI and FDMI ABTS paths
scsi: fnic: Turn off FDMI ACTIVE flags on link down
scsi: fnic: Fix crash in fnic_wq_cmpl_handler when FDMI times out
scsi: ufs: core: Fix clk scaling to be conditional in reset and restore
scsi: megaraid_sas: Fix invalid node index

+161 -42
+149 -38
drivers/scsi/fnic/fdls_disc.c
··· 763 763 iport->fabric.timer_pending = 1; 764 764 } 765 765 766 - static void fdls_send_fdmi_abts(struct fnic_iport_s *iport) 766 + static uint8_t *fdls_alloc_init_fdmi_abts_frame(struct fnic_iport_s *iport, 767 + uint16_t oxid) 767 768 { 768 - uint8_t *frame; 769 + struct fc_frame_header *pfdmi_abts; 769 770 uint8_t d_id[3]; 771 + uint8_t *frame; 770 772 struct fnic *fnic = iport->fnic; 771 - struct fc_frame_header *pfabric_abts; 772 - unsigned long fdmi_tov; 773 - uint16_t oxid; 774 - uint16_t frame_size = FNIC_ETH_FCOE_HDRS_OFFSET + 775 - sizeof(struct fc_frame_header); 776 773 777 774 frame = fdls_alloc_frame(iport); 778 775 if (frame == NULL) { 779 776 FNIC_FCS_DBG(KERN_ERR, fnic->host, fnic->fnic_num, 780 777 "Failed to allocate frame to send FDMI ABTS"); 781 - return; 778 + return NULL; 782 779 } 783 780 784 - pfabric_abts = (struct fc_frame_header *) (frame + FNIC_ETH_FCOE_HDRS_OFFSET); 781 + pfdmi_abts = (struct fc_frame_header *) (frame + FNIC_ETH_FCOE_HDRS_OFFSET); 785 782 fdls_init_fabric_abts_frame(frame, iport); 786 783 787 784 hton24(d_id, FC_FID_MGMT_SERV); 788 - FNIC_STD_SET_D_ID(*pfabric_abts, d_id); 785 + FNIC_STD_SET_D_ID(*pfdmi_abts, d_id); 786 + FNIC_STD_SET_OX_ID(*pfdmi_abts, oxid); 787 + 788 + return frame; 789 + } 790 + 791 + static void fdls_send_fdmi_abts(struct fnic_iport_s *iport) 792 + { 793 + uint8_t *frame; 794 + struct fnic *fnic = iport->fnic; 795 + unsigned long fdmi_tov; 796 + uint16_t frame_size = FNIC_ETH_FCOE_HDRS_OFFSET + 797 + sizeof(struct fc_frame_header); 789 798 790 799 if (iport->fabric.fdmi_pending & FDLS_FDMI_PLOGI_PENDING) { 791 - oxid = iport->active_oxid_fdmi_plogi; 792 - FNIC_STD_SET_OX_ID(*pfabric_abts, oxid); 800 + frame = fdls_alloc_init_fdmi_abts_frame(iport, 801 + iport->active_oxid_fdmi_plogi); 802 + if (frame == NULL) 803 + return; 804 + 805 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 806 + "0x%x: FDLS send FDMI PLOGI abts. iport->fabric.state: %d oxid: 0x%x", 807 + iport->fcid, iport->fabric.state, iport->active_oxid_fdmi_plogi); 793 808 fnic_send_fcoe_frame(iport, frame, frame_size); 794 809 } else { 795 810 if (iport->fabric.fdmi_pending & FDLS_FDMI_REG_HBA_PENDING) { 796 - oxid = iport->active_oxid_fdmi_rhba; 797 - FNIC_STD_SET_OX_ID(*pfabric_abts, oxid); 811 + frame = fdls_alloc_init_fdmi_abts_frame(iport, 812 + iport->active_oxid_fdmi_rhba); 813 + if (frame == NULL) 814 + return; 815 + 816 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 817 + "0x%x: FDLS send FDMI RHBA abts. iport->fabric.state: %d oxid: 0x%x", 818 + iport->fcid, iport->fabric.state, iport->active_oxid_fdmi_rhba); 798 819 fnic_send_fcoe_frame(iport, frame, frame_size); 799 820 } 800 821 if (iport->fabric.fdmi_pending & FDLS_FDMI_RPA_PENDING) { 801 - oxid = iport->active_oxid_fdmi_rpa; 802 - FNIC_STD_SET_OX_ID(*pfabric_abts, oxid); 822 + frame = fdls_alloc_init_fdmi_abts_frame(iport, 823 + iport->active_oxid_fdmi_rpa); 824 + if (frame == NULL) { 825 + if (iport->fabric.fdmi_pending & FDLS_FDMI_REG_HBA_PENDING) 826 + goto arm_timer; 827 + else 828 + return; 829 + } 830 + 831 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 832 + "0x%x: FDLS send FDMI RPA abts. iport->fabric.state: %d oxid: 0x%x", 833 + iport->fcid, iport->fabric.state, iport->active_oxid_fdmi_rpa); 803 834 fnic_send_fcoe_frame(iport, frame, frame_size); 804 835 } 805 836 } 806 837 838 + arm_timer: 807 839 fdmi_tov = jiffies + msecs_to_jiffies(2 * iport->e_d_tov); 808 840 mod_timer(&iport->fabric.fdmi_timer, round_jiffies(fdmi_tov)); 809 841 iport->fabric.fdmi_pending |= FDLS_FDMI_ABORT_PENDING; 842 + 843 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 844 + "0x%x: iport->fabric.fdmi_pending: 0x%x", 845 + iport->fcid, iport->fabric.fdmi_pending); 810 846 } 811 847 812 848 static void fdls_send_fabric_flogi(struct fnic_iport_s *iport) ··· 2281 2245 spin_unlock_irqrestore(&fnic->fnic_lock, flags); 2282 2246 } 2283 2247 2248 + void fdls_fdmi_retry_plogi(struct fnic_iport_s *iport) 2249 + { 2250 + struct fnic *fnic = iport->fnic; 2251 + 2252 + iport->fabric.fdmi_pending = 0; 2253 + /* If max retries not exhausted, start over from fdmi plogi */ 2254 + if (iport->fabric.fdmi_retry < FDLS_FDMI_MAX_RETRY) { 2255 + iport->fabric.fdmi_retry++; 2256 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 2257 + "Retry FDMI PLOGI. FDMI retry: %d", 2258 + iport->fabric.fdmi_retry); 2259 + fdls_send_fdmi_plogi(iport); 2260 + } 2261 + } 2262 + 2284 2263 void fdls_fdmi_timer_callback(struct timer_list *t) 2285 2264 { 2286 2265 struct fnic_fdls_fabric_s *fabric = timer_container_of(fabric, t, ··· 2308 2257 spin_lock_irqsave(&fnic->fnic_lock, flags); 2309 2258 2310 2259 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 2311 - "fdmi timer callback : 0x%x\n", iport->fabric.fdmi_pending); 2260 + "iport->fabric.fdmi_pending: 0x%x\n", iport->fabric.fdmi_pending); 2312 2261 2313 2262 if (!iport->fabric.fdmi_pending) { 2314 2263 /* timer expired after fdmi responses received. */ ··· 2316 2265 return; 2317 2266 } 2318 2267 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 2319 - "fdmi timer callback : 0x%x\n", iport->fabric.fdmi_pending); 2268 + "iport->fabric.fdmi_pending: 0x%x\n", iport->fabric.fdmi_pending); 2320 2269 2321 2270 /* if not abort pending, send an abort */ 2322 2271 if (!(iport->fabric.fdmi_pending & FDLS_FDMI_ABORT_PENDING)) { ··· 2325 2274 return; 2326 2275 } 2327 2276 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 2328 - "fdmi timer callback : 0x%x\n", iport->fabric.fdmi_pending); 2277 + "iport->fabric.fdmi_pending: 0x%x\n", iport->fabric.fdmi_pending); 2329 2278 2330 2279 /* ABTS pending for an active fdmi request that is pending. 2331 2280 * That means FDMI ABTS timed out 2332 2281 * Schedule to free the OXID after 2*r_a_tov and proceed 2333 2282 */ 2334 2283 if (iport->fabric.fdmi_pending & FDLS_FDMI_PLOGI_PENDING) { 2284 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 2285 + "FDMI PLOGI ABTS timed out. Schedule oxid free: 0x%x\n", 2286 + iport->active_oxid_fdmi_plogi); 2335 2287 fdls_schedule_oxid_free(iport, &iport->active_oxid_fdmi_plogi); 2336 2288 } else { 2337 - if (iport->fabric.fdmi_pending & FDLS_FDMI_REG_HBA_PENDING) 2289 + if (iport->fabric.fdmi_pending & FDLS_FDMI_REG_HBA_PENDING) { 2290 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 2291 + "FDMI RHBA ABTS timed out. Schedule oxid free: 0x%x\n", 2292 + iport->active_oxid_fdmi_rhba); 2338 2293 fdls_schedule_oxid_free(iport, &iport->active_oxid_fdmi_rhba); 2339 - if (iport->fabric.fdmi_pending & FDLS_FDMI_RPA_PENDING) 2294 + } 2295 + if (iport->fabric.fdmi_pending & FDLS_FDMI_RPA_PENDING) { 2296 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 2297 + "FDMI RPA ABTS timed out. Schedule oxid free: 0x%x\n", 2298 + iport->active_oxid_fdmi_rpa); 2340 2299 fdls_schedule_oxid_free(iport, &iport->active_oxid_fdmi_rpa); 2300 + } 2341 2301 } 2342 2302 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 2343 - "fdmi timer callback : 0x%x\n", iport->fabric.fdmi_pending); 2303 + "iport->fabric.fdmi_pending: 0x%x\n", iport->fabric.fdmi_pending); 2344 2304 2345 - iport->fabric.fdmi_pending = 0; 2346 - /* If max retries not exhaused, start over from fdmi plogi */ 2347 - if (iport->fabric.fdmi_retry < FDLS_FDMI_MAX_RETRY) { 2348 - iport->fabric.fdmi_retry++; 2349 - FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 2350 - "retry fdmi timer %d", iport->fabric.fdmi_retry); 2351 - fdls_send_fdmi_plogi(iport); 2352 - } 2305 + fdls_fdmi_retry_plogi(iport); 2353 2306 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 2354 - "fdmi timer callback : 0x%x\n", iport->fabric.fdmi_pending); 2307 + "iport->fabric.fdmi_pending: 0x%x\n", iport->fabric.fdmi_pending); 2355 2308 spin_unlock_irqrestore(&fnic->fnic_lock, flags); 2356 2309 } 2357 2310 ··· 3770 3715 3771 3716 switch (FNIC_FRAME_TYPE(oxid)) { 3772 3717 case FNIC_FRAME_TYPE_FDMI_PLOGI: 3718 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3719 + "Received FDMI PLOGI ABTS rsp with oxid: 0x%x", oxid); 3720 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3721 + "0x%x: iport->fabric.fdmi_pending: 0x%x", 3722 + iport->fcid, iport->fabric.fdmi_pending); 3773 3723 fdls_free_oxid(iport, oxid, &iport->active_oxid_fdmi_plogi); 3724 + 3725 + iport->fabric.fdmi_pending &= ~FDLS_FDMI_PLOGI_PENDING; 3726 + iport->fabric.fdmi_pending &= ~FDLS_FDMI_ABORT_PENDING; 3727 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3728 + "0x%x: iport->fabric.fdmi_pending: 0x%x", 3729 + iport->fcid, iport->fabric.fdmi_pending); 3774 3730 break; 3775 3731 case FNIC_FRAME_TYPE_FDMI_RHBA: 3732 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3733 + "Received FDMI RHBA ABTS rsp with oxid: 0x%x", oxid); 3734 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3735 + "0x%x: iport->fabric.fdmi_pending: 0x%x", 3736 + iport->fcid, iport->fabric.fdmi_pending); 3737 + 3738 + iport->fabric.fdmi_pending &= ~FDLS_FDMI_REG_HBA_PENDING; 3739 + 3740 + /* If RPA is still pending, don't turn off ABORT PENDING. 3741 + * We count on the timer to detect the ABTS timeout and take 3742 + * corrective action. 3743 + */ 3744 + if (!(iport->fabric.fdmi_pending & FDLS_FDMI_RPA_PENDING)) 3745 + iport->fabric.fdmi_pending &= ~FDLS_FDMI_ABORT_PENDING; 3746 + 3776 3747 fdls_free_oxid(iport, oxid, &iport->active_oxid_fdmi_rhba); 3748 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3749 + "0x%x: iport->fabric.fdmi_pending: 0x%x", 3750 + iport->fcid, iport->fabric.fdmi_pending); 3777 3751 break; 3778 3752 case FNIC_FRAME_TYPE_FDMI_RPA: 3753 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3754 + "Received FDMI RPA ABTS rsp with oxid: 0x%x", oxid); 3755 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3756 + "0x%x: iport->fabric.fdmi_pending: 0x%x", 3757 + iport->fcid, iport->fabric.fdmi_pending); 3758 + 3759 + iport->fabric.fdmi_pending &= ~FDLS_FDMI_RPA_PENDING; 3760 + 3761 + /* If RHBA is still pending, don't turn off ABORT PENDING. 3762 + * We count on the timer to detect the ABTS timeout and take 3763 + * corrective action. 3764 + */ 3765 + if (!(iport->fabric.fdmi_pending & FDLS_FDMI_REG_HBA_PENDING)) 3766 + iport->fabric.fdmi_pending &= ~FDLS_FDMI_ABORT_PENDING; 3767 + 3779 3768 fdls_free_oxid(iport, oxid, &iport->active_oxid_fdmi_rpa); 3769 + FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 3770 + "0x%x: iport->fabric.fdmi_pending: 0x%x", 3771 + iport->fcid, iport->fabric.fdmi_pending); 3780 3772 break; 3781 3773 default: 3782 3774 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num, ··· 3832 3730 break; 3833 3731 } 3834 3732 3835 - timer_delete_sync(&iport->fabric.fdmi_timer); 3836 - iport->fabric.fdmi_pending &= ~FDLS_FDMI_ABORT_PENDING; 3837 - 3838 - fdls_send_fdmi_plogi(iport); 3733 + /* 3734 + * Only if ABORT PENDING is off, delete the timer, and if no other 3735 + * operations are pending, retry FDMI. 3736 + * Otherwise, let the timer pop and take the appropriate action. 3737 + */ 3738 + if (!(iport->fabric.fdmi_pending & FDLS_FDMI_ABORT_PENDING)) { 3739 + timer_delete_sync(&iport->fabric.fdmi_timer); 3740 + if (!iport->fabric.fdmi_pending) 3741 + fdls_fdmi_retry_plogi(iport); 3742 + } 3839 3743 } 3840 3744 3841 3745 static void ··· 5080 4972 fdls_delete_tport(iport, tport); 5081 4973 } 5082 4974 5083 - if ((fnic_fdmi_support == 1) && (iport->fabric.fdmi_pending > 0)) { 5084 - timer_delete_sync(&iport->fabric.fdmi_timer); 5085 - iport->fabric.fdmi_pending = 0; 4975 + if (fnic_fdmi_support == 1) { 4976 + if (iport->fabric.fdmi_pending > 0) { 4977 + timer_delete_sync(&iport->fabric.fdmi_timer); 4978 + iport->fabric.fdmi_pending = 0; 4979 + } 4980 + iport->flags &= ~FNIC_FDMI_ACTIVE; 5086 4981 } 5087 4982 5088 4983 FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
+1 -1
drivers/scsi/fnic/fnic.h
··· 30 30 31 31 #define DRV_NAME "fnic" 32 32 #define DRV_DESCRIPTION "Cisco FCoE HBA Driver" 33 - #define DRV_VERSION "1.8.0.0" 33 + #define DRV_VERSION "1.8.0.2" 34 34 #define PFX DRV_NAME ": " 35 35 #define DFX DRV_NAME "%d: " 36 36
+2
drivers/scsi/fnic/fnic_fcs.c
··· 636 636 unsigned long flags; 637 637 638 638 pa = dma_map_single(&fnic->pdev->dev, frame, frame_len, DMA_TO_DEVICE); 639 + if (dma_mapping_error(&fnic->pdev->dev, pa)) 640 + return -ENOMEM; 639 641 640 642 if ((fnic_fc_trace_set_data(fnic->fnic_num, 641 643 FNIC_FC_SEND | 0x80, (char *) frame,
+1
drivers/scsi/fnic/fnic_fdls.h
··· 394 394 bool fdls_delete_tport(struct fnic_iport_s *iport, 395 395 struct fnic_tport_s *tport); 396 396 void fdls_fdmi_timer_callback(struct timer_list *t); 397 + void fdls_fdmi_retry_plogi(struct fnic_iport_s *iport); 397 398 398 399 /* fnic_fcs.c */ 399 400 void fnic_fdls_init(struct fnic *fnic, int usefip);
+1 -1
drivers/scsi/fnic/fnic_scsi.c
··· 1046 1046 if (icmnd_cmpl->scsi_status == SAM_STAT_TASK_SET_FULL) 1047 1047 atomic64_inc(&fnic_stats->misc_stats.queue_fulls); 1048 1048 1049 - FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num, 1049 + FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num, 1050 1050 "xfer_len: %llu", xfer_len); 1051 1051 break; 1052 1052
+5 -1
drivers/scsi/megaraid/megaraid_sas_base.c
··· 5910 5910 const struct cpumask *mask; 5911 5911 5912 5912 if (instance->perf_mode == MR_BALANCED_PERF_MODE) { 5913 - mask = cpumask_of_node(dev_to_node(&instance->pdev->dev)); 5913 + int nid = dev_to_node(&instance->pdev->dev); 5914 + 5915 + if (nid == NUMA_NO_NODE) 5916 + nid = 0; 5917 + mask = cpumask_of_node(nid); 5914 5918 5915 5919 for (i = 0; i < instance->low_latency_index_start; i++) { 5916 5920 irq = pci_irq_vector(instance->pdev, i);
+2 -1
drivers/ufs/core/ufshcd.c
··· 7807 7807 hba->silence_err_logs = false; 7808 7808 7809 7809 /* scale up clocks to max frequency before full reinitialization */ 7810 - ufshcd_scale_clks(hba, ULONG_MAX, true); 7810 + if (ufshcd_is_clkscaling_supported(hba)) 7811 + ufshcd_scale_clks(hba, ULONG_MAX, true); 7811 7812 7812 7813 err = ufshcd_hba_enable(hba); 7813 7814