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: <CAHp75Vc6cLnLztXtvTcWisjAqDUTEWBBgv20CA34ZQmBEAvpbA@mail.gmail.com>
Date:   Mon, 29 Apr 2019 11:33:50 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Esben Haabendal <esben@...bendal.dk>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        "open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jslaby@...e.com>,
        Darwin Dingel <darwin.dingel@...iedtelesis.co.nz>,
        He Zhe <zhe.he@...driver.com>,
        Jisheng Zhang <Jisheng.Zhang@...aptics.com>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] serial: 8250: Allow port registration without UPF_BOOT_AUTOCONF

On Mon, Apr 29, 2019 at 9:27 AM Esben Haabendal <esben@...bendal.dk> wrote:
> Andy Shevchenko <andy.shevchenko@...il.com> writes:
> > On Sat, Apr 27, 2019 at 12:01 PM Esben Haabendal <esben@...bendal.dk> wrote:
> >> Andy Shevchenko <andriy.shevchenko@...ux.intel.com> writes:
> >> > On Fri, Apr 26, 2019 at 06:54:05PM +0200, Esben Haabendal wrote:
> >> >> Andy Shevchenko <andriy.shevchenko@...ux.intel.com> writes:
> >> >> The reason for this patch is to be able to do exactly that (set port
> >> >> type and UPF_FIXED_TYPE) without having UPF_BOOT_AUTOCONF added.
> >> >>
> >> >> In the current serial8250_register_8250_port() there is:
> >> >>
> >> >>     uart->port.flags        = up->port.flags | UPF_BOOT_AUTOCONF;
> >> >>
> >> >> So, even though I set UPF_FIXED_TYPE, I get
> >> >> UPF_FIXED_TYPE|UPF_BOOT_AUTOCONF.
> >> >
> >> > Yes.
> >> >
> >> >> So I need this patch.
> >> >
> >> > Why? I don't see any problems to have these flags set.
> >>
> >> The problem with having UPF_BOOT_AUTOCONF is the call to
> >> serial8250_request_std_resource().  It calls request_mem_region(), which
> >> fails if the MFD driver already have requested the memory region for the
> >> MFD device.
> >
> > If it's MFD, why it requested the region for its child?
> > Isn't it a bug in MFD driver?
>
> It is a PCI driver, which calls pci_request_regions().  The PCI device
> carries a lot of different functions, which uses small slices of the PCI
> memory region(s).  With the resources being a tree structure, I don't
> think it is a bug when a parent driver requests the entire memory
> region.

If it's MFD driver, it's not its business to do something
child-related on child behalf.
In any case, Linux device resource model uses exclusive region
slicing. If you do like above, you call for a problems.

Btw, we have PCI MFD driver which enumerates 8250 (more precisely
8250_dw) w/o any issues.

> It would be nice if child drivers requesting memory would pass the
> parent memory resource.  Maybe 8250 driver could be changed to accept a
> struct resource pointer instead of a simple mapbase value, allowing to
> setup the resource with parent pointing to the MFD memory resource.

I don't see the problem in certain driver, I guess you are trying to
workaround existin Linux device resource model.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ