From patchwork Thu Jan 3 01:54:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Grussling X-Patchwork-Id: 209169 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 694282C008D for ; Thu, 3 Jan 2013 12:55:43 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752853Ab3ACBzi (ORCPT ); Wed, 2 Jan 2013 20:55:38 -0500 Received: from mail-da0-f46.google.com ([209.85.210.46]:41703 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752784Ab3ACBze (ORCPT ); Wed, 2 Jan 2013 20:55:34 -0500 Received: by mail-da0-f46.google.com with SMTP id p5so6700212dak.19 for ; Wed, 02 Jan 2013 17:55:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=tcfPEeLYu5LFOlaBIOgd2db3HJN/4rTTv1J1J7CRbr0=; b=QTcuwr75s7piBZDAwCnp+Sc2kUZcSU2I6f2RoM7I18E5e08mB2R4dwvIinCa7cjLKR yzxzRl+QyGjZQtIMRg7G9oyVdWdiA52xeRGtQbhXAyFf4UqQuuomNLGG0p2OUHDNpocX ozhh67+2N3Ebc0oHWPvnbDLlj9DpeivgNq7zGKIr71PxDbroCIsSYc8gX6h9N+XS4OaN dfN/EDvdgqMB2vpqmCb+6krvs0FOVeRAQ5p/TcMaOW68c24SKM7/uI4qPwEysU+X2rY1 q/TyzhyJpX6CVuXiTg0H/qWgjAYhKPM0HXTozA4e+XgFbQlGElbhmdoF93a3xO4Nc6ke JwsA== X-Received: by 10.69.0.74 with SMTP id aw10mr148701048pbd.87.1357178134087; Wed, 02 Jan 2013 17:55:34 -0800 (PST) Received: from trixie.pullman ([76.178.144.65]) by mx.google.com with ESMTPS id vo8sm29366410pbc.16.2013.01.02.17.55.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Jan 2013 17:55:33 -0800 (PST) From: Barry Grussling To: barry@grussling.com, netdev@vger.kernel.org Subject: [PATCH 2/4] DSA: Convert msleep calls to usleep_range calls Date: Wed, 2 Jan 2013 17:54:56 -0800 Message-Id: <1357178098-4057-3-git-send-email-barry@grussling.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1357178098-4057-1-git-send-email-barry@grussling.com> References: <1357178098-4057-1-git-send-email-barry@grussling.com> X-Gm-Message-State: ALoCoQkWaHz8AiWGEZ95qjYv5RmS6AV9JkFSfDEMr4ilCzfEA9GHG9RE1SBR8RSLEyE7lFziBWyb Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Convert DSA msleep calls to usleep_range calls as reported by checkpatch.pl. Values of sleep duration were verified on Marvell hardware platform and appear to work. Values chosen are not special and no strong "vetting" has gone into them other than verifying correct operation on available hardware. Signed-off-by: Barry Grussling --- drivers/net/dsa/mv88e6060.c | 7 ++++--- drivers/net/dsa/mv88e6123_61_65.c | 7 ++++--- drivers/net/dsa/mv88e6131.c | 7 ++++--- drivers/net/dsa/mv88e6xxx.c | 5 +++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/net/dsa/mv88e6060.c b/drivers/net/dsa/mv88e6060.c index 16ec763..fa6bc7d 100644 --- a/drivers/net/dsa/mv88e6060.c +++ b/drivers/net/dsa/mv88e6060.c @@ -8,6 +8,7 @@ * (at your option) any later version. */ +#include #include #include #include @@ -76,20 +77,20 @@ static int mv88e6060_switch_reset(struct dsa_switch *ds) /* Wait for transmit queues to drain. */ - msleep(2); + usleep_range(2000, 4000); /* Reset the switch. */ REG_WRITE(REG_GLOBAL, 0x0a, 0xa130); - /* Wait up to one second for reset to complete. + /* Wait up to two seconds for reset to complete. */ for (i = 0; i < 1000; i++) { ret = REG_READ(REG_GLOBAL, 0x00); if ((ret & 0x8000) == 0x0000) break; - msleep(1); + usleep_range(1000, 2000); } if (i == 1000) return -ETIMEDOUT; diff --git a/drivers/net/dsa/mv88e6123_61_65.c b/drivers/net/dsa/mv88e6123_61_65.c index f964bfb..0ead9b4 100644 --- a/drivers/net/dsa/mv88e6123_61_65.c +++ b/drivers/net/dsa/mv88e6123_61_65.c @@ -8,6 +8,7 @@ * (at your option) any later version. */ +#include #include #include #include @@ -60,20 +61,20 @@ static int mv88e6123_61_65_switch_reset(struct dsa_switch *ds) /* Wait for transmit queues to drain. */ - msleep(2); + usleep_range(2000, 4000); /* Reset the switch. */ REG_WRITE(REG_GLOBAL, 0x04, 0xc400); - /* Wait up to one second for reset to complete. + /* Wait up to two seconds for reset to complete. */ for (i = 0; i < 1000; i++) { ret = REG_READ(REG_GLOBAL, 0x00); if ((ret & 0xc800) == 0xc800) break; - msleep(1); + usleep_range(1000, 2000); } if (i == 1000) return -ETIMEDOUT; diff --git a/drivers/net/dsa/mv88e6131.c b/drivers/net/dsa/mv88e6131.c index 7a7bcc2..7872507 100644 --- a/drivers/net/dsa/mv88e6131.c +++ b/drivers/net/dsa/mv88e6131.c @@ -8,6 +8,7 @@ * (at your option) any later version. */ +#include #include #include #include @@ -53,20 +54,20 @@ static int mv88e6131_switch_reset(struct dsa_switch *ds) /* Wait for transmit queues to drain. */ - msleep(2); + usleep_range(2000, 4000); /* Reset the switch. */ REG_WRITE(REG_GLOBAL, 0x04, 0xc400); - /* Wait up to one second for reset to complete. + /* Wait up to two seconds for reset to complete. */ for (i = 0; i < 1000; i++) { ret = REG_READ(REG_GLOBAL, 0x00); if ((ret & 0xc800) == 0xc800) break; - msleep(1); + usleep_range(1000, 2000); } if (i == 1000) return -ETIMEDOUT; diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index eaa341a..a2f9e9b6 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c @@ -8,6 +8,7 @@ * (at your option) any later version. */ +#include #include #include #include @@ -215,7 +216,7 @@ static int mv88e6xxx_ppu_disable(struct dsa_switch *ds) for (i = 0; i < 1000; i++) { ret = REG_READ(REG_GLOBAL, 0x00); - msleep(1); + usleep_range(1000, 2000); if ((ret & 0xc000) != 0xc000) return 0; } @@ -233,7 +234,7 @@ static int mv88e6xxx_ppu_enable(struct dsa_switch *ds) for (i = 0; i < 1000; i++) { ret = REG_READ(REG_GLOBAL, 0x00); - msleep(1); + usleep_range(1000, 2000); if ((ret & 0xc000) == 0xc000) return 0; }