From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1432425AbdDYRNm (ORCPT ); Tue, 25 Apr 2017 13:13:42 -0400 Received: from mail.kernel.org ([198.145.29.136]:34722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1432408AbdDYRNf (ORCPT ); Tue, 25 Apr 2017 13:13:35 -0400 MIME-Version: 1.0 In-Reply-To: <20170424230530.GN15143@minitux> References: <1487609235-19458-3-git-send-email-kimran@codeaurora.org> <20170222140448.qo677wamcd44tgkw@rob-hp-laptop> <0bf24858-33b2-8d08-ddc3-df83a2bd696d@codeaurora.org> <4b85e85b-8c2a-a226-d3b2-67fde0820ada@codeaurora.org> <0d59bc31-7d35-06c8-68d1-13790a512c23@codeaurora.org> <20170424230530.GN15143@minitux> From: Rob Herring Date: Tue, 25 Apr 2017 12:13:09 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [v10, 2/2] Documentation/ABI: Add ABI information for QCOM socinfo driver To: Bjorn Andersson Cc: Imran Khan , Stephen Boyd , Andy Gross , linux-arm-msm , "linux-kernel@vger.kernel.org" , "open list:ARM/QUALCOMM SUPPORT" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 24, 2017 at 6:05 PM, Bjorn Andersson wrote: > On Mon 24 Apr 09:27 PDT 2017, Rob Herring wrote: > >> On Mon, Apr 24, 2017 at 11:00 AM, Imran Khan wrote: >> > On 4/18/2017 7:53 PM, Imran Khan wrote: >> > Hi Rob, >> > Could you please provide some feedback so that this discussion can move forward >> > and ABI document can be finalized? >> > Without the ABI document we are not able to get the corresponding driver >> > finalized and get merged. >> > >> > Thanks again for your time, >> > Imran >> >> Hi Rob, >> >> >> >> On 3/6/2017 12:19 PM, Imran Khan wrote: >> >>> On 2/22/2017 7:34 PM, Rob Herring wrote: >> >>>> On Mon, Feb 20, 2017 at 10:17:15PM +0530, Khan, Imran wrote: >> >>>>> The socinfo ABI document describes the information provided >> >>>>> by socinfo driver and the corresponding attributes to access >> >>>>> that information. >> >>>>> >> >>>>> Signed-off-by: Imran Khan >> >>>>> --- >> >>>>> .../ABI/testing/sysfs-driver-qcom_socinfo | 171 +++++++++++++++++++++ >> >>>>> 1 file changed, 171 insertions(+) >> >>>>> create mode 100644 Documentation/ABI/testing/sysfs-driver-qcom_socinfo >> >>>> >> >>>> Sorry to comment late on this (blame LWM), but I think creating this ABI >> >>>> is a mistake. The biggest issue I have is this doesn't scale if every >> >>>> SoC does its own thing. We should have a common interface so for example >> >>>> userspace can retrieve the serial number from any SoC in the same way. >> >>>> Yes, we can have custom attributes, but there should be common base. >> >>>> >> >>> >> >>> Yeah, I agree about the scalability part. Could you please suggest some way to >> >>> implement a common base for the custom attributes. Like for serial number I think >> >>> we can put it in generic soc_device_attribute but for custom attributes like accessory_chip, >> >>> hw_platform etc., how can we implement a common base. Can we have a private pointer within >> >>> generic soc_device_attribute structure and this private pointer can point to custom attributes. >> >>> Or if you have some other suggestion to implement this common interface, please let me know. >> >> >> >> Could you please provide some feedback regarding this? >> >> Splitting things between common and private seems like a good direction. >> > > But the pattern of amending the common attributes with vendor or > platform-specific ones is how its done in other drivers, e.g. > integrator. > > Why should we for the Qualcomm case make up some other pattern? > > Or am I misunderstanding your suggestion? I'm just trying to ensure that we make things that could be common, common. The question here was about the implementation. Right now, drivers/soc is just a free for all dumping ground IMO. >> >>>>> diff --git a/Documentation/ABI/testing/sysfs-driver-qcom_socinfo b/Documentation/ABI/testing/sysfs-driver-qcom_socinfo >> >>>>> new file mode 100644 >> >>>>> index 0000000..cce611f >> >>>>> --- /dev/null >> >>>>> +++ b/Documentation/ABI/testing/sysfs-driver-qcom_socinfo >> >>>>> @@ -0,0 +1,171 @@ >> >>>>> +What: /sys/devices/soc0/accessory_chip >> >>>>> +Date: January 2017 >> >>>>> +Contact: linux-arm-msm@vger.kernel.org >> >>>>> +Description: >> >>>>> + This file shows the id of the accessory chip. >> >>>>> + >> >>>>> +What: /sys/devices/soc0/adsp_image_crm >> >>>>> +What: /sys/devices/soc0/adsp_image_variant >> >>>>> +What: /sys/devices/soc0/adsp_image_version >> >>>>> +Date: January 2017 >> >>>>> +Contact: linux-arm-msm@vger.kernel.org >> >>>>> +Description: >> >>>>> + These files respectively show the crm version, variant and >> >>>>> + version of the ADSP image. >> >>>> >> >>>> Shouldn't this be part of the ADSP driver? >> >>>> >> >>> Yes, It can be but I wanted to keep the image information at a central location, >> >>> rather than pushing it back to each driver. For image information we basically >> >>> read the same item from SMEM but use different offsets within it for different images, >> >>> so the idea was to read this information ( get SMEM handler) just once, rather than >> >>> doing it for each driver. >> >>> But if this idea does not look correct, I can remove it from socinfo driver. >> >>> >> >> >> >> Could you please provide some feedback regarding this? >> >> I don't think parsing things once will save you much. >> > > Defining the struct in some shared header file and implementing the > "parsing" throughout various drivers would probably work out fine. > > What I do not fancy is where these "parsers" would be implemented and > where the information would end up in sysfs. > > "The ADSP driver" has to refer to the remoteproc driver for the adsp and > it would be reasonable to have version information of the firmware > available for a running piece of remoteproc. The same would work out for > modem and wireless. > > The v4l driver is responsible for controlling the venus core, so it > could provide the version attribute - which would show up somewhere in > the /sys/bus/platform hierarchy. > > We have a mfd-like driver for communicating with the RPM, so perhaps we > could shoehorn in an attribute there. But the sysfs path will be > completely different, depending on platform and system configuration. > > There is no driver representing the boot code. > > > So, when Android goes belly up and we want to produce a bugreport that > describes all the pieces of the system we will have to all over sysfs to > figure out the versions of the firmware... Can't you just use the meta build id? That implies the version of *everything*, right? >> >> >> >>>>> + >> >>>>> +What: /sys/devices/soc0/apps_image_crm >> >>>>> +What: /sys/devices/soc0/apps_image_variant >> >>>>> +What: /sys/devices/soc0/apps_image_version >> >>>>> +Date: January 2017 >> >>>>> +Contact: linux-arm-msm@vger.kernel.org >> >>>>> +Description: >> >>>>> + These files respectively show the crm version, variant and >> >>>>> + version of the APPS(Linux kernel, rootfs) image. >> >>>> >> >>>> Assuming that the kernel and rootfs are the same image and updated >> >>>> together? >> >>>> >> >>> >> >>> Yes. The kernel and rootfs are same image and they are updated together. >> >> Maybe for you, but generally those are separate pieces. >> > > This attribute is special in that it is populated from user space, so > any tool running on apps should be able to fetch it directly anyways > (e.g. from Android properties). > > Imran, is there any users of this information outside the apps context? > E.g. does your tools for analysing memory-dumps depend on this > information being available in SMEM? > >> >>> >> >>>>> + >> >>>>> +What: /sys/devices/soc0/boot_image_crm >> >>>>> +What: /sys/devices/soc0/boot_image_variant >> >>>>> +What: /sys/devices/soc0/boot_image_version >> >>>>> +Date: January 2017 >> >>>>> +Contact: linux-arm-msm@vger.kernel.org >> >>>>> +Description: >> >>>>> + These files respectively show the crm version, variant and >> >>>>> + version of the Boot(bootloader) image. >> >>>>> + >> >>>>> +What: /sys/devices/soc0/build_id >> >>>>> +Date: January 2017 >> >>>>> +Contact: linux-arm-msm@vger.kernel.org >> >>>>> +Description: >> >>>>> + This file shows the unique id of current build being used on >> >>>>> + the system. >> >>>> >> >>>> Build of what? The kernel already has a build version. >> >>>> >> >>> This is not build id of the kernel. This is build ID of complete meta image. >> >> That's assuming everything is built together which generally isn't >> true. > > Not necessarily compiled together, but packaged up in something that > gets a "release number" - which I presume is quite common for any type > of embedded products. > > E.g. we do give the Linaro releases version numbers such as "16.09". Yes, but I doubt the release number is visible inside the release unless it is part of some existing version like the kernel's version string. If this is quite common, then lets make it common. Why not just make this a file in the filesystem? Why does the kernel need to provide it? >> It doesn't seem like that is information the kernel should >> provide. >> > > I used to say that we could just store this information in a file in > /etc (or in build.prop), then I started doing post-build composition and > realized that you really do want a new system-version if you change e.g. > the version of the boot firmware - without having to regenerate the > rootfs. > > So while I agree that this is none of the kernel's business I'm not sure > how you would get this information from SMEM to a user space process for > e.g. bugreport generation purposes. > >> >>> >> >>>>> + >> >>>>> +What: /sys/devices/soc0/cnss_image_crm >> >>>>> +What: /sys/devices/soc0/cnss_image_variant >> >>>>> +What: /sys/devices/soc0/cnss_image_version >> >>>>> +Date: January 2017 >> >>>>> +Contact: linux-arm-msm@vger.kernel.org >> >>>>> +Description: >> >>>>> + These files respectively show the crm version, variant and >> >>>>> + version of the CNSS image. >> >>>>> + >> >>>>> +What: /sys/devices/soc0/family >> >>>>> +Date: January 2017 >> >>>>> +Contact: linux-arm-msm@vger.kernel.org >> >>>>> +Description: >> >>>>> + This file shows the family(e.g Snapdragon) of the SoC. >> >>>> >> >>>> Sounds like a standard attr. >> >>>> >> >>> Yeah. This is standard attribute. Will remove this from Documentation here. >> >>> >> >>>>> + >> >>>>> +What: /sys/devices/soc0/foundry_id >> >>>>> +Date: January 2017 >> >>>>> +Contact: linux-arm-msm@vger.kernel.org >> >>>>> +Description: >> >>>>> + This file shows the id of the foundry, where soc was >> >>>>> + manufactured. >> >>>> >> >>>> I don't see how userspace should care... >> >>>> >> >>> Yeah, usually user space would not care for such information. But sometimes we have >> >>> come across h/w issues that were seen only on set of chips from a particular >> >>> foundry. Under such situations we use this information to confirm if a certain h/w >> >>> issue is specific to a batch from a particular foundry or not. >> >>> >> >> Could you please provide some feedback regarding this? >> >> The qcom compatible string format already provides this. I don't think >> we need 2 ABIs that are both vendor specific to expose this. Now if >> there's other vendors wanting to expose the foundry, then a common >> attr would make sense. >> >> compatible = "qcom,[-][-]-[/][-]" >> > > For userspace to be able to parse out this information from > /proc/device-tree/compatible we need to improve that expression quite a > bit! What's the foundry_id of <"acme,phone-a","qcom,platform-b-c">? I can't help it if QCom defines an elaborate compatible string format and then doesn't use it. >> >>>>> + >> >>>>> +What: /sys/devices/soc0/hw_platform >> >>>>> +Date: January 2017 >> >>>>> +Contact: linux-arm-msm@vger.kernel.org >> >>>>> +Description: >> >>>>> + This file shows the type of hardware platform >> >>>>> + (e.g MTP, QRD etc) where SoC is being used. >> >>>> >> >>>> What's a platform? >> >>>> >> >>> We may use same soc on different type of platforms. For example for QCOM we have >> >>> MTP (board with which a debug board can be connected), QRD (no debug connection available). >> >>> Similarly other ODMs may have different kind of platforms based on same soc. >> >>> hw_paltform indicates numeric id for different kind of such platforms. >> >> As above, I believe /compatible already provides that information. >> > > I believe this is what OMAP calls "type", in a custom attribute on the > side of the common ones. > > But as far as I can see this information should be trivial to derive > from the compatible of the board. Imran, what is this data used for? > > Regards, > Bjorn