From patchwork Thu Jun 6 09:03:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13688097 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2137.outbound.protection.outlook.com [40.107.22.137]) (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 9DDDE13E8B0; Thu, 6 Jun 2024 09:04:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.137 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664651; cv=fail; b=efEQThqHqs9ECKYNcGL2Jjb/+HjgNX9ua4P90V2hSMSWiCMtLXTpI3vwjA9PGFNpSe8KQopD7yMdHnJfhFKQMtQ+W0T7MfaPuDzwiewckPDms286DeCn4/18JlImR2njtklOFwmtS6RCuNUABx9bC7+9oOhPbTeG+sszgQMLko4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664651; c=relaxed/simple; bh=oGHAmiaIXUBlb1bL754L4bhEDbYyEsEujOoaumKhU5Q=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=iGRBQdMo2brXHwBrI8LC+HUn1wewLQxL8TdqLI4S/OTI2Mpcuo3v6wG3O/XZW42tmO+FQ/M1rIfEG2AcsYQE4yjvhI9FJudV575CluOzk6d8nV4EPsXTx2pO5z3wu0RF0piSmV+yZnkXh4vQGrH4zS4OHkMytUxdNMZoMtgnfFY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net; spf=pass smtp.mailfrom=wolfvision.net; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b=0Sjn8JvX; arc=fail smtp.client-ip=40.107.22.137 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b="0Sjn8JvX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qqly8M9vKzho9rop16OrtqL17MPQzk5iWIuFHnWepelOMD0Yo3H3LvHCTJF2YNizyEihJ91cvtuuVXbwt6ISAI4chbVNNcOQ70mF+HM0LZULyPcQAfj4nnhFmTpUktWQgK4fKf2GFIJ6bRLlvxq9fgxnBs0VfgO+XYyNFLhc+O+M+lrHKOO7BoSS8/3+FAaS0DnShEXOgSXQDkBuV73AmROV5YieH7JUmVIMUTJ3bvXGzC+IwrhuALHaGJfiMCCy+5UeG2S6XIBO6Gg0Cb2eoG31QMSlw35vRZ9pdwz7oCQtzhl/A9i+0kk0E8PxA9gv4cY4CHNEAVBLdk/BZbwJhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=pgVPp8pUkqh1jiJMjjW5QlfFUuPCqjWn94zVfmSvdT0=; b=mOxJ2igyqVy8UbCbwqHZzRNMaMN/PmAGTg4DdOZanckbSiM4Wfd4Hpmc3A9mG6rd7vTu+lao+yB+OWgbnlenYuFOguvYjx+qrhl+JkmtxBgJzSNhrAvWEpKlYlL/h3BJpRtUD5Psuc0tlz04esgpL3D5kIUmOfhh5vBmI8/gbxl4SCLIfEU/uzseXm4L0sthY4B9bszWgPPOqlUd0+wL5bCZozmA0wCtkL9rEeajZuXvMOLpvJiZ2YQ5QbnPFHVoAAOzh9FYHXrx4SIZe6nm3gOLniBkbC4PjLR2x+MjlPMea17LKNBxqRWVCpmu2ysMwdXkedzPBdApbS4Q7K/Qyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pgVPp8pUkqh1jiJMjjW5QlfFUuPCqjWn94zVfmSvdT0=; b=0Sjn8JvXW7UV7tPN5zxsQxeiO2G0CtF4PcZLTq+nmgzfxjdUa9DFfQkvWx4iVOFf+I+NhI7TevxwppMMhNHB0ksn6FIEmyypgLpovvXcwi0idTQMgDJUuXApV/dNOnphc2QMnTfciB2x+sscrGgB9hselmOwUesqEliefmTg26k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) by DB9PR08MB9513.eurprd08.prod.outlook.com (2603:10a6:10:459::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Thu, 6 Jun 2024 09:04:04 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::a08:11be:8709:f5e1]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::a08:11be:8709:f5e1%4]) with mapi id 15.20.7633.033; Thu, 6 Jun 2024 09:04:04 +0000 From: Javier Carrasco Date: Thu, 06 Jun 2024 11:03:55 +0200 Subject: [PATCH 1/3] usb: typec: tipd: drop second firmware name read Message-Id: <20240606-tps6598x_fw_update_log-v1-1-2b5b8369a0ba@wolfvision.net> References: <20240606-tps6598x_fw_update_log-v1-0-2b5b8369a0ba@wolfvision.net> In-Reply-To: <20240606-tps6598x_fw_update_log-v1-0-2b5b8369a0ba@wolfvision.net> To: Heikki Krogerus , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1717664643; l=2278; i=javier.carrasco@wolfvision.net; s=20240320; h=from:subject:message-id; bh=oGHAmiaIXUBlb1bL754L4bhEDbYyEsEujOoaumKhU5Q=; b=r4KNoC8k4VSaEhfrsjFcfiHVzBdM9agVHEPIE02+v6efdb+cmOpugYSW7DXUW7YapQQ1R+99x rU94TB5UcGbClpBuPM2ufQHxaW8jRn+Y97sPiHBxm/Ag7ZGCt7v1C5l X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=Vxk2/0sGIxM8rsKnceszFuSuHVfQwa1Yo8+is7BX2nY= X-ClientProxiedBy: VI1PR07CA0310.eurprd07.prod.outlook.com (2603:10a6:800:130::38) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|DB9PR08MB9513:EE_ X-MS-Office365-Filtering-Correlation-Id: 149ea9b0-4999-4dc0-e74f-08dc86079ce5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015|52116005|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?eo1z6HggemNEfPSBNkqmQ0f1clpjrvA?= =?utf-8?q?l4sAdj2oP3OEFfZre5oT/uSjQlqljsIH+ZUhtBU4jSl04iLac7wqGstuLJMCdXVdJ?= =?utf-8?q?28NsidadZpvJKDwILXzPNhiR897r4CqWVib6QBI80g1U21h1tESaReHkPrjY8P9UA?= =?utf-8?q?JeFPWWqF4+fgkDSbSShBAWMfQM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97CeWYcZltOT4/zV0GvWxnTD7l+Pu2tbGr/bAQw?= =?utf-8?q?3bouXuHQTipB4aP8VYqMvFT8lzjt1+dbl6cUKrKBwkn9wRaNFcjTNH6v9rddaBhbs?= =?utf-8?q?Ew9+spn9Z5JO0bPQ8mkHlLl3Qkl++dgiHjulyJyQ7V0lKGEBQiObmLiKIK76BRQH+?= =?utf-8?q?rTfj8vW5ERZHNGK2ofYd7MEjbCpbCIqiwUztplTbYdyMaece3TbMM533cvFivsC+u?= =?utf-8?q?c8K9+gqmnc1Uq5aCCF5/whfLzIIawnZUw1+WYamCyDB3KopZXViWLDi0=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR08MB4974.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(366007)(1800799015)(52116005)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?LPTVFPbXucBnzKg+53GbbIgBYB4w?= =?utf-8?q?U9wlc6YGdfECICbty4DGQkb4i06q+BC45ryGI/S/I2qiF1PuCIPyTfxl+AjbhPGrw?= =?utf-8?q?rUer5LJsMnl67Io5iebRfzLD1TGn9v2fyUaINVKuY9hq4Ji33XcUSZFWD6HLVlr0K?= =?utf-8?q?Vd+Z3gq4LbKa+D73hLP2XBSDuYneS+aKJTh1Cv7FiISLOwsp7uGTz0l7dkRHHQcSr?= =?utf-8?q?bttVXr0vKwOrqJIc1wILm/7IemJ4uD8bS+cMHdQ46eoxuEKdJaJy61uxIB/YCkCqh?= =?utf-8?q?ZfmiNlirargJpIdiQ4bPtic2U98+Yn0tHNjlDHGLhuemu+FEDtFEycXQjNq+N2UQi?= =?utf-8?q?TOlGt3yedoj9/Ro+BQZDpvxISjeZelueUXFGh92IF5IL5awYPHs+cv1e7qGocA7dX?= =?utf-8?q?o8EHBIV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3ABF558OXcZqQe8OyhcBahms5IDRO4JHX8P7N84h3PGP/BiP0n0Ka6TYmHt?= =?utf-8?q?7UqPo4V/Wgh6sE28kME9e2+CYi5D2vsd/Pk5CzDnr1SfgEXwrOkc55A1aUt36OdwX?= =?utf-8?q?I4ta0cIxfngvXMAUeRattR9Km4Nt9r/CiIWCrQ4Iv9quI5MagnH5VXNhulmLcA+cR?= =?utf-8?q?RBBM+48Cy/082zjVLnsndrt7In25OU9ayV/VbtZ9xx8Pw2qV1DV0qsN4MH2BljhSN?= =?utf-8?q?Iwbzr1sNJBbyPDYVRi6yNxPjy8zsmCk3uw=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 149ea9b0-4999-4dc0-e74f-08dc86079ce5 X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 09:04:03.5791 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: laNCqxEUZNcPkI0p1r9DfuI1GyHVylkNayYNcbGEbIXCZdHF6MXGUKlp18jhoL3F9e6WM2hffOJmde9IqKTD0lVfQ3RKNcApWBjh4Z2YKFk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9513 tps_request_firmware() reads the firmware name and there is no need to repeat the action in the device-specific implementations of the firmware update mechanism. Provide the firmware name as a parameter in tps_request_firmware() to avoid repetitive operations in the device-specific implementations. Signed-off-by: Javier Carrasco Reviewed-by: Heikki Krogerus --- drivers/usb/typec/tipd/core.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index ad76dbd20e65..851b0d02727a 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -892,19 +892,19 @@ tps6598x_register_port(struct tps6598x *tps, struct fwnode_handle *fwnode) return 0; } -static int tps_request_firmware(struct tps6598x *tps, const struct firmware **fw) +static int tps_request_firmware(struct tps6598x *tps, const struct firmware **fw, + const char **firmware_name) { - const char *firmware_name; int ret; ret = device_property_read_string(tps->dev, "firmware-name", - &firmware_name); + firmware_name); if (ret) return ret; - ret = request_firmware(fw, firmware_name, tps->dev); + ret = request_firmware(fw, *firmware_name, tps->dev); if (ret) { - dev_err(tps->dev, "failed to retrieve \"%s\"\n", firmware_name); + dev_err(tps->dev, "failed to retrieve \"%s\"\n", *firmware_name); return ret; } @@ -999,12 +999,7 @@ static int tps25750_start_patch_burst_mode(struct tps6598x *tps) u32 addr; struct device_node *np = tps->dev->of_node; - ret = device_property_read_string(tps->dev, "firmware-name", - &firmware_name); - if (ret) - return ret; - - ret = tps_request_firmware(tps, &fw); + ret = tps_request_firmware(tps, &fw, &firmware_name); if (ret) return ret; @@ -1155,12 +1150,7 @@ static int tps6598x_apply_patch(struct tps6598x *tps) const char *firmware_name; int ret; - ret = device_property_read_string(tps->dev, "firmware-name", - &firmware_name); - if (ret) - return ret; - - ret = tps_request_firmware(tps, &fw); + ret = tps_request_firmware(tps, &fw, &firmware_name); if (ret) return ret; From patchwork Thu Jun 6 09:03:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13688096 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2137.outbound.protection.outlook.com [40.107.22.137]) (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 9371A13E8BE; Thu, 6 Jun 2024 09:04:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.137 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664649; cv=fail; b=GCOGV3rxQC8u5a7iWwM14hSNZeATTI8SkmIpZ8AuT3I55FutLno3d2vlDNOfNvbyHNcWkI63Z4d4O8H7xclVNyu0ObGIpbXctmeusp8OLeFNdq3RpgGMo0U7r0160F1LxzSeWoO2nXqZ1fvl4Bb5FV9oLge3LnV51j+wpZF6hFU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664649; c=relaxed/simple; bh=aoQGd5ZliRw15hKnZTHa2KKfY2LRQ+HHwl3dLCuDzEo=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=LL8SYLrR7owQ3EUZ1fXXyXKndyg02ZXVv8arYHKmO9KhqJRU8gSffzyzprJPcusjGHLMjsA4JUdSJKAVHAhhdWra6lgWO0PUuQ2X4B1TgkSmO6jRnTlMt2gO4h2Dc0cPJaTdN+QVEENsjjPooczPU6kkcbLIpbsIEqZunbUfdbM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net; spf=pass smtp.mailfrom=wolfvision.net; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b=xJnOkgDR; arc=fail smtp.client-ip=40.107.22.137 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b="xJnOkgDR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VIFHoQhVJIh1gUvFbUPv/BsQOSCAvful93BDyDkmWn6Hk5nhAA89oz8tv/wIf4/XbtYfYposVgwVOfa+SEdE0lzNr6eMODWwPI2b9z1mgbT9XmqpcnC47tTHJQNwVi7aCyYknJcvgDydHjlHJTMyL4lCcsG00cGhnT7jRsWXBJ8hlzotrlw+waSc+vTPD9272Hgd265ZGAlWlqfjeItdcnGjr5eqkE3T4HRYOidykzOBHhHuFOjtwLF4gnq71hO3VlJ1piMm8L3izRfAXaTgnF+li21fN+j7sQlCIM+Gf6djZm+lXQgNqK2rXkfmyMjx+KbKzR/PKuwTYHJjSQT+Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=vAB2FzZBvrU7LxEpBzwymNV0PbYDBiDtlljYTeMWBt8=; b=iFSyJWdqGKFINUu9ECY5uA2u2AEn6BP9ujlizlHnIh/5Yj74ZETn5hevXxkKNcNQpczA76IAN19sQ4dTZ3xr12XakcMi8RUH7N4Q7Yzx4acOb+BsoWGkwe4wXAZZV2cWESXj4t5qbJP43J0iiX4vKig50D0FydBfqHlGrKeE10yRu8+75PxyVr2xINTPD/CGL/2E/Bl9Ut3R+SPVJ2klRit7Hwprk7fru23P/rd9tM7BMVZ40+YD7Xnum07PhYK7VoJypYWpdG/Kwg0UfVDZqJ9h6DZ+WEabtcJicc2xrMJwOFRNqR/D3MNr/gO9h8Ym45eP/+lDHxmjuNAkwBSd+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vAB2FzZBvrU7LxEpBzwymNV0PbYDBiDtlljYTeMWBt8=; b=xJnOkgDRqJYcZIW47xe0Ru0JeIfIwGx3QZubukBR7bt8lNxr0Crz7I1ZBik3EIxTPKKa/JzExabr9sQoN3ppjwx/y4QY3KW0IpqAvvICqXMc8P9RYoforqAeMOnmPc8zcm5ZM5nP8CG12YWNujiCqQ2gRW4lhE2d4aSzxuSjZzc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) by DB9PR08MB9513.eurprd08.prod.outlook.com (2603:10a6:10:459::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Thu, 6 Jun 2024 09:04:04 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::a08:11be:8709:f5e1]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::a08:11be:8709:f5e1%4]) with mapi id 15.20.7633.033; Thu, 6 Jun 2024 09:04:04 +0000 From: Javier Carrasco Date: Thu, 06 Jun 2024 11:03:56 +0200 Subject: [PATCH 2/3] usb: typec: tipd: add error log to provide firmware name and size Message-Id: <20240606-tps6598x_fw_update_log-v1-2-2b5b8369a0ba@wolfvision.net> References: <20240606-tps6598x_fw_update_log-v1-0-2b5b8369a0ba@wolfvision.net> In-Reply-To: <20240606-tps6598x_fw_update_log-v1-0-2b5b8369a0ba@wolfvision.net> To: Heikki Krogerus , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1717664643; l=918; i=javier.carrasco@wolfvision.net; s=20240320; h=from:subject:message-id; bh=aoQGd5ZliRw15hKnZTHa2KKfY2LRQ+HHwl3dLCuDzEo=; b=KqpqGvn1uyKtq2if0MePRVBfvfyMu9hlH2Q5e2y7WBhrV84kmnAVYFPdC8AnYdRjrBjDckOiC 3cSuon7ILc7CycDQN5XEQ0tBIiX15GwD8SCCMcoAnnIrFaeSSkAw8nn X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=Vxk2/0sGIxM8rsKnceszFuSuHVfQwa1Yo8+is7BX2nY= X-ClientProxiedBy: VI1PR07CA0310.eurprd07.prod.outlook.com (2603:10a6:800:130::38) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|DB9PR08MB9513:EE_ X-MS-Office365-Filtering-Correlation-Id: 7501ae53-f733-4cd1-069b-08dc86079d2d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015|52116005|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?RfRHIDLAkzG3Ctcv6RejhDSd8xrusLR?= =?utf-8?q?98pYqnusd9g6xPDabVGe9SElPB4gS4NTOCkDllhnE5Wu72+qlLtHDGqTe4LZGgOP5?= =?utf-8?q?Hq2iSTXiSeUPVeVoDTuLemqGTDtAgbOjF09kCgKsAjMUSZSMzCe+TZHH4pMZ2s+CT?= =?utf-8?q?WpQijqdqnlY437KdyV0w4eHahoUhC299jVIOXugQZqpBFIbk0C2UyHcQVCwrOEQXK?= =?utf-8?q?jeoX0FX4Kq1qe47KnCDjljO/h7semKpvkTg4uV7c7qeHPGQBlqWkbHQ10o95FKOsx?= =?utf-8?q?fzQXYW1R7a5TMJNPc2WjKYgnWYhoeuMS+MavlXnBETQqO6RsQxJahcxkhJjcLDWW0?= =?utf-8?q?HJa6ZgCu1cqSbe4P8VSkRjvdzutujekbOfE5skyVd/7jDI+aEvSz6vJ0D+uzagz1G?= =?utf-8?q?BciplA+c5nNhWCRpRfZ350pUlY5c5EGLjNwXc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38zrs0=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR08MB4974.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(366007)(1800799015)(52116005)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?O8eVECP/fKUXm6UckG/7wMXJYxhP?= =?utf-8?q?OxjpRfNuLiX+7MzAUAcZFnTvGY/7iOYvI+mO0t5X3WNz6jj32H48jtSx1P36uwRpe?= =?utf-8?q?3QxXln/bw9f5fbc6KZkzHupOck35MEPdZXp2YM5Y7Vw1SsSkKoeb9GU0oKpx9CVPe?= =?utf-8?q?Zi1/VtnLLmaXz0oI4FwxD5aYPmhXIDYebxtdDsgRnpsBRruEPDnaxQISgnTerpqsQ?= =?utf-8?q?3+IptZJTTD0DPxGicBnthvTaC8jkY6wXiX6Xbf8oqXXRHWc96oifZC1Ct5yPRYURz?= =?utf-8?q?e4Ymha81H6jiLUSixL0xhvkaGyuIJ+86KrqlQjTUJ5LeERcuZchbrNuwMSAtioDNs?= =?utf-8?q?qdthMGH+D3UAM1glpbbC5RjcbuG8z/VVza+37704LyZPom6FRDULZPegXsp+QN1uI?= =?utf-8?q?Nk3b3yHGhnrY73n2ebnrqUykmHZYlfi/LSr1z3S2ll4H6RfQAC0SwUVr/yz6DICl7?= =?utf-8?q?XYT+NzwYSbDjMIEmTin7Q/XA+xqZGk5fc9Rfv6WUZ44NmFOqv5xlWVtvQ/3KQLVVR?= =?utf-8?q?FY2uwaxBGvLIZqgpdDidIHa8rk1iEExyZXld23hmsP6BD3niPJLLuoKWvQSfU0AWf?= =?utf-8?q?jS2P8HfKKv7AJr5hOjJjyN6/qv0E3tNjvNhr6UmBHSx2Nii71caSGCAXXdeD0TmCJ?= =?utf-8?q?aMNI2xIzY8b2qS8BMuyP8d/Oe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Hl1DAoF3OIBVhVGmjtPU3Wl4o=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 7501ae53-f733-4cd1-069b-08dc86079d2d X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 09:04:04.0570 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QnupOk8Y7g0SqtjlwufvtXey6sqeZSIKO+sM6wVBdMBd3tQV8PWvQFgta1vVS8nAIy3XrksKnwkItSqK0nYDoIBYj0vHu8NI/epQ/ZWnTz8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9513 The current error logs do not show the firmware name and size for the tps6598x. On the other hand, this information is provided for the tps25750. Both implementations have access to that information, and the existing message for the tps25750 can be used for the tps6598x without extra modifications. Signed-off-by: Javier Carrasco Reviewed-by: Heikki Krogerus --- drivers/usb/typec/tipd/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 851b0d02727a..58f6eeffd070 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -1195,6 +1195,10 @@ static int tps6598x_apply_patch(struct tps6598x *tps) release_fw: release_firmware(fw); + if (ret) { + dev_err(tps->dev, "Failed to write patch %s of %zu bytes\n", + firmware_name, fw->size); + } return ret; }; From patchwork Thu Jun 6 09:03:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13688098 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2137.outbound.protection.outlook.com [40.107.22.137]) (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 B2EDD13F43C; Thu, 6 Jun 2024 09:04:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.137 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664653; cv=fail; b=Tndul5aV2BH8Q5ln3Qs3k71dhNiztYgxmNwbSbW/6eQQGxRkCa4DvBtrMCwzVWaLErpGhPY6CBRLSFdhn0KMLQ3SjKHsxsY5acV+y8FisM1/LO80aD9KpgDEJBb9QaGS1H4cqxAspr8GBNaPsndcYJYL+nQE4Zs4yolJsYSOLS4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664653; c=relaxed/simple; bh=/bvpjmuTI73t9Y50sKoIVGe6v8d3c15b5jQEKsWXO6g=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=J3U8To1embw1OO6Nl/dqdSPV6qxBS+f0CTCyomPgNTQ5QNWwh+Q7MqDK5KCZXCxVQBJfvJ5XTPOOstOMiWqhjvUyvUc9T2e0FOyK77Bvi+K2fFw7HuIQg+WcUaiyfTjr9KKc7xLlB7dNp49exIBeCx3yr/8vMe2E7ADQPYmEXCQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net; spf=pass smtp.mailfrom=wolfvision.net; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b=Mfe8kNA8; arc=fail smtp.client-ip=40.107.22.137 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b="Mfe8kNA8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D0EafCGd4TYE7ps86p31XWdT1gkhqR0oxOFguEHrHUBjOSb6WBkcitdRiJL/dbaAJv0Kw3SEUcy8TXarSUWOf2iRWkb9GtWzB7DBJe7W6ydaOeOkkxMS7WOHQxC8iuVhnph/ITJoj2v0aikOPU0nWAe1NWGF93N6SSJVm7kr80kmYDN+jkDHl15fE/RYlo7rY9NUxQCZ1dT36sRIH3OYXGHvgvQ8VMDvluo0edY/KRjoKQUKDYAVHMyS2cpmzvnNA6tLeZmnDg+yRgBjOo6IdBHdtMR1PTFHn4IqJT+6fQwPT8HKYG821ecLtTa52ci57A8+gzfv0WC+KdxIQCfqLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=/0sPv/kgzthBYwBq9wWhLcgJfqattFC5Ri363g8RG+s=; b=bbqHXrGym1JJIdRhMEaJN2PTM1xqVL51r8XWFNA85VHUwZyYwqj7ZrL//FEbQTgiMO4lrW3kTHs1B3BVk45TRCT3I9q8kIiIDjxe0l8tdBCsw06/0uwp3a6io0TZCgnE6Z7HUf4WPXAzCVdd6SxbdrRBqMLJFS7wmkh9zJJpCXRWOPGfY4B8QIN3TsQSf4C09VHbFB754Zde9aXEqYrA+pWVuLncDZZAXpIbPk/fhaJyfPMicrQRWv5en8X0JMJ6GMYpH6ANXwU/IIxtM6wE3A6en2YKif+Tint1lxTqYbcdRHcPfU4Iu8zG10rAj9CtrxnLgE/Ae9TWgASU/v46/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/0sPv/kgzthBYwBq9wWhLcgJfqattFC5Ri363g8RG+s=; b=Mfe8kNA8MnhORslnyJW2ba+tsUavRNxPtrQZjcT0BTbkaZLR+OeWdvXujiRZBn3ObdzZ3nlAQCV0oyh5gSZldVm509sBBUMF3LaJ8KAGzsVPDrtzRtILFy7fNIvPI0kc4Lxmxc5Xn7imhgbhmbroQrasqjDPZSDbiuFRUxadnFE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) by DB9PR08MB9513.eurprd08.prod.outlook.com (2603:10a6:10:459::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Thu, 6 Jun 2024 09:04:04 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::a08:11be:8709:f5e1]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::a08:11be:8709:f5e1%4]) with mapi id 15.20.7633.033; Thu, 6 Jun 2024 09:04:04 +0000 From: Javier Carrasco Date: Thu, 06 Jun 2024 11:03:57 +0200 Subject: [PATCH 3/3] usb: typec: tipd: use min() to set tps6598x firmware packet size Message-Id: <20240606-tps6598x_fw_update_log-v1-3-2b5b8369a0ba@wolfvision.net> References: <20240606-tps6598x_fw_update_log-v1-0-2b5b8369a0ba@wolfvision.net> In-Reply-To: <20240606-tps6598x_fw_update_log-v1-0-2b5b8369a0ba@wolfvision.net> To: Heikki Krogerus , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco , Julia Lawall X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1717664643; l=1069; i=javier.carrasco@wolfvision.net; s=20240320; h=from:subject:message-id; bh=/bvpjmuTI73t9Y50sKoIVGe6v8d3c15b5jQEKsWXO6g=; b=rItKa9iubWFufBYxSWm3roOl9DhE7SOTQxKGq428uU59ImBcxOIMUFYbYzbZ3wxucnyPyl1bK B0Q+qwA7qAXDBnqhPYkS/59J6l17DKOK/7cEYVanpJDeEEG/rDwd0s0 X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=Vxk2/0sGIxM8rsKnceszFuSuHVfQwa1Yo8+is7BX2nY= X-ClientProxiedBy: VI1PR07CA0310.eurprd07.prod.outlook.com (2603:10a6:800:130::38) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|DB9PR08MB9513:EE_ X-MS-Office365-Filtering-Correlation-Id: e8150fcc-12e0-4735-f2c3-08dc86079d54 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015|52116005|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?IJPekG6vrbwybYGsmzLF02bLzhLeW/2?= =?utf-8?q?aosuPNUdvbEkdCx3iYGye3Kb8AWZKfXk0SUhup0Zhhw3FEPQ8bJkOKMz3X5vXKg8D?= =?utf-8?q?uXv5F95Nw6d9AgfwgfgAmh7Pv9QjnACN5t0kMDiYDiV768q4wJdupoUA8BOj0wmmA?= =?utf-8?q?OQ26oZlJrzOiUXYb4lAhJAW120/lsDIC8yfBmnzTNzmaZ+tp8ggKUWLo+fq5D0AB6?= =?utf-8?q?1Qsbpt0UDQIL5AekPAm+j5V8WFrvgZHR+5u4M0WimuS85lcu+HlO3xfjTIUzl++WT?= =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yvlidt?= =?utf-8?q?S43gOb6BpxPhQGmLD8XeRMrVHWYZQn5dpPQdpmuSt8rbA1GKQGbkvmH0s7vf5CNgF?= =?utf-8?q?qU/BzJkr8I/sIlCxLvXkQa5VkxtD0iNj0L0hP6GjDG51OkiJs/sYYIs9M7GZldvSm?= =?utf-8?q?iakhm63EZ8beWKHEdM7StM0blWGQBtAFbsRXHWV2Y0229K4DmHOWIYjQ=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR08MB4974.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(366007)(1800799015)(52116005)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?mUMsYzgQMGCh2oV1C1HRtOPdmG8T?= =?utf-8?q?xqqo0M7YpfxqvFsrUdtJwLV7HF91d+Ij2tdEEI/yeorcb2Cz6aWs+PXcweA4n19Nw?= =?utf-8?q?s8LLYJXRLtBs8NJr6/FqAn4PBt/Ec31i5Hr7ngtbe1DFjaq/ST7q79T3yTp3ffP3j?= =?utf-8?q?3/6tQJSRWVLsJ1uLz8WMbf/MejfOJM3WdVwJqzwM/OwQ1TQKw9gJi47mLSjeNfoj3?= =?utf-8?q?Ddwoys3yGOK4yet4DggzVkhcbw9w1SrFRCYqIEOiAENHtavlyzHzA+XLnE17BH8xS?= =?utf-8?q?M+Rll4zWz08bwqUqsgjudzi3QuHd2uS+PH7gqPy5+lbG5La566ir+ABuLQ+zJ3f56?= =?utf-8?q?hVBZJVQ6NtZpyt8MaP8PWHT1bColwRR+QEoxk+NbuKyAtxc1UdUkufUCKnntFUj+k?= =?utf-8?q?QJuD/qSm8d0iLI0dlPIgC02fb73fSy7cpMHOeCrWNrUw22ka2hxI8zsAg1+kKMb44?= =?utf-8?q?Ix+dBT/vIVIcwoqGHv5bXSgAy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oVMg8/yBqDISQ3/UD0IHDq07WW0D+?= =?utf-8?q?n1g1ZAmAjAQdJSn4BFyLLH8jgasWxD+OlcoYMlIDyU+gshKEH4dprKNTUOTH8TbHf?= =?utf-8?q?5hxXqdrZ1daQ5S4bYuZua0xSe9H+jqBBMEsf1BSZjPcFrlkw5lGGZTcCOtxC612pd?= =?utf-8?q?GSDcix5eI7kbTj106bZopysDxMARyD1I36O4Gn4D6sbKVne2AyAuXPQ=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: e8150fcc-12e0-4735-f2c3-08dc86079d54 X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 09:04:04.3202 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YPjXAs4gDcCNtis9VgPMVGVEGwrPsujzqIDg5WbjO9QEnlF+PS1bns7A9gEJU8zkoDv/9Iaidtx/4G/tYdgo9t/a6GPuJ2gvGeSYV7GzSAQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9513 Simplify the current firmware packet size check in the tps6598x implementation by means of a single call to min(), which is what the current code does in a more verbose, less elegant way. This patch fixes a cocci warning ("WARNING opportunity for min()"). Suggested-by: Julia Lawall Signed-off-by: Javier Carrasco Reviewed-by: Heikki Krogerus --- drivers/usb/typec/tipd/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 58f6eeffd070..ea768b19a7f1 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -1165,10 +1165,7 @@ static int tps6598x_apply_patch(struct tps6598x *tps) bytes_left = fw->size; while (bytes_left) { - if (bytes_left < TPS_MAX_LEN) - in_len = bytes_left; - else - in_len = TPS_MAX_LEN; + in_len = min(bytes_left, TPS_MAX_LEN); ret = tps6598x_exec_cmd(tps, "PTCd", in_len, fw->data + copied_bytes, TPS_PTCD_OUT_BYTES, out);