Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753221AbdF2TA0 (ORCPT ); Thu, 29 Jun 2017 15:00:26 -0400 Received: from ale.deltatee.com ([207.54.116.67]:51843 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752506AbdF2TAT (ORCPT ); Thu, 29 Jun 2017 15:00:19 -0400 To: Allen Hubbe , linux-ntb@googlegroups.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170629032648.3073-1-logang@deltatee.com> <20170629032648.3073-7-logang@deltatee.com> <000301d2f103$3310ca60$99325f20$@dell.com> Cc: "'Jon Mason'" , "'Dave Jiang'" , "'Bjorn Helgaas'" , "'Greg Kroah-Hartman'" , "'Kurt Schwemmer'" , "'Stephen Bates'" , "'Serge Semin'" From: Logan Gunthorpe Message-ID: <079047c1-6612-2814-e147-844fabd56b75@deltatee.com> Date: Thu, 29 Jun 2017 13:00:06 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <000301d2f103$3310ca60$99325f20$@dell.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.111 X-SA-Exim-Rcpt-To: fancer.lancer@gmail.com, sbates@raithlin.com, kurt.schwemmer@microsemi.com, gregkh@linuxfoundation.org, bhelgaas@google.com, dave.jiang@intel.com, jdmason@kudzu.us, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-ntb@googlegroups.com, Allen.Hubbe@dell.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH 06/16] ntb: add check and comment for link up to mw_count and mw_get_align X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1167 Lines: 20 On 6/29/2017 12:11 PM, Allen Hubbe wrote: > Nak. This breaks a work around for stability issues on some hardware. I am ok with changing the comment to say, this is only supported when called after link up. I would still like to allow these to be called at any time. Specific hardware drivers like Switchtec may return an error. Upstream drivers, of course, should call these after link up: patch 5/16 part of this set looks good. If absolutely necessary I can leave this out. But in terms of interface design it's _so_ much better to have it in. This change would bring the score from a 3 to a 5 on Rusty Russel's Hard to Misuse ranking[1]. To quote Rusty: "3. Read the documentation and you'll get it right. People only read instructions after they've already tied themselves into a knot. Then they skim them for keywords and don't read your warnings. I don't give an example of this; if this is the best an interface can get do, it's in trouble." Can someone not just fix the out-of-tree code? And since when is out-of-tree code reasonable justification for what's done in upstream? Logan [1]http://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html