Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1912281yba; Sat, 27 Apr 2019 09:43:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwftcJVo70PQixB3nJISBm+6kIFqOxkj5R1h5OIqd+ESBQWNgfch74YQPHZDZIZx9fFbvOi X-Received: by 2002:aa7:8455:: with SMTP id r21mr2900127pfn.253.1556383427566; Sat, 27 Apr 2019 09:43:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556383427; cv=none; d=google.com; s=arc-20160816; b=GM9qEPm6KgeRjKZ1XH0PZnh1/5ks3+QcajneOHy56QwLiMVN1rm1VfgvPtw3eS5HN2 ORvZ356tSLWRtwR3HfHVdIkT6pb/2dVkFd1RXmHZwzfFNGOo3150HtKaVRH64Aoy/E52 t6mSiLpC+jjorEonrOjaLFyOGxk2DPGkr0LvANMoakJI4H2S1WzJ8yFpds3Zz0CHkkOV dMQYPycm9NZ/WJkQUnpVTysw+G31ib51NUvxGR4egWZ4JKSLhosK5hk0UJVjF6J1m0/z P9LHK3bNyBi923s8mLrCkIcVxappbhIYSHGqPpdZM8SrWcbA3ELHJDOGOSsGrTGQjPcg X54A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=x2wgOmjHmygiVTqAX0w6y4VcoX721WxiuBgRaT/Kgs4=; b=Le0sFZErOujZ2Loqhu8qwDd0e6vHWlYLaZIj+E9EP6qRuv7Ei9zGPZc3F1LBQa3dxj 9x7Avp4Uq51v+HsxsSeaylcl/InMamnFj51GluOlCcOl95ppeP4FYrRgLQMMD/M+3ooJ Rg1GOO+rhlbSmIkvu9LKZTy6x6x8BGAWX8P/uazukt+P7KJ6QEnU/dy3JJRhWlGyJdRz C1yMJC3dszSSSOLK0icog6nx794JkKh4mmplKLjk/4X6LEZRaCjCy7fitv7bX/T1pZZl GB7uiQsrsEuDbJxBPqW3p8yMyvb+iojP3FHDyWtOAxb40PWtgomOA8xhfrOEjK22jAqX A2QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WfBaQ5Qr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si18404205pln.91.2019.04.27.09.43.31; Sat, 27 Apr 2019 09:43:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WfBaQ5Qr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726125AbfD0QlX (ORCPT + 99 others); Sat, 27 Apr 2019 12:41:23 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45263 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725942AbfD0QlW (ORCPT ); Sat, 27 Apr 2019 12:41:22 -0400 Received: by mail-pl1-f193.google.com with SMTP id o5so3002281pls.12; Sat, 27 Apr 2019 09:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x2wgOmjHmygiVTqAX0w6y4VcoX721WxiuBgRaT/Kgs4=; b=WfBaQ5Qr0pxSFWSxQoKoGdhEz++2xJYrpML8oCGjlqT0If8C5biJMXCsf+l0P32d2D MsFqZLVlKklvrVJPnKpv/FDx8INjZAgL7SQaDIgQMqLVlwNEj+Aap3xT4WXMVI6hBfJH MxZAERxfXqkcPIu3k/csao/Ij2Em2zSgmqggNgpLy+stDdG5yIQ0CX1lcO7OP8NSsHL7 jTCpFljpk1KmyGBmaw//KrI2yMHsWFEPyxBL485uTIHICDeqtQdtmNpGhnSaeeA1ldgI cT8+YcSmwp6m9nyC59i0UGUwgzp32vmd9Fg0IeNoDV9VFgseXjuOiE8uAaEthoj2C+oU 12UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x2wgOmjHmygiVTqAX0w6y4VcoX721WxiuBgRaT/Kgs4=; b=k29BMupy2UhBZKBUdSh9BQEHPxskiLy2gvJtZnOU2Y4Gh+jyLEg1VgEl1NZ190A9JG r6nuznVcId/jMzlxvDmiPCoB5d6MsJmH7pNOJfYcPLMVYarTrHZpOFcqaJpGKe/RurSx aKplhRRwpkrQ+Xg3lzM+AWI1UUACiKQTQHoTN0yYsxkoLOZfv3DujGSAhIaKs+GRFWdX D1X3yJjUV7o8tOUUwhgofRE3YhpT5/jN+1vR2TlI5n01xDsNVGnhSq3Fag/2HgmNhVOT phwRTC7Jj8E8aDhR8wi5Rqv/QffKcCQVZmzmWMZO6p4tQZMcVpSQa73n4HL/1Og1+xRB wKxQ== X-Gm-Message-State: APjAAAUu0Wa150Th+5eC0JAS7qGSHECaRpgidrUCN9arGl8Y8CCuQM4+ 4Ioo/bBDdSei6A3WXBJkwxLDsYJEyt7OeQw56sI= X-Received: by 2002:a17:902:758b:: with SMTP id j11mr15560561pll.87.1556383281759; Sat, 27 Apr 2019 09:41:21 -0700 (PDT) MIME-Version: 1.0 References: <20190426084038.6377-1-esben@geanix.com> <20190426084038.6377-2-esben@geanix.com> <20190426143946.GX9224@smile.fi.intel.com> <871s1og11u.fsf@haabendal.dk> <20190426215103.GD9224@smile.fi.intel.com> <87tvejakot.fsf@haabendal.dk> In-Reply-To: <87tvejakot.fsf@haabendal.dk> From: Andy Shevchenko Date: Sat, 27 Apr 2019 19:41:10 +0300 Message-ID: Subject: Re: [PATCH 1/2] serial: 8250: Allow port registration without UPF_BOOT_AUTOCONF To: Esben Haabendal Cc: Andy Shevchenko , "open list:SERIAL DRIVERS" , Greg Kroah-Hartman , Jiri Slaby , Darwin Dingel , He Zhe , Jisheng Zhang , Sebastian Andrzej Siewior , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 27, 2019 at 12:01 PM Esben Haabendal wrote: > Andy Shevchenko writes: > > On Fri, Apr 26, 2019 at 06:54:05PM +0200, Esben Haabendal wrote: > >> Andy Shevchenko 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? > 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. -- With Best Regards, Andy Shevchenko