All of lore.kernel.org
 help / color / mirror / Atom feed
* pull-request: can 2018-01-04
@ 2018-01-04 15:33 Marc Kleine-Budde
  2018-01-04 15:33 ` [PATCH 1/4] can: vxcan: improve handling of missing peer name attribute Marc Kleine-Budde
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2018-01-04 15:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-can, kernel

Hello David,

this is a pull request for net/master consisting of 4 patches.

The first patch is by Oliver Hartkopp, it improves the error checking
during the creation of a vxcan link. Wolfgang Grandegger's patch for the
gs_usb driver fixes the return value of the "set_bittiming" callback.
Luu An Phu provides a patch for the flexcan driver to fix the frame
length check in the flexcan_start_xmit() function. The last patch is by
Martin Lederhilger for the ems_usb driver and improves the error
reporting for error warning and passive frames.

regards,
Marc

---

The following changes since commit 820d1d5eba5e0db88432f4b19149d87523ee193c:

  Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue (2018-01-03 13:49:24 -0500)

are available in the Git repository at:

  ssh://git@gitolite.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-4.15-20180104

for you to fetch changes up to 6ebc5e8fe85286c7392f1777a3dba9e1fd6d0253:

  can: ems_usb: improve error reporting for error warning and error passive (2018-01-04 16:14:38 +0100)

----------------------------------------------------------------
linux-can-fixes-for-4.15-20180104

----------------------------------------------------------------
Luu An Phu (1):
      can: flex_can: Correct the checking for frame length in flexcan_start_xmit()

Martin Lederhilger (1):
      can: ems_usb: improve error reporting for error warning and error passive

Oliver Hartkopp (1):
      can: vxcan: improve handling of missing peer name attribute

Wolfgang Grandegger (1):
      can: gs_usb: fix return value of the "set_bittiming" callback

 drivers/net/can/flexcan.c     | 2 +-
 drivers/net/can/usb/ems_usb.c | 1 +
 drivers/net/can/usb/gs_usb.c  | 2 +-
 drivers/net/can/vxcan.c       | 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

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

* [PATCH 1/4] can: vxcan: improve handling of missing peer name attribute
  2018-01-04 15:33 pull-request: can 2018-01-04 Marc Kleine-Budde
@ 2018-01-04 15:33 ` Marc Kleine-Budde
  2018-01-04 15:33 ` [PATCH 2/4] can: gs_usb: fix return value of the "set_bittiming" callback Marc Kleine-Budde
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2018-01-04 15:33 UTC (permalink / raw)
  To: netdev
  Cc: davem, linux-can, kernel, Oliver Hartkopp, Serhey Popovych,
	linux-stable, Marc Kleine-Budde

From: Oliver Hartkopp <socketcan@hartkopp.net>

Picking up the patch from Serhey Popovych (commit 191cdb3822e5df6b3c8,
"veth: Be more robust on network device creation when no attributes").

When the peer name attribute is not provided the former implementation tries
to register the given device name twice ... which leads to -EEXIST.
If only one device name is given apply an automatic generated and valid name
for the peer.

Cc: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/vxcan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/vxcan.c b/drivers/net/can/vxcan.c
index 8404e8852a0f..b4c4a2c76437 100644
--- a/drivers/net/can/vxcan.c
+++ b/drivers/net/can/vxcan.c
@@ -194,7 +194,7 @@ static int vxcan_newlink(struct net *net, struct net_device *dev,
 		tbp = peer_tb;
 	}
 
-	if (tbp[IFLA_IFNAME]) {
+	if (ifmp && tbp[IFLA_IFNAME]) {
 		nla_strlcpy(ifname, tbp[IFLA_IFNAME], IFNAMSIZ);
 		name_assign_type = NET_NAME_USER;
 	} else {
-- 
2.15.1

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

* [PATCH 2/4] can: gs_usb: fix return value of the "set_bittiming" callback
  2018-01-04 15:33 pull-request: can 2018-01-04 Marc Kleine-Budde
  2018-01-04 15:33 ` [PATCH 1/4] can: vxcan: improve handling of missing peer name attribute Marc Kleine-Budde
@ 2018-01-04 15:33 ` Marc Kleine-Budde
  2018-01-04 15:33 ` [PATCH 3/4] can: flex_can: Correct the checking for frame length in flexcan_start_xmit() Marc Kleine-Budde
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2018-01-04 15:33 UTC (permalink / raw)
  To: netdev
  Cc: davem, linux-can, kernel, Wolfgang Grandegger, linux-stable,
	Marc Kleine-Budde

From: Wolfgang Grandegger <wg@grandegger.com>

The "set_bittiming" callback treats a positive return value as error!
For that reason "can_changelink()" will quit silently after setting
the bittiming values without processing ctrlmode, restart-ms, etc.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/usb/gs_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index 68ac3e88a8ce..8bf80ad9dc44 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -449,7 +449,7 @@ static int gs_usb_set_bittiming(struct net_device *netdev)
 		dev_err(netdev->dev.parent, "Couldn't set bittimings (err=%d)",
 			rc);
 
-	return rc;
+	return (rc > 0) ? 0 : rc;
 }
 
 static void gs_usb_xmit_callback(struct urb *urb)
-- 
2.15.1


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

* [PATCH 3/4] can: flex_can: Correct the checking for frame length in flexcan_start_xmit()
  2018-01-04 15:33 pull-request: can 2018-01-04 Marc Kleine-Budde
  2018-01-04 15:33 ` [PATCH 1/4] can: vxcan: improve handling of missing peer name attribute Marc Kleine-Budde
  2018-01-04 15:33 ` [PATCH 2/4] can: gs_usb: fix return value of the "set_bittiming" callback Marc Kleine-Budde
@ 2018-01-04 15:33 ` Marc Kleine-Budde
  2018-01-04 15:33 ` [PATCH 4/4] can: ems_usb: improve error reporting for error warning and error passive Marc Kleine-Budde
  2018-01-05 18:48 ` pull-request: can 2018-01-04 David Miller
  4 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2018-01-04 15:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-can, kernel, Luu An Phu, Marc Kleine-Budde

From: Luu An Phu <phu.luuan@nxp.com>

The flexcan_start_xmit() function compares the frame length with data
register length to write frame content into data[0] and data[1]
register. Data register length is 4 bytes and frame maximum length is 8
bytes.

Fix the check that compares frame length with 3. Because the register
length is 4.

Signed-off-by: Luu An Phu <phu.luuan@nxp.com>
Reviewed-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/flexcan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 0626dcfd1f3d..760d2c07e3a2 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -526,7 +526,7 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		data = be32_to_cpup((__be32 *)&cf->data[0]);
 		flexcan_write(data, &priv->tx_mb->data[0]);
 	}
-	if (cf->can_dlc > 3) {
+	if (cf->can_dlc > 4) {
 		data = be32_to_cpup((__be32 *)&cf->data[4]);
 		flexcan_write(data, &priv->tx_mb->data[1]);
 	}
-- 
2.15.1


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

* [PATCH 4/4] can: ems_usb: improve error reporting for error warning and error passive
  2018-01-04 15:33 pull-request: can 2018-01-04 Marc Kleine-Budde
                   ` (2 preceding siblings ...)
  2018-01-04 15:33 ` [PATCH 3/4] can: flex_can: Correct the checking for frame length in flexcan_start_xmit() Marc Kleine-Budde
@ 2018-01-04 15:33 ` Marc Kleine-Budde
  2018-01-05 18:48 ` pull-request: can 2018-01-04 David Miller
  4 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2018-01-04 15:33 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-can, kernel, Martin Lederhilger, Marc Kleine-Budde

From: Martin Lederhilger <m.lederhilger@ds-automotion.com>

This patch adds the missing CAN_ERR_CRTL to cf->can_id in case of
CAN_STATE_ERROR_WARNING or CAN_STATE_ERROR_PASSIVE

Signed-off-by: Martin Lederhilger <m.lederhilger@ds-automotion.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/usb/ems_usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index b00358297424..12ff0020ecd6 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -395,6 +395,7 @@ static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg)
 
 		if (dev->can.state == CAN_STATE_ERROR_WARNING ||
 		    dev->can.state == CAN_STATE_ERROR_PASSIVE) {
+			cf->can_id |= CAN_ERR_CRTL;
 			cf->data[1] = (txerr > rxerr) ?
 			    CAN_ERR_CRTL_TX_PASSIVE : CAN_ERR_CRTL_RX_PASSIVE;
 		}
-- 
2.15.1

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

* Re: pull-request: can 2018-01-04
  2018-01-04 15:33 pull-request: can 2018-01-04 Marc Kleine-Budde
                   ` (3 preceding siblings ...)
  2018-01-04 15:33 ` [PATCH 4/4] can: ems_usb: improve error reporting for error warning and error passive Marc Kleine-Budde
@ 2018-01-05 18:48 ` David Miller
  2018-01-07 12:32   ` Marc Kleine-Budde
  4 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2018-01-05 18:48 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can, kernel

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Thu,  4 Jan 2018 16:33:51 +0100

> this is a pull request for net/master consisting of 4 patches.
> 
> The first patch is by Oliver Hartkopp, it improves the error checking
> during the creation of a vxcan link. Wolfgang Grandegger's patch for the
> gs_usb driver fixes the return value of the "set_bittiming" callback.
> Luu An Phu provides a patch for the flexcan driver to fix the frame
> length check in the flexcan_start_xmit() function. The last patch is by
> Martin Lederhilger for the ems_usb driver and improves the error
> reporting for error warning and passive frames.
 ...
>   ssh://git@gitolite.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-4.15-20180104

I think you meant:

	git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-4.15-20180104

Otherwise can I please have all of your private SSH keys? :-)

Pulled, thanks.

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

* Re: pull-request: can 2018-01-04
  2018-01-05 18:48 ` pull-request: can 2018-01-04 David Miller
@ 2018-01-07 12:32   ` Marc Kleine-Budde
  0 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2018-01-07 12:32 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-can, kernel


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

On 01/05/2018 07:48 PM, David Miller wrote:
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Date: Thu,  4 Jan 2018 16:33:51 +0100
> 
>> this is a pull request for net/master consisting of 4 patches.
>>
>> The first patch is by Oliver Hartkopp, it improves the error checking
>> during the creation of a vxcan link. Wolfgang Grandegger's patch for the
>> gs_usb driver fixes the return value of the "set_bittiming" callback.
>> Luu An Phu provides a patch for the flexcan driver to fix the frame
>> length check in the flexcan_start_xmit() function. The last patch is by
>> Martin Lederhilger for the ems_usb driver and improves the error
>> reporting for error warning and passive frames.
>  ...
>>   ssh://git@gitolite.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-4.15-20180104
> 
> I think you meant:
> 
> 	git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-4.15-20180104

No, that was intentional.

> Otherwise can I please have all of your private SSH keys? :-)

As long as you have your SSH keys, you have read only access to my (and
the git repos of the other kernel developers) on git.kernel.org. I'm
already fetching from net and net-next via ssh:

> $ git fetch net  
> remote: Counting objects: 70, done.
> remote: Compressing objects: 100% (70/70), done.
> remote: Total 70 (delta 59), reused 0 (delta 0)
> Unpacking objects: 100% (70/70), done.
> From ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/davem/net
>    6926e041a892..5133550296d4  master     -> net/master

See Konstantin Ryabitsev's mail "[kernel.org users] Forcing git to
always use gitolite.kernel.org" for more details.

regards,
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: 488 bytes --]

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

end of thread, other threads:[~2018-01-07 12:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-04 15:33 pull-request: can 2018-01-04 Marc Kleine-Budde
2018-01-04 15:33 ` [PATCH 1/4] can: vxcan: improve handling of missing peer name attribute Marc Kleine-Budde
2018-01-04 15:33 ` [PATCH 2/4] can: gs_usb: fix return value of the "set_bittiming" callback Marc Kleine-Budde
2018-01-04 15:33 ` [PATCH 3/4] can: flex_can: Correct the checking for frame length in flexcan_start_xmit() Marc Kleine-Budde
2018-01-04 15:33 ` [PATCH 4/4] can: ems_usb: improve error reporting for error warning and error passive Marc Kleine-Budde
2018-01-05 18:48 ` pull-request: can 2018-01-04 David Miller
2018-01-07 12:32   ` Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.