All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Sathya Prakash <Sathya.Prakash@broadcom.com>,
	linux-pci@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Keith Busch <keith.busch@intel.com>
Subject: Re: [Patch v1 0/7] mpt3sas: Hot-Plug Surprise removal support on IOC.
Date: Thu, 13 Sep 2018 12:10:50 +0200	[thread overview]
Message-ID: <20180913101050.h4nkjhtxj4jwfh2h@wunner.de> (raw)
In-Reply-To: <CAK=zhgoy8qfKmjM+ypAmbZ1aXALdGwHSS5ND1G9HBt6h4hTheg@mail.gmail.com>

On Wed, Sep 12, 2018 at 03:31:07PM +0530, Sreekanth Reddy wrote:
> On Wed, Sep 5, 2018 at 1:08 PM, Lukas Wunner <lukas@wunner.de> wrote:
> > On Wed, Sep 05, 2018 at 11:45:45AM +0530, Sreekanth Reddy wrote:
> > > I have one more instance where still we need this poll kthread, i.e
> > > during the device probe time we have some commands which has more
> > > timeout value (e.g. 300 seconds), so if user has unplugged this device
> > > just after sending this more time-out valued command then driver has
> > > to wait until this time-out value expires. i.e. this device is still
> > > visible in lspci output until this 300 seconds timeout value expires
> > > even though device is unplugged. if we have a poll kthread (which will
> > > poll for every one second) then driver can early detect the unplugged
> > > state and can terminate the outstanding commands and hence probe
> > > operation can be completed quickly.
> >
> > The only instances I can see in your driver where it waits for 300 s
> > is in _base_diag_reset(), which does an msleep(256) in a loop for up
> > to 300 s, and scsih_scan_finished(), which is called in a loop with an
> > msleep(10) by do_scsi_scan_host().
> >
> > Any harm in simply checking for removal of the device in those loops
> > and bailing out if so?  Instead of the poll kthread to achieve the same?
> 
> we can do for this port enable request but still we have other
> requests where we don't have this type of loops and used
> wait_for_completion_timeout () API where we can't bailout the request
> in-between and we have to wait until the timeout value expires. For
> these types of request terminating it though watchdog thread will be
> simple.

When the HBA is hot-removed, its driver's ->remove callback is invoked.
You could just check at the beginning of the ->remove callback whether
the device is no longer present, and if it isn't, complete() any
completions that may be pending.

I think that would obviate the need for a watchdog.

Thanks,

Lukas

      reply	other threads:[~2018-09-13 15:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1535690081-16116-1-git-send-email-suganath-prabu.subramani@broadcom.com>
     [not found] ` <CAHp75VfC8GN3oEzSFJYfMr0iqBTYUJ=WPoLS9Oh5NgVcFmnBkw@mail.gmail.com>
2018-08-31  8:55   ` [Patch v1 0/7] mpt3sas: Hot-Plug Surprise removal support on IOC Lukas Wunner
2018-09-04  5:49     ` Sreekanth Reddy
2018-09-04  9:42       ` Lukas Wunner
2018-09-05  6:15         ` Sreekanth Reddy
2018-09-05  7:38           ` Lukas Wunner
2018-09-05 14:17             ` Keith Busch
2018-09-12 10:01             ` Sreekanth Reddy
2018-09-13 10:10               ` Lukas Wunner [this message]

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=20180913101050.h4nkjhtxj4jwfh2h@wunner.de \
    --to=lukas@wunner.de \
    --cc=Sathya.Prakash@broadcom.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=keith.busch@intel.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.