Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1119343iog; Wed, 15 Jun 2022 22:08:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u6ofHGxgxoTo3232COCJyhDivRx7pjYydKlquB605pqUP0GMvopzdAPjVCLA4cDYwnX+Df X-Received: by 2002:a17:90b:388b:b0:1e8:7347:c3cd with SMTP id mu11-20020a17090b388b00b001e87347c3cdmr14153943pjb.135.1655356136212; Wed, 15 Jun 2022 22:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655356136; cv=none; d=google.com; s=arc-20160816; b=eTqpo3Qa1tWpwkaWkK43ce/Vfk8zbHmATTpq7IK/sWVGBHmTVy9B1HeHLdOafqNY8A wX1NZ0FQqRVdap00jTsv9fqV2O1eWnWMb9Z8L/PXgZ9ohx6g2OHT9lK6OyTRsInX/c1r j9Yj/VWcuZDO14kmShCsMnudARM14nrM6qHALZFCjlfWdoNXPYuSQWBo0ZZpzbtKL/cA fFd6+J9efXx/JWPC362LC/zUcQjrzovj6bCeC1AlQ42/sHXX5/BbsIbGgt8cpvUbeSC7 w3jUVSa/epqdZ+AnDyVzvKn28IP1pgLDLYRIzwuS+KBjbJQiGDmhomf6lg1Uqmbf0IqY 0Ubw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=116UIsGcn16o2UWvxBXBxTHlTDKC2HHe3GPiY7JeBDg=; b=LWHGfYhZDhTF6LnX3ItFVrpfo4TQfIjzkOy+NTx9oit7f9V9+X7ZSGiEzWtjcta7sz iKkbZQK6s7oIyF1XiYk/VGqOD5/dwDHpMsa141NIyAChSA8/OjJ3GPmwZRmVAqzvo0lC mas9zQ5f5hGihY0o/rfWfuzsgZ2HhvE2oLpPMDY85E1xBGg0VL5rnnw8cYScYG5hMjpk k+lZE8JZ4XJDu2jws+vbcaylrVLIM1w+MV/N22AZiirlxcFGomM88hIaSyFPaz3TD8AE 5w3P6ERmbgTKW0KIhdMjJCSVTDi8qveddDGkXe9QLSFo5npb/wqd1plqcOpzNUjcJsLP 0WDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YqicQFhf; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i63-20020a638742000000b003fe22d70808si1292894pge.569.2022.06.15.22.08.43; Wed, 15 Jun 2022 22:08:56 -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=@intel.com header.s=Intel header.b=YqicQFhf; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244611AbiFPFE1 (ORCPT + 99 others); Thu, 16 Jun 2022 01:04:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349153AbiFPFE0 (ORCPT ); Thu, 16 Jun 2022 01:04:26 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B536A5A154; Wed, 15 Jun 2022 22:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655355861; x=1686891861; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=BLWxLUoPpHR0Mx/K28WEXQm09XW/3QsGGK6+7EjrGps=; b=YqicQFhf27pgy/EYaHH4rHemWejTPzjOvhddlF0K2tfvUNmCkR3wyJRW I5bxU9kEnKsh5y8U4wMZ/AjYnCgOnBcnGqBCU2bnXpNyDWQAfuWts62DV yYSDhaz8mvtJSpYG5UwW8FhexNAhKwg6t2Dhd+tyCVBtCuQZwzVVsgXyt A01PeGN6WZv3ZvqWMf9lJpNjobklYg2md8FOGfbAQFAgksDj4MNUsg3Co dlyyIAvlHKV66nZ8SqR3BVKs1ccffKqe2APsmszX7t4xGXkdtk0qdw/dd 8pGJIw1Qfsx/0tW0Nj2joOIOC1l1noz4zGgQPyVies1ZwjcdP4U4dAJNg Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10379"; a="277963358" X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="277963358" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 22:04:21 -0700 X-IronPort-AV: E=Sophos;i="5.91,304,1647327600"; d="scan'208";a="589477564" Received: from mngueron-mobl1.amr.corp.intel.com ([10.252.60.248]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 22:04:16 -0700 Date: Thu, 16 Jun 2022 08:04:09 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Andy Shevchenko cc: linux-serial , Greg KH , Jiri Slaby , Jonathan Corbet , Arnd Bergmann , linux-doc@vger.kernel.org, LKML , linux-arch@vger.kernel.org, Lukas Wunner , =?ISO-8859-15?Q?Uwe_Kleine-K=F6nig?= , Lino Sanfilippo , linux-api@vger.kernel.org Subject: Re: [PATCH v7 5/6] serial: Support for RS-485 multipoint addresses In-Reply-To: Message-ID: References: <20220615124829.34516-1-ilpo.jarvinen@linux.intel.com> <20220615124829.34516-6-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1441432405-1655355860=:1693" X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1441432405-1655355860=:1693 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT On Wed, 15 Jun 2022, Andy Shevchenko wrote: > On Wed, Jun 15, 2022 at 03:48:28PM +0300, Ilpo J?rvinen wrote: > > Add support for RS-485 multipoint addressing using 9th bit [*]. The > > addressing mode is configured through .rs485_config(). > > > > ADDRB in termios indicates 9th bit addressing mode is enabled. In this > > mode, 9th bit is used to indicate an address (byte) within the > > communication line. ADDRB can only be enabled/disabled through > > .rs485_config() that is also responsible for setting the destination and > > receiver (filter) addresses. > > > > [*] Technically, RS485 is just an electronic spec and does not itself > > specify the 9th bit addressing mode but 9th bit seems at least > > "semi-standard" way to do addressing with RS485. > > > > Cc: Arnd Bergmann > > Cc: Jonathan Corbet > > Cc: linux-api@vger.kernel.org > > Cc: linux-doc@vger.kernel.org > > Cc: linux-kernel@vger.kernel.org > > Cc: linux-arch@vger.kernel.org > > Hmm... In order to reduce commit messages you can move these Cc:s after the > cutter line ('---'). Ok, although the toolchain I use didn't support preserving --- content so I had to create hack to preserve them, hopefully nothing backfires due to the hack. :-) > > - __u32 padding[5]; /* Memory is cheap, new structs > > - are a royal PITA .. */ > > + __u8 addr_recv; > > + __u8 addr_dest; > > + __u8 padding[2 + 4 * sizeof(__u32)]; /* Memory is cheap, new structs > > + * are a royal PITA .. */ > > I'm not sure it's an equivalent. I would leave u32 members untouched, so > something like > > __u8 addr_recv; > __u8 addr_dest; > __u8 padding0[2]; /* Memory is cheap, new structs > __u32 padding1[4]; * are a royal PITA .. */ > > And repeating about `pahole` tool which may be useful here to check for ABI > potential changes. I cannot take __u32 padding[] away like that, this is an uapi header. Or do you mean I should create anonymous union? ...I'm skeptical that can be pulled off w/o breaking user-space compile in some circumstances. Anon unions were only introduced by C11 but is it ok to rely on C11 in uapi/ headers? Even making padding smaller has some unwanted consequences if somebody is clearing just .padding. In retrospect, having padding as a direct member doesn't seem a good idea. That padding[5] should have been within an union right from the start to make this easily extendable. Maybe create a copy of that struct under another name which is just equal sized, that would give more freedom on member naming. But can I change ioctl's param type to another struct (in _IOR/_IOWR) w/o breaking something? -- i. --8323329-1441432405-1655355860=:1693--