Received: by 10.223.176.5 with SMTP id f5csp1502727wra; Sun, 4 Feb 2018 05:39:12 -0800 (PST) X-Google-Smtp-Source: AH8x224e+O10qoRHVt1FlLeogcrjPqLCH++7cvWxhFyj2zltAWQ7Ocovo+wULa0Be+3FFByaKfIC X-Received: by 10.98.74.154 with SMTP id c26mr11393985pfj.188.1517751552491; Sun, 04 Feb 2018 05:39:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517751552; cv=none; d=google.com; s=arc-20160816; b=Ty3mFCI3SKJgc7NqQL31ZIVC3UU/8CmFC1VLyEPeItgEr87P1EDkJAJOcFPj/vWT/w qa1relF3MQUAUrRq1ClawYB3XCmS8Ioq8JpQ3tiVNSeCS1DzxJxp6OCsPAztlfoOEnuf aeXfBXAkz2yL2ldb7pgwVDfI785bLo8eaFM6cx+DxNUXHOeubyd3RO8XfY1ML/7ULxpO yUTUyKGuIU3X8Xvl27OUaTdr8wYfl1kRyqubA1w2kdYASfdgolEXKWGIctAGgwK0Klfa tOfR1Of/MWXn7TFXpHk1qr+bFN4QpfBnAfEXY1z1on9AFrVUKgnn6znOs3+qSeNk6Ty+ 8H5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=lvQlTtoLeCi9BwSWxDPAQwqmqpkGKNIUHFunyxJujN8=; b=yiuOYsA1SxUsKN7VbtqRS6UKgeSBValInAw2Bt2enTua4c2d7lZOdU44gza12CK5qV 1kLVVyqL8w4hI3HZN6+ToPkiz1rS2MOzszwhgSPdQHXUUxgz3/NJM4LDX67VOPpT2E2s /4WrRGMbvM+F1E7DYn7m0zmCNTrMnCP0t5zekKsNAk74air8wTTJH+w1mM1aI8CHEeOE 9hNEvzg6masTE3AcAukr5fAiv62mAcp4j/Eqa+u7FQCgnROUs82Fp9jYt2G4r+MFc1JA r6o9YB4Xg8GLqvHwKqf7F3gvvzEGFi/MH6pvDSfXpJUkEjOw/Eniw229SKJF58P7Dp8a Ix2Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3-v6si3438835plp.625.2018.02.04.05.38.57; Sun, 04 Feb 2018 05:39:12 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751979AbeBDNdX (ORCPT + 99 others); Sun, 4 Feb 2018 08:33:23 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:58646 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750868AbeBDNdP (ORCPT ); Sun, 4 Feb 2018 08:33:15 -0500 Received: from localhost (unknown [104.153.224.167]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 81FA0EFD; Sun, 4 Feb 2018 13:33:12 +0000 (UTC) Date: Sun, 4 Feb 2018 14:15:15 +0100 From: Greg KH To: Stanislav Nijnikov Cc: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jaegeuk@kernel.org" , Alex Lemberg Subject: Re: [PATCH v4 01/10] ufs: sysfs: attribute group for existing sysfs entries. Message-ID: <20180204131515.GA2977@kroah.com> References: <1517501746-19075-1-git-send-email-stanislav.nijnikov@wdc.com> <1517501746-19075-2-git-send-email-stanislav.nijnikov@wdc.com> <20180201165923.GA12838@kroah.com> <20180204123343.GA940@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 04, 2018 at 01:09:09PM +0000, Stanislav Nijnikov wrote: > > > > -----Original Message----- > > From: Greg KH [mailto:gregkh@linuxfoundation.org] > > Sent: Sunday, February 4, 2018 2:34 PM > > To: Stanislav Nijnikov > > Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; > > jaegeuk@kernel.org; Alex Lemberg > > Subject: Re: [PATCH v4 01/10] ufs: sysfs: attribute group for existing sysfs > > entries. > > > > On Sun, Feb 04, 2018 at 12:29:06PM +0000, Stanislav Nijnikov wrote: > > > > > + curr_len += snprintf((buf + curr_len), (PAGE_SIZE - curr_len), > > > > > + "\nAll available Runtime PM levels info:\n"); > > > > > + for (lvl = UFS_PM_LVL_0; lvl < UFS_PM_LVL_MAX; lvl++) > > > > > + curr_len += snprintf((buf + curr_len), (PAGE_SIZE - curr_len), > > > > > + "\tRuntime PM level [%d] => dev_state > > > > [%s] link_state [%s]\n", > > > > > + lvl, > > > > > + ufschd_ufs_dev_pwr_mode_to_string( > > > > > + ufs_pm_lvl_states[lvl].dev_state), > > > > > + ufschd_uic_link_state_to_string( > > > > > + ufs_pm_lvl_states[lvl].link_state)); > > > > > + > > > > > > > > sysfs if "one value per file", not "random text that someone has to > > > > parse per file" please. > > > > > > > > Huge hint, if you ever care about checking the size of the sysfs > > > > buffer you are writing into, you are doing something really really wrong. > > > > > > > Hi Greg > > > It's the existing code, added by: > > > commit 09690d5a6ae1b7e4cb5ac429c311b99d09352c12 > > > Author: subhashj@codeaurora.org > > > Date: Thu Dec 22 18:41:00 2016 -0800 > > > > > > scsi: ufs: provide sysfs attribute to select the PM level > > > > > > This patch provides the sysfs attribute to choose the power management > > > level for UFS runtime and system suspend. > > > > > > Reviewed-by: Sujit Reddy Thumma > > > Signed-off-by: Subhash Jadavani > > > Signed-off-by: Martin K. Petersen > > > > > > I just moved it to an another file and changed the sysfs entries > > > creation by Jaegeuk Kim' request. At the moment the entry shows the PM > > > level, the device state, the link state and all possible PM levels. Do you > > want me to change it? > > > > Ah, you are just moving this code around. Ok, that's fine for this patch, but > > please fix it up as part of this patch series because this isn't an acceptable > > sysfs file at all. If it were documented that would be a lot more obvious as to > > just how wrong it was :( > > > > And, as it wasn't documented, you can change it as it's obvious no one used it > > :) > > > > thanks, > > > > greg k-h > > Can I fix these entries not in this patchset? As long as I know they are used and I > would prefer that change of the existing sysfs entries behavior be related to a > separate patch. Ok, but it's nice to at least hope that someone will fix it up soon :) thanks, greg k-h