Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp558349lqh; Thu, 28 Mar 2024 09:25:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzCFvOxN5K7AhoHaIQj33u3GyXSynQny7vT1ze7CdMbcpLtyz7xlPQjcNUP+FdJPp89S7sQO4sR9wv04lb8A57o5JWa7YvzXKm2L30kw== X-Google-Smtp-Source: AGHT+IG47CyPuUjjOg0zytiB6rj5v2Gw2pUv2UkyOooXKtbcjbVAfPxXDPEts52QexAKqFbuTdIi X-Received: by 2002:a05:6358:419f:b0:183:4d55:b86b with SMTP id w31-20020a056358419f00b001834d55b86bmr3424110rwc.5.1711643106825; Thu, 28 Mar 2024 09:25:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711643106; cv=pass; d=google.com; s=arc-20160816; b=OMOWY8mc1uwZlD1ylIiwmQA9ByxxtnMrmG6dA6/brekVFgM1wsmKQNE6j/4oQkRdlS cVEqWX9Itm21j3Z79ajZKRDMJNQ2g+rMt9OSOseX6A0xTwo1x+8rYfdtp49LK0rBiRyj OCOugPM+cBtahcecyFB5khlyfqxCJX8FFH+7D1ID5cF4SEDzmVsoDy8/8DrNo1DA5UpJ A362pwdMxbugz2p7Umg3cvxogjk4Tm1Dsyxs6F8SyUyA+sW78mN32Y+y41zA32obgXmG 3BY37hwN2fCm+u3zHyl8r6We1rzBMkJcKQnDx7+6rH2ij3MAP41UevIWzeU6ueSHL0h9 5MXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=Y4wxpIDwbG6xN4Rd6kXVmo84Yvf4H2Cur+wWFIz4RR8=; fh=zlxW9Z4+1SUuOo6uPxuJmxEKdS3LvmGN2f+k5hv+Q58=; b=f+eVqH1e2CaoKsYwkyTUXUxsqFtIYLE850x8aStsbUdVOgn3HvZtbsDccXqJZ/IKpF G/cgcxpv9BuOEz9OtDPTBgp8JnL8LO9QA9IXh5ztVCirjXshETSr/cSp1BDi87MBwdlA ZDY5b0Glb9lwoO1V7qLGfGyjyg8LKxtKJLqS6/TSYAAw5Ago5Dlo6LJ972mFkE7z9ANo Xvwk/dSYLazCGXayLLyxbEo0Q80Xh9hRI+2cBxskjH6bhHKZXM9JzG9fsMN7BJqI4J0k E5sXS7chLy92k3U3mICPgeZ3mKY15VthCbfoLU9oHOz+xu/Bx/Oa/HgmjA8DfyEyvgnp j3dQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-123230-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123230-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m32-20020a635820000000b005dc528a5317si1767678pgb.50.2024.03.28.09.25.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 09:25:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123230-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-123230-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123230-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 72A43B24815 for ; Thu, 28 Mar 2024 16:18:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A964132817; Thu, 28 Mar 2024 16:18:17 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id 0B205131BA0 for ; Thu, 28 Mar 2024 16:18:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.131.102.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711642696; cv=none; b=jxGSCUcw3IXUoeLFZHWw35LQF7Bbq7NemFsynr4EeAh3GyGzTN0xQa2reapz7wllo/XNMQSfW+mPJJ4+BR5mCyBNruLAfIxGsoO+bSQn7Edz6rspXG0b/9CWGxfHHEqTpVUVVh54EJNIlGXHQb+PqOWFIe4Zk2fmZqeeeSpPXa4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711642696; c=relaxed/simple; bh=/KpgnWg969w9kfQ1LtcLkrkYrqm1vt/23nXsUi0UYKE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kCmX4bdJ4pd5jCX+TjR7fMgCXrNeR+a22/Sr7VKdE9Do124hBwaRQCQc05CdVBjxAnResvdq91f4WQHkRDAbcUl+ZuoR8l2ee9/TBFRGDDNW36GV6uxWwVSqDJWOo3JcISAlEovZ76liefmFR89LFKQyjhU6iCfbG6DZ1Pf9Tz8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu; spf=pass smtp.mailfrom=netrider.rowland.org; arc=none smtp.client-ip=192.131.102.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netrider.rowland.org Received: (qmail 964417 invoked by uid 1000); 28 Mar 2024 12:18:13 -0400 Date: Thu, 28 Mar 2024 12:18:13 -0400 From: Alan Stern To: Matthew Dharm Cc: Norihiko Hama , Greg KH , "linux-usb@vger.kernel.org" , "usb-storage@lists.one-eyed-alien.net" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] usb-storage: Optimize scan delay more precisely Message-ID: <2483fb37-8939-4723-ae8d-7a7a7dba3322@rowland.harvard.edu> References: <20240327055130.43206-1-Norihiko.Hama@alpsalpine.com> <2024032757-surcharge-grime-d3dd@gregkh> <0c99daaf-c727-467f-b8c1-ba8846d8a9ab@rowland.harvard.edu> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Mar 28, 2024 at 08:21:18AM -0700, Matthew Dharm wrote: > On Thu, Mar 28, 2024 at 7:51 AM Alan Stern wrote: > > > > On Thu, Mar 28, 2024 at 03:04:47AM +0000, Norihiko Hama wrote: > > > > On Wed, Mar 27, 2024 at 07:39:55AM +0000, Norihiko Hama wrote: > > > > > > Sorry, but module parameters are from the 1990's, we will not go back to that if at all possible as it's not easy to maintain and will not work properly for multiple devices. > > > > > > > > > > > > I can understand wanting something between 1 and 0 seconds, but adding yet-another-option isn't probably the best way, sorry. > > > > > 1 second does not meet with performance requirement. > > > > > I have no good idea except module parameter so that we can maintain backward compatibility but be configurable out of module. > > > > > Do you have any other better solution? > > > > > > > > Can you accomplish what you want with a quirk flag? > > > > > > I think that it's hard to do that because 'quirk' is specified for a device > > > but it's difficult to identify the devices to make quirk, especially for future introduced devices. > > > > > > Can we change the design of existing 'delay_use' ? > > > For example, 'delay_use' is 32-bit value and the value "1000 secs" does not make sense to set it, > > > So if it's set to '1100', it's treated as "100 / 1000 = 0.1 sec". Is this possible? > > > > Here's an approach that Greg might accept. > > > > Since we already have a delay_use module parameter, we could add a > > delay_use_ms parameter. The two module parameters would display the > > same value, but delay_use_ms would be in milliseconds instead of in > > seconds. (This is similar to what we did for the autosuspend and > > autosuspend_delay_ms sysfs attributes.) > > What about just changing the parser on the currently delay_use > parameter to accept an optional suffix? If it's just digits, it is in > seconds. If it ends in "ms", then interpret it as milliseconds. This > would be backwards compatible with existing uses, give you the > flexibility you want, avoid adding another modules parameter, and > potentially be expandable in the future (if, for some reason, someone > wanted microseconds or kiloseconds). A little unconventional, I think (at least, I don't know offhand of any other module parameters or sysfs attributes that work this way), but it would work. Noriko, would you like to write a patch to do this? Alan Stern