Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp491591lqh; Thu, 28 Mar 2024 07:53:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXaDlMOmHB3G+92cJk5TXp+PSDsHfRsSrQfA3Ofer1ADYbnqXo0b3O4c2808DWf83BGIVEhhLou9Wo4Onv72uE/XobK4RW3dOAxMY0o9g== X-Google-Smtp-Source: AGHT+IH9YjaUXOXy3Ul9ZKb4xji7lyl1SdMPqrMCPDgRtJwapfWdwr8O4mktp3qPC2sF8r9QK29R X-Received: by 2002:a17:90a:4586:b0:29f:ed63:9009 with SMTP id v6-20020a17090a458600b0029fed639009mr2894126pjg.10.1711637582147; Thu, 28 Mar 2024 07:53:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711637582; cv=pass; d=google.com; s=arc-20160816; b=dGDpuxBU8OCtMOm0Nx7UIC6TRg+S6xWTfI/LYWGChR55YJk4UC/gw8rKMF6P1GCvJR G+00lslxRmQ/Fzc5y3arKpeJcMAUoZy6r+UViBC1Zl2EVWKQJT97xw2oyxNFUpkuSnTd 6goBuBBkEpLE70vZHyIP3VTDn7ZwiNLt7IsLFpT9IW2ANHen77aWPjtMT8QfEW/UHYLG zbyz1+1AXUmX4EZVKrNxZQmwbIQE8KrNcUa8fc+Nhyfv5QrPKhQjY5DAY5gpJeMWAYfT 4G7ui++BgHa4fzS2uzFTG7kwSoSZwKg8ayHDxXPs0FKz8XQrfnKpZ3dMeWOV3mOrdwFT WbZg== 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=cL8GtyzXu4OVD+XveIMA9TszIlLVO/zB5rFjwW5BlW0=; fh=NJ83p9IPUuekDOZJkQQc54YQvJMvWb5A+kxF5vURf4o=; b=wRDJWr91kJot0K7V8SYBC9QhPMCD36ym/EdgUSS/dy6rHiD9q7rfzZu8x+W5DerZY0 SM/oqX6UchDu21+iL8J6D3Mu4dnwcqWaQ+aeciW5w8xWgb8nMhr5vK7PsAKPkfyw6rMK wNByNqqpcq2jAsjW6uUN7vkl+LEfHkVl97BMDV805Meo+l/T0vNAe6+mxfcWn1EJZagp A8sO3Im3iEtCOzqPfLNj6pCZP60Th3AHtyxevuK2VRHV+G4J9eNzIOlgFUapshVLOjdR 8j1u0IkmfwDAG5OraNSmDYFwjbT0UCsLIJk2rbyEMWgPei26CfQpScmrFYfu5MiVPsFQ Uvyw==; 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-123107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123107-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 d15-20020a17090a110f00b0029b8534a3cesi3805844pja.142.2024.03.28.07.53.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 07:53:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123107-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-123107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123107-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 3E447B224BF for ; Thu, 28 Mar 2024 14:52:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A5E512DD90; Thu, 28 Mar 2024 14:52:01 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id BB9508121F for ; Thu, 28 Mar 2024 14:51:58 +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=1711637520; cv=none; b=u/ffLIQGHjYAhgPQOxD+jCRwllGx9qSiPcJq166DWL9buh8rtedOB+s3tDTfdJcaUj/22DOSJDc5a1SSqw/ELz6BOQIYPerfLcyAFfnMGJVLkLLOI0sYFM/CrJIR29tFZFsSzkdSCQTM1PKFk2UBvAanMMnElPkzRKsqMzOeNMQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711637520; c=relaxed/simple; bh=fDPLCIyTGAjC+KUo0nZjfOc6qxfhbVrcbWZOLvzn1+E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SaEJ+yEwYQxjk2nNgTHp654GHdW0muacc1Ml+1VitsP+LDFrq+DSxws21+V8yv7cvfB7cJRUSifKEpRCwyTeYz11FtuOLoO73bMioZmtKZI5QFwiEWJRYWC1ybg75dn4tF/RdbtH9VPxzpXjB07ldenGFW55UeM9WBS+Q3yQPXk= 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 961409 invoked by uid 1000); 28 Mar 2024 10:51:51 -0400 Date: Thu, 28 Mar 2024 10:51:51 -0400 From: Alan Stern To: Norihiko Hama Cc: 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: <0c99daaf-c727-467f-b8c1-ba8846d8a9ab@rowland.harvard.edu> References: <20240327055130.43206-1-Norihiko.Hama@alpsalpine.com> <2024032757-surcharge-grime-d3dd@gregkh> 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: 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.) To make it work, you would have to add the new module parameter and store its value in milliseconds. You would also have to change the existing module_param() definition for delay_use to module_param_cb() so that the get/set routines could divide/multiply the delay_use_ms/user-specified value by 1000 to convert to/from seconds. When you write the patch, don't forget to update Documentation/admin-guide/kernel-parameters.txt. Alan Stern