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

Merge patch series "libsas: Some tidy-up"

John Garry <john.g.garry@oracle.com> says:

This series tidies-up libsas a bit, including:
- delete structure(s) with only one member
- delete structure members which are only ever set
- delete structure members which are never set and code which relies on
that member being set

This conflicts with the following series:
https://lore.kernel.org/linux-scsi/20230809132249.37948-1-yuehaibing@huawei.com/

Any conflict should be trivial to resolve.

Based on mkp-scsi staging at a18e81d17a7e ("scsi: ufs: ufs-pci: Add support for QEMU")

Link: https://lore.kernel.org/r/20230815115156.343535-1-john.g.garry@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

+59 -131
+1 -3
drivers/scsi/aic94xx/aic94xx_hwi.c
··· 28 28 if (asd_ha->hw_prof.sas_addr[0]) 29 29 return 0; 30 30 31 - return sas_request_addr(asd_ha->sas_ha.core.shost, 31 + return sas_request_addr(asd_ha->sas_ha.shost, 32 32 asd_ha->hw_prof.sas_addr); 33 33 } 34 34 ··· 72 72 struct asd_sas_phy *sas_phy = &phy->sas_phy; 73 73 74 74 sas_phy->enabled = 1; 75 - sas_phy->class = SAS; 76 75 sas_phy->iproto = SAS_PROTOCOL_ALL; 77 76 sas_phy->tproto = 0; 78 - sas_phy->type = PHY_TYPE_PHYSICAL; 79 77 sas_phy->role = PHY_ROLE_INITIATOR; 80 78 sas_phy->oob_mode = OOB_NOT_CONNECTED; 81 79 sas_phy->linkrate = SAS_LINK_RATE_UNKNOWN;
+3 -4
drivers/scsi/aic94xx/aic94xx_init.c
··· 667 667 } 668 668 669 669 asd_ha->sas_ha.sas_ha_name = (char *) asd_ha->name; 670 - asd_ha->sas_ha.lldd_module = THIS_MODULE; 671 670 asd_ha->sas_ha.sas_addr = &asd_ha->hw_prof.sas_addr[0]; 672 671 673 672 for (i = 0; i < ASD_MAX_PHYS; i++) { ··· 687 688 688 689 err = sas_unregister_ha(&asd_ha->sas_ha); 689 690 690 - sas_remove_host(asd_ha->sas_ha.core.shost); 691 - scsi_host_put(asd_ha->sas_ha.core.shost); 691 + sas_remove_host(asd_ha->sas_ha.shost); 692 + scsi_host_put(asd_ha->sas_ha.shost); 692 693 693 694 kfree(asd_ha->sas_ha.sas_phy); 694 695 kfree(asd_ha->sas_ha.sas_port); ··· 738 739 asd_printk("found %s, device %s\n", asd_ha->name, pci_name(dev)); 739 740 740 741 SHOST_TO_SAS_HA(shost) = &asd_ha->sas_ha; 741 - asd_ha->sas_ha.core.shost = shost; 742 + asd_ha->sas_ha.shost = shost; 742 743 shost->transportt = aic94xx_transport_template; 743 744 shost->max_id = ~0; 744 745 shost->max_lun = ~0;
+2 -10
drivers/scsi/aic94xx/aic94xx_task.c
··· 388 388 flags |= data_dir_flags[task->data_dir]; 389 389 scb->ata_task.ata_flags = flags; 390 390 391 - scb->ata_task.retry_count = task->ata_task.retry_count; 391 + scb->ata_task.retry_count = 0; 392 392 393 - flags = 0; 394 - if (task->ata_task.set_affil_pol) 395 - flags |= SET_AFFIL_POLICY; 396 - if (task->ata_task.stp_affil_pol) 397 - flags |= STP_AFFIL_POLICY; 398 - scb->ata_task.flags = flags; 393 + scb->ata_task.flags = 0; 399 394 } 400 395 ascb->tasklet_complete = asd_task_tasklet_complete; 401 396 ··· 480 485 scb->ssp_task.ssp_frame.tptt = cpu_to_be16(0xFFFF); 481 486 482 487 memcpy(scb->ssp_task.ssp_cmd.lun, task->ssp_task.LUN, 8); 483 - if (task->ssp_task.enable_first_burst) 484 - scb->ssp_task.ssp_cmd.efb_prio_attr |= EFB_MASK; 485 - scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_prio << 3); 486 488 scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_attr & 7); 487 489 memcpy(scb->ssp_task.ssp_cmd.cdb, task->ssp_task.cmd->cmnd, 488 490 task->ssp_task.cmd->cmd_len);
+3 -6
drivers/scsi/hisi_sas/hisi_sas_main.c
··· 1018 1018 phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS; 1019 1019 phy->maximum_linkrate = hisi_hba->hw->phy_get_max_linkrate(); 1020 1020 sas_phy->enabled = (phy_no < hisi_hba->n_phy) ? 1 : 0; 1021 - sas_phy->class = SAS; 1022 1021 sas_phy->iproto = SAS_PROTOCOL_ALL; 1023 1022 sas_phy->tproto = 0; 1024 - sas_phy->type = PHY_TYPE_PHYSICAL; 1025 1023 sas_phy->role = PHY_ROLE_INITIATOR; 1026 1024 sas_phy->oob_mode = OOB_NOT_CONNECTED; 1027 1025 sas_phy->linkrate = SAS_LINK_RATE_UNKNOWN; ··· 2512 2514 2513 2515 sha->sas_ha_name = DRV_NAME; 2514 2516 sha->dev = hisi_hba->dev; 2515 - sha->lldd_module = THIS_MODULE; 2516 2517 sha->sas_addr = &hisi_hba->sas_addr[0]; 2517 2518 sha->num_phys = hisi_hba->n_phy; 2518 - sha->core.shost = hisi_hba->shost; 2519 + sha->shost = hisi_hba->shost; 2519 2520 2520 2521 for (i = 0; i < hisi_hba->n_phy; i++) { 2521 2522 sha->sas_phy[i] = &hisi_hba->phy[i].sas_phy; ··· 2556 2559 { 2557 2560 struct sas_ha_struct *sha = platform_get_drvdata(pdev); 2558 2561 struct hisi_hba *hisi_hba = sha->lldd_ha; 2559 - struct Scsi_Host *shost = sha->core.shost; 2562 + struct Scsi_Host *shost = sha->shost; 2560 2563 2561 2564 del_timer_sync(&hisi_hba->timer); 2562 2565 2563 2566 sas_unregister_ha(sha); 2564 - sas_remove_host(sha->core.shost); 2567 + sas_remove_host(shost); 2565 2568 2566 2569 hisi_sas_free(hisi_hba); 2567 2570 scsi_host_put(shost);
+2 -7
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
··· 960 960 struct scsi_cmnd *scsi_cmnd = ssp_task->cmd; 961 961 struct sas_tmf_task *tmf = slot->tmf; 962 962 int has_data = 0, priority = !!tmf; 963 - u8 *buf_cmd, fburst = 0; 963 + u8 *buf_cmd; 964 964 u32 dw1, dw2; 965 965 966 966 /* create header */ ··· 1018 1018 1019 1019 buf_cmd = hisi_sas_cmd_hdr_addr_mem(slot) + 1020 1020 sizeof(struct ssp_frame_hdr); 1021 - if (task->ssp_task.enable_first_burst) { 1022 - fburst = (1 << 7); 1023 - dw2 |= 1 << CMD_HDR_FIRST_BURST_OFF; 1024 - } 1025 1021 hdr->dw2 = cpu_to_le32(dw2); 1026 1022 1027 1023 memcpy(buf_cmd, &task->ssp_task.LUN, 8); 1028 1024 if (!tmf) { 1029 - buf_cmd[9] = fburst | task->ssp_task.task_attr | 1030 - (task->ssp_task.task_prio << 3); 1025 + buf_cmd[9] = task->ssp_task.task_attr; 1031 1026 memcpy(buf_cmd + 12, task->ssp_task.cmd->cmnd, 1032 1027 task->ssp_task.cmd->cmd_len); 1033 1028 } else {
+1 -2
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
··· 1798 1798 1799 1799 memcpy(buf_cmd, &task->ssp_task.LUN, 8); 1800 1800 if (!tmf) { 1801 - buf_cmd[9] = task->ssp_task.task_attr | 1802 - (task->ssp_task.task_prio << 3); 1801 + buf_cmd[9] = task->ssp_task.task_attr; 1803 1802 memcpy(buf_cmd + 12, task->ssp_task.cmd->cmnd, 1804 1803 task->ssp_task.cmd->cmd_len); 1805 1804 } else {
+4 -5
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
··· 1326 1326 1327 1327 memcpy(buf_cmd, &task->ssp_task.LUN, 8); 1328 1328 if (!tmf) { 1329 - buf_cmd[9] = ssp_task->task_attr | (ssp_task->task_prio << 3); 1329 + buf_cmd[9] = ssp_task->task_attr; 1330 1330 memcpy(buf_cmd + 12, scsi_cmnd->cmnd, scsi_cmnd->cmd_len); 1331 1331 } else { 1332 1332 buf_cmd[10] = tmf->tmf; ··· 4956 4956 4957 4957 sha->sas_phy = arr_phy; 4958 4958 sha->sas_port = arr_port; 4959 - sha->core.shost = shost; 4959 + sha->shost = shost; 4960 4960 sha->lldd_ha = hisi_hba; 4961 4961 4962 4962 shost->transportt = hisi_sas_stt; ··· 4973 4973 4974 4974 sha->sas_ha_name = DRV_NAME; 4975 4975 sha->dev = dev; 4976 - sha->lldd_module = THIS_MODULE; 4977 4976 sha->sas_addr = &hisi_hba->sas_addr[0]; 4978 4977 sha->num_phys = hisi_hba->n_phy; 4979 4978 ··· 5060 5061 struct device *dev = &pdev->dev; 5061 5062 struct sas_ha_struct *sha = dev_get_drvdata(dev); 5062 5063 struct hisi_hba *hisi_hba = sha->lldd_ha; 5063 - struct Scsi_Host *shost = sha->core.shost; 5064 + struct Scsi_Host *shost = sha->shost; 5064 5065 5065 5066 pm_runtime_get_noresume(dev); 5066 5067 del_timer_sync(&hisi_hba->timer); 5067 5068 5068 5069 sas_unregister_ha(sha); 5069 5070 flush_workqueue(hisi_hba->wq); 5070 - sas_remove_host(sha->core.shost); 5071 + sas_remove_host(shost); 5071 5072 5072 5073 hisi_sas_v3_destroy_irqs(pdev, hisi_hba); 5073 5074 hisi_sas_free(hisi_hba);
+1 -1
drivers/scsi/isci/host.h
··· 306 306 307 307 static inline struct Scsi_Host *to_shost(struct isci_host *ihost) 308 308 { 309 - return ihost->sas_ha.core.shost; 309 + return ihost->sas_ha.shost; 310 310 } 311 311 312 312 #define for_each_isci_host(id, ihost, pdev) \
+2 -3
drivers/scsi/isci/init.c
··· 250 250 return -ENOMEM; 251 251 252 252 sas_ha->sas_ha_name = DRV_NAME; 253 - sas_ha->lldd_module = THIS_MODULE; 254 253 sas_ha->sas_addr = &isci_host->phys[0].sas_addr[0]; 255 254 256 255 for (i = 0; i < SCI_MAX_PHYS; i++) { ··· 572 573 goto err_shost; 573 574 574 575 SHOST_TO_SAS_HA(shost) = &ihost->sas_ha; 575 - ihost->sas_ha.core.shost = shost; 576 + ihost->sas_ha.shost = shost; 576 577 shost->transportt = isci_transport_template; 577 578 578 579 shost->max_id = ~0; ··· 727 728 sas_prep_resume_ha(&ihost->sas_ha); 728 729 729 730 isci_host_init(ihost); 730 - isci_host_start(ihost->sas_ha.core.shost); 731 + isci_host_start(ihost->sas_ha.shost); 731 732 wait_for_start(ihost); 732 733 733 734 sas_resume_ha(&ihost->sas_ha);
-2
drivers/scsi/isci/phy.c
··· 1404 1404 iphy->sas_phy.ha = &ihost->sas_ha; 1405 1405 iphy->sas_phy.lldd_phy = iphy; 1406 1406 iphy->sas_phy.enabled = 1; 1407 - iphy->sas_phy.class = SAS; 1408 1407 iphy->sas_phy.iproto = SAS_PROTOCOL_ALL; 1409 1408 iphy->sas_phy.tproto = 0; 1410 - iphy->sas_phy.type = PHY_TYPE_PHYSICAL; 1411 1409 iphy->sas_phy.role = PHY_ROLE_INITIATOR; 1412 1410 iphy->sas_phy.oob_mode = OOB_NOT_CONNECTED; 1413 1411 iphy->sas_phy.linkrate = SAS_LINK_RATE_UNKNOWN;
+1 -1
drivers/scsi/isci/request.c
··· 180 180 cmd_iu->_r_a = 0; 181 181 cmd_iu->_r_b = 0; 182 182 cmd_iu->en_fburst = 0; /* unsupported */ 183 - cmd_iu->task_prio = task->ssp_task.task_prio; 183 + cmd_iu->task_prio = 0; 184 184 cmd_iu->task_attr = task->ssp_task.task_attr; 185 185 cmd_iu->_r_c = 0; 186 186
+4 -5
drivers/scsi/libsas/sas_ata.c
··· 162 162 struct ata_port *ap = qc->ap; 163 163 struct domain_device *dev = ap->private_data; 164 164 struct sas_ha_struct *sas_ha = dev->port->ha; 165 - struct Scsi_Host *host = sas_ha->core.shost; 165 + struct Scsi_Host *host = sas_ha->shost; 166 166 struct sas_internal *i = to_sas_internal(host->transportt); 167 167 168 168 /* TODO: we should try to remove that unlock */ ··· 201 201 task->data_dir = qc->dma_dir; 202 202 } 203 203 task->scatter = qc->sg; 204 - task->ata_task.retry_count = 1; 205 204 qc->lldd_task = task; 206 205 207 206 task->ata_task.use_ncq = ata_is_ncq(qc->tf.protocol); ··· 237 238 238 239 static struct sas_internal *dev_to_sas_internal(struct domain_device *dev) 239 240 { 240 - return to_sas_internal(dev->port->ha->core.shost->transportt); 241 + return to_sas_internal(dev->port->ha->shost->transportt); 241 242 } 242 243 243 244 static int sas_get_ata_command_set(struct domain_device *dev) ··· 586 587 int sas_ata_init(struct domain_device *found_dev) 587 588 { 588 589 struct sas_ha_struct *ha = found_dev->port->ha; 589 - struct Scsi_Host *shost = ha->core.shost; 590 + struct Scsi_Host *shost = ha->shost; 590 591 struct ata_host *ata_host; 591 592 struct ata_port *ap; 592 593 int rc; ··· 824 825 struct sas_ha_struct *ha = dev->port->ha; 825 826 826 827 sas_ata_printk(KERN_DEBUG, dev, "dev error handler\n"); 827 - ata_scsi_port_error_handler(ha->core.shost, ap); 828 + ata_scsi_port_error_handler(ha->shost, ap); 828 829 sas_put_device(dev); 829 830 } 830 831
+4 -4
drivers/scsi/libsas/sas_discover.c
··· 170 170 { 171 171 int res = 0; 172 172 struct sas_ha_struct *sas_ha = dev->port->ha; 173 - struct Scsi_Host *shost = sas_ha->core.shost; 173 + struct Scsi_Host *shost = sas_ha->shost; 174 174 struct sas_internal *i = to_sas_internal(shost->transportt); 175 175 176 176 if (!i->dft->lldd_dev_found) ··· 192 192 void sas_notify_lldd_dev_gone(struct domain_device *dev) 193 193 { 194 194 struct sas_ha_struct *sas_ha = dev->port->ha; 195 - struct Scsi_Host *shost = sas_ha->core.shost; 195 + struct Scsi_Host *shost = sas_ha->shost; 196 196 struct sas_internal *i = to_sas_internal(shost->transportt); 197 197 198 198 if (!i->dft->lldd_dev_gone) ··· 234 234 struct domain_device *dev; 235 235 struct sas_discovery_event *ev = to_sas_discovery_event(work); 236 236 struct asd_sas_port *port = ev->port; 237 - struct Scsi_Host *shost = port->ha->core.shost; 237 + struct Scsi_Host *shost = port->ha->shost; 238 238 struct sas_internal *si = to_sas_internal(shost->transportt); 239 239 240 240 clear_bit(DISCE_SUSPEND, &port->disc.pending); ··· 373 373 static void sas_abort_device_scsi_cmds(struct domain_device *dev) 374 374 { 375 375 struct sas_ha_struct *sas_ha = dev->port->ha; 376 - struct Scsi_Host *shost = sas_ha->core.shost; 376 + struct Scsi_Host *shost = sas_ha->shost; 377 377 378 378 if (dev_is_expander(dev->dev_type)) 379 379 return;
+1 -1
drivers/scsi/libsas/sas_expander.c
··· 37 37 int res, retry; 38 38 struct sas_task *task = NULL; 39 39 struct sas_internal *i = 40 - to_sas_internal(dev->port->ha->core.shost->transportt); 40 + to_sas_internal(dev->port->ha->shost->transportt); 41 41 struct sas_ha_struct *ha = dev->port->ha; 42 42 43 43 pm_runtime_get_sync(ha->dev);
+2 -2
drivers/scsi/libsas/sas_host_smp.c
··· 114 114 u8 reg_type, u8 reg_index, u8 reg_count, 115 115 u8 *req_data) 116 116 { 117 - struct sas_internal *i = to_sas_internal(sas_ha->core.shost->transportt); 117 + struct sas_internal *i = to_sas_internal(sas_ha->shost->transportt); 118 118 int written; 119 119 120 120 if (i->dft->lldd_write_gpio == NULL) { ··· 182 182 enum sas_linkrate max, u8 *resp_data) 183 183 { 184 184 struct sas_internal *i = 185 - to_sas_internal(sas_ha->core.shost->transportt); 185 + to_sas_internal(sas_ha->shost->transportt); 186 186 struct sas_phy_linkrates rates; 187 187 struct asd_sas_phy *asd_phy; 188 188
+8 -8
drivers/scsi/libsas/sas_init.c
··· 183 183 struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost); 184 184 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; 185 185 struct sas_internal *i = 186 - to_sas_internal(sas_ha->core.shost->transportt); 186 + to_sas_internal(sas_ha->shost->transportt); 187 187 188 188 return i->dft->lldd_control_phy(asd_phy, PHY_FUNC_GET_EVENTS, NULL); 189 189 } ··· 232 232 struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost); 233 233 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; 234 234 struct sas_internal *i = 235 - to_sas_internal(sas_ha->core.shost->transportt); 235 + to_sas_internal(sas_ha->shost->transportt); 236 236 237 237 if (!hard_reset && sas_try_ata_reset(asd_phy) == 0) 238 238 return 0; ··· 266 266 struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost); 267 267 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; 268 268 struct sas_internal *i = 269 - to_sas_internal(sas_ha->core.shost->transportt); 269 + to_sas_internal(sas_ha->shost->transportt); 270 270 271 271 if (enable) 272 272 ret = transport_sas_phy_reset(phy, 0); ··· 303 303 struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost); 304 304 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; 305 305 struct sas_internal *i = 306 - to_sas_internal(sas_ha->core.shost->transportt); 306 + to_sas_internal(sas_ha->shost->transportt); 307 307 308 308 ret = i->dft->lldd_control_phy(asd_phy, reset_type, NULL); 309 309 } else { ··· 339 339 struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost); 340 340 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; 341 341 struct sas_internal *i = 342 - to_sas_internal(sas_ha->core.shost->transportt); 342 + to_sas_internal(sas_ha->shost->transportt); 343 343 344 344 ret = i->dft->lldd_control_phy(asd_phy, PHY_FUNC_SET_LINK_RATE, 345 345 rates); ··· 438 438 /* all phys are back up or timed out, turn on i/o so we can 439 439 * flush out disks that did not return 440 440 */ 441 - scsi_unblock_requests(ha->core.shost); 441 + scsi_unblock_requests(ha->shost); 442 442 if (drain) 443 443 sas_drain_work(ha); 444 444 clear_bit(SAS_HA_RESUMING, &ha->state); ··· 468 468 int i; 469 469 470 470 sas_disable_events(ha); 471 - scsi_block_requests(ha->core.shost); 471 + scsi_block_requests(ha->shost); 472 472 for (i = 0; i < ha->num_phys; i++) { 473 473 struct asd_sas_port *port = ha->sas_port[i]; 474 474 ··· 641 641 struct asd_sas_event *event; 642 642 struct sas_ha_struct *sas_ha = phy->ha; 643 643 struct sas_internal *i = 644 - to_sas_internal(sas_ha->core.shost->transportt); 644 + to_sas_internal(sas_ha->shost->transportt); 645 645 646 646 event = kmem_cache_zalloc(sas_event_cache, gfp_flags); 647 647 if (!event)
+4 -4
drivers/scsi/libsas/sas_phy.c
··· 38 38 struct sas_ha_struct *sas_ha = phy->ha; 39 39 struct asd_sas_port *port = phy->port; 40 40 struct sas_internal *i = 41 - to_sas_internal(sas_ha->core.shost->transportt); 41 + to_sas_internal(sas_ha->shost->transportt); 42 42 43 43 sas_deform_port(phy, 1); 44 44 ··· 66 66 struct asd_sas_phy *phy = ev->phy; 67 67 struct sas_ha_struct *sas_ha = phy->ha; 68 68 struct sas_internal *i = 69 - to_sas_internal(sas_ha->core.shost->transportt); 69 + to_sas_internal(sas_ha->shost->transportt); 70 70 71 71 phy->error = 0; 72 72 i->dft->lldd_control_phy(phy, PHY_FUNC_RELEASE_SPINUP_HOLD, NULL); ··· 95 95 struct asd_sas_phy *phy = ev->phy; 96 96 struct sas_ha_struct *sas_ha = phy->ha; 97 97 struct sas_internal *i = 98 - to_sas_internal(sas_ha->core.shost->transportt); 98 + to_sas_internal(sas_ha->shost->transportt); 99 99 100 100 if (phy->enabled) { 101 101 int ret; ··· 131 131 spin_lock_init(&phy->sas_prim_lock); 132 132 phy->frame_rcvd_size = 0; 133 133 134 - phy->phy = sas_phy_alloc(&sas_ha->core.shost->shost_gendev, i); 134 + phy->phy = sas_phy_alloc(&sas_ha->shost->shost_gendev, i); 135 135 if (!phy->phy) 136 136 return -ENOMEM; 137 137
+3 -5
drivers/scsi/libsas/sas_port.c
··· 28 28 struct domain_device *dev, *n; 29 29 struct asd_sas_port *port = phy->port; 30 30 struct sas_ha_struct *sas_ha = phy->ha; 31 - struct sas_internal *si = to_sas_internal(sas_ha->core.shost->transportt); 31 + struct sas_internal *si = to_sas_internal(sas_ha->shost->transportt); 32 32 33 33 if (si->dft->lldd_port_formed) 34 34 si->dft->lldd_port_formed(phy); ··· 83 83 memcpy(port->sas_addr, phy->sas_addr, SAS_ADDR_SIZE); 84 84 85 85 if (*(u64 *)port->attached_sas_addr == 0) { 86 - port->class = phy->class; 87 86 memcpy(port->attached_sas_addr, phy->attached_sas_addr, 88 87 SAS_ADDR_SIZE); 89 88 port->iproto = phy->iproto; ··· 108 109 struct asd_sas_port *port = phy->port; 109 110 struct domain_device *port_dev = NULL; 110 111 struct sas_internal *si = 111 - to_sas_internal(sas_ha->core.shost->transportt); 112 + to_sas_internal(sas_ha->shost->transportt); 112 113 unsigned long flags; 113 114 114 115 if (port) { ··· 211 212 struct sas_ha_struct *sas_ha = phy->ha; 212 213 struct asd_sas_port *port = phy->port; 213 214 struct sas_internal *si = 214 - to_sas_internal(sas_ha->core.shost->transportt); 215 + to_sas_internal(sas_ha->shost->transportt); 215 216 struct domain_device *dev; 216 217 unsigned long flags; 217 218 ··· 248 249 INIT_LIST_HEAD(&port->phy_list); 249 250 memset(port->sas_addr, 0, SAS_ADDR_SIZE); 250 251 memset(port->attached_sas_addr, 0, SAS_ADDR_SIZE); 251 - port->class = 0; 252 252 port->iproto = 0; 253 253 port->tproto = 0; 254 254 port->oob_mode = 0;
+7 -8
drivers/scsi/libsas/sas_scsi_host.c
··· 142 142 task->dev = dev; 143 143 task->task_proto = task->dev->tproto; /* BUG_ON(!SSP) */ 144 144 145 - task->ssp_task.retry_count = 1; 146 145 int_to_scsilun(cmd->device->lun, &lun); 147 146 memcpy(task->ssp_task.LUN, &lun.scsi_lun, 8); 148 147 task->ssp_task.task_attr = TASK_ATTR_SIMPLE; ··· 278 279 unsigned long flags; 279 280 int i, res; 280 281 struct sas_internal *si = 281 - to_sas_internal(task->dev->port->ha->core.shost->transportt); 282 + to_sas_internal(task->dev->port->ha->shost->transportt); 282 283 283 284 for (i = 0; i < 5; i++) { 284 285 pr_notice("%s: aborting task 0x%p\n", __func__, task); ··· 326 327 int res = TMF_RESP_FUNC_FAILED; 327 328 struct scsi_lun lun; 328 329 struct sas_internal *i = 329 - to_sas_internal(dev->port->ha->core.shost->transportt); 330 + to_sas_internal(dev->port->ha->shost->transportt); 330 331 331 332 int_to_scsilun(cmd->device->lun, &lun); 332 333 ··· 354 355 { 355 356 int res = TMF_RESP_FUNC_FAILED; 356 357 struct sas_internal *i = 357 - to_sas_internal(dev->port->ha->core.shost->transportt); 358 + to_sas_internal(dev->port->ha->shost->transportt); 358 359 359 360 pr_notice("I_T nexus reset for dev %016llx\n", 360 361 SAS_ADDR(dev->sas_addr)); ··· 409 410 spin_unlock_irq(&ha->lock); 410 411 411 412 /* make sure SCSI EH is complete */ 412 - if (scsi_host_in_recovery(ha->core.shost)) { 413 + if (scsi_host_in_recovery(ha->shost)) { 413 414 msleep(10); 414 415 goto retry; 415 416 } ··· 439 440 set_bit(SAS_DEV_EH_PENDING, &dev->state); 440 441 set_bit(reset_type, &dev->state); 441 442 int_to_scsilun(lun, &dev->ssp_dev.reset_lun); 442 - scsi_schedule_eh(ha->core.shost); 443 + scsi_schedule_eh(ha->shost); 443 444 } 444 445 spin_unlock_irq(&ha->lock); 445 446 ··· 924 925 unsigned int qid, void *data) 925 926 { 926 927 struct sas_ha_struct *ha = device->port->ha; 927 - struct sas_internal *i = to_sas_internal(ha->core.shost->transportt); 928 + struct sas_internal *i = to_sas_internal(ha->shost->transportt); 928 929 struct sas_task *task = NULL; 929 930 int res, retry; 930 931 ··· 1014 1015 { 1015 1016 struct sas_task *task; 1016 1017 struct sas_internal *i = 1017 - to_sas_internal(device->port->ha->core.shost->transportt); 1018 + to_sas_internal(device->port->ha->shost->transportt); 1018 1019 int res, retry; 1019 1020 1020 1021 for (retry = 0; retry < TASK_RETRY; retry++) {
+2 -5
drivers/scsi/mvsas/mv_init.c
··· 84 84 phy->port = NULL; 85 85 timer_setup(&phy->timer, NULL, 0); 86 86 sas_phy->enabled = (phy_id < mvi->chip->n_phy) ? 1 : 0; 87 - sas_phy->class = SAS; 88 87 sas_phy->iproto = SAS_PROTOCOL_ALL; 89 88 sas_phy->tproto = 0; 90 - sas_phy->type = PHY_TYPE_PHYSICAL; 91 89 sas_phy->role = PHY_ROLE_INITIATOR; 92 90 sas_phy->oob_mode = OOB_NOT_CONNECTED; 93 91 sas_phy->linkrate = SAS_LINK_RATE_UNKNOWN; ··· 414 416 415 417 sha->sas_phy = arr_phy; 416 418 sha->sas_port = arr_port; 417 - sha->core.shost = shost; 419 + sha->shost = shost; 418 420 419 421 sha->lldd_ha = kzalloc(sizeof(struct mvs_prv_info), GFP_KERNEL); 420 422 if (!sha->lldd_ha) ··· 456 458 457 459 sha->sas_ha_name = DRV_NAME; 458 460 sha->dev = mvi->dev; 459 - sha->lldd_module = THIS_MODULE; 460 461 sha->sas_addr = &mvi->sas_addr[0]; 461 462 462 463 sha->num_phys = nr_core * chip_info->n_phy; ··· 470 473 shost->sg_tablesize = min_t(u16, SG_ALL, MVS_MAX_SG); 471 474 shost->can_queue = can_queue; 472 475 mvi->shost->cmd_per_lun = MVS_QUEUE_SIZE; 473 - sha->core.shost = mvi->shost; 476 + sha->shost = mvi->shost; 474 477 } 475 478 476 479 static void mvs_init_sas_add(struct mvs_info *mvi)
+2 -7
drivers/scsi/mvsas/mv_sas.c
··· 564 564 void *buf_prd; 565 565 struct ssp_frame_hdr *ssp_hdr; 566 566 void *buf_tmp; 567 - u8 *buf_cmd, *buf_oaf, fburst = 0; 567 + u8 *buf_cmd, *buf_oaf; 568 568 dma_addr_t buf_tmp_dma; 569 569 u32 flags; 570 570 u32 resp_len, req_len, i, tag = tei->tag; ··· 582 582 (phy_mask << TXQ_PHY_SHIFT)); 583 583 584 584 flags = MCH_RETRY; 585 - if (task->ssp_task.enable_first_burst) { 586 - flags |= MCH_FBURST; 587 - fburst = (1 << 7); 588 - } 589 585 if (is_tmf) 590 586 flags |= (MCH_SSP_FR_TASK << MCH_SSP_FR_TYPE_SHIFT); 591 587 else ··· 663 667 memcpy(buf_cmd, &task->ssp_task.LUN, 8); 664 668 665 669 if (ssp_hdr->frame_type != SSP_TASK) { 666 - buf_cmd[9] = fburst | task->ssp_task.task_attr | 667 - (task->ssp_task.task_prio << 3); 670 + buf_cmd[9] = task->ssp_task.task_attr; 668 671 memcpy(buf_cmd + 12, task->ssp_task.cmd->cmnd, 669 672 task->ssp_task.cmd->cmd_len); 670 673 } else{
-3
drivers/scsi/pm8001/pm8001_hwi.c
··· 4053 4053 ssp_cmd.data_len = cpu_to_le32(task->total_xfer_len); 4054 4054 ssp_cmd.device_id = cpu_to_le32(pm8001_dev->device_id); 4055 4055 ssp_cmd.tag = cpu_to_le32(tag); 4056 - if (task->ssp_task.enable_first_burst) 4057 - ssp_cmd.ssp_iu.efb_prio_attr |= 0x80; 4058 - ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_prio << 3); 4059 4056 ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_attr & 7); 4060 4057 memcpy(ssp_cmd.ssp_iu.cdb, task->ssp_task.cmd->cmnd, 4061 4058 task->ssp_task.cmd->cmd_len);
+1 -4
drivers/scsi/pm8001/pm8001_init.c
··· 162 162 phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS; 163 163 phy->maximum_linkrate = SAS_LINK_RATE_6_0_GBPS; 164 164 sas_phy->enabled = (phy_id < pm8001_ha->chip->n_phy) ? 1 : 0; 165 - sas_phy->class = SAS; 166 165 sas_phy->iproto = SAS_PROTOCOL_ALL; 167 166 sas_phy->tproto = 0; 168 - sas_phy->type = PHY_TYPE_PHYSICAL; 169 167 sas_phy->role = PHY_ROLE_INITIATOR; 170 168 sas_phy->oob_mode = OOB_NOT_CONNECTED; 171 169 sas_phy->linkrate = SAS_LINK_RATE_UNKNOWN; ··· 652 654 sha->sas_ha_name = DRV_NAME; 653 655 sha->dev = pm8001_ha->dev; 654 656 sha->strict_wide_ports = 1; 655 - sha->lldd_module = THIS_MODULE; 656 657 sha->sas_addr = &pm8001_ha->sas_addr[0]; 657 658 sha->num_phys = chip_info->n_phy; 658 - sha->core.shost = shost; 659 + sha->shost = shost; 659 660 } 660 661 661 662 /**
-3
drivers/scsi/pm8001/pm80xx_hwi.c
··· 4316 4316 ssp_cmd.data_len = cpu_to_le32(task->total_xfer_len); 4317 4317 ssp_cmd.device_id = cpu_to_le32(pm8001_dev->device_id); 4318 4318 ssp_cmd.tag = cpu_to_le32(tag); 4319 - if (task->ssp_task.enable_first_burst) 4320 - ssp_cmd.ssp_iu.efb_prio_attr = 0x80; 4321 - ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_prio << 3); 4322 4319 ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_attr & 7); 4323 4320 memcpy(ssp_cmd.ssp_iu.cdb, task->ssp_task.cmd->cmnd, 4324 4321 task->ssp_task.cmd->cmd_len);
+1 -28
include/scsi/libsas.h
··· 23 23 24 24 struct block_device; 25 25 26 - enum sas_class { 27 - SAS, 28 - EXPANDER 29 - }; 30 - 31 26 enum sas_phy_role { 32 27 PHY_ROLE_NONE = 0, 33 28 PHY_ROLE_TARGET = 0x40, 34 29 PHY_ROLE_INITIATOR = 0x80, 35 - }; 36 - 37 - enum sas_phy_type { 38 - PHY_TYPE_PHYSICAL, 39 - PHY_TYPE_VIRTUAL 40 30 }; 41 31 42 32 /* The events are mnemonically described in sas_dump.c ··· 248 258 /* public: */ 249 259 int id; 250 260 251 - enum sas_class class; 252 261 u8 sas_addr[SAS_ADDR_SIZE]; 253 262 u8 attached_sas_addr[SAS_ADDR_SIZE]; 254 263 enum sas_protocol iproto; ··· 308 319 int enabled; /* must be set */ 309 320 310 321 int id; /* must be set */ 311 - enum sas_class class; 312 322 enum sas_protocol iproto; 313 323 enum sas_protocol tproto; 314 324 315 - enum sas_phy_type type; 316 325 enum sas_phy_role role; 317 326 enum sas_oob_mode oob_mode; 318 327 enum sas_linkrate linkrate; ··· 333 346 void *lldd_phy; /* not touched by the sas_class_code */ 334 347 }; 335 348 336 - struct scsi_core { 337 - struct Scsi_Host *shost; 338 - 339 - }; 340 - 341 349 enum sas_ha_state { 342 350 SAS_HA_REGISTERED, 343 351 SAS_HA_DRAINING, ··· 353 371 354 372 struct mutex disco_mutex; 355 373 356 - struct scsi_core core; 374 + struct Scsi_Host *shost; 357 375 358 376 /* public: */ 359 377 char *sas_ha_name; 360 378 struct device *dev; /* should be set */ 361 - struct module *lldd_module; /* should be set */ 362 379 363 380 struct workqueue_struct *event_q; 364 381 struct workqueue_struct *disco_q; ··· 525 544 struct host_to_dev_fis fis; 526 545 u8 atapi_packet[16]; /* 0 if not ATAPI task */ 527 546 528 - u8 retry_count; /* hardware retry, should be > 0 */ 529 - 530 547 u8 dma_xfer:1; /* PIO:0 or DMA:1 */ 531 548 u8 use_ncq:1; 532 - u8 set_affil_pol:1; 533 - u8 stp_affil_pol:1; 534 549 u8 return_fis_on_success:1; 535 550 536 551 u8 device_control_reg_update:1; ··· 560 583 }; 561 584 562 585 struct sas_ssp_task { 563 - u8 retry_count; /* hardware retry, should be > 0 */ 564 - 565 586 u8 LUN[8]; 566 - u8 enable_first_burst:1; 567 587 enum task_attribute task_attr; 568 - u8 task_prio; 569 588 struct scsi_cmnd *cmd; 570 589 }; 571 590