Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1350943rwb; Thu, 8 Dec 2022 09:30:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Tc+vjQk67XsGcOHqF9S4h/576RPUph8TEF8nDkbl400u21ckzNhNUTjbnaCup9nY+6AxX X-Received: by 2002:a05:6402:4289:b0:467:9864:9463 with SMTP id g9-20020a056402428900b0046798649463mr67124821edc.360.1670520642788; Thu, 08 Dec 2022 09:30:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670520642; cv=none; d=google.com; s=arc-20160816; b=SQUftOHsiXxAGx4lB9Pq4Xe/3OH/eO1FCwqQxgZSAolwrHiLK9h5c96W9syTiFYY1U 8301FgKaWyKs1b+rqxb7RYavhqGqvTlQSskhWktzh5Pq5CQJRbNa7vcc78CbNg9sOSDS qrGbqk3ZzdoiF/cjvcGNvUCJrUFe31rm4xzBRkXVr+GSIlz3z3p4yBQ0qNKMAqO41vxB 0UfJ/9qoHhofUufekmuE16s1u023qp0VxIwux55mBtvnJK0BgpC8qUF0qOoZGjLYHy9M Gmh0D0eduDV3+X2Xo1qJzl1R7CPp0+38gd0Af7UuJxExZDcH8qNPVNhJhzK543jBv+IB Iymw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7cRXDJWcjfeRkRo2+R2+cz6b1HoZXpYfUmYKBkAZh0g=; b=uFuJuYbjyXkl4CBtL2WRfTfv/c/HFK2zfXViIUQD2qiU0vL+hyh2xTwkvRniD0v2Ok 13OigEp/O0vIHxr8CHR2bA9p7fLqWH7jnNThiU3tYrigo2Z7LsXS2+FApIp5Z1xKRjUx bUvkChgNgKIIm06jZb14TaQpqqRuUkpGpqYn4WRV2agBcgIRf89NKmIPB7o1NuQV7eJa WIrqG+QaOJosscYqz+7dq4FP5XK+ILvcI7vQdLVWEt3hKIQpQoyHPyyspKjXOLZ0q9uc bNzos3VARc1kz2/9wbuiTETp/Y9GpRYASAezGklRtkUHFmavP4NHR5ZgXPFE+CIdM5zR Zi7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UMNVJXiX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a50fc08000000b0046a31967739si6454797edr.96.2022.12.08.09.30.25; Thu, 08 Dec 2022 09:30:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UMNVJXiX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbiLHQkD (ORCPT + 72 others); Thu, 8 Dec 2022 11:40:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbiLHQkC (ORCPT ); Thu, 8 Dec 2022 11:40:02 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F3B33AC15 for ; Thu, 8 Dec 2022 08:39:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670517541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7cRXDJWcjfeRkRo2+R2+cz6b1HoZXpYfUmYKBkAZh0g=; b=UMNVJXiXyP8DvYp3v4je2ucPHe/NVwJXRqqJqCqwbyh5FWEJrLCN7OkI5PMZW0zKr1N/Iw GNU/uc15Dx8QLE8BmMcLNRX7LQxH0SMqWsrSbyf1/Cj0TctTydG5qFCIGRAz5ZfhTPoGXa mlQnkp24fv60+q6dqvczNeSY5ycb1LA= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-500-l7FI-DG8Ok-rl-OE4fC7xw-1; Thu, 08 Dec 2022 11:39:00 -0500 X-MC-Unique: l7FI-DG8Ok-rl-OE4fC7xw-1 Received: by mail-ed1-f69.google.com with SMTP id v4-20020a056402348400b0046cbbc786bdso1231055edc.7 for ; Thu, 08 Dec 2022 08:38:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7cRXDJWcjfeRkRo2+R2+cz6b1HoZXpYfUmYKBkAZh0g=; b=tm9Je6ZN07ByLh/t1zo9IQyIzPzdyOtH1JDMys+tLheTWGPiOpfs5rJIxo7+ZqMQCV RX2DA1oLiWcZ34q1z/bgJe97mfKoIY4J82+HIIK+ykRYZ8dYQQYAo5Px3L4ZUlkGYEXG qki/zkhjLOR4barG8yApnSaRxWbyACpEQYpgYN0ltS9IPNmifEx/LLNy/z+mfyZur064 mBPo5mAHGFiAcY31Rt58hnkB3kFla03O0N0ERSaEBNiJdZTcERPcH0JBgNJomOLqBal8 8ftUVtUJoHtIgMfLXiICFGDMAMz07y2jZ7yTDU2NSXmSoceEOYd71zS6Mgl+x1cE3coI eWUg== X-Gm-Message-State: ANoB5pmQdX4YfLXvUmk/iLVssxd2SSq6rXUaEvMMNQRNm7NRxLBlDjAR EnNgj9wA0s0M02ic8OFtmhIcZULsCUUOtOTdIaMXTtq6fxM2L8yOjvs6FBBpfkLb+hPyiI6vxfY eunhG9z2ArPkxUuKRNOBuoACC X-Received: by 2002:a17:906:524f:b0:7bf:f0e9:4edc with SMTP id y15-20020a170906524f00b007bff0e94edcmr2332669ejm.31.1670517539022; Thu, 08 Dec 2022 08:38:59 -0800 (PST) X-Received: by 2002:a17:906:524f:b0:7bf:f0e9:4edc with SMTP id y15-20020a170906524f00b007bff0e94edcmr2332656ejm.31.1670517538859; Thu, 08 Dec 2022 08:38:58 -0800 (PST) Received: from ?IPV6:2001:1c00:c1e:bf00:d69d:5353:dba5:ee81? (2001-1c00-0c1e-bf00-d69d-5353-dba5-ee81.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:d69d:5353:dba5:ee81]) by smtp.gmail.com with ESMTPSA id bd7-20020a056402206700b0046b847d6a1csm3555506edb.21.2022.12.08.08.38.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Dec 2022 08:38:58 -0800 (PST) Message-ID: Date: Thu, 8 Dec 2022 17:38:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH 0/9] platform/surface: aggregator: Improve target/source handling in SSH messages Content-Language: en-US, nl To: Benjamin Tissoires Cc: Maximilian Luz , Jiri Kosina , Sebastian Reichel , Mark Gross , Jonathan Corbet , platform-driver-x86@vger.kernel.org, linux-doc@vger.kernel.org, linux-input@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221202223327.690880-1-luzmaximilian@gmail.com> From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 12/8/22 17:24, Benjamin Tissoires wrote: > On Thu, Dec 8, 2022 at 5:03 PM Hans de Goede wrote: >> >> Hi Maximilian, >> >> On 12/2/22 23:33, Maximilian Luz wrote: >>> We have some new insights into the Serial Hub protocol, obtained through >>> reverse engineering. In particular, regarding the command structure. The >>> input/output target IDs actually represent source and target IDs of >>> (what looks like) physical entities (specifically: host, SAM EC, KIP EC, >>> debug connector, and SurfLink connector). >>> >>> This series aims to improve handling of messages with regards to those >>> new findings and, mainly, improve clarity of the documentation and usage >>> around those fields. >>> >>> See the discussion in >>> >>> https://github.com/linux-surface/surface-aggregator-module/issues/64 >>> >>> for more details. >>> >>> There are a couple of standouts: >>> >>> - Patch 1 ensures that we only handle commands actually intended for us. >>> It's possible that we receive messages not intended for us when we >>> enable debugging. I've kept it intentionally minimal to simplify >>> backporting. The rest of the series patch 9 focuses more on clarity >>> and documentation, which is probably too much to backport. >>> >>> - Patch 8 touches on multiple subsystems. The intention is to enforce >>> proper usage and documentation of target IDs in the SSAM_SDEV() / >>> SSAM_VDEV() macros. As it directly touches those macros I >>> unfortunately can't split it up by subsystem. >>> >>> - Patch 9 is a loosely connected cleanup for consistency. >> >> Thank you for the patches. Unfortunately I don't have time atm to >> review this. >> >> And the next 2 weeks are the merge window, followed by 2 weeks >> of christmas vacation. >> >> So I'm afraid that I likely won't get around to reviewing >> this until the week of January 9th. >> >>> Hans, Jiri, Benjamin, Sebastian: While patch 8 ("platform/surface: >>> aggregator: Enforce use of target-ID enum in device ID macros") touches >>> multiple subsystems, it should be possible to take the whole series >>> through the pdx86 tree. The changes in other subsystems are fairly >>> limited. >> >> I agree that it will be best to take all of this upstream through the >> pdx86 tree. Sebastian thank you for the ack for patch 8/9. >> >> Jiri or Benjamin may we have your ack for merging patch 7/9 + 8/9 >> through the pdx86 tree ? > > I can give you an ack for taking those through your tree, but I can > not review the patches themselves because I was only CC-ed to those 2, > and so was linux-input. Given that SSAM_SSH_TID_KIP is not in my > current tree I assume it comes from this series. > > Anyway, enough ranting :) > > If you think the patches are OK, they are really small concerning the > HID part, so feel free to take them through your tree Hans. Thank you. Regards, Hans >>> Maximilian Luz (9): >>> platform/surface: aggregator: Ignore command messages not intended for >>> us >>> platform/surface: aggregator: Improve documentation and handling of >>> message target and source IDs >>> platform/surface: aggregator: Add target and source IDs to command >>> trace events >>> platform/surface: aggregator_hub: Use target-ID enum instead of >>> hard-coding values >>> platform/surface: aggregator_tabletsw: Use target-ID enum instead of >>> hard-coding values >>> platform/surface: dtx: Use target-ID enum instead of hard-coding >>> values >>> HID: surface-hid: Use target-ID enum instead of hard-coding values >>> platform/surface: aggregator: Enforce use of target-ID enum in device >>> ID macros >>> platform/surface: aggregator_registry: Fix target-ID of base-hub >>> >>> .../driver-api/surface_aggregator/client.rst | 4 +- >>> .../driver-api/surface_aggregator/ssh.rst | 36 ++++----- >>> drivers/hid/surface-hid/surface_hid.c | 2 +- >>> drivers/hid/surface-hid/surface_kbd.c | 2 +- >>> .../platform/surface/aggregator/controller.c | 12 +-- >>> .../platform/surface/aggregator/ssh_msgb.h | 4 +- >>> .../surface/aggregator/ssh_request_layer.c | 15 ++++ >>> drivers/platform/surface/aggregator/trace.h | 73 +++++++++++++++++-- >>> .../platform/surface/surface_aggregator_hub.c | 8 +- >>> .../surface/surface_aggregator_registry.c | 2 +- >>> .../surface/surface_aggregator_tabletsw.c | 10 +-- >>> drivers/platform/surface/surface_dtx.c | 20 ++--- >>> .../surface/surface_platform_profile.c | 2 +- >>> drivers/power/supply/surface_battery.c | 4 +- >>> drivers/power/supply/surface_charger.c | 2 +- >>> include/linux/surface_aggregator/controller.h | 4 +- >>> include/linux/surface_aggregator/device.h | 50 ++++++------- >>> include/linux/surface_aggregator/serial_hub.h | 40 ++++++---- >>> 18 files changed, 191 insertions(+), 99 deletions(-) >>> >> >