Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751154AbdL3RTQ (ORCPT ); Sat, 30 Dec 2017 12:19:16 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:39426 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063AbdL3RTO (ORCPT ); Sat, 30 Dec 2017 12:19:14 -0500 X-Google-Smtp-Source: ACJfBov5MuABLHBc+6EUECZezVysWFQRkh40jOEpbAJ6P+AXs7kbs4pULOmxkQHz6Xt2Lk8eveu57w== Date: Sat, 30 Dec 2017 09:19:06 -0800 From: Stephen Hemminger To: Jia-Ju Bai Cc: mlindner@marvell.com, shemminger@linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sky2: Replace mdelay with msleep in sky2_vpd_wait Message-ID: <20171230091906.6eabcf39@xeon-e3> In-Reply-To: <1514632187-14849-1-git-send-email-baijiaju1990@gmail.com> References: <1514632187-14849-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 967 Lines: 28 On Sat, 30 Dec 2017 19:09:47 +0800 Jia-Ju Bai wrote: > sky2_vpd_wait is not called in an interrupt handler nor holding a spinlock. > The function mdelay in it can be replaced with msleep, to reduce busy wait. > > Signed-off-by: Jia-Ju Bai > --- > drivers/net/ethernet/marvell/sky2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c > index 9efe177..9fe8530 100644 > --- a/drivers/net/ethernet/marvell/sky2.c > +++ b/drivers/net/ethernet/marvell/sky2.c > @@ -4287,7 +4287,7 @@ static int sky2_vpd_wait(const struct sky2_hw *hw, int cap, u16 busy) > dev_err(&hw->pdev->dev, "VPD cycle timed out\n"); > return -ETIMEDOUT; > } > - mdelay(1); > + msleep(1); > } > > return 0; When sky2 was written mdelay was equivalent to current msleep. Acked-by: Stephen Hemminger