All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Imran Khan <kimran@codeaurora.org>
Cc: andy.gross@linaro.org, david.brown@linaro.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-soc@vger.kernel.org
Subject: Re: [PATCH v8 1/2] soc: qcom: Add SoC info driver
Date: Tue, 14 Feb 2017 16:24:43 -0800	[thread overview]
Message-ID: <20170215002443.GA23255@minitux> (raw)
In-Reply-To: <1484063285-8306-1-git-send-email-kimran@codeaurora.org>

On Tue 10 Jan 07:48 PST 2017, Imran Khan wrote:

> diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
> new file mode 100644
> index 0000000..40c180d
> --- /dev/null
> +++ b/drivers/soc/qcom/socinfo.c
> @@ -0,0 +1,516 @@
> +/*
> + * Copyright (c) 2009-2016, The Linux Foundation. All rights reserved.

Sorry for the slow progress, please bump the year now.

[..]
> +
> +static const char *const pmic_model[] = {
> +	[0]  = "Unknown PMIC model",
> +	[13] = "PM8058",
> +	[14] = "PM8028",
> +	[15] = "PM8901",
> +	[16] = "PM8027",
> +	[17] = "ISL9519",
> +	[18] = "PM8921",
> +	[19] = "PM8018",
> +	[20] = "PM8015",
> +	[21] = "PM8014",
> +	[22] = "PM8821",
> +	[23] = "PM8038",
> +	[24] = "PM8922",
> +	[25] = "PM8917",
> +};

I thought the conclusion was to drop the "hw_platform",
"qrd_hw_platform_subtype" and hw_platform_subtype" lists, but to keep
the cpu_of_id (although named soc_of_id).

The hw_platform ids are re-used by ODMs and might have different
meaning, but the SoC name is quite useful. So please put the soc_of_id
back in here.

[..]
> +
> +static ssize_t
> +qcom_odm_show(struct device *dev, struct device_attribute *attr, char *buf)
> +{
> +	return scnprintf(buf, PAGE_SIZE, "%s\n", odm_name);
> +}
> +DEVICE_ATTR_RO(qcom_odm);

In the case that ODMs will start using this implementation for
communicating information to user-space I believe a name will not be
enough - most likely there would be some product name and some
revision/build information.

My suggestion is that you just skip the "odm" attribute in your patch,
this gives a good opportunity for the ODMs to make a simple contribution
of what they actually want here.

[..]
> +
> +void qcom_socinfo_init(struct device *device)
> +{
> +	struct soc_device_attribute *attr;
> +	const struct fdt_property *prop;
> +	struct soc_device *soc_dev;
> +	struct device *dev;
> +	size_t item_size;
> +	size_t size;
> +	int i;
> +
> +	socinfo = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID,
> +			&item_size);
> +	if (IS_ERR(socinfo)) {
> +		dev_err(device, "Coudn't find socinfo\n");
> +		return;
> +	}
> +
> +	if ((SOCINFO_VERSION_MAJOR(le32_to_cpu(socinfo->v0_1.fmt)) != 0) ||
> +	(SOCINFO_VERSION_MINOR(le32_to_cpu(socinfo->v0_1.fmt)) < 0) ||
> +	(le32_to_cpu(socinfo->v0_1.fmt) > MAX_SOCINFO_FORMAT)) {

Indent wrapped lines by the start parenthesis and skip the extra
parenthesis please.

I.e.

if (... ||
    ... ||
    ...) {

> +		dev_err(device, "Wrong socinfo format\n");
> +		return;
> +	}
> +

[..]

> +
> +	odm_name = of_get_property(device->of_node, "qcom,odm", NULL);
> +	if (odm_name)
> +		device_create_file(dev, &dev_attr_qcom_odm);

Skip this for now.

> +
> +	/* Feed the soc specific unique data into entropy pool */
> +	add_device_randomness(socinfo, item_size);
> +}
> +EXPORT_SYMBOL(qcom_socinfo_init);

Please add me as To: on the next spin of your patch so I don't miss it
on the mailing list. I do expect to be able to recommend Andy to merge
that version.

Regards,
Bjorn

  reply	other threads:[~2017-02-15  0:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 15:48 [PATCH v8 1/2] soc: qcom: Add SoC info driver Imran Khan
2017-02-15  0:24 ` Bjorn Andersson [this message]
2017-02-15  5:31   ` Imran Khan
2017-02-16  4:32     ` Bjorn Andersson

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=20170215002443.GA23255@minitux \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=kimran@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.