From 2a84d13723e07124a3a91349e18e72f39fdc5e24 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Tue, 12 May 2009 10:57:41 +0900 Subject: [PATCH] --- yaml --- r: 147099 b: refs/heads/master c: d50ce07d6fd8a422757a231f9d7293cbddeaec31 h: refs/heads/master i: 147097: 2b0419ecc02527eaf03e38b4b67a85a1c246374f 147095: 68aae63d391d5ec49b19da74ce4c7f987d2b6eaa v: v3 --- [refs] | 2 +- trunk/drivers/ata/ahci.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 3760dcbaa67d..84991209de88 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 437681800bdaa9feb58cf943dfbbd239c21d3705 +refs/heads/master: d50ce07d6fd8a422757a231f9d7293cbddeaec31 diff --git a/trunk/drivers/ata/ahci.c b/trunk/drivers/ata/ahci.c index cd832cb69492..2141a31f176b 100644 --- a/trunk/drivers/ata/ahci.c +++ b/trunk/drivers/ata/ahci.c @@ -77,8 +77,6 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf, size_t size); static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state, ssize_t size); -#define MAX_SLOTS 8 -#define MAX_RETRY 15 enum { AHCI_PCI_BAR = 5, @@ -231,6 +229,10 @@ enum { ICH_MAP = 0x90, /* ICH MAP register */ + /* em constants */ + EM_MAX_SLOTS = 8, + EM_MAX_RETRY = 5, + /* em_ctl bits */ EM_CTL_RST = (1 << 9), /* Reset */ EM_CTL_TM = (1 << 8), /* Transmit Message */ @@ -282,8 +284,8 @@ struct ahci_port_priv { unsigned int ncq_saw_dmas:1; unsigned int ncq_saw_sdb:1; u32 intr_mask; /* interrupts to enable */ - struct ahci_em_priv em_priv[MAX_SLOTS];/* enclosure management info - * per PM slot */ + /* enclosure management info per PM slot */ + struct ahci_em_priv em_priv[EM_MAX_SLOTS]; }; static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); @@ -1140,12 +1142,12 @@ static void ahci_start_port(struct ata_port *ap) emp = &pp->em_priv[link->pmp]; /* EM Transmit bit maybe busy during init */ - for (i = 0; i < MAX_RETRY; i++) { + for (i = 0; i < EM_MAX_RETRY; i++) { rc = ahci_transmit_led_message(ap, emp->led_state, 4); if (rc == -EBUSY) - udelay(100); + msleep(1); else break; } @@ -1339,7 +1341,7 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state, /* get the slot number from the message */ pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8; - if (pmp < MAX_SLOTS) + if (pmp < EM_MAX_SLOTS) emp = &pp->em_priv[pmp]; else return -EINVAL; @@ -1407,7 +1409,7 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf, /* get the slot number from the message */ pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8; - if (pmp < MAX_SLOTS) + if (pmp < EM_MAX_SLOTS) emp = &pp->em_priv[pmp]; else return -EINVAL;