Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp735498ybh; Wed, 18 Mar 2020 08:12:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtvHC+CmrgVYJp3XAbb0znlqjSXjtoTRlZHN5OkwgIcFep3fgiImpWW00C5LSEiSwpgXuDX X-Received: by 2002:a05:6830:1aca:: with SMTP id r10mr3950862otc.330.1584544336600; Wed, 18 Mar 2020 08:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584544336; cv=none; d=google.com; s=arc-20160816; b=jA7KN16ErzoECt3EISQ87fTDLuPmaQE5JNU2kFZPThp5jbEYx7yFP2hbazZoJtFm1R BC6al6dPBPjwuoA2rIzvV+Fegqpizvq0bz3hIF6/9pwBPEneaQ3CPjE2cS+jb/B1/tol nU7eHVALpmJTvHzp0iJi0pKQdEVLrY6Mo7M6IkSPI3VJAfntGe3EaCYOiwsc6Avv3EA4 GrTcvVoYnwin6AnzCmTB9KbaGxmH5BohMxHzs/XjXyI2n30qYH2E5JA9FBlh16XFrI7o vbnmmh2sh6/an2l8xfND3YV0HGttuwwYirQH3/wDXoemSMDfhbaeSZi02JRc+SWamvIW W1eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=oZB95Lt2xbFL6HrC+Rp68HrNs0kkwLAG7FWpFQfPE/A=; b=eRY7rLjFjnw1B4n7WcUCTg6M2KVic8re86PmeRs1o1sHprHMO2lllnfRD/NkuiamzG kSa6wuk/yE5I1s296L/HXbtdGXySTeSf2hAU7TsOTIVIP8eYLquoQw9ijT/Unp12+bQ0 WrCFBzsw+1anqiTsoclgMpsJvVpwfLJTAmsQzLulBXGed0F4luY7GcK3ZEBwcv4YvgEn XcXNTj2DEMIPO5f+etH3xi785PtQQ6hhxp3NAqdSXL1AvR3Y082wYWb0/TCyw/YjXMeW UKJsSgoig5dcM+KN8C/jZzQ3lc+AlTph8i+TdFcXjoDhmZPNWCTZldxU2UFb3fPdi1mW HUIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u14si3561466otg.10.2020.03.18.08.12.03; Wed, 18 Mar 2020 08:12:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727477AbgCRPJn (ORCPT + 99 others); Wed, 18 Mar 2020 11:09:43 -0400 Received: from mga03.intel.com ([134.134.136.65]:4178 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727240AbgCRPJ0 (ORCPT ); Wed, 18 Mar 2020 11:09:26 -0400 IronPort-SDR: SRvoJ1UsaE9GPxsLflTWZEOK7mXfbPjTBADyX4MPs/YO4UwiiFjzwhjSOzkja69d/jHYRx3ae3 qain5uuH8cYQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2020 08:09:25 -0700 IronPort-SDR: QgXPe2zraTvcFJFPzJA53gRwWZDVVY7j8aM1EGopf5bVV+x4ePads7C5BXxBUX3mXm1k6cNcMu iS+7+VqwQqPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,568,1574150400"; d="scan'208";a="263410997" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga002.jf.intel.com with ESMTP; 18 Mar 2020 08:09:23 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jEaJx-00AnHz-KV; Wed, 18 Mar 2020 17:09:25 +0200 Date: Wed, 18 Mar 2020 17:09:25 +0200 From: Andy Shevchenko To: Heiko Stuebner Cc: gregkh@linuxfoundation.org, jslaby@suse.com, matwey.kornilov@gmail.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Heiko Stuebner Subject: Re: [PATCH 2/7] serial: 8250: add serial_in_poll_timeout helper Message-ID: <20200318150925.GM1922688@smile.fi.intel.com> References: <20200318142640.982763-1-heiko@sntech.de> <20200318142640.982763-3-heiko@sntech.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200318142640.982763-3-heiko@sntech.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 18, 2020 at 03:26:35PM +0100, Heiko Stuebner wrote: > From: Heiko Stuebner > > In cases where a serial register needs to be polled until a specific > state, this should have a timeout as noted in the thread bringing em485 > support to 8250_dw. > > To not re-implement timeout handling in each case, add a helper modelled > after readx_poll_timeout / regmap_read_poll_timeout to facilitate this. > +#define serial_in_poll_timeout(port, offs, val, cond, timeout_us) \ This can (re-)use readx_poll_timeout(). Example: https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git/commit/?h=testing&id=b0415c224926c6d94c778d72f3d44c83862eb214 -- With Best Regards, Andy Shevchenko