From patchwork Tue Feb 6 21:13:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 1895908 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=kkCgu/Mk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.48.161; helo=sy.mirrors.kernel.org; envelope-from=linux-ide+bounces-480-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TTwwy2jT8z23hP for ; Wed, 7 Feb 2024 08:14:26 +1100 (AEDT) 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 E7FBFB20C72 for ; Tue, 6 Feb 2024 21:14:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9B6B1B94E; Tue, 6 Feb 2024 21:14:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kkCgu/Mk" X-Original-To: linux-ide@vger.kernel.org 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 AA1E91B942 for ; Tue, 6 Feb 2024 21:14:23 +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=1707254063; cv=none; b=opK60uVCmKtu73+sYmx9htl1Hy1nT6eYt0W/n7lDw4pICDKZm1IZoQ0DFiq2xFgBNrXqb5BMT+WrfLT2DAEciZ8cUCPRnTAOYR0NWo6np4wy1H8O4tQNEhyIB8EPcjlxuynHD2A7aVcYM4GPYa/UJlXjjzPczEahg+DmhuCVlac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707254063; c=relaxed/simple; bh=WVW7rapzVbtdhBN/8wNUHqabi6PJi+e9tY2txdgsxp4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y0FYJM/cqun0bHJMiOCKBkKxaved0KKwAlL6en6BHJTZQlAsEG8GHBCPneYNp9IXsxpX2yJgWfnSjrNX0+nWeXaQqNCzB0C3D1/9Nd1drSLAuDrym9Owy8P+aXIVLaQblOorHhFxVMQphqTCnikKEzR8HsQID0pg+xQtq7nFdOE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kkCgu/Mk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 879F6C433C7; Tue, 6 Feb 2024 21:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707254063; bh=WVW7rapzVbtdhBN/8wNUHqabi6PJi+e9tY2txdgsxp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kkCgu/MkjZe4lQvhZX6+tKFz95gRMOKZWHr6PIG8zqmbrJQeoTvZFyXw6MZG+GP9J r2WRDTEgXPPskP4kdLrcQBGUtNpTT0jYLK+qjsULri4hRWfgqDmegkr43/N5W9Kl+l eT0sfLJbMwPyNZqyu7IwD6lqRIGrO4C/av2rDxUW/V7yoayiEXrP9X5YjYBY0hoi4o fAyGcKgieAvtZT7jhfADfAWCgqLqf1cGzwfVzlEzO0vhm2TZ+rmOVfPECFypy1WvgB PgjAyR+xskB4fLQyMLNjWsY/QRqakPh9wjyVnP93s2hDBz/wWvtp4xYj1dAEps7Yeo VXvJtfHLrygJQ== From: Niklas Cassel To: Damien Le Moal , Niklas Cassel Cc: Werner Fischer , Daniel Drake , Mika Westerberg , Jian-Hong Pan , Dieter Mummenschanz , Mario Limonciello , linux-ide@vger.kernel.org Subject: [PATCH v2 2/5] ata: ahci: a hotplug capable port is an external port Date: Tue, 6 Feb 2024 22:13:43 +0100 Message-ID: <20240206211352.1664816-3-cassel@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240206211352.1664816-1-cassel@kernel.org> References: <20240206211352.1664816-1-cassel@kernel.org> Precedence: bulk X-Mailing-List: linux-ide@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 A hotplug capable port is an external port, so mark it as such. We even say this ourselves in libata-scsi.c: /* set scsi removable (RMB) bit per ata bit, or if the * AHCI port says it's external (Hotplug-capable, eSATA). */ This also matches the terminology used in AHCI 1.3.1 (the keyword to search for is "externally accessible"). Reviewed-by: Damien Le Moal Signed-off-by: Niklas Cassel Tested-by: Thomas Weißschuh --- drivers/ata/ahci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index aa58ce615e79..4d3ec6d15ad1 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1648,9 +1648,10 @@ static void ahci_mark_external_port(struct ata_port *ap) void __iomem *port_mmio = ahci_port_base(ap); u32 tmp; - /* mark esata ports */ + /* mark external ports (hotplug-capable, eSATA) */ tmp = readl(port_mmio + PORT_CMD); - if ((tmp & PORT_CMD_ESP) && (hpriv->cap & HOST_CAP_SXS)) + if (((tmp & PORT_CMD_ESP) && (hpriv->cap & HOST_CAP_SXS)) || + (tmp & PORT_CMD_HPCP)) ap->pflags |= ATA_PFLAG_EXTERNAL; }