From: Alistair Popple <alistair@popple.id.au>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: openbmc@lists.ozlabs.org, Joel Stanley <joel@jms.id.au>,
Andrew Jeffery <andrew@aj.id.au>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 5/5] fsi/scom: Major overhaul
Date: Mon, 18 Jun 2018 15:05:46 +1000 [thread overview]
Message-ID: <2586161.J3ITyiHLyu@new-mexico> (raw)
In-Reply-To: <33924c2e545b2dfabf2849d9c485f165c339323f.camel@kernel.crashing.org>
On Monday, 18 June 2018 2:46:33 PM AEST Benjamin Herrenschmidt wrote:
> On Mon, 2018-06-18 at 14:09 +1000, Alistair Popple wrote:
> > On Sunday, 17 June 2018 11:22:11 AM AEST Benjamin Herrenschmidt wrote:
> > > On Sun, 2018-06-17 at 11:17 +1000, Benjamin Herrenschmidt wrote:
> > > >
> > > > We have everything that cronus needs and more than pdbg needs afaik :-)
> >
> > Yep, has what we need and more (such as put scom under mask and indirect scom).
> > Only other useful thing would be repeated getsom/putscom operations (eg. read
> > the same scom address n times) as they would help with ADU access which can do
> > autoincrement or scanscom (although we should just use the scan engine directly
> > for that so not a big issue).
> >
> > > + for (retries = 0; retries < SCOM_MAX_RETRIES; retries++) {
> > > + rc = raw_get_scom(scom, value, addr, &status);
> > > + if (rc) {
> > > + /* Try resetting the bridge if FSI fails */
> > > + if (rc != -ENODEV && retries == 0) {
> > > + fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG,
> > > + &dummy, sizeof(uint32_t));
> > > + rc = -EBUSY;
> > > + } else
> > > + return rc;
> > > + } else
> > > + rc = handle_fsi2pib_status(scom, status);
> > > + if (rc && rc != -EBUSY)
> > > + break;
> > > + if (rc == 0) {
> > > + rc = handle_pib_status(scom,
> > > + (status & SCOM_STATUS_PIB_RESP_MASK)
> > > + >> SCOM_STATUS_PIB_RESP_SHIFT);
> > > + if (rc && rc != -EBUSY)
> > > + break;
> > > + }
> > > + if (rc == 0)
> > > + break;
> > > + msleep(1);
> > > + }
> >
> > The rc handling above took me a little while to grok but I didn't come up with a
> > cleaner alternative and I think it's correct.
>
> Ack-by or Reviewed-by tag pls ? :-)
Oh, sure:
Reviewed-by: Alistair Popple <alistair@popple.id.au>
> Cheers,
> Ben.
>
> > - Alistair
> >
> > > >
> > > > That said, cronus does a bunch of other stupid things that I'm still
> > > > trying to figure out how to fix.
> > > >
> > > > We might need to create a /dev/cfam rather than going through that
> > > > magic sysfs "raw" file, and I wouldn't mind using a single IDA so that
> > > > all the devices below a given FSI slace (cfam itself, sbefifo, occ,
> > > > ...) have the same "number".
> > >
> > > Also while we're at reworking how all this is exposed to our broken
> > > userspace, I wouldn't mind putting all these dev entries under a
> > > directory, if I can figure out how to do that (I haven't really looked
> > > yet).
> > >
> > > /dev/fsi/{cfamN,sbefifoN,occN, ...} and possibly similar by-id and by-
> > > path that other subsystems use, so we have something more deterministic
> > > than the "random number" crap we do now.
> > >
> > > We can always keep hacks to do symlinks in our kernel tree until we
> > > have converted all our userspace users.
> > >
> > > We currently control the only userspace users of this, so now is a good
> > > time to cleanup how we expose things. This won't always be the case.
> > >
> > > Cheers,
> > > Ben.
> > >
> > >
> >
> >
>
prev parent reply other threads:[~2018-06-18 5:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 5:19 [RFC PATCH 0/5] FSI scom driver overhaul Benjamin Herrenschmidt
2018-06-12 5:19 ` [RFC PATCH 1/5] fsi/scom: Add mutex around FSI2PIB accesses Benjamin Herrenschmidt
2018-06-13 14:59 ` Eddie James
2018-06-12 5:19 ` [RFC PATCH 2/5] fsi/scom: Whitespace fixes Benjamin Herrenschmidt
2018-06-13 14:58 ` Eddie James
2018-06-12 5:19 ` [RFC PATCH 3/5] fsi/scom: Fixup endian annotations Benjamin Herrenschmidt
2018-06-13 14:58 ` Eddie James
2018-06-12 5:19 ` [RFC PATCH 4/5] fsi/scom: Add register definitions Benjamin Herrenschmidt
2018-06-13 14:57 ` Eddie James
2018-06-12 5:19 ` [RFC PATCH 5/5] fsi/scom: Major overhaul Benjamin Herrenschmidt
2018-06-13 14:57 ` Eddie James
2018-06-13 23:00 ` Benjamin Herrenschmidt
2018-06-14 14:12 ` Eddie James
2018-06-16 5:04 ` Joel Stanley
2018-06-17 1:17 ` Benjamin Herrenschmidt
2018-06-17 1:22 ` Benjamin Herrenschmidt
2018-06-18 4:09 ` Alistair Popple
2018-06-18 4:46 ` Benjamin Herrenschmidt
2018-06-18 5:05 ` Alistair Popple [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=2586161.J3ITyiHLyu@new-mexico \
--to=alistair@popple.id.au \
--cc=andrew@aj.id.au \
--cc=benh@kernel.crashing.org \
--cc=gregkh@linuxfoundation.org \
--cc=joel@jms.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=openbmc@lists.ozlabs.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