Skip to content

[Deepin-Kernel-SIG] [linux 6.18.y] [FROMLIST] USB: cdc-acm: Fix bit overlap and move quirk definitions to header#1663

Merged
opsiff merged 1 commit into
deepin-community:linux-6.18.yfrom
opsiff:linux-6.18.y-2026-05-07-fix
May 8, 2026
Merged

[Deepin-Kernel-SIG] [linux 6.18.y] [FROMLIST] USB: cdc-acm: Fix bit overlap and move quirk definitions to header#1663
opsiff merged 1 commit into
deepin-community:linux-6.18.yfrom
opsiff:linux-6.18.y-2026-05-07-fix

Conversation

@opsiff
Copy link
Copy Markdown
Member

@opsiff opsiff commented May 7, 2026

The VENDOR_CLASS_DATA_IFACE and ALWAYS_POLL_CTRL quirk flags added in commit f58752ebcb35 ("USB: cdc-acm: Add quirks for Yoga Book 9 14IAH10 INGENIC touchscreen") were placed inside the acm_ctrl_msg() function rather than in the header with the other quirk flags. Worse, their values (BIT(9) and BIT(10)) collided with NO_UNION_12 which is already BIT(9).

Move the definitions to drivers/usb/class/cdc-acm.h where they belong and shift them to BIT(10) and BIT(11) to avoid the overlap.

Fixes: f58752ebcb35 ("USB: cdc-acm: Add quirks for Yoga Book 9 14IAH10 INGENIC touchscreen")
Cc: stable@vger.kernel.org

(cherry picked from commit 12b9827)

Summary by Sourcery

Fix cdc-acm USB quirk flag definitions to avoid bit overlap and centralize them in the shared header.

Bug Fixes:

  • Resolve overlapping quirk bit definitions between NO_UNION_12 and newly added cdc-acm quirks.

Enhancements:

  • Move VENDOR_CLASS_DATA_IFACE and ALWAYS_POLL_CTRL quirk flags from the source file into the cdc-acm header alongside other quirk flags.

The VENDOR_CLASS_DATA_IFACE and ALWAYS_POLL_CTRL quirk flags added in
commit f58752ebcb35 ("USB: cdc-acm: Add quirks for Yoga Book 9 14IAH10
INGENIC touchscreen") were placed inside the acm_ctrl_msg() function
rather than in the header with the other quirk flags.  Worse, their
values (BIT(9) and BIT(10)) collided with NO_UNION_12 which is already
BIT(9).

Move the definitions to drivers/usb/class/cdc-acm.h where they belong
and shift them to BIT(10) and BIT(11) to avoid the overlap.

Fixes: f58752ebcb35 ("USB: cdc-acm: Add quirks for Yoga Book 9 14IAH10 INGENIC touchscreen")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
(cherry picked from commit 12b9827)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 7, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Moves recently added cdc-acm quirk flags into the shared header and adjusts their bit positions to avoid overlap with existing flags, keeping all quirk definitions centralized and non-conflicting.

Class diagram for centralized cdc_acm quirk flags in header

classDiagram
    class cdc_acm_quirk_flags {
        +BIT7 DISABLE_ECHO
        +BIT8 MISSING_CAP_BRK
        +BIT9 NO_UNION_12
        +BIT10 VENDOR_CLASS_DATA_IFACE
        +BIT11 ALWAYS_POLL_CTRL
    }
Loading

File-Level Changes

Change Details Files
Centralize and reassign cdc-acm quirk flag bits to prevent overlap with existing flags.
  • Remove in-function macro definitions for VENDOR_CLASS_DATA_IFACE and ALWAYS_POLL_CTRL from acm_ctrl_msg() so the function no longer defines quirk bits locally.
  • Add VENDOR_CLASS_DATA_IFACE and ALWAYS_POLL_CTRL quirk macros to the shared cdc-acm header alongside existing quirk flags.
  • Reassign VENDOR_CLASS_DATA_IFACE and ALWAYS_POLL_CTRL from BIT(9)/BIT(10) to BIT(10)/BIT(11) respectively to avoid collision with NO_UNION_12 at BIT(9).
drivers/usb/class/cdc-acm.c
drivers/usb/class/cdc-acm.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Avenger-285714
Copy link
Copy Markdown
Member

/approve

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Avenger-285714

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a quirk-flag bit collision in the cdc-acm USB class driver by moving two quirk definitions into the shared header alongside the other quirk flags and reassigning them to non-overlapping bit positions.

Changes:

  • Move VENDOR_CLASS_DATA_IFACE and ALWAYS_POLL_CTRL quirk flag definitions out of acm_ctrl_msg() into drivers/usb/class/cdc-acm.h.
  • Shift the two quirk flag bit positions to BIT(10) and BIT(11) to avoid overlapping with NO_UNION_12 (BIT(9)).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
drivers/usb/class/cdc-acm.h Centralizes the two quirk flag definitions with the existing quirk bitmask and updates them to non-overlapping bit positions.
drivers/usb/class/cdc-acm.c Removes the in-function quirk #defines so the driver consistently consumes quirk definitions from the header.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@opsiff opsiff merged commit 3fbc4d3 into deepin-community:linux-6.18.y May 8, 2026
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants