Skip to content

Conversation

@Avenger-285714
Copy link
Member

@Avenger-285714 Avenger-285714 commented Feb 6, 2025

Summary by Sourcery

Synchronize Uniontech patches from v6.14-rc1 to Deepin Linux Kernel.

Bug Fixes:

  • Fix a typo in a comment.

Enhancements:

  • Share resources between XHCI host controllers.

Tests:

  • Update default SSH configuration.

WangYuli added 2 commits February 6, 2025 17:59
[ Upstream commit f3a3001 ]

There is a spelling mistake of 'accesing' in comments which should
be 'accessing'.

Fixes: 6d76f46 ("ktest: Add useful example configs")
Link: https://lore.kernel.org/8714AE3735C0EA0B+20241218140437.194906-1-wangyuli@uniontech.com
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
[ Backport from v6.14-rc1 ]
Signed-off-by: WangYuli <wangyuli@uniontech.com>
[ Upstream commit 594c823 ]

When inserting a USB device, examining hcd->rsrc_start can be
helpful in identifying which hcd is mounted, as the physical
address represented here is typically unique.

The following code snippet demonstrates this:
  struct usb_hcd *hcd = bus_to_hcd(udev->bus);
  unsigned long long usb_hcd_addr = (unsigned long long)hcd->rsrc_start;

However, this approach has limitations now. For USB hosts with an
MMIO interface, the effectiveness of this method is restricted to
USB 2.0.

Because commit 3429e91 ("usb: host: xhci: add platform driver
support") assigned res->start to hcd->rsrc_start. But
shared_hcd->rsrc_start remains unassigned, which is also necessary
in certain scenarios.

Fixes: 3429e91 ("usb: host: xhci: add platform driver support")
Co-developed-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Link: https://lore.kernel.org/r/186B9F56972457B4+20250107133854.172309-1-wangyuli@uniontech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Backport from v6.14-rc1 ]
Signed-off-by: WangYuli <wangyuli@uniontech.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Feb 6, 2025

Reviewer's Guide by Sourcery

This pull request backports Uniontech patches from v6.14-rc1 to the linux 6.6-y kernel. The changes include updating the xhci-plat.c file to properly assign resource start and length to the shared HCD, and a minor correction in the ktest defaults.conf file.

Sequence diagram for XHCI platform probe resource sharing

sequenceDiagram
    participant xhci_plat_probe
    participant hcd as Host Controller Driver (HCD)
    participant shared_hcd as Shared HCD (USB 3.0)

    xhci_plat_probe->>hcd: Initialize resources
    Note over hcd: Set rsrc_start and rsrc_len
    xhci_plat_probe->>shared_hcd: Copy resource values
    Note over shared_hcd: New: Set rsrc_start from HCD
    Note over shared_hcd: New: Set rsrc_len from HCD
    xhci_plat_probe->>shared_hcd: Add shared HCD
Loading

Class diagram for USB Host Controller Driver structure

classDiagram
    class hcd {
        +rsrc_start
        +rsrc_len
    }
    class shared_hcd {
        +rsrc_start
        +rsrc_len
    }
    class xhci {
        +shared_hcd
    }
    xhci --> shared_hcd
    note for shared_hcd "Now includes resource information from main HCD"
Loading

File-Level Changes

Change Details Files
Assign resource start and length to the shared HCD.
  • Assign rsrc_start from hcd to xhci->shared_hcd->rsrc_start
  • Assign rsrc_len from hcd to xhci->shared_hcd->rsrc_len
drivers/usb/host/xhci-plat.c
Corrected a typo in a comment.
  • Fixed a typo in the comment about accessing the machine via SSH.
tools/testing/ktest/examples/include/defaults.conf

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!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

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

Copy link

@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 @Avenger-285714 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The patch looks good overall. One suggestion: when copying rsrc_start and rsrc_len from hcd to shared_hcd in xhci_plat_probe(), it might be worth adding a brief inline comment explaining why these values are being shared, especially if there are any assumptions about their initialization or consistency. This can help future maintainers understand the rationale behind this resource sharing.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sourcery-ai[bot]
Once this PR has been reviewed and has the lgtm label, please ask for approval from avenger-285714. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@Avenger-285714 Avenger-285714 merged commit 7c3cfc6 into deepin-community:linux-6.6.y Feb 6, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants