Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp220693rdb; Tue, 5 Dec 2023 03:46:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHElDMpTTqJFkI34g3u7vqHU8ruuPUvwAVVemrM55A9arJTKefzYnnXGmLQEh8MtHTqe8Ok X-Received: by 2002:a17:90b:4b91:b0:286:ccc1:48a with SMTP id lr17-20020a17090b4b9100b00286ccc1048amr903568pjb.19.1701776763683; Tue, 05 Dec 2023 03:46:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701776763; cv=none; d=google.com; s=arc-20160816; b=vmAqJM/X6CiL2ey6e6gCJd1vaX5cgbFsYBabvLLLqKelukJbTFT6GUW526kDxwB7x0 pMflnHmvWBhZNDR/h3gb1SFAotoOAOxS3PQOWwvVr9NnaKlCX4iWvmDqtoSfzkUI6Ri4 KKpf/zT/78Vvkc518JBOeP27Tnf8ZQjp8G5jr3VVWg82aIy8IhRd4964TzgQL2I/Wfe4 CtQnlZWN2RwPKIFazBkO/C0So/DGvuX+2V9XMTgWm4HL5J6V+IMhRR87/NJ2W3RND+0l Y5162a59I+OzUDL1WYAXWczyPCkIQOHhqxUTv0ke3fK4rVLsBtIKqEEpK12/f7i84RYW V7+w== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ifjZic9V2+iDg+N0MCNpQXnm6i6pbqN+fLGdm8ADAvI=; fh=le8THkbpRf3CTOlW4Qt6g8cYOAcQy13xMrvLW5I1SGM=; b=E3yYfyDbDZdrMrAaWzH7gtm/cx9MEBlqaezzs46wcna6T0G2AMoLMYYdL/HcdaWN7o LfcL/jFgoLPotohUFpCr6tkMwNioGh+38eaDfkdja9ms73ia25aGfFgB+/ZsN0rLXOg6 3i0YuWnV+xaeBK72NOySWTOqHfym9QZoJmlVe6jjePqp7Xq0YqvdrPu2Y6Uk3+LczrHh L92F101/FxqAcF9uFTZ0Yukr2B808Qw3ghQrkDMWiAlR0UwNR2hkOoQVGI0uzf4DHh0V cuzMPbqAcN/Eong4b/wN7cN1wT7+leoiKsJBvAQ3keNNZ3vTHwLh2dB1+J+Cd3SqV85X KOJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jp1j7YNb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id kk17-20020a17090b4a1100b00286bc991cd5si2880487pjb.86.2023.12.05.03.46.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:46:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jp1j7YNb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 373B480A7F3F; Tue, 5 Dec 2023 03:45:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345333AbjLELpg (ORCPT + 99 others); Tue, 5 Dec 2023 06:45:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345199AbjLELpd (ORCPT ); Tue, 5 Dec 2023 06:45:33 -0500 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E580C3 for ; Tue, 5 Dec 2023 03:45:39 -0800 (PST) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1d0c94397c0so1996785ad.2 for ; Tue, 05 Dec 2023 03:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701776738; x=1702381538; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ifjZic9V2+iDg+N0MCNpQXnm6i6pbqN+fLGdm8ADAvI=; b=jp1j7YNbJ2K0Q2+WKaqBcNrxLlw+1Xu9arwcfKdJoFxiPxj41DM58ahngWy7c0VHOv UaV411e4/8wO4kBS1QYT+c2CCH7yEEC7gGC9jsHdp/vdRXGeNics8g0bFd9l7Km6HEWU OBN6RCkYpw/5ehn30BIcZORuAu0pHbwss8KO1nz2AWeup/izLXdJTjPfMy8XYrm6df2D Xgy3ZwgKCnwfrQlWwlfCp7kYTof9K9ktPZoSGwEWr/92nlDP1WuiHXTsLKyRXUezEJE0 Y3Od/SKMnlYq/Ek6DVq3iYXopbO3htZxs4sp9nMQd2kjjvXrghgJCD+fFMOZJucHu5SN RluA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701776738; x=1702381538; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ifjZic9V2+iDg+N0MCNpQXnm6i6pbqN+fLGdm8ADAvI=; b=O4ckIOyMkmh43j9tGiOnZHPLa5Wbx/X/5nhDQY4I4wF9FFxb9NPqNEz4DhtRf+NOB8 Rut4aThyfgnsr4lNiIwoLWj4uvVvV/4TOcwaSuskxg9ArOCTMlgdbZEhaRqZuRk7R0qT /UqSqC4zLDEPBz6IZJ6mkuIB6rTOGqOyet70IQghLToTsGcWBRZmsIoXAkBOuB9+wHhz uHUNFc//Vz2UgBIjdbq25+ckL/vP6vy7xAWImoBSrn80XbGMiHQ8UbWdWjLmaqf5i5Lf 1wO5Lg6ev5TbA+UKkNIJOSb4Q84d+UhsUdyH79hh5U40HETae70mnY29mhA1t9wsAUBG 6FaQ== X-Gm-Message-State: AOJu0Yz515Cfm6hDtWxs4bGX402MMzgviwo4kn9tGTIwFskNHLvvBINV QB/ZmXTsazWg+wm0OJiZX6I= X-Received: by 2002:a17:902:ecc7:b0:1d0:c6fd:3173 with SMTP id a7-20020a170902ecc700b001d0c6fd3173mr355177plh.42.1701776738436; Tue, 05 Dec 2023 03:45:38 -0800 (PST) Received: from ?IPV6:2401:4900:1f3e:53bf:50c7:2988:e019:4b97? ([2401:4900:1f3e:53bf:50c7:2988:e019:4b97]) by smtp.gmail.com with ESMTPSA id c15-20020a170902d48f00b001d0cd9e4248sm316501plg.196.2023.12.05.03.45.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Dec 2023 03:45:38 -0800 (PST) Message-ID: <4cafbb5a-8ecd-407e-81a0-76d6505d013b@gmail.com> Date: Tue, 5 Dec 2023 17:15:33 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V3] greybus: gb-beagleplay: Ensure le for values in transport To: Greg KH Cc: Johan Hovold , greybus-dev@lists.linaro.org, elder@kernel.org, linux-kernel@vger.kernel.org, jkridner@beagleboard.org, kernel test robot References: <20231204131008.384583-1-ayushdevel1325@gmail.com> <7ead544b-9234-483f-aacb-55ed05b01fa3@gmail.com> <2023120515-mongrel-undertook-6e5a@gregkh> Content-Language: en-US From: Ayush Singh In-Reply-To: <2023120515-mongrel-undertook-6e5a@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 05 Dec 2023 03:45:56 -0800 (PST) On 12/5/23 05:44, Greg KH wrote: > On Mon, Dec 04, 2023 at 09:58:55PM +0530, Ayush Singh wrote: >> On 12/4/23 19:42, Johan Hovold wrote: >>> On Mon, Dec 04, 2023 at 06:40:06PM +0530, Ayush Singh wrote: >>>> Ensure that the following values are little-endian: >>>> - header->pad (which is used for cport_id) >>>> - header->size >>>> >>>> Fixes: ec558bbfea67 ("greybus: Add BeaglePlay Linux Driver") >>>> Reported-by: kernel test robot >>>> Closes: https://lore.kernel.org/r/202311072329.Xogj7hGW-lkp@intel.com/ >>>> Signed-off-by: Ayush Singh >>>> --- >>>> V3: >>>> - Fix endiness while sending. >>>> V2: https://lists.linaro.org/archives/list/greybus-dev@lists.linaro.org/thread/L53UN5ROSG4M6OE7CU5Y3L5F44T6ZPCC/ >>>> - Ensure endianess for header->pad >>>> V1: https://lists.linaro.org/archives/list/greybus-dev@lists.linaro.org/message/K7UJ6PEAWBLNDMHLT2IO6OP5LQISHRUO/ >>>> >>>> drivers/greybus/gb-beagleplay.c | 9 +++++---- >>>> 1 file changed, 5 insertions(+), 4 deletions(-) >>>> >>>> diff --git a/drivers/greybus/gb-beagleplay.c b/drivers/greybus/gb-beagleplay.c >>>> index 43318c1993ba..8b21c3e1e612 100644 >>>> --- a/drivers/greybus/gb-beagleplay.c >>>> +++ b/drivers/greybus/gb-beagleplay.c >>>> @@ -93,9 +93,9 @@ static void hdlc_rx_greybus_frame(struct gb_beagleplay *bg, u8 *buf, u16 len) >>>> memcpy(&cport_id, hdr->pad, sizeof(cport_id)); >>>> dev_dbg(&bg->sd->dev, "Greybus Operation %u type %X cport %u status %u received", >>>> - hdr->operation_id, hdr->type, cport_id, hdr->result); >>>> + hdr->operation_id, hdr->type, le16_to_cpu(cport_id), hdr->result); >>>> - greybus_data_rcvd(bg->gb_hd, cport_id, buf, len); >>>> + greybus_data_rcvd(bg->gb_hd, le16_to_cpu(cport_id), buf, len); >>> This looks broken; a quick against mainline (and linux-next) check shows >>> cport_id to be u16. >>> >>> I think you want get_unaligned_le16() or something instead of that >>> memcpy() above. >> Thanks, will do. >>> But that just begs the question: why has this driver repurposed the pad >>> bytes like this? The header still says that these shall be set to zero. >> So, the reason is multiplexing. The original gbridge setup used to do this, >> so I followed it when I moved gbridge to the coprocessor (during GSoC). >> >> Using the padding for storing cport information allows not having to wrap >> the message in some other format at the two transport layers (UART and TCP >> sockets) beagle connect is using.This also seems better than trying to do >> something bespoke, especially since the padding bytes are not being used for >> anything else. >> >> The initial spec was for project Ara (modular smartphone), so the current >> use for IoT is significantly different from the initial goals of the >> protocol. Maybe a future version of the spec can be more focused on IoT, but >> that will probably only happen once it has proven somewhat useful in this >> space. > Please don't violate the spec today this way, I missed that previously, > that's not ok. We can change the spec for new things if you need it, > but to not follow it, and still say it is "greybus" isn't going to work > and will cause problems in the long-run. > > Should I just disable the driver for now until this is fixed up? > > thanks, > > greg k-h Well, I will look into some ways to pass along the cport information (maybe using a wrapper over greybus message) for now. However, I would prefer having some bytes in greybus messages reserved for passing around this information in a transport agnostic way. Ayush Singh