2020-04-14 22:13:05

by Nicholas Johnson

[permalink] [raw]
Subject: [PATCH v1 0/1] Revert workaround for Thunderbolt nvmem now that write-only nvmem is supported

Hi Mika,

Here is the revert patch you requested in this email:

https://lkml.org/lkml/2020/3/6/17

Kind regards,

Nicholas Johnson

Nicholas Johnson (1):
Revert "thunderbolt: Prevent crash if non-active NVMem file is read"

drivers/thunderbolt/switch.c | 7 -------
1 file changed, 7 deletions(-)

--
2.26.0


2020-04-14 22:13:05

by Nicholas Johnson

[permalink] [raw]
Subject: [PATCH v1 1/1] Revert "thunderbolt: Prevent crash if non-active NVMem file is read"

This reverts commit 03cd45d2e219301880cabc357e3cf478a500080f.

Commit 664f0549380c ("nvmem: core: use is_bin_visible for permissions")
incidentally adds support for write-only nvmem. Hence, this workaround
is no longer required, so drop it.

Signed-off-by: Nicholas Johnson <[email protected]>
---
drivers/thunderbolt/switch.c | 7 -------
1 file changed, 7 deletions(-)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index a2ce99051..1ba4050f6 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -348,12 +348,6 @@ static int tb_switch_nvm_read(void *priv, unsigned int offset, void *val,
return ret;
}

-static int tb_switch_nvm_no_read(void *priv, unsigned int offset, void *val,
- size_t bytes)
-{
- return -EPERM;
-}
-
static int tb_switch_nvm_write(void *priv, unsigned int offset, void *val,
size_t bytes)
{
@@ -399,7 +393,6 @@ static struct nvmem_device *register_nvmem(struct tb_switch *sw, int id,
config.read_only = true;
} else {
config.name = "nvm_non_active";
- config.reg_read = tb_switch_nvm_no_read;
config.reg_write = tb_switch_nvm_write;
config.root_only = true;
}
--
2.26.0

2020-04-16 08:50:34

by Mika Westerberg

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] Revert "thunderbolt: Prevent crash if non-active NVMem file is read"

On Tue, Apr 14, 2020 at 02:04:25AM +0800, Nicholas Johnson wrote:
> This reverts commit 03cd45d2e219301880cabc357e3cf478a500080f.
>
> Commit 664f0549380c ("nvmem: core: use is_bin_visible for permissions")
> incidentally adds support for write-only nvmem. Hence, this workaround
> is no longer required, so drop it.
>
> Signed-off-by: Nicholas Johnson <[email protected]>

Applied, thanks!