On 03/06/2018 01:55 PM, Dan Williams wrote:
> On Tue, Mar 6, 2018 at 10:25 AM, Dave Jiang <dave.ji...@intel.com> wrote:
>> Adding generic and intel support function to allow check if update firmware
>> is supported by the kernel.
>>
>> Signed-off-by: Dave Jiang <dave.ji...@intel.com>
> [..]
>> diff --git a/ndctl/update.c b/ndctl/update.c
>> index 0f0f0d81..b4ae1ddb 100644
>> --- a/ndctl/update.c
>> +++ b/ndctl/update.c
>> @@ -449,11 +449,24 @@ static int get_ndctl_dimm(struct update_context *uctx, 
>> void *ctx)
>>  {
>>         struct ndctl_dimm *dimm;
>>         struct ndctl_bus *bus;
>> +       int rc;
>>
>>         ndctl_bus_foreach(ctx, bus)
>>                 ndctl_dimm_foreach(bus, dimm) {
>>                         if (!util_dimm_filter(dimm, uctx->dimm_id))
>>                                 continue;
>> +                       rc = ndctl_dimm_fw_update_supported(dimm);
>> +                       switch (rc) {
>> +                       case -ENOTTY:
>> +                               error("DIMM firmware update not supported by 
>> ndctl.");
>> +                               return rc;
>> +                       case -EOPNOTSUPP:
>> +                               error("DIMM firmware update not supported by 
>> the kernel");
>> +                               return rc;
>> +                       case -EIO:
>> +                               error("DIMM firmware update not supported by 
>> platform firmware.");
> 
> I like that you separated the no ND_CMD_CALL case from the
> test_dimm_dsm(ND_INTEL_FW_GET_INFO) case, however this error message
> should be:
> 
>      "DIMM firmware update not supported by either platform firmware
> or the kernel"
> 
> ...because it could be the case that the kernel has ND_CMD_CALL
> support but has not been updated for the given DSM mask.
> 
> Other than that you can add:
> 
> Reviewed-by: Dan Williams <dan.j.willi...@intel.com>
> 

Thanks. I'll just change it in patch 2/2 instead of here.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to