tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: faeab166167f5787719eb8683661fd41a3bb1514 commit: 8aa580cd92843b60d4d6331f3b0a9e8409bb70eb scsi: hisi_sas: Enable force phy when SATA disk directly connected date: 1 year, 1 month ago config: loongarch-randconfig-r113-20260419 compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff) rustc: rustc 1.88.0 (6b00bc388 2025-06-23) sparse: v0.6.5-rc1 reproduce (this is a W=1 build): If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Fixes: 8aa580cd9284 ("scsi: hisi_sas: Enable force phy when SATA disk directly connected") | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202604191850.IVYPTaML-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:1448:26: sparse: sparse: invalid assignment: |= drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:1448:26: sparse: left side has type restricted __le32 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:1448:26: sparse: right side has type unsigned int vim +1448 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c 1425 1426 static void prep_ata_v3_hw(struct hisi_hba *hisi_hba, 1427 struct hisi_sas_slot *slot) 1428 { 1429 struct sas_task *task = slot->task; 1430 struct domain_device *device = task->dev; 1431 struct domain_device *parent_dev = device->parent; 1432 struct hisi_sas_device *sas_dev = device->lldd_dev; 1433 struct hisi_sas_cmd_hdr *hdr = slot->cmd_hdr; 1434 struct asd_sas_port *sas_port = device->port; 1435 struct hisi_sas_port *port = to_hisi_sas_port(sas_port); 1436 int phy_id; 1437 u8 *buf_cmd; 1438 int has_data = 0, hdr_tag = 0; 1439 u32 dw1 = 0, dw2 = 0; 1440 1441 hdr->dw0 = cpu_to_le32(port->id << CMD_HDR_PORT_OFF); 1442 if (parent_dev && dev_is_expander(parent_dev->dev_type)) { 1443 hdr->dw0 |= cpu_to_le32(3 << CMD_HDR_CMD_OFF); 1444 } else { 1445 phy_id = device->phy->identify.phy_identifier; 1446 hdr->dw0 |= cpu_to_le32((1U << phy_id) 1447 << CMD_HDR_PHY_ID_OFF); > 1448 hdr->dw0 |= CMD_HDR_FORCE_PHY_MSK; 1449 hdr->dw0 |= cpu_to_le32(4U << CMD_HDR_CMD_OFF); 1450 } 1451 1452 switch (task->data_dir) { 1453 case DMA_TO_DEVICE: 1454 has_data = 1; 1455 dw1 |= DIR_TO_DEVICE << CMD_HDR_DIR_OFF; 1456 break; 1457 case DMA_FROM_DEVICE: 1458 has_data = 1; 1459 dw1 |= DIR_TO_INI << CMD_HDR_DIR_OFF; 1460 break; 1461 default: 1462 dw1 &= ~CMD_HDR_DIR_MSK; 1463 } 1464 1465 if ((task->ata_task.fis.command == ATA_CMD_DEV_RESET) && 1466 (task->ata_task.fis.control & ATA_SRST)) 1467 dw1 |= 1 << CMD_HDR_RESET_OFF; 1468 1469 dw1 |= (hisi_sas_get_ata_protocol(task)) << CMD_HDR_FRAME_TYPE_OFF; 1470 dw1 |= sas_dev->device_id << CMD_HDR_DEV_ID_OFF; 1471 1472 if (FIS_CMD_IS_UNCONSTRAINED(task->ata_task.fis)) 1473 dw1 |= 1 << CMD_HDR_UNCON_CMD_OFF; 1474 1475 hdr->dw1 = cpu_to_le32(dw1); 1476 1477 /* dw2 */ 1478 if (task->ata_task.use_ncq) { 1479 struct ata_queued_cmd *qc = task->uldd_task; 1480 1481 hdr_tag = qc->tag; 1482 task->ata_task.fis.sector_count |= (u8) (hdr_tag << 3); 1483 dw2 |= hdr_tag << CMD_HDR_NCQ_TAG_OFF; 1484 } 1485 1486 dw2 |= (HISI_SAS_MAX_STP_RESP_SZ / 4) << CMD_HDR_CFL_OFF | 1487 2 << CMD_HDR_SG_MOD_OFF; 1488 hdr->dw2 = cpu_to_le32(dw2); 1489 1490 /* dw3 */ 1491 hdr->transfer_tags = cpu_to_le32(slot->idx); 1492 1493 if (has_data) 1494 prep_prd_sge_v3_hw(hisi_hba, slot, hdr, task->scatter, 1495 slot->n_elem); 1496 1497 hdr->data_transfer_len = cpu_to_le32(task->total_xfer_len); 1498 hdr->cmd_table_addr = cpu_to_le64(hisi_sas_cmd_hdr_addr_dma(slot)); 1499 hdr->sts_buffer_addr = cpu_to_le64(hisi_sas_status_buf_addr_dma(slot)); 1500 1501 buf_cmd = hisi_sas_cmd_hdr_addr_mem(slot); 1502 1503 if (likely(!task->ata_task.device_control_reg_update)) 1504 task->ata_task.fis.flags |= 0x80; /* C=1: update ATA cmd reg */ 1505 /* fill in command FIS */ 1506 memcpy(buf_cmd, &task->ata_task.fis, sizeof(struct host_to_dev_fis)); 1507 } 1508 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki