From patchwork Mon Nov 13 13:11:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xiaolei wang X-Patchwork-Id: 164477 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1190641vqg; Mon, 13 Nov 2023 05:12:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2RowlSv6OmWax5edH6CwGWNyvU1MMNU2B58U84ss3i4BCeVL7FiPYq1oeXuL+3kGbCMY1 X-Received: by 2002:a17:903:2a8f:b0:1cc:40a4:9179 with SMTP id lv15-20020a1709032a8f00b001cc40a49179mr5460187plb.34.1699881146438; Mon, 13 Nov 2023 05:12:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699881146; cv=pass; d=google.com; s=arc-20160816; b=QhQoGfdVnHJMc2Kwi4VkO05arK8e2+ZNqMajyebCPJ589ktz25bCKq5ZLvEOpmS40Z QKB1vfq62ddIC7I660+b7J+n70gylKbMBfZqm0YMwkc8L33Yv6NrJjqyNrd/ZU3vl00W W1YHMhAN/ueqey6Iy0LZmWKGBedBnji3i7dSCX1W+WSlQmtasRUwrh1hsiLiq0E0boXF foWhWvlhueqLa2ysgKt5gHKZM007ayWl49RkvwzPT4mnnPjOyhV8X/PnlZCCrYiWT1V7 yiLqcuemhn17n9zZWpWnhwmvMWk/ISZvz9AQDYRbU25Uy31EEW0ibO9/ejxfU8kTuBjH 4D1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=eWXSEfEfus3YKhK1x2xdYhleqWxN6MtTE1dPm1YvChE=; fh=r2ozbC7zWHWKzErpY3ns9AD7oM7lZ5HPDrl3Ma5DKEs=; b=jMCdWJ9uqswlQUKCe59a2d2TtunoLd8ifmvrMkMRf4/kRGdN/fpN9efrd2Li1KU+Vu M/KNRdrfssQya5oraPNE47P0cyyzfpj/2hDau6NoUi6chF1RJyHI9XBkFj5CZopsZne2 94x3jQSATKZC08XGt5WaAWeOhRnJYIccD9nEhOCKdTjnbpg/24fwT5kUqI8lu6fQiq3x tUvUQw99aG/VQ14/YNpoZuqra4O+pFwS5grz1qoNE9fy+sHhHtEN+mvXsfjOVbDg45Ar J5iz8Z65pml6VFet+A4Xt4OSAFfkVWKm8dY/CxnJki+FNcJprN0Ya2DRFDPCstyJlfst zGxA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=RtAwPCDU; arc=pass (i=1 spf=pass spfdomain=windriver.com dkim=pass dkdomain=windriver.com dmarc=pass fromdomain=windriver.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=windriver.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id c17-20020a170902d49100b001c88fc3c5a1si5947124plg.461.2023.11.13.05.12.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 05:12:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=RtAwPCDU; arc=pass (i=1 spf=pass spfdomain=windriver.com dkim=pass dkdomain=windriver.com dmarc=pass fromdomain=windriver.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=windriver.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BD8B08080D7F; Mon, 13 Nov 2023 05:12:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230077AbjKMNLv (ORCPT + 29 others); Mon, 13 Nov 2023 08:11:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbjKMNLs (ORCPT ); Mon, 13 Nov 2023 08:11:48 -0500 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25356D7E; Mon, 13 Nov 2023 05:11:45 -0800 (PST) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ADCCLAg023674; Mon, 13 Nov 2023 05:11:26 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from:to:cc:subject:date:message-id:content-transfer-encoding :content-type:mime-version; s=PPS06212021; bh=eWXSEfEfus3YKhK1x2 xdYhleqWxN6MtTE1dPm1YvChE=; b=RtAwPCDUST9vjRfq1A7vzQvy8+GTBm9CS1 6lTHONDhHXS4PqdZbkmU73lyqJ0S2VS0u9Ft/gSIe1fbhYSxkPjlD5RxXCIuSVhX A9jT0RcJJ11x9EllXNKOAWBlvOTeJGlIrEYYIDUvNlV9+sr9sTZn7Nui+/F6lRwB wXz1Setk7e7ft3jE2Fet9sPqzg1Dv7h6mAM1TCnj0EeCF5quLt/80LOInt7iQjS0 QylseFQ1qepv0o8vwHhCf9xIL1XJBNM0sfBRnaBK7MBdaRHG0KtuKlY7zM2MSl4K S74FaAri+z2Sk/5KVN+F8uJEZYOFci4hJI6Ui7LKE93QsNWNMGXg== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2168.outbound.protection.outlook.com [104.47.73.168]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3ua5s4se6j-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Nov 2023 05:11:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VVeZym3WcQUA7HpsQAYiy4eRMLz1geF/HxJkoIuXAOhoX+w3CLzN2mOOgRyJkzm8J5vvwqz1V/7hT5AQjXVZ81pxUDAr8PgFwI+qMHkh4qwfDGodLE9ntb/roDGzuqLM6vQe40hOncOD4Tnk/j5tvvTupSr/0lq6KKQ/+AbrqE4g3Tw6MZUTwIwfAisppwWTg3zCpdG4V4IDfHVnxFCnfjoqt2kmoa1u+iIpFLErKBI7AhZeqZPzO5DEzsDOUGvN1grp3DByJyMhWRWMyN8J9AFh0b0E7LGkEPYIf8vm3fRRnbPsjIoUzu9ltm0islyV3rYxbBVRVW9UpctWec7yPw== 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=eWXSEfEfus3YKhK1x2xdYhleqWxN6MtTE1dPm1YvChE=; b=hsQ7+xPu8O5Jg7x2owcy8JBpDovxZMp2GuRQdoxRwBdbdofnddN++lHKM+uji8v0pVO1APoKQEz21q8g/Px59f+1qZQ9lhFzpqDHHhue3kr9B2ee9URkkYoewpmTomAI9yHrzMfPx2SCdsvrqNDYlBu2YGz/vwKOE7OMpd153f4GtxSGw0JdFVRGmiMnrr7HpSYq3wX5txYbO95yrgEU4IXza/rBC0U9ZBFSXqee6DjpRAxzaM3ZPkS4oh9As/6hsCTuewSAW9E34wnA+QfSeY1d02Dwf7RQ1oTMLmpxLucn6qkUT5qBUqiZS1l1xa02S5jTwIa5C85mP+dRagK7Zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from MW5PR11MB5764.namprd11.prod.outlook.com (2603:10b6:303:197::8) by PH7PR11MB6772.namprd11.prod.outlook.com (2603:10b6:510:1b6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.29; Mon, 13 Nov 2023 13:11:19 +0000 Received: from MW5PR11MB5764.namprd11.prod.outlook.com ([fe80::7d7c:4379:e96:3537]) by MW5PR11MB5764.namprd11.prod.outlook.com ([fe80::7d7c:4379:e96:3537%7]) with mapi id 15.20.6977.029; Mon, 13 Nov 2023 13:11:19 +0000 From: Xiaolei Wang To: Frank.Li@nxp.com, vkoul@kernel.org Cc: imx@lists.linux.dev, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] dmaengine: fsl-edma: Do not suspend and resume the masked dma channel when the system is sleeping Date: Mon, 13 Nov 2023 21:11:04 +0800 Message-Id: <20231113131105.1361293-1-xiaolei.wang@windriver.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SG2PR02CA0007.apcprd02.prod.outlook.com (2603:1096:3:17::19) To MW5PR11MB5764.namprd11.prod.outlook.com (2603:10b6:303:197::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW5PR11MB5764:EE_|PH7PR11MB6772:EE_ X-MS-Office365-Filtering-Correlation-Id: ddb9843c-fe4c-4c28-fb2f-08dbe44a06b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: las7F+cFOt9S41hAr99Td9ULQoSMukm2Ot7t2lC58XedlJPd8UNt+MM4IG7KdF9tHyFLu14vtu8f6tfpWOZjVN/fx4KZcHoxS+bguFtjZCpkokgk395hC/RCqfzMIhjsQHFty1ODoHjd+E67tq4GHyY570k8jUSj/T70rK1VOGKEmPJWnTRsx4TTsrNIJIy2YRdzQzRWGBrIWB3EumF7q60ux+4HNmk+rmMXKA8zlAdOTrcvjis0h01hxAjOKV2Tsy5ZTUSVH71cjmx7i8t05aEQVwqSkERePmPR6N2P0LrZefHJv2OvjVxmC8uPVg+OXz395sdIS/IHFwAFS1VNpDaVygRHc9u7cArH1BJlBOnGwCf/upsPpr25VV/R7xW5uUHTZ62RMvvOh6kEgd9W39leq3XUU/dIcDVDxX5Ykn2QLc79W5uNV4dY07Y9I3TyFK2S+PHHvCeWzTORET9FaWr6RMmh7kV5XztTPWDLxBrt1dxFyWE4bnIfO9novZOyPQ9d94GIFFUkj0JGxPLKGnv31XSXQSyGrI8zWNPjwaab5jeDSWfRxecaI1CtZH318EaKb58e0lBQc+df7zr9fYjTQKied/osyZc8oKwuyJ28Lr6foMBdBfD3yyIeLASA X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW5PR11MB5764.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(366004)(376002)(39850400004)(136003)(396003)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(15650500001)(5660300002)(86362001)(6486002)(478600001)(2906002)(45080400002)(6666004)(8676002)(8936002)(4326008)(44832011)(66946007)(316002)(66476007)(66556008)(26005)(1076003)(36756003)(83380400001)(41300700001)(6512007)(6506007)(38100700002)(52116002)(2616005)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZV34CJWj8FL8Fv1qSFRG5crmfL8+4JExaYwhR+/3ThGRSPzOoOkEUpYDLDTIcuLiLxt7Fma41EYjXECJayznj8VAeTNOGEgE3S5wFlTP5xd2gyhJ5t117+S8Vrjoxi5n7fG1Z+tdZdivap0fLBnQlQftzxh+geXlvsUI0HturcqYhIwk2IzsnjWLDs2HRkuycSzcovubVO3zW0ekI6LC7P4JMKkXWig2PVyC8Nw2672lPDhpjFMX6LDf9MX/wj+ULS9pDVpekypuvqTNhh/UTJSXbm9UmK1mjQU32XOTCSGotgOvFyQGkNpUJ6zAIhFHI9hK/mD4Jr6dve0rQXFG7pNlJCGlK7ysZII7XoFy7qVuefahXpZ9Vo3moLDDbYzXrsh2qjFCYsSTNHMmzcfvQ7z0WChX9zZeie50mGPWeP1Jc+WPH8AOkJkFQMaUtwAgDdCx1QRh5wGoNr+Tx4ES3n1dN/5Nq/UC9VgBYzA0+aqRtE6DeESecXL6v6S/uvdY28gDri0HYfkaOic5Nrv+HCoiMYL/T7/mPWePFRMN6HhpKUZQdOurwkrl3+o6qHivE1PWNTibp5w7DoNAWxMZSWps46P5QOVY5eiiDdaGs+ryco/XPRdoIycA5acQDiH+UOPBOBgqPYPV/MHc8cDRlzmfeAJr1acHEY6LqR0KoMpASfMTrQrbBmRaZ/69Nh+Pfmh8+jhlu4ii7yJ7hmYVcw0e0h9l1EbcB4uLlKkw/BFcqir0hCnRzLMn/q9ggTL8GuXHvbGGbyYTVUNshVw55VilXWKxFUIz5NNj5kgYkaEqR4UpfQxgWswHLCff5vgt4ShnZbeW6yuKTkJXjvWaEzgW/8dSi9+b8o3h/qtWVt3qiJkV/dEn/knnxw2nBkFxRude1eVn/VpBqvoCq0h6sOvV1ySiu9gJqBct8PFty2sYJQ4mJCAGJByxWcjL28xNQxIN82b5PtgFfKX/gYj2Ps1S9lnOXQo4eXlm0AlfjHHK1hmZMgPkJpEdkgnRI4HHirl7eyQOFBvrlBSNd5xw16WSS1o0+OAWt0HkdbAulBAbUv3UihvoBkPEY0R2h5YuFc8eO1PUNNtxNtzea7Qig9oBNyr32+XGDa0DCvO2MuERrYrOWJs14pCwSAfUQicIBy/yNzypdZFeu08XzlOlQtz7eLrIo3KJBiepuRZ6FGqyoy3jnxcv/JZ515lgVupZabhayA5kPPuRqcMaLshzRneWWHBijPUjB/gYP77CNrTdFShMpn0THw3qQAQvyQ/ZcD5bQ4LHOsBuUbcgX1OWflfpKdxhi5L7SbPhJDKzNgAXnRKd3QOTlWu2ZI3OkO1yKxZCBy+ITuBFsASRGVb+4MzQ/jqbseUHiZjcO92FgQ5HimDIaxHHhETNwqxCtvhZnaypTeMsp872daYGbEkwqGRCdMoN1RMnB8/w5v0YROXqSBDicdsno0AEW7BjD56vcDBVuHN/rbC24t17/FJhrqTUBXFdJpxyTzuS6F8SEUBHc2hSaH5HjEOBEgt7dYiwo0Nf1+nSf9nmTMqyrs2lTs7RiMpNdDa8JHKsyoWLP4a+vfrYyHSuS60lz/IUhMz5ITrGKXtWTOhZkDCBtx1uHw== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: ddb9843c-fe4c-4c28-fb2f-08dbe44a06b1 X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5764.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2023 13:11:19.5696 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +mW3UW1oUTHHcjJxax7UPaBnDnl5qGhcCX9y1VutOFzGiCHlIM2E+JJFk7EwJZ4CNL/sWHRpaS4UjTuZ9GOM9JiAaeRocnHESYW4s0f+no8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6772 X-Proofpoint-GUID: b3f1PH4D9TuUHKcSItKALT-DCaWiw4AP X-Proofpoint-ORIG-GUID: b3f1PH4D9TuUHKcSItKALT-DCaWiw4AP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-13_03,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=331 clxscore=1015 priorityscore=1501 lowpriorityscore=0 mlxscore=0 spamscore=0 suspectscore=0 bulkscore=0 impostorscore=0 adultscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311060001 definitions=main-2311130108 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 13 Nov 2023 05:12:23 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782454573143627415 X-GMAIL-MSGID: 1782454573143627415 Some channels may be masked. When the system is suspended, if these masked channels are not filtered out, this will lead to null pointer operations and system crash: Unable to handle kernel NULL pointer dereference at virtual address Mem abort info: ESR = 0x0000000096000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 CM = 0, WnR = 0, TnD = 0, TagAccess = 0 GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=0000000894300000 [00000000000002a0] pgd=0000000000000000, p4d=0000000000000000 Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 989 Comm: sh Tainted: G B 6.6.0-16203-g557fb7a3ec4c-dirty #70 Hardware name: Freescale i.MX8QM MEK (DT) pstate: 400000c5 (nZcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc: fsl_edma_disable_request+0x3c/0x78 lr: fsl_edma_disable_request+0x3c/0x78 sp:ffff800089ae7690 x29: ffff800089ae7690 x28: ffff000807ab5440 x27: ffff000807ab5830 x26: 0000000000000008 x25: 0000000000000278 x24: 0000000000000001 23: ffff000807ab4328 x22: 0000000000000000 x21: 0000000000000009 x20: ffff800082616940 x19: 0000000000000000 x18: 0000000000000000 x17: 3d3d3d3d3d3d3d3d x16: 3d3d3d3d3d3d3d3d x15: 3d3d3d3d3d3d3d3d x14: 3d3d3d3d3d3d3d3d x13: 3d3d3d3d3d3d3d3d x12: 1ffff00010d45724 x11: ffff700010d45724 x10: dfff800000000000 x9: dfff800000000000 x8: 00008fffef2ba8dc x7: 0000000000000001 x6: ffff800086a2b927 x5: ffff800086a2b920 x4: ffff700010d45725 x3: ffff8000800d5bbc x2 : 0000000000000000 x1 : ffff000800c1d880 x0 : 0000000000000001 Call trace: fsl_edma_disable_request+0x3c/0x78 fsl_edma_suspend_late+0x128/0x12c dpm_run_callback+0xd4/0x304 __device_suspend_late+0xd0/0x240 dpm_suspend_late+0x174/0x59c suspend_devices_and_enter+0x194/0xd00 pm_suspend+0x3c4/0x910 Fixes: 82d149b86d31 ("dmaengine: fsl-edma: add PM suspend/resume support") Signed-off-by: Xiaolei Wang --- drivers/dma/fsl-edma-main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 4635e16d7705..52577fffc62b 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -631,6 +631,8 @@ static int fsl_edma_suspend_late(struct device *dev) for (i = 0; i < fsl_edma->n_chans; i++) { fsl_chan = &fsl_edma->chans[i]; + if (fsl_edma->chan_masked & BIT(i)) + continue; spin_lock_irqsave(&fsl_chan->vchan.lock, flags); /* Make sure chan is idle or will force disable. */ if (unlikely(!fsl_chan->idle)) { @@ -655,6 +657,8 @@ static int fsl_edma_resume_early(struct device *dev) for (i = 0; i < fsl_edma->n_chans; i++) { fsl_chan = &fsl_edma->chans[i]; + if (fsl_edma->chan_masked & BIT(i)) + continue; fsl_chan->pm_state = RUNNING; edma_write_tcdreg(fsl_chan, 0, csr); if (fsl_chan->slave_id != 0) From patchwork Mon Nov 13 13:11:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xiaolei wang X-Patchwork-Id: 164475 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1190478vqg; Mon, 13 Nov 2023 05:12:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCayfnMMjbb2+nj4/PCJgx64M4R/mJH+HYFoMkYVwfzDg8LHzZaeCd41dPhnrkdFAydqeP X-Received: by 2002:a17:90b:38c2:b0:280:22e2:60ea with SMTP id nn2-20020a17090b38c200b0028022e260eamr4286645pjb.3.1699881128745; Mon, 13 Nov 2023 05:12:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699881128; cv=pass; d=google.com; s=arc-20160816; b=H8FwgKZVayyRJX+GcI9sqWwwvrUDeNXvFDmADmJlDg+Ni7iYvkV/l+zEj5oJx/a/kl 9wsBTAACAkKN502atcK2UPyvJ70/hjWg2m8ZrLz8s4J8Sf4jgc8E4596rtGEsCivDwRq J4usyQU1RVlOVRyaq77LHoQqw86FYpiQcW+KwZqa2jX6NtfH56IdQOTKGxVpPeZ8jGUP owDah3vz1uvbiHerlk06Y3V1CCJx00GBIx1aVItFw/SnWN/m0b+uebhjcB3biURL+4f5 9QnoQw+ejgpca3omW6y52LsJPaDJi9f/XZTBpmKHIMQMj9kkl32jem3hbQ7GdS4E1V92 JKZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=olQ92dcB6vP/6vAQYokPPi+X91EBt6OBucsVRmpfMcQ=; fh=r2ozbC7zWHWKzErpY3ns9AD7oM7lZ5HPDrl3Ma5DKEs=; b=HcLBK6FDvx1leYx7LS9WUbMep63ZixJrtfFl8g3mItNgL363f6P/5xCi+TlQ5pIi+/ ag/A1vZlG2ZaWnbIYntZS/NAlD1fOqkgFY5iTb9t5BEDZqfpJXyTvjdUQBYeOiGS1JrN QVu09ktPgqCGpH/M7bUUyQzvTJxvhkMhZWReqqS/X3pQPrcbHSQ/7KLJl3wDjgcqvoec fuhdf6BWIVui0nAvthL5jMIiHMBYp6CWX5pYCp3WybJ3/nG5QGATQsFpxkxc835k6Kx8 RYFoJUcoo6JilJPqigXPXSIl9QeLHupv8rteVrNKP/BWCBzFLkrtOebhjIRyyKHdPGUQ aSTQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=Q1azMx8J; arc=pass (i=1 spf=pass spfdomain=windriver.com dkim=pass dkdomain=windriver.com dmarc=pass fromdomain=windriver.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=windriver.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id kb4-20020a17090ae7c400b002800b7caf7dsi6318554pjb.168.2023.11.13.05.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 05:12:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=Q1azMx8J; arc=pass (i=1 spf=pass spfdomain=windriver.com dkim=pass dkdomain=windriver.com dmarc=pass fromdomain=windriver.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=windriver.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DB944807F675; Mon, 13 Nov 2023 05:12:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbjKMNLt (ORCPT + 29 others); Mon, 13 Nov 2023 08:11:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbjKMNLs (ORCPT ); Mon, 13 Nov 2023 08:11:48 -0500 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 251B7D6C; Mon, 13 Nov 2023 05:11:45 -0800 (PST) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ADCCLAf023674; Mon, 13 Nov 2023 05:11:26 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= PPS06212021; bh=olQ92dcB6vP/6vAQYokPPi+X91EBt6OBucsVRmpfMcQ=; b= Q1azMx8J8RofgP3eGJRpJ8mjXqTBWhSKOlKAezEEFA6EJzPWwTLVf9EFtn5Y41Fl fMyMw45X3JGo/OZkBCjJK2R4Fe3/1e/jLBxrUswxAJgYhbJNeUhhUdx1YkZCmP/K 9NGl8FmXxeTKQxkD6W6kZlG1m2Yfa/IK32LPgDDfPbK3BLxhk2ko72wkuWy+UfHw 6slujhkICptEyM3HG7hysh2fbRid6ZQv0IVT/uAxMcEPioHHxRf2KhY8E6zEgC0r VgxTsWrW7O4U2OZMJzZ8JtFd32MEcXyQiieDmvPS0GHxdYWpXTXMT8jmfeFS5jyg IyfCYjy5Qr84kudZpD593A== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2168.outbound.protection.outlook.com [104.47.73.168]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3ua5s4se6j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Nov 2023 05:11:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=STo7Sghu9QpOsAu3FjU3psWdHZtHtgtPpTduLpbM95uAXmYtrWpjoB61wU/XdqUTZqGmVhbei4lvABG2F9zWRj3sCWYkm2z/Sg8KaLx3/3tyitwdkvvx6su17vRbVcPcNHs5Z1vTvixkUtZz3eHHZVHuAIoDm0X8vNsLJIxEbKeBOBG7v3YlGX19LKd4BmehHUGxr7vpG50PnRPnARSdBLEfR8tzU55im/H7M19gzymrhgXVjw1jgd3mF49quWbd58sfV4jy1+vEavSDOimG7X1nI5yLqcJ9i2KX6+I//Apv/biNPnjhTelzOUCl32xPh0SQEE4OmMgEQO7Gg7ZSaw== 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=olQ92dcB6vP/6vAQYokPPi+X91EBt6OBucsVRmpfMcQ=; b=BWwu2QldYcnB3ZhsQvH4n9V75kqNcvjICSxgyHiqzO9uMYxEQe3Qi9GmsxGzA3p+xFVslh/oOYxH+yzyh5yCdjAHEvUeuVbqdKkPYlgfJZcDVxwreCOxLaG40ylA6yXf7Ug6n971YoKxcdBdTDJEOWfMM2zYHvMp3rpbCVPz4n2xlPmMzLfRu/O6TezPQoHwdLYONWAS+Ba2ke6clThXFo2WhPyr9jiNyLGocqbX1KzYUw+XY5TBlMG1E0T5ucFCVlheyTuq+nnaRDJ51u7Pdr76L2qSd+q4sZ65mpAb0Qf8X9T6pKIn1eXXEsYZP2I1pXGFb4h8+1vVzZOupPLvYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from MW5PR11MB5764.namprd11.prod.outlook.com (2603:10b6:303:197::8) by PH7PR11MB6772.namprd11.prod.outlook.com (2603:10b6:510:1b6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.29; Mon, 13 Nov 2023 13:11:21 +0000 Received: from MW5PR11MB5764.namprd11.prod.outlook.com ([fe80::7d7c:4379:e96:3537]) by MW5PR11MB5764.namprd11.prod.outlook.com ([fe80::7d7c:4379:e96:3537%7]) with mapi id 15.20.6977.029; Mon, 13 Nov 2023 13:11:21 +0000 From: Xiaolei Wang To: Frank.Li@nxp.com, vkoul@kernel.org Cc: imx@lists.linux.dev, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] dmaengine: fsl-edma: Add judgment on enabling round robin arbitration Date: Mon, 13 Nov 2023 21:11:05 +0800 Message-Id: <20231113131105.1361293-2-xiaolei.wang@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231113131105.1361293-1-xiaolei.wang@windriver.com> References: <20231113131105.1361293-1-xiaolei.wang@windriver.com> X-ClientProxiedBy: SG2PR02CA0007.apcprd02.prod.outlook.com (2603:1096:3:17::19) To MW5PR11MB5764.namprd11.prod.outlook.com (2603:10b6:303:197::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW5PR11MB5764:EE_|PH7PR11MB6772:EE_ X-MS-Office365-Filtering-Correlation-Id: fad7cfcd-87a3-444c-da33-08dbe44a07f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mldjm0/+nTiqOBTJZp6qClQYRBIq18k3cZw3LyENq5KvNcaKRejY8M3cYLHtP9HQ2xmMOS49HG7m3VxDEY6QBec8W5KusFPXPSvEGAYlvYf5GPKzuQ9vOzNJWC8wdX0B9ZyyomSLni8DNO3fq4qAac89LCtjRu1C/boQPWnD7E2GMnMxQ7Ect+ThvVQsAAw76X7LlgOoVL3CW82xjwVNbftAvJ0QE097263wUpEHO0HcjyzlbJZSeas9FuKJnvyfgdv4ePwMLSkQaMHrMMb2GUlTE9Jmr8nzXLpFUXcUpPYeU+5mbOnM3AbAc1fmtG9DcHmeaMow2xfLZNkmE1MLAKohcjRhgLAG4Eurus4H82lK/uiubrPkox0Dd0rWLy0iTHQQFi7bzYtjahECEGiEItBk3vkl1Mpl9otf913WgdJ/bDwEbVMGUYOejmGehib0ep19JzhawO4PyUsl5BqKrt/JL5neAzVZIzvxRYsAOYYeqNtHrlupOGoZTHKXOBUFW34En2tcZZQqBn75dOrl7emREzv1bEmpE3NCS113MEOHzcoGYxIIcbeY02ZBkkYjykMQpjXome5dDAIMDHDvy8bQ1JIq6NEtKw6j0OWxlS7twOvV54w7G1WhumVO+SHB X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW5PR11MB5764.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(366004)(376002)(39850400004)(136003)(396003)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(5660300002)(86362001)(6486002)(478600001)(2906002)(6666004)(8676002)(8936002)(4326008)(44832011)(66946007)(316002)(66476007)(66556008)(26005)(1076003)(36756003)(83380400001)(41300700001)(6512007)(6506007)(38100700002)(52116002)(2616005)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J9p0zMXdxqaZo/rKzQ2BOEdJ0fS7APm/TgKr09tRwZZydbbWpdEpu6MD14zFdwBtbt+nBbJavLcsfn5ssVjX7j/WcR8d4e5TFPz2VKhjB3SGvFB6REVKDvtRN1u5mTbJS6/qe77nBriS3d7V2wpretFmVvCanU20ysBk1W/ejd88+m7UPsy0AIYhvrjysW/P1oWREJee5m9cf4WGPlIFYOnpJZkXQlYz/6HjYaeRlWJ4hb4Y4NhHXoaiKVJYGmB+i6IQEkYrIQPt1F37bmylWopcCKfJyRFCnV09YbYl+o3t7IMGwrb1HdHSJZ9hr0yyDPMOhkKewcIFrKkqO07FDY4ujdY5iup5NBKZ/pvm7xq28DHV1f9p32LJfrdzUUnjIZmAB09NJRe9L+HtqGz8SssTHHdP8LnHoXkv5RrUUipT5tsQVaRjsz+Ho0hixXexHoBMjmAwKIvWfaqb/sQ8rnKZ6ExZNGhkv/ddGdWJ09tqUyW2t85+lBci7MihQGdE4WBLFhQh062alFDKwZacxT0jrNbajAAb2QD+RXXOJEUl7WLUaxyMGSnP+4MG1IMsAWczSQr5ISJfzNMztK/vIljZFDy1a4ndFrAlOr5UNO7oWchbzSnDt88o1idVCaPcEr6mrT67bL2NCtr19Zn31+35d1wxkwF4JVCOwgfFt2bLgpu+ut1S8dplw4g0y9I43e7kk26CaJoTN5xyvljZhl//BRqvC8F7esBs3q7YCRAoXlEaJDDvL9Sxe/a+88KHUpf9QlSg1YClNOvwhdef4vnLFb5mebs+tN8hZfn3j6PZ+hClzLyMzLKL++QLrUYTHcC/LhYTYTE7WbjkF1L7TcDoPrMDGwa5HZxOB5XOdDQC4svittSqhiQCs4gfh9Wi29AU65+rvRSMCB78UVhiNYnc4HNo5/Xdn7FmgdD47dVz3vS2WamiZYvB/o3/lGg425awlaNyamkEVEc6kFSKdR7Uxxg9Fo1pm77IDt7jLKWEoIoLlVBFIjGVxcktql5kNG5v7xQjynnwNUnYBzdSeKjw4lO+x5Na3MO/hlLlqIcZIU+oBW/wd3aRPluDq0r6xa3fQcYtQYCXbvA+9jkfkxP0RHvd8V8JvrF0f5H2aAg1wZ5Mn7itjhuwMz7f6nbo0nYTsHBQtVaCecRn+PK5nt0qIB5IdceD+xlGd75qY+53utBlsCfjRn+EMqz0UqY+tTX/e1hhMHEHDRS1EKu/wZzUUd4K5KLqETHO6906u2rGpIQWETkn4jXEM8LU8Fd2jOlwh9Ga+MFcpynK0khV9MMlQ7akauc19mZnHA697XCbFZxqksM5vgp20ReXG1A06HBmtSRuEMQyBQhB+6EMLbmE5kecgY6YWrV6Gwa1boi4DC0nfxmO6dP3UlnhMCy1f3LiT0hbU9Qt1X/cizltgVAGu0ZoTPLhA75wHDCHVPlv7nNHUMo6eMC4IJYW9pYjznPFBWyGObJbuhkYOx9Vr32JFHXbJFA0ymUKzJ0fPK1p27b8biryPhn13X7k2VyVUKOrpBRXkwBWsxFqkX0nK+qUlWXvfzj/OvodNa+c8bhvZawJH13xYGPjVL9wqyEmD8N2b5OvRz7rtXOSHHxMkA== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: fad7cfcd-87a3-444c-da33-08dbe44a07f3 X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5764.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2023 13:11:21.6948 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DCgPlPAvEKis+F1DFGKFtiG4fWrb2/7b9/siiGBXz0zCSJe/hVhL7ZZ1+nldR11aix0yFQaUrLxwrqhazlLGHy+BIPkQ9stkW4ZZ3VISGAM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6772 X-Proofpoint-GUID: wkhA0Nc4Iy08eMopc8DTCoMZMKLdi8Ts X-Proofpoint-ORIG-GUID: wkhA0Nc4Iy08eMopc8DTCoMZMKLdi8Ts X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-13_03,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=607 clxscore=1011 priorityscore=1501 lowpriorityscore=0 mlxscore=0 spamscore=0 suspectscore=0 bulkscore=0 impostorscore=0 adultscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311060001 definitions=main-2311130108 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 13 Nov 2023 05:12:03 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782454554347564334 X-GMAIL-MSGID: 1782454554347564334 Add judgment on enabling round robin arbitration to avoid exceptions if this function is not supported. Call trace: fsl_edma_resume_early+0x1d4/0x208 dpm_run_callback+0xd4/0x304 device_resume_early+0xb0/0x208 dpm_resume_early+0x224/0x528 suspend_devices_and_enter+0x3e4/0xd00 pm_suspend+0x3c4/0x910 state_store+0x90/0x124 kobj_attr_store+0x48/0x64 sysfs_kf_write+0x84/0xb4 kernfs_fop_write_iter+0x19c/0x264 vfs_write+0x664/0x858 ksys_write+0xc8/0x180 __arm64_sys_write+0x44/0x58 invoke_syscall+0x5c/0x178 el0_svc_common.constprop.0+0x11c/0x14c do_el0_svc+0x30/0x40 el0_svc+0x58/0xa8 el0t_64_sync_handler+0xc0/0xc4 el0t_64_sync+0x190/0x194 Fixes: 82d149b86d31 ("dmaengine: fsl-edma: add PM suspend/resume support") Signed-off-by: Xiaolei Wang --- drivers/dma/fsl-edma-main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 52577fffc62b..aea7a703dda7 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -665,7 +665,8 @@ static int fsl_edma_resume_early(struct device *dev) fsl_edma_chan_mux(fsl_chan, fsl_chan->slave_id, true); } - edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr); + if (!(fsl_edma->drvdata->flags & FSL_EDMA_DRV_SPLIT_REG)) + edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr); return 0; }