All of lore.kernel.org
 help / color / mirror / Atom feed
From: Logan Gunthorpe <logang@deltatee.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-pci@vger.kernel.org
Cc: tglx@linutronix.de, Kurt Schwemmer <kurt.schwemmer@microsemi.com>,
	Stephen Bates <stephen.bates@microsemi.com>
Subject: Re: [PATCH] pci/switchtec: Don't use completion's wait queue
Date: Wed, 4 Oct 2017 10:13:15 -0600	[thread overview]
Message-ID: <dfd717ac-a775-f30c-4d41-2da68e08ff54@deltatee.com> (raw)
In-Reply-To: <20171004095007.19148-1-bigeasy@linutronix.de>


On 04/10/17 03:50 AM, Sebastian Andrzej Siewior wrote:
> The poll callback is using completion's wait_queue_head_t member and
> puts it in poll_wait() so the poll() caller gets a wakeup after command
> completed. This does not work on RT because we don't have a
> wait_queue_head_t in our completion implementation. Nobody in tree does
> like that in tree so this is the only driver that breaks.

I'm sorry but this seems a bit crazy to me. Driver's can't poll on 
completions because an out of tree implementation changes them in a 
weird way??! Just because no one in-tree does it now doesn't make it 
invalid.

But at the very least, if we _absolutely_ have to patch this out, you 
shouldn't make it so convoluted. Just replace the struct completion with 
a wait queue and a done flag (which is what a completion is). Don't move 
the wait queue into switchtec_dev and don't use an unnecessary counter. 
And certainly don't think about merging it with another wait queue that 
has completely different wake events and waiters.

In any case, I haven't tested the patch, but I'm pretty sure it's not 
correct. There can be multiple switchtec_user's queued up and this patch 
will essentially complete them all once any one of them finishes and 
cmd_cnt increments.

So this patch gets a NAK from me.

Logan

  reply	other threads:[~2017-10-04 16:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04  9:50 [PATCH] pci/switchtec: Don't use completion's wait queue Sebastian Andrzej Siewior
2017-10-04 16:13 ` Logan Gunthorpe [this message]
2017-10-05 10:51   ` [PATCH v2] " Sebastian Andrzej Siewior
2017-10-05 18:46     ` Logan Gunthorpe
2017-11-02 15:07       ` Sebastian Andrzej Siewior
2017-11-02 16:03         ` Logan Gunthorpe
2017-11-02 17:17           ` Sebastian Andrzej Siewior
2017-11-02 17:23             ` Logan Gunthorpe
2017-11-02 18:05               ` Sebastian Andrzej Siewior
2017-11-02 20:02                 ` Logan Gunthorpe
2017-11-02 20:53                   ` Sebastian Andrzej Siewior
2017-11-02 20:55                     ` Logan Gunthorpe
2017-11-02 17:19           ` [PATCH v3] " Sebastian Andrzej Siewior
2017-11-02 20:53             ` Logan Gunthorpe
2017-11-03  8:22               ` Sebastian Andrzej Siewior
2017-11-03 16:06                 ` Logan Gunthorpe
2017-11-03 16:19                   ` Sebastian Andrzej Siewior
2017-11-03 16:33                     ` Logan Gunthorpe
2017-11-03 16:39                       ` Sebastian Andrzej Siewior
2017-11-03 16:42                         ` Logan Gunthorpe
2017-11-02 15:12       ` Sebastian Andrzej Siewior

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=dfd717ac-a775-f30c-4d41-2da68e08ff54@deltatee.com \
    --to=logang@deltatee.com \
    --cc=bigeasy@linutronix.de \
    --cc=kurt.schwemmer@microsemi.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=stephen.bates@microsemi.com \
    --cc=tglx@linutronix.de \
    /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.