linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Grimm <grimm@linux.vnet.ibm.com>
To: Ian Munsie <imunsie@au1.ibm.com>
Cc: mikey <mikey@neuling.org>, linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 2/3] CXL: Snoop control
Date: Thu, 15 Jan 2015 16:46:25 -0500	[thread overview]
Message-ID: <54B83531.5090807@linux.vnet.ibm.com> (raw)
In-Reply-To: <1421297757-sup-8434@delenn.ozlabs.ibm.com>

On 01/15/2015 12:16 AM, Ian Munsie wrote:
> Excerpts from Ryan Grimm's message of 2015-01-15 13:56:40 +1100:
>> Add mode to opal call.  SNOOP control turns CAPP unit snooping on/off.  This is
>> needed for the following reset patch, which turns snoops off in the CAPP
>> recovery path.
>
> Looking at patch 3 in this series I think this description needs to be
> updated, as it doesn't seem to turn off snoops?
>

OK, will make commit message more clear.

Maybe I'll rename the first line to CXL: Enable CAPP recovery, since 
that's what it does.

>
>> +/* CAPI modes for PHB */
>> +enum {
>> +        OPAL_PHB_CAPI_MODE_PCIE         = 0,
>> +        OPAL_PHB_CAPI_MODE_CAPI         = 1,
>> +        OPAL_PHB_CAPI_MODE_SNOOP_OFF    = 2,
>> +        OPAL_PHB_CAPI_MODE_SNOOP_ON     = 3,
>> +};
>
> Spaces have been used for indention here
>

Fixed.

>
>> +/* CAPI feature flags (in device-tree) */
>> +#define OPAL_PHB_CAPI_FLAG_SNOOP_CONTROL        0x00000001
>> +#define OPAL_PHB_CAPI_FLAG_REVERT_TO_PCIE       0x00000002
>
> It doesn't look like these are used?

Yeah.

>
>
>> -int pnv_phb_to_cxl(struct pci_dev *dev)
>> +int pnv_phb_to_cxl(struct pci_dev *dev, uint64_t mode)
>
> Should we rename this function since it no longer just sets the PHB to
> CXL mode? Maybe something like pnv_phb_set_cxl_mode?
>

Good call.  The names are updated in the skiboot code base...missed this 
one.

>
>> +    if ((rc = pnv_phb_to_cxl(dev, OPAL_PHB_CAPI_MODE_SNOOP_ON))) {
>> +        dev_err(&dev->dev, "enable capp snoops: %i\n", rc);
>> +    }
>
> Ok, we turn on snooping here, but I don't see where we turned it off -
> has patch 3 changed so that never happens?
>

snoops are disabled by Sapphire in the CAPP recovery path.

> Also - why this late in in the init sequence? Not saying it's wrong, just
> wondering if this has to happen after all the AFUs have been initialised, or if
> it can happen earlier in the adapter initialisation, like when we set
> the PHB to capi mode?
>

It has no effect when the driver is bound initially since Sapphire 
already turns on snoops as part of the phb to cxl procedure.

I did it this way to handle CAPP recovery.  The driver doesn't know that 
capp recovery happened...EEH unbinds the driver, Sapphire does the CAPP 
recovery procedure, then EEH rebinds the driver.

The last step in capp recovery is to turn on snoops.  I'll put a comment 
to explain that better...but, sure it could be earlier in the sequence.

-Ryan

>
> Cheers,
> -Ian
>

  reply	other threads:[~2015-01-15 21:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15  2:56 [PATCH 1/3] CXL: Add image control to sysfs Ryan Grimm
2015-01-15  2:56 ` [PATCH 2/3] CXL: Snoop control Ryan Grimm
2015-01-15  5:16   ` Ian Munsie
2015-01-15 21:46     ` Ryan Grimm [this message]
2015-01-15  2:56 ` [PATCH 3/3] CXL: Add reset to sysfs Ryan Grimm
2015-01-15  5:42   ` Ian Munsie
2015-01-15  6:18     ` Ian Munsie
2015-01-15 21:58     ` Ryan Grimm
2015-01-15  5:51   ` Ian Munsie
2015-01-15  4:41 ` [PATCH 1/3] CXL: Add image control " Ian Munsie
2015-01-15  4:46   ` Ian Munsie
2015-01-15  4:54     ` Ian Munsie
2015-01-15  5:07   ` Michael Ellerman
2015-01-15  5:44     ` Ian Munsie
2015-01-15 21:45   ` Ryan Grimm

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=54B83531.5090807@linux.vnet.ibm.com \
    --to=grimm@linux.vnet.ibm.com \
    --cc=imunsie@au1.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    /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;
as well as URLs for NNTP newsgroup(s).