Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Massimo Toscanelli" <massimo.toscanelli@leica-geosystems.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH 1/2] usb: gadget: f_ncm: do not notify from ncm_set_alt()
Date: Fri, 23 Oct 2026 12:21:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-182754@kernel.org> (raw)
In-Reply-To: <20261023-ncm-ecm-lpm-v1-1-d01e81fbf460@leica-geosystems.com>

> From: Massimo Toscanelli <massimo.toscanelli@leica-geosystems.com>
> 
> ncm_set_alt() calls ncm_notify() for both altsettings of the data
> interface. So a notification is already queued at SET_CONFIGURATION,
> when altsetting 0 is selected, and it waits until the host reads the
> interrupt endpoint.
> 
> The USB 2.0 LPM ECN (section 2.2.2) lets a device answer NYET to an LPM
> request when it has data pending for the host, and DWC3 does so. So
> when the host loads no class driver, like the USB-IF test tool, the
> device never enters L1 and the LPM L1 test fails.
> 
> The CDC NCM spec (version 1.1, section 9.2) [1] asks for the
> notifications only when the host selects altsetting 1. There the call
> is not needed: gether_connect() already calls ncm_open() or
> ncm_close(), and both notify. The extra call only restarts the
> sequence while the first notification is in flight, so the host gets
> two connection notifications before the speed one.
> 
> The old ether.c also notified only for altsetting 1, until commit
> da741b8c56d6 ("usb ethernet gadget: split CDC Ethernet function")
> moved the call out of that branch in f_ecm. f_ncm copied that
> pattern.
> 
> Remove the call.
> 
> Fixes: 9f6ce4240a2b ("usb: gadget: f_ncm.c added")
> Link: https://www.usb.org/sites/default/files/NCM11.pdf # [1]
> Signed-off-by: Massimo Toscanelli <massimo.toscanelli@leica-geosystems.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261023-ncm-ecm-lpm-v1-0-d01e81fbf460@leica-geosystems.com?part=1


  reply	other threads:[~2026-10-23 12:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 12:15 [PATCH 0/2] usb: gadget: f_ncm/f_ecm: do not notify from set_alt() Massimo Toscanelli via B4 Relay
2026-10-23 12:15 ` [PATCH 1/2] usb: gadget: f_ncm: do not notify from ncm_set_alt() Massimo Toscanelli via B4 Relay
2026-10-23 12:21   ` sashiko-bot [this message]
2026-10-26 12:04   ` Aldo Ariel Panzardo
2026-10-23 12:15 ` [PATCH 2/2] usb: gadget: f_ecm: do not notify from ecm_set_alt() Massimo Toscanelli via B4 Relay
2026-10-23 12:23   ` sashiko-bot
2026-10-26 12:06   ` Aldo Ariel Panzardo

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=sashiko-outbox-182754@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=massimo.toscanelli@leica-geosystems.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox