Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5654397ybi; Wed, 31 Jul 2019 01:06:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHiQi5JeRdj48NC6joUH8BpdBonVghWzEKhC5lTjYoWNgI1UBlwbxmXeOqRz+TYHGdo/OH X-Received: by 2002:a17:902:54d:: with SMTP id 71mr116388366plf.140.1564560372378; Wed, 31 Jul 2019 01:06:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564560372; cv=none; d=google.com; s=arc-20160816; b=Qb7cWSH3vFMMA0iBOEv7itrFhGI/DbETsW6D9q/cZZ8Q0pOLDK9w2rYrQPPPx6ZpMa MRynHHfiL0PkrlSXtV6RjHuvBmZnTMrjJ5NtnBYadI+o3qTV2zscCV57scFPJZ0S4NgE QL9K87fTPr473KodtM2BWjmN55CzWJykI8Ncu22KHGW3krwLG3IUgD+d7nIMWFbUXiW6 JP2Cxm+l84H8gPtqY7ybGOFGhMK+ygRrbbsIb7eI1th9+eMKbIlXHDl6/ID0i775wTzZ 0DBpyKbIyGVLik1wjVdqT1PL4CMahc+zmHxmr8iflKVhwKsRSG9rWHFHdhGJUZXK6Ho+ oBXg== 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=iQoo/3Gx2EEiQL/F/oE5WOjxkza6YDCbYqBVhCONHIo=; b=Fi108GFLa28ogWZ7Y9WcmcbYXghVoaXH/u1YI7t7Y+8vd6OcWTY3XIktcxXFLghFGc /KR9tbopEdLqMEAv95mjcxgrlscqzXHTsXLV6ari/vXJXsB2G+FDS8PhpZMKZLi60ug9 z21tUIy3fhl5Wbkx+kN1l9j4hnHq6jSWbjnDtLCIuThiD2sYm7voHJTkGKcjgDWNjy7y F/NQtfwFUXQYj2NVA7Qta+2O8ugsF3+4CqW2JEWwC/9Fvz4WopALVbEDMX5SHDDq4E7g ZAPi6B40Q4ZB29CAnaHtYL5Uhb4O74RLW9cgXCqEDmsFsfYRen2Uq865o5Ws+JF9tFVj Eivg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=CeLUn4vb; 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=NONE sp=NONE dis=NONE) header.from=opensource.cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k13si31166307pgj.525.2019.07.31.01.05.57; Wed, 31 Jul 2019 01:06:12 -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=@cirrus.com header.s=PODMain02222019 header.b=CeLUn4vb; 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=NONE sp=NONE dis=NONE) header.from=opensource.cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726232AbfGaIFJ (ORCPT + 99 others); Wed, 31 Jul 2019 04:05:09 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:57626 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbfGaIFJ (ORCPT ); Wed, 31 Jul 2019 04:05:09 -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 x6V80Yw8014879; Wed, 31 Jul 2019 03:03:33 -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=iQoo/3Gx2EEiQL/F/oE5WOjxkza6YDCbYqBVhCONHIo=; b=CeLUn4vbGznXh0XIvlePWeW6sr0yWHp+5oKz98Y1JvpBACVGENhJyWux5WQiDU5O9d2e TqspA7VHmxeN7gilJ2OQXKLHDGbHXtZMkAcn2p71NfPLSWNDC0zK/OZk/0pTo8CnkwU0 2FHlgnhTeUBUEyyG6YZFcDFuegBh2rtthbczBtuXmP904LriQzKngwSNEn+2ffnfhpJZ 5ltD68RzypoB2qAaIMNsSy71GmNzFt4TiXTRYIgP25VZgvWjvOBcGeTBk4q4XQc9Ac2L TNbUEZonQVIWfenh21kAH+owpGF4WrtCP0fqxduHAKMssuE2UtLAniqcSnUWZJgDwI1p Zg== Authentication-Results: ppops.net; spf=fail smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0b-001ae601.pphosted.com with ESMTP id 2u0k1qww6p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 31 Jul 2019 03:03:33 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Wed, 31 Jul 2019 09:03:31 +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.1591.10 via Frontend Transport; Wed, 31 Jul 2019 09:03:31 +0100 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 942FE45; Wed, 31 Jul 2019 09:03:31 +0100 (BST) Date: Wed, 31 Jul 2019 09:03:31 +0100 From: Charles Keepax To: Thomas Preston CC: Mark Brown , Mark Rutland , , , Kuninori Morimoto , Kirill Marinushkin , Liam Girdwood , Marco Felsch , Annaliese McDermond , Takashi Iwai , Paul Cercueil , Vinod Koul , Rob Herring , Srinivas Kandagatla , Jerome Brunet , , Cheng-Yi Chiang Subject: Re: [alsa-devel] [PATCH v2 3/3] ASoC: TDA7802: Add turn-on diagnostic routine Message-ID: <20190731080331.GJ54126@ediswmail.ad.cirrus.com> References: <20190730120937.16271-1-thomas.preston@codethink.co.uk> <20190730120937.16271-4-thomas.preston@codethink.co.uk> <20190730141935.GF4264@sirena.org.uk> <45156592-a90f-b4f8-4d30-9631c03f1280@codethink.co.uk> <20190730155027.GJ4264@sirena.org.uk> <9b47a360-3b62-b968-b8d5-8639dc4b468d@codethink.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <9b47a360-3b62-b968-b8d5-8639dc4b468d@codethink.co.uk> 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 -all X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1907310085 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 30, 2019 at 05:28:11PM +0100, Thomas Preston wrote: > On 30/07/2019 16:50, Mark Brown wrote: > > On Tue, Jul 30, 2019 at 04:25:56PM +0100, Thomas Preston wrote: > >> On 30/07/2019 15:19, Mark Brown wrote: > > > >>> It is unclear what this mutex usefully protects, it only gets taken when > >>> writing to the debugfs file to trigger this diagnostic mode but doesn't > >>> do anything to control interactions with any other code path in the > >>> driver. > > > >> If another process reads the debugfs node "diagnostic" while the turn-on > >> diagnostic mode is running, this mutex prevents the second process > >> restarting the diagnostics. > > > >> This is redundant if debugfs reads are atomic, but I don't think they are. > > > > Like I say it's not just debugfs though, there's the standard driver > > interface too. > > > > Ah right, I understand. So if we run the turn-on diagnostics routine, there's > nothing stopping anyone from interacting with the device in other ways. > > I guess there's no way to share that mutex with ALSA? In that case, it doesn't > matter if this mutex is there or not - this feature is incompatible. How > compatible do debugfs interfaces have to be? I was under the impression anything > goes. I would argue that the debugfs is better off for having the mutex so > that no one re-reads "diagnostic" within the 5s poll timeout. > > Alternatively, this diagnostic feature could be handled with an external-handler > kcontrol SOC_SINGLE_EXT? I'm not sure if this is an atomic interface either. > > What would be acceptable? You could take the DAPM mutex in your debugfs handler that would prevent any changes to the cards power state whilst your debug stuff is running. Thanks, Charles