Received: by 10.192.165.156 with SMTP id m28csp924248imm; Wed, 11 Apr 2018 09:20:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx49RPM7SQyw7HRGIc4TS/d6o9/SwUhkYWfuzj5jq3ubFoYib7HMYCn5EtibIcn7rOGd0Ht5q X-Received: by 2002:a17:902:be08:: with SMTP id r8-v6mr5634551pls.289.1523463616058; Wed, 11 Apr 2018 09:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523463616; cv=none; d=google.com; s=arc-20160816; b=jkvF/g860iLd8yi7C1UI60THQ4JQAgUQhXI1YSSA3FWVqhiC4R6z5M1ynh0sf9e+lV ippHEtcYP+5leVpWxGdTXSbmTTFQQX9zjedy8qspW4vuT/zLLCU0duv8pM4OFFNjGjHB xk5ZLllpnpyvBEMr47NKUv/eHraMfUAaMu+YzLeo0etRD1WvnTTahiNPazy93ppoG4ih f0HwYUG6SlV98qNYPR8pfXnAQ13TrOvYtLh6YgUMfu4HFsBvuvardYDQTN/N/M4mZvsl z7iTZ/f+dAu/9Zzr9zIq1ifO7q0k/9C1xLwDsH/rDlY+r/b13ERajliTf+x4zU68iefM k/AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=7lGecyt46T83JpT2go5bINtRGQc0sNJdTRc3lag4Eww=; b=0EBNdMImp2In61np6RivfDTC3zKI30a+yQdtt2ioAPCRTXhfi/WiDkbQmMLZU4EsAc Ji0NKZZDifUhMgl8PlpjGTwtyvaGetvJbhPSKvBL+i1QcriAmYfhBAZ/0AmoERMKKDCL Xs4b35kikGjmBCWoF10nO+V7kBAVK3GWWyBnoFfBTVkv2M4SusRfVdJTchWx9BAa1kXX Wcm4Wd7mgbTWrTAlSyIelhZdySgpoh3KtAPw3FEFtnBLy1yqXzrLpQ8HhoHRsI0pVVSq L+sZKBi5JD8Q7numGeKuic1ueLEuTiqMlTQPJPEQhmn960PPVUf8JwBiS1ZzmEykYSoD kFoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=RrO9JqKt; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si963196pgs.665.2018.04.11.09.19.36; Wed, 11 Apr 2018 09:20:16 -0700 (PDT) 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; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=RrO9JqKt; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753937AbeDKQQW (ORCPT + 99 others); Wed, 11 Apr 2018 12:16:22 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:35650 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752798AbeDKQQV (ORCPT ); Wed, 11 Apr 2018 12:16:21 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 7C3BD8EE25E; Wed, 11 Apr 2018 09:16:20 -0700 (PDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09XO-RO8WNpN; Wed, 11 Apr 2018 09:16:20 -0700 (PDT) Received: from [153.66.254.194] (unknown [50.35.65.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id E6C578EE0E2; Wed, 11 Apr 2018 09:16:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1523463380; bh=J3WvXvOkxsyT7KiMW368rniLy0fsn4U7XqawEewVWEk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=RrO9JqKtzXCHuUdX3F7044TiDcWNMt8MtljMIsy1vEG4yHa8VZWRQMcnhPL3CU1vE rz5JyADd+yEI3Xue1zM1dULipxAMv2qmgGh32Jp8eJ0xUGIVaSQSuLOd7T40tMLKrm krQV+LD9vbmDrMpuqOezS9AYpTL1gG9w0xkqD+pc= Message-ID: <1523463379.3221.18.camel@HansenPartnership.com> Subject: Re: [PATCH v2] dec: tulip: de4x5: Replace mdelay with usleep_range in de4x5_hw_init From: James Bottomley To: Jia-Ju Bai , davem@davemloft.net, stephen@networkplumber.org, johannes.berg@intel.com, arvind.yadav.cs@gmail.com, dhowells@redhat.com Cc: netdev@vger.kernel.org, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 11 Apr 2018 09:16:19 -0700 In-Reply-To: <1523461182-5897-1-git-send-email-baijiaju1990@gmail.com> References: <1523461182-5897-1-git-send-email-baijiaju1990@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-04-11 at 23:39 +0800, Jia-Ju Bai wrote: > de4x5_hw_init() is never called in atomic context. > > de4x5_hw_init() is only called by de4x5_pci_probe(), which is only  > set as ".probe" in struct pci_driver. > > Despite never getting called from atomic context, de4x5_hw_init()  > calls mdelay() to busily wait. This is not necessary and can be > replaced with usleep_range() to  avoid busy waiting. > > This is found by a static analysis tool named DCNS written by myself. > And I also manually check it. Did you actually test this? The usual reason for wanting m/udelay is that the timing must be exact. The driver is filled with mdelay()s for this reason. The one you've picked on is in the init path so it won't affect the runtime in any way. I also don't think we have the hrtimer machinery for usleep_range() to work properly on parisc, so I don't think the replacement works. James