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

scsi: libsas: Introduce struct smp_rps_resp

Similarly to sas report general and discovery responses, define the
structure struct smp_rps_resp to handle SATA PHY report responses using a
structure with a size that is exactly equal to the sas defined response
size.

With this change, struct smp_resp becomes unused and is removed.

Link: https://lore.kernel.org/r/20220609022456.409087-4-damien.lemoal@opensource.wdc.com
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Damien Le Moal and committed by
Martin K. Petersen
3dafe064 44f2bfe9

+7 -11
+1 -1
drivers/scsi/aic94xx/aic94xx_dev.c
··· 159 159 flags |= OPEN_REQUIRED; 160 160 if ((dev->dev_type == SAS_SATA_DEV) || 161 161 (dev->tproto & SAS_PROTOCOL_STP)) { 162 - struct smp_resp *rps_resp = &dev->sata_dev.rps_resp; 162 + struct smp_rps_resp *rps_resp = &dev->sata_dev.rps_resp; 163 163 if (rps_resp->frame_type == SMP_RESPONSE && 164 164 rps_resp->function == SMP_REPORT_PHY_SATA && 165 165 rps_resp->result == SMP_RESP_FUNC_ACC) {
+2 -2
drivers/scsi/libsas/sas_expander.c
··· 676 676 #ifdef CONFIG_SCSI_SAS_ATA 677 677 678 678 #define RPS_REQ_SIZE 16 679 - #define RPS_RESP_SIZE 60 679 + #define RPS_RESP_SIZE sizeof(struct smp_rps_resp) 680 680 681 681 int sas_get_report_phy_sata(struct domain_device *dev, int phy_id, 682 - struct smp_resp *rps_resp) 682 + struct smp_rps_resp *rps_resp) 683 683 { 684 684 int res; 685 685 u8 *rps_req = alloc_smp_req(RPS_REQ_SIZE);
+1 -1
drivers/scsi/libsas/sas_internal.h
··· 83 83 struct domain_device *sas_ex_to_ata(struct domain_device *ex_dev, int phy_id); 84 84 int sas_ex_phy_discover(struct domain_device *dev, int single); 85 85 int sas_get_report_phy_sata(struct domain_device *dev, int phy_id, 86 - struct smp_resp *rps_resp); 86 + struct smp_rps_resp *rps_resp); 87 87 int sas_try_ata_reset(struct asd_sas_phy *phy); 88 88 void sas_hae_reset(struct work_struct *work); 89 89
+1 -1
include/scsi/libsas.h
··· 145 145 146 146 struct ata_port *ap; 147 147 struct ata_host *ata_host; 148 - struct smp_resp rps_resp ____cacheline_aligned; /* report_phy_sata_resp */ 148 + struct smp_rps_resp rps_resp ____cacheline_aligned; /* report_phy_sata_resp */ 149 149 u8 fis[ATA_RESP_FIS_SIZE]; 150 150 }; 151 151
+2 -6
include/scsi/sas.h
··· 712 712 struct discover_resp disc; 713 713 } __attribute__ ((packed)); 714 714 715 - struct smp_resp { 715 + struct smp_rps_resp { 716 716 u8 frame_type; 717 717 u8 function; 718 718 u8 result; 719 719 u8 reserved; 720 - union { 721 - struct report_general_resp rg; 722 - struct discover_resp disc; 723 - struct report_phy_sata_resp rps; 724 - }; 720 + struct report_phy_sata_resp rps; 725 721 } __attribute__ ((packed)); 726 722 727 723 #endif /* _SAS_H_ */