[PATCH v2] mmc: core: optimize mmc_calc_max_discard

2018-02-08 Thread Sergio Valverde
If the max_discard value is zero, the conditional branch that checks the trim capabilities will never update this value with max_trim. Change the condition statement to also check the max_discard value in order to avoid an unnecessary call to mmc_do_calc_max_discard. Signed-off-by: Sergio

[PATCH] mmc: core: optimize mmc_calc_max_discard

2018-02-07 Thread Sergio Valverde
If the max_discard value is zero, the conditional branch that checks the trim capabilities will never update this value with max_trim. Change the condition statement to also check the max_discard value in order to avoid an unnecessary call to mmc_do_calc_max_discard. Signed-off-by: Sergio

[PATCH] Fix race condition in enc28j60 driver

2016-07-01 Thread Sergio Valverde
From: Sergio Valverde The interrupt worker code for the enc28j60 relies only on the TXIF flag to determinate if the packet transmission was completed. However the datasheet specifies in section 12.1.3 that TXERIF will clear the TXRTS after a transmit abort. Also in section 12.1.4 that TXIF will