Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4276819imm; Mon, 15 Oct 2018 11:58:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV61OdZ/y5rtM8rI28zd+3bUHDwITpapCy08+XtZp4OQNLC+5/hBd49tIzKnGZNqpIY5b1bJr X-Received: by 2002:a63:a119:: with SMTP id b25-v6mr17108961pgf.186.1539629914973; Mon, 15 Oct 2018 11:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539629914; cv=none; d=google.com; s=arc-20160816; b=TfVjf8KGhJx0DoMVN2fDfRkcdzhF9JaDFCwjjkXH5AGM26jFjXzAC2zgY+iNMT8av+ rYUeF6YE8o7F/m4HRWu6W/6GmZSSePZHI7pba/hn33OPrdvnEGWGixGJmTvX6zASAPJh rviKZBD+S5eoEW7VwkPOY9ROVIoN3C+hFVF6Yi/HMXgGeaRvkEdbsQ89Olu7k4ZNiaKP jnQtUzn5B32dcV1BwNs9fGQuL6uWqc0WKIvjrEtfuu626TYgpZW0aUEGpmOALp02vITW AlVF7QvfI1IaDiyYXS2UD9m5+mrCoH27ye3UK7Xophur1qx9zs7lWeEr/6S1KZ0pTeKb iSfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4aYb7u/Z11684LDCeK9FKVQ3f/iesGET/yMXAry1D4Y=; b=e20YLdhLy3aSm2AWO0SsJIgK6F4qDiuu/+xoWEMDqBLGAmccY6mJ3AQ7bvsT6d0nwJ Zhpv7HwXlRdA+mu/e+9Jye2t+bT77pwZNY2Ue6l0K00eDrEdxutZkGd0c1D6fb1UOIRu MeIO7E9hXhhbtGCrdmjoEzCL1uab3zSD8yLv08d/dgEYFUp0TwtjeEp2TQFzVhYfhB06 RpIIXxiGayrpSjO20cPTUC0pcC64O3+ONq+Ub7Zat15aVtPmZAYVhAzrzLb/2zL4ZV6a Drd7w1SMdiSwF0gZRDE6RdgGu2rK2fV6wM9LIqLnlledfPccq10DNEaqq43hEGiFXJQT R9Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WONmfdjx; 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 b6-v6si10969206plr.267.2018.10.15.11.58.18; Mon, 15 Oct 2018 11:58:34 -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=@kernel.org header.s=default header.b=WONmfdjx; 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 S1726990AbeJPCmp (ORCPT + 99 others); Mon, 15 Oct 2018 22:42:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:46372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726713AbeJPCmp (ORCPT ); Mon, 15 Oct 2018 22:42:45 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D17CE208D9; Mon, 15 Oct 2018 18:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539629774; bh=mDK4+EIqo9md04S9e+DhwOr+0uETFJl7BVEnCiNhjY8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WONmfdjxSF0Vmr3CmdKG/FfeMgaLhS5UXP3iA7VVnyeiLRsk2lJxDckHs5dnY8HxL JqlExvCOLBPaEbv+aCGZpHiMQH4JNsVKc51r1zTDrY64Vq3u1+lwHMuQ3mc1ktv4Jj wfRLwXp4qSPYrcdnGO+zn79wm+MPrFo94udh3Zhc= Date: Mon, 15 Oct 2018 20:56:11 +0200 From: Greg KH To: Roman Kiryanov Cc: linux-kernel@vger.kernel.org, Todd Kjos Subject: Re: [PATCH v3 06/15] platform: goldfish: pipe: Move memory allocation from probe to init Message-ID: <20181015185611.GA5201@kroah.com> References: <20181003171720.169953-1-rkir@google.com> <20181003171720.169953-6-rkir@google.com> <20181015183458.GA28454@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 15, 2018 at 11:48:28AM -0700, Roman Kiryanov wrote: > > You should only allocate memory at probe time > > probe does not know what memory to allocate. We have several versions > of the driver (with different init) and different versions allocate > different state. I only see one driver here. Why does probe not know what to allocate? That is exactly when the device is bound to the driver, you have _way_ more information than you do at init time. > >, not init time as what > > happens if the hardware is not present yet your driver is loaded? > > init will have to rollback what it allocated. But those resources it will sit there wasted until unload happens. And unload _never_ happens on a system unless you are a developer working on the module. thanks, greg k-h