Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp319401lqo; Thu, 16 May 2024 07:17:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWsYqjtmWacBeemUEo6Ql4kOA/kXi4IUWRmd4aGSBcUDNNv4UBbQYiI4+jZQ8PDtib+ihDHIIfE8RjGskTErYluOEmYw+/uHXPJYA3Yww== X-Google-Smtp-Source: AGHT+IF/LOq90dRS6KXEfTU0J6Lf92KZXVHzv4SLUZO6qhZf+5knXlPQeCQKzNUJcoZb8xUp32pk X-Received: by 2002:a17:906:c78c:b0:a5a:1b60:7c9a with SMTP id a640c23a62f3a-a5a2d676415mr1739785066b.71.1715869052560; Thu, 16 May 2024 07:17:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715869052; cv=pass; d=google.com; s=arc-20160816; b=HO1Kr81RmfgeVtxeM4N7Oe9Xu7HgpaOmkHtWi8+PDU4AtucU6LpLDqdcU6NggYBEt+ ct5z325uHLTesAjUO7jU+TOp+wLULAmAm20ix5PAFWVEpZYtqeKEnJZMA+FsVZKeQANf qNIV3TmG+hQZy3OUDqTvEsuwdoAavvYGmzqujKOwleHEdJXn6o1yOlx6iG20vU2zMj2e VcjkAoVFGxVqMm/DLILX1WFImxDIa+z3iZXEpz6IQfDwEyMb+TieDih4wQDygBH3eO8o tezz2B3On+LbWqf/wNqYsvsWiwDNEiPKsJFZBFo1Rr0YbA2DYwtqhJjoJLhJFRF8vlqm /N1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=DIahbDSpuDRG5+a9rEtREKP7+qLiKp27MuyfzJgoL7U=; fh=K+Tg+GhtIqZfvlhfGR7M/+sET2hfDDyZF+hArCUWMWo=; b=zM5BF8TfYuvgBviuxS3SQ+4HmqRMKCT7OiC9lbKnuNhXY9KZa6BTUnD3XF7HqENceQ 5cqUwecMUL505CX6PVsLcdKwyLKV/DIMiSbyQ2nwmV/Fo2b4EnrGkdA2aT2dkZS9+G6c n3qMJj/jWpSH0CPYyj8ssITl3m0w8qoSNKFssuR6uP5GX4OVtmqmR/nbrAibB0ThshtY cwsYwTJNi5QQ7zRfYc/W5/7SBvypQxxk0vu2pI0wOKbxTqyTLmxi/swJdTLbRRZqvOtj d4I8q3Jwqmn5Ky1F5qE18knv+mgj8A8AjZ4t3pw6UCOU6WqTBjvfpQmVBir5gRUzyKpS omBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=C57+4asW; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-181163-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181163-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be6930si842479066b.776.2024.05.16.07.17.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 07:17:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181163-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=C57+4asW; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-181163-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181163-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id EC6A51F2256F for ; Thu, 16 May 2024 14:17:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD64D14A4D7; Thu, 16 May 2024 14:17:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="C57+4asW" Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BF321474C6; Thu, 16 May 2024 14:17:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715869039; cv=none; b=HOSMsu0qlosBnwTOSPlyOB4OWgRs8mhdHKFS2wpzuag/luB+FaNQyZ4nXExLk7DwiJ/S3Hek+xkjIdMnZWJ7NuvE/2EFoTNA/oN+AoKTxGXR73pt9a49Yl3l3+myaXXqCo4CEmE8Ruuf85guqYPJ65VK612rKPX2sIuQY4T+J3A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715869039; c=relaxed/simple; bh=vuGen6pBZFDSpFlQAM7glOJYA6AoeXmKysq5Rr1LfXg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=amJSH1EmuzX5L8lG5Jh12+woO51Wk24k7ks1J0GYSPS6NSABHibNvAeGVfjKQAWCKm/FoDwHZCqCyFpUhDeuk8fBujHqOyThxn6ECUpvo4N6mTTOqdPehQh3LRENuYYlkIl8sxLXXEpRbv4q2ObaZ/X70dALbmE5oQob4xYlwQI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=C57+4asW; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4VgBxT0RNCzlgMVL; Thu, 16 May 2024 14:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :user-agent:mime-version:date:date:message-id:received:received; s=mr01; t=1715869035; x=1718461036; bh=DIahbDSpuDRG5+a9rEtREKP7 +qLiKp27MuyfzJgoL7U=; b=C57+4asWP6YaRdtoCSPHv+Y1Z6isoVJoi5/I0U0w FU6VPJZsQfgpGhI6+7UsvC6Zb6tVec+5C+I6Dy+1wW2fa8MjBarKX4gRW7nOa7RK kPXfadsHjzry1JI/u1f2hGiLDWhsCSPUvVT4vHqrAblOsazFxXNqgTSN5H29UTjm NsnsfuMlWDc4b8+6KY+B3wQtJGfK5yZiQqmWvzon8NuZDE8y1+K2+jO76H0jp3kD EdgthzIxjC3y4xs3yyQljXKrX+FhZm/J21KzVGWMLwmRggVTlyZHc35FmTlR19vE QMy6MzL9i9CMdf/h1iP7LLAH05l2BIJvVjbBDsLvV+pnTA== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id ZAlx0itUAQNB; Thu, 16 May 2024 14:17:15 +0000 (UTC) Received: from [172.20.0.79] (unknown [8.9.45.205]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4VgBxQ2N5nzlgT1K; Thu, 16 May 2024 14:17:14 +0000 (UTC) Message-ID: <054739a5-f38c-4756-b248-94dfb6bad916@acm.org> Date: Thu, 16 May 2024 08:17:13 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 3/3] scsi: ufs: sysfs: Make max_number_of_rtt read-write To: Avri Altman , "Martin K . Petersen" Cc: Bean Huo , Peter Wang , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240516055124.24490-1-avri.altman@wdc.com> <20240516055124.24490-4-avri.altman@wdc.com> Content-Language: en-US From: Bart Van Assche In-Reply-To: <20240516055124.24490-4-avri.altman@wdc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/15/24 23:51, Avri Altman wrote: > +static ssize_t max_number_of_rtt_store(struct device *dev, > + struct device_attribute *attr, > + const char *buf, size_t count) > +{ > + struct ufs_hba *hba = dev_get_drvdata(dev); > + unsigned int rtt; > + int ret; > + > + if (kstrtouint(buf, 0, &rtt)) > + return -EINVAL; > + > + down(&hba->host_sem); > + if (!ufshcd_is_user_access_allowed(hba)) { > + ret = -EBUSY; > + goto out; > + } > + > + ufshcd_rpm_get_sync(hba); > + ret = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR, > + QUERY_ATTR_IDN_MAX_NUM_OF_RTT, 0, 0, &rtt); > + ufshcd_rpm_put_sync(hba); > + > +out: > + up(&hba->host_sem); > + return ret < 0 ? ret : count; > +} Since modifying RTT is only allowed while no commands are in progress, shouldn't max_number_of_rtt_store() freeze and unfreeze all request queues of all logical units? Thanks, Bart.