Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp437796iog; Wed, 29 Jun 2022 03:25:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sREuw9VlI3m/1QWqZcGz6MCbO+vZC0+zGXuodGM+MQmyKIQ0gpUGPJGuoMAm+5IU+ndT3J X-Received: by 2002:a63:4f22:0:b0:403:7c60:adae with SMTP id d34-20020a634f22000000b004037c60adaemr2388912pgb.225.1656498308855; Wed, 29 Jun 2022 03:25:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656498308; cv=none; d=google.com; s=arc-20160816; b=esH9MbwT2+tXhR1AFBRaqqry+mmC0AfMDcppfucSM/CS3v+dBiDKFT3tl9exbZ67D4 cpfL+2CGPx9OQ0phja6XM1o5C+uPoPjzdTw95MWkDcYDflo5QeHmOw31kjmNOmcDNhQY 6VPBmijYodMRM69wmRUXm8eMji8CVQ4JNRPiJ9wj/o0yyec5y6jitpnN+9IriHRCumi5 PvI48iOKi/1QuWzhE3svTXFlXuHbezxfuqRpVSjiMlfyMkY92iadYkzSX6okG96TvJaD NeV3bLSJU+ywxX+o/cjPvYMR9MBx0fStOxJtL4yR/KByyLc1IwvST2kDlfMO1rezZrRl lwqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=GElelnyPu+t07uIEEMNg6LAxOxXoiqjQ91T5C4EviUo=; b=nnQtuibgg6ZUirJRiTORxPme4GuS5soeuKvKYvzVo4NoVvQ4lcjCVplsQjSJyhOxoS Qzg9klGZcJ4PZO6ZIbnoa3Hc/oqwQqZujO9reYOJSBCl8aAlokYV8RBYVqzj2k2XTCeP L3sWUdcJwq9vWlsBVa+lotAeuB/XMDj5ow9Kk02onclScaTuzuzTJhPP+9aoUfuJ+ZG0 LbWTiY30budzH6q3eOOqqXqeFpOyRxp3XIkXeH8LrtTpjgaiYhiTxNCmmxORLEIJ/LVB HqYZXGQl4kFuo/n4osfuTcUGzFyLw1733S3kHRVHo6WMZjW3sUi/YMg2po9eCK12zPu4 EsBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=k5Dz9Mh6; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a056a00124b00b00518da2b2c2bsi3522128pfi.221.2022.06.29.03.24.57; Wed, 29 Jun 2022 03:25:08 -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=@gmail.com header.s=20210112 header.b=k5Dz9Mh6; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233084AbiF2JwB (ORCPT + 99 others); Wed, 29 Jun 2022 05:52:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233108AbiF2Jvw (ORCPT ); Wed, 29 Jun 2022 05:51:52 -0400 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5210C3D4AB; Wed, 29 Jun 2022 02:51:51 -0700 (PDT) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-3177f4ce3e2so142733977b3.5; Wed, 29 Jun 2022 02:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GElelnyPu+t07uIEEMNg6LAxOxXoiqjQ91T5C4EviUo=; b=k5Dz9Mh62sOyTMvK1jWeC2gk1L7MIejLDCiZiyIRvcclCRkz4ozx33pOhMPnvNMVUl MjyFTRHSY8KdXW81PV6z5oHynmj5QMU8LplegY5n5eWyBQGtOSkfZJJuapRR8+SwYBtQ rROmUXBAUjkrru2etvsjnCDJFjt04o8vFd+u6AoOV49seRLM8K9wtA8GSpXsPEgQuLvF PJlB1eeddl4lI1TzBtc98SQsuQ4dambMemxNJPm5SW51QctVQjPoJvl7zW4nke/Ggapy daYEhlJkgp8BZbpn/ObnS2Cl+6FWaFTG5dxo1MoLDAvr1cwcFNQelzoDIS+o7p4Xij86 3rTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GElelnyPu+t07uIEEMNg6LAxOxXoiqjQ91T5C4EviUo=; b=L9TTzv8FdhtCFWDHOi5hj/gjTSBne/VLJwyvlJgLOKmH0wUKhfwJQ2Ll7im0yQhGIh Od/+YDJSOyaOvpRouWZtEPFJLtIS1u0i0rPbvNqDcYO1AUkOIrNiwzV4owLaacXWaPwO 3ilEYqpH9YlbCDHEmh3Q7SNh3mmsBSEbjq8oIDK0D4Rk1ef0B5bp68EONJvNkogadr3G 6cyPFiG+JgIiqI2g9kF9SSaHaVg/15T+14Vkx5ua1zVQiVRHbMtNlMKxusniDLIcVd1r C/glclTPlHeod9gbqK0stOwOW7jnaRaOsYvn4QTn5E0E/SceqKXI8fKnaKvVv2W3UgtL Qbcw== X-Gm-Message-State: AJIora/wNxzOrsq3Sx3/paO/b5fPa5Kx1ICOAYFhh0jQYV/jTMzLM0Q0 QhZmTQwlQr9OGSdMZpFaKuCYzrVCX+LQElMReXs= X-Received: by 2002:a81:5d88:0:b0:318:31c1:56f3 with SMTP id r130-20020a815d88000000b0031831c156f3mr2860106ywb.18.1656496310543; Wed, 29 Jun 2022 02:51:50 -0700 (PDT) MIME-Version: 1.0 References: <20220628134234.53771-1-ilpo.jarvinen@linux.intel.com> <20220628134234.53771-5-ilpo.jarvinen@linux.intel.com> <29b084c-183b-4a84-2376-2c88eff7d5a@linux.intel.com> In-Reply-To: From: Andy Shevchenko Date: Wed, 29 Jun 2022 11:51:13 +0200 Message-ID: Subject: Re: [PATCH 4/4] serial: 8250_dw: Rework ->serial_out() LCR write retry logic To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: "open list:SERIAL DRIVERS" , Greg KH , Jiri Slaby , Andy Shevchenko , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Wed, Jun 29, 2022 at 11:40 AM Ilpo J=C3=A4rvinen wrote: > On Wed, 29 Jun 2022, Andy Shevchenko wrote: > > On Wed, Jun 29, 2022 at 10:47 AM Ilpo J=C3=A4rvinen > > wrote: > > > On Tue, 28 Jun 2022, Andy Shevchenko wrote: ... > > > Eh, are you suggesting I should do write as a side-effect inside one = of > > > the iopoll.h macros? Because those available seem to only read? > > > > > > Or should I create another macro there which writes too? > > > > It seems to me that it would be a macro on top of iopoll's one which > > will take an op read and op write arguments depending on the case. > > The thing is those iopoll macros don't return until the timeout is > exhausted It returns when the condition is true (in your case verify_lcr is OK). > so I don't think I can reuse them easily for this task ("on top > of iopoll's one")? That is, w/o some major side-effect hack (which is > IMHO a no-go). Basically what we need is a write-read type of polling. With your current approach I don't like that retries assignment is duplicated several times and decrement happens in the callee. What I'm trying to suggest is to research alternatives. --=20 With Best Regards, Andy Shevchenko