Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp789257rdb; Fri, 26 Jan 2024 10:38:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgezLMlwus4FX4sEVRK5gQHPYuFaUVr9vv5I3XlDcnL5KQoe5hWtG8cHbjVuHF/SKSP/r+ X-Received: by 2002:a05:6808:19a2:b0:3bd:7301:5824 with SMTP id bj34-20020a05680819a200b003bd73015824mr198791oib.36.1706294282780; Fri, 26 Jan 2024 10:38:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706294282; cv=pass; d=google.com; s=arc-20160816; b=JQRkyJe8aUFGKLjRvZ01D+a+zbP2F63OV0Zhm9MarpNSePJGN9ziTU1wJvIjRehga7 Lk29TKL1BFoeDP1B9O55ljDL8TLMVbaDjIj7bzLHf2YkybZBK9W0YAsMItWS5hD9/ntt 9H0CR4kb4Vs2kFq25hr1TBp6ARVjYBIctN2zGsRBeQeig1fEcPDUPY1IAMVqEhP1KidS Lp+D7b039dOez7LGRaoFWFby6VxrGa+oTOCSR/OBFC9cW/DLGRFCp87X/R6C7SpEe5TX 7v+6j5yylYCGaIjxGg3RpF9vE5ZZ8yOMuyMjuch7ouDS/CJHJo2CtkLHWMssdYhVV+Cs g1+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=uQ9LWpRZqhGXr17Sut+fsyT3gP0HQr5bswuLlV5/xTo=; fh=R2JgpRyf+mAzUjbquHWyO1M+HXMHS3xXLd8B5votflo=; b=lL3ocFKfjy1fIC2N9xgUSVuAbMx6pap1Vhb2jQwxNxJgnLpyfqLDXX2MTZr9zVMmAq JPkXyp1ATYbZsaa3Gg66/EJ3rkAIuNd5H83BRDqdBOQkXfh3lZghefZ2fC5dc7aA7o9l m7r9B1jcqNtsuadv0CZlGqiaQVl53x5lavdJxm8exPN0XVv3EjWbH2QHQUlTkJzi8bf8 SerDPqYaBW2WOZm7oWqJZHu5ladpiEVxyC6hbYVElNUF9TF4yO3JTl6SxHt6gZDMW/Jw zEzKtIqeUs8rYllu6PyFGWW7NZ2JCEJvzh51/pWKjDvm0/TwD6lmLLKMrairvkVe978i wBvQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VZRmIzkd; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-40499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40499-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m18-20020a05622a055200b0042a541555b5si1783477qtx.274.2024.01.26.10.38.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 10:38:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VZRmIzkd; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-40499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40499-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 85ABC1C23B1B for ; Fri, 26 Jan 2024 18:38:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C17E21104; Fri, 26 Jan 2024 18:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="VZRmIzkd" Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A343E208BC for ; Fri, 26 Jan 2024 18:37:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706294272; cv=none; b=fODgXqGDuX4fgvCrbipyTQ0gtYpm1jWdPwgBiz4hqllCrvmCCFbaFuvRkMwon6x9UfpJPrzbETxwvkS8Cyo3E+L15wfWsNRq7saJFWXWdUvsuCazW1ml13ndtG9ZxnghUP9bUpt9w72hcpLeebODNZyy/Ol2xWJnsuUm4M1xp+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706294272; c=relaxed/simple; bh=XZ2hRyKad9HfIgpa+F9en0MefeDawNEJlY0vs6zijUE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bLKkDUBwEI6C3SZAZOFeaZGMHSjsEodKBbVU5CtXoncrRPkhM/w+ZgkOovy1qY+VgFzGIDs90LE/cf9pkOi0N5+9ofleSqu98g0QQQxej+Cy3THXgASpTS61uASbFmhSoMlt1ptigjsBrVPKtWIvCmsVwytvfiecDCWth7A/DsU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=VZRmIzkd; arc=none smtp.client-ip=209.85.219.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-yb1-f174.google.com with SMTP id 3f1490d57ef6-dc6432ee799so893872276.0 for ; Fri, 26 Jan 2024 10:37:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1706294269; x=1706899069; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uQ9LWpRZqhGXr17Sut+fsyT3gP0HQr5bswuLlV5/xTo=; b=VZRmIzkd5BF7pS+vQAVSqz58UIJHWRKEaMNxNCUEZv3Gn6lQp8+FDfdTostyjJDni1 ySrE8rj/M88GIXWywMOFXHiXFDzxGesIriZqaTT+ks1dnOcWKyIPvygZA25AYuGfSfgk IMAph3bzCvUEq5oVejaykqE+az7hbEcTM/p1s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706294269; x=1706899069; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uQ9LWpRZqhGXr17Sut+fsyT3gP0HQr5bswuLlV5/xTo=; b=gk3d1m5Ju+7IiZR2eJE1LuGxImDCF2gEWLlJz+YEOVrVJoE+peap5t1wxj8QhN4DxL FpAz4gNy7E3V4DGxDNl5VePj+mgRvXZ83BHO7sETOAssRANt3kUvWsMO73oIan1JYMbo JYx41hPNWOubTNeFA/wTxgbYcW61qAZO7BooC0WhYYM6uGM8IdAX0wXWzhntgqApPPie l1qIvhX1pyNNEfF2jh9qVdzr0yPPplamL3V5Z09EkXCCnNNIAy3jQ9sh4FVuysG/0sMy FTi6ZCeHaRr+hCYdQezhaCyUn2Z0NepcQRlwEfShwO14zjGxqZYIPKA4VM8BZHsviz/r 3eeg== X-Gm-Message-State: AOJu0YwlhAqLnQwo+FUaq6WAgTKW8i8c6JQ+NZiNi5q0e1KBPjqrXYlv 6RLZ7jP/j9gBrLzcOUYElrAPx2YNifJ9RKLO6WXE63LuFM3QJ1p7b+yI1tomWmDFoSo1xa0/og5 GXRzwUGNBWpsypaWW5DMj39NRaQ/xt+ueZPJM X-Received: by 2002:a5b:80c:0:b0:dc6:57cf:d905 with SMTP id x12-20020a5b080c000000b00dc657cfd905mr125981ybp.7.1706294269467; Fri, 26 Jan 2024 10:37:49 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240125004456.575891-1-abhishekpandit@google.com> <20240124164443.v2.2.I3d909e3c9a200621e3034686f068a3307945fd87@changeid> <2024012512-haphazard-mobster-f566@gregkh> <2024012555-nuclear-chummy-6079@gregkh> <2024012612-giggling-diabetes-3a74@gregkh> In-Reply-To: <2024012612-giggling-diabetes-3a74@gregkh> From: Abhishek Pandit-Subedi Date: Fri, 26 Jan 2024 10:37:38 -0800 Message-ID: Subject: Re: [PATCH v2 2/3] usb: typec: ucsi: Update connector cap and status To: Greg Kroah-Hartman Cc: Abhishek Pandit-Subedi , Heikki Krogerus , linux-usb@vger.kernel.org, jthies@google.com, pmalani@chromium.org, Dmitry Baryshkov , Neil Armstrong , Rajaram Regupathy , Saranya Gopal , linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 26, 2024 at 10:30=E2=80=AFAM Greg Kroah-Hartman wrote: > > On Fri, Jan 26, 2024 at 10:08:16AM -0800, Abhishek Pandit-Subedi wrote: > > On Thu, Jan 25, 2024 at 5:50=E2=80=AFPM Greg Kroah-Hartman > > wrote: > > > > > > On Thu, Jan 25, 2024 at 04:21:47PM -0800, Abhishek Pandit-Subedi wrot= e: > > > > On Thu, Jan 25, 2024 at 3:03=E2=80=AFPM Greg Kroah-Hartman > > > > wrote: > > > > > > > > > > On Wed, Jan 24, 2024 at 04:44:53PM -0800, Abhishek Pandit-Subedi = wrote: > > > > > > diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/= ucsi/ucsi.h > > > > > > index bec920fa6b8a..94b373378f63 100644 > > > > > > --- a/drivers/usb/typec/ucsi/ucsi.h > > > > > > +++ b/drivers/usb/typec/ucsi/ucsi.h > > > > > > @@ -3,6 +3,7 @@ > > > > > > #ifndef __DRIVER_USB_TYPEC_UCSI_H > > > > > > #define __DRIVER_USB_TYPEC_UCSI_H > > > > > > > > > > > > +#include > > > > > > > > > > Do you really need to include a asm/ include file? This feels ve= ry > > > > > wrong. > > > > > > > > I didn't see any header in include/linux that already had these > > > > unaligned access functions so I opted to include > > > > asm-generic/unaligned.h. Is there a reason not to use an asm/ inclu= de > > > > file? > > > > > > Yes, you should never need to include a asm/ file, unless you are > > > arch-specific code. > > > > > > But the big issue is that you don't really need this, right? > > > > The UCSI struct definitions have lots of unaligned bit ranges (and I > > will be refactoring to support this but that's > > coming later). As an example, the GET_CONNECTOR_STATUS data structure > > has unaligned fields from bit 88-145. > > Rather than define my own macro, it was suggested I use the > > get_unaligned_le32 functions (see > > https://chromium-review.googlesource.com/c/chromiumos/third_party/kerne= l/+/5195032/3..4/drivers/usb/typec/ucsi/ucsi.h#b183). > > > > I did a quick ripgrep on the drivers folder -- it looks like the "You > > should never need to include a asm/ file unless you are arch specific" > > isn't being followed for this file: > > $ (cd drivers && rg -g '*.h' "unaligned\.h" -l) | wc -l > > 22 > > > > The unaligned access functions (get_unaligned_le16, > > get_unaligned_le32, etc) are really useful and widely used. Maybe they > > SHOULD be exposed from a since they are so useful? > > I can send a follow-on patch that creates (that > > simply just includes ) and moves all includes of > > outside of "arch" to the linux header instead (this > > will also create a checkpatch warning now as you are expecting). > > This is being worked on, see: > https://lore.kernel.org/r/20231212024920.GG1674809@ZenIV > > thanks, > > greg k-h Thanks, I see the move here: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=3Dhe= aders.unaligned&id=3D3169da8e80dfca2bcbfb6e998e2f36bcdcd5895a I'm not sure how the logistics of this is going to work but I assume it's ok to merge with for now and let the later merge from viro fix this? (+Viro as FYI) I'll send up Patch 3 of this series with the fixes discussed (use asm/unaligned.h and reorder includes) Abhishek