All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: <dan.j.williams@intel.com>, <dave.jiang@intel.com>,
	<alison.schofield@intel.com>, <vishal.l.verma@intel.com>,
	<fan.ni@samsung.com>, <a.manzanares@samsung.com>,
	<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH v2] cxl/mbox: Add background cmd handling machinery
Date: Mon, 15 May 2023 17:19:31 +0100	[thread overview]
Message-ID: <20230515171931.000054a5@Huawei.com> (raw)
In-Reply-To: <lhpw35lii4cfrmvebphvhaivjgp2l3ajhnelmtilj5vbvqaxmn@o2ajzugaxbcc>

On Mon, 15 May 2023 08:40:30 -0700
Davidlohr Bueso <dave@stgolabs.net> wrote:

> On Mon, 15 May 2023, Jonathan Cameron wrote:
> 
> >On Wed, 3 May 2023 07:57:56 -0700
> >Davidlohr Bueso <dave@stgolabs.net> wrote:
> >  
> >> This adds support for handling background operations, as defined in
> >> the CXL 3.0 spec. Commands that can take too long (over ~2 seconds)
> >> can run in the background asynchronously (to the hardware).
> >>
> >> The driver will deal with such commands synchronously, blocking all
> >> other incoming commands for a specified period of time, allowing
> >> time-slicing the command such that the caller can send incremental
> >> requests to avoid monopolizing the driver/device. This approach
> >> makes the code simpler, where any out of sync (timeout) between the
> >> driver and hardware is just disregarded as an invalid state until
> >> the next successful submission.
> >>
> >> On devices where mbox interrupts are supported, this will still use
> >> a poller that will wakeup in the specified wait intervals. The irq
> >> handler will simply awake the blocked cmd, which is also safe vs a
> >> task that is either waking (timing out) or already awoken. Similarly
> >> any irq setup error during the probing falls back to polling, thus
> >> avoids unnecessarily erroring out.  
> >
> >This raises the question of why we don't support Doorbell Interrupts.
> >2 seconds is rather a long time to poll for.  I can't really remember the
> >reasoning but maybe it's that we don't expect anyone to every produce
> >hardware that takes that long.
> >
> >Ah well, job for another day perhaps.
> >
> >I'm not following why the rcuwait is needed versus other options.
> >Perhaps some minimal text here for those of us not familiar with that
> >particular mechanism vs a completion of similar.  
> 
> As mentioned before, rcuwait gives us the single wait/wake semantics we
> need (we are serialized by the mbox_mutex) - completions use queued wait,
> which is an overkill for this case.
Fair enough I guess. New toy that I'd not come across before.

Jonathan

> 
> >> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>  
> >Otherwise just a comment inline on dev_warn for unexpected interrupt
> >on an interrupt that you've marked as IRQF_SHARED which pretty much
> >guarantees you need to handle unexpected interrupts as 'normal'.  
> 
> Per your feedback in the the previous series, I will remove this dev_warn
> altogether.
> 
> Thanks,
> Davidlohr


  reply	other threads:[~2023-05-15 16:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 17:18 [PATCH 0/3] cxl: Handle background commands Davidlohr Bueso
2023-05-02 17:18 ` [PATCH 1/3] rcuwait: Support timeouts Davidlohr Bueso
2023-05-19 21:38   ` Dan Williams
2023-05-19 22:55     ` Davidlohr Bueso
2023-05-20 11:03       ` Peter Zijlstra
2023-05-02 17:18 ` [PATCH 2/3] cxl/pci: Allocate irq vectors earlier in pci probe Davidlohr Bueso
2023-05-15 10:08   ` Jonathan Cameron
2023-05-02 17:18 ` [PATCH 3/3] cxl/mbox: Add background cmd handling machinery Davidlohr Bueso
2023-05-02 17:55   ` Davidlohr Bueso
2023-05-03 14:22   ` Dan Carpenter
2023-05-03 14:57   ` [PATCH v2] " Davidlohr Bueso
2023-05-15 10:30     ` Jonathan Cameron
2023-05-15 15:40       ` Davidlohr Bueso
2023-05-15 16:19         ` Jonathan Cameron [this message]
2023-05-16  7:58     ` Li, Ming
2023-05-16 17:02       ` Davidlohr Bueso
2023-05-19 23:13     ` Dan Williams
2023-05-22 16:58       ` Davidlohr Bueso
2023-05-22 18:19         ` Dan Williams
2023-05-22 18:57           ` Davidlohr Bueso
2023-05-22 20:16             ` Dan Williams
2023-05-22 20:28               ` Davidlohr Bueso
2023-05-22 21:21                 ` Dan Williams
2023-05-22 21:26                   ` Davidlohr Bueso
2023-05-22 22:48                     ` Dan Williams

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=20230515171931.000054a5@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=a.manzanares@samsung.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=fan.ni@samsung.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=vishal.l.verma@intel.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.