lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1440685119.14237.83.camel@hp.com>
Date:	Thu, 27 Aug 2015 08:18:39 -0600
From:	Toshi Kani <toshi.kani@...com>
To:	Ross Zwisler <ross.zwisler@...ux.intel.com>
Cc:	dan.j.williams@...el.com, rafael.j.wysocki@...el.com,
	linux-nvdimm@...ts.01.org, robert.moore@...el.com,
	linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org
Subject: Re: [PATCH 1/2]: nfit: Clarify memory device state flags strings

On Wed, 2015-08-26 at 21:07 -0600, Ross Zwisler wrote:
> On Wed, Aug 26, 2015 at 10:20:23AM -0600, Toshi Kani wrote:
> > diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
> > index c3fe206..6993ff2 100644
> > --- a/drivers/acpi/nfit.c
> > +++ b/drivers/acpi/nfit.c
> > @@ -701,12 +701,13 @@ static ssize_t flags_show(struct device *dev,
> >  {
> >  	u16 flags = to_nfit_memdev(dev)->flags;
> >  
> > -	return sprintf(buf, "%s%s%s%s%s\n",
> > -			flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save " : 
> > "",
> > -			flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore 
> > " : "",
> > -			flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush " : 
> > "",
> > -			flags & ACPI_NFIT_MEM_ARMED ? "arm " : "",
> > -			flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart 
> > " : "");
> > +	return sprintf(buf, "%s%s%s%s%s%s\n",
> > +		flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save_fail " : "",
> > +		flags & ACPI_NFIT_MEM_RESTORE_FAILED ? "restore_fail " 
> > : "",
> > +		flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush_fail " : 
> > "",
> > +		flags & ACPI_NFIT_MEM_ARMED ? "not_arm " : "",
> 
> Assuming we do want to update these strings to be more friendly, 

> "not_armed" probably makes more sense than "not_arm".  Also applies to the 
> 2nd hunk below.

Agreed.  (Will update if this patch gets ever resurrected. :-)

> > +		flags & ACPI_NFIT_MEM_HEALTH_OBSERVED ? "smart_event " > > : "",
> > +		flags & ACPI_NFIT_MEM_HEALTH_ENABLED ? "notify_enabled 
> > " : "");
> >  }
> >  static DEVICE_ATTR_RO(flags);
> >  
> > @@ -834,11 +835,11 @@ static int acpi_nfit_register_dimms(struct 
> > acpi_nfit_desc *acpi_desc)
> >  			continue;
> >  
> >  		dev_info(acpi_desc->dev, "%s: failed: %s%s%s%s\n",
> > -				nvdimm_name(nvdimm),
> > -			mem_flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save " 
> > : "",
> > -			mem_flags & ACPI_NFIT_MEM_RESTORE_FAILED ? 
> > "restore " : "",
> > -			mem_flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush 
> > " : "",
> > -			mem_flags & ACPI_NFIT_MEM_ARMED ? "arm " : "");
> > +		  nvdimm_name(nvdimm),
> > +		  mem_flags & ACPI_NFIT_MEM_SAVE_FAILED ? "save_fail " 
> > : "",
> > +		  mem_flags & ACPI_NFIT_MEM_RESTORE_FAILED ? 
> > "restore_fail ":"",
> > +		  mem_flags & ACPI_NFIT_MEM_FLUSH_FAILED ? "flush_fail 
> > " : "",
> > +		  mem_flags & ACPI_NFIT_MEM_ARMED ? "not_arm " : "");
> 
> While you're in here, is there a reason not to include the last two flags
> (smart_event and notify_enabled) in this dev_info() output?

This dev_info() logs any failure in NVDIMM, and the last two flags are not
failure conditions.

Thanks,
-Toshi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ