Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2327135ybt; Tue, 16 Jun 2020 03:11:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB7KKKtPdxuzmtEg7fswj1IFTKKqlaT9KTaz3OVq+JR7tKfXx2L2fP17BZYQBiqqVroLOk X-Received: by 2002:aa7:da14:: with SMTP id r20mr1868611eds.7.1592302264677; Tue, 16 Jun 2020 03:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592302264; cv=none; d=google.com; s=arc-20160816; b=Tiyd7CbxGpUSvPNxRXtHgoVUtugW2ZQ3D0t/qvA4rkLkH6wSCiIXdamMRMMLp7Vz4P UFmRh9wK6PzKitQpQuC/Xtej6Jz7Az6I4KbqkHeoIgcuMKse9RjW6M3VqCpeyYhUjakF kTQh5mA8HfKFeb3XQ+KGTlLPh3gQMuzhK2xS7TB8cRk1mCfdp6k+YeipAl8CFF40FFyP RzE1sFRlfH+GWpGry1pBG89gdTLgwhMwAvPfWtpSkh1vLzKuwN8AVIDBqHPleuOSWZJo WzyCZb/8zLDhyUZPjfGfTBhFVti5OeDDps6wdg66m1M8ZquW0lvuGbtBOCA/+nt4QjQn HI3g== 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=tk9jIiCR+CkLNCqt8fWMpRjmysyiGl7KNIcLtC8864Y=; b=UGMN6GwSzhpOdC/Xk21vRwFy/9TaY8QUeQu7OuzfLEx201QHNMzh1ugrdrD9mO111X DA1F8vmzGBtFgdZZ7OcupP3KAulyl3T+E5CGspP1RirfrBnh9XIdze6XJBOOX6ydnV60 3dho7h37WtrPUZcTLmWrJ6qHd5rMkKcYW92M1CT3UMBbcSGeOTDGm1+wvdoJoZMVkeCd nCUa1QjSBzzGHjp3qpzeClM/nvwuxNnm4ZIzQw0SAvYf6ekTBGeuu7eUKbI2XXD12Gdq Ycq4t2Dh55JShKi2PeA1QXI09D/2x8P2y2s5FzszknU2ggWMEQ8gaA4OJ2ZJ6dgTPLHP hmDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b="VUSbPo/z"; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k4si10474636ejg.386.2020.06.16.03.10.41; Tue, 16 Jun 2020 03:11: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=@cirrus.com header.s=PODMain02222019 header.b="VUSbPo/z"; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728464AbgFPKG3 (ORCPT + 99 others); Tue, 16 Jun 2020 06:06:29 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:25326 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728445AbgFPKG3 (ORCPT ); Tue, 16 Jun 2020 06:06:29 -0400 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05GA1OM0004360; Tue, 16 Jun 2020 05:06:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=PODMain02222019; bh=tk9jIiCR+CkLNCqt8fWMpRjmysyiGl7KNIcLtC8864Y=; b=VUSbPo/zdy6D2qV2HoDWpQdtTWg/ODmpMod4OOB/VpBKNVoa5Beo2QVAWBgrXz99yhaB 7oc1tgM+cTIaqmgppWXolYL+Jk1VCwiY/ATfQp7tVUvyBB+9VGQs4MvSXlfJC0tv3Bi0 hCmCvrDumGeMLOH4UazLCkeroindyGLG1HIgNVvd9N9gzo3x7C0spmf26t6tDVaTYRwP UjCl0ETB/rz+PYU56pgAfSauDdFaFzZK9lGobBQRhZQ1QD9etnLciLnIlM9kVKVRI+wu tq4fRsMiJkX7pe7O6uY2YS0/w5RsTHEJIqcE0zI37+LuP0eaDVZ60cdBWQmCekdliW7n Yg== Authentication-Results: ppops.net; spf=fail smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from ediex01.ad.cirrus.com ([87.246.76.36]) by mx0b-001ae601.pphosted.com with ESMTP id 31mu7p46cv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 16 Jun 2020 05:06:27 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Tue, 16 Jun 2020 11:06:25 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Tue, 16 Jun 2020 11:06:25 +0100 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id DA6722C5; Tue, 16 Jun 2020 10:06:25 +0000 (UTC) Date: Tue, 16 Jun 2020 10:06:25 +0000 From: Charles Keepax To: Lee Jones CC: , Subject: Re: [PATCH v2 1/2] mfd: mfd-core: Add mechanism for removal of a subset of children Message-ID: <20200616100625.GT71940@ediswmail.ad.cirrus.com> References: <20200615150722.5249-1-ckeepax@opensource.cirrus.com> <20200616075834.GF2608702@dell> <20200616084748.GS71940@ediswmail.ad.cirrus.com> <20200616091545.GP2608702@dell> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200616091545.GP2608702@dell> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-SPF-Result: fail X-Proofpoint-SPF-Record: v=spf1 include:spf-001ae601.pphosted.com include:spf.protection.outlook.com ip4:5.172.152.52 -all X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 phishscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=727 malwarescore=0 cotscore=-2147483648 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006160075 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 16, 2020 at 10:15:45AM +0100, Lee Jones wrote: > On Tue, 16 Jun 2020, Charles Keepax wrote: > > On Tue, Jun 16, 2020 at 08:58:34AM +0100, Lee Jones wrote: > > > On Mon, 15 Jun 2020, Charles Keepax wrote: > > Does this match how you would expect this to be used? > > No, not at all. > > > I do have some concerns. The code can't use mfd_get_cell since it > > returns a const pointer, although the pointer in platform_device > > isn't const so we access that directly, could update mfd_get_cell? We > > also don't have access to mfd_dev_type outside of the mfd core so > > its hard to check we are actually setting the mfd_cell of actual > > MFD children, I guess just checking for mfd_cell being not NULL is > > good enough? > > Hmmm... looks like I missed the fact that you needed additional > processing between the removal of each batch of devices. My > implementation simply handles the order in which devices are removed > (a bit like initcall()s). > > How about the inclusion of mfd_remove_devices_late(), whereby > mfd_remove_devices() will refuse to remove devices tagged with > MFD_DEP_LEVEL_HIGH. > Yeah this should work fine for my use-case. > Not sure why, but I really dislike the idea of device removal by > arbitrary value/tag, as I see it spawning all sorts of weird and > wonderful implications/hacks/abuse. > Its definitely a spectrum with flexibility covering more use-cases but also definitely opening things up to more abuse. If you are more comfortable with this approach that is fine with me. Would you like me to have a crack at coding it up this way? Or did you want to do a patch? Thanks, Charles