Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2217212/?format=api
{ "id": 2217212, "url": "http://patchwork.ozlabs.org/api/patches/2217212/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260327184706.1600329-10-vladimir.oltean@nxp.com/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/projects/28/?format=api", "name": "Linux PCI development", "link_name": "linux-pci", "list_id": "linux-pci.vger.kernel.org", "list_email": "linux-pci@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260327184706.1600329-10-vladimir.oltean@nxp.com>", "list_archive_url": null, "date": "2026-03-27T18:46:47", "name": "[v6,phy-next,09/28] scsi: ufs: exynos: stop poking into struct phy guts", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e9735f591e264260904199ded41de71cf2ccfd9d", "submitter": { "id": 75582, "url": "http://patchwork.ozlabs.org/api/people/75582/?format=api", "name": "Vladimir Oltean", "email": "vladimir.oltean@nxp.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260327184706.1600329-10-vladimir.oltean@nxp.com/mbox/", "series": [ { "id": 497822, "url": "http://patchwork.ozlabs.org/api/series/497822/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=497822", "date": "2026-03-27T18:46:39", "name": "Split Generic PHY consumer and provider", "version": 6, "mbox": "http://patchwork.ozlabs.org/series/497822/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2217212/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2217212/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-pci+bounces-51335-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-pci@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256\n header.s=selector1 header.b=cQd5Oy+i;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-pci+bounces-51335-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com\n header.b=\"cQd5Oy+i\"", "smtp.subspace.kernel.org;\n arc=fail smtp.client-ip=52.101.83.36", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=nxp.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=nxp.com", "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=nxp.com;" ], "Received": [ "from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fj8vN26qBz1y1P\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 05:54:24 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 15E64306CFF8\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 18:51:16 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 0F2C238F24C;\n\tFri, 27 Mar 2026 18:49:01 +0000 (UTC)", "from GVXPR05CU001.outbound.protection.outlook.com\n (mail-swedencentralazon11013036.outbound.protection.outlook.com\n [52.101.83.36])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 1836F38C2D4;\n\tFri, 27 Mar 2026 18:48:59 +0000 (UTC)", "from DU2PR04MB8584.eurprd04.prod.outlook.com (2603:10a6:10:2db::24)\n by MRWPR04MB11287.eurprd04.prod.outlook.com (2603:10a6:501:79::20) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9745.22; Fri, 27 Mar\n 2026 18:48:51 +0000", "from DU2PR04MB8584.eurprd04.prod.outlook.com\n ([fe80::3f9d:4a01:f53c:952d]) by DU2PR04MB8584.eurprd04.prod.outlook.com\n ([fe80::3f9d:4a01:f53c:952d%5]) with mapi id 15.20.9745.019; Fri, 27 Mar 2026\n 18:48:51 +0000" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774637340; cv=fail;\n b=CcqTz5nqJGXhtXpyboN1mhV1AkYvIUwkc4yX6N2nR8cPhmbj8Rm+is7Tf1mSiLa85eEaIQuKJltOQTi+ssxv8Ct+Z1bwsQCtdeaIym7B3pwxdlUyyiQFIs7EvQTJCBIloMNssHVq6Nj8oKkiL6npJa36x3IyJ7+BlnOFwywqCIY=", "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=I8fw/fXalEIXbvmPZOaRdhh3MtMAwPc8OhhrxCpI0zc+b6SSL4HxSJLkyyDjVnv4tq4H/BvohAFsun27udNoJ3T2f5lPMR3mlBIiuKZW2WWy5P03d20irN4TZTA6PvMFlOsRQ5U9Oa+/ZUOen2ubmXbPv3cKth4qFTkKno2p1YSieMUFEDcDd1GeRjcHGPTqFMLdBYLbQFbO4lPdl5PJDtTYmVmiPacXKf79tJJLV7JL+beDahURDx77hEBcqDb2R4xHEIQ7/pInLrBN0fLqGmss6JFuQJxVJrx0VnvuZGotkCfN1QfrPtape57bRLLf6IahzQg+ST/Oaq0z3oUyEQ==" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774637340; c=relaxed/simple;\n\tbh=xSiJoAaiLq/Z7hUV3pXZeuMbfcK7M2P7cNmla1yXVr0=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=NbV7SG57GaonWJLvbK5+pGfzcIV87s/RMBQtf2ohlJNT0/m+PhxBG/LNkIqQDZGX75zyHUXn3ZdmSzlmHqQiCgYA7dNDFy9cBI2yKifd/CiNz06iFISg0Su++8nfGHURPBlGuC+IKEKRjATmtMPyEuqHkyrFJoK8xHkL7q3z5kc=", "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n 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;\n bh=Aqdghs05KEu7V8VABAy5TygYdBGISgaWkwMnIha9YTA=;\n b=ctEUfCZByKFEDwsM8k2nUghU9YX4aH+UPHqV8NxiZpiahWMz5Zy+LxhcqRycm/uQcZRiw8uAVlxgpGgMH7sEcdkvdNYuDN4khcaC7LWVbzk/9Veg4rabnr1SWMovqLFy3eKk3B6OP3mxqDiaDYDZJfc++d4RCkNAADPOcLp+wBdKF49L3cWbwYlI8gsWD/LfomQgh7gP5DWSksUVRyuqoZ0hU/vYbZGxzvJRdAeVbdy5nEv4pCfOQZiCrvp+dXHsQm1QsSFnzHAOFEel6QsoTmbxrEu2kSqL7hkwB6w/+2M1uyHG0oUqS5iwQl89Ee9Sc9yyscV227ktb6QUwzwlKQ==" ], "ARC-Authentication-Results": [ "i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=nxp.com;\n spf=pass smtp.mailfrom=nxp.com;\n dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com\n header.b=cQd5Oy+i; arc=fail smtp.client-ip=52.101.83.36", "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass\n header.d=nxp.com; arc=none" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=Aqdghs05KEu7V8VABAy5TygYdBGISgaWkwMnIha9YTA=;\n b=cQd5Oy+ir5beee96sDYJme4sZTJ5P/3dupDT8FstTV7C7SRJKbEopUpS7a0jCNX5IZ7KmUEcgqDnqKM33JJ2DhjI07eCzHPfMYbIG4pFL7eYKttxUwSlQSn8l7+0y62IF2vVIsItuVRqH7hp1ISe/TKVnaq7seZpkMsXeZ27MQXMdIcqBuwEXOpR75vzt0ya35rrlv+3nMlMKQllGElLd8X/lomW0mUwGIp67H5irPEXSOy6wtu4DCi0JirCyW2jFqHNq5ionwCibmGolqqJ0ZUzacKJdkvFr9Yqn0Q82FIza/TCBs/MaRR01c0Z9v4E4uJPeUDQsHBRw+2Xzhg9pQ==", "From": "Vladimir Oltean <vladimir.oltean@nxp.com>", "To": "linux-phy@lists.infradead.org", "Cc": "Vinod Koul <vkoul@kernel.org>,\n\tNeil Armstrong <neil.armstrong@linaro.org>,\n\tdri-devel@lists.freedesktop.org,\n\tfreedreno@lists.freedesktop.org,\n\tlinux-arm-kernel@lists.infradead.org,\n\tlinux-arm-msm@vger.kernel.org,\n\tlinux-can@vger.kernel.org,\n\tlinux-gpio@vger.kernel.org,\n\tlinux-ide@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-media@vger.kernel.org,\n\tlinux-pci@vger.kernel.org,\n\tlinux-renesas-soc@vger.kernel.org,\n\tlinux-riscv@lists.infradead.org,\n\tlinux-rockchip@lists.infradead.org,\n\tlinux-samsung-soc@vger.kernel.org,\n\tlinux-scsi@vger.kernel.org,\n\tlinux-sunxi@lists.linux.dev,\n\tlinux-tegra@vger.kernel.org,\n\tlinux-usb@vger.kernel.org,\n\tnetdev@vger.kernel.org,\n\tspacemit@lists.linux.dev,\n\tUNGLinuxDriver@microchip.com,\n\tBart Van Assche <bvanassche@acm.org>,\n\tAlim Akhtar <alim.akhtar@samsung.com>,\n\tPeter Griffin <peter.griffin@linaro.org>,\n\t\"James E.J. Bottomley\" <James.Bottomley@HansenPartnership.com>,\n\t\"Martin K. Petersen\" <martin.petersen@oracle.com>,\n\tKrzysztof Kozlowski <krzk@kernel.org>,\n\tChanho Park <chanho61.park@samsung.com>", "Subject": "[PATCH v6 phy-next 09/28] scsi: ufs: exynos: stop poking into struct\n phy guts", "Date": "Fri, 27 Mar 2026 20:46:47 +0200", "Message-ID": "<20260327184706.1600329-10-vladimir.oltean@nxp.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260327184706.1600329-1-vladimir.oltean@nxp.com>", "References": "<20260327184706.1600329-1-vladimir.oltean@nxp.com>", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-ClientProxiedBy": "VI1P195CA0068.EURP195.PROD.OUTLOOK.COM\n (2603:10a6:802:59::21) To DU2PR04MB8584.eurprd04.prod.outlook.com\n (2603:10a6:10:2db::24)", "Precedence": "bulk", "X-Mailing-List": "linux-pci@vger.kernel.org", "List-Id": "<linux-pci.vger.kernel.org>", "List-Subscribe": "<mailto:linux-pci+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-pci+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "DU2PR04MB8584:EE_|MRWPR04MB11287:EE_", "X-MS-Office365-Filtering-Correlation-Id": "cb4442a2-c8fe-4e81-28eb-08de8c317d56", "X-LD-Processed": "686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "\n BCL:0;ARA:13230040|7416014|376014|1800799024|366016|10070799003|19092799006|18002099003|56012099003|22082099003;", "X-Microsoft-Antispam-Message-Info": "\n uowyqYlh3ch3d6m2aBBrxdbS7zRuqzt9uducjkx2DbQ1y20xWuberiA0ZgAC1Jz1/TT6pZQHor+TeeQE4GVYj0Go7e9HhrgLnioDWB2ZfS8EhVllEphk3g0ImSd+bebWCLFRUkF8vy2Lij1t0FsNkhG9qHIH3BbvcbwiKrqXtkyuHxTFJMKLBMb273iUIi9dgGpfG+lgvmsGRbdTnuR6oc05pFy4MEN83HNSahLgrwX4QR5XPMcGSA6utsP9DUuPw8vmm0dun/+fHjmvC/LOHjGM3qVbBocvdF0Dsz/65r+U3f8KbtFjMlimb60elqDJ39Rn88IYmt++V+V+3w0Wu5l3Evjk0MjIDymp8mChO5aD5iXF9jzBGe5nqaVvyvRiUwacQUbQHLZtklXnw2+WrJNvsTOavLBiXtlMR4dskElsde4RwGj8QsLKVrxjwF3VhuG9ROqd8vbfPCdETRnEFKE2AkyWgepvjt7LI4kCa/PotLU5WCtuSkEGi1yAfZYY7sU90/mCo/5JreqLLSQKMBEe3yYGDFnnkIfqWMAm0LZja1t6AvgvfuPQfTXBgfIJOcHyZSKDBlZTgdQ2EV2G39zh7iOSiAExW3FEPSymudJ0rt6Skr0j/Y3k/Nf8JdXDtCiyOpfxoq3PetbohLhjs2mUMLxBFYO5JG6ruPI3P0zA1IUjnU8tJCsmjuL9Nqau8XqqfLmroub8wgXtmaSb6lvoQvFRt/5Dco3ZsPTbr7I=", "X-Forefront-Antispam-Report": "\n CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8584.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016)(10070799003)(19092799006)(18002099003)(56012099003)(22082099003);DIR:OUT;SFP:1101;", "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "2", "X-MS-Exchange-AntiSpam-MessageData-0": "\n erDN0Onkhu2DZzWyMAOMN7kvT1UKqrHJVca26YdV8AH/GUthenaMr3ogyh9Xz3kS2/hGpFynJ6uSQMSeN3pCJCHFc+R8NnpT4h/sgHSz3v2UpdwE+SOh/PLiXyozov/aXbZSNqCjUkP5S5/H0drerTprS9+Paj3iKD5Z57sQ+Yj5fcLnOso1lEfG1cMnviamxIVvxdMcFGDJkwkk6Asxm1BeDRPEjGvMYwKLIvP1cRy6TgUmnHf0gAx/1mPJnUf1RHC8UO5G481FrUhg+VWFLxjBCTxLfg74oWaEQoDIk310B9GYAsksM2mTwMrbHzDAc4gj3IH5Tx5DJwMM1KWEMm7mhoAqJuA1e+/I0/2G3xV8kIVfD+KVifFOj8ZzTS4A88EZAMYpXPPfc4+rQMai6/E3gGQVIG3lZFQ4ywFyQRUN7FaD8eDlJQD1dP00cSwCUIBgNoeAxDaHOXjUOVfGieoyV2lhSne0RVGQqJc1mq5RiXb36VgDPoIF/+bhDWQiRuaDEtA2sZhvw5XJmFoVLHRj1ZKxfS8JhJdQ0tGGb71Fb/mbhVK4rbt8TUgPvsKpe1iww80p44PUfos4ywSq9EtzNUjN6iJAVg5CXXJMw8oWpZT6b87m0+s8UqgDFw6MvzQNzwUh39Y9yU9ibO3dLsExWm8qEkkdtjD6f0mkf46sN7JC07eXfRDOylgFi3jmTK99AjS284E1hTjFq+PzIQnpyIxZHvH+aHQ3WIYMcZP4haxmT0Oi3aDEJMspFLRS1Ox14FiDLdk2IBkBSHrsB6wkAlCP30svIB8enJbpAMcHMIW09XzsqEhUG7w97HcCw2djlT5nQd1fPPpJoXhpM8R6jhm8y+8ULEwonSMutNeBZG0C/50yjt7N82udSAvTuWi000vabcZNZpjpDPXCVjWXbziLUeQTAJegE8+C4qxMz6QV/kVX2OcCibkb6VXDQpjwxT5cWptV7iJpfzZBLCFrnq7a3HfWoFpHMptmEeK3zAYXL6q3oR6rTG7QxyoSmBS4u04jUhEqzLA/h/8LF7Ux3HE5A8TmG7obCADMvDzNqtJkAGrksWh0Ho4ibm58b4atA6BQGxsiCKnK3HtvY2YwrNzg7pHOJgOyOW+8fXloMctXar7T8Dc7AeQXbL0uB6gZp6S0GMABwwwCyiGuVGXHwOmB5WfNK/KphpNzYi23NADwxUvaNUR0o+oBichrbnj9XSW9CaBppyOpQHCShiCM+5juQz3Sg6j2sr5J5ZNHlcA7e695hD7K6Fb7H4Tl7pp718Qw0vyliKROCitX2o1VETOwY42iG70QSCE57wI3hEh3DWkxBeCRE4qUwURZ1hCv6LpPMgYYhSAtLBDJV4Z4/2tVsRRE16h6nmdTJRFTn96h2HkfI+vJQHlqpB8iKt4IrbiSezytXnpL7HyZEwoyC/GtKMubi4LZ7CPYklDMqhQ+whi69DclMEmshvqLae1ZUvZPB6WAodYAE0+HIEN26uO+CjEoXlYm9OoUOdpfiLqrq/456Dr+6kwsVEMn1VhTzyaPxwFc81l3GSvggcf8U7D3r2lr0lSUJMSREw0QsgzRvRV4rYxAsYLPaR2Is6d9qtLZsC7lhw1zRvR8OF+4ElJajS+OrfN8OgIMattzo0bwPKkISVYjBK0sZ7XU6KEGPsrfd1/HwEUUzr5qJCol12y0MpMBWC/cpSGCQIXQmxfxaTFx0vJ/SDWqcKU0a/fFxFo7XRa5QGvom1To3Xyx/cZV2yYV3yRipnc6D67mGy3oRJC75w9b47Fg/e1RhtF7pNNk", "X-MS-Exchange-AntiSpam-MessageData-1": "9F5Efq5uQB2m4sknm/J2y4a1KVE0rKKUaAg=", "X-OriginatorOrg": "nxp.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n cb4442a2-c8fe-4e81-28eb-08de8c317d56", "X-MS-Exchange-CrossTenant-AuthSource": "DU2PR04MB8584.eurprd04.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "27 Mar 2026 18:48:51.8305\n (UTC)", "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted", "X-MS-Exchange-CrossTenant-Id": "686ea1d3-bc2b-4c6f-a92c-d99c5c301635", "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED", "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n tIZPwWsiHd2d77fZVE3INE99HhNDu6p8F0kq/ttBNalBEOly/YNJCvHX0fGZq0MsqOhyldSkhRiZTVjE7PxKpQ==", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "MRWPR04MB11287" }, "content": "The Exynos host controller driver is clearly a PHY consumer (gets the\nufs->phy using devm_phy_get()), but pokes into the guts of struct phy\nto get the generic_phy->power_count.\n\nThe UFS core (specifically ufshcd_link_startup()) may call the variant\noperation exynos_ufs_pre_link() -> exynos_ufs_phy_init() multiple times\nif the link startup fails and needs to be retried.\n\nHowever ufs-exynos shouldn't be doing what it's doing, i.e. looking at\nthe generic_phy->power_count, because in the general sense of the API, a\nsingle Generic PHY may have multiple consumers. If ufs-exynos looks at\ngeneric_phy->power_count, there's no guarantee that this ufs-exynos\ninstance is the one who previously bumped that power count. So it may be\npowering down the PHY on behalf of another consumer.\n\nThe correct way in which this should be handled is ufs-exynos should\n*remember* whether it has initialized and powered up the PHY before, and\npower it down during link retries. Not rely on the power_count (which,\nbtw, on the writer side is modified under &phy->mutex, but on the reader\nside is accessed unlocked). This is a discouraged pattern even if here\nit doesn't cause functional problems.\n\nSigned-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>\nReviewed-by: Bart Van Assche <bvanassche@acm.org>\nAcked-by: Alim Akhtar <alim.akhtar@samsung.com>\nTested-by: Alim Akhtar <alim.akhtar@samsung.com>\n---\nCc: Alim Akhtar <alim.akhtar@samsung.com>\nCc: Peter Griffin <peter.griffin@linaro.org>\nCc: \"James E.J. Bottomley\" <James.Bottomley@HansenPartnership.com>\nCc: \"Martin K. Petersen\" <martin.petersen@oracle.com>\nCc: Krzysztof Kozlowski <krzk@kernel.org>\nCc: Chanho Park <chanho61.park@samsung.com>\n\nv5->v6: collect tags from Alim Akhtar\nv4->v5: collect tag, add \"scsi: \" prefix to commit title\nv3->v4: none\nv2->v3:\n- add Cc Chanho Park, author of commit 3d73b200f989 (\"scsi: ufs:\n ufs-exynos: Change ufs phy control sequence\")\nv1->v2:\n- add better ufs->phy_powered_on handling in exynos_ufs_exit(),\n exynos_ufs_suspend() and exynos_ufs_resume() which ensures we won't\n enter a phy->power_count underrun condition\n---\n drivers/ufs/host/ufs-exynos.c | 24 ++++++++++++++++++++----\n drivers/ufs/host/ufs-exynos.h | 1 +\n 2 files changed, 21 insertions(+), 4 deletions(-)", "diff": "diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c\nindex 76fee3a79c77..274e53833571 100644\n--- a/drivers/ufs/host/ufs-exynos.c\n+++ b/drivers/ufs/host/ufs-exynos.c\n@@ -963,9 +963,10 @@ static int exynos_ufs_phy_init(struct exynos_ufs *ufs)\n \n \tphy_set_bus_width(generic_phy, ufs->avail_ln_rx);\n \n-\tif (generic_phy->power_count) {\n+\tif (ufs->phy_powered_on) {\n \t\tphy_power_off(generic_phy);\n \t\tphy_exit(generic_phy);\n+\t\tufs->phy_powered_on = false;\n \t}\n \n \tret = phy_init(generic_phy);\n@@ -979,6 +980,8 @@ static int exynos_ufs_phy_init(struct exynos_ufs *ufs)\n \tif (ret)\n \t\tgoto out_exit_phy;\n \n+\tufs->phy_powered_on = true;\n+\n \treturn 0;\n \n out_exit_phy:\n@@ -1527,6 +1530,9 @@ static void exynos_ufs_exit(struct ufs_hba *hba)\n {\n \tstruct exynos_ufs *ufs = ufshcd_get_variant(hba);\n \n+\tif (!ufs->phy_powered_on)\n+\t\treturn;\n+\n \tphy_power_off(ufs->phy);\n \tphy_exit(ufs->phy);\n }\n@@ -1728,8 +1734,10 @@ static int exynos_ufs_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,\n \tif (ufs->drv_data->suspend)\n \t\tufs->drv_data->suspend(ufs);\n \n-\tif (!ufshcd_is_link_active(hba))\n+\tif (!ufshcd_is_link_active(hba) && ufs->phy_powered_on) {\n \t\tphy_power_off(ufs->phy);\n+\t\tufs->phy_powered_on = false;\n+\t}\n \n \treturn 0;\n }\n@@ -1737,9 +1745,17 @@ static int exynos_ufs_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,\n static int exynos_ufs_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)\n {\n \tstruct exynos_ufs *ufs = ufshcd_get_variant(hba);\n+\tint err;\n \n-\tif (!ufshcd_is_link_active(hba))\n-\t\tphy_power_on(ufs->phy);\n+\tif (!ufshcd_is_link_active(hba) && !ufs->phy_powered_on) {\n+\t\terr = phy_power_on(ufs->phy);\n+\t\tif (err) {\n+\t\t\tdev_err(hba->dev, \"Failed to power on PHY: %pe\\n\",\n+\t\t\t\tERR_PTR(err));\n+\t\t} else {\n+\t\t\tufs->phy_powered_on = true;\n+\t\t}\n+\t}\n \n \texynos_ufs_config_smu(ufs);\n \texynos_ufs_fmp_resume(hba);\ndiff --git a/drivers/ufs/host/ufs-exynos.h b/drivers/ufs/host/ufs-exynos.h\nindex abe7e472759e..683b9150e2ba 100644\n--- a/drivers/ufs/host/ufs-exynos.h\n+++ b/drivers/ufs/host/ufs-exynos.h\n@@ -227,6 +227,7 @@ struct exynos_ufs {\n \tint avail_ln_rx;\n \tint avail_ln_tx;\n \tint rx_sel_idx;\n+\tbool phy_powered_on;\n \tstruct ufs_pa_layer_attr dev_req_params;\n \tstruct ufs_phy_time_cfg t_cfg;\n \tktime_t entry_hibern8_t;\n", "prefixes": [ "v6", "phy-next", "09/28" ] }