Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5652551imm; Tue, 16 Oct 2018 13:49:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV63tzjcU3jinVmiRz4GeltrksEh1ekg0dletnURV+40EtX+sWz8ugAq2NuzVyNW+AfHtzZG4 X-Received: by 2002:a63:3cc:: with SMTP id 195-v6mr21766632pgd.262.1539722948157; Tue, 16 Oct 2018 13:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539722948; cv=none; d=google.com; s=arc-20160816; b=hFupw1xUEQIrGpK6xqA3DXKX5V1169VA23W/1aS1ho2EoSMTdTy4xmbNgUXn7OA4Qq sGYT9Hzw+Q8c9ctkp5xfPLLRor/FMLmAUAA3IvJKfVQ0g30XHRqlRCOZfn2om+QXkZCF 2HRIxZKUaKsgev8nmdq6QTM+F7+wIN1A4UlMaH9tZ+940c8rGZP9BKQ025y3RYIXDlAo SJmX5OTtnGVom+vqo9ky82C6JLhFcMQwaxPxU7aO4+iLl8U2lYTKe0IvLPRqS8qU4fRv 0pAoBFVyy70tC49wH12sY2CM3BPbacvAeL9d9Y2gU0PmGe3KtPqokGurXqUhLeya08AT 5MCA== 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=v36tdw5ECNgDycMRV3b45ysJ1bpPZcEEdyba3mPNyOE=; b=zOHHgglc1ZK/1pTOgGnspU7aXreTlcNA1fv1/vpRqHNYwjQomvfILcBRswwkEKAKeO tY45eNFe58PcMPZVLHXJZO1uEaScmbVWqShteSrm+KeqwezxR+PQn/HE4RFdiWDFX8u3 wb0tBVzzEPQXglkP+qCcD8HSydiqJ2YMyF8YuykkpwFnWeI/7SzCRSyXiMF2CX6rsI4E UrS+b0TK+4cB4zC3tvqK+z22AVIC4G3NWTlx5MyYe9xvdDmZXx/WjV4rzpV5q5QRRTYj wn2GLt11N7bj4LzdTCS7KOp9TG03HrgSdR0r6LPyUvGnb3G5NAMiW977dyYiwUJU8GYa oE7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=l47tQaLg; 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 k185-v6si15370651pgk.183.2018.10.16.13.48.52; Tue, 16 Oct 2018 13:49:08 -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=l47tQaLg; 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 S1726964AbeJQEkl (ORCPT + 99 others); Wed, 17 Oct 2018 00:40:41 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:45644 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726048AbeJQEkk (ORCPT ); Wed, 17 Oct 2018 00:40:40 -0400 Received: by mail-lf1-f68.google.com with SMTP id v22-v6so6272142lfe.12 for ; Tue, 16 Oct 2018 13:48:29 -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=v36tdw5ECNgDycMRV3b45ysJ1bpPZcEEdyba3mPNyOE=; b=l47tQaLgv+oyWieiYBoZgP6oFNVpNQPQoevG1sUS2YuSbxgeAohURoh4lj3kTXUxxM duImo+LAZffzBv1/MYIVsTfpVSmJSf4ZY8zC1z13gvbcAVPI8RoSl5+rhV+28Mz1Ft6J CdJAcwOxGo0h2kCohKm1WY4egQUdp4MFpBd/msn36UgkOahklTaWOk4e1/Epa3TU7EQi zl0NuVMJ2fWypxWgtVpmGkcBzryOnRVft3aN/FclPL+mDnVeR70TddxgWI6cVIxI5oKr AIiNh9MmmoaCCxM7myfmCOs93GPidLqgW5urKvjFp2Dh0zHCZ0rKMKii9pKXa5wlxG8x +rug== 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=v36tdw5ECNgDycMRV3b45ysJ1bpPZcEEdyba3mPNyOE=; b=RkjbPsSKsJfWEv/jQbMJdRI0MnJ3GVBhHnmWJMm+LRoMvmB8r6gpu6e9qbvlIzAh7J 7n8Fk70ujv0Xv8+5B69nBH9gNydvQJjWgItlkFVOrRB+qxmYjDAfN7V+FFplHgd4E7TX DdYMjaD6SNypiQsJ9nA5eJUs29wDg9CrFOMb7DcoA+h549qv8W2GGkWAQnuRJNmbZovI aS0D3xU+erGL5OEqAks+QHuvV0d2Kt6VCNhl6JT1uasMH/aozXIRiVLwCg2s/NqTvi7G AsVPNFWItKdavp/fTJ8mpVu0ZlkX8ztVmxctSH7VWX98G6snQtbAvlEjWYohns8m6mM3 zhSg== X-Gm-Message-State: ABuFfoil6R648ozEyF9bwN3QfaDAICNbspRVcCLPRV+ykeng++eL8XST Q1ImfP3n8NSpEAUP0EM7X/73KEN0rvgc+8eExQ/O8g== X-Received: by 2002:a19:5f57:: with SMTP id a23-v6mr8834749lfj.28.1539722908540; Tue, 16 Oct 2018 13:48:28 -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> <20181016062721.GA882@kroah.com> In-Reply-To: <20181016062721.GA882@kroah.com> From: Roman Kiryanov Date: Tue, 16 Oct 2018 13:48:16 -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 > I think we are getting our terms confused here. > > "init" usually means module_init(), is that what you are referring to > here? This is just a function that probe calls to, goldfish_pipe_device_v2_init. https://android.googlesource.com/kernel/goldfish/+/android-goldfish-4.14-dev/drivers/platform/goldfish/goldfish_pipe_v2.c#1128 > Why would your probe function know, or care, about versions? Different driver versions allocate different state. > How is your probe function learning about the "version" to use here? writel(PIPE_DRIVER_VERSION, base + PIPE_V2_REG_VERSION); version = readl(base + PIPE_V2_REG_VERSION); https://android.googlesource.com/kernel/goldfish/+/android-goldfish-4.14-dev/drivers/platform/goldfish/goldfish_pipe.c#106 > You have to clean up after your probe function failing before you return > from it. Are you saying that devm_kzalloc does not free memory if probe fails? Is this useful? I can free memory myself then.