From: Esben Haabendal <esben@haabendal.dk>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-serial@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
Darwin Dingel <darwin.dingel@alliedtelesis.co.nz>,
He Zhe <zhe.he@windriver.com>,
Jisheng Zhang <Jisheng.Zhang@synaptics.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] serial: 8250: Allow port registration without UPF_BOOT_AUTOCONF
Date: Sat, 27 Apr 2019 10:58:42 +0200 [thread overview]
Message-ID: <87tvejakot.fsf@haabendal.dk> (raw)
In-Reply-To: <20190426215103.GD9224@smile.fi.intel.com> (Andy Shevchenko's message of "Sat, 27 Apr 2019 00:51:03 +0300")
Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:
> On Fri, Apr 26, 2019 at 06:54:05PM +0200, Esben Haabendal wrote:
>> Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:
>> > On Fri, Apr 26, 2019 at 10:40:37AM +0200, Esben Haabendal wrote:
>> >> With serial8250_register_8250_port() forcing UPF_BOOT_AUTOCONF bit on, it
>> >> is not possible to register a port without having
>> >> serial8250_request_std_resource() called.
>> >>
>> >> For adding a 8250 port to an MFD device, this is problematic, as the
>> >> request_mem_region() call will fail, as the MFD device (and rightly so)
>> >> has requested the region. For this case, the 8250 port should accept
>> >> having passed mapbase and membase, and just use that.
>> >
>> > You need to simple set port type and use UPF_FIXED_TYPE.
>> > No need for this patch.
>>
>> 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. And I believe that is a valid thing to do.
To workaround this, I first thought I could just avoid setting
port->mapbase, causing serial8250_request_std_resource() to be a no-op.
But this breaks with more than one UART port, as uart_match_port() will
match the same line for all such UART ports, causing all but the last
one to be removed.
That said, the purpose of UPF_BOOT_AUTOCONF (for 8250 driver) is to
request and map the register memory. So when that is already done by
the parent MFD driver, I think it is silly to workaround problems caused
by UPF_BOOT_AUTOCONF being force setted, when it really shouldn't.
> Moreover, some drivers
> are used as MFD counterparts with exactly same bits set.
>
>> I think it is unfortunate that UPF_BOOT_AUTOCONF is or'ed to flags like
>> that, but changing that will surely break stuff.
>
> True.
next prev parent reply other threads:[~2019-04-27 8:58 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-26 8:40 [PATCH 0/2] serial: 8250: Add support for 8250/16550 as MFD function Esben Haabendal
2019-04-26 8:40 ` [PATCH 1/2] serial: 8250: Allow port registration without UPF_BOOT_AUTOCONF Esben Haabendal
2019-04-26 14:39 ` Andy Shevchenko
2019-04-26 16:54 ` Esben Haabendal
2019-04-26 21:51 ` Andy Shevchenko
2019-04-27 8:58 ` Esben Haabendal [this message]
2019-04-27 11:57 ` Enrico Weigelt, metux IT consult
2019-04-29 6:37 ` Esben Haabendal
2019-04-29 6:37 ` Esben Haabendal
2019-04-27 16:41 ` Andy Shevchenko
2019-04-29 6:27 ` Esben Haabendal
2019-04-29 6:27 ` Esben Haabendal
2019-04-29 8:33 ` Andy Shevchenko
2019-04-29 9:29 ` Esben Haabendal
2019-04-29 9:29 ` Esben Haabendal
2019-04-29 12:56 ` Enrico Weigelt, metux IT consult
2019-04-29 13:35 ` Andy Shevchenko
2019-04-29 14:25 ` Esben Haabendal
2019-04-29 14:25 ` Esben Haabendal
2019-04-26 8:40 ` [PATCH 2/2] serial: 8250: Add support for 8250/16550 as MFD function Esben Haabendal
2019-05-07 11:49 ` Lee Jones
2019-05-07 12:04 ` Esben Haabendal
2019-05-07 13:38 ` Lee Jones
2019-05-14 8:00 ` Esben Haabendal
2019-05-14 10:47 ` Lee Jones
2019-05-14 12:26 ` Greg Kroah-Hartman
2019-05-14 12:41 ` Esben Haabendal
2019-05-21 10:09 ` Greg Kroah-Hartman
2019-05-21 11:11 ` Esben Haabendal
2019-05-21 11:18 ` Greg Kroah-Hartman
2019-05-21 11:50 ` Esben Haabendal
2019-05-21 12:56 ` Greg Kroah-Hartman
2019-05-21 14:31 ` Esben Haabendal
2019-05-21 14:43 ` Greg Kroah-Hartman
2019-05-27 19:56 ` Enrico Weigelt, metux IT consult
2019-04-26 14:35 ` [PATCH 0/2] " Andy Shevchenko
2019-04-26 16:57 ` Esben Haabendal
2019-04-26 17:21 ` Andy Shevchenko
-- strict thread matches above, loose matches on Subject: below --
2019-04-26 8:36 [PATCH 1/2] serial: 8250: Allow port registration without UPF_BOOT_AUTOCONF Esben Haabendal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tvejakot.fsf@haabendal.dk \
--to=esben@haabendal.dk \
--cc=Jisheng.Zhang@synaptics.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bigeasy@linutronix.de \
--cc=darwin.dingel@alliedtelesis.co.nz \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=zhe.he@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.