Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1091306ybi; Sat, 8 Jun 2019 02:15:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4Y2FafokimttRsrRliVGKKVptM31VkCuJlo+lsfZxPrcHxo2+tO3tAjAr6W7yxezMY5pb X-Received: by 2002:a17:90a:3aed:: with SMTP id b100mr10429116pjc.63.1559985346881; Sat, 08 Jun 2019 02:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559985346; cv=none; d=google.com; s=arc-20160816; b=fhBD8FrzHs1AIdYqlzUr2qOWTMVbr1+S8unyQlUXhk5tTQhbQz5SmesCldWJ9mI60z pf5lIypZU1f05DSFTpVYzgm1fi9uWMnSVucdx7+vpHerzANtpyuLnwfCnoX5oioqlxbX 29PDgyvb1KUT+ScHLf7BJoliTfcpW48XIxNXUVM8vUDRk0jLhZd/wkBcf8HZiEhwHNpj IgGceKeoZRm4UztqdLtO+AB0UmQYbt3aHWfychQhz/P/3iSpQXYoub0z7p7471MR8Ax/ Er+E43KerwInNUm7yph30yUudRQYZcJkHDo5KkwYOlxi6uVp2s5oiuwLe+YoEoqvf61o XZMA== 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:dkim-signature; bh=MMiLmgNqJUSrJfw+GaF3nM145kVYKZXwjH0MmNsHYnE=; b=gWDY+9z+vBIiosM+SMauGbhfOWiiDm5UEzoSu3eQ5lfHrSKhpfUbop5Xsriby/dWbh wPMafQEB7re/EthyM+HBrf/muH0OyalvwlHH94kCLEYqmJsop/LH8b/4NqjS9n6Ypltc MY33fjMtwh0isFIWXRxMdcOGf4JQ3cITNR3FCspkrqqr7oVF1lvSb0O9teeiEUa8uNm7 wgIVJJrtM67fe2AwKXA8wVsD9hWkWnbOU1EtC60I2N3rKldM5gI4qfnOPHq68oKRWPb8 05ghornT9TaHnKG6PdIbklEVDc0/cCFOKld0jd0jCejZrpZrCpU330jczY36eEJPHCM+ V9FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=oxaM1Xis; 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=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b20si3927278pjo.107.2019.06.08.02.15.30; Sat, 08 Jun 2019 02:15:46 -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=@yandex-team.ru header.s=default header.b=oxaM1Xis; 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=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726785AbfFHJM6 (ORCPT + 99 others); Sat, 8 Jun 2019 05:12:58 -0400 Received: from forwardcorp1j.mail.yandex.net ([5.45.199.163]:54554 "EHLO forwardcorp1j.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726478AbfFHJM6 (ORCPT ); Sat, 8 Jun 2019 05:12:58 -0400 Received: from mxbackcorp1j.mail.yandex.net (mxbackcorp1j.mail.yandex.net [IPv6:2a02:6b8:0:1619::162]) by forwardcorp1j.mail.yandex.net (Yandex) with ESMTP id AA5982E0DB6; Sat, 8 Jun 2019 12:12:54 +0300 (MSK) Received: from smtpcorp1o.mail.yandex.net (smtpcorp1o.mail.yandex.net [2a02:6b8:0:1a2d::30]) by mxbackcorp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id QsaXMhCqJa-CrO0pb2o; Sat, 08 Jun 2019 12:12:54 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1559985174; bh=MMiLmgNqJUSrJfw+GaF3nM145kVYKZXwjH0MmNsHYnE=; h=In-Reply-To:Message-ID:From:Date:References:To:Subject:Cc; b=oxaM1Xist0o3ZYctT6hPBHwXsMEwEtne7sZuaC2AhLCTbKfHH2g2Vbq6WrpOmAm7q 0w53IkIB0dMeXpVT6fAKGZU/M49zsaITjV/keuzdLGZZgiRLeNcsdtu5bCbV24uqxu BV5xWjfRv1MbhWMmcdLqXGb03nlr3mUAjBYwcG2U= Authentication-Results: mxbackcorp1j.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-iva.dhcp.yndx.net (dynamic-iva.dhcp.yndx.net [2a02:6b8:0:827::1:20]) by smtpcorp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id hX5gvk80Kz-CrYqk4qr; Sat, 08 Jun 2019 12:12:53 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Subject: Re: [PATCH] drivers/ata: print trim features at device initialization To: "Martin K. Petersen" , Christoph Hellwig Cc: Jens Axboe , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Monakhov References: <155989287898.1506.14253954112551051148.stgit@buzz> From: Konstantin Khlebnikov Message-ID: Date: Sat, 8 Jun 2019 12:12:52 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07.06.2019 19:58, Martin K. Petersen wrote: > > Konstantin, > >> + if (dev->horkage & ATA_HORKAGE_NOTRIM) >> + trim_status = "backlisted"; > > blacklisted Oops. My bad. > >> + else >> + trim_status = "supported"; >> + >> + if (!ata_fpdma_dsm_supported(dev)) >> + trim_queued = "no"; >> + else if (dev->horkage & ATA_HORKAGE_NO_NCQ_TRIM) >> + trim_queued = "backlisted"; > > ditto > >> + else >> + trim_queued = "yes"; > > Why is trim_status "supported" and trim_queued/trim_zero "yes"? Hmm. This seems properties of trim, not independent features. > >> + >> + if (!ata_id_has_zero_after_trim(id)) >> + trim_zero = "no"; >> + else if (dev->horkage & ATA_HORKAGE_ZERO_AFTER_TRIM) >> + trim_zero = "yes"; >> + else >> + trim_zero = "maybe"; >> + >> + ata_dev_info(dev, "trim: %s, queued: %s, zero_after_trim: %s\n", >> + trim_status, trim_queued, trim_zero); >> + } >> + > > Otherwise no particular objections. We were trying to limit noise during > boot which is why this information originally went to sysfs instead of > being printed during probe. > On 08.06.2019 11:25, Christoph Hellwig wrote:> On Fri, Jun 07, 2019 at 10:34:39AM +0300, Konstantin Khlebnikov wrote: > > Do we really need to spam dmesg with even more ATA crap? What about > a sysfs file that can be read on demand instead? > Makes sense. Trim state is exposed for ata_device: /sys/class/ata_device/devX.Y/trim but there is no link from scsi device to ata device so they hard to match. I'll think about it.