From: Krzysztof Kozlowski <krzk@kernel.org>
To: Albert Yang <yangzh0906@thundersoft.com>,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
gordon.ge@bst.ai, catalin.marinas@arm.com,
geert.uytterhoeven@gmail.com, will@kernel.org,
ulf.hansson@linaro.org, adrian.hunter@intel.com, arnd@arndb.de
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-mmc@vger.kernel.org, soc@lists.linux.dev,
bst-upstream@bstai.top, neil.armstrong@linaro.org,
jonathan.cameron@huawei.com, bigfoot@classfun.cn,
kever.yang@rock-chips.com, mani@kernel.org,
geert+renesas@glider.be, andersson@kernel.org, nm@ti.com,
nfraprado@collabora.com, quic_tdas@quicinc.com,
ebiggers@google.com, victor.shih@genesyslogic.com.tw,
shanchun1218@gmail.com, ben.chuang@genesyslogic.com.tw
Subject: Re: [PATCH v2 5/8] mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
Date: Wed, 2 Jul 2025 12:47:40 +0200 [thread overview]
Message-ID: <2559f035-787e-4c80-8889-d1826a27171b@kernel.org> (raw)
In-Reply-To: <20250702094444.3523973-6-yangzh0906@thundersoft.com>
On 02/07/2025 11:44, Albert Yang wrote:
> Add a driver for the DesignWare Mobile Storage Host Controller (DWCMSHC)
> SDHCI controller found in Black Sesame Technologies C1200 SoCs.
>
> The driver provides specialized clock configuration, tuning, voltage
> switching, and power management for the BST DWCMSHC controller. It also
> includes support for eMMC boot and memory-mapped I/O for CRM registers.
>
Missing SoB.
...
> +
> +static int bst_sdhci_reallocate_bounce_buffer(struct sdhci_host *host)
> +{
> + struct mmc_host *mmc = host->mmc;
> + unsigned int max_blocks;
> + unsigned int bounce_size;
> + int ret;
> +
> + /*
> + * Cap the bounce buffer at 64KB. Using a bigger bounce buffer
> + * has diminishing returns, this is probably because SD/MMC
> + * cards are usually optimized to handle this size of requests.
> + */
> + bounce_size = SZ_32K;
> + /*
> + * Adjust downwards to maximum request size if this is less
> + * than our segment size, else hammer down the maximum
> + * request size to the maximum buffer size.
> + */
> + if (mmc->max_req_size < bounce_size)
> + bounce_size = mmc->max_req_size;
> + max_blocks = bounce_size / 512;
> +
> + ret = of_reserved_mem_device_init_by_idx(mmc_dev(mmc), mmc_dev(mmc)->of_node, 0);
> + if (ret) {
> + dev_err(mmc_dev(mmc), "Failed to initialize reserved memory\n");
> + return ret;
> + }
> +
> + host->bounce_buffer = dma_alloc_coherent(mmc_dev(mmc), bounce_size,
> + &host->bounce_addr, GFP_KERNEL);
> + if (!host->bounce_buffer)
> + return -ENOMEM;
> +
> + host->bounce_buffer_size = bounce_size;
> +
> + /* Lie about this since we're bouncing */
> + mmc->max_segs = max_blocks;
> + mmc->max_seg_size = bounce_size;
> + mmc->max_req_size = bounce_size;
> +
> + dev_info(mmc_dev(mmc), "BST reallocate %s bounce up to %u segments into one, max segment size %u bytes\n",
> + mmc_hostname(mmc), max_blocks, bounce_size);
Devices are supposed to be silent on success.
> +
...
> +/**
> + * dwcmshc_remove - Platform driver remove
> + * @pdev: Platform device
> + *
> + * Removes the SDHCI host controller.
> + *
> + * Return: 0 on success
> + */
Drop all such fake comments, not helpful. We all now what is the purpose
of the function and saying that platform driver remove callback is
"platform driver remove" which "Removes the SDHCI host controller." is
not only redundant, but actually harming because later you have:
"Return: 0 on success"
which is impossible.
Such redundant comments are not kernel coding style. Provide USEFUL
comments, useful kerneldoc, not something to satisfy line-counters.
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-07-02 10:47 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 8:54 [PATCH v1 0/9] arm64: Introduce Black Sesame Technologies C1200 SoC and CDCU1.0 board Albert Yang
2025-07-02 9:44 ` [PATCH v2 0/8] " Albert Yang
2025-07-02 9:44 ` [PATCH v2 1/8] dt-bindings: vendor-prefixes: Add Black Sesame Technologies Co., Ltd Albert Yang
2025-07-02 10:24 ` Krzysztof Kozlowski
2025-07-03 5:02 ` Albert Yang
2025-07-02 9:44 ` [PATCH v2 2/8] dt-bindings: arm: add Black Sesame Technologies (bst) SoC Albert Yang
2025-07-02 9:44 ` [PATCH v2 3/8] arm64: Kconfig: add ARCH_BST for bst silicons Albert Yang
2025-07-02 12:21 ` Krzysztof Kozlowski
2025-07-02 9:44 ` [PATCH v2 4/8] dt-bindings: mmc: add binding for BST DWCMSHC SDHCI controller Albert Yang
2025-07-02 13:28 ` Rob Herring (Arm)
2025-07-03 4:36 ` Albert Yang
2025-07-02 14:23 ` Rob Herring
2025-07-03 3:27 ` Albert Yang
2025-07-02 9:44 ` [PATCH v2 5/8] mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver Albert Yang
2025-07-02 10:40 ` Arnd Bergmann
2025-07-02 10:47 ` Krzysztof Kozlowski [this message]
2025-07-02 9:44 ` [PATCH v2 6/8] arm64: dts: bst: add support for Black Sesame Technologies C1200 CDCU1.0 board and defconfig Albert Yang
2025-07-02 10:30 ` Krzysztof Kozlowski
2025-07-02 12:31 ` [PATCH v2 6/8] arm64: dts: bst: add support for Black Sesame Technologies C1200 CDCU1.0 board Albert Yang
2025-07-02 14:19 ` Rob Herring
2025-08-12 9:47 ` Albert Yang
2025-08-12 11:01 ` [PATCH v2 6/8] arm64: dts: bst: add support for Black Sesame Technologies C1200 CDCU1.0 board and defconfig Albert Yang
2025-07-02 12:15 ` Robin Murphy
2025-07-02 9:44 ` [PATCH v2 7/8] arm64: defconfig: enable BST C1200 DWCMSHC SDHCI controller Albert Yang
2025-07-02 10:25 ` Krzysztof Kozlowski
2025-07-02 9:44 ` [PATCH v2 8/8] MAINTAINERS: add and consolidate Black Sesame Technologies (BST) ARM SoC support Albert Yang
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=2559f035-787e-4c80-8889-d1826a27171b@kernel.org \
--to=krzk@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=andersson@kernel.org \
--cc=arnd@arndb.de \
--cc=ben.chuang@genesyslogic.com.tw \
--cc=bigfoot@classfun.cn \
--cc=bst-upstream@bstai.top \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=ebiggers@google.com \
--cc=geert+renesas@glider.be \
--cc=geert.uytterhoeven@gmail.com \
--cc=gordon.ge@bst.ai \
--cc=jonathan.cameron@huawei.com \
--cc=kever.yang@rock-chips.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mani@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=nfraprado@collabora.com \
--cc=nm@ti.com \
--cc=quic_tdas@quicinc.com \
--cc=robh@kernel.org \
--cc=shanchun1218@gmail.com \
--cc=soc@lists.linux.dev \
--cc=ulf.hansson@linaro.org \
--cc=victor.shih@genesyslogic.com.tw \
--cc=will@kernel.org \
--cc=yangzh0906@thundersoft.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;
as well as URLs for NNTP newsgroup(s).