diff mbox series

[2/6] net: can: xilinx_can: Fix flags field initialization for axi can and canps

Message ID 1552908766-26753-3-git-send-email-appana.durga.rao@xilinx.com (mailing list archive)
State New, archived
Headers show
Series net: can: xilinx_can: Bug fixes and Enhancements | expand

Commit Message

Appana Durga Kedareswara rao March 18, 2019, 11:32 a.m. UTC
AXI CAN IP and CANPS IP supports tx fifo empty feature, this patch updates
the flags field for the same.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
---
 drivers/net/can/xilinx_can.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Anssi Hannula Oct. 4, 2019, 2:32 p.m. UTC | #1
On 18.3.2019 13.32, Appana Durga Kedareswara rao wrote:
> AXI CAN IP and CANPS IP supports tx fifo empty feature, this patch updates
> the flags field for the same.
>
> Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
> ---
>  drivers/net/can/xilinx_can.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
> index 2de51ac..22569ef 100644
> --- a/drivers/net/can/xilinx_can.c
> +++ b/drivers/net/can/xilinx_can.c
> @@ -1428,6 +1428,7 @@ static const struct dev_pm_ops xcan_dev_pm_ops = {
>  };
>  
>  static const struct xcan_devtype_data xcan_zynq_data = {
> +	.flags = XCAN_FLAG_TXFEMP,
>  	.bittiming_const = &xcan_bittiming_const,
>  	.btr_ts2_shift = XCAN_BTR_TS2_SHIFT,
>  	.btr_sjw_shift = XCAN_BTR_SJW_SHIFT,

Thanks for catching this, this line seemed to have been incorrectly
removed by my 9e5f1b273e ("can: xilinx_can: add support for Xilinx CAN
FD core").

But:

> @@ -1435,6 +1436,7 @@ static const struct xcan_devtype_data xcan_zynq_data = {
>  };
>  
>  static const struct xcan_devtype_data xcan_axi_data = {
> +	.flags = XCAN_FLAG_TXFEMP,
>  	.bittiming_const = &xcan_bittiming_const,
>  	.btr_ts2_shift = XCAN_BTR_TS2_SHIFT,
>  	.btr_sjw_shift = XCAN_BTR_SJW_SHIFT,


Are you sure this is right?
In the documentation [1] there does not seem to be any TXFEMP interrupt,
it would be interrupt bit 14 but AXI CAN 5.0 seems to only go up to 11.

Or maybe it is undocumented or there is a newer version somewhere?

[1]
https://www.xilinx.com/support/documentation/ip_documentation/can/v5_0/pg096-can.pdf
Appana Durga Kedareswara Rao Oct. 9, 2019, 4:01 a.m. UTC | #2
Hi,

<Snip>
> On 18.3.2019 13.32, Appana Durga Kedareswara rao wrote:
> > AXI CAN IP and CANPS IP supports tx fifo empty feature, this patch
> > updates the flags field for the same.
> >
> > Signed-off-by: Appana Durga Kedareswara rao
> > <appana.durga.rao@xilinx.com>
> > ---
> >  drivers/net/can/xilinx_can.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/can/xilinx_can.c
> > b/drivers/net/can/xilinx_can.c index 2de51ac..22569ef 100644
> > --- a/drivers/net/can/xilinx_can.c
> > +++ b/drivers/net/can/xilinx_can.c
> > @@ -1428,6 +1428,7 @@ static const struct dev_pm_ops xcan_dev_pm_ops
> =
> > {  };
> >
> >  static const struct xcan_devtype_data xcan_zynq_data = {
> > +	.flags = XCAN_FLAG_TXFEMP,
> >  	.bittiming_const = &xcan_bittiming_const,
> >  	.btr_ts2_shift = XCAN_BTR_TS2_SHIFT,
> >  	.btr_sjw_shift = XCAN_BTR_SJW_SHIFT,
> 
> Thanks for catching this, this line seemed to have been incorrectly removed by
> my 9e5f1b273e ("can: xilinx_can: add support for Xilinx CAN FD core").
> 
> But:
> 
> > @@ -1435,6 +1436,7 @@ static const struct xcan_devtype_data
> > xcan_zynq_data = {  };
> >
> >  static const struct xcan_devtype_data xcan_axi_data = {
> > +	.flags = XCAN_FLAG_TXFEMP,
> >  	.bittiming_const = &xcan_bittiming_const,
> >  	.btr_ts2_shift = XCAN_BTR_TS2_SHIFT,
> >  	.btr_sjw_shift = XCAN_BTR_SJW_SHIFT,
> 
> 
> Are you sure this is right?
> In the documentation [1] there does not seem to be any TXFEMP interrupt, it
> would be interrupt bit 14 but AXI CAN 5.0 seems to only go up to 11.
> 
> Or maybe it is undocumented or there is a newer version somewhere?

Sorry for the delay in the reply. 
Agree TXFEMP interrupt feature is not supported by the Soft IP CAN.
Since this patch already got applied will send a separate patch to fix this.

Regards,
Kedar.

> 
> [1]
> https://www.xilinx.com/support/documentation/ip_documentation/can/v5_0
> /pg096-can.pdf
> 
> --
> Anssi Hannula / Bitwise Oy
> +358 503803997
Marc Kleine-Budde Oct. 9, 2019, 7:17 a.m. UTC | #3
On 10/9/19 6:01 AM, Appana Durga Kedareswara Rao wrote:
> Hi,
> 
> <Snip>
>> On 18.3.2019 13.32, Appana Durga Kedareswara rao wrote:
>>> AXI CAN IP and CANPS IP supports tx fifo empty feature, this patch
>>> updates the flags field for the same.
>>>
>>> Signed-off-by: Appana Durga Kedareswara rao
>>> <appana.durga.rao@xilinx.com>
>>> ---
>>>  drivers/net/can/xilinx_can.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/net/can/xilinx_can.c
>>> b/drivers/net/can/xilinx_can.c index 2de51ac..22569ef 100644
>>> --- a/drivers/net/can/xilinx_can.c
>>> +++ b/drivers/net/can/xilinx_can.c
>>> @@ -1428,6 +1428,7 @@ static const struct dev_pm_ops xcan_dev_pm_ops
>> =
>>> {  };
>>>
>>>  static const struct xcan_devtype_data xcan_zynq_data = {
>>> +	.flags = XCAN_FLAG_TXFEMP,
>>>  	.bittiming_const = &xcan_bittiming_const,
>>>  	.btr_ts2_shift = XCAN_BTR_TS2_SHIFT,
>>>  	.btr_sjw_shift = XCAN_BTR_SJW_SHIFT,
>>
>> Thanks for catching this, this line seemed to have been incorrectly removed by
>> my 9e5f1b273e ("can: xilinx_can: add support for Xilinx CAN FD core").
>>
>> But:
>>
>>> @@ -1435,6 +1436,7 @@ static const struct xcan_devtype_data
>>> xcan_zynq_data = {  };
>>>
>>>  static const struct xcan_devtype_data xcan_axi_data = {
>>> +	.flags = XCAN_FLAG_TXFEMP,
>>>  	.bittiming_const = &xcan_bittiming_const,
>>>  	.btr_ts2_shift = XCAN_BTR_TS2_SHIFT,
>>>  	.btr_sjw_shift = XCAN_BTR_SJW_SHIFT,
>>
>>
>> Are you sure this is right?
>> In the documentation [1] there does not seem to be any TXFEMP interrupt, it
>> would be interrupt bit 14 but AXI CAN 5.0 seems to only go up to 11.
>>
>> Or maybe it is undocumented or there is a newer version somewhere?
> 
> Sorry for the delay in the reply. 
> Agree TXFEMP interrupt feature is not supported by the Soft IP CAN.
> Since this patch already got applied will send a separate patch to fix this.

Please base your patch on net/master and add the appropriate fixes tag:

Fixes: 3281b380ec9f ("can: xilinx_can: Fix flags field initialization for axi can and canps")

Marc
Appana Durga Kedareswara Rao Oct. 9, 2019, 7:31 a.m. UTC | #4
Hi Marc,

<Snip>
> On 10/9/19 6:01 AM, Appana Durga Kedareswara Rao wrote:
> > Hi,
> >
> > <Snip>
> >> On 18.3.2019 13.32, Appana Durga Kedareswara rao wrote:
> >>> AXI CAN IP and CANPS IP supports tx fifo empty feature, this patch
> >>> updates the flags field for the same.
> >>>
> >>> Signed-off-by: Appana Durga Kedareswara rao
> >>> <appana.durga.rao@xilinx.com>
> >>> ---
> >>>  drivers/net/can/xilinx_can.c | 2 ++
> >>>  1 file changed, 2 insertions(+)
> >>>
> >>> diff --git a/drivers/net/can/xilinx_can.c
> >>> b/drivers/net/can/xilinx_can.c index 2de51ac..22569ef 100644
> >>> --- a/drivers/net/can/xilinx_can.c
> >>> +++ b/drivers/net/can/xilinx_can.c
> >>> @@ -1428,6 +1428,7 @@ static const struct dev_pm_ops
> xcan_dev_pm_ops
> >> =
> >>> {  };
> >>>
> >>>  static const struct xcan_devtype_data xcan_zynq_data = {
> >>> +	.flags = XCAN_FLAG_TXFEMP,
> >>>  	.bittiming_const = &xcan_bittiming_const,
> >>>  	.btr_ts2_shift = XCAN_BTR_TS2_SHIFT,
> >>>  	.btr_sjw_shift = XCAN_BTR_SJW_SHIFT,
> >>
> >> Thanks for catching this, this line seemed to have been incorrectly
> >> removed by my 9e5f1b273e ("can: xilinx_can: add support for Xilinx CAN FD
> core").
> >>
> >> But:
> >>
> >>> @@ -1435,6 +1436,7 @@ static const struct xcan_devtype_data
> >>> xcan_zynq_data = {  };
> >>>
> >>>  static const struct xcan_devtype_data xcan_axi_data = {
> >>> +	.flags = XCAN_FLAG_TXFEMP,
> >>>  	.bittiming_const = &xcan_bittiming_const,
> >>>  	.btr_ts2_shift = XCAN_BTR_TS2_SHIFT,
> >>>  	.btr_sjw_shift = XCAN_BTR_SJW_SHIFT,
> >>
> >>
> >> Are you sure this is right?
> >> In the documentation [1] there does not seem to be any TXFEMP
> >> interrupt, it would be interrupt bit 14 but AXI CAN 5.0 seems to only go up
> to 11.
> >>
> >> Or maybe it is undocumented or there is a newer version somewhere?
> >
> > Sorry for the delay in the reply.
> > Agree TXFEMP interrupt feature is not supported by the Soft IP CAN.
> > Since this patch already got applied will send a separate patch to fix this.
> 
> Please base your patch on net/master and add the appropriate fixes tag:
> 
> Fixes: 3281b380ec9f ("can: xilinx_can: Fix flags field initialization for axi can
> and canps")

Sure Marc will send the patch on top of net/master. 

Regards,
Kedar.

> 
> Marc
> 
> --
> Pengutronix e.K.                  | Marc Kleine-Budde           |
> Industrial Linux Solutions        | Phone: +49-231-2826-924     |
> Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
diff mbox series

Patch

diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 2de51ac..22569ef 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -1428,6 +1428,7 @@  static const struct dev_pm_ops xcan_dev_pm_ops = {
 };
 
 static const struct xcan_devtype_data xcan_zynq_data = {
+	.flags = XCAN_FLAG_TXFEMP,
 	.bittiming_const = &xcan_bittiming_const,
 	.btr_ts2_shift = XCAN_BTR_TS2_SHIFT,
 	.btr_sjw_shift = XCAN_BTR_SJW_SHIFT,
@@ -1435,6 +1436,7 @@  static const struct xcan_devtype_data xcan_zynq_data = {
 };
 
 static const struct xcan_devtype_data xcan_axi_data = {
+	.flags = XCAN_FLAG_TXFEMP,
 	.bittiming_const = &xcan_bittiming_const,
 	.btr_ts2_shift = XCAN_BTR_TS2_SHIFT,
 	.btr_sjw_shift = XCAN_BTR_SJW_SHIFT,