From patchwork Mon Nov 13 22:57:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xiaolei wang X-Patchwork-Id: 164660 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1523614vqg; Mon, 13 Nov 2023 14:58:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPSVhTlbhPp2KSpSQrIBoXpuME0fCLo7JT4xhwS0Gni4MYCMoeFkLzC40+3OEGDN4nckgW X-Received: by 2002:a05:6a00:2d1:b0:6be:b79:eca with SMTP id b17-20020a056a0002d100b006be0b790ecamr7513251pft.32.1699916300059; Mon, 13 Nov 2023 14:58:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699916300; cv=pass; d=google.com; s=arc-20160816; b=wKTqcoMAlMdTsSd9R402GSQaQUOXoMz5Sv74W5gS/iI0rwKhLr47nDehm7wcmJLnvg 1/uAsphZUjvQMi8spgaqEAklgSGtLHSXHn1bN66JwE94kmua0K11SeHa4uAIPEFGiDon yU42KzECO45bfAli3UyyY0xr7NIzrjiUAxb0nZEccLV/mgVBjVxI4bwPDI7TxTNlS5HV bc4Pjz9zim1s8/JJBDn+iAZfSUW86UGZWHuR+6cjYOUhPt2TEm1iBJDXa60zbrFr7Hhv cfpQgrhgT+rEmB0upJDnSDbJM6oI2mC89hkpQPbWQzl+U5b43NIFE2taQzYwfZt312uX 5U6A== 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=2CmEor3xq8MqRSVFSHUHsTnpoTWHXIo4ktJzjLyOOBQ=; fh=r2ozbC7zWHWKzErpY3ns9AD7oM7lZ5HPDrl3Ma5DKEs=; b=i7MwNgf7CFujV/mfYFiNoy/EovKnMFxRaGrXJ7QUvzzTpb4ZexBsCvK2wdU+ksr5uf 7kVemzFUEpiTVSvdwTe5Rg40lJLM0uPjYbX2CgjIhIIK8BzE9Oq4Fc3V5v8T9lSIkfgQ Z0f69dE9SJ54vqpuERU5lDiuCYpuJHEYKPjMyvvJtIqS6+t0vlPOCJiuoziLbt4pzV53 e+yEfnUL9+rbqfZFbyKB3GTiwGqV/LJ9EefxRw+qrA4jHOMMdwkj7F57qODSo0JruIxZ OMfR5w3pDSNU994Lx5i7SOW7IDnrM4V7hs8UXZUwl+2ekPbLd1rSLJywrme7lNHAggvz bkKw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=U4muxILy; 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.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id d19-20020a056a00199300b0068fea05ecd7si6900986pfl.164.2023.11.13.14.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 14:58:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=U4muxILy; 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.38 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 fry.vger.email (Postfix) with ESMTP id 6E24B80AE20C; Mon, 13 Nov 2023 14:58:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231745AbjKMW5s (ORCPT + 30 others); Mon, 13 Nov 2023 17:57:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbjKMW5q (ORCPT ); Mon, 13 Nov 2023 17:57:46 -0500 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D080E1A6; Mon, 13 Nov 2023 14:57:42 -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 3ADBZ169012916; Mon, 13 Nov 2023 14:57:33 -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=2CmEor3xq8MqRSVFSHUHsTnpoTWHXIo4ktJzjLyOOBQ=; b= U4muxILy4QhujOUbw47empRt4sTDOx0G+3YCEyMwSTsnecjccMa/55cfH4zczuMt NYZSw17f3OSdZBkt2g3KiE9CAJhqC2g7YT3lp3w8pUhLP4TlO3a5t/HaiAx0JUkD I+9eosGaiTgjAGcSH8z7qV+npLr1Da/yGDO+o3ifSEGFYIpfPkX6tbZG69E45TdD feD2922kPk/l9mE9++ioijRB5PumFqpo+S8T6oKwaUBq97EOHuRkPti7buGo960k 8z1AujwNxPM1koLAXRrqq3j20+yfTLvdwp8Fr4dPOFnBb8o9a2IaO4rn61AeA+ci 4Cr386T8K7q12iiGm1cjAA== Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3ua5s4sw6g-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Nov 2023 14:57:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kEjwQCTIhSyWPRypl+lKD5koqdOeTpsmaUIAnqrguEvVgQuueItSwS+hzQNrGuipAd3tZkFkzvVd/fEPJV9YvPnRuPu02c1X1Tjy1SfesKq7Ef8o1WDzMWho7CGmB5XV5J6/efIBOf6gvYLfpdh6IgdROPtrmbuqbvqQNO1ggNlOnqY49pXE0HZ/AqpPCW0wE6P/8DbVvfmxwPCMHFi3xtC7PbRCe49lbMef/B8ViGulzQY8he3xigzzCdXDtnv08WaIdiofmMFMQGGpCqvg+k/ga6ZgrXNpoBz429FuWrDvbkP4W/p1uztbICQ/5PDnMI2v/7Lt7nJm4OfcbTLIeQ== 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=2CmEor3xq8MqRSVFSHUHsTnpoTWHXIo4ktJzjLyOOBQ=; b=SRs4U28ZkPlHlDAiFbbN7AslMP4tt69uAiAffAovwk9XmJM7q60A4e/0pw7/Ridg+/SdQNZWl/+ZDJ7tHMfL8OeROoJaprVeEzziOLmRQBj6K/1Tw5QMZY16HnVKAGqk3O12RY6M2XE9HrG+Zz5Hk1qj4TJK7ooSY9byOmIz4/z7s4uRBuYENsG3r4lhInCkPRtRqF8KnZgzz8W2fQ77FeP+CaTXyKQ3YxeKbVRz/j0lzXsg4qQ8t9LAPO8hqrmIFJn082ndipTnO/HYqQf3aZKYZpXpKV3RGoJ8yuBhyS7dAbjvJsRkSfZXTSM0AQ27dbRX31211yRE/dMLWHX4OA== 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 CY8PR11MB7136.namprd11.prod.outlook.com (2603:10b6:930:60::6) 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 22:57:31 +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 22:57:31 +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 v2 1/2] dmaengine: fsl-edma: Do not suspend and resume the masked dma channel when the system is sleeping Date: Tue, 14 Nov 2023 06:57:12 +0800 Message-Id: <20231113225713.1892643-2-xiaolei.wang@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231113225713.1892643-1-xiaolei.wang@windriver.com> References: <20231113225713.1892643-1-xiaolei.wang@windriver.com> X-ClientProxiedBy: TYAPR01CA0137.jpnprd01.prod.outlook.com (2603:1096:404:2d::29) To MW5PR11MB5764.namprd11.prod.outlook.com (2603:10b6:303:197::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW5PR11MB5764:EE_|CY8PR11MB7136:EE_ X-MS-Office365-Filtering-Correlation-Id: ca043563-5f4e-4224-6f14-08dbe49beac2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aNv05OYFRsJqXb8UY0xqHXXgLPqhd+Q+FvZX27B7SS1dqd29BrvcYaItccbXKm2eQk0Ce/vhnZ0RKhcM1INlvPELww9uo3kgmdy7V2LxyeSRBQ+wQLDd31Q0+cFLq9kCqAvT1i8KKz8X4oCK3flhTThLPhJxqkMHwx9C/lJ0F+8H5zE3XcazNkRlpshm+mHEWJXL8+sr3AyvQbb85icv33FaVDlDygZs4r/cHYvt2vH0liwqAZO7v7f4b32yXKKTa1iAhn7qcpSOMubTs2ZMJSQuNMFnFoHXyP4tBlpaUKNg2rbQVJ1Ompj2Btl8HTwbrG3JES+dMG8AuAU5yhHwS40UHSxg1qHh3SWrl1DGih1uOCIGhGzjpiQ667K5kK3pcoGoMq5QRJAjIidwCMB2pYC4PFx58OHz410RhwuCVT6rlX8bvc3EChl5xcOjLDYNVeCo7IRkyBCEQBx6aAuam2yWPZbovVgnbWEEgDTM0HpMxIEA8gP2F2II8D1+OP8vZgRcQNwx10hzFKOCbgR0/kHZybZsjPfCkX61c2PvoHI6UN2guyS7eD9D1kEKe7XjQNY1hsGiWUBWt3HHB85lCpCEcf8l20nyGJEssiLwb8cTiI+JNRIH0Bju2zJ6c27y 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)(376002)(396003)(366004)(346002)(39850400004)(136003)(230922051799003)(186009)(451199024)(64100799003)(1800799009)(38100700002)(2616005)(1076003)(8936002)(8676002)(4326008)(44832011)(52116002)(6512007)(6506007)(83380400001)(26005)(6486002)(6666004)(478600001)(45080400002)(66946007)(66476007)(66556008)(316002)(38350700005)(36756003)(41300700001)(2906002)(86362001)(5660300002)(15650500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kOpG5+fQuBW67/aT29RROlfDJZ9Pp/7/bGD5L53gw+YHnrmOZCNgHCklKBP4+zQ3C8kKIVndZD7COzuohbxllrXFPq1HFEF6cHbw0o7DxWLN3CQf/dzgvEOvPJrEU+E3zo5CoAnps4UuLoTsah5/2kSBdqK8CQh5XQA5wp/eVRWQc4Ye9Zq4LuEG2JtiwpsboDRJFZPyPJ1F6GiqrSXfYVMw2Kc7ewHruyWHrCEvGr9PKw4s05uVN7c4+Q4DxK6Nl9wY92t/vgX8Ym/Btg1LLCRLh4Qn62kwVhcPx+qoGyyNADXUrl79jVCaKudxiHDJhd5JhTtSi8prclEmN9WL6NXKaxCIh+AQYU++dkq4tbIWHitNRhrphxViJ+jhaW4NxW44lF4vUIu4iGtgoIn17zxQf+P+KIxTCdsq+Loh46c15JT2A+WFH2I/CTijW3KS4Jt6BFd5O8bwv7XADbkzUIHGz/Pbc7tdugBhcNlOvw9WfNyqM0qe6VSSOov7JimaFxm30V2wls0tVEV8nG66p88Bqn934zkt4hWc1Ju/3Tu/9RHPImqKj+d9FlPP6nwjME47ICkHwfSuMyql9yemE/sddo1vuXGRkPtVjj9BCFXV1OsXSIYt11YdZn++MzrUVM+ThvPdGOSu14e+oN72rU760bYzlTl2wfmiphROsJnRIxsbJW2Sq17HlRlyMb8lSB3JSnnr3X04WXXYQeyDzpfP+R3cg5/OWy9vBxiUpVHf5y4aBREFExkGEoaCBxIGWkxau7CMh7OAK6FRpO6WXAVnpwIN/OPKM8drYFUzKA9f6FuZCOfkJQtDlbyhl9u2GE+pg7vikMjTz0SfRHdiMiler+qWt49/dZXAJvYE0/IGOGRFq1AD9Q4Bh2pTCNpkexdkis32/TFij2YyUQ5Nhoy6aOBzBujuI0rSgzfHrSS0bde0xsyrrX4FMAx1naTUB69J6Tx8kuFxCKQwsrzHNhokXGw3bdb+7fm6he+6ADMvp/jzSuuh6nWKH53jj7Z6IA737qZjF5jGVJRMo282Mp4EBpnJ5PvVtSKbKliZ9QkYi4pKWGiKjRh+Okb5VWMLdTm1AV5TQ4H7V9KglPx4mkiSAew30e1Vkp8/GGSG1e8XToRzqaWY1C4topGCNldFN78b/3zOjONPlEye9Tr7i4L01NXN5EBEy/mHKAYcine9+hdYmtnHL86vKzWIFy9lvFfgt/n2vWn/7QsyJ8Lfr57mJwvwu8uwUMqzx9Jxbp+KZzk2W/kSo90cT1UEEJhqfAOYTNEbxoPqoMfaHaLY+GqSjUa7klvVso755AqTySaMWNuEf5pph9T6Z1QALX1OAyg1Y/h30Vhbvw2QWgLyZt4k2bQ92nuIqOt/LrBmbBY61dyz7k9F870pBiHBzzK4c260LXIdZ32ED1HMvgGTLcnXjHoiDdBtFvZB2Zuo5fWfG7+idy6I18Q9s9z3HixYmgYzOCJylMMJwsW/eejcTh5Pa12vj5/8ZIu91hbv6ojdnYvsNOgCyLE0fTCMoL5HfUfCkBIxiYrygZT3cJOEsgrNTQGv7mXs1fKmUDi/jHMjB5WPhv5bo4RtklQa08cSogeljYUpJDkCMUqoVRKJCw== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca043563-5f4e-4224-6f14-08dbe49beac2 X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5764.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2023 22:57:31.5025 (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: NMq0zsy8bpv5Exl1h2vnsiJDe8EtSnP8nIIi1F9ksjzzd+Bbe3Mb+zvY3m+j4eBCzt25+DyrNDgw+jOWk/4UyomD+rPdRYptwbcotE0Mi7Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7136 X-Proofpoint-GUID: Vgil4NOfyQxG45gJ99mKVxJCUOUphf_R X-Proofpoint-ORIG-GUID: Vgil4NOfyQxG45gJ99mKVxJCUOUphf_R 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_12,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=468 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-2311130179 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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 13 Nov 2023 14:58:17 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782491434240636916 X-GMAIL-MSGID: 1782491434240636916 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: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 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 22:57:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xiaolei wang X-Patchwork-Id: 164661 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1523709vqg; Mon, 13 Nov 2023 14:58:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEETuFIHJvvC9gyPTmm14TnRhlvIYQkeAzJ6xmxqC/uiGVOk6Z4dF/EJ+OlnOdp6cwaSWmB X-Received: by 2002:aa7:818b:0:b0:68a:6018:a66f with SMTP id g11-20020aa7818b000000b0068a6018a66fmr1197632pfi.2.1699916317711; Mon, 13 Nov 2023 14:58:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699916317; cv=pass; d=google.com; s=arc-20160816; b=dnQG/Ra4qbf6pNMesF8XsRshpzMBEimY7mB272C70e8F+KZceRf9ubf9WtSYhObHzp dC6MbfpeikcjvVuP4OhdJkrdKFTjNAkyM66DVeIH8+2oluCNW19w9jwCs0NTj+bGRcUx MPmmEVdFbEpmwn9w5yXjqSePk7o2hnsjCWrHYih2JCLFs4/IUmZvxiLUxT2QdgHCezm8 rvqmF85c06ORqKcdrFtsZISQrcsPeEr2L0oJbToE3HebRZCL4zgjCI4nXqbrprOSkohA 8ZszRcK+7matxDHxUwyiAPi768kErUo0LJbvBwoYpfRZulQQuVNJY9jCG6jjwVzO3uqr WDYg== 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=4hGwZs/gkFgvgh64pmtZQPr1ae5vVRucOKAiY2toD9A=; fh=r2ozbC7zWHWKzErpY3ns9AD7oM7lZ5HPDrl3Ma5DKEs=; b=fytNQaO9Rb6/kVxkmYrJuLFVqv7YTyh8j1f/bRBwQeVTLTkhZFaw23wPTTQZNRDtrk 7gTnnJ3DzC3fIHrbqmvyCn4ltY5YDDRieXbl9GDtzRXXVefLKyAiakSPmipToph/J0cT 5B0v2sI9Y7vV6FxMHsnf5/A3u9wQH/cO83XjbEzSCM0PT2x+0w6duGlx2yK0zFbS5nL6 580UytmGrVAzno4XaWSi+PSHoI1DbPK/dJxNr1a9yMwTn4JV3NJaa4yANhDBZkzr+Ars yQ3sO/pyNuJZq2IYUX+B2mWeLQnHL1eFc4EVyHfz/+K/2iwcLQRUv3by+DDAXh4tosAW M3Gg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=J3L+PLKo; 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 hq10-20020a056a00680a00b006bbfc944748si6206640pfb.315.2023.11.13.14.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 14:58:37 -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=J3L+PLKo; 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 6211D80A3640; Mon, 13 Nov 2023 14:58:35 -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 S231842AbjKMW5t (ORCPT + 30 others); Mon, 13 Nov 2023 17:57:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbjKMW5q (ORCPT ); Mon, 13 Nov 2023 17:57:46 -0500 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77B2C1B5; Mon, 13 Nov 2023 14:57:43 -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 3ADBZ16A012916; Mon, 13 Nov 2023 14:57:34 -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=4hGwZs/gkFgvgh64pmtZQPr1ae5vVRucOKAiY2toD9A=; b= J3L+PLKoF1KiB17wbXsGPjWVIhjxUXl9CWXkBdYr+RCAjQn7MXnoyJNcwKv46a/U k9ajtygNtM2UhtyOTXCkeBwHY8Znt0PHzybHG2L1U48TfJGDGsKTPSzoALoxFa4l cVJqdgo2ItSNyB40LD4RR7LE1ROdM/VZ64TMkHwytQGIAKAriTjZEStTe6OI9nNP SNRvGTh3i7Oo5qUpSa/WKrovGawzRdNq5L2Apuww+ZLtDoO37JjmddvS1BUuY52h ywLIYKjuxKwloRKMZFIOfwyurgexVmK0XGuCA3znT7yXCeW3JhfrKGsWy/FEoeQk 4g08wHpA0nzsA1MAJ47JVQ== Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3ua5s4sw6g-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Nov 2023 14:57:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KihoWP35qTwez3trQv9nGuiPrJvDJEPLXIQZorpZUzl+jooi/zlBx/PgX+yh2zLbxKvNEmoSRDQDNdHO8ZTXbJE8ngJy24Qrp3R2bQrsbQLR+3QVz6yYD4u3DgRkqMZKtYfE39gkrxsCwmX5t+YTesSfCl3IU4w+1SHxDQgL2QiYmDFIuSUprnUj/75roj5Ce8pZ751FISIPTxL4c0FLj7hd7uhK5HosaRij2+Q1IlDEcLQFX9eK6zfvY5FI1OUENSLqJg9pKgtzFfTTX8Hi/6nqerne6qcAidBxzWQLHn7W9brysm1UjhiyLJ6XTsbWQgM2ikLJNecB2gKPTQgD2Q== 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=4hGwZs/gkFgvgh64pmtZQPr1ae5vVRucOKAiY2toD9A=; b=U8C/Vsx0vET+manC3mQuq65a6ybqAn0f33ggc4B2PUJNZGZPODmp3sjbmJ6TkOA1B7aEJcu/HBOfhdCkLnz8sen0zYGPpnXIowge66YnRtroLpUHafKsFxclC8uE1t8+qEnlywlUYg5SOPb+gKnDDEmbB/VltsA+La97F3qgUSgnbXA4BmHucHmtqeOAxL50udCfk5RU+KUjHoQK6ntLtRCL2RXgNklgC3euP1eWUybmvuen3hEwTl/GAqvQMKiHB3JQ414PWzYpNwmneMg9wtrFnqeXd94RF4l+hlBiPFqjCfAQZomOjZl5FjTd0T7n+3nMsWfmMIC8vPrvmEKuqg== 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 CY8PR11MB7136.namprd11.prod.outlook.com (2603:10b6:930:60::6) 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 22:57:33 +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 22:57:33 +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 v2 2/2] dmaengine: fsl-edma: Add judgment on enabling round robin arbitration Date: Tue, 14 Nov 2023 06:57:13 +0800 Message-Id: <20231113225713.1892643-3-xiaolei.wang@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231113225713.1892643-1-xiaolei.wang@windriver.com> References: <20231113225713.1892643-1-xiaolei.wang@windriver.com> X-ClientProxiedBy: TYAPR01CA0137.jpnprd01.prod.outlook.com (2603:1096:404:2d::29) To MW5PR11MB5764.namprd11.prod.outlook.com (2603:10b6:303:197::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW5PR11MB5764:EE_|CY8PR11MB7136:EE_ X-MS-Office365-Filtering-Correlation-Id: a65f2aea-4bd4-455a-79a0-08dbe49bebcd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Bf3JEcfO2xzk7rnNiCLBegozCsvfeV5Vi39TDPsqslzK8G0MEOQ+DnO17zouNSyGaFsvnVgJTraPKmfqqYm9LiUkLpnRxOjFY/qnK+3CoeiCnUV8kar2oMrIPMrbE8XRXgwLvasx5HGbYZy144NW2p1xJPtJZdM7aw1vMhCBXqsIt39Bm0dDuZswppEBHULhzL/2bG4LqBK1w/QCxJzCiyAf7SavGv1fhmhYf2T5d8o6BHB8zcf2J3h6yApUPVDJy0V2gtIhdoG1hYtY6uhEigW4SIj30IzwuX1j4ebJNF2dMUw0OdREbNt2R+12lbSslHYyG+VByyuIW2EG3LtZd/VDHaEqYOmLwzvsnE+wIuMYijM31Lh9Ykwy19J7iXFA0wluE7NTBIEePUvpn423E8VIhKK3QszvrfC69G+KpdGn0rRzd8847iJVB5Qz4T/4vUHYdNtZiIs6vUXSvuMVN2GTrE/RthxfQ/C2lpO/WkcEakzA9wRCtxzqGsfBsnnuL5JTN9xDKDbH4UWrDGDIW3GrLAReKG1PX3uVlWiAGO4YEScpE0yHdQSJEamOZteEsIaaGhTZn8gX7ziCh4HtmCrm+X2n4eY+qLiaZH1owrge95ekotryQFAIu73BC3BI 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)(376002)(396003)(366004)(346002)(39850400004)(136003)(230922051799003)(186009)(451199024)(64100799003)(1800799009)(38100700002)(2616005)(1076003)(8936002)(8676002)(4326008)(44832011)(52116002)(6512007)(6506007)(83380400001)(26005)(6486002)(6666004)(478600001)(66946007)(66476007)(66556008)(316002)(38350700005)(36756003)(41300700001)(2906002)(86362001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AQfvsNzAsfPH7KKcWExd0xJI6/CYxzZGwSLRip3rhNCiYZ8ewHmLGcmrd4uVRyW6vNuvBrGF6cn8mehCwXZsjwaW4Ojg3m4PMcUpCllarFa9FbLuRV4fofSgxoEHiN8c5ry4G2RNIfMgYKmINww5M6rFJrtNYK5sxENOXsbi2CxtiTfVhiEF49FXNj9jRh1kmWFetJn6FsHvAVKm1mdat8iw9uIpmd+oidfZGy9K9OCqBJ6PvYQzs2Q4U+uZJ2ZMq6SnYqEbp02E+ZAr4vsBxxIismbICDgL68IzOUp8nMJ8PYe20Ni05WxpvwbKyfPY7E9uEErvNFhWhBrqsoc5ZOrXQ3IJhfwouXD6wybjCftufj6XAnaTJS73EyTHTe93XzCG/FNcZgxBTW+zH6a4Q7jTw48looDHqRJEVMPBEIc5sBaRG3/UKY8g5007w6foq9kt84Au1KXqvuHyaxRStzKqUhNI7ZXSEDr15mG70MBo3w9YRHt8njLj+EPFtu7q2GzdIKTnGYIhfXEysxjOHhMzZitFrMCd+yOBtyLQj1OxlWBz7vPi7NFEFM89JNZfhnQL9Tncy2DHj0u2ncPdheK91XIHJNizescceKjNfu9NOW63B6aBtRpmUfG4t8+rYsRCQrZHfjMkrrWrXrx7mndqJoFWR3VDbelVnBu9kN3XxHPyHAI940y1bM+wWyGWlvMk2bxBdqIYXVzQJdH9dtnYs2W7dj6wr0dj6YECY0mchs7o2k1NY6UK6ccQZ564Z0eWnd3iXmDprU/XGGvSgwfdzkVTqT87puFcBuK/KUhb4l8FHDC7BkVp10ouLV6gEIhGHuOTbJTHBciKd0M32apLkw4q96mve1gkzfceKxUL5sFM4QjeIb43u4DppF1YzTZC1Wjmkzurg/1y3h99hBMachPSanCBCjQmZQzCQKbXaVjxcvdIj4Xd4gHwaQULbU1atHuWomaU2vOHi4WTFCFcwZYeRtdOe0RouL/C91mF8Xq1of1aQEotofru7/hShFCmkbb1A3Uo9jdqUNDqyhjZrl1rub59nbA6E7Egni7mM0KTAt6Tw7yUPtvW/qPfmd4FKj9Ei4BqwZb1QFeGAYwU9bNoDJjS41yxPECB/6Lw4Sy/Wb+Gt2VIgXXVcz0caAp9wDG3rwvseTN0zwl21PpGIcw2SXzm5pBh+ex/FTj23eCoqa+XMsq6Txh1Aam85RKGfoOu+/PPJAPTkRYgMUItziwUaT1OZM9TGSVliHpJCEiba5BJ0sxrttfRwDiLM1NIafDJyhehYNM7TY430xD0owZFA3mNDKMMKBoBs6plROSDYv53kbiev0c4GS2B0q40DHsb6k+2JQVyM4ce6b4bqBXFFFagRhCbQ+iWKErjVnQLazqQTn+wAjpD39NN2rqa1ly58TuL6ZkHj+EONxtzN0RZljJTTab+w1pDDSF71MkAk0LZGllA9TMqxbNqVKzmbkW0woAefzs/TMIYMLlHXZDh7w5CVp/9BRndO8OMdX+UQk+bivZXSoI/LI2pqPAIrzhxG0vfkanEJVC2n7z2ZUZhHmfDV6/rTPqElFixIKKE8TG35FFnVHJ2Su16lF5wB36hGjxUDWfSUbxG2g== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: a65f2aea-4bd4-455a-79a0-08dbe49bebcd X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5764.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2023 22:57:33.1884 (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: LuoO7h0dl7AfVHqy8ZHJ3DyaDHcetu8mqxlUgZnqftZm0xfWYfHKiUdRQSHOvCGJpwd8oA4VIqr/qOdg9MWRsWz5hAibHZFqCY9SUkHmIhQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7136 X-Proofpoint-GUID: MTQPTcT57abejzkFke0GyINJX-Gvzp7A X-Proofpoint-ORIG-GUID: MTQPTcT57abejzkFke0GyINJX-Gvzp7A 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_12,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=699 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-2311130179 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 14:58:35 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782491452620203101 X-GMAIL-MSGID: 1782491452620203101 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: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Xiaolei Wang Reviewed-by: Frank Li Reviewed-by: Frank Li --- 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; }