Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3321306yba; Sun, 28 Apr 2019 23:29:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvj9Mqv850UkxXsfAgQYCByeACAcjUnLccUk4mUVBEIApg7Jj48OM1IhZyqg6g9RjiHTCK X-Received: by 2002:aa7:8186:: with SMTP id g6mr24957299pfi.126.1556519371408; Sun, 28 Apr 2019 23:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556519371; cv=none; d=google.com; s=arc-20160816; b=jWkWflkJ+tArcIIIh+P2qkh3hip+IE/w28gl12XmoVjwc4m2qwF67AuglJQYS7qIzo Gef/bcW6jb5xlw5D3jIwH0x2YacyAVMKI47CBqhIxbNQcSeThQedbY339UZHKwm78j8B xVbFWprtBZLzXnw2iToHsEXIC/AVHZO7VA93PhBbVFwedgMbll+zWVx4VfP47kh4Vj1l /Hh1vvqZUtvMddCesydmquby7Yov53q0GFWSkRyZAkdPNXW/60yLnvOHxIUwtKFROreB 4dVF96tU3t+z/vUic+mKdHoXmXJuaFWYvWbihM4WdgEU++7jT06DbZ3Z9KZJIq2miain kURg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dkim-signature; bh=XYOc3di3/FnOo+X1QJKgjdVsQJzM5OjhprwMMvJqZaI=; b=dEL7ptej/R6gowKxEZzZncqH33PJv/WVV7gm3sBnT8VK0zdeRzVAWHWBD3z4KTyC45 AFXHKYvargUp4pZ4Ohk42OEVOenJY3J/W7MSP5lzyPC2XJfsMtcqYPfZY+r3CeC10teh wHbOcGOhBnQW5gBlkCaVOWDPMlY3FLtPcjBjkQ5cZjNO7juKTUA97ow7Y0jpWq2vGSLq 9XG9szm9iYTLITp/bUGP9gV9m/YDGa2iOmp3M+JbUcaFw7jlP3Ex/CdxFxuinIG/70Ce SOE5hHsgrKRvj2I/4DkQ97XXctNfbfr5pMkIQI6uVsT+KtvSpucpz8Ts0llCGhx86liC fsKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@haabendal.dk header.s=20140924 header.b=VYJEQOtc; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x24si4021672pfo.120.2019.04.28.23.29.05; Sun, 28 Apr 2019 23:29:31 -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=@haabendal.dk header.s=20140924 header.b=VYJEQOtc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727281AbfD2G2B (ORCPT + 99 others); Mon, 29 Apr 2019 02:28:01 -0400 Received: from mailrelay3-1.pub.mailoutpod1-cph3.one.com ([46.30.210.184]:43096 "EHLO mailrelay3-1.pub.mailoutpod1-cph3.one.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726979AbfD2G2B (ORCPT ); Mon, 29 Apr 2019 02:28:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=haabendal.dk; s=20140924; h=content-type:mime-version:message-id:in-reply-to:date:references:subject:cc: to:from:from; bh=XYOc3di3/FnOo+X1QJKgjdVsQJzM5OjhprwMMvJqZaI=; b=VYJEQOtc9+dJ6uCZe31Kujvkd9whUVy8H7qTaH9uEt3neZalOs7U0HGfgteWD5bguKLSwqlhD1fjk eVIEFw3qOuP/4QNUml4O6TpTOPeNaigwcE3IC25PzR8RfKrjKoYuLQf+gaAUnPhwn7kXZtfdYrL+uS d0z72zKCZsubdrqM= X-HalOne-Cookie: 77fc30f33d2e37bcee46875632c6ff9310ff2e62 X-HalOne-ID: ed4dcbfe-6a47-11e9-9a3d-d0431ea8bb03 Received: from localhost (unknown [193.163.1.7]) by mailrelay3.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id ed4dcbfe-6a47-11e9-9a3d-d0431ea8bb03; Mon, 29 Apr 2019 06:27:56 +0000 (UTC) From: Esben Haabendal To: Andy Shevchenko 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 Subject: Re: [PATCH 1/2] serial: 8250: Allow port registration without UPF_BOOT_AUTOCONF 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> Date: Mon, 29 Apr 2019 08:27:56 +0200 In-Reply-To: (Andy Shevchenko's message of "Sat, 27 Apr 2019 19:41:10 +0300") Message-ID: <87y33tz5oz.fsf@haabendal.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Shevchenko writes: > 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? 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. 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. /Esben