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

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

Pull SCSI fixes from James Bottomley:
"Seven fixes to four drivers with no core changes.

The mpt3sas one is theoretical until we get a CPU that goes up to 64
bits physical, the qla2xxx one fixes an oops in a driver
initialization error leg and the others are mostly cosmetic"

[ The fcoe patches may be worth highlighting - they may be "just"
cleanups, but they simplify and fix the odd fc_rport_priv structure
handling rules so that the new gcc-9 warnings about memset crossing
structure boundaries are gone.

The old code was hard for humans to understand too, and really
confused the compiler sanity checks - Linus ]

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: qla2xxx: Fix possible fcport null-pointer dereferences
scsi: mpt3sas: Use 63-bit DMA addressing on SAS35 HBA
scsi: hpsa: remove printing internal cdb on tag collision
scsi: hpsa: correct scsi command status issue after reset
scsi: fcoe: pass in fcoe_rport structure instead of fc_rport_priv
scsi: fcoe: Embed fc_rport_priv in fcoe_rport structure
scsi: libfc: Whitespace cleanup in libfc.h

+115 -109
+65 -73
drivers/scsi/fcoe/fcoe_ctlr.c
··· 2005 2005 */ 2006 2006 static inline struct fcoe_rport *fcoe_ctlr_rport(struct fc_rport_priv *rdata) 2007 2007 { 2008 - return (struct fcoe_rport *)(rdata + 1); 2008 + return container_of(rdata, struct fcoe_rport, rdata); 2009 2009 } 2010 2010 2011 2011 /** ··· 2269 2269 */ 2270 2270 static int fcoe_ctlr_vn_parse(struct fcoe_ctlr *fip, 2271 2271 struct sk_buff *skb, 2272 - struct fc_rport_priv *rdata) 2272 + struct fcoe_rport *frport) 2273 2273 { 2274 2274 struct fip_header *fiph; 2275 2275 struct fip_desc *desc = NULL; ··· 2277 2277 struct fip_wwn_desc *wwn = NULL; 2278 2278 struct fip_vn_desc *vn = NULL; 2279 2279 struct fip_size_desc *size = NULL; 2280 - struct fcoe_rport *frport; 2281 2280 size_t rlen; 2282 2281 size_t dlen; 2283 2282 u32 desc_mask = 0; 2284 2283 u32 dtype; 2285 2284 u8 sub; 2286 - 2287 - memset(rdata, 0, sizeof(*rdata) + sizeof(*frport)); 2288 - frport = fcoe_ctlr_rport(rdata); 2289 2285 2290 2286 fiph = (struct fip_header *)skb->data; 2291 2287 frport->flags = ntohs(fiph->fip_flags); ··· 2345 2349 if (dlen != sizeof(struct fip_wwn_desc)) 2346 2350 goto len_err; 2347 2351 wwn = (struct fip_wwn_desc *)desc; 2348 - rdata->ids.node_name = get_unaligned_be64(&wwn->fd_wwn); 2352 + frport->rdata.ids.node_name = 2353 + get_unaligned_be64(&wwn->fd_wwn); 2349 2354 break; 2350 2355 case FIP_DT_VN_ID: 2351 2356 if (dlen != sizeof(struct fip_vn_desc)) 2352 2357 goto len_err; 2353 2358 vn = (struct fip_vn_desc *)desc; 2354 2359 memcpy(frport->vn_mac, vn->fd_mac, ETH_ALEN); 2355 - rdata->ids.port_id = ntoh24(vn->fd_fc_id); 2356 - rdata->ids.port_name = get_unaligned_be64(&vn->fd_wwpn); 2360 + frport->rdata.ids.port_id = ntoh24(vn->fd_fc_id); 2361 + frport->rdata.ids.port_name = 2362 + get_unaligned_be64(&vn->fd_wwpn); 2357 2363 break; 2358 2364 case FIP_DT_FC4F: 2359 2365 if (dlen != sizeof(struct fip_fc4_feat)) ··· 2401 2403 /** 2402 2404 * fcoe_ctlr_vn_probe_req() - handle incoming VN2VN probe request. 2403 2405 * @fip: The FCoE controller 2404 - * @rdata: parsed remote port with frport from the probe request 2406 + * @frport: parsed FCoE rport from the probe request 2405 2407 * 2406 2408 * Called with ctlr_mutex held. 2407 2409 */ 2408 2410 static void fcoe_ctlr_vn_probe_req(struct fcoe_ctlr *fip, 2409 - struct fc_rport_priv *rdata) 2411 + struct fcoe_rport *frport) 2410 2412 { 2411 - struct fcoe_rport *frport = fcoe_ctlr_rport(rdata); 2412 - 2413 - if (rdata->ids.port_id != fip->port_id) 2413 + if (frport->rdata.ids.port_id != fip->port_id) 2414 2414 return; 2415 2415 2416 2416 switch (fip->state) { ··· 2428 2432 * Probe's REC bit is not set. 2429 2433 * If we don't reply, we will change our address. 2430 2434 */ 2431 - if (fip->lp->wwpn > rdata->ids.port_name && 2435 + if (fip->lp->wwpn > frport->rdata.ids.port_name && 2432 2436 !(frport->flags & FIP_FL_REC_OR_P2P)) { 2433 2437 LIBFCOE_FIP_DBG(fip, "vn_probe_req: " 2434 2438 "port_id collision\n"); ··· 2452 2456 /** 2453 2457 * fcoe_ctlr_vn_probe_reply() - handle incoming VN2VN probe reply. 2454 2458 * @fip: The FCoE controller 2455 - * @rdata: parsed remote port with frport from the probe request 2459 + * @frport: parsed FCoE rport from the probe request 2456 2460 * 2457 2461 * Called with ctlr_mutex held. 2458 2462 */ 2459 2463 static void fcoe_ctlr_vn_probe_reply(struct fcoe_ctlr *fip, 2460 - struct fc_rport_priv *rdata) 2464 + struct fcoe_rport *frport) 2461 2465 { 2462 - if (rdata->ids.port_id != fip->port_id) 2466 + if (frport->rdata.ids.port_id != fip->port_id) 2463 2467 return; 2464 2468 switch (fip->state) { 2465 2469 case FIP_ST_VNMP_START: ··· 2482 2486 /** 2483 2487 * fcoe_ctlr_vn_add() - Add a VN2VN entry to the list, based on a claim reply. 2484 2488 * @fip: The FCoE controller 2485 - * @new: newly-parsed remote port with frport as a template for new rdata 2489 + * @new: newly-parsed FCoE rport as a template for new rdata 2486 2490 * 2487 2491 * Called with ctlr_mutex held. 2488 2492 */ 2489 - static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fc_rport_priv *new) 2493 + static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fcoe_rport *new) 2490 2494 { 2491 2495 struct fc_lport *lport = fip->lp; 2492 2496 struct fc_rport_priv *rdata; ··· 2494 2498 struct fcoe_rport *frport; 2495 2499 u32 port_id; 2496 2500 2497 - port_id = new->ids.port_id; 2501 + port_id = new->rdata.ids.port_id; 2498 2502 if (port_id == fip->port_id) 2499 2503 return; 2500 2504 ··· 2511 2515 rdata->disc_id = lport->disc.disc_id; 2512 2516 2513 2517 ids = &rdata->ids; 2514 - if ((ids->port_name != -1 && ids->port_name != new->ids.port_name) || 2515 - (ids->node_name != -1 && ids->node_name != new->ids.node_name)) { 2518 + if ((ids->port_name != -1 && 2519 + ids->port_name != new->rdata.ids.port_name) || 2520 + (ids->node_name != -1 && 2521 + ids->node_name != new->rdata.ids.node_name)) { 2516 2522 mutex_unlock(&rdata->rp_mutex); 2517 2523 LIBFCOE_FIP_DBG(fip, "vn_add rport logoff %6.6x\n", port_id); 2518 2524 fc_rport_logoff(rdata); 2519 2525 mutex_lock(&rdata->rp_mutex); 2520 2526 } 2521 - ids->port_name = new->ids.port_name; 2522 - ids->node_name = new->ids.node_name; 2527 + ids->port_name = new->rdata.ids.port_name; 2528 + ids->node_name = new->rdata.ids.node_name; 2523 2529 mutex_unlock(&rdata->rp_mutex); 2524 2530 2525 2531 frport = fcoe_ctlr_rport(rdata); 2526 2532 LIBFCOE_FIP_DBG(fip, "vn_add rport %6.6x %s state %d\n", 2527 2533 port_id, frport->fcoe_len ? "old" : "new", 2528 2534 rdata->rp_state); 2529 - *frport = *fcoe_ctlr_rport(new); 2535 + frport->fcoe_len = new->fcoe_len; 2536 + frport->flags = new->flags; 2537 + frport->login_count = new->login_count; 2538 + memcpy(frport->enode_mac, new->enode_mac, ETH_ALEN); 2539 + memcpy(frport->vn_mac, new->vn_mac, ETH_ALEN); 2530 2540 frport->time = 0; 2531 2541 } 2532 2542 ··· 2564 2562 /** 2565 2563 * fcoe_ctlr_vn_claim_notify() - handle received FIP VN2VN Claim Notification 2566 2564 * @fip: The FCoE controller 2567 - * @new: newly-parsed remote port with frport as a template for new rdata 2565 + * @new: newly-parsed FCoE rport as a template for new rdata 2568 2566 * 2569 2567 * Called with ctlr_mutex held. 2570 2568 */ 2571 2569 static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip, 2572 - struct fc_rport_priv *new) 2570 + struct fcoe_rport *new) 2573 2571 { 2574 - struct fcoe_rport *frport = fcoe_ctlr_rport(new); 2575 - 2576 - if (frport->flags & FIP_FL_REC_OR_P2P) { 2572 + if (new->flags & FIP_FL_REC_OR_P2P) { 2577 2573 LIBFCOE_FIP_DBG(fip, "send probe req for P2P/REC\n"); 2578 2574 fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REQ, fcoe_all_vn2vn, 0); 2579 2575 return; ··· 2580 2580 case FIP_ST_VNMP_START: 2581 2581 case FIP_ST_VNMP_PROBE1: 2582 2582 case FIP_ST_VNMP_PROBE2: 2583 - if (new->ids.port_id == fip->port_id) { 2583 + if (new->rdata.ids.port_id == fip->port_id) { 2584 2584 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: " 2585 2585 "restart, state %d\n", 2586 2586 fip->state); ··· 2589 2589 break; 2590 2590 case FIP_ST_VNMP_CLAIM: 2591 2591 case FIP_ST_VNMP_UP: 2592 - if (new->ids.port_id == fip->port_id) { 2593 - if (new->ids.port_name > fip->lp->wwpn) { 2592 + if (new->rdata.ids.port_id == fip->port_id) { 2593 + if (new->rdata.ids.port_name > fip->lp->wwpn) { 2594 2594 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: " 2595 2595 "restart, port_id collision\n"); 2596 2596 fcoe_ctlr_vn_restart(fip); ··· 2602 2602 break; 2603 2603 } 2604 2604 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: send reply to %x\n", 2605 - new->ids.port_id); 2606 - fcoe_ctlr_vn_send(fip, FIP_SC_VN_CLAIM_REP, frport->enode_mac, 2607 - min((u32)frport->fcoe_len, 2605 + new->rdata.ids.port_id); 2606 + fcoe_ctlr_vn_send(fip, FIP_SC_VN_CLAIM_REP, new->enode_mac, 2607 + min((u32)new->fcoe_len, 2608 2608 fcoe_ctlr_fcoe_size(fip))); 2609 2609 fcoe_ctlr_vn_add(fip, new); 2610 2610 break; 2611 2611 default: 2612 2612 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: " 2613 - "ignoring claim from %x\n", new->ids.port_id); 2613 + "ignoring claim from %x\n", 2614 + new->rdata.ids.port_id); 2614 2615 break; 2615 2616 } 2616 2617 } ··· 2619 2618 /** 2620 2619 * fcoe_ctlr_vn_claim_resp() - handle received Claim Response 2621 2620 * @fip: The FCoE controller that received the frame 2622 - * @new: newly-parsed remote port with frport from the Claim Response 2621 + * @new: newly-parsed FCoE rport from the Claim Response 2623 2622 * 2624 2623 * Called with ctlr_mutex held. 2625 2624 */ 2626 2625 static void fcoe_ctlr_vn_claim_resp(struct fcoe_ctlr *fip, 2627 - struct fc_rport_priv *new) 2626 + struct fcoe_rport *new) 2628 2627 { 2629 2628 LIBFCOE_FIP_DBG(fip, "claim resp from from rport %x - state %s\n", 2630 - new->ids.port_id, fcoe_ctlr_state(fip->state)); 2629 + new->rdata.ids.port_id, fcoe_ctlr_state(fip->state)); 2631 2630 if (fip->state == FIP_ST_VNMP_UP || fip->state == FIP_ST_VNMP_CLAIM) 2632 2631 fcoe_ctlr_vn_add(fip, new); 2633 2632 } ··· 2635 2634 /** 2636 2635 * fcoe_ctlr_vn_beacon() - handle received beacon. 2637 2636 * @fip: The FCoE controller that received the frame 2638 - * @new: newly-parsed remote port with frport from the Beacon 2637 + * @new: newly-parsed FCoE rport from the Beacon 2639 2638 * 2640 2639 * Called with ctlr_mutex held. 2641 2640 */ 2642 2641 static void fcoe_ctlr_vn_beacon(struct fcoe_ctlr *fip, 2643 - struct fc_rport_priv *new) 2642 + struct fcoe_rport *new) 2644 2643 { 2645 2644 struct fc_lport *lport = fip->lp; 2646 2645 struct fc_rport_priv *rdata; 2647 2646 struct fcoe_rport *frport; 2648 2647 2649 - frport = fcoe_ctlr_rport(new); 2650 - if (frport->flags & FIP_FL_REC_OR_P2P) { 2648 + if (new->flags & FIP_FL_REC_OR_P2P) { 2651 2649 LIBFCOE_FIP_DBG(fip, "p2p beacon while in vn2vn mode\n"); 2652 2650 fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REQ, fcoe_all_vn2vn, 0); 2653 2651 return; 2654 2652 } 2655 - rdata = fc_rport_lookup(lport, new->ids.port_id); 2653 + rdata = fc_rport_lookup(lport, new->rdata.ids.port_id); 2656 2654 if (rdata) { 2657 - if (rdata->ids.node_name == new->ids.node_name && 2658 - rdata->ids.port_name == new->ids.port_name) { 2655 + if (rdata->ids.node_name == new->rdata.ids.node_name && 2656 + rdata->ids.port_name == new->rdata.ids.port_name) { 2659 2657 frport = fcoe_ctlr_rport(rdata); 2658 + 2660 2659 LIBFCOE_FIP_DBG(fip, "beacon from rport %x\n", 2661 2660 rdata->ids.port_id); 2662 2661 if (!frport->time && fip->state == FIP_ST_VNMP_UP) { ··· 2679 2678 * Don't add the neighbor yet. 2680 2679 */ 2681 2680 LIBFCOE_FIP_DBG(fip, "beacon from new rport %x. sending claim notify\n", 2682 - new->ids.port_id); 2681 + new->rdata.ids.port_id); 2683 2682 if (time_after(jiffies, 2684 2683 fip->sol_time + msecs_to_jiffies(FIP_VN_ANN_WAIT))) 2685 2684 fcoe_ctlr_vn_send_claim(fip); ··· 2739 2738 { 2740 2739 struct fip_header *fiph; 2741 2740 enum fip_vn2vn_subcode sub; 2742 - struct { 2743 - struct fc_rport_priv rdata; 2744 - struct fcoe_rport frport; 2745 - } buf; 2741 + struct fcoe_rport frport = { }; 2746 2742 int rc, vlan_id = 0; 2747 2743 2748 2744 fiph = (struct fip_header *)skb->data; ··· 2755 2757 goto drop; 2756 2758 } 2757 2759 2758 - rc = fcoe_ctlr_vn_parse(fip, skb, &buf.rdata); 2760 + rc = fcoe_ctlr_vn_parse(fip, skb, &frport); 2759 2761 if (rc) { 2760 2762 LIBFCOE_FIP_DBG(fip, "vn_recv vn_parse error %d\n", rc); 2761 2763 goto drop; ··· 2764 2766 mutex_lock(&fip->ctlr_mutex); 2765 2767 switch (sub) { 2766 2768 case FIP_SC_VN_PROBE_REQ: 2767 - fcoe_ctlr_vn_probe_req(fip, &buf.rdata); 2769 + fcoe_ctlr_vn_probe_req(fip, &frport); 2768 2770 break; 2769 2771 case FIP_SC_VN_PROBE_REP: 2770 - fcoe_ctlr_vn_probe_reply(fip, &buf.rdata); 2772 + fcoe_ctlr_vn_probe_reply(fip, &frport); 2771 2773 break; 2772 2774 case FIP_SC_VN_CLAIM_NOTIFY: 2773 - fcoe_ctlr_vn_claim_notify(fip, &buf.rdata); 2775 + fcoe_ctlr_vn_claim_notify(fip, &frport); 2774 2776 break; 2775 2777 case FIP_SC_VN_CLAIM_REP: 2776 - fcoe_ctlr_vn_claim_resp(fip, &buf.rdata); 2778 + fcoe_ctlr_vn_claim_resp(fip, &frport); 2777 2779 break; 2778 2780 case FIP_SC_VN_BEACON: 2779 - fcoe_ctlr_vn_beacon(fip, &buf.rdata); 2781 + fcoe_ctlr_vn_beacon(fip, &frport); 2780 2782 break; 2781 2783 default: 2782 2784 LIBFCOE_FIP_DBG(fip, "vn_recv unknown subcode %d\n", sub); ··· 2800 2802 */ 2801 2803 static int fcoe_ctlr_vlan_parse(struct fcoe_ctlr *fip, 2802 2804 struct sk_buff *skb, 2803 - struct fc_rport_priv *rdata) 2805 + struct fcoe_rport *frport) 2804 2806 { 2805 2807 struct fip_header *fiph; 2806 2808 struct fip_desc *desc = NULL; 2807 2809 struct fip_mac_desc *macd = NULL; 2808 2810 struct fip_wwn_desc *wwn = NULL; 2809 - struct fcoe_rport *frport; 2810 2811 size_t rlen; 2811 2812 size_t dlen; 2812 2813 u32 desc_mask = 0; 2813 2814 u32 dtype; 2814 2815 u8 sub; 2815 - 2816 - memset(rdata, 0, sizeof(*rdata) + sizeof(*frport)); 2817 - frport = fcoe_ctlr_rport(rdata); 2818 2816 2819 2817 fiph = (struct fip_header *)skb->data; 2820 2818 frport->flags = ntohs(fiph->fip_flags); ··· 2865 2871 if (dlen != sizeof(struct fip_wwn_desc)) 2866 2872 goto len_err; 2867 2873 wwn = (struct fip_wwn_desc *)desc; 2868 - rdata->ids.node_name = get_unaligned_be64(&wwn->fd_wwn); 2874 + frport->rdata.ids.node_name = 2875 + get_unaligned_be64(&wwn->fd_wwn); 2869 2876 break; 2870 2877 default: 2871 2878 LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x " ··· 2952 2957 /** 2953 2958 * fcoe_ctlr_vlan_disk_reply() - send FIP VLAN Discovery Notification. 2954 2959 * @fip: The FCoE controller 2960 + * @frport: The newly-parsed FCoE rport from the Discovery Request 2955 2961 * 2956 2962 * Called with ctlr_mutex held. 2957 2963 */ 2958 2964 static void fcoe_ctlr_vlan_disc_reply(struct fcoe_ctlr *fip, 2959 - struct fc_rport_priv *rdata) 2965 + struct fcoe_rport *frport) 2960 2966 { 2961 - struct fcoe_rport *frport = fcoe_ctlr_rport(rdata); 2962 2967 enum fip_vlan_subcode sub = FIP_SC_VL_NOTE; 2963 2968 2964 2969 if (fip->mode == FIP_MODE_VN2VN) ··· 2977 2982 { 2978 2983 struct fip_header *fiph; 2979 2984 enum fip_vlan_subcode sub; 2980 - struct { 2981 - struct fc_rport_priv rdata; 2982 - struct fcoe_rport frport; 2983 - } buf; 2985 + struct fcoe_rport frport = { }; 2984 2986 int rc; 2985 2987 2986 2988 fiph = (struct fip_header *)skb->data; 2987 2989 sub = fiph->fip_subcode; 2988 - rc = fcoe_ctlr_vlan_parse(fip, skb, &buf.rdata); 2990 + rc = fcoe_ctlr_vlan_parse(fip, skb, &frport); 2989 2991 if (rc) { 2990 2992 LIBFCOE_FIP_DBG(fip, "vlan_recv vlan_parse error %d\n", rc); 2991 2993 goto drop; 2992 2994 } 2993 2995 mutex_lock(&fip->ctlr_mutex); 2994 2996 if (sub == FIP_SC_VL_REQ) 2995 - fcoe_ctlr_vlan_disc_reply(fip, &buf.rdata); 2997 + fcoe_ctlr_vlan_disc_reply(fip, &frport); 2996 2998 mutex_unlock(&fip->ctlr_mutex); 2997 2999 2998 3000 drop:
+11 -3
drivers/scsi/hpsa.c
··· 2334 2334 case IOACCEL2_SERV_RESPONSE_COMPLETE: 2335 2335 switch (c2->error_data.status) { 2336 2336 case IOACCEL2_STATUS_SR_TASK_COMP_GOOD: 2337 + if (cmd) 2338 + cmd->result = 0; 2337 2339 break; 2338 2340 case IOACCEL2_STATUS_SR_TASK_COMP_CHK_COND: 2339 2341 cmd->result |= SAM_STAT_CHECK_CONDITION; ··· 2485 2483 2486 2484 /* check for good status */ 2487 2485 if (likely(c2->error_data.serv_response == 0 && 2488 - c2->error_data.status == 0)) 2486 + c2->error_data.status == 0)) { 2487 + cmd->result = 0; 2489 2488 return hpsa_cmd_free_and_done(h, c, cmd); 2489 + } 2490 2490 2491 2491 /* 2492 2492 * Any RAID offload error results in retry which will use ··· 5658 5654 return SCSI_MLQUEUE_DEVICE_BUSY; 5659 5655 5660 5656 /* 5657 + * This is necessary because the SML doesn't zero out this field during 5658 + * error recovery. 5659 + */ 5660 + cmd->result = 0; 5661 + 5662 + /* 5661 5663 * Call alternate submit routine for I/O accelerated commands. 5662 5664 * Retries always go down the normal I/O path. 5663 5665 */ ··· 6091 6081 if (idx != h->last_collision_tag) { /* Print once per tag */ 6092 6082 dev_warn(&h->pdev->dev, 6093 6083 "%s: tag collision (tag=%d)\n", __func__, idx); 6094 - if (c->scsi_cmd != NULL) 6095 - scsi_print_command(c->scsi_cmd); 6096 6084 if (scmd) 6097 6085 scsi_print_command(scmd); 6098 6086 h->last_collision_tag = idx;
+4 -1
drivers/scsi/libfc/fc_rport.c
··· 128 128 struct fc_rport_priv *fc_rport_create(struct fc_lport *lport, u32 port_id) 129 129 { 130 130 struct fc_rport_priv *rdata; 131 + size_t rport_priv_size = sizeof(*rdata); 131 132 132 133 lockdep_assert_held(&lport->disc.disc_mutex); 133 134 ··· 136 135 if (rdata) 137 136 return rdata; 138 137 139 - rdata = kzalloc(sizeof(*rdata) + lport->rport_priv_size, GFP_KERNEL); 138 + if (lport->rport_priv_size > 0) 139 + rport_priv_size = lport->rport_priv_size; 140 + rdata = kzalloc(rport_priv_size, GFP_KERNEL); 140 141 if (!rdata) 141 142 return NULL; 142 143
+7 -5
drivers/scsi/mpt3sas/mpt3sas_base.c
··· 2703 2703 { 2704 2704 u64 required_mask, coherent_mask; 2705 2705 struct sysinfo s; 2706 + /* Set 63 bit DMA mask for all SAS3 and SAS35 controllers */ 2707 + int dma_mask = (ioc->hba_mpi_version_belonged > MPI2_VERSION) ? 63 : 64; 2706 2708 2707 2709 if (ioc->is_mcpu_endpoint) 2708 2710 goto try_32bit; ··· 2714 2712 goto try_32bit; 2715 2713 2716 2714 if (ioc->dma_mask) 2717 - coherent_mask = DMA_BIT_MASK(64); 2715 + coherent_mask = DMA_BIT_MASK(dma_mask); 2718 2716 else 2719 2717 coherent_mask = DMA_BIT_MASK(32); 2720 2718 2721 - if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) || 2719 + if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(dma_mask)) || 2722 2720 dma_set_coherent_mask(&pdev->dev, coherent_mask)) 2723 2721 goto try_32bit; 2724 2722 2725 2723 ioc->base_add_sg_single = &_base_add_sg_single_64; 2726 2724 ioc->sge_size = sizeof(Mpi2SGESimple64_t); 2727 - ioc->dma_mask = 64; 2725 + ioc->dma_mask = dma_mask; 2728 2726 goto out; 2729 2727 2730 2728 try_32bit: ··· 2746 2744 _base_change_consistent_dma_mask(struct MPT3SAS_ADAPTER *ioc, 2747 2745 struct pci_dev *pdev) 2748 2746 { 2749 - if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) { 2747 + if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(ioc->dma_mask))) { 2750 2748 if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) 2751 2749 return -ENODEV; 2752 2750 } ··· 4991 4989 total_sz += sz; 4992 4990 } while (ioc->rdpq_array_enable && (++i < ioc->reply_queue_count)); 4993 4991 4994 - if (ioc->dma_mask == 64) { 4992 + if (ioc->dma_mask > 32) { 4995 4993 if (_base_change_consistent_dma_mask(ioc, ioc->pdev) != 0) { 4996 4994 ioc_warn(ioc, "no suitable consistent DMA mask for %s\n", 4997 4995 pci_name(ioc->pdev));
+1 -1
drivers/scsi/qla2xxx/qla_init.c
··· 4877 4877 ql_log(ql_log_warn, vha, 0xd049, 4878 4878 "Failed to allocate ct_sns request.\n"); 4879 4879 kfree(fcport); 4880 - fcport = NULL; 4880 + return NULL; 4881 4881 } 4882 4882 4883 4883 INIT_WORK(&fcport->del_work, qla24xx_delete_sess_fn);
+26 -26
include/scsi/libfc.h
··· 115 115 struct fc_lport *lp; 116 116 struct list_head peers; 117 117 struct work_struct rport_work; 118 - u32 port_id; 118 + u32 port_id; 119 119 }; 120 120 121 121 /** ··· 155 155 */ 156 156 struct fc_rport_libfc_priv { 157 157 struct fc_lport *local_port; 158 - enum fc_rport_state rp_state; 158 + enum fc_rport_state rp_state; 159 159 u16 flags; 160 160 #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0) 161 161 #define FC_RP_FLAGS_RETRY (1 << 1) 162 162 #define FC_RP_STARTED (1 << 2) 163 163 #define FC_RP_FLAGS_CONF_REQ (1 << 3) 164 - unsigned int e_d_tov; 165 - unsigned int r_a_tov; 164 + unsigned int e_d_tov; 165 + unsigned int r_a_tov; 166 166 }; 167 167 168 168 /** ··· 191 191 struct fc_lport *local_port; 192 192 struct fc_rport *rport; 193 193 struct kref kref; 194 - enum fc_rport_state rp_state; 194 + enum fc_rport_state rp_state; 195 195 struct fc_rport_identifiers ids; 196 196 u16 flags; 197 - u16 max_seq; 197 + u16 max_seq; 198 198 u16 disc_id; 199 199 u16 maxframe_size; 200 - unsigned int retries; 201 - unsigned int major_retries; 202 - unsigned int e_d_tov; 203 - unsigned int r_a_tov; 204 - struct mutex rp_mutex; 200 + unsigned int retries; 201 + unsigned int major_retries; 202 + unsigned int e_d_tov; 203 + unsigned int r_a_tov; 204 + struct mutex rp_mutex; 205 205 struct delayed_work retry_work; 206 - enum fc_rport_event event; 206 + enum fc_rport_event event; 207 207 struct fc_rport_operations *ops; 208 - struct list_head peers; 209 - struct work_struct event_work; 208 + struct list_head peers; 209 + struct work_struct event_work; 210 210 u32 supported_classes; 211 - u16 prli_count; 211 + u16 prli_count; 212 212 struct rcu_head rcu; 213 213 u16 sp_features; 214 214 u8 spp_type; ··· 618 618 * @disc_callback: Callback routine called when discovery completes 619 619 */ 620 620 struct fc_disc { 621 - unsigned char retry_count; 622 - unsigned char pending; 623 - unsigned char requested; 624 - unsigned short seq_count; 625 - unsigned char buf_len; 626 - u16 disc_id; 621 + unsigned char retry_count; 622 + unsigned char pending; 623 + unsigned char requested; 624 + unsigned short seq_count; 625 + unsigned char buf_len; 626 + u16 disc_id; 627 627 628 628 struct list_head rports; 629 629 void *priv; ··· 697 697 struct fc_rport_priv *ms_rdata; 698 698 struct fc_rport_priv *ptp_rdata; 699 699 void *scsi_priv; 700 - struct fc_disc disc; 700 + struct fc_disc disc; 701 701 702 702 /* Virtual port information */ 703 703 struct list_head vports; ··· 715 715 u8 retry_count; 716 716 717 717 /* Fabric information */ 718 - u32 port_id; 718 + u32 port_id; 719 719 u64 wwpn; 720 720 u64 wwnn; 721 721 unsigned int service_params; ··· 743 743 struct fc_ns_fts fcts; 744 744 745 745 /* Miscellaneous */ 746 - struct mutex lp_mutex; 747 - struct list_head list; 746 + struct mutex lp_mutex; 747 + struct list_head list; 748 748 struct delayed_work retry_work; 749 749 void *prov[FC_FC4_PROV_SIZE]; 750 - struct list_head lport_list; 750 + struct list_head lport_list; 751 751 }; 752 752 753 753 /**
+1
include/scsi/libfcoe.h
··· 229 229 * @vn_mac: VN_Node assigned MAC address for data 230 230 */ 231 231 struct fcoe_rport { 232 + struct fc_rport_priv rdata; 232 233 unsigned long time; 233 234 u16 fcoe_len; 234 235 u16 flags;