Received: by 2002:a05:7208:31d3:b0:81:e143:7c29 with SMTP id v19csp415300rbd; Fri, 5 Apr 2024 08:12:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWT1WguvIPfQERxX1xDgw4w2P+laRUy4l9cTK/4tufv7eiMqOc7qxHJfJwnNQaQS80LMgZx6w5R7MaM+sH90jSWr9hDlbU7VoInhOW/aw== X-Google-Smtp-Source: AGHT+IG/kefF87NQl/mjAminkwSbUdypJ2kO3wGBCERMXsq3++KHKXrbNoyj+v1mGtaVhcThtawH X-Received: by 2002:a17:902:cccb:b0:1e0:185d:a73 with SMTP id z11-20020a170902cccb00b001e0185d0a73mr3106162ple.9.1712329978333; Fri, 05 Apr 2024 08:12:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712329978; cv=pass; d=google.com; s=arc-20160816; b=awwAdP6d6ff0VO0B4t3k5OfxwAZuVphToBSFIKKrCsqf++seQIs7R3VXFyhXQqFcBX DIfp9gj9qtbWndqt+XLdC3z3VCiVdP193OUSQbTs7A5XqMWBXtsFUHTEM5eENkMSr6VA z7iWB5DlyTrk8WkjkafF0o6nHJ0a4pZUm3wloBwjDzfEznq5Z0Uf2LqbJXxNcvdyRjRn m+gWb4WOzCQkUu+7d+eFwQAl5ZbRiQfa2ixECKZF5gevr0XrURSuKenPLp+oGCsNAFVA HeHvROXyZ+K/YSb6+fJofs6cwGIbvSfwqjYPb81qBNVqidBq/QVN/YmB+/4EjRNjDeeI 45jw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=FXZjchgVJRkLL6nKQXe0Te5bOvqhW9W0R32fvKIVQaw=; fh=oMfl6pDP2ruRUWkp284xpP2VmgiygSeQSayjQhnL7w0=; b=h7uR+eMdOv9/QqhbA/+l9vkyffNvWFMb/3V5rTTI7Hf9E+OQW4DxEv+ZwA3L/QYOn4 GoH3OOBjmhO/rxpPj+FimXft6ClfsP4PLUy06GhjK4WHNkz0r7YxlbjsqeqJSm2sZmoO n4mv4lRPZPfZ1WCiKmCmvT8accYjV3fEYGYhZIj9Sq85b9HvJu1YO4Hum/zmeEmNRg/P SXw3N3jv/vF3ZDNbODyfDgXopHXwQsh3ZA8y2pTYOJ7XTkUnF23q1pFcRXh4MrgTB1KR StOqU2yREhACOn5g58jZfTEc8jMcA7gcMoCg3iBXX2rEYYE0/5bbriM+OqT8C1T4NA+J xyKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YfGaSh3Z; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-133221-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133221-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 4-20020a170902ee4400b001e21db5dbb4si1460058plo.6.2024.04.05.08.12.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 08:12:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133221-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=@intel.com header.s=Intel header.b=YfGaSh3Z; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-133221-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133221-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 05D58286136 for ; Fri, 5 Apr 2024 15:12:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 76FEA16F84B; Fri, 5 Apr 2024 15:12:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YfGaSh3Z" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 3F4A816D331; Fri, 5 Apr 2024 15:12:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712329971; cv=none; b=KXbGSN0X6zgzRxI3H1NAJW+NNIePre2rqucNH5BhvDt6D14VzJU30oGu4eoTgZVSkyhPp5dhttokIMVFAG/AHQTu/TLFzOp/49w7SuwPsQsaaayApM2wo2EKzO6jE9jHvoKhK7+iuIK+STTeQTBA9Jotmei0eP/mffGRVdaquiI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712329971; c=relaxed/simple; bh=JIVzB8EAS0X1yVhPxr3X0yBglPfuin2m7XG+z2ewpMI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BkT4JAKyGLHQQXupQUZoOTdnOzvlYfHic3tE9jwLEnpg1fgZRHUVCXgaEkcRQX/1NkAhIzpeIk9Ugc6mIl3AbzDcQJbbzu3OOCYL+0H4Nqzu35+NwT1ORk0nf3py/J2/SEBeQGcn01RCMQNLy7o+/XR2h+30YnX6moM5F7KQJtQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YfGaSh3Z; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712329970; x=1743865970; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=JIVzB8EAS0X1yVhPxr3X0yBglPfuin2m7XG+z2ewpMI=; b=YfGaSh3ZzQm0vrnVbF2HDG54o6T7MpGIxutAMYqSikYD39C6T9of8ZK1 EyhBYLLdjLX2ByIFteh0hjH3jS1yEuTY2WHXdMPp/pr8TbrKkJuTZPsRW LZiE5k0EpIYWuQmGMdAOoXhk8mTZ7OIQ2ySs8G6P1d87QdVtagYxTz986 ee8cNTySYOOJpsFYqxsIqHcpQ7qITey82XKOGwEMcX2/SB9LK5JOtdElM +kt0+c0Bmp3+q2ETiapn1yPh+yzRi4xDSMy8+xmWPv/0MhZXhTvhUhPsU KU2jL9XdGAyoVvk12Jwkc/tLqqNciwlKkZA5Gt/UZi7kXVuVvY9cJJp9u w==; X-CSE-ConnectionGUID: L+rRlzjMQpevZJW/y6aZiw== X-CSE-MsgGUID: olQf0ZgyRZ2Fl5bMV+fuHg== X-IronPort-AV: E=McAfee;i="6600,9927,11035"; a="19096788" X-IronPort-AV: E=Sophos;i="6.07,181,1708416000"; d="scan'208";a="19096788" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2024 08:12:50 -0700 X-CSE-ConnectionGUID: Fqt99sqcSSq+64XiV2ONnQ== X-CSE-MsgGUID: rhmB8fVWQw2CBkZNszo/rA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,181,1708416000"; d="scan'208";a="19120656" Received: from kmoorman-mobl.amr.corp.intel.com (HELO [10.212.57.192]) ([10.212.57.192]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2024 08:12:49 -0700 Message-ID: <19f21879-885c-4120-9411-7022f526426f@linux.intel.com> Date: Fri, 5 Apr 2024 10:12:48 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 6/7] soundwire: debugfs: add interface to read/write commands To: Vinod Koul , Bard Liao Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, bard.liao@intel.com References: <20240326090122.1051806-1-yung-chuan.liao@linux.intel.com> <20240326090122.1051806-7-yung-chuan.liao@linux.intel.com> Content-Language: en-US From: Pierre-Louis Bossart In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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? 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.