Received: by 10.223.176.5 with SMTP id f5csp141484wra; Tue, 6 Feb 2018 19:01:47 -0800 (PST) X-Google-Smtp-Source: AH8x227bVt0rJJTyqmhMY531w4FQBp5ojuSFiElMQWw9QPfWct+WQF5rGc+BkYw8+88gqy7Fp4AS X-Received: by 10.98.8.206 with SMTP id 75mr4480853pfi.172.1517972507677; Tue, 06 Feb 2018 19:01:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517972507; cv=none; d=google.com; s=arc-20160816; b=Qbhsy9UjPHeYKJtYxTRnRNemGGGDWrtFlF+ciIma0gUEqSwT6cJIA/+lGfufA7oLBS U23PWEVcdr9/N5ThvSCKVsNmJrZXmcC1xxCLterRL/pXmhZLTvuSdsGLyDFkBJVOXlcR dRIFgjHFZL1OfmA5unsDIvE9i8fRsM0GWRaGBAls2SD/kW561I8DkZZQ9hl+TSbQfoMJ q4e8QyFXzXqFjHfFV7JO9KLa6vq7HJRurFGRNAXXXid1pbhukRa35W929IlOf094PjR4 SiKF5odD9kZbeBlrFLu/5/0/3MvqkBZx0BIU6Me4Db9HRjBKPVEgvn00nw/CQG2arGk8 gaFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=uWMQrMFUbuv8MlQxiD4N9srFTpN6vPMS1rgJ+KnblLw=; b=uQlO4vGcSLgJDXRrPcUtYbydWC/KNJnFMW4tEqG+RXdr+ThhGAn6e+Ilh900HQ9pds 13Qp0tfql55YQuNPQOlW0RQ5n9sNA/c7RqLggTC547zsJfyKJ3Qa7UR0I9vBo70RAZ6l yd1w/Vow4qFHnyjLtugfHbbZH5CrfW8A7yQ/CwkuyhNl7cwb8ZFzjdMTNbVbF+PPfhld e0CeY4Uv55Wx1lNHb8VQqC3k1C/94XdcfxaRjwDBwDZk2DBnxjt1MhXtg/pcxk2pYzHy DlClh1lEaQ2PfyZov7YITBBi5WB06+ExS1iJm8Bof0FOcpuKofyrfeKX9mUz5fqJjS75 REfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t15si315461pgf.370.2018.02.06.19.01.33; Tue, 06 Feb 2018 19:01:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753228AbeBGDAr (ORCPT + 99 others); Tue, 6 Feb 2018 22:00:47 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:52742 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752838AbeBGDAq (ORCPT ); Tue, 6 Feb 2018 22:00:46 -0500 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S23992618AbeBGDAlBIS0l (ORCPT + 1 other); Wed, 7 Feb 2018 04:00:41 +0100 Date: Wed, 7 Feb 2018 03:00:41 +0000 (GMT) From: "Maciej W. Rozycki" To: Jia-Ju Bai cc: 3chas3@gmail.com, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] atm: idt77252: Replace mdelay with usleep_range in idt77252_preset In-Reply-To: <1516938138-27259-1-git-send-email-baijiaju1990@gmail.com> Message-ID: References: <1516938138-27259-1-git-send-email-baijiaju1990@gmail.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 26 Jan 2018, Jia-Ju Bai wrote: > diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c > index 0277f36..cea4bf2 100644 > --- a/drivers/atm/idt77252.c > +++ b/drivers/atm/idt77252.c > @@ -3563,7 +3563,7 @@ static int idt77252_preset(struct idt77252_dev *card) > > /* Software reset */ > writel(SAR_CFG_SWRST, SAR_REG_CFG); > - mdelay(1); > + usleep_range(500, 1000); > writel(0, SAR_REG_CFG); > > IPRINTK("%s: Software resetted.\n", card->name); This is only called from the driver's ->probe method, so it looks to me indeed safe to sleep here. A similar, more extensive clean-up seems due for 77252 older brother's driver nicstar.c. Out of curiosity I have looked up the SAR manual and it requires the SWRST bit to be asserted for at least 2 PCI clock cycles for the reset to be valid, so having the lower bound of .5ms still looks completely safe if not an overkill to me for real world applications where PCI is driven in the MHz clock range. Reviewed-by: Maciej W. Rozycki Maciej