All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Vincent Mailhol <mailhol@kernel.org>,
	Harald Mommer <harald.mommer@oss.qualcomm.com>,
	Mikhail Golubev-Ciuchea
	<mikhail.golubev-ciuchea@oss.qualcomm.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	linux-can@vger.kernel.org, virtualization@lists.linux.dev,
	Wolfgang Grandegger <wg@grandegger.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Stefano Garzarella <sgarzare@redhat.com>,
	francesco@valla.it
Subject: Re: [PATCH v10] can: virtio: Add virtio CAN driver
Date: Mon, 2 Mar 2026 16:52:13 +0100	[thread overview]
Message-ID: <aaWyLWmqx0KCJvwI@fedora> (raw)
In-Reply-To: <20260302-condor-of-nonconcrete-infinity-d3ddbb-mkl@pengutronix.de>

On Mon, Mar 02, 2026 at 02:23:42PM +0100, Marc Kleine-Budde wrote:
> On 02.03.2026 11:30:34, Marc Kleine-Budde wrote:
> > > +static int virtio_can_open(struct net_device *ndev)
> > > +{
> > > +	virtio_can_start(ndev);
> > > +
> > > +	netif_start_queue(ndev);
> > > +
> > > +	return 0;
> > > +}
> >
> > Is open_candev() missing? The CAN framework requires drivers to call
> > open_candev() in their ndo_open handler. open_candev() validates that
> > bittiming has been configured (returns -EINVAL if bitrate is 0), checks
> > CAN FD data bitrate requirements, and manages carrier state. Without this
> > call, can the device be brought up without configuring bitrate? The driver
> > does call close_candev() in virtio_can_close(), showing awareness of the
> > CAN lifecycle. Every other CAN driver in the kernel calls open_candev() in
> > its open function.
> 
> This is true for physical CAN devices, so let's clarify things for
> virtio.
> 
> As far as I can see, there's no interface to get/set the bit timing/bit
> rate from the guest, right?
> 
AFAIU there is not such a interface.

> You can set bittiming.bitrate to CAN_BITRATE_UNKNOWN, remove the
> netif_carrier handling from virtio_can_start() and use open_candev().
> 
Will do. Thanks!

Matias


  reply	other threads:[~2026-03-02 15:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17 10:24 [PATCH v10] can: virtio: Add virtio CAN driver Matias Ezequiel Vara Larsen
2026-02-26 14:08 ` Harald Mommer
2026-02-26 14:11   ` Michael S. Tsirkin
2026-03-02 10:30 ` Marc Kleine-Budde
2026-03-02 13:23   ` Marc Kleine-Budde
2026-03-02 15:52     ` Matias Ezequiel Vara Larsen [this message]
2026-03-02 17:55 ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aaWyLWmqx0KCJvwI@fedora \
    --to=mvaralar@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=francesco@valla.it \
    --cc=harald.mommer@oss.qualcomm.com \
    --cc=jasowang@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=mikhail.golubev-ciuchea@oss.qualcomm.com \
    --cc=mkl@pengutronix.de \
    --cc=mst@redhat.com \
    --cc=pabeni@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=wg@grandegger.com \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.