From: Min Li Date: Tue, 24 May 2022 14:45:01 +0000 (-0400) Subject: ptp: ptp_clockmatrix: fix is_single_shot X-Git-Tag: baikal/aarch64/sdk6.1~3836^2~51 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=a0bb2fe83370d5b1f836fbd6dd4474a82ef370e5;p=kernel.git ptp: ptp_clockmatrix: fix is_single_shot is_single_shot should return false for the power_of_2 mask Fixes: 70fabad6828f ("ptp: ptp_clockmatrix: Add PTP_CLK_REQ_EXTTS support") Signed-off-by: Min Li Link: https://lore.kernel.org/r/1653403501-12621-1-git-send-email-min.li.xe@renesas.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c index cb258e1448d55..c9d451bf89e2d 100644 --- a/drivers/ptp/ptp_clockmatrix.c +++ b/drivers/ptp/ptp_clockmatrix.c @@ -267,7 +267,7 @@ static int arm_tod_read_trig_sel_refclk(struct idtcm_channel *channel, u8 ref) static bool is_single_shot(u8 mask) { /* Treat single bit ToD masks as continuous trigger */ - return mask <= 8 && is_power_of_2(mask); + return !(mask <= 8 && is_power_of_2(mask)); } static int idtcm_extts_enable(struct idtcm_channel *channel,