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: <CACRpkdaYL99yhJ08U13zJqviCFHzjMo9KtwfYhD+dHkuvQRhYg@mail.gmail.com>
Date:	Tue, 27 Jan 2015 00:22:14 +0100
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	Arnd Bergmann <arnd@...db.de>, Rob Herring <robh@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	linux-pci <linux-pci@...r.kernel.org>,
	Russell King <linux@....linux.org.uk>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 07/16] ARM: integrator: convert PCI to use generic config accesses

On Mon, Jan 26, 2015 at 7:22 PM, Bjorn Helgaas <bhelgaas@...gle.com> wrote:
> On Thu, Jan 22, 2015 at 02:33:36PM -0600, Bjorn Helgaas wrote:
>> On Mon, Jan 12, 2015 at 01:05:12AM +0100, Linus Walleij wrote:
>> > On Sat, Jan 10, 2015 at 10:53 PM, Arnd Bergmann <arnd@...db.de> wrote:
>> > > On Saturday 10 January 2015 22:40:22 Linus Walleij wrote:
>> > >> >  static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where,
>> > >> >                           int size, u32 *val)
>> > >> >  {
>> > >> > -       addr = v3_open_config_window(bus, devfn, where);
>> > >> > +       int ret = pci_generic_config_read(bus, devfn, where, size, val);
>> > >> >         v3_close_config_window();
>> > >> > +       return ret;
>> > >> >  }
>> > >> >
>> > >> >  static int v3_write_config(struct pci_bus *bus, unsigned int devfn, int where,
>> > >> >                            int size, u32 val)
>> > >> >  {
>> > >> > +       int ret = pci_generic_config_write(bus, devfn, where, size, val);
>> > >> >         v3_close_config_window();
>> > >> > -       raw_spin_unlock_irqrestore(&v3_lock, flags);
>> > >> > +       return ret;
>> > >> >  }
>> > >> >
>> > >> >  static struct pci_ops pci_v3_ops = {
>> > >> > +       .map_bus = v3_open_config_window,
>> > >> >         .read   = v3_read_config,
>> > >> >         .write  = v3_write_config,
>> > >>
>> > >> So .map_bus is called before every .read/.write operation I take it.
>> > >>
>> > >> Wouldn't it be proper to call the v3_close_config_window() from a
>> > >> matching .unmap_bus() callback for symmetry?
>> > >
>> > > It would be nicer for integrator but useless for anything else, so
>> > > I'd vote for leaving it the way Rob posted.
>> >
>> > OK I buy that, throw in a comment about it in the code if there
>> > is some time for iterating the patch.
>>
>> Would you prefer something like the following instead?  It keeps the
>> v3_open/close symmetry, but it does break apart and duplicate some of the
>> logic from v3_open_config_window().
>
> Hearing nothing, I kept Rob's initial version.  It can be tweaked later if
> anybody wants to.  I just want to get all this into v3.20.

Sorry, I'm OK with either version, this latest iteration looks very nice.
Acked-by.

Yours,
Linus Walleij
--
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