From nobody Mon Nov 25 04:44:00 2024 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2138.outbound.protection.outlook.com [40.107.104.138]) (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 CBEA81EBFF7; Wed, 30 Oct 2024 13:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.138 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730295479; cv=fail; b=aJZ5qAjt38CQBCFRiQc0j4HzwzelLSxQnsK1yE3pELrI/6QhI8ubTqnuc+/wPrlCUOy7EudhBztt2qyOmDChAfSG8VyfZkgkff0xyubHR4SblwzQ4rENwyU44Zyk7RN8Wuf0Hc1YzerfB8t0YN+PtkuSbd5PG2njbMlyF9qAysE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730295479; c=relaxed/simple; bh=R/R185xnjGDxDDQYHhH52g9GjQICuTSmE2mmrB/4DdQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=tpPfedczuE7mShE1ql+lG1Tuu4FuoRIy4Zk/X2pv5Oh+LIqGFNnojaViapMqkiQAhEOLnKzaXsteYMdczP3uKQvMvSRbonbyG1qsSJKy4b/iwR90HzN+Sg6DRTWbWV6YzGZKoeOPpV2YhqDFB5O3gJZdgXCaTst9Nod8NoMj1/8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=solid-run.com; spf=pass smtp.mailfrom=solid-run.com; dkim=pass (1024-bit key) header.d=solidrn.onmicrosoft.com header.i=@solidrn.onmicrosoft.com header.b=RDAa6fS7; arc=fail smtp.client-ip=40.107.104.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=solid-run.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=solid-run.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=solidrn.onmicrosoft.com header.i=@solidrn.onmicrosoft.com header.b="RDAa6fS7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cbSqH2YV/Ck0VJd2RhSe2i/lV4E1Yp9fGL67awahdd+u+UjgEJO9CDRmWxvKyWv6hPynf2Wg3AW/vPNLXXvwyrc8qEgKVzaMe+R2wp+zHwkkc5GNNm73fIg0pI3aDiAO3+FVS/aCBQp1S55MHzsCZv4KorbRLKY1BUVxxWRnRby1zphJru78mGV04peNpj9z+vHzHPdOGU0BnsSBkN6zgc69PltJFaBwEj1jNx83tPj6T4WXFE25y5QyC3swzunQ4lDcTTm0d+n6IFhUxIdWtRnjFAAqCOMK/yPtpBBp58ZxXVdXJ97BOyIUhKMYlar2+h1apZxAP01YUCJSCSKTOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5CrzKIeNV3LC1Yjtw8TgAbW2jPPZymVcAdYMB9FufyY=; b=SdJFcn1ccaUzNjVSKnS2JgMrgrMaoxBidcWa9yyDVbeGla5uphao93YymG32AlkozIbf2R2G9skZUetU9x7TJ5ObmLIS1SddZdquCHW30NAUBb+qN30EruxZmNopaD1ualCAs22tNwp0kZVr+ZzOM16NPqpmbJuneYJgg3/QsAfrG5RSLKEtZ1ORjT1L3nlrYHo1ILYMwTB87Hjmn8F/h5o0eRF0CsKUWCzGkYnOZ3KN3xgffTjzTWKf7zgl2aZpSsBgrFs2U594NwxBd/IWGCmgH9ukZ/uyrtWhF1mYVoNPAcx5mWNDZrP9qTHx2Q76JgaERpZrqcRc6vNL1suE1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=solid-run.com; dmarc=pass action=none header.from=solid-run.com; dkim=pass header.d=solid-run.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=solidrn.onmicrosoft.com; s=selector1-solidrn-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5CrzKIeNV3LC1Yjtw8TgAbW2jPPZymVcAdYMB9FufyY=; b=RDAa6fS73cDYJywNWlxw5lqJ+pgYMuh1za+Rh6hO2yqJh6LkXHz6JS63qMWl0zrfEgTK0vtxshw52+2wGknpJN/itRkqeHaIpOEZf9aoJgAv5/Yp48LcsJnjXOroSjy8j1o0JZ6fVgIqXYE28Mg3J60IOLnVG2WuIqTsp6Pdpmg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=solid-run.com; Received: from AM9PR04MB7586.eurprd04.prod.outlook.com (2603:10a6:20b:2d5::17) by DU2PR04MB9097.eurprd04.prod.outlook.com (2603:10a6:10:2f0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Wed, 30 Oct 2024 13:37:50 +0000 Received: from AM9PR04MB7586.eurprd04.prod.outlook.com ([fe80::c04e:8a97:516c:5529]) by AM9PR04MB7586.eurprd04.prod.outlook.com ([fe80::c04e:8a97:516c:5529%4]) with mapi id 15.20.8093.027; Wed, 30 Oct 2024 13:37:50 +0000 From: Josua Mayer Date: Wed, 30 Oct 2024 14:37:44 +0100 Subject: [PATCH v2 2/2] mmc: host: sdhci-esdhc-imx: update esdhc sysctl dtocv bitmask Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241030-imx-emmc-reset-v2-2-b3a823393974@solid-run.com> References: <20241030-imx-emmc-reset-v2-0-b3a823393974@solid-run.com> In-Reply-To: <20241030-imx-emmc-reset-v2-0-b3a823393974@solid-run.com> To: Adrian Hunter , Haibo Chen , Ulf Hansson , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Mikhail Anikin , Jon Nettleton , Yazan Shhady , Rabeeh Khoury , imx@lists.linux.dev, linux-mmc@vger.kernel.org, s32@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Josua Mayer X-Mailer: b4 0.14.2 X-ClientProxiedBy: FR0P281CA0165.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b3::13) To AM9PR04MB7586.eurprd04.prod.outlook.com (2603:10a6:20b:2d5::17) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB7586:EE_|DU2PR04MB9097:EE_ X-MS-Office365-Filtering-Correlation-Id: 93c4eef2-d44a-4a48-262d-08dcf8e80c62 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|7416014|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MEhaV214d3c3Snl1MXBpTGQxQjhNVlVhdURnWEZYSm1ucUU3TnVzMzg3cmpo?= =?utf-8?B?d1FSZGllcitaZmM4aUQrblRjV2hvYnZ5STRiOEJtR2trdkhVQ3o4UWtub0Jp?= =?utf-8?B?MndCNU55L3NkQ1FrU0FwOER0ekdqMzdqZEdGb3dSdXc4aWljQU9zeFhpZ3VW?= =?utf-8?B?ZW1QYS9XdGg0S3dnRWE2ZGpSMm1UMnRDOUN4QXowbUd3TWxNcUlpTi9vK0ZE?= =?utf-8?B?OUxzOWxwZzhTREE2OFR6QTZZbjJOVU1NZE9GRW84QkpwcUt0SURITGhOS3hE?= =?utf-8?B?dVRuQU4vM0luc2I1YU5leTFaazFtc0pMaEN5TEJYckVoS1U0RUs0S2E1dEZO?= =?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3Zmww?= =?utf-8?B?VFk2dlZ0bnJWMmF5QkhhLzNVU29aMHFRaDViQTFHd25jWGpwQXVNU1pjTE5C?= =?utf-8?B?ekIwMEJqaUYzd29jWE9GMkV3S25BRFYzVVBYbHZmeDVGUjlhd0s3NHFkOGhu?= =?utf-8?B?WjRYYk51MVFZd0RMN2c2dVU5ejhaQTVSb0F2UTdUL01wdWxtakFhRjhROE81?= =?utf-8?B?QTJJeDVYbWFpZWdPVXZmNFJBbGU3RENuUitqYVRZenJzeWQxT1VkMnVTaDMy?= =?utf-8?B?ODZzTmlaSVdvUW5KOFlZSFlYbHRES3VzWWlacWNUUG1idFZuWTN6STEvSi9R?= =?utf-8?B?YzROK29IWXVzTStjUythSVpKVmc1WXpqb1M5MnJvUUt3QlFPMG9KV2k0WEtS?= =?utf-8?B?bVRUS3VVZTdIUmFZYUNkMk1mcC9RdXN1R2dZUlIzMGtSaUlDQnRzdU1SNjlD?= =?utf-8?B?SmliY1lBb3VyMDZtOWhMTUNxZVV4NXY4NDFqYVJLU0FacWxJVG5RL1lMY0Zz?= =?utf-8?B?UmZCckdlNk0rUU9ySmUzekpCNFo3T3U4Y3B1N1lLbFlzc1paZWpGR2YzUnFn?= =?utf-8?Q?Yw/nNvcZJuIEHkfmtqM1RucBwuNZNj6J8VdVc=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB7586.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(7416014)(376014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TllXdzM1ZWh0TXNORDhoMHRLWVBINkdMNy9uM28ycVpJYyszUFNPYkFyRVRJ?= =?utf-8?B?Uk1PaUFONENhS3VQOURHaGJocURwYlhoL2RDTGIreEszSURlMlhJYkxuM050?= =?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ak4wSVM0cFh0cU95OTNla2tvYU82NERn?= =?utf-8?B?b2R5SG5XUkgyaUVjeE5NNVMxWHdLbERmb2lFYVdJWVQzVjZTZGNaUUUrU3lH?= =?utf-8?B?TDdwUUYrNDJlbUVtczBvNWdVUHJST0Y1V0tlK0pEWlNsWVFyQjM1NDd4NzBv?= =?utf-8?B?RjZTbjBFZGxZMUxab1VZaUdzRTRZV1ozNkovU1hMR2huZGVqNnQvSS9oa2F2?= =?utf-8?Q?O3Cmd73IrNN1CcCgeF2AO5Vky?= X-OriginatorOrg: solid-run.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93c4eef2-d44a-4a48-262d-08dcf8e80c62 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB7586.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 13:37:50.4816 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a4a8aaf3-fd27-4e27-add2-604707ce5b82 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: B49RqsAbTljftugADP3LdAM1CbZ9p09whC5WdKMeJSQmrxrN88wpRZlWSUlWVRpPq9yVnZyOe5L2IX2NA8CZOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9097 NXP ESDHC supports setting data timeout using uSDHCx_SYS_CTRL register DTOCV bits (bits 16-19). Currently the driver accesses those bits by 32-bit write using SDHCI_TIMEOUT_CONTROL (0x2E) defined in drivers/mmc/host/sdhci.h. This is offset by two bytes relative to uSDHCx_SYS_CTRL (0x2C). The driver also defines ESDHC_SYS_CTRL_DTOCV_MASK as first 4 bits, which is correct relative to SDHCI_TIMEOUT_CONTROL but not relative to uSDHCx_SYS_CTRL. The definition carrying control register in its name is therefore inconsistent. Update the bitmask definition for bits 16-19 to be correct relative to control register base. Update the esdhc_set_timeout function to set timeout value at control register base, not timeout offset. This solves a purely cosmetic problem. Signed-off-by: Josua Mayer --- drivers/mmc/host/sdhci-esdhc-imx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-es= dhc-imx.c index a830d9a9490408d3148b927bf1acc719a13e8975..101feabb24fb41bd10a2e796f4f= 3f8d4357dc245 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -30,10 +30,10 @@ #include "sdhci-esdhc.h" #include "cqhci.h" =20 -#define ESDHC_SYS_CTRL_DTOCV_MASK 0x0f #define ESDHC_CTRL_D3CD 0x08 #define ESDHC_BURST_LEN_EN_INCR (1 << 27) #define ESDHC_SYS_CTRL 0x2c +#define ESDHC_SYS_CTRL_DTOCV_MASK GENMASK(19, 16) #define ESDHC_SYS_CTRL_IPP_RST_N BIT(23) /* VENDOR SPEC register */ #define ESDHC_VENDOR_SPEC 0xc0 @@ -1387,7 +1387,7 @@ static void esdhc_set_timeout(struct sdhci_host *host= , struct mmc_command *cmd) =20 /* use maximum timeout counter */ esdhc_clrset_le(host, ESDHC_SYS_CTRL_DTOCV_MASK, - esdhc_is_usdhc(imx_data) ? 0xF : 0xE, + esdhc_is_usdhc(imx_data) ? 0x0F0000 : 0x0E0000, SDHCI_TIMEOUT_CONTROL); } =20 --=20 2.43.0