Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5918055imu; Mon, 26 Nov 2018 06:54:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/UmTsskx076j8vYcDosLZUWdB4Trjd0x8KxxmsgKvEroFXXPcq3ND8HpNbkMrk3JUa0156D X-Received: by 2002:a62:53c5:: with SMTP id h188mr18069458pfb.190.1543244059573; Mon, 26 Nov 2018 06:54:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543244059; cv=none; d=google.com; s=arc-20160816; b=XhPHQXxWa82k5Zl9qb2OaJlhRsyT7IcwXKIzkFr0B+wWgZcwsFVhktffNCUQ83PzJ4 Y2A+3VI+F1hTQLuJuuIBSyLtPChw82XxqpYaYT24QnUDNH+W93oKMl2UVadyqYIGETnp E/07P46Uzi0d67E0Hp6JkJDHM3j2JbkkD/M+o0ydym8coqaZWJ2aQIRGcrIfE3FW+Bia 4GToJOxQ5Q1XK49l0XDAKjw/yWGH1jnEhmO3fRXqkNZ6ekUcw5KD/Djrw499D8Agbt9m tadvaBeHCZuH8+rPj9oW1JAEHMdWo+/spIRZES/QvEFFn1x0YUMHmUTaYElMrsoiDrj6 BPGg== 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:dkim-signature; bh=qpeqr1RVm0aX6xRtJv8DUVFMfa9V7O7COPfCVjJm3Dc=; b=XW3qiUy24b5W7jeZwC7goExcTUD5/IwomqmZB0MhiJEd6S434pylJHe7eLFpmTPpLL gNcVYEhhML+k8Eyk/Xzwswh/LoIx5x2ENPkhemw+rrEi2yxHV/cMx+vCUafup/fd1koX ATZQRvybSSFhWVv4vy4v0nHaJC1F5b0JipoohdwuLXjrudPr4AaKiKr6dl1D6nurdsRu w/O/fMfLKqoRQjkAVhYUmb2HXcukPlXGgGG3+87yKdyS3jrS1i6i8yZHVGjQ6IJqYFK1 LvnTAH08F/RQuT3DZ09v4RSF7nfkNq1aLlaaj0uiY1kw/Nff0sGTN3mLF6wRwclC5ot9 gNXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=s2W9wA5+; 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 i23si541775pgb.116.2018.11.26.06.53.48; Mon, 26 Nov 2018 06:54:19 -0800 (PST) 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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=s2W9wA5+; 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 S1727008AbeK0Bqf (ORCPT + 99 others); Mon, 26 Nov 2018 20:46:35 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:49499 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbeK0Bqe (ORCPT ); Mon, 26 Nov 2018 20:46:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=qpeqr1RVm0aX6xRtJv8DUVFMfa9V7O7COPfCVjJm3Dc=; b=s2W9wA5+FbJOZLmt9nEhpG6OtZnxzBXshJRYUT/x/2y/pAoJGI/Vo5VVPpOfB+qCz9C2SD4xSHvdYjObnhojAAeSDZmbb31JuotDTye8xoHTI2bHXA37wyIxh+zprpwC/qB6uEtFOWyEH8HjBeb0ohd9YcrLPv59JEVKbCRbOx0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1gRIF8-0004fZ-AE; Mon, 26 Nov 2018 15:52:10 +0100 Date: Mon, 26 Nov 2018 15:52:10 +0100 From: Andrew Lunn To: Claudiu.Beznea@microchip.com Cc: harini.katakam@xilinx.com, Nicolas.Ferre@microchip.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, michal.simek@xilinx.com, harinikatakamlinux@gmail.com, harinik@xilinx.com, shubhrajyoti.datta@xilinx.com, sai.pavan.boddu@xilinx.com Subject: Re: [PATCH v2 1/4] net: macb: Check MDIO state before read/write and use timeouts Message-ID: <20181126145210.GD12116@lunn.ch> References: <1543216072-9623-1-git-send-email-harini.katakam@xilinx.com> <1543216072-9623-2-git-send-email-harini.katakam@xilinx.com> <5de882e3-65ac-7ff1-bb55-7537666dfc77@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5de882e3-65ac-7ff1-bb55-7537666dfc77@microchip.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 26, 2018 at 02:46:01PM +0000, Claudiu.Beznea@microchip.com wrote: > Hi Harini, > > On 26.11.2018 09:07, Harini Katakam wrote: > > From: Harini Katakam > > > > Replace the while loop in MDIO read/write functions with a timeout. > > In addition, add a check for MDIO bus busy before initiating a new > > operation as well to make sure there is no ongoing MDIO operation. > > Is this MDIO bus busy check necessary? The caller of > macb_mdio_read/macb_mdio_write locks the mdio bus mutex before calling it > (e.g. mdiobus_read). Hi Claudiu It depends on the implementation. A write operation you could just launch, but not wait for it to complete, allowing you to do other stuff while the hardware is busy. For the next operation you then do need to check the previous operation has completed. I've not checked it is actually implemented this way. Andrew