From: Vinod Koul <vkoul@kernel.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: linux-sound@vger.kernel.org, alsa-devel@alsa-project.org,
tiwai@suse.de, broonie@kernel.org, vinod.koul@intel.com,
Bard liao <yung-chuan.liao@linux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
srinivas.kandagatla@linaro.org,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
vijendar.mukunda@amd.com,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
Shuming Fan <shumingf@realtek.com>, Jack Yu <jack.yu@realtek.com>,
Oder Chiou <oder_chiou@realtek.com>
Subject: Re: [RFC PATCH 09/16] soundwire: crc8: add constant table
Date: Thu, 21 Dec 2023 20:12:05 +0530 [thread overview]
Message-ID: <ZYROvUA7RrqQknlM@matsya> (raw)
In-Reply-To: <121b44fb-9d2f-4e1f-beca-a54b16d7e13c@linux.intel.com>
On 18-12-23, 14:26, Pierre-Louis Bossart wrote:
>
>
> On 12/18/23 06:01, Vinod Koul wrote:
> > On 07-12-23, 16:29, Pierre-Louis Bossart wrote:
> >> Add the lookup table required by crc8(). All configuration values were
> >> directly table from the MIPI SoundWire 1.x specification.
> >>
> >> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> >> ---
> >> drivers/soundwire/Makefile | 4 +-
> >> drivers/soundwire/crc8.c | 277 +++++++++++++++++++++++++++++++++++++
> >> drivers/soundwire/crc8.h | 11 ++
> >> 3 files changed, 291 insertions(+), 1 deletion(-)
> >> create mode 100644 drivers/soundwire/crc8.c
> >> create mode 100644 drivers/soundwire/crc8.h
> >>
> >> diff --git a/drivers/soundwire/Makefile b/drivers/soundwire/Makefile
> >> index 657f5888a77b..170128dd9318 100644
> >> --- a/drivers/soundwire/Makefile
> >> +++ b/drivers/soundwire/Makefile
> >> @@ -5,7 +5,9 @@
> >>
> >> #Bus Objs
> >> soundwire-bus-y := bus_type.o bus.o master.o slave.o mipi_disco.o stream.o \
> >> - sysfs_slave.o sysfs_slave_dpn.o
> >> + sysfs_slave.o sysfs_slave_dpn.o \
> >> + crc8.o
> >> +
> >> obj-$(CONFIG_SOUNDWIRE) += soundwire-bus.o
> >>
> >> soundwire-generic-allocation-objs := generic_bandwidth_allocation.o
> >> diff --git a/drivers/soundwire/crc8.c b/drivers/soundwire/crc8.c
> >> new file mode 100644
> >> index 000000000000..b6b984d7f39a
> >> --- /dev/null
> >> +++ b/drivers/soundwire/crc8.c
> >> @@ -0,0 +1,277 @@
> >> +// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
> >> +// Copyright(c) 2024 Intel Corporation.
> >> +
> >> +#include <linux/crc8.h>
> >> +#include <linux/module.h>
> >> +#include "crc8.h"
> >> +
> >> +/*
> >> + * the MIPI SoundWire CRC8 polynomial is X^8 + X^6 + X^3 + X^2 + 1, MSB first
> >> + * The value is (1)01001101 = 0x4D
> >> + *
> >> + * the table below was generated with
> >> + *
> >> + * u8 crc8_lookup_table[CRC8_TABLE_SIZE];
> >> + * crc8_populate_msb(crc8_lookup_table, SDW_CRC8_POLY);
> >
> > Good that you found this API, so next question would be why should we
> > have this static table in kernel and not generate on probe if bpt is
> > supported..? Many subsystems use these APIs to generate the tables..
>
> The table is going to be the same for all hosts, it's simpler if
> everyone uses a constant table, no? We're talking about 256 bytes added
> for the common bus parts, be it with dynamically allocated memory or a
> static table.
>
> I don't mind reverting to a dynamically allocated table populated at
> boot if that was the consensus.
Most of the kernel users I looked have dynamically allocated table
populated at boot, also out of many users how many would support BTP.?
Your older platforms, current qcom dont, so not point is adding for
everyone...
--
~Vinod
next prev parent reply other threads:[~2023-12-21 14:42 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 22:29 [RFC PATCH 00/16] soundwire/ASoC: speed-up downloads with BTP/BRA protocol Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 01/16] Documentation: driver: add SoundWire BRA description Pierre-Louis Bossart
2023-12-07 23:29 ` Mark Brown
2023-12-08 0:56 ` Pierre-Louis Bossart
2023-12-08 21:49 ` Mark Brown
2023-12-19 16:50 ` Pierre-Louis Bossart
2023-12-19 16:53 ` Mark Brown
2023-12-19 17:08 ` Pierre-Louis Bossart
2023-12-20 15:16 ` Charles Keepax
2023-12-20 18:26 ` Pierre-Louis Bossart
2023-12-20 18:28 ` Mark Brown
2023-12-21 9:46 ` Charles Keepax
2024-08-20 7:48 ` Pierre-Louis Bossart
2024-08-20 11:53 ` Mark Brown
2024-08-20 14:58 ` Pierre-Louis Bossart
2024-08-20 15:09 ` Mark Brown
2023-12-08 16:27 ` Charles Keepax
2023-12-08 18:45 ` Pierre-Louis Bossart
2023-12-08 18:55 ` Mark Brown
2023-12-18 11:40 ` Vinod Koul
2023-12-18 12:58 ` Pierre-Louis Bossart
2023-12-18 14:29 ` Charles Keepax
2023-12-18 16:33 ` Pierre-Louis Bossart
2023-12-21 14:45 ` Vinod Koul
2023-12-21 14:44 ` Vinod Koul
2023-12-21 14:44 ` Vinod Koul
2023-12-07 22:29 ` [RFC PATCH 02/16] soundwire: cadence: add BTP support for DP0 Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 03/16] soundwire: stream: extend sdw_alloc_stream() to take 'type' parameter Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 04/16] soundwire: extend sdw_stream_type to BPT Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 05/16] soundwire: stream: special-case the bus compute_params() routine Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 06/16] soundwire: stream: reuse existing code for BPT stream Pierre-Louis Bossart
2023-12-12 12:30 ` Charles Keepax
2023-12-18 10:45 ` Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 07/16] soundwire: bus: add API for BPT protocol Pierre-Louis Bossart
2023-12-12 12:19 ` Charles Keepax
2023-12-18 10:38 ` Pierre-Louis Bossart
2023-12-18 11:54 ` Vinod Koul
2023-12-18 13:12 ` Pierre-Louis Bossart
2023-12-18 14:57 ` Charles Keepax
2023-12-18 16:44 ` Pierre-Louis Bossart
2023-12-21 14:49 ` Vinod Koul
2023-12-07 22:29 ` [RFC PATCH 08/16] soundwire: bus: add bpt_stream pointer Pierre-Louis Bossart
2023-12-18 11:55 ` Vinod Koul
2023-12-18 13:20 ` Pierre-Louis Bossart
2023-12-21 14:39 ` Vinod Koul
2023-12-21 17:09 ` Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 09/16] soundwire: crc8: add constant table Pierre-Louis Bossart
2023-12-18 12:01 ` Vinod Koul
2023-12-18 13:26 ` Pierre-Louis Bossart
2023-12-21 14:42 ` Vinod Koul [this message]
2023-12-21 17:15 ` Pierre-Louis Bossart
2023-12-21 17:21 ` Vinod Koul
2023-12-07 22:29 ` [RFC PATCH 10/16] soundwire: cadence: add BTP/BRA helpers to format data Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 11/16] soundwire: intel_auxdevice: add indirection for BPT open/close/send_async/wait Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 12/16] ASoC: SOF: Intel: hda-sdw-bpt: add helpers for SoundWire BPT DMA Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 13/16] soundwire: intel: add BPT context definition Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 14/16] soundwire: intel_ace2x: add BPT open/close/send_async/wait Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 15/16] soundwire: debugfs: add interface for BPT/BRA transfers Pierre-Louis Bossart
2023-12-07 22:29 ` [RFC PATCH 16/16] ASoC: rt711-sdca: add DP0 support Pierre-Louis Bossart
2023-12-07 22:56 ` [RFC PATCH 00/16] soundwire/ASoC: speed-up downloads with BTP/BRA protocol Mark Brown
2023-12-07 23:06 ` Pierre-Louis Bossart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZYROvUA7RrqQknlM@matsya \
--to=vkoul@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=jack.yu@realtek.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-sound@vger.kernel.org \
--cc=oder_chiou@realtek.com \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=rf@opensource.cirrus.com \
--cc=shumingf@realtek.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.de \
--cc=vijendar.mukunda@amd.com \
--cc=vinod.koul@intel.com \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox