Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2509868imm; Thu, 18 Oct 2018 16:15:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV62h0H8x+0uoTzONIU6L09VFdVhUC/SIWYg+lMfgHftnyK+0JEPVG+owDblaDTwdPhhIJQ5C X-Received: by 2002:a63:c20f:: with SMTP id b15-v6mr30315672pgd.13.1539904504725; Thu, 18 Oct 2018 16:15:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539904504; cv=none; d=google.com; s=arc-20160816; b=ioXpEg1jP6YPy/bJ9ovvxAuOeV69EdHvjqmcw2BTHbvsvaDOJ3VcPQjHG+aePUDX9P QUtHwMDLUlPfBVGp77J4OSO/x1GTLGnv4GIqiIiT2TQUIvb/4woRp1Cob+pAVSDHRkTC ev3eTT7d+6rBNv61XC7s8fXR4gFDiAGi2fkptXRfsGP8xwX07uans4KjErOYrDTp4Crq xo1V6EUcVAA4NGfGsthYeEUiDCWNwNGTE1jLQ09LTSJj2TH/pRJ0jVAk/x2Wh7eBCzyX Yv7k5KnYWu/7jVKRl7gV149Pil2mTaocmq+CcpZygcV6Rr5lw7JDaVHMVh+0GyeuyRqg S1rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature:dkim-signature; bh=qReEp1SB7cdYYzkyrhBEtjS5cQF4GJTebujWTxuRncA=; b=r12SdaItTdoLU+4d9YYhp/tGPETNf/YZ8+v7dNtrJOSQ6pwyAt4Yjm5Z5k/t5KvvJt 2R9oZOXvHOg7x8btkH+kkITEzF2/phYRNXDh8c/iEKCgyOPBtBr++Xm6sOg7GB0LbDBf 4EwAWa2xgzPmKM6k6iJHsfkikfDFVHjK8QAigFgnDaEtjJKJdxmDK0tw7nHV1M2N6K3a +eO7JkyoPjhc3vp/aatGpu9KtI11TFcTzAucbTQ2tXwvBgBj90vutiMpzw5aFxPxi0cK O7om2NjwcCVpylA4HMYSM9v3Udnk2oAbwTYK+08vuh832e530SnXdc6FALfnCAAaoPPh stBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mendozajonas.com header.s=fm1 header.b=JCa2LC7B; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=XP6d0pBV; 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 r13-v6si7938753pgb.355.2018.10.18.16.14.49; Thu, 18 Oct 2018 16:15:04 -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; dkim=pass header.i=@mendozajonas.com header.s=fm1 header.b=JCa2LC7B; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=XP6d0pBV; 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 S1727076AbeJSHQG (ORCPT + 99 others); Fri, 19 Oct 2018 03:16:06 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:46595 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbeJSHQG (ORCPT ); Fri, 19 Oct 2018 03:16:06 -0400 X-Greylist: delayed 451 seconds by postgrey-1.27 at vger.kernel.org; Fri, 19 Oct 2018 03:16:05 EDT Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 58B58226DF; Thu, 18 Oct 2018 19:05:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 18 Oct 2018 19:05:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=message-id:subject:from:to:cc:date :in-reply-to:references:content-type:mime-version :content-transfer-encoding; s=fm1; bh=qReEp1SB7cdYYzkyrhBEtjS5cQ F4GJTebujWTxuRncA=; b=JCa2LC7BX3wwMhgy3ermK4atJ8UBvW00AVWfTv5Uz7 E6FyWdsusA2/7U4QMmKh0nkCROMYCH69zkbprrc0rNFF8Ae8fnlB2Lk+WZCFU/Wc 5uCO8cD8oUMVb0pYeZEuOqHO3ubQy4KW8DeFFbDV0kQbCXA0vQPtiA7Fkh/GRJ7X dADIiZoyzi3eoghzuVx9G5qLKCOuzYuX6WXYot3G+hx15zCHkiIVXfLcnGj8e9lc enhI8Uq87/e9XlxnLDyiNvtCxXWwE/GgVm4VcfNgiYe0meIMak+jiNE0Ufo26130 3KtLntKVjSA0MMidMBc70IiXMxzFiEUFoab7IM4AmqdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=qReEp1SB7cdYYzkyrhBEtjS5cQF4GJTebujWTxuRn cA=; b=XP6d0pBVsU4AVtBnlDeymuNjTXbykOEcgZ5Py2pGeSXMQwiovxfWB3rLg hn6evMyiqcCBQK+9ZviKKB0yhk78CK1u59m6DAAyLOEgIrhIO+XtCQC6nucg8ltJ k+NfG/nqcHY4Ez6Pby7JAQSN3p/Bz6M2nISSPpFjeFmm7M7pkqlxPOnmjAH0s9bt z6icUg0t0wbFYFXn1XKp2D57u+6d8oTJdVjndIymC72obyiglUZW/sNgd3aeeNJT 9IpygvCrq7DN5iT2IR7sm0WOCVf1q/PB+iW70MvXNRm7rAO4AUembE8Lkh/zIf95 ZWjztn4U+E2xYxBDhhTrlPiONIDEw== X-ME-Sender: X-ME-Proxy: Received: from v4 (pa49-180-141-13.pa.nsw.optusnet.com.au [49.180.141.13]) by mail.messagingengine.com (Postfix) with ESMTPA id 14EE8E462B; Thu, 18 Oct 2018 19:05:14 -0400 (EDT) Message-ID: <7f3744217190fe94bb1df879fa107593e911d7b5.camel@mendozajonas.com> Subject: Re: [PATCH net-next 0/6] net/ncsi: Allow enabling multiple packages & channels From: Samuel Mendoza-Jonas To: David Miller Cc: netdev@vger.kernel.org, Justin.Lee1@Dell.com, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Date: Fri, 19 Oct 2018 10:05:09 +1100 In-Reply-To: <20181018.155647.1045018243241594303.davem@davemloft.net> References: <20181018035917.19413-1-sam@mendozajonas.com> <20181018.155647.1045018243241594303.davem@davemloft.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-10-18 at 15:56 -0700, David Miller wrote: > From: Samuel Mendoza-Jonas > Date: Thu, 18 Oct 2018 14:59:11 +1100 > > > This series extends the NCSI driver to configure multiple packages > > and/or channels simultaneously. Since the RFC series this includes a few > > extra changes to fix areas in the driver that either made this harder or > > were roadblocks due to deviations from the NCSI specification. > > > > Patches 1 & 2 fix two issues where the driver made assumptions about the > > capabilities of the NCSI topology. > > Patches 3 & 4 change some internal semantics slightly to make multi-mode > > easier. > > Patch 5 introduces a cleaner way of reconfiguring the NCSI configuration > > and keeping track of channel states. > > Patch 6 implements the main multi-package/multi-channel configuration, > > configured via the Netlink interface. > > > > Readers who have an interesting NCSI setup - especially multi-package > > with HWA - please test! I think I've covered all permutations but I > > don't have infinite hardware to test on. > > This doesn't apply cleanly to net-next. Does it depend upon changes > applied elsewhere? You must always make that explicit. Ah, my mistake; I hadn't updated my net-next branch recently enough and missed Vijay's OEM command patch. Will rebase. > > Also, please explain this locking in ncsi_reset_dev(): > > + NCSI_FOR_EACH_PACKAGE(ndp, np) { > + NCSI_FOR_EACH_CHANNEL(np, nc) { > + spin_lock_irqsave(&nc->lock, flags); > + enabled = nc->monitor.enabled; > + state = nc->state; > + spin_unlock_irqrestore(&nc->lock, flags); > + > + if (enabled) > + ncsi_stop_channel_monitor(nc); > + if (state == NCSI_CHANNEL_ACTIVE) { > + active = nc; > + break; > + } > > Is that really protecting anything? > > Right after you drop np->lock those two values can change, the state > of the 'nc' can change such that it isn't NCSI_CHANNEL_ACTIVE anymore > etc. > > At best this locking makes sure thatn enabled and state are consistent > with respect to eachother, only. It doesn't guarantee anything about > the stability of the state of the object at all, and it can change > right from under you. And you've caught this correctly, I'll fix this up in the rebase to protect actually checking the channel/monitor state. Thanks, Sam