diff options
author | Ian Moffett <ian@osmora.org> | 2025-06-10 23:31:58 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-06-10 23:35:24 -0400 |
commit | 6c48e37379705763c340629fb759ead80fb3c4cf (patch) | |
tree | 55f987cef3887ce394e1cf0de81b720553dab00a /sys/dev | |
parent | c3fe4c4c4dfb662e65299669147a904585eb5aca (diff) |
kernel: ahci: Fix issue of undetectable devices
- Only check PxSCTL.SET within the port reset logic
- Do not create device file for ATAPI devices (yet)
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/ahci.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c index b713711..d4c10c7 100644 --- a/sys/dev/ic/ahci.c +++ b/sys/dev/ic/ahci.c @@ -760,27 +760,19 @@ ahci_init_port(struct ahci_hba *hba, uint32_t portno) struct hba_device *dp; struct ctlfs_dev dev; size_t clen, pagesz; - uint32_t lo, hi, ssts; - uint8_t det; + uint32_t lo, hi, sig; paddr_t fra, cmdlist, tmp; int error; pagesz = DEFAULT_PAGESIZE; port = &abar->ports[portno]; - /* Is anything on the port? */ - ssts = mmio_read32(&port->ssts); - det = AHCI_PXSCTL_DET(ssts); - switch (det) { - case AHCI_DET_NULL: - /* No device attached */ - return 0; - case AHCI_DET_PRESENT: - if ((error = hba_port_reset(hba, port)) < 0) { - pr_trace("failed to reset port %d\n", portno); - return error; - } - break; + if ((error = hba_port_reset(hba, port)) < 0) { + return error; + } + sig = mmio_read32(&port->sig); + if (sig == ATAPI_SIG) { + return -ENOTSUP; } pr_trace("found device @ port %d\n", portno); |