Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp503238lqb; Wed, 17 Apr 2024 02:56:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXfnciVRimJEuXYj82fvGUD/tHIQ9705wi0wjVAJt/kicS7v/jq0sOReT0BP6cIgj9E64B9wIBJ87vcJFVDCjZxzE9u6l9UAv4uKmUbyg== X-Google-Smtp-Source: AGHT+IEWYXeYdQsFUXNVps6P+Vz0BfqRIFcpUwNKVOWJ4qvCe6VwgVCjrg1PaUb1hgLJpCt1OfRD X-Received: by 2002:a37:e216:0:b0:78d:601f:f955 with SMTP id g22-20020a37e216000000b0078d601ff955mr16471876qki.30.1713347794753; Wed, 17 Apr 2024 02:56:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713347794; cv=pass; d=google.com; s=arc-20160816; b=yY277CpkH4H65d02loVx6ffXz5CkGKg6Y9rCrg9cSRpQmtOH8/9b4bT5aX4XvqfGjB NiIKiTaIHOqqKgOEbjJKIOkw/OQIBQBvobW1hC81w/kLKwjislCPSXhN04QhmI6mCM98 9pdY/ag52mXPZ7sjO6kBlSxXFGxe0mAtQD9P6W0667nCvmbH2sHxzlnIpuA3rQeu9Tjy Pc9xFJnqKHHQTtQbsKFTwxFKFC7OCWOFMZWpLBgx0IqkTA2V5JZVCW6sn0d0zdO5i3Zj XqD7ozQOeNgv0i9u6RbPw5lhNjwAga9TVvrDSYT6UwMNNDnvvw+EVSnQDfbHHD5fK7OZ HjKA== 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:dkim-signature; bh=/Yoh9rKfFYx4NV/PnsKxA+D+UiMlfFylz/iijlw39xI=; fh=0zaBFzhEObel4ITlrD8u32AFLlSMrdbDLibNgBPyDF4=; b=xwafsAqeUq1YKG6VEm/WfISrbQfgbhRwIUfR0xWEUoi/mmEv5i0UBkoHr2+s7pDj+X JRv0gDlVBMwlFf0VTIrSsJ1fam7sQyPan1hs5B2hBsXQyE7qaKbDT5oq8NX8itzOSqCn xCUjUfU6RtCZjujpRMSwj+V6MP5bTembynBVVcm3vEfUDbCuHokZ+id4r2gg0tGjw7h8 FOVQclRovzT8EqKosQkTF9lPvsGRwY+KqHdXbPHBNtmO84D1Oco4QxynjP8Urrc96uNY MeR5ZR+m+ERD5hwbx5y3369vOcbt2NYZ7k4XSBu3RogEDGCU10e4pdGl2BgHSuFVIRXb x9sg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fVpm9K00; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-148281-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148281-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id br9-20020a05620a460900b0078edfedada4si8489752qkb.395.2024.04.17.02.56.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 02:56:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148281-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fVpm9K00; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-148281-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148281-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 49D6A1C21F03 for ; Wed, 17 Apr 2024 09:56:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82EE813A268; Wed, 17 Apr 2024 09:56:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fVpm9K00" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AA0F112DD94; Wed, 17 Apr 2024 09:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713347788; cv=none; b=AWcBrLxhlA4/etj4NAaJuWbsoP8nvzwicFjhwDxXdaPeeVdBLH4+XMQge+VyfvPwaf+N3e7G8omUNbcNXg3feCGHoWnp6MzMYzuUWfi9V8X0QkpENhq31kDsBAyoqWttJwGLCGvvJOsuZUNKssHsUAx6eLzjPi0yhw7RYBaceJE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713347788; c=relaxed/simple; bh=zZ7v7PQp0DDEHhoo/bYInJ8iPIZtAFy1cxCwkUCT9gU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=V2rWEh0hfu1Ek3i1yIaCtISFXbSbFs5l77XSCxP5OKj4t3So/URAFMIu1kOW1TCKCE+tjohs+fSAflwHhqST3u48bP8vy5l5VoE/806BXa8GXSoGcLkDm9Zdlu4AadHdbJsqYBxUOK5zAyC585Pz70RVNHABZms6O4p9aoAcgBY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fVpm9K00; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 603B1C072AA; Wed, 17 Apr 2024 09:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713347788; bh=zZ7v7PQp0DDEHhoo/bYInJ8iPIZtAFy1cxCwkUCT9gU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fVpm9K00ZdOv8mpz9I/gPJjSj4ALSYKsJ2JHp7KFwbtTU8SOxycZhvYqXCUt9u8L/ 1+gURGur7NOqehJoZfKnYmeCxhI1JNZ1tqTamFpjrPVPIZMYJm2Y04Bdn9XuVsH24I C6AbRRvfOpNOe/vCPTaR6U0OzO5aM8JADqEwsdBkbJzEGk60xb4LjaikdFc5R6OC8J WvNLkF3bPCrfggPF49hTZDmNWXgYMhhoQ1/kd1bJ6F71M6hOy8t4HbprmWLSHlBw+P 00VCnT8v/pWZ0wZ9ZOMfl1WVhl7mBxjwW3r/D4Aw00EjTpyMkFVDhhHmHTPb+PgXS2 hJledh2aYAfTw== Date: Wed, 17 Apr 2024 11:56:23 +0200 From: Niklas Cassel To: Damien Le Moal Cc: Gustav Ekelund , Gustav Ekelund , hare@suse.de, martin.petersen@oracle.com, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@axis.com Subject: Re: [PATCH] ata: Add sdev attribute to lower link speed in runtime Message-ID: References: <20240412134838.788502-1-gustav.ekelund@axis.com> <4e5c88f1-1b24-4f6d-8c11-d7029329ba7a@kernel.org> <7e6eb387-5a0e-460c-af08-eff070fa35ca@axis.com> <898497f0-d279-4d01-be8d-aad4048df95d@kernel.org> 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: <898497f0-d279-4d01-be8d-aad4048df95d@kernel.org> On Wed, Apr 17, 2024 at 08:59:27AM +1000, Damien Le Moal wrote: > > Can you send examples of the errors you are seeing ? That needs to be > investigated first before going the (drastic) route of allowing to manually > lower link speed at run-time. Gustav, is it possible for you to share the error messages that you are seeing? Preferably a whole kernel boot. Since you are talking hot plug, there is a bunch of libata hot-plug related in v6.9.x (which turns off LPM if your external port is hotplug capable). So it would be interesting to see if you still get these errors on v6.9-rc4 (we will see if you have LPM enabled), and if so, what errors you are seeing. You could also try booting with: libata.force=nolpm on the kernel command line. (This will explicitly set lpm-policy to MAX_POWER, which is different from lpm-policy=0 (which is the default) - which means keep firmware settings.) Kind regards, Niklas > > > > > So I want to adapt the link, depending on the connected model, in a > > running system because I know that some particular models in this case > > will operate better in SATA2 in this system. > > > > Can I use the libata.force module to make changes to a particular link > > in runtime? > > Nope, libata.force is a module parameter so you can specify it as a kernel boot > parameter, or if you compile libata as a module when loading (modprobe) libata. > At run time, you need to rmmod+modprobe again libata, and so the ahci driver as > well (because of dependencies). > > As I mentioned, if a run-time knob really is necessary (it should not be), using > the ata_link hw_sata_spd_limit would be a better approach. But again, that > really should not be necessary at all. > > > > > Best regards > > Gustav > > > > -- > Damien Le Moal > Western Digital Research >