Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp497558rwr; Thu, 20 Apr 2023 02:19:28 -0700 (PDT) X-Google-Smtp-Source: AKy350ZZjfLVQ7jRWGOEAvKQiAHek66DBeTDHzpe/9SGAuy9eQHMMPHwWRLEoRW65nAWqxOua7Au X-Received: by 2002:a05:6a21:170b:b0:ef:e589:28a3 with SMTP id nv11-20020a056a21170b00b000efe58928a3mr1198054pzb.16.1681982368519; Thu, 20 Apr 2023 02:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681982368; cv=none; d=google.com; s=arc-20160816; b=mNCkWwypj8KyB6Lj/OlLg8xAxI5bNXKH5wFXE/U6gfZV5tf7xCW+3JRFGHw3OPqpo0 gUwBZ2JCadYk8Nd1HZHnzwWYAQfrKYMvhzdZbz6kXc7usWar/+IRjsxldddxTF7IRBew txwfrWsGnJfMERAR1QHTh4wTH9T+zL7dOtTjkrcYOdJdWt+NwxM+ZjV+TW9ezHOkkYGo cEs0sEcGZhPmWEwl4XIEG5/K84SBROg3xZKokvLWP3VojgmXLpmA6F4bcMcXyrQ/oj7B lmokWCfCDwhAavmbl8LX4233U3WJLEMn01/Yl6Jtf+L1k4217yDe3dHiA+1PRZDIdTvx Ekxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=3nhZjDHaJ334FIWpuzMOE5F3Bk26E5LBcaIBNbWiCzs=; b=nc0aENqZeW++vngnmopGeZKG/hQkeAJX2mnzWBojvJXYjMeWiU6Xx2dPRzisGoQ/b9 d8xug1A1JGgm0h7q4+iUs9yNVeiZepMifXhKmdG7jcquljQ++J3doLN0tHFoJi+XnPWp UGhhyAhSwURooZU2ZdUQvmbHOiDnKUWluIdbHz7mzm+VW97g6trY0bTQ11HVCDj56hAG MFoiI1fdJlgNowNKYxUCwknjCkSJjsTpJVh0yH0juo8ZLe5l7ktBhQN8ge1ba8yhlmvP OeeLLnx/+XIUYuTnPeT3mUIQhp3ZVFp2NFK/a0gZp4oc6OtR3OKWAmsmXykJJEylSNVa AQ4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=PFCjMVFR; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Dj+Tz4LU; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020a656499000000b005138574a0e8si1303005pgv.284.2023.04.20.02.19.12; Thu, 20 Apr 2023 02:19:28 -0700 (PDT) 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=@arndb.de header.s=fm2 header.b=PFCjMVFR; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Dj+Tz4LU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234026AbjDTJSJ (ORCPT + 99 others); Thu, 20 Apr 2023 05:18:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbjDTJSI (ORCPT ); Thu, 20 Apr 2023 05:18:08 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93555213F; Thu, 20 Apr 2023 02:18:07 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 009CF5C0274; Thu, 20 Apr 2023 05:18:07 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Thu, 20 Apr 2023 05:18:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1681982286; x=1682068686; bh=3n hZjDHaJ334FIWpuzMOE5F3Bk26E5LBcaIBNbWiCzs=; b=PFCjMVFR8xWZt8hxXM 6f3m+Y7Y38EftWG0FyTkI2OrmjO7kKXG2+pBmoKTG7zkH7QeZwHDh/r89IZMUEuG qNUHDnmXnyk+rrVtFdQAay6d3oIDWV3j4D74qje5vIHq+pI4l/1mMMCPxqRRAjYT 0XoZTif3wsRjrRvahKl8GqmsHDAzXv1JowSUwjntxHauyCC1K2pyjFr5S2NiWGG6 DL6j11D4CtCkvQzqdxTDy9DWgxlWwvnQ5s16Y2Djai6AhRYBy6IHNIR9RIXzcROg FcpaD2n6+RA4MblHQQ6rl6jSCi3GlE272tZte9tIsYYQz96l16HTeCIisCFsKbW4 wyZg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1681982286; x=1682068686; bh=3nhZjDHaJ334F IWpuzMOE5F3Bk26E5LBcaIBNbWiCzs=; b=Dj+Tz4LUdxf5mrYe1vSPX4w5L88GB /oKyJpJTTpHlYIKDmAtTDKJwQReHek+u4PAEleuSt/9AXCgNGYhBWlgDYEG57C7t hHuEcWDAE7UghA2xS5goMqU5orHu5WcbS55Lpz7CBM0wczb45NuEqH32ngGmyrZh o2+B0tRwLaG0QdItw7w8CyQeTSis2YySt/fpElsA8OAOVyUx7DCzZlG8AZ2/OZqr nu5bFpYf61+yI0U4bWEeGWccVSCs8IqOPgP/QPwD4LaIFrqpPwbyEUjJPM3r97X8 Qf3d/LLvIq1k/UNxVrrhvAS6SQuDAEtDO+q1wxu0fDcLrw5ZRgNKqhvQg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedtvddguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 01915B60086; Thu, 20 Apr 2023 05:18:03 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-372-g43825cb665-fm-20230411.003-g43825cb6 Mime-Version: 1.0 Message-Id: In-Reply-To: <20230420090101.80812-2-pawell@cadence.com> References: <20230420090101.80812-1-pawell@cadence.com> <20230420090101.80812-2-pawell@cadence.com> Date: Thu, 20 Apr 2023 11:17:43 +0200 From: "Arnd Bergmann" To: "Pawel Laszczak" , "Greg Kroah-Hartman" Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Daisy.Barrera@siriusxm.com, Cliff.Holden@siriusxm.com, "Tony Lindgren" , "Jean Delvare" , neal_liu@aspeedtech.com, "Linus Walleij" , egtvedt@samfundet.no, "Biju Das" , herve.codina@bootlin.com Subject: Re: [PATCH v2 1/4] usb: cdns2: Device side header file for CDNS2 driver Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 On Thu, Apr 20, 2023, at 11:00, Pawel Laszczak wrote: > Patch defines macros, registers and structures used by > Device side driver. > > Signed-off-by: Pawel Laszczak > +struct cdns2_ep0_regs { > + __u8 rxbc; > + __u8 txbc; > + __u8 cs; > + __u8 reserved1[4]; > + __u8 fifo; > + __le32 reserved2[94]; > + __u8 setupdat[8]; > + __u8 reserved4[88]; > + __u8 maxpack; > +} __packed; > +struct cdns2_epx_base { > + __le16 rxbc; > + __u8 rxcon; > + __u8 rxcs; > + __le16 txbc; > + __u8 txcon; > + __u8 txcs; > +} __packed; > +struct cdns2_epx_regs { > + __le32 reserved[2]; > + struct cdns2_epx_base ep[15]; > + __u8 reserved2[290]; > + __u8 endprst; > + __u8 reserved3[41]; > + __le16 isoautoarm; > + __u8 reserved4[10]; > + __le16 isodctrl; > + __le16 reserved5; > + __le16 isoautodump; > + __le32 reserved6; > + __le16 rxmaxpack[15]; > + __le32 reserved7[65]; > + __le32 rxstaddr[15]; > + __u8 reserved8[4]; > + __le32 txstaddr[15]; > + __u8 reserved9[98]; > + __le16 txmaxpack[15]; > +} __packed; Register structures should generally not be __packed, otherwise any multi-byte registers will be accessed as individual bytes on architectures that have no unaligned load/store. If you are worried about struct packing on OABI arm, you can mark it as both __packed and __aligned(4). Most drivers just avoid the problem by not defining these as structures but instead use macros with register offsets. Arnd