linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary
@ 2016-03-04  6:07 Ed Spiridonov
  2016-03-04  7:52 ` Marc Kleine-Budde
  0 siblings, 1 reply; 5+ messages in thread
From: Ed Spiridonov @ 2016-03-04  6:07 UTC (permalink / raw)
  To: mkl; +Cc: linux-can, celston, chripell, sbabic, Ed Spiridonov

Only two bits (RX0OVR and RX1OVR) are writable in EFLG, write is useless if these bits aren't set.

Signed-off-by: Ed Spiridonov <edo.rus@gmail.com>
---
 drivers/net/can/spi/mcp251x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index 575790e..74a7dfe 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -843,7 +843,7 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
 		if (clear_intf)
 			mcp251x_write_bits(spi, CANINTF, clear_intf, 0x00);
 
-		if (eflag)
+		if (eflag & (EFLG_RX0OVR | EFLG_RX1OVR))
 			mcp251x_write_bits(spi, EFLG, eflag, 0x00);
 
 		/* Update can state */
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary
  2016-03-04  6:07 [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary Ed Spiridonov
@ 2016-03-04  7:52 ` Marc Kleine-Budde
  0 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2016-03-04  7:52 UTC (permalink / raw)
  To: Ed Spiridonov; +Cc: linux-can, celston, chripell, sbabic


[-- Attachment #1.1: Type: text/plain, Size: 515 bytes --]

On 03/04/2016 07:07 AM, Ed Spiridonov wrote:
> Only two bits (RX0OVR and RX1OVR) are writable in EFLG, write is useless if these bits aren't set.
> 
> Signed-off-by: Ed Spiridonov <edo.rus@gmail.com>

Added to can.

Thanks,
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   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* pull-request: can 2016-03-04
@ 2016-03-04  7:55 Marc Kleine-Budde
  2016-03-04  7:55 ` [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary Marc Kleine-Budde
  2016-03-04 19:33 ` pull-request: can 2016-03-04 David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2016-03-04  7:55 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-can, kernel

Hello David,

this is a pull request for net/master.

There is one patch from Ed Spiridonov, which increases the performance of the
mcp251x SPI CAN driver, by avoiding to write to error flag register if it's
unnecessary.

regards,
Marc

---

The following changes since commit c1bb0a5588816ec26abc08aa9adcf90e32656781:

  be2net: don't enable multicast flag in be_enable_if_filters() routine (2016-03-03 17:18:03 -0500)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-4.5-20160304

for you to fetch changes up to d694b06c42a56c9610861ee0474b4d441af8ada6:

  can: mcp251x: avoid write to error flag register if it's unnecessary (2016-03-04 08:45:17 +0100)

----------------------------------------------------------------
linux-can-fixes-for-4.5-20160304

----------------------------------------------------------------
Ed Spiridonov (1):
      can: mcp251x: avoid write to error flag register if it's unnecessary

 drivers/net/can/spi/mcp251x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary
  2016-03-04  7:55 pull-request: can 2016-03-04 Marc Kleine-Budde
@ 2016-03-04  7:55 ` Marc Kleine-Budde
  2016-03-04 19:33 ` pull-request: can 2016-03-04 David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2016-03-04  7:55 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-can, kernel, Ed Spiridonov, Marc Kleine-Budde

From: Ed Spiridonov <edo.rus@gmail.com>

Only two bits (RX0OVR and RX1OVR) are writable in EFLG, write is useless
if these bits aren't set.

Signed-off-by: Ed Spiridonov <edo.rus@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/spi/mcp251x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index 575790e8a75a..74a7dfecee27 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -843,7 +843,7 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
 		if (clear_intf)
 			mcp251x_write_bits(spi, CANINTF, clear_intf, 0x00);
 
-		if (eflag)
+		if (eflag & (EFLG_RX0OVR | EFLG_RX1OVR))
 			mcp251x_write_bits(spi, EFLG, eflag, 0x00);
 
 		/* Update can state */
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: pull-request: can 2016-03-04
  2016-03-04  7:55 pull-request: can 2016-03-04 Marc Kleine-Budde
  2016-03-04  7:55 ` [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary Marc Kleine-Budde
@ 2016-03-04 19:33 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2016-03-04 19:33 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can, kernel

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri,  4 Mar 2016 08:55:54 +0100

> Hello David,
> 
> this is a pull request for net/master.
> 
> There is one patch from Ed Spiridonov, which increases the performance of the
> mcp251x SPI CAN driver, by avoiding to write to error flag register if it's
> unnecessary.

Pulled, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-04 19:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-04  7:55 pull-request: can 2016-03-04 Marc Kleine-Budde
2016-03-04  7:55 ` [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary Marc Kleine-Budde
2016-03-04 19:33 ` pull-request: can 2016-03-04 David Miller
  -- strict thread matches above, loose matches on Subject: below --
2016-03-04  6:07 [PATCH] can: mcp251x: avoid write to error flag register if it's unnecessary Ed Spiridonov
2016-03-04  7:52 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).