From: Tom Rix <trix@redhat.com>
To: Lee Jones <lee.jones@linaro.org>, Xu Yilun <yilun.xu@intel.com>
Cc: broonie@kernel.org, linux-kernel@vger.kernel.org,
matthew.gerlach@linux.intel.com, russell.h.weight@intel.com,
lgoncalv@redhat.com, hao.wu@intel.com
Subject: Re: [PATCH v4 2/2] mfd: intel-m10-bmc: add Max10 BMC chip support for Intel FPGA PAC
Date: Fri, 28 Aug 2020 06:50:54 -0700 [thread overview]
Message-ID: <de14ce03-2d42-74d1-3801-2dd2b09a448e@redhat.com> (raw)
In-Reply-To: <20200828100236.GF1826686@dell>
>> +
>> +static int check_m10bmc_version(struct intel_m10bmc *m10bmc)
>> +{
>> + unsigned int v;
>> +
>> + if (m10bmc_raw_read(m10bmc, M10BMC_LEGACY_SYS_BASE + M10BMC_BUILD_VER,
>> + &v))
>> + return -ENODEV;
> Please break functions out of if statements.
>
> Does m10bmc_raw_read() return 0 on success?
>
> Seems odd for a read function.
>
>> + if (v != 0xffffffff) {
>> + dev_err(m10bmc->dev, "bad version M10BMC detected\n");
>> + return -ENODEV;
>> + }
> The only acceptable version is -1?
I ran into this in testing. This is a check if the board is using a very old legacy bmc version. The M10BMC_LEGACY_SYS_BASE is the offset to this old block of mmio regs. On the old boards, v would have not been f's, on the current boards it is f's. The check is necessary because future calls use the M10BMC_SYS_BASE offset which was not valid on the old boards.
Tom
next prev parent reply other threads:[~2020-08-28 13:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-19 7:34 [PATCH v4 0/2] add regmap-spi-avmm & Intel Max10 BMC chip support Xu Yilun
2020-08-19 7:34 ` [PATCH v4 1/2] regmap: add Intel SPI Slave to AVMM Bus Bridge support Xu Yilun
2020-08-19 7:34 ` [PATCH v4 2/2] mfd: intel-m10-bmc: add Max10 BMC chip support for Intel FPGA PAC Xu Yilun
2020-08-28 10:02 ` Lee Jones
2020-08-28 13:50 ` Tom Rix [this message]
2020-09-08 11:56 ` Lee Jones
2020-08-29 18:24 ` Xu Yilun
2020-09-08 12:03 ` Lee Jones
2020-09-09 6:01 ` Xu Yilun
2020-09-09 7:31 ` Lee Jones
2020-09-09 8:29 ` Xu Yilun
2020-08-26 19:16 ` [PATCH v4 0/2] add regmap-spi-avmm & Intel Max10 BMC chip support Mark Brown
2020-08-27 6:56 ` Lee Jones
2020-08-27 12:20 ` Mark Brown
2020-08-27 12:27 ` Lee Jones
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=de14ce03-2d42-74d1-3801-2dd2b09a448e@redhat.com \
--to=trix@redhat.com \
--cc=broonie@kernel.org \
--cc=hao.wu@intel.com \
--cc=lee.jones@linaro.org \
--cc=lgoncalv@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.gerlach@linux.intel.com \
--cc=russell.h.weight@intel.com \
--cc=yilun.xu@intel.com \
/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
all inboxes | Powered by JetHome®