Message ID | 20201007213159.1959308-15-mkl@pengutronix.de (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | pull-request: can-next 2020-10-07 | expand |
> -----Original Message----- > From: Marc Kleine-Budde <mkl@pengutronix.de> > Sent: 2020年10月8日 5:32 > To: netdev@vger.kernel.org > Cc: davem@davemloft.net; linux-can@vger.kernel.org; > kernel@pengutronix.de; Marc Kleine-Budde <mkl@pengutronix.de>; Joakim > Zhang <qiangqing.zhang@nxp.com> > Subject: [PATCH 14/17] can: flexcan: remove ack_grp and ack_bit handling from > driver > > Since commit: > > 048e3a34a2e7 can: flexcan: poll MCR_LPM_ACK instead of GPR ACK for > stop mode acknowledgment > > the driver polls the IP core's internal bit MCR[LPM_ACK] as stop mode > acknowledge and not the acknowledgment on chip level. > > This means the 4th and 5th value of the property "fsl,stop-mode" isn't used > anymore. This patch removes the used "ack_gpr" and "ack_bit" from the > driver. > > Link: > https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flore.kern > el.org%2Fr%2F20201006203748.1750156-15-mkl%40pengutronix.de&dat > a=02%7C01%7Cqiangqing.zhang%40nxp.com%7C1540ad5bf7bd4a1e10a508d8 > 6b087a67%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637377031 > 436785787&sdata=ierIIVdSqZFLklIvgMokHX6LU77cEWQgUGzUi6CHdDI% > 3D&reserved=0 > Fixes: 048e3a34a2e7 ("can: flexcan: poll MCR_LPM_ACK instead of GPR ACK > for stop mode acknowledgment") > Cc: Joakim Zhang <qiangqing.zhang@nxp.com> > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> [...] > /* stop mode property format is: > - * <&gpr req_gpr req_bit ack_gpr ack_bit>. > + * <&gpr req_gpr>. Hi Marc, Sorry for response delay, stop mode property format should be "<&gpr req_gpr req_bit>", I saw this code change has went into linux-next, so I will correct it by the way next time when I upsteam wakeup function for i.MX8. Need I update stop mode property in dts file? Although this function won't be broken without dts update. Best Regards, Joakim Zhang
On 10/14/20 10:53 AM, Joakim Zhang wrote: >> Since commit: >> >> 048e3a34a2e7 can: flexcan: poll MCR_LPM_ACK instead of GPR ACK for >> stop mode acknowledgment >> >> the driver polls the IP core's internal bit MCR[LPM_ACK] as stop mode >> acknowledge and not the acknowledgment on chip level. >> >> This means the 4th and 5th value of the property "fsl,stop-mode" isn't used >> anymore. This patch removes the used "ack_gpr" and "ack_bit" from the >> driver. >> >> Link: >> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flore.kern >> el.org%2Fr%2F20201006203748.1750156-15-mkl%40pengutronix.de&dat >> a=02%7C01%7Cqiangqing.zhang%40nxp.com%7C1540ad5bf7bd4a1e10a508d8 >> 6b087a67%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637377031 >> 436785787&sdata=ierIIVdSqZFLklIvgMokHX6LU77cEWQgUGzUi6CHdDI% >> 3D&reserved=0 >> Fixes: 048e3a34a2e7 ("can: flexcan: poll MCR_LPM_ACK instead of GPR ACK >> for stop mode acknowledgment") >> Cc: Joakim Zhang <qiangqing.zhang@nxp.com> >> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> > > [...] >> /* stop mode property format is: >> - * <&gpr req_gpr req_bit ack_gpr ack_bit>. >> + * <&gpr req_gpr>. > > Hi Marc, > > Sorry for response delay, stop mode property format should be "<&gpr req_gpr > req_bit>", I saw this code change has went into linux-next, so I will correct > it by the way next time when I upsteam wakeup function for i.MX8. Doh! I wrongly deleted "req_bit" in the comment, but the code should be all right. I'll add that back. > Need I update stop mode property in dts file? Although this function won't be > broken without dts update. Yes, you can send patches to update the dts (after net-next was merged to linus). Marc
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index fbdd9a8c9374..4d594e977497 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -333,8 +333,6 @@ struct flexcan_stop_mode { struct regmap *gpr; u8 req_gpr; u8 req_bit; - u8 ack_gpr; - u8 ack_bit; }; struct flexcan_priv { @@ -1847,14 +1845,14 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev) struct device_node *gpr_np; struct flexcan_priv *priv; phandle phandle; - u32 out_val[5]; + u32 out_val[3]; int ret; if (!np) return -EINVAL; /* stop mode property format is: - * <&gpr req_gpr req_bit ack_gpr ack_bit>. + * <&gpr req_gpr>. */ ret = of_property_read_u32_array(np, "fsl,stop-mode", out_val, ARRAY_SIZE(out_val)); @@ -1880,13 +1878,10 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev) priv->stm.req_gpr = out_val[1]; priv->stm.req_bit = out_val[2]; - priv->stm.ack_gpr = out_val[3]; - priv->stm.ack_bit = out_val[4]; dev_dbg(&pdev->dev, - "gpr %s req_gpr=0x02%x req_bit=%u ack_gpr=0x02%x ack_bit=%u\n", - gpr_np->full_name, priv->stm.req_gpr, priv->stm.req_bit, - priv->stm.ack_gpr, priv->stm.ack_bit); + "gpr %s req_gpr=0x02%x req_bit=%u\n", + gpr_np->full_name, priv->stm.req_gpr, priv->stm.req_bit); device_set_wakeup_capable(&pdev->dev, true);
Since commit: 048e3a34a2e7 can: flexcan: poll MCR_LPM_ACK instead of GPR ACK for stop mode acknowledgment the driver polls the IP core's internal bit MCR[LPM_ACK] as stop mode acknowledge and not the acknowledgment on chip level. This means the 4th and 5th value of the property "fsl,stop-mode" isn't used anymore. This patch removes the used "ack_gpr" and "ack_bit" from the driver. Link: http://lore.kernel.org/r/20201006203748.1750156-15-mkl@pengutronix.de Fixes: 048e3a34a2e7 ("can: flexcan: poll MCR_LPM_ACK instead of GPR ACK for stop mode acknowledgment") Cc: Joakim Zhang <qiangqing.zhang@nxp.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> --- drivers/net/can/flexcan.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)