Received: by 2002:a05:7208:b08c:b0:82:bbfa:f723 with SMTP id c12csp406528rbb; Fri, 26 Apr 2024 07:39:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUml0U4VDYgveTh7toe/kBdNXNu1ljMHLok0vzYU+G/sXBJroegQ+0UQuVFoOJIn1D2rFG++jIPjm6m20PU8We5v7ObIbX4T+o/ZROlng== X-Google-Smtp-Source: AGHT+IGQkdvJzFAbsbMoARb8Vtqn1gfkcGSDLhkRqdY+mF3lCdhJsyGAzZrVjrf2QsoQMj3zThzS X-Received: by 2002:a17:903:32cf:b0:1e4:6519:816d with SMTP id i15-20020a17090332cf00b001e46519816dmr3241606plr.48.1714142340791; Fri, 26 Apr 2024 07:39:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714142340; cv=pass; d=google.com; s=arc-20160816; b=nEy8RH2Y8VEepe4+tLEw7JrQfZZDyOOqLLrnFKbhT426lv5OwH5/n4P+CW8XTYT3Xo ZRePia6IkjRS9KwyArmV4B3zhxqG5I4Wa2rYptzFp9PwgHCQ6sAwNL1OPBQsC6l92b8C DGoVM8JrYdxLTHH/yCDZm/vSaMXPUG0j0qim2VCIa7NMam9r034XALBWvsCGCfU72yTI VRRm4Zb0gHO5Zk3yCRywSMzpZmScxbjKh6kLMbeQR/C6VtEmPh3WnikKh5nwgbU0GTEt e2sVEQEM19vp6WXN1HKRRAoRjwrgUZieEXLqKEVSS197sNb1VL7haCuCxk1NB0nETkYS jQLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=JtFkBGDCvoTHr1FxTazOVm+d9RGbsiCdYS9tDvgoTXk=; fh=FqUVr371cc1tTqxoDZir02HaIRYiJLTekm+ByvbbJgY=; b=GAKwUhcjt5MSC/a2KN0PytcwfmmTDlkOtrO9GyelF9D5d7mklwRVGSwEiNTq+/2eQy CwbWKullJXH1N0O0DyrMl5XcN/cUD5ENkYdBSGI/7WQn5AXOjNMiHkOVv1y5oFbETAdg Pa0YqqVVSupBuVJ2gpUGJd8N5RiOBqN7qxm0tRxo0WhhUZ1MD/IUd2XLPX86GbRXDfAx /JbNqzQWy0thNBKZgM+kUAmPcl0IPccA31RJAIemMZE7Qiem52bGS97bb97xX5mxrpYB eKQVHmk7Oi4aQSVnruqQKUn2uT7NsM8tCI4MNaJzY9LpAdqNAR96UG67rZhDSYoGm6Pl MBhA==; 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-160162-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160162-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a6-20020a170902ecc600b001e9219222cfsi11374668plh.269.2024.04.26.07.39.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 07:39:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160162-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::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-160162-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160162-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BA39028B471 for ; Fri, 26 Apr 2024 14:30:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C9B4147C63; Fri, 26 Apr 2024 14:30:17 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id A78E32BAF6 for ; Fri, 26 Apr 2024 14:30:14 +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=1714141816; cv=none; b=Mc5ta70JfrrydnGuc81t/87oGOO+aBBD0/yyef9J8YLWxwJbCq5JlXCZCprPFfU2Wv/2fgIMUau5zZczEJSLxzSYzzuxHTmVrlTSJEcr7sdVmcAWS95dOfzGXu+fJyXUefF2LgZRFY8uduYY2jxUmlOOgGW7MT6Ve2OZ5eVjGQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714141816; c=relaxed/simple; bh=1YOGk2Fu8LkkiUHoAmC1Crgo6gi/S7xansJx6h+2kVQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CwHKP9RLYqPSv4DkcwZO6f4o3u0gqn4/w+jTtlA/rMZFRatvshFf7lDBCPfbyZeQngRK+UWYz9QxsC+RPOLXNLQUuf8H8uMiWDdoZlhB7jr5ao/IWMDFCyDbN3Hodah8vY5sCWFFylvd+50KS6u3MRRdjkL/ZLhWbbxc9ALvnpU= 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 527438 invoked by uid 1000); 26 Apr 2024 10:30:07 -0400 Date: Fri, 26 Apr 2024 10:30:07 -0400 From: Alan Stern To: Norihiko Hama Cc: gregkh@linuxfoundation.org, corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net Subject: Re: [PATCH v5] usb-storage: Optimize scan delay more precisely Message-ID: <6362de20-ed91-4856-ba0c-d0619585f0eb@rowland.harvard.edu> References: <20240426080231.3062-1-Norihiko.Hama@alpsalpine.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240426080231.3062-1-Norihiko.Hama@alpsalpine.com> On Fri, Apr 26, 2024 at 05:02:31PM +0900, Norihiko Hama wrote: > Current storage scan delay is reduced by the following old commit. > > a4a47bc03fe5 ("Lower USB storage settling delay to something more reasonable") > > It means that delay is at least 'one second', or zero with delay_use=0. > 'one second' is still long delay especially for embedded system but > when delay_use is set to 0 (no delay), still error observed on some USB drives. > > So delay_use should not be set to 0 but 'one second' is quite long. > Especially for embedded system, it's important for end user > how quickly access to USB drive when it's connected. > That's why we have a chance to minimize such a constant long delay. > > This patch optimizes scan delay more precisely > to minimize delay time but not to have any problems on USB drives > by extending module parameter 'delay_use' in milliseconds internally. > The parameter 'delay_use' is changed to be parsed as 3 decimal point value > if it has digit values with '.'. > It makes the range of value to 1 / 1000 in internal 32-bit value > but it's still enough to set the delay time. > By default, delay time is 'one second' for backward compatibility. > > For example, it seems to be good by changing delay_use=0.1, > that is 100 millisecond delay without issues for most USB pen drives. > > Signed-off-by: Norihiko Hama > --- > V4 -> V5: Simplify parser/formatter code and fix documentaion > V3 -> V4: Separate parser functions from module parameter set/get > V2 -> V3: Change to use kstrtouint only for parsing decimal point > V1 -> V2: Extend existing module parameter 'delay_use' to support decimal points Reviewed-by: Alan Stern