Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1322375ybi; Sat, 8 Jun 2019 07:15:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRZUWBnv/6rk+4fXIe06XeUGlgPt+Oop7wnjy1qoW+KXgir47Jrv2ymB+LBVRUdkWnVmJw X-Received: by 2002:a62:5252:: with SMTP id g79mr28216643pfb.18.1560003317659; Sat, 08 Jun 2019 07:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560003317; cv=none; d=google.com; s=arc-20160816; b=DZJV5nnPb8jaoQ/2kNnDEMOUBAAk4RLxjCl4D9Vy4CG90Xls00xM6W++eNsRziwk7R HAJDaVdz8e6R2pHohr3XtE7rKEe+NC6AXJKjrMc0gbsJnsQMz72qmZpfHlg71+D5OJbd ulH2PkdnFrROyJtg8ERiszHv4J5tUtFGj3yv7j9XqEfgAOhV+zjOU0iOOluK1sfjrtLD tauvQtfanNHnfy1+m4Bp9SnDWi+gRPMsfYy9c5n20xXPjCJanWF6cuPwuutAcSl7zfS5 F6h0YlwDMjM46fNILYwTDO85xX3lh6eQav5E9T7Agc25U87vBgSwjzMC/huAnwTVDQAN 9ufw== 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:references:cc:to:from:subject:dkim-signature; bh=ZJAigA+ZG+rVR7oC7AwaFY8agPggvLHat5UXOAYyCec=; b=GdkZ4Tm/Ot3Zsw+YiAyxfSeUUac6v3UEsCB1Rhq48nAoPPjO07s+bkbainknfSSCZ5 KPUZ2or/SGPFbVq335ie8TgdwGv9idvKLVM9JnyhI+evP4PbqpVIJaJRXodEm93WTBEe DSVKrtUyH4Mi+pyjdwfvwd2/xvJZ7UuBWSXckDMuxd0p+jQd2R5EsSJMHxiQQJwg45N6 XJTgOP7okGvXDX3iJD3cbL0mP5YkltlPNwfWjEC/wWnSGB7oAoD1G1r1a2sxIUcAbN2z kbACyPtL+LSTyeHezTrMbbgsm/7XaZmHWDnTEh89Hakh/DSpXQWfoK58kp1L1sMDCCn+ Sciw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=A4B64Yp3; 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 y92si4892366plb.318.2019.06.08.07.15.01; Sat, 08 Jun 2019 07:15:17 -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=A4B64Yp3; 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 S1727101AbfFHONg (ORCPT + 99 others); Sat, 8 Jun 2019 10:13:36 -0400 Received: from forwardcorp1o.mail.yandex.net ([95.108.205.193]:47986 "EHLO forwardcorp1o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbfFHONg (ORCPT ); Sat, 8 Jun 2019 10:13:36 -0400 Received: from mxbackcorp1o.mail.yandex.net (mxbackcorp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::301]) by forwardcorp1o.mail.yandex.net (Yandex) with ESMTP id 899DB2E125C; Sat, 8 Jun 2019 17:13:32 +0300 (MSK) Received: from smtpcorp1j.mail.yandex.net (smtpcorp1j.mail.yandex.net [2a02:6b8:0:1619::137]) by mxbackcorp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id DzuU53LwT0-DVoqFgjZ; Sat, 08 Jun 2019 17:13:32 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1560003212; bh=ZJAigA+ZG+rVR7oC7AwaFY8agPggvLHat5UXOAYyCec=; h=In-Reply-To:Message-ID:Date:References:To:From:Subject:Cc; b=A4B64Yp3ADzOz20YSiA9DlFU61mA6+K+M1JsMm0rTWTb0hT4WbxUb5X6wiM/Mzbwz 4PeLHgH6oR9XpM8/Wm+HT9andPporgQa+b1D9LUYGX+YLbkL7+jlW+GwbIQ/bFbHSU aXS4gmvEr7r5O7rvdvPP/VHExAo5tp+Ga7Sz0jr8= Authentication-Results: mxbackcorp1o.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:40c:3d25:9e27:4f75:a150]) by smtpcorp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id I7j3bGcYlp-DVe0sccL; Sat, 08 Jun 2019 17:13:31 +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 From: Konstantin Khlebnikov 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> Message-ID: <048ed77f-8faa-fb67-c6bc-10d953f52f89@yandex-team.ru> Date: Sat, 8 Jun 2019 17:13:31 +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: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08.06.2019 12:12, Konstantin Khlebnikov wrote: > 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. Nope. There is no obvious way to link scsi device with ata_device. ata_device is built on top of "transport_class" and "attribute_container". This some extremely over engineered sysfs framework used only in ata/scsi. I don't want to touch this.