From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A8EAC433EF for ; Fri, 15 Oct 2021 05:09:44 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9EE29611C3 for ; Fri, 15 Oct 2021 05:09:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9EE29611C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HVvTL0v0Nz3bhg for ; Fri, 15 Oct 2021 16:09:42 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=jms.id.au header.i=@jms.id.au header.a=rsa-sha256 header.s=google header.b=eFZkvPCh; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::72a; helo=mail-qk1-x72a.google.com; envelope-from=joel.stan@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=jms.id.au header.i=@jms.id.au header.a=rsa-sha256 header.s=google header.b=eFZkvPCh; dkim-atps=neutral Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HVvSZ2GCDz2yxj; Fri, 15 Oct 2021 16:09:01 +1100 (AEDT) Received: by mail-qk1-x72a.google.com with SMTP id l7so7625209qkk.0; Thu, 14 Oct 2021 22:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a8L8tI7fdWPVyLQWYDtFqLlsNHHScmHBHQCVqZSRnUA=; b=eFZkvPChLYCKGXv27qtba5UyFdqjjqownlsjEdy+4EKngt/MVChZWaXXsNpPRqtNdZ Uzpw6KMUk5imyPD/9a0ErDBs/mUyNpju3rXqNtXZRRYZunGxPC8MaPaIdzfix/J//PYy ug/ORwkTSl/NfS/h6FrpYcrn9TBQUZvtNC9lQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a8L8tI7fdWPVyLQWYDtFqLlsNHHScmHBHQCVqZSRnUA=; b=JG24pWkUqTyxJhJij8BCPtckvqnz+dErT61jxFHVXESeL3s8hqXIfu/MWFBpNRg5V0 CABPRDtuaNm/GiCmwA6KJXa0LZXRyoUV8bABP5rBtFM/ctefjBkks00YRLptyLVLpSza yUmspkHfy0Mh6zImLQVVWaAS9Hhra8u9jA+Ti6YQqe1EKYCpnBo47rOKQnNKoPq/3qC+ BKXJCt+BQWg83RGNYme+Klo9Qr7Epu+0ioiUUay6RGzhvaQkfUergl6UeSzxzICnewS6 QGvpE9ERi+gb1dVvkqDYl+joITNwMx5zVeBsNflNOxzC1/XsxQ9fZQ6yUcK4JXXtHC2v SZBQ== X-Gm-Message-State: AOAM530iUIyQW5rye2lgMQbKOFHYdkc+k7SW4s2c6seriaf19Jr39La3 vmAh6Rn0GW2d/543NpmK8M8HS802zKgtxFfv/oY= X-Google-Smtp-Source: ABdhPJzuAMBgm8X5B5WDZpgXeLp9fa14Q/T2EoOBrzxlSLdt7SSEQHnrVDk/B8pW7JurHxpiT6HH0sn98mY2EuNrha4= X-Received: by 2002:a05:620a:4247:: with SMTP id w7mr8273900qko.381.1634274538886; Thu, 14 Oct 2021 22:08:58 -0700 (PDT) MIME-Version: 1.0 References: <20210920190031.22168-1-eajames@linux.ibm.com> In-Reply-To: <20210920190031.22168-1-eajames@linux.ibm.com> From: Joel Stanley Date: Fri, 15 Oct 2021 05:08:47 +0000 Message-ID: Subject: Re: [PATCH] fsi: sbefifo: Add sysfs file indicating a timeout error To: Eddie James , Amitay Isaacs Content-Type: text/plain; charset="UTF-8" X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: OpenBMC Maillist , Linux Kernel Mailing List , linux-fsi@lists.ozlabs.org Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" On Mon, 20 Sept 2021 at 19:00, Eddie James wrote: > > The SBEFIFO timeout error requires special handling in userspace > to do recovery operations. Add a sysfs file to indicate a timeout > error, and notify pollers when a timeout occurs. Should this have some documentation too? What userspace uses this? Looks good to me otherwise. Reviewed-by: Joel Stanley > > Signed-off-by: Eddie James > --- > drivers/fsi/fsi-sbefifo.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c > index 84cb965bfed5..b414ab4431ef 100644 > --- a/drivers/fsi/fsi-sbefifo.c > +++ b/drivers/fsi/fsi-sbefifo.c > @@ -124,6 +124,7 @@ struct sbefifo { > bool broken; > bool dead; > bool async_ffdc; > + bool timed_out; > }; > > struct sbefifo_user { > @@ -136,6 +137,14 @@ struct sbefifo_user { > > static DEFINE_MUTEX(sbefifo_ffdc_mutex); > > +static ssize_t timeout_show(struct device *dev, struct device_attribute *attr, > + char *buf) > +{ > + struct sbefifo *sbefifo = container_of(dev, struct sbefifo, dev); > + > + return sysfs_emit(buf, "%d\n", sbefifo->timed_out ? 1 : 0); > +} > +static DEVICE_ATTR_RO(timeout); > > static void __sbefifo_dump_ffdc(struct device *dev, const __be32 *ffdc, > size_t ffdc_sz, bool internal) > @@ -462,11 +471,14 @@ static int sbefifo_wait(struct sbefifo *sbefifo, bool up, > break; > } > if (!ready) { > + sysfs_notify(&sbefifo->dev.kobj, NULL, dev_attr_timeout.attr.name); > + sbefifo->timed_out = true; > dev_err(dev, "%s FIFO Timeout ! status=%08x\n", up ? "UP" : "DOWN", sts); > return -ETIMEDOUT; > } > dev_vdbg(dev, "End of wait status: %08x\n", sts); > > + sbefifo->timed_out = false; > *status = sts; > > return 0; > @@ -993,6 +1005,8 @@ static int sbefifo_probe(struct device *dev) > child_name); > } > > + device_create_file(&sbefifo->dev, &dev_attr_timeout); > + > return 0; > err_free_minor: > fsi_free_minor(sbefifo->dev.devt); > @@ -1018,6 +1032,8 @@ static int sbefifo_remove(struct device *dev) > > dev_dbg(dev, "Removing sbefifo device...\n"); > > + device_remove_file(&sbefifo->dev, &dev_attr_timeout); > + > mutex_lock(&sbefifo->lock); > sbefifo->dead = true; > mutex_unlock(&sbefifo->lock); > -- > 2.27.0 >