Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp759072pxb; Fri, 8 Jan 2021 18:32:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXC/MI/NDOXUQcRqvSujX+dyV7RkP2eGTFRfFWWLn3NIw/WeDYFTWFt1AErmADKYVsjIcb X-Received: by 2002:a17:906:4e45:: with SMTP id g5mr4364555ejw.391.1610159552663; Fri, 08 Jan 2021 18:32:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610159552; cv=none; d=google.com; s=arc-20160816; b=iv3bVhHwm9LQOToFcZmV1zcbHlKZC3fEV3ILRaxSC0RObYIH7/18yHAUkJdf6PGrwJ eDqspkMRaQm+sXsrJR9ggvDL+CriDuuKxDKOQR1lDLnz0a1ASg3tZawX66BmJIJQzMI1 YwUVn4moSASxayzgaa90EOd2ZUo3yBbVmv5af10xi/g89YrrcAlMKnGc/xSi+H463Eqe UMHCCPgDT6AecoVvDgnRMthxYqB/IIYVQH93r/U7I7OJSGXYHQUhkUY9S9cVP3cUETVi eLt7R2uko4s24FIkDC1UORCIaLEUHpFWLCIW5lvGHtLc64YKKbfWnUDZ/bD/PuiNslhm 95tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date:sender :dkim-signature; bh=b+XgQyUnCoOiGgr+1GYfr3DJzHJ7A/npVw+YL/876VE=; b=Qe1VN/hjcLQgkkXg3L4LG3NlPXgMgX48A/LJpUEOcowLktDdTbxeZKY8MiQxXN9LTV CPo9VqCSiZEdnYgWX8Pr/lQX7GlYJea/6inql1u6ypll3jcvRTOSbwiUaFXpOGXeTYS5 A1NaxfBpUu6k2De7dLRRd6wflIoyaqoIOtoLfv5R5K5dndNifW0cqE17rIgcgdykD7xn +MnfMi9ipIMM3LYTLJXGuVvWYkisiqWh3mFZdUhYjF6v3uUqdH+oqFUNzqS7XIvQp7iW FHa6lBPqAaTxcmhcuHzVhemUm+r/DbGyuuGLaRGjDha0JLHqhRZZXnpmTUFXeSf4JE1i unGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="H573ePv/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw4si4030492ejb.196.2021.01.08.18.32.09; Fri, 08 Jan 2021 18:32:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="H573ePv/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726510AbhAIC3A (ORCPT + 99 others); Fri, 8 Jan 2021 21:29:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbhAIC3A (ORCPT ); Fri, 8 Jan 2021 21:29:00 -0500 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE64EC061573 for ; Fri, 8 Jan 2021 18:28:19 -0800 (PST) Received: by mail-oi1-x22d.google.com with SMTP id d203so13707419oia.0 for ; Fri, 08 Jan 2021 18:28:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:reply-to:references :mime-version:content-disposition:in-reply-to; bh=b+XgQyUnCoOiGgr+1GYfr3DJzHJ7A/npVw+YL/876VE=; b=H573ePv/AtnMkHsZ/24KmwfivLwt9HN3mg9yC5QfsVSoMmqUrG5/amVIQqaTb2t0CM FLVOJzbi35ExhVdMJzfE3JAWoT9HGQTdBFmJ+OoCW1O5uRQjJmcS7rM1O0eYfImON91r bhwiUD3Dhy6qX2p+YPHRdG7fk1auT8789ykXv4xoCOs/xIo8iknnaREdcia91KDx4c+r 9t6nsPGupWmAg85kEBzqR3F0hYjAMq0hDskkJlm8gf/N+rrmQRkx4mRfmRwui7ZP8mTj b/yMYnSSnsrHd/SxLCwW62tTG51fe6GOHYrProzWqnR5nAE3ltC8Fh/xgob0sFqoKZ89 PB+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-disposition:in-reply-to; bh=b+XgQyUnCoOiGgr+1GYfr3DJzHJ7A/npVw+YL/876VE=; b=ByhIYsqo17oWhFN7GRRZUy9WlEkks+wL1EE/ZDlakC5SsivoXmgvm9YP0952xabr9Z In1YIjNyct06CxJGz2s1la/hxiOKpH0PZQtlPNEYIdv9rG4GIsMephU79bxsIJ3V1iaC Bl4Mlq2teosolerlxJI0QtGr2pUyPkmqAwt0rDD9v4zpwULb2PPf3KlvYLBy96QAh/WC +dSbulgDdya4dz8a3U5EnahXBCDXJp3BhUeO/A/kHyJukctj1dAfcgh8y1AYm/Jbx1vh nPYrWn4Hu4hBj46dEhFDlNScjLjFW3ZJXI8a6QvaW/b44GZHH8rozG9rWho9cXin+lKI aOtQ== X-Gm-Message-State: AOAM531+Aiz28EmeI70xjNJWDDe3cqvfnaoFs7JBJc4VxCw/S/QrPDzv M2s9eFoqOUNan7DRdqlMa7DgbXfFmg== X-Received: by 2002:a54:4e81:: with SMTP id c1mr4003808oiy.52.1610159298968; Fri, 08 Jan 2021 18:28:18 -0800 (PST) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id s77sm2145277oos.27.2021.01.08.18.28.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 18:28:17 -0800 (PST) Sender: Corey Minyard Received: from minyard.net (unknown [IPv6:2001:470:b8f6:1b:e49d:8694:914c:6014]) by serve.minyard.net (Postfix) with ESMTPSA id 9B0CA18003C; Sat, 9 Jan 2021 02:28:16 +0000 (UTC) Date: Fri, 8 Jan 2021 20:28:15 -0600 From: Corey Minyard To: Asmaa Mnebhi Cc: "linux-kernel@vger.kernel.org" Subject: Re: ipmi_msghandler.c question Message-ID: <20210109022815.GA3324@minyard.net> Reply-To: minyard@acm.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 08, 2021 at 11:37:04PM +0000, Asmaa Mnebhi wrote: > Hi Corey, > > I have a question for you related to the following function in ipmi_msghandler.c > > static void __get_guid(struct ipmi_smi *intf) > { > int rv; > struct bmc_device *bmc = intf->bmc; > > bmc->dyn_guid_set = 2; > intf->null_user_handler = guid_handler; > rv = send_guid_cmd(intf, 0); > if (rv) > /* Send failed, no GUID available. */ > bmc->dyn_guid_set = 0; > else > wait_event(intf->waitq, bmc->dyn_guid_set != 2); > > /* dyn_guid_set makes the guid data available. */ > smp_rmb(); > > intf->null_user_handler = NULL; > } > > Why is wait_event used as opposed to wait_event_timeout? In the context where the dyn_guid_set value doesn't change from 2, this would run forever. Wouldn't we want to timeout after a certain amount of time? > The low-level IPMI driver is guarateed to return a response to a message, though if something goes wrong with the BMC it can take a few seconds to return the failure message. So it shouldn't be an issue. -corey > Thanks. > Asmaa