Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp276691lqg; Thu, 11 Apr 2024 02:29:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkiVH/bAr4AfCL/knIl7tPAABRavuJEnV5UB5GuZyNhu1CihVcYs7dDHkSn0s8XSKU+Tkh/0apygATTC9cSyVk09cYcjY11BAt7Yvfdg== X-Google-Smtp-Source: AGHT+IFpKs0p7CqMKmn7mMn9xGKVZcRUAA7iNs15HfLeCBNJc27ociYno+p1jX5ceBDFUUOTyo7A X-Received: by 2002:a05:6a00:4c06:b0:6ed:cd4c:cc37 with SMTP id ea6-20020a056a004c0600b006edcd4ccc37mr3195749pfb.17.1712827744205; Thu, 11 Apr 2024 02:29:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712827744; cv=pass; d=google.com; s=arc-20160816; b=F3L10fI9GE7szT4SIxxosjQGqOEKNP8wg6cHWUEZ1JBkPV/yGKdyzZZu7vdolefTOI oTeA2VSsic4T6RhZ3j3vs7avmBA1JZ3XA4XEh3zEjpD+uFlndjIgGpRR64wE5DbiAziP JmvdketB7ZZg2iwnI1sHF1C6neV9ZaHcJ9r+eW1gIrJ0ou0hsl+EM0NN3GINcXkO4XZY AeMbJK8KZvuxr+WiYkFQHx8pXsByQRTorKc+2pCghgOrVTSIcJP1DKrn/SLZT9Af/wx1 7eq04XkL7PhYOutwVMsrwuuG/L7YAJNPhgyGeZaS0oIC4nRn+lwdjz960YAr4jkeql/E BdYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PCijfBhSCi6sjT+DddBzsUzKSO401f724m2rzRWIkiE=; fh=FW9tdg6G61apmFC5iq6N48I3Yh5JlYWEGgyX5f6gi/k=; b=cj8+ZFygYJTXPjPEwPVzoH1JwSS67ngC1gyNV1EB/C9QoToKVLYJeDIK/0BbSHB0FE NtrDMQ2ruOXPLuYiKGQIG2Zrgd1q9hu+aDEnm+lbdrQ+qqY3yohRV2eZ0HWMSpynFIUv +aMZ2biojMH5Dq3zCerfIDsc475hxFJYL/UUrvevT81BM/II4bjkUpUgl9RpPTdboBc6 6l5tZuAQpPW8dTeUJQV53B/rDrkfc69SRUIcpZqYJWGzQgZL4YAZDya5RfOutd5PhzxR W9dJS+M+12tAaHbwvHzJ/NdgIHUxOvJRdesAzKtMOlJGCQqmvgGSglwcLv1++QRZrXt8 zOqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WP+U9tUy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-140175-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140175-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id gx9-20020a056a001e0900b006e6b95a346csi1075560pfb.330.2024.04.11.02.29.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 02:29:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140175-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WP+U9tUy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-140175-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140175-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DE82128732D for ; Thu, 11 Apr 2024 09:29:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0129144D20; Thu, 11 Apr 2024 09:28:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WP+U9tUy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 253B613DDDD; Thu, 11 Apr 2024 09:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712827737; cv=none; b=Zx73wKccsQbIskyKTU0plda4Ano+J69Z+6QjFDt1Z3dJJ8o05PaIY6BJtBrxzIsTt/nt9sgBKfjiUZ5ev6rVXBLdzibRnwMdxpx/VZRfNd5S+t3ukKpH7AxLQjam/ezqA1Ha3AoLVt1ghBQ7985dCgMiGOa015aoKDVTav9XtDc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712827737; c=relaxed/simple; bh=2I1/4qZuQ40nFxqyqIJAUShzzfUDscacEy2/72jyb4Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oOmUjGe7jMeuiIXV37j58TARFw5tt0KHNarfo65ea96vxu3oPb2AHVEinwrbsuenJN7UKO9uaKkL0/tB0qRKajSDYsjuV4GuG732FcgfKNxzubDTNRaV5mwiI2ysUt1l/oFckE5zO1xWWjYP0v52zzzDrCh6YPH0Wy+hm8r2CiI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WP+U9tUy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32392C433C7; Thu, 11 Apr 2024 09:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712827736; bh=2I1/4qZuQ40nFxqyqIJAUShzzfUDscacEy2/72jyb4Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WP+U9tUyFkgpFim5PCThH6Zs7yz+il51IuFchPawYBrBzEaUCUIfps/yhn62DS1lv 1MuYp1UZ5xqR8b/rWRn0vLBlgMX9TMXXq+gvCAh61ZPRnUWJ/Kqk39hh3T3P6z+xWw lOCcDSPuI3GH03dwwzptgrvTt0oWz9/2FGYRSN/HzXf4sOYlQY3WFSfh8rgi+DIdd4 Vpyctb/OmDMeQG8IDiNvP0zXkRuc02lgzo2llSPV7WhkP7ccMTeyvUXv4nXZ+zN9Dt 4uM5QCPzXR9i/4euCSNFBTpZpkeccfvCwU5sHwnZG98b1Tpe9D4atHQ9nXFMFRIwlx nnXWduaJa6Kjw== Date: Thu, 11 Apr 2024 14:58:52 +0530 From: Vinod Koul To: Pierre-Louis Bossart Cc: Bard Liao , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, bard.liao@intel.com Subject: Re: [PATCH 6/7] soundwire: debugfs: add interface to read/write commands Message-ID: References: <20240326090122.1051806-1-yung-chuan.liao@linux.intel.com> <20240326090122.1051806-7-yung-chuan.liao@linux.intel.com> <19f21879-885c-4120-9411-7022f526426f@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19f21879-885c-4120-9411-7022f526426f@linux.intel.com> On 05-04-24, 10:12, Pierre-Louis Bossart wrote: > On 4/5/24 06:45, Vinod Koul wrote: > > On 26-03-24, 09:01, Bard Liao wrote: > >> From: Pierre-Louis Bossart > >> > >> We have an existing debugfs files to read standard registers > >> (DP0/SCP/DPn). > >> > >> This patch provides a more generic interface to ANY set of read/write > >> contiguous registers in a peripheral device. In follow-up patches, > >> this interface will be extended to use BRA transfers. > >> > >> The sequence is to use the following files added under the existing > >> debugsfs directory for each peripheral device: > >> > >> command (write 0, read 1) > >> num_bytes > >> start_address > >> firmware_file (only for writes) > >> read_buffer (only for reads) > >> > >> Example for a read command - this checks the 6 bytes used for > >> enumeration. > >> > >> cd /sys/kernel/debug/soundwire/master-0-0/sdw\:0\:025d\:0711\:01/ > >> echo 1 > command > >> echo 6 > num_bytes > >> echo 0x50 > start_address > >> echo 1 > go > > > > can we have a simpler interface? i am not a big fan of this kind of > > structure for debugging. > > > > How about two files read_bytes and write_bytes where you read/write > > bytes. > > > > echo 0x50 6 > read_bytes > > cat read_bytes > > > > in this format I would like to see addr and values (not need to print > > address /value words (regmap does that too) > > > > For write > > > > echo start_addr N byte0 byte 1 ... byte N > write_bytes > > I think you missed the required extension where we will add a new > 'command_type' to specify which of the regular or BTP/BRA accesses is used. > > Also the bytes can come from a firmware file, it would be very odd to > have a command line with 32k value, wouldn't it? ofc no one should expect that... it should be written directly from the firmware file > I share your concern about making the interface as simple as possible, > but I don't see how it can be made simpler really. We have to specify > - read/write > - access type (BRA or regular) > - start address > - number of bytes > - a firmware file for writes > - a means to see the read data. > > And I personally prefer one 1:1 mapping between setting and debugfs > file, rather than a M:1 mapping that require users to think about the > syntax and which value maps to what setting. At my age I have to define > things that I will remember on the next Monday. Exactly, you won't remember all the files to write to, my idea was a simple format or addr, N and data.. a TLV kind of structure.. What would happen if you issue go, but missed writing one of the files. Also I would expect you to do error checking of inputs... Thanks -- ~Vinod