lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZBLeLq/JSE8wLeUC@corigine.com>
Date:   Thu, 16 Mar 2023 10:15:26 +0100
From:   Simon Horman <simon.horman@...igine.com>
To:     Markus Schneider-Pargmann <msp@...libre.com>
Cc:     Marc Kleine-Budde <mkl@...gutronix.de>,
        Chandrasekar Ramakrishnan <rcsekar@...sung.com>,
        Wolfgang Grandegger <wg@...ndegger.com>,
        Vincent MAILHOL <mailhol.vincent@...adoo.fr>,
        linux-can@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 04/16] can: m_can: Disable unused interrupts

On Wed, Mar 15, 2023 at 12:05:34PM +0100, Markus Schneider-Pargmann wrote:
> There are a number of interrupts that are not used by the driver at the
> moment. Disable all of these.
> 
> Signed-off-by: Markus Schneider-Pargmann <msp@...libre.com>



> ---
>  drivers/net/can/m_can/m_can.c | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index 5274d9642566..e7aceeba3759 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -1261,6 +1261,7 @@ static int m_can_set_bittiming(struct net_device *dev)
>  static int m_can_chip_config(struct net_device *dev)
>  {
>  	struct m_can_classdev *cdev = netdev_priv(dev);
> +	u32 interrupts = IR_ALL_INT;
>  	u32 cccr, test;
>  	int err;
>  
> @@ -1270,6 +1271,11 @@ static int m_can_chip_config(struct net_device *dev)
>  		return err;
>  	}
>  
> +	/* Disable unused interrupts */
> +	interrupts &= ~(IR_ARA | IR_ELO | IR_DRX | IR_TEFF | IR_TEFW | IR_TFE |
> +			IR_TCF | IR_HPM | IR_RF1F | IR_RF1W | IR_RF1N |
> +			IR_RF0F | IR_RF0W);
> +
>  	m_can_config_endisable(cdev, true);
>  
>  	/* RX Buffer/FIFO Element Size 64 bytes data field */
> @@ -1364,15 +1370,13 @@ static int m_can_chip_config(struct net_device *dev)
>  	m_can_write(cdev, M_CAN_TEST, test);
>  
>  	/* Enable interrupts */
> -	if (!(cdev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING))
> +	if (!(cdev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)) {
>  		if (cdev->version == 30)
> -			m_can_write(cdev, M_CAN_IE, IR_ALL_INT &
> -				    ~(IR_ERR_LEC_30X));
> +			interrupts &= ~(IR_ERR_LEC_30X);
>  		else
> -			m_can_write(cdev, M_CAN_IE, IR_ALL_INT &
> -				    ~(IR_ERR_LEC_31X));
> -	else
> -		m_can_write(cdev, M_CAN_IE, IR_ALL_INT);
> +			interrupts &= ~(IR_ERR_LEC_31X);
> +	}
> +	m_can_write(cdev, M_CAN_IE, interrupts);

This now enables interrupts outside the if condition.
Which was also the case prior to patch 3/16.
Perhaps it makes sense to merge patches 3/16 and 4/16?

Perhaps not :)

Regardless,

Reviewed-by: Simon Horman <simon.horman@...igine.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ