Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4629145pxb; Tue, 5 Oct 2021 07:10:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGXKHCV0lxaY0K9bkaVRc9iZbJz4fMN/I/2hkj3po9tEgQkVyWoZ6OEJU8LjVM592gURe7 X-Received: by 2002:a63:3705:: with SMTP id e5mr16243098pga.307.1633443004936; Tue, 05 Oct 2021 07:10:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633443004; cv=none; d=google.com; s=arc-20160816; b=nmnZ8BKBFN7faxFmEtieKv02bxmWU0917rpC9JM1Us/PajwJUZ2vxCBE5Isc3WQuR+ m5Y92VgcklkD6G1Qzxu2frU7j4vTc/J+LQnQMKPd9tpHSQgE1Mqr1j/jc8UQE7qySpT1 R5Denp1K4ITC+IFZGMtVcn5fgNG4dx9620yMY7tjJEnfxiFFmCmRrIRzTuS+/OSwr8aZ HO+5bPPhMBwWwpFfkafTvP64lNyeO/kOoYDUdg86aKKUk5EFut14TdUyPqBii70zywob L+XekDx9xgzaV6qal9EB9F5tBs9SZLnOrqdOhEV0SH5sWj7FqDxc7M3YDA4zYPu1auoC /5vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+q/eYkCyI0gSzKnXK3sqtdy5NTaw7cTSwC9sFoxdSvY=; b=vhgAsc3db76SQwee9h/N8qS0pGRn7sdpLnk2e1hzs02cJAqDY8PCqvibCMQYdmWmW7 lBS2k8yYeK15MDzbBmIYMlCJAICZJtRLMbGqgUbrU+6Q67dEGt0eXqCApQAr9TJH+f4s VBdx49v2/yvPYQJ2vbxSAg/Ulcrc63ghZKsC1odS8oeInGaQOMe3qTTLakuL894I5/m4 LRzWh4oVyFTKN2k3yy+ZgTOT10BV/9kAvK72igVWrxycUdvcAYFgAJjWz7UWcv7Hap60 gxZeud6qJHdX+osxSF+X7CZAB68xsD7MaGeVVNQzVMkANjejaxqSB85xi+A+uIahM5RC 6KLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hhvWtXGK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si3288558pli.413.2021.10.05.07.09.45; Tue, 05 Oct 2021 07:10:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hhvWtXGK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235598AbhJEOJm (ORCPT + 99 others); Tue, 5 Oct 2021 10:09:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:44358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236315AbhJEOJA (ORCPT ); Tue, 5 Oct 2021 10:09:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 421FA6115B; Tue, 5 Oct 2021 14:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633442828; bh=cnL/sf+hUo4gm74iG3lE21vurF1Az8bAampwQ7TaiAc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hhvWtXGKLs/EcIil4Qn1gria7uNWcxsINfw0mkwTdbaeLFIdI7kHGp/ZuY+UMZG7l TKTCwk17ziUxoS7W6ULVtfbtH4Bs3pxlc+CrDShWqjpmleZ48sZdWrqjbFUF3xfF4C LWE+Ph7lAO/Zc4QP+OlmfUNR0KT/n03HPGO8SOUI= Date: Tue, 5 Oct 2021 16:07:06 +0200 From: Greg Kroah-Hartman To: Nikita Yushchenko Cc: Lee Jones , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Christian Gromm Subject: Re: [PATCH] staging: most: dim2: fix device registration Message-ID: References: <20210929205619.2800-1-nikita.yoush@cogentembedded.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 05, 2021 at 03:49:09PM +0200, Greg Kroah-Hartman wrote: > On Tue, Oct 05, 2021 at 04:33:02PM +0300, Nikita Yushchenko wrote: > > > > Commit 723de0f9171e ("staging: most: remove device from interface > > > > structure") moved registration of driver-provided struct device to > > > > the most subsystem, but did not properly update dim2 driver to > > > > work with that change. > > > > > > > > After most subsystem passes driver's dev to register_device(), it > > > > becomes refcounted, and can be only deallocated in the release method. > > > > Provide that by: > > > > - not using devres to allocate the device, > > > > - moving shutdown actions from _remove() to the device release method, > > > > - not calling shutdown actions in _probe() after the device becomes > > > > refcounted. > > > > > > Should this be 3 patches? > > > > But these three items are deeply interconnected, and fix the issue together. > > Must not manually free device structure passed to register_device(), thus > > must not allocate via devres (because otherwise, devres will free it). Once > > not using devres for it, must deallocate it somehow else, thus must rework > > the release paths. > > Ok, but that was obvious. That was *not* obvious.