Received: by 2002:a05:6512:404:0:0:0:0 with SMTP id u4csp499714lfk; Wed, 15 Jun 2022 07:22:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sqmz7GBz+E5gX7yfQiWr7PIcGdKN2T1S24irGEeJW186KmASz2VmzWV9kVGc+nGu6ot6zL X-Received: by 2002:a63:c00c:0:b0:3fc:dc35:6192 with SMTP id h12-20020a63c00c000000b003fcdc356192mr55432pgg.7.1655302927839; Wed, 15 Jun 2022 07:22:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655302927; cv=none; d=google.com; s=arc-20160816; b=GH/3HfRvjAyiUyf4NnGVAxNsOQl4FipkwDh8YAlBG5wSbnCAggDh5Su+dIkXPhQS2j 4xGISZj17t9NjEMXibUBxJuGiFrm8uEriiXRKdlsv014v5lFde6J4DJJ781XLSFsxfag CFscMaapLrdX1hU5VUH1+0rGjA6kx9L2yMjwa3cwO8n6LA4bNssUqf16KVptfktsjngz Co9O1SIgYTifF+63Ni3Hmp6HgZPW5c3c1dQeeNZjPnwGsGZdpg+LWaDCzIfHZMwvMTfU /PJwvvkn5AjGI7Jhj2kVyjEb7AS+yjDXH6KPVe/TlQHCYKbaD67rD7mFePDewEGLl5wo US4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UQ5xkF0xHi3gqGKJ1JPdJIrvOpbiju3y1Ig7QfPyDgg=; b=anm+By10g5rtUw1VJxhf8B05hysi3D5SXQ7uzgnyQLfahi4If8h8DL1DeWudSit0Uk FPvZZ6HsPrk6MrG+Ju5S798NRK4E6qmz/Jey9xrW9G4C1bb7X6yXz967uS2ffMk9IF6Y NceG6VvvKIbj5AC5qVIO5lsqEr304qX7kXp/5kv4teckIWmE0697k4nECqrdmqCl8jZn 7Ij/azqOG7HSBNE8e1riVYDN2HMMSEERIb+TfMwoX+yEMF1bKfZsXHI9LxpGofwoyFSF GM20DNdlJ9O3F2oZ4/G7cCNLu9zc2hXQ5/D4fvMQ6lbzgNDTn6kVm6Hzc92b1ItEV+FM lS8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j7s2LQCi; 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 t4-20020a170902bc4400b001675c833af5si15466863plz.401.2022.06.15.07.21.53; Wed, 15 Jun 2022 07:22:07 -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=j7s2LQCi; 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 S1345871AbiFOOOZ (ORCPT + 99 others); Wed, 15 Jun 2022 10:14:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346085AbiFOONr (ORCPT ); Wed, 15 Jun 2022 10:13:47 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA65128E34; Wed, 15 Jun 2022 07:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655302426; x=1686838426; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=B8TiHIv5Q07n74NXSDQu97TnsKK0fjGHsjxfyj1wpiY=; b=j7s2LQCiH9CKxMSDH7iK001hej/is0TvhiFUsIDii4844ClqkgD1K5Sq T4JY0+935qE90NBYUmLzfqYjlIO5JNE98WaI4s3lDMn0hAJwcTaQFiEc5 8fBNXHG13OPkxqDx8PpnQ1H+se38knaOYn0TmrqnktyzhsFZVxDBBvYan KL+KWnQnVkPeXSyGJzSWiKmwilaIzvbYv2Sae4+o1sfZo4S8c6j4ozWsc CcwcPBnB8XmwG50cUr7zMApYucDAXYomLHS5WSAfENO48NOi5EOqbEOYC bkus4cvuDpCxnar1o/PHXpgl+LGtzl5aNgx8w1THZAr0ae9KLYD5RAxpO g==; X-IronPort-AV: E=McAfee;i="6400,9594,10378"; a="267662562" X-IronPort-AV: E=Sophos;i="5.91,302,1647327600"; d="scan'208";a="267662562" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 07:13:20 -0700 X-IronPort-AV: E=Sophos;i="5.91,302,1647327600"; d="scan'208";a="536053581" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 07:13:17 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1o1Tlh-000dUY-Vg; Wed, 15 Jun 2022 17:13:13 +0300 Date: Wed, 15 Jun 2022 17:13:13 +0300 From: Andy Shevchenko To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , Jonathan Corbet , Arnd Bergmann , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Lukas Wunner , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Lino Sanfilippo , linux-api@vger.kernel.org Subject: Re: [PATCH v7 5/6] serial: Support for RS-485 multipoint addresses 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: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220615124829.34516-6-ilpo.jarvinen@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 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 ('---'). ... > - __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. -- With Best Regards, Andy Shevchenko