mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: baijiaju1990@gmail.com
Cc: perex@perex.cz, floeff@mathematik.uni-stuttgart.de,
	acme@conectiva.com.br, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] hp100: Fix a possible sleep-in-atomic bug in hp100_login_to_vg_hub
Date: Wed, 13 Dec 2017 16:20:32 -0500 (EST)	[thread overview]
Message-ID: <20171213.162032.129766742729458957.davem@davemloft.net> (raw)
In-Reply-To: <1513158468-14382-1-git-send-email-baijiaju1990@gmail.com>


I want you to review all of your patches and resend them after you
have checked them carefully.

The first patch I even looked at, this one, is buggy.

You changed a schedule_timeout_interruptible(1) into a udelay(10)

That's not right.

schedule_timeout_interruptible() takes a "jiffies" argument, which
is a completely different unit than udelay() takes.  You would have
to scale the argument to udelay() in some way using HZ.

Furthermore, the udelay argument you would come up with would
be way too long to be appropirate in this atomic context.

That's why the code tries to use a sleeping timeout, a long wait is
necessary here.

  reply	other threads:[~2017-12-13 21:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  9:47 Jia-Ju Bai
2017-12-13 21:20 ` David Miller [this message]
2017-12-14  3:13   ` Jia-Ju Bai
2017-12-14  3:31     ` Jia-Ju Bai
2017-12-14  3:34     ` David Miller
2017-12-14  3:56       ` Jia-Ju Bai
2017-12-15 11:13         ` Siegfried Loeffler
2017-12-14  1:21 ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171213.162032.129766742729458957.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=acme@conectiva.com.br \
    --cc=baijiaju1990@gmail.com \
    --cc=floeff@mathematik.uni-stuttgart.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=perex@perex.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®