Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4286350imm; Mon, 15 Oct 2018 12:07:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV61OMUT0PqSUUu7AvHHkG5t/R6RFaQMU+ueOpbsZrZ3v/16qKTtg46KotQUtbQ38LpKEgpYQ X-Received: by 2002:a65:4d03:: with SMTP id i3-v6mr17182648pgt.239.1539630435314; Mon, 15 Oct 2018 12:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539630435; cv=none; d=google.com; s=arc-20160816; b=FwRrbJM1TtfTGFGTvflRSt1obtinQyt6ucdaCuQBjygj3StESMN0am/8h/hxmPmFc3 KtZsOtuIOy0Ot/Hhhgkq6A9LkpD4t8AveUyb4Ccgg42wQsh6VyH4rKlNHIcaDTfylWR9 i5rBLAksqQGtazm3fYbKhiMRtsMjchw+Xlsg4y97kXOXWVxNwVkQ8cPdbavP/p+j+Ca1 Y1MsAcCqnorC/g4LmvrHWKk5EYJFfSv/iMdl12qkyg7q8FYGKcWut3AY29kcKIZasvOU UjL2zUnZ1h0mRqwEsZMXIxV04ASyrGTPB2/CKBTYzsz59EEKrQzy5cOOPNo2PSzCPhm1 r3+Q== 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=pYEY5CM4UvtFM7HS4ZvtoZnV+DZrS+4uXnp8zoybaJY=; b=lzRDbpS9HFyFS4pJqTI4W1lT/oTw5Sw0VNVnZ9Y+2bFPF9IfltO4av93JQlJFTLOVV BJsucFZo+3JvxcDX+27fIT3smmluL6o94t4kzyCiDJHVsX+ecNAj/1mpiBKyBSWJaKDG 7vGYlC3r5GlMq6y5jtJGs85sg4AltZTZIEGdPWHLe7wTnkg6wqnjfpXRqHID/ciKbUjM 3YuJGeYwjhR/DTzkWvpDOTIyp9gOVjatvTRV/uoC+PtXVj3pY358GXnc3eeagEe22RuB EbEw7XBkhoB46wHxFKOOef+ojfIElKa2XkZfk5c+yaXCUpTGkD/hOnSiJiciUcLmedP/ WegQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pCxV9RqP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2-v6si12450415plk.373.2018.10.15.12.06.59; Mon, 15 Oct 2018 12:07:15 -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=@google.com header.s=20161025 header.b=pCxV9RqP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726882AbeJPCw6 (ORCPT + 99 others); Mon, 15 Oct 2018 22:52:58 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:33621 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726684AbeJPCw6 (ORCPT ); Mon, 15 Oct 2018 22:52:58 -0400 Received: by mail-lj1-f194.google.com with SMTP id z21-v6so18550871ljz.0 for ; Mon, 15 Oct 2018 12:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pYEY5CM4UvtFM7HS4ZvtoZnV+DZrS+4uXnp8zoybaJY=; b=pCxV9RqPadZd+ztJButAkWHppMY7Pqbb7tw6vIsQGelmAwZCnDu5fiitgC/SveW5hd TpidruKzgFAizKRMe14Ree2shtuKn0N6mMh57M24xTg840YtP5cxy/1NjODfHKLWqexA IqqB4DF6XscdmFHWlGUk02oHr6WX6u0PAPILM++PyT5eBlCrWxmfEXqNIweMDRrZM+Dp virnSRVNepMpusIpUlLqR1uFsbokiea7qDztQ0VpsL/4LUdS1yXjt92UhC7zJP7k/H4D GyhlEsGADb1rNZYF3OeH7LIX5apBQMad7DCyzzGIEvsaKs6njrvkD39ivUrnm4UInP7b RoqA== 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=pYEY5CM4UvtFM7HS4ZvtoZnV+DZrS+4uXnp8zoybaJY=; b=WYKE+oC8vTzFiYm56k+jwrbYdM3CCZ4Xk0aQaK5Vy1GKheSMEdMlf8WdJTxuyI435h SR/489PDFZpQt6EIxjs/EFY6ZqJLSFR75FD0h7iGKnE3nkrLt9JWO+KeDisLrsT2KVC9 zTjv7jHmHt4+JNP4+o8aTxgD/n2oohDfaI431lIo16hsTO047LBuB1XCyGgCyS50n5sE bYE0hTMpaPMO8OhKPZSpchO1bVQhFeYp7rBEtTGj4gWTIMVdtoTlSAKJwAKSAZchESee Xk0QxyU2lD7ModeJdl4toJF62E+YcXlikVmIvLUBWEam3uUaaQakHTd1AXw0jF+h4Tvm XSvw== X-Gm-Message-State: ABuFfohG7EpTzVNF06jnwL0LJQO/Az3zqMElzC0GjG+0E80YuMe9fcIX sN+GgleErlvUK0RhZtuFX16aKt0gp8LlLJDtzIlOKki3Qb8= X-Received: by 2002:a2e:6d0a:: with SMTP id i10-v6mr12785590ljc.14.1539630384053; Mon, 15 Oct 2018 12:06:24 -0700 (PDT) MIME-Version: 1.0 References: <20181003171720.169953-1-rkir@google.com> <20181003171720.169953-6-rkir@google.com> <20181015183458.GA28454@kroah.com> <20181015185611.GA5201@kroah.com> In-Reply-To: <20181015185611.GA5201@kroah.com> From: Roman Kiryanov Date: Mon, 15 Oct 2018 12:06:12 -0700 Message-ID: Subject: Re: [PATCH v3 06/15] platform: goldfish: pipe: Move memory allocation from probe to init To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Todd Kjos 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 > > 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. It will be added in "PATCH v3 15/15". There will be two init functions allocating different states. > 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. We have two versions of the driver. Probe asks for the version and calls the init function for this version. I don't want probe to know everything about all versions. > > >, 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. If probe fails I expect the kernel to release all resources. Is this not the case?