* [PATCH 0/3] bus: fsl-mc: minor updates
@ 2021-02-08 17:09 Ioana Ciornei
2021-02-08 17:09 ` [PATCH 1/3] bus: fsl-mc: Fix test for end of loop Ioana Ciornei
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Ioana Ciornei @ 2021-02-08 17:09 UTC (permalink / raw)
To: gregkh; +Cc: laurentiu.tudor, linux-kernel, Ioana Ciornei
From: Ioana Ciornei <ioana.ciornei@nxp.com>
This patch set adds a fix on the userspace support of the fsl-mc bus.
Other than that, a missing device type is added and some other commands
to the list of the accepted ones.
Dan Carpenter (1):
bus: fsl-mc: Fix test for end of loop
Ioana Ciornei (2):
bus: fsl-mc: add the dpdbg device type
bus: fsl-mc: list more commands as accepted through the ioctl
drivers/bus/fsl-mc/fsl-mc-bus.c | 6 ++++
drivers/bus/fsl-mc/fsl-mc-uapi.c | 52 +++++++++++++++++++++++++++++++-
2 files changed, 57 insertions(+), 1 deletion(-)
--
2.30.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] bus: fsl-mc: Fix test for end of loop
2021-02-08 17:09 [PATCH 0/3] bus: fsl-mc: minor updates Ioana Ciornei
@ 2021-02-08 17:09 ` Ioana Ciornei
2021-02-08 18:58 ` Dan Carpenter
2021-02-08 17:09 ` [PATCH 2/3] bus: fsl-mc: add the dpdbg device type Ioana Ciornei
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Ioana Ciornei @ 2021-02-08 17:09 UTC (permalink / raw)
To: gregkh; +Cc: laurentiu.tudor, linux-kernel, Dan Carpenter, Ioana Ciornei
From: Dan Carpenter <dan.carpenter@oracle.com>
The "desc" pointer can't possibly be NULL here. If we can't find the
correct "desc" then tt points to the last element of the
fsl_mc_accepted_cmds[] array. Fix this by testing if
"i == FSL_MC_NUM_ACCEPTED_CMDS" instead.
Fixes: 2cf1e703f066 ("bus: fsl-mc: add fsl-mc userspace support")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/bus/fsl-mc/fsl-mc-uapi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bus/fsl-mc/fsl-mc-uapi.c b/drivers/bus/fsl-mc/fsl-mc-uapi.c
index eeb988c9f4bb..bdcd9d983a78 100644
--- a/drivers/bus/fsl-mc/fsl-mc-uapi.c
+++ b/drivers/bus/fsl-mc/fsl-mc-uapi.c
@@ -338,7 +338,7 @@ static int fsl_mc_command_check(struct fsl_mc_device *mc_dev,
if ((cmdid & desc->cmdid_mask) == desc->cmdid_value)
break;
}
- if (!desc) {
+ if (i == FSL_MC_NUM_ACCEPTED_CMDS) {
dev_err(&mc_dev->dev, "MC command 0x%04x: cmdid not accepted\n", cmdid);
return -EACCES;
}
--
2.30.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] bus: fsl-mc: add the dpdbg device type
2021-02-08 17:09 [PATCH 0/3] bus: fsl-mc: minor updates Ioana Ciornei
2021-02-08 17:09 ` [PATCH 1/3] bus: fsl-mc: Fix test for end of loop Ioana Ciornei
@ 2021-02-08 17:09 ` Ioana Ciornei
2021-02-08 17:09 ` [PATCH 3/3] bus: fsl-mc: list more commands as accepted through the ioctl Ioana Ciornei
2021-02-08 18:26 ` [PATCH 0/3] bus: fsl-mc: minor updates Laurentiu Tudor
3 siblings, 0 replies; 7+ messages in thread
From: Ioana Ciornei @ 2021-02-08 17:09 UTC (permalink / raw)
To: gregkh; +Cc: laurentiu.tudor, linux-kernel, Ioana Ciornei
From: Ioana Ciornei <ioana.ciornei@nxp.com>
A new object type was recently added in MC. This has to be added in the
fsl-mc bus device type list so that it can be properly listed.
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
drivers/bus/fsl-mc/fsl-mc-bus.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index 70f4b69556f5..0c8bf020ba43 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -388,6 +388,11 @@ struct device_type fsl_mc_bus_dpdmai_type = {
};
EXPORT_SYMBOL_GPL(fsl_mc_bus_dpdmai_type);
+struct device_type fsl_mc_bus_dpdbg_type = {
+ .name = "fsl_mc_bus_dpdbg"
+};
+EXPORT_SYMBOL_GPL(fsl_mc_bus_dpdbg_type);
+
static struct device_type *fsl_mc_get_device_type(const char *type)
{
static const struct {
@@ -409,6 +414,7 @@ static struct device_type *fsl_mc_get_device_type(const char *type)
{ &fsl_mc_bus_dpaiop_type, "dpaiop" },
{ &fsl_mc_bus_dpci_type, "dpci" },
{ &fsl_mc_bus_dpdmai_type, "dpdmai" },
+ { &fsl_mc_bus_dpdbg_type, "dpdbg" },
{ NULL, NULL }
};
int i;
--
2.30.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] bus: fsl-mc: list more commands as accepted through the ioctl
2021-02-08 17:09 [PATCH 0/3] bus: fsl-mc: minor updates Ioana Ciornei
2021-02-08 17:09 ` [PATCH 1/3] bus: fsl-mc: Fix test for end of loop Ioana Ciornei
2021-02-08 17:09 ` [PATCH 2/3] bus: fsl-mc: add the dpdbg device type Ioana Ciornei
@ 2021-02-08 17:09 ` Ioana Ciornei
2021-02-08 18:26 ` [PATCH 0/3] bus: fsl-mc: minor updates Laurentiu Tudor
3 siblings, 0 replies; 7+ messages in thread
From: Ioana Ciornei @ 2021-02-08 17:09 UTC (permalink / raw)
To: gregkh; +Cc: laurentiu.tudor, linux-kernel, Ioana Ciornei
From: Ioana Ciornei <ioana.ciornei@nxp.com>
Add some new MC firmware commands that can be received through the
userspace ioctl interface - *get_max_frame_length and *_get_counter.
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
drivers/bus/fsl-mc/fsl-mc-uapi.c | 50 ++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/drivers/bus/fsl-mc/fsl-mc-uapi.c b/drivers/bus/fsl-mc/fsl-mc-uapi.c
index bdcd9d983a78..9c4c1395fcdb 100644
--- a/drivers/bus/fsl-mc/fsl-mc-uapi.c
+++ b/drivers/bus/fsl-mc/fsl-mc-uapi.c
@@ -60,6 +60,13 @@ enum fsl_mc_cmd_index {
DPNI_GET_PRIM_MAC,
DPNI_GET_STATISTICS,
DPNI_GET_LINK_STATE,
+ DPNI_GET_MAX_FRAME_LENGTH,
+ DPSW_GET_TAILDROP,
+ DPSW_SET_TAILDROP,
+ DPSW_IF_GET_COUNTER,
+ DPSW_IF_GET_MAX_FRAME_LENGTH,
+ DPDMUX_GET_COUNTER,
+ DPDMUX_IF_GET_MAX_FRAME_LENGTH,
GET_ATTR,
GET_IRQ_MASK,
GET_IRQ_STATUS,
@@ -261,6 +268,49 @@ static struct fsl_mc_cmd_desc fsl_mc_accepted_cmds[] = {
.token = true,
.size = 8,
},
+ [DPNI_GET_MAX_FRAME_LENGTH] = {
+ .cmdid_value = 0x2170,
+ .cmdid_mask = 0xFFF0,
+ .token = true,
+ .size = 8,
+ },
+ [DPSW_GET_TAILDROP] = {
+ .cmdid_value = 0x0A80,
+ .cmdid_mask = 0xFFF0,
+ .token = true,
+ .size = 14,
+ },
+ [DPSW_SET_TAILDROP] = {
+ .cmdid_value = 0x0A90,
+ .cmdid_mask = 0xFFF0,
+ .token = true,
+ .size = 24,
+ .flags = FSL_MC_CAP_NET_ADMIN_NEEDED,
+ },
+ [DPSW_IF_GET_COUNTER] = {
+ .cmdid_value = 0x0340,
+ .cmdid_mask = 0xFFF0,
+ .token = true,
+ .size = 11,
+ },
+ [DPSW_IF_GET_MAX_FRAME_LENGTH] = {
+ .cmdid_value = 0x0450,
+ .cmdid_mask = 0xFFF0,
+ .token = true,
+ .size = 10,
+ },
+ [DPDMUX_GET_COUNTER] = {
+ .cmdid_value = 0x0b20,
+ .cmdid_mask = 0xFFF0,
+ .token = true,
+ .size = 11,
+ },
+ [DPDMUX_IF_GET_MAX_FRAME_LENGTH] = {
+ .cmdid_value = 0x0a20,
+ .cmdid_mask = 0xFFF0,
+ .token = true,
+ .size = 10,
+ },
[GET_ATTR] = {
.cmdid_value = 0x0040,
.cmdid_mask = 0xFFF0,
--
2.30.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] bus: fsl-mc: minor updates
2021-02-08 17:09 [PATCH 0/3] bus: fsl-mc: minor updates Ioana Ciornei
` (2 preceding siblings ...)
2021-02-08 17:09 ` [PATCH 3/3] bus: fsl-mc: list more commands as accepted through the ioctl Ioana Ciornei
@ 2021-02-08 18:26 ` Laurentiu Tudor
3 siblings, 0 replies; 7+ messages in thread
From: Laurentiu Tudor @ 2021-02-08 18:26 UTC (permalink / raw)
To: Ioana Ciornei, gregkh; +Cc: linux-kernel, Ioana Ciornei
On 2/8/2021 7:09 PM, Ioana Ciornei wrote:
> From: Ioana Ciornei <ioana.ciornei@nxp.com>
>
> This patch set adds a fix on the userspace support of the fsl-mc bus.
> Other than that, a missing device type is added and some other commands
> to the list of the accepted ones.
>
> Dan Carpenter (1):
> bus: fsl-mc: Fix test for end of loop
>
> Ioana Ciornei (2):
> bus: fsl-mc: add the dpdbg device type
> bus: fsl-mc: list more commands as accepted through the ioctl
>
> drivers/bus/fsl-mc/fsl-mc-bus.c | 6 ++++
> drivers/bus/fsl-mc/fsl-mc-uapi.c | 52 +++++++++++++++++++++++++++++++-
> 2 files changed, 57 insertions(+), 1 deletion(-)
>
For the series:
Acked-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
---
Best Regards, Laurentiu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] bus: fsl-mc: Fix test for end of loop
2021-02-08 17:09 ` [PATCH 1/3] bus: fsl-mc: Fix test for end of loop Ioana Ciornei
@ 2021-02-08 18:58 ` Dan Carpenter
2021-02-09 9:17 ` Ioana Ciornei
0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2021-02-08 18:58 UTC (permalink / raw)
To: Ioana Ciornei; +Cc: gregkh, laurentiu.tudor, linux-kernel, Ioana Ciornei
On Mon, Feb 08, 2021 at 07:09:47PM +0200, Ioana Ciornei wrote:
> From: Dan Carpenter <dan.carpenter@oracle.com>
>
> The "desc" pointer can't possibly be NULL here. If we can't find the
> correct "desc" then tt points to the last element of the
> fsl_mc_accepted_cmds[] array. Fix this by testing if
> "i == FSL_MC_NUM_ACCEPTED_CMDS" instead.
>
> Fixes: 2cf1e703f066 ("bus: fsl-mc: add fsl-mc userspace support")
> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Generally the tags are expected to go in chronological order:
Fixes: commit
Signed-off-by: Author
Acked-by: Whoever
Signed-off-by: Maintainer
regards,
dan carpenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] bus: fsl-mc: Fix test for end of loop
2021-02-08 18:58 ` Dan Carpenter
@ 2021-02-09 9:17 ` Ioana Ciornei
0 siblings, 0 replies; 7+ messages in thread
From: Ioana Ciornei @ 2021-02-09 9:17 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Ioana Ciornei, gregkh, Laurentiu Tudor, linux-kernel
On Mon, Feb 08, 2021 at 09:58:10PM +0300, Dan Carpenter wrote:
> On Mon, Feb 08, 2021 at 07:09:47PM +0200, Ioana Ciornei wrote:
> > From: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > The "desc" pointer can't possibly be NULL here. If we can't find the
> > correct "desc" then tt points to the last element of the
> > fsl_mc_accepted_cmds[] array. Fix this by testing if
> > "i == FSL_MC_NUM_ACCEPTED_CMDS" instead.
> >
> > Fixes: 2cf1e703f066 ("bus: fsl-mc: add fsl-mc userspace support")
> > Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Generally the tags are expected to go in chronological order:
>
> Fixes: commit
> Signed-off-by: Author
> Acked-by: Whoever
> Signed-off-by: Maintainer
>
Thanks! I didn't know that.
Ioana
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-02-09 9:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 17:09 [PATCH 0/3] bus: fsl-mc: minor updates Ioana Ciornei
2021-02-08 17:09 ` [PATCH 1/3] bus: fsl-mc: Fix test for end of loop Ioana Ciornei
2021-02-08 18:58 ` Dan Carpenter
2021-02-09 9:17 ` Ioana Ciornei
2021-02-08 17:09 ` [PATCH 2/3] bus: fsl-mc: add the dpdbg device type Ioana Ciornei
2021-02-08 17:09 ` [PATCH 3/3] bus: fsl-mc: list more commands as accepted through the ioctl Ioana Ciornei
2021-02-08 18:26 ` [PATCH 0/3] bus: fsl-mc: minor updates Laurentiu Tudor
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).