Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3470002imm; Sun, 17 Jun 2018 21:10:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIwEAT98nX1kRoWUmOF1mkewf4bza7JW8Aw4V0dodOAXBVQ3n2b8qBC63wrniM6lQOKg5xB X-Received: by 2002:a17:902:7202:: with SMTP id ba2-v6mr12053835plb.119.1529295021073; Sun, 17 Jun 2018 21:10:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529295021; cv=none; d=google.com; s=arc-20160816; b=wdsSGJrjmso86MlovGsdOmxwvpdAujv/+AzrIcyRaGeqjtpFxdp9BYT80D7dajbB6u o1Jk3vgLbjAPM3fWLpgdH1WCeu16vyMl9OJYZwzwzJ9iT7fISDJbeF31xk+QAZmPP4FS 6mDhgATs5tPxv6aZR11rFWHK4bn8ae2qyxRR0HMXFzY+6Gqec38phh8KP8WMVmhDiBei Ekf3sVt9YJ+PkL+zkHs1FCwI0g+siw4iVnVJMIY9J531/Lu6AF5oh+JmBq1kTVV4hK1O sk0NaomQD+6blsPukha6uraav81iM627bmGcxyhPwa5GCwKzTymM+RbY6/UUc4nzq/Qx WkzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:user-agent:message-id:date:subject:cc:to :from:arc-authentication-results; bh=lgokHXyIEDPK2AVXRkr+bKnm8YkgMPgg89Ds6dua84w=; b=H+uJ2eOsDSRon5APjXhjNE2ZJNJRNb+zVTza0ej5YWpNtKscOxSH0dNNlGDrdGSl3v PaaD1sM59kpoR2LpFOfN9F7Gjho/NCc7EuRRJy90PF797w3gR6n6dlk06V8XJUcg7vSl 8vEzQ4CgGWZwWd4XYRish0Eu98MF+66Zyy7KS2owtDaq8HrLBaj0j2/MQ+qptm2vtE5j OxzhPuFeRpCRLTpmdJNirNDeRTEofBOxXL6rQ6c9OBtKZbyUGgu0hLfFxRtc5vFrPgQ0 Rb7Kzh+7GGcN52BZ05vYEe4tQARn7iH6mxfvR6Krue1vPc8y7vtcqRLBXO327eVIkCJ4 QTZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si14149700pfm.26.2018.06.17.21.10.05; Sun, 17 Jun 2018 21:10:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752654AbeFREJZ (ORCPT + 99 others); Mon, 18 Jun 2018 00:09:25 -0400 Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:34280 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910AbeFREJY (ORCPT ); Mon, 18 Jun 2018 00:09:24 -0400 Received: from static-82-10.transact.net.au (HELO new-mexico.localnet) ([122.99.82.10]) by ipmail07.adl2.internode.on.net with ESMTP; 18 Jun 2018 13:39:23 +0930 From: Alistair Popple To: openbmc@lists.ozlabs.org Cc: Benjamin Herrenschmidt , Joel Stanley , Andrew Jeffery , Greg Kroah-Hartman , Linux Kernel Mailing List Subject: Re: [RFC PATCH 5/5] fsi/scom: Major overhaul Date: Mon, 18 Jun 2018 14:09:20 +1000 Message-ID: <1908243.hVhg7auBNd@new-mexico> User-Agent: KMail/5.2.3 (Linux/4.13.0-0.bpo.1-amd64; KDE/5.28.0; x86_64; ; ) In-Reply-To: References: <20180612051911.20690-1-benh@kernel.crashing.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. - 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. > >