summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTimo Alho <talho@nvidia.com>2018-10-22 16:19:38 +0300
committerThierry Reding <treding@nvidia.com>2018-11-08 12:49:26 +0100
commit2b86c11b99d3fc4e82af65c5b00b4334a6dfe6c9 (patch)
tree6082deabd840e5c6c5f908b4e194c9f8f0e79869 /drivers
parent43dc7485807a8ffde12e242e557a1992478de4de (diff)
downloadlinux-2b86c11b99d3fc4e82af65c5b00b4334a6dfe6c9.tar.gz
linux-2b86c11b99d3fc4e82af65c5b00b4334a6dfe6c9.tar.bz2
linux-2b86c11b99d3fc4e82af65c5b00b4334a6dfe6c9.zip
firmware: tegra: Print version tag at full
Last two characters of the version tag that is 32 bytes long were stripped out. Signed-off-by: Timo Alho <talho@nvidia.com> Acked-by: Sivaram Nair <sivaramn@nvidia.com> Acked-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firmware/tegra/bpmp.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c
index 90c6089fed84..191f8a91c466 100644
--- a/drivers/firmware/tegra/bpmp.c
+++ b/drivers/firmware/tegra/bpmp.c
@@ -28,6 +28,7 @@
#define MSG_ACK BIT(0)
#define MSG_RING BIT(1)
+#define TAG_SZ 32
static inline struct tegra_bpmp *
mbox_client_to_bpmp(struct mbox_client *client)
@@ -556,7 +557,10 @@ static int tegra_bpmp_get_firmware_tag(struct tegra_bpmp *bpmp, char *tag,
void *virt;
int err;
- virt = dma_alloc_coherent(bpmp->dev, MSG_DATA_MIN_SZ, &phys,
+ if (size != TAG_SZ)
+ return -EINVAL;
+
+ virt = dma_alloc_coherent(bpmp->dev, TAG_SZ, &phys,
GFP_KERNEL | GFP_DMA32);
if (!virt)
return -ENOMEM;
@@ -574,9 +578,9 @@ static int tegra_bpmp_get_firmware_tag(struct tegra_bpmp *bpmp, char *tag,
local_irq_restore(flags);
if (err == 0)
- strlcpy(tag, virt, size);
+ memcpy(tag, virt, TAG_SZ);
- dma_free_coherent(bpmp->dev, MSG_DATA_MIN_SZ, virt, phys);
+ dma_free_coherent(bpmp->dev, TAG_SZ, virt, phys);
return err;
}
@@ -689,7 +693,7 @@ static int tegra_bpmp_probe(struct platform_device *pdev)
{
struct tegra_bpmp *bpmp;
unsigned int i;
- char tag[32];
+ char tag[TAG_SZ];
size_t size;
int err;
@@ -817,13 +821,13 @@ static int tegra_bpmp_probe(struct platform_device *pdev)
goto free_mrq;
}
- err = tegra_bpmp_get_firmware_tag(bpmp, tag, sizeof(tag) - 1);
+ err = tegra_bpmp_get_firmware_tag(bpmp, tag, sizeof(tag));
if (err < 0) {
dev_err(&pdev->dev, "failed to get firmware tag: %d\n", err);
goto free_mrq;
}
- dev_info(&pdev->dev, "firmware: %s\n", tag);
+ dev_info(&pdev->dev, "firmware: %.*s\n", (int)sizeof(tag), tag);
platform_set_drvdata(pdev, bpmp);