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: <20110326023252.GZ3130@pulham.picochip.com>
Date:	Sat, 26 Mar 2011 02:32:52 +0000
From:	Jamie Iles <jamie@...ieiles.com>
To:	Mike Frysinger <vapier@...too.org>
Cc:	Jamie Iles <jamie@...ieiles.com>, linux-kernel@...r.kernel.org,
	gregkh@...e.de
Subject: Re: [RFC PATCHv3 3/4] drivers/otp: convert bfin otp to generic OTP

On Fri, Mar 25, 2011 at 10:11:40PM -0400, Mike Frysinger wrote:
> >> > +static const struct otp_region_ops bfin_region_ops = {
> >> > +       .read_word      = bfin_region_read_word,
> >> > +       .write_word     = bfin_region_write_word,
> >> > +       .get_size       = bfin_region_get_size,
> >> > +       .get_fmt        = bfin_region_get_fmt,
> >> > +       .ioctl          = bfin_region_ioctl,
> >> > +};
> >>
> >> hmm, i just realized this stuff is per-region.  wouldnt the
> >> read/write/ioctl make more sense as per-device ?
> >
> > No, I don't think so.  The file_operations are all based on the regions
> > rather than the device so I think it makes sense to have these as region
> > based operations.  We could make them per device and pass the region as
> > a parameter but I'm not sure that it gains us anything.
> 
> for a device that exports more than one region, you dont need to
> duplicate the structure.  as you add in more regions, the amount of
> duplication increases.
> 
> how many regions does your device export ?  does it need different
> read/write behavior for each ?

The current devices are up to 8 regions and whilst the behaviour is the 
same for each it does need to know what region it's operating on so it 
can set the redundancy correctly.

We could move the read and write methods into some device ops but they'd 
need to take an otp_region as a parameter.  Also, at the moment we don't 
duplicate the structure as we're just keeping a pointer to it but I'm 
happy to move these into the device ops if you have a strong preference.

Jamie
--
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