Skip to contentSkip to conversation

block: ahci: Remove dead code

PATCH In review Fabio Estevam 3 participants 4 messages Nov 1, 2015 – Nov 13, 2015 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: ahci: Remove dead code

From: Fabio Estevam <[email protected]>

CONFIG_AHCI_SETFEATURES_XFER is not selected by any user, so delete the dead code.

---
 drivers/block/ahci.c | 36 ------------------------------------
 1 file changed, 36 deletions(-)
drivers/block/ahci.c +0 -36
index 82c6843..1ad638e 100644
@@ -485,36 +485,6 @@ static void ahci_fill_cmd_slot(struct ahci_ioports *pp, u32 opts)
 #endif
 }
 
-
-#ifdef CONFIG_AHCI_SETFEATURES_XFER
-static void ahci_set_feature(u8 port)
-{
-	struct ahci_ioports *pp = &(probe_ent->port[port]);
-	void __iomem *port_mmio = pp->port_mmio;
-	u32 cmd_fis_len = 5;	/* five dwords */
-	u8 fis[20];
-
-	/* set feature */
-	memset(fis, 0, sizeof(fis));
-	fis[0] = 0x27;
-	fis[1] = 1 << 7;
-	fis[2] = ATA_CMD_SET_FEATURES;
-	fis[3] = SETFEATURES_XFER;
-	fis[12] = __ilog2(probe_ent->udma_mask + 1) + 0x40 - 0x01;
-
-	memcpy((unsigned char *)pp->cmd_tbl, fis, sizeof(fis));
-	ahci_fill_cmd_slot(pp, cmd_fis_len);
-	ahci_dcache_flush_sata_cmd(pp);
-	writel(1, port_mmio + PORT_CMD_ISSUE);
-	readl(port_mmio + PORT_CMD_ISSUE);
-
-	if (waiting_for_cmd_completed(port_mmio + PORT_CMD_ISSUE,
-				WAIT_MS_DATAIO, 0x1)) {
-		printf("set feature error on port %d!\n", port);
-	}
-}
-#endif
-
 static int wait_spinup(void __iomem *port_mmio)
 {
 	ulong start;
@@ -956,9 +926,6 @@ void scsi_low_level_init(int busdevfunc)
 				printf("Can not start port %d\n", i);
 				continue;
 			}
-#ifdef CONFIG_AHCI_SETFEATURES_XFER
-			ahci_set_feature((u8) i);
-#endif
 		}
 	}
 }
@@ -1002,9 +969,6 @@ int ahci_init(void __iomem *base)
 				printf("Can not start port %d\n", i);
 				continue;
 			}
-#ifdef CONFIG_AHCI_SETFEATURES_XFER
-			ahci_set_feature((u8) i);
-#endif
 		}
 	}
 err_out:
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/1 block: ahci: Remove dead code

In reply to Fabio Estevam
Quoted 6 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

CONFIG_AHCI_SETFEATURES_XFER is not selected by any user, so delete the dead code.

This used to be done unconditionally but was put under this flag as it breaks some SSDs and doesn't seem to be needed otherwise.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151101/8b117ecc/attachment.sig>
#3 lore raw
In reply to Fabio Estevam
Quoted 8 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

CONFIG_AHCI_SETFEATURES_XFER is not selected by any user, so delete the dead code.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/5981f3ec/attachment.sig>