FreeBSD Bugzilla – Attachment 220793 Details for
Bug 243401
[patch] ahci driver problems with Marvell 88SE9230 (Dell BOSS-S1)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for AHCI driver to make Dell BOSS-S1 detect unconfigure disks
ahci.c.patch (text/plain), 5.01 KB, created by
Peter Eriksson
on 2020-12-21 23:41:04 UTC
(
hide
)
Description:
Patch for AHCI driver to make Dell BOSS-S1 detect unconfigure disks
Filename:
MIME Type:
Creator:
Peter Eriksson
Created:
2020-12-21 23:41:04 UTC
Size:
5.01 KB
patch
obsolete
>Index: sys/dev/ahci/ahci.c >=================================================================== >--- sys/dev/ahci/ahci.c (revision 368820) >+++ sys/dev/ahci/ahci.c (working copy) >@@ -103,6 +103,10 @@ > #define RECOVERY_REQUEST_SENSE 2 > #define recovery_slot spriv_field1 > >+int ahci_verbose = 0; >+SYSCTL_INT(_debug, OID_AUTO, ahci_verbose, CTLFLAG_RW, &ahci_verbose, >+ 0, "AHCI verbosity"); >+ > static uint32_t > ahci_ch_detval(struct ahci_channel *ch, uint32_t val) > { >@@ -125,7 +129,7 @@ > AHCI_CCCC_EN); > ctlr->cccv = (ATA_INL(ctlr->r_mem, AHCI_CCCC) & > AHCI_CCCC_INT_MASK) >> AHCI_CCCC_INT_SHIFT; >- if (bootverbose) { >+ if (bootverbose || ahci_verbose) { > device_printf(dev, > "CCC with %dms/4cmd enabled on vector %d\n", > ctlr->ccc, ctlr->cccv); >@@ -322,7 +326,7 @@ > device_printf(dev, "quirks=0x%b\n", ctlr->quirks, > AHCI_Q_BIT_STRING); > } >- if (bootverbose) { >+ if (bootverbose || ahci_verbose) { > device_printf(dev, "Caps:%s%s%s%s%s%s%s%s %sGbps", > (ctlr->caps & AHCI_CAP_64BIT) ? " 64bit":"", > (ctlr->caps & AHCI_CAP_SNCQ) ? " NCQ":"", >@@ -347,7 +351,7 @@ > (ctlr->caps & AHCI_CAP_SXS) ? " eSATA":"", > (ctlr->caps & AHCI_CAP_NPMASK) + 1); > } >- if (bootverbose && version >= 0x00010200) { >+ if ((bootverbose || ahci_verbose) && version >= 0x00010200) { > device_printf(dev, "Caps2:%s%s%s%s%s%s\n", > (ctlr->caps2 & AHCI_CAP2_DESO) ? " DESO":"", > (ctlr->caps2 & AHCI_CAP2_SADM) ? " SADM":"", >@@ -857,7 +861,7 @@ > ch->chcaps |= AHCI_P_CMD_FBSCP; > if (ch->caps2 & AHCI_CAP2_SDS) > ch->chscaps = ATA_INL(ch->r_mem, AHCI_P_DEVSLP); >- if (bootverbose) { >+ if (bootverbose || ahci_verbose) { > device_printf(dev, "Caps:%s%s%s%s%s%s\n", > (ch->chcaps & AHCI_P_CMD_HPCP) ? " HPCP":"", > (ch->chcaps & AHCI_P_CMD_MPSP) ? " MPSP":"", >@@ -1224,7 +1228,7 @@ > u_int32_t status = ATA_INL(ch->r_mem, AHCI_P_SSTS); > union ccb *ccb; > >- if (bootverbose) { >+ if (bootverbose || ahci_verbose) { > if ((status & ATA_SS_DET_MASK) != ATA_SS_DET_NO_DEVICE) > device_printf(ch->dev, "CONNECT requested\n"); > else >@@ -1259,7 +1263,7 @@ > if ((status & AHCI_P_CMD_CPD) == 0) > return; > >- if (bootverbose) { >+ if (bootverbose || ahci_verbose) { > dev = ch->dev; > if (status & AHCI_P_CMD_CPS) { > device_printf(dev, "COLD CONNECT requested\n"); >@@ -1285,7 +1289,7 @@ > > if (ch->caps & AHCI_CAP_SSNTF) > ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status); >- if (bootverbose) >+ if (bootverbose || ahci_verbose) > device_printf(ch->dev, "SNTF 0x%04x\n", status); > for (i = 0; i < 16; i++) { > if ((status & (1 << i)) == 0) >@@ -2422,7 +2426,7 @@ > DELAY(1000); > timeout++; > } >- if (bootverbose) >+ if (bootverbose || ahci_verbose) > device_printf(ch->dev, "AHCI reset: device ready after %dms\n", > timeout + t0); > return (0); >@@ -2459,7 +2463,7 @@ > int i; > > xpt_freeze_simq(ch->sim, 1); >- if (bootverbose) >+ if (bootverbose || ahci_verbose) > device_printf(ch->dev, "AHCI reset...\n"); > /* Forget about previous reset. */ > if (ch->resetting) { >@@ -2506,7 +2510,7 @@ > ATA_OUTL(ch->r_mem, AHCI_P_IE, 0); > /* Reset and reconnect PHY, */ > if (!ahci_sata_phy_reset(ch)) { >- if (bootverbose) >+ if (bootverbose || ahci_verbose) > device_printf(ch->dev, > "AHCI reset: device not found\n"); > ch->devices = 0; >@@ -2517,7 +2521,7 @@ > xpt_release_simq(ch->sim, TRUE); > return; > } >- if (bootverbose) >+ if (bootverbose || ahci_verbose) > device_printf(ch->dev, "AHCI reset: device found\n"); > /* Wait for clearing busy status. */ > if (ahci_wait_ready(ch, dumping ? 31000 : 0, 0)) { >@@ -2603,10 +2607,17 @@ > { > u_int32_t status; > int timeout, found = 0; >+ int last_status = -1; > >+ > /* Wait up to 100ms for "connect well" */ >- for (timeout = 0; timeout < 1000 ; timeout++) { >+ for (timeout = 0; timeout < 10000 ; timeout++) { /* timeout < 1000 - Peter E */ > status = ATA_INL(ch->r_mem, AHCI_P_SSTS); >+ >+ if (ahci_verbose && status != last_status) { >+ device_printf(ch->dev, "SATA status changed %08x at time=%dus\n", status, timeout * 100); >+ last_status = status; >+ } > if ((status & ATA_SS_DET_MASK) != ATA_SS_DET_NO_DEVICE) > found = 1; > if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) && >@@ -2614,18 +2625,18 @@ > ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) > break; > if ((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_OFFLINE) { >- if (bootverbose) { >+ if (bootverbose || ahci_verbose) { > device_printf(ch->dev, "SATA offline status=%08x\n", > status); > } > return (0); > } >- if (found == 0 && timeout >= 100) >+ if (found == 0 && timeout >= 5000) /* timeout >= 100 */ > break; > DELAY(100); > } >- if (timeout >= 1000 || !found) { >- if (bootverbose) { >+ if (timeout >= 5000 || !found) { >+ if (bootverbose || ahci_verbose) { > device_printf(ch->dev, > "SATA connect timeout time=%dus status=%08x\n", > timeout * 100, status); >@@ -2632,7 +2643,7 @@ > } > return (0); > } >- if (bootverbose) { >+ if (bootverbose || ahci_verbose) { > device_printf(ch->dev, "SATA connect time=%dus status=%08x\n", > timeout * 100, status); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 243401
:
220793
|
221500
|
221502
|
237998
|
240058