Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6888893ybh; Thu, 8 Aug 2019 07:13:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLn/oym+PbBdVaqkb3crWBzsp9uDTU+Uo39/aMaKSt2Lw9GwElpGFJ/2KMnjVMNBZUuFYd X-Received: by 2002:a17:90a:9b08:: with SMTP id f8mr4319318pjp.103.1565273613164; Thu, 08 Aug 2019 07:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565273613; cv=none; d=google.com; s=arc-20160816; b=Ds1ZUH6C6Eau5teaE/i3p7t+KUZXGra8r7bQJGnife2ZiSOUICXlMUgsgmq2SysB28 Dy/59MyimuDyHV91r7vWNRbgzL/s5S8Ub48L5hRcopHlnk8ftJkej86ruQYojCUhr5N7 4VVCOQX/yHHseAXzPMBUT6sWtjCbwZG9KN6R8M3JGgaJ2oaF5bJBPyRNH6I+E+QuECHY yUghjvwSO+g0/o6TKh/9iWrRI8mkE3WCeZLvs8mCPodSJRgTfS2OoWi44sfNhKPL7Qg9 FwyE6ujYn23l1g8OWFh5rVuPrFND3UTCGn73O3lKFrJQjUn5O5XhaxhDmD2WRq4pDhpC pDog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=r6O0K0Lbnp4hA0AJPB0Knf0/Gqi93FxhoE5wp3HoaE0=; b=wSDn7kRD7ghBRFRljoLG8WXC+G1dJVH7AXlMWDfVZVEZ2eQf3yqoEha2KQWGiMg/Y1 idioVZeLjHHQhPDKs5kINBs+SJbhvEAnbQyQOoUZbhFxauIgBCkMUeZqJYG3L0T4Bwmw V3CmcjKtfYd5KehUdtmTy6qZMPZ+45sUxala/Ge1EMI5amOgvJPXBezcbQzFNpmtE2sA +pPkBIA2N7Plhk7jSsCjatepGnp0xeSrBqD3qVaZ68BuE7+LN70z2O2oQE+Up8g9l0sj e6XnxHT8mNjiWYxJVy8d3bvIIezGs75tP8tJIuLyY+5JvTlazOyRyRKKFKf7WBwbr7zw gWqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OoyThrHN; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j69si11861498plb.78.2019.08.08.07.13.17; Thu, 08 Aug 2019 07:13:33 -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=@gmail.com header.s=20161025 header.b=OoyThrHN; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403890AbfHHOM0 (ORCPT + 99 others); Thu, 8 Aug 2019 10:12:26 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:39614 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403797AbfHHOMZ (ORCPT ); Thu, 8 Aug 2019 10:12:25 -0400 Received: by mail-vs1-f68.google.com with SMTP id u3so63100122vsh.6 for ; Thu, 08 Aug 2019 07:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=r6O0K0Lbnp4hA0AJPB0Knf0/Gqi93FxhoE5wp3HoaE0=; b=OoyThrHNHWSiQ2llrUFoT/+F6P++B3XNStkFuyZCAo4LzRZPqx505VtlW/Yybsuw2y 0hRKq5rAOuYiOiKK2sm4nzPupAIIhQbbPKVP/xK2r/JDkwRotrfRn+lYZLAijjeCs4vL Nq9yxZiBrSP3acR/7iCX5KMrvNgaAZEQ/WPmMEwMjEK4Bl9shfsg/LG6Ex34KM2MiSnT 5aKk543EBaWIh95X+tQpEFpipexilcO+1KEveDXDTR9eFMsefK6eUGrGRO+B+BRCZK8k UxwPJsjOCaFZIgW/LfntNyytKp1sEQJKnW4fiVd4c8hyMcpC002LNvuV5Z00/fv99muY Q7og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r6O0K0Lbnp4hA0AJPB0Knf0/Gqi93FxhoE5wp3HoaE0=; b=QKJ3aFRD2zielGCRl2EjcPKmgOoAN0kNjRJIc7issL9e104yBFgZmlvv24emfCJ1Vg TH0ZzK7TXO2RBYH8DAKBPVg3otvobSa5qruvjMXnGFFf1m20goSxugJTFh4y9LsjAV3d OtZ4ol4OuvRGmSWKRXElekuKs8Sm/8CI5T35Hq7qseuxtNQuSfzd1b13mrGmGJSSGnHY zZO3gslEfP2PSuOqpKHtxZw8BOAK+q5xC7Yciow35NvQD6+YICcUac0hwMlpMWC37e4E FR4m+1exQwpI1K/zAvb7g36DsO71tVgPm+vcyh1rY8VDNodgGLN3VUpLoIsYvibPTrgE 75kw== X-Gm-Message-State: APjAAAWxsn7J9tQJul3hVamOLMDiv+Vpw93cF3oiL31enkgFX3VozBvH vD5LfLfFc2/0bQRjXaElYf8oxahoa1M5HANot/mdXg== X-Received: by 2002:a67:e3d5:: with SMTP id k21mr9505435vsm.172.1565273544734; Thu, 08 Aug 2019 07:12:24 -0700 (PDT) MIME-Version: 1.0 References: <20190808122956.12789-1-ttayar@habana.ai> In-Reply-To: <20190808122956.12789-1-ttayar@habana.ai> From: Oded Gabbay Date: Thu, 8 Aug 2019 17:11:58 +0300 Message-ID: Subject: Re: [PATCH] habanalabs: Handle HW_IP_INFO if device disabled or in reset To: Tomer Tayar Cc: "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 8, 2019 at 3:30 PM Tomer Tayar wrote: > > The HW IP information is relevant even if the device is disabled or in > reset, so always handle the corresponding INFO IOCTL opcode. > > Signed-off-by: Tomer Tayar > --- > drivers/misc/habanalabs/habanalabs_ioctl.c | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) > > diff --git a/drivers/misc/habanalabs/habanalabs_ioctl.c b/drivers/misc/habanalabs/habanalabs_ioctl.c > index 3ce65459b01c..589324ac19d0 100644 > --- a/drivers/misc/habanalabs/habanalabs_ioctl.c > +++ b/drivers/misc/habanalabs/habanalabs_ioctl.c > @@ -204,10 +204,21 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data, > struct hl_device *hdev = hpriv->hdev; > int rc; > > - /* We want to return device status even if it disabled or in reset */ > - if (args->op == HL_INFO_DEVICE_STATUS) > + /* > + * Information is returned for the following opcodes even if the device > + * is disabled or in reset. > + */ > + switch (args->op) { > + case HL_INFO_HW_IP_INFO: > + return hw_ip_info(hdev, args); > + > + case HL_INFO_DEVICE_STATUS: > return device_status_info(hdev, args); > > + default: > + break; > + } > + > if (hl_device_disabled_or_in_reset(hdev)) { > dev_warn_ratelimited(dev, > "Device is %s. Can't execute INFO IOCTL\n", > @@ -216,10 +227,6 @@ static int _hl_info_ioctl(struct hl_fpriv *hpriv, void *data, > } > > switch (args->op) { > - case HL_INFO_HW_IP_INFO: > - rc = hw_ip_info(hdev, args); > - break; > - > case HL_INFO_HW_EVENTS: > rc = hw_events_info(hdev, args); > break; > -- > 2.17.1 > This patch is: Reviewed-by: Oded Gabbay