Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4180064yba; Tue, 7 May 2019 13:32:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0otRdXzARByu/X3/ktkW9cmZduqlVfs+m8IuamK62+9chZV51Us0gHPWnopzOTMqkTHJk X-Received: by 2002:a62:a503:: with SMTP id v3mr43966412pfm.32.1557261174540; Tue, 07 May 2019 13:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557261174; cv=none; d=google.com; s=arc-20160816; b=JeGlWv9B3uPJbTHh+WKW8eiNGlUPIfnriQrFzXVEweWU7EzbygDICj7f0hK45nev3o dEz37l+anHJjDq5fUG5jZ0PINCZxOED2i4dc27bbsIXxcfCXlqK0FVT6I7PvitbILBfe jJ4TBBiWQiAngkrnfylQViMG7lcFKWVQdqot2ju2W9CevzH1DqasWluhmdoDzSesx6h5 rSBXls63Ad34qHg6W7dBgj3ZaZigShV0OsuYLPbPE+VfoNTpYbWf2XKq/zeVG32plzI0 daJuPcaYx1WKjexTLbpeZQOZFjD82PNcxc13M8E1SdAIxjXgPdypjslBn1P5SHJ/mq+s 9qPQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=prXl6iiKu/d9Mr0csXgDhv1X2W+6bQLvAPYo5QH/v0w=; b=uCqR5f6x3QWO38s0iU6puMmWqStT2QPwKhL3ZgYzpz8lKmI6mzZ0RfJ9y9t2CrYvdR Mrw3P4H44xwb6l9Vxycj/x8O0J+MPCxcyyjV2h9m176EofddpgJNXTDetXUk1Eo/shtj T+uBy0MGw0owcxCag/RHskqJP1pQgVr152VWt5KlkfYQ0+SMB7ulha/xdEt/wbQA2r8A fhSpVB5hSvA7lNFiEvJ1ydpQG6XTZCY0oJxmcmctgMOFZVDeZel6MIcJbibmzBYWAKP8 ehrnzXQwj5Yx1VsF93zB6p49M0dgVBGDiBYdElP5pV7BPksx0lBc/93AJ0jrZdDCYgV1 StwQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si19653385plp.361.2019.05.07.13.32.36; Tue, 07 May 2019 13:32:54 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726494AbfEGUbo (ORCPT + 99 others); Tue, 7 May 2019 16:31:44 -0400 Received: from mga07.intel.com ([134.134.136.100]:42507 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbfEGUbo (ORCPT ); Tue, 7 May 2019 16:31:44 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2019 13:31:43 -0700 Received: from unknown (HELO [10.232.112.171]) ([10.232.112.171]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/AES256-SHA; 07 May 2019 13:31:42 -0700 Subject: Re: [PATCH v2 6/7] nvme-pci: add device coredump support To: Akinobu Mita , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Jens Axboe , Sagi Grimberg , Keith Busch , Minwoo Im , Johannes Berg , Christoph Hellwig References: <1557248314-4238-1-git-send-email-akinobu.mita@gmail.com> <1557248314-4238-7-git-send-email-akinobu.mita@gmail.com> From: "Heitke, Kenneth" Message-ID: Date: Tue, 7 May 2019 14:31:41 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1557248314-4238-7-git-send-email-akinobu.mita@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/7/2019 10:58 AM, Akinobu Mita wrote: > + > +static int nvme_get_telemetry_log_blocks(struct nvme_ctrl *ctrl, void *buf, > + size_t bytes, loff_t offset) > +{ > + const size_t chunk_size = ctrl->max_hw_sectors * ctrl->page_size; Just curious if chunk_size is correct since page size and block size can be different. > + loff_t pos = 0; > + > + while (pos < bytes) { > + size_t size = min_t(size_t, bytes - pos, chunk_size); > + int ret; > + > + ret = nvme_get_log(ctrl, NVME_NSID_ALL, NVME_LOG_TELEMETRY_CTRL, > + 0, buf + pos, size, offset + pos); > + if (ret) > + return ret; > + > + pos += size; > + } > + > + return 0; > +}