Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp4740108imd; Tue, 30 Oct 2018 06:48:27 -0700 (PDT) X-Google-Smtp-Source: AJdET5cX+p1jbjMiqhhs0UspONGtrmPEloujjJKJTqmI34LhJlys515OdROsoHdhC9/LkkkOs0Z/ X-Received: by 2002:a63:bc12:: with SMTP id q18-v6mr17511648pge.353.1540907307617; Tue, 30 Oct 2018 06:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540907307; cv=none; d=google.com; s=arc-20160816; b=WLQvTx2b7E3PlaF1pK+0YNkILffOE0tb7ICKwoFRfpt1UayUAa7aZGRCepWt56WniD qOKK3rFRDLL4NSDS1WpMie45y9oNG8OkTfa9HO1QUFXE2a9abor3KDgomHFcx9y8TSNw 5HFJiOy6snGq0a3wt28ocmWeWsk5dJc9JOE3+wqZaHTDd2F5yim1ky0dwit7PYzsRg6w l3XPUjJqkHXVOHe8lmQYgP+w6oLDo2IepI1gIG8shAdaxluRlIvDAOc9zWlnQHDNgClb h82BboY/fzXiJRJnjVF37MPw9+dXrisC5dpOXKrFvrpfin0fCsXoGp8z7Votc/BSOAy5 fp+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=pBrN8begXF4SmUcpCS3LR9wt7Gky2MnWdXirvv7Y9Ms=; b=C4Lk7/raSGdfah68DY+we1eM4NJf9zE8/kLwjMfUBsbR8byJyNVbPntuk6/jM20YDf mwlVeoh1MIpWd8vqzsKisQJ8AEl2b9YXcSsB2Nngx6zAPNEiaWwW0+p671NppLK5DwLT LJtv7tqvjlAyV2djoEa/WG0jWT83DRhbykcty2DI8gmZzpNhG/UFp0dl9GyCD1ZrqKuM cLCFDRoq3s+MHVjot2An1WSC4Pm4Uk/osyp4rxINx8Q2fuwca1gTgGmwXMzdIWl7RVmC curZf9HIfDhnovvZ7C2VGBlbBkvhtvm4aYx7Bvuc0tQ2dLhk2rWzgRIEs8Wz2k29NAcV yv3g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si3029250plc.409.2018.10.30.06.48.11; Tue, 30 Oct 2018 06:48:27 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728162AbeJ3Wkr (ORCPT + 99 others); Tue, 30 Oct 2018 18:40:47 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53962 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727450AbeJ3Wkq (ORCPT ); Tue, 30 Oct 2018 18:40:46 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1gHUMK-0008EU-OL; Tue, 30 Oct 2018 14:47:04 +0100 Date: Tue, 30 Oct 2018 14:47:04 +0100 From: Kurt Kanzenbach To: Andrew Lunn Cc: Anirudha Sarangi , John Linn , "David S. Miller" , Michal Simek , Radhey Shyam Pandey , YueHaibing , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2] net: xlinx: mdio: recheck condition after timeout Message-ID: <20181030134704.l673d7pm5mwysx2o@linutronix.de> References: <20181030093139.10226-1-kurt@linutronix.de> <20181030120831.GC27873@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181030120831.GC27873@lunn.ch> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On Tue, Oct 30, 2018 at 01:08:31PM +0100, Andrew Lunn wrote: > On Tue, Oct 30, 2018 at 10:31:37AM +0100, Kurt Kanzenbach wrote: > > Hi, > > > > the Xilinx mdio wait functions may return false positives under certain > > circumstances: If the functions get preempted between reading the corresponding > > mdio register and checking for the timeout, they could falsely indicate a > > timeout. > > Hi Kurt > > I wonder if it would be possible to add a readx_poll_timeout() which > passes two parameters to op()? actually I was thinking about using readx_poll_timeout(). But as you already pointed out, it expects only one parameter for op(). I'm not sure about adding a new readx_poll_timeout() macro. > > I keep seeing this basic problem in various drivers, and try to point > people towards readx_poll_timeout(), but it is not the best of fit. > > Otherwise, could you add a axienet_ior_read_mcr(lp), and use > readx_poll_timeout() as is? I guess that would work. I'll use readx_poll_timeout() for both wait functions and send a v2. Thanks, Kurt