Received: by 10.192.165.156 with SMTP id m28csp904882imm; Fri, 13 Apr 2018 09:48:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/DtjLrEjyZ3yQi/jen1e+PbqZu1+JAUJN4VvwuIbZ0Y2UY2lroglvuJutT+bvINl8ztXE0 X-Received: by 10.99.128.73 with SMTP id j70mr4739871pgd.12.1523638118526; Fri, 13 Apr 2018 09:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523638118; cv=none; d=google.com; s=arc-20160816; b=iFvVmVvyqQfUNU33fmkmid2PL8Esm+3h3BhOwIEZOSK3Y1mDI7Rgz8XrcBM/NrqBtw RN5ZXHQ/V4WhqhhnfXI+aw8N0hpsef/crc5BQ2EuuluCl6ex5FS6ePPSSyf9eYAvG17d jApnpuE1nCzSR1cv+gcaZq0nyJ036RzMWIdx4Nsx8govgzY3PweYxueRGHnoqWZ+UPDw TIjkf0nER82YOjeM66t2S4RCn2Eu/mB3pmtJRc/EhfpRt6QzLfrsYfspyMpCgIdAu2rm dtvUhZZeJ2GTZZPPf3fXXyNaZooP+ISKNptf34Fx0cdjeqX9aKZIK/sRDGaCVb/VfrOV nCAg== 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:arc-authentication-results; bh=qjd1hxeBZp2iaPGYDvIfDbc6dExrsYOH4D/0Fhc3ppc=; b=N+RYXThCvMuTNYB/kbXjbpr2uZAFasBgwQdD3WKIBly3nhuUqq2b7z8KpDv+6vhZAs 1+QJXSY+n7c5Ap0KbYSfH4XjhjuADPFQt7dNCFP2L6yg6DxgG0RmwGp4Wjt8ZSWIyJH0 7bGte5vTvSSe2sYnkStXtAmE/k+b4yZ3Pn9JdRoL3oczkJHLA6NvuZ+vMtewhsqnWgNH pZhs/F4ptV3u95HbKCqyeuYRW128OnahBiEIxzcAbu9RnUsWlJTE4Rpzdby5pYxWwig2 l4HLT/Ofuy5yK8KeN+G8VSGBpgQwJEbRwOIAkHX/GPQs7kdCQb2SBzA6U3yaYlOpgB0U PLWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=PfLwET6j; 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 e127si4814746pfc.315.2018.04.13.09.48.24; Fri, 13 Apr 2018 09:48:38 -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=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=PfLwET6j; 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 S1752775AbeDMQrQ (ORCPT + 99 others); Fri, 13 Apr 2018 12:47:16 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:52210 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750923AbeDMQrN (ORCPT ); Fri, 13 Apr 2018 12:47:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bIeCndwlM0B6xglrucebonlVphrBm/ECJYjnZhoZ77s=; b=PfLwET6jKMIss4O/Bu0iJz4Kl /L7clS0M4GXDycfjU/B6e/aGvRZ1p6UbxprmOwqndjZ2dWya/8noNpfZgvoPa2nX5IjroRWIpxJm2 HFi2F8QCFUAHbxF7/w1N27WaJWsgl2GxJVE4dqUr2UahlksSDL8fjRFcwFWnbdD9uq1uYmwob/+Hv PAmJZvHoTu9ghiZ0zY790Ntbx+9sUVGRZTvUhbaN4rTW1Itp8yLn25HwR0Nos+k5j34hcRXDhdoNV IAcFsTMGb1SdB2A26GMfHC7to9ymyc32E9J2wugEsCY9veMIKIKDln3vuErB+uTUOOWZmxs/kPiV9 dGaz0tWxA==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f71qy-0002GR-Dx; Fri, 13 Apr 2018 16:47:12 +0000 Date: Fri, 13 Apr 2018 09:47:10 -0700 From: Darren Hart To: Vadim Pasternak Cc: andy.shevchenko@gmail.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, jiri@resnulli.us, michaelsh@mellanox.com, ivecera@redhat.com Subject: Re: [PATCH v1 3/7] platform/mellanox: mlxreg-hotplug: add extra cycle for hotplug work queue Message-ID: <20180413164710.GE27560@fury> References: <1522144927-56512-1-git-send-email-vadimp@mellanox.com> <1522144927-56512-4-git-send-email-vadimp@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522144927-56512-4-git-send-email-vadimp@mellanox.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 27, 2018 at 10:02:03AM +0000, Vadim Pasternak wrote: > It adds missed logic for signal acknowledge, by adding an extra run for > work queue in case a signal is received, but no specific signal assertion > is detected. Such case theoretically can happen for example in case > several units are removed or inserted at the same time. In this situation > acknowledge for some signal can be missed at signal top aggreagation > status level. Why can they be missed? What does "signal top aggregation status level" mean? I'm asking to confirm that we are fixing this at the right place, and not just applying a suboptimal bandaid by running the workqueue more. ... > > Fixes: 1f976f6978bf ("platform/x86: Move Mellanox platform hotplug driver to platform/mellanox") You didn't mention above how this commit caused this - how did moving the driver create this problem? Does this need to go to stable? I'm assuming not as you've called it theoretical - not something you've observed in practice? ... > static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv, > @@ -410,6 +413,18 @@ static void mlxreg_hotplug_work_handler(struct work_struct *work) > aggr_asserted = priv->aggr_cache ^ regval; > priv->aggr_cache = regval; > > + /* > + * Handler is invoked, but no assertion is detected at top aggregation > + * status level. Set aggr_asserted to mask value to allow handler extra > + * run over all relevant signals to recover any missed signal. > + */ > + if (priv->not_asserted == MLXREG_HOTPLUG_NOT_ASSERT) { > + priv->not_asserted = 0; > + aggr_asserted = pdata->mask; > + } > + if (!aggr_asserted) We seem to check aggr_asserted in several places in this routine now. Looks like something we could simplify. If you check it here, can you drop the check lower in the routine? Can you remove it from the for loop if conditional entirely? Please consider how to simplify. -- Darren Hart VMware Open Source Technology Center