Re: [PATCH V14 3/7] PCI/DOE: Add DOE mailbox support functions
From: Ira Weiny
Date: Tue Jul 19 2022 - 15:51:24 EST
On Tue, Jul 19, 2022 at 12:16:06PM -0700, Ira wrote:
> On Tue, Jul 19, 2022 at 05:35:53PM +0100, Jonathan Cameron wrote:
[snip]
> > Hi Ira,
> >
> > Thanks for persisting with this!
> >
> > So, I think this works, but there is at least one 'sleep' I can't
> > see a purpose for. I think it's just a left over from refactoring.
> >
> > A few other more trivial things inline.
[snip]
> > > +
> > > +#define PCI_DOE_BUSY_MAX_RETRIES 16
> > Left over from removed code.
>
> I think Dan may have taken these. If so I'll send a clean up. If not I can
> spin. Let me check.
I'm spinning a v15 of this patch.
[snip]
>
> >
> > > + if (rc) {
> > > + /*
> > > + * The specification does not provide any guidance on how to
> > > + * resolve conflicting requests from other entities.
> > > + * Furthermore, it is likely that busy will not be detected
> > > + * most of the time. Flag any detection of status busy with an
> > > + * error.
> > > + */
> > > + if (rc == -EBUSY)
> > > + dev_err_ratelimited(&pdev->dev, "[%x] busy detected; another entity is sending conflicting requests\n",
> > > + offset);
> > > + signal_task_abort(task, rc);
> > > + return;
> > > + }
> > > +
> > > + timeout_jiffies = jiffies + PCI_DOE_TIMEOUT;
> > > + rc = pci_doe_wait(doe_mb, PCI_DOE_POLL_INTERVAL);
> >
> > What's this particular wait for? I think you can just move directly to checking
> > if the response is ready.
>
> We could but I assume it will take at least some time to process the request.
> So it seemed best to wait and then check.
>
> But of course we all know that also used to wait for an IRQ as an option. :-/
>
> I'm really on the fence here because I don't think it really matters. We are
> sleeping so it does not really affect the system much and this is not a
> performance path. If we were spinning I would agree with you.
I've deferred to your expertise here and removed the extra wait.
Ira