Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6717291ybf; Fri, 6 Mar 2020 03:13:10 -0800 (PST) X-Google-Smtp-Source: ADFU+vv1QsdouQUrKTQdPpL5r2uKAEK1lh4vCst8iYqTG3FgJ+wC50rtlZMXTx5a1m3wSLGuyNuU X-Received: by 2002:a9d:d27:: with SMTP id 36mr2121712oti.230.1583493190228; Fri, 06 Mar 2020 03:13:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1583493190; cv=pass; d=google.com; s=arc-20160816; b=g8K2OVjpoVXnxGoEsfEoOW/6Gq0Yi2qnCDNXclRjByskToVJoTf5j8taDWdiuZb2FK GhxxxS/2bwlrCWKbXoJbL9Hjeebvdk/lVNrfEcqp23dOloDEgC1jItcODGvgexrtARNe mWs7jJoDtcUCVA0ZSTchZDpbfIh4HKhPNqbpOrjTryQk34bwGGmV3JmTkeY4wWMJRKhg JiWE27S/HVC/g4v7PAarO0wavIWFdbnlmQ3qvn8+AVf8/R2P/7Q1LkJCPMBqMxvAhqnH ypUr32oeEE1P1QOS7dt6JegYtjPcwiJ2lIbQDHbDCd5BkMlk3kuJ74hBxsn/YZaZvUCE 9qjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9hwjz+JxwPUJhmJSAaZkZECaVjiCTFHzNNwzbEVHIo4=; b=g9jsVIQi2XXOJmm5sl2JNI2Y0DKGogxKgj1QUEOQnkt4vlWGDPwVnSQtDIqN+ukBpp 9QshmsFBKUhIgMtfNVdxDsIUHJe+PR9JocLXehlGN0x2cTXpc7HGhnSXYC+ZCgyYmEmK 0Fj1qhFWkJNN8p1+ct1ZE+idLbnEDYeKs/KMRl79YI4f1hS/OJCoRlmmXR8Rf2xjFKNE HGOI4P4s3O6Wx4LLlSLrENkyLqqW7IlKwfnOvg+T01ZPfzZzi5gAXZJ7014+hLemP+JN +6w4R76LY8f0G6Sa4o3J9gocb9HRzaxClCI5jSmNp/g6VpfwxEA58xNGFi0rWHQH3l/B u9fw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=DUZ5o+me; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si1049680oiq.71.2020.03.06.03.12.58; Fri, 06 Mar 2020 03:13:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=DUZ5o+me; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726231AbgCFLMR (ORCPT + 99 others); Fri, 6 Mar 2020 06:12:17 -0500 Received: from mail-eopbgr130085.outbound.protection.outlook.com ([40.107.13.85]:8664 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726129AbgCFLMR (ORCPT ); Fri, 6 Mar 2020 06:12:17 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YovSpe4EFfOj8RV/1eWsYDGAm6HOUtAL4zS9XlbmOyAfSm+uc0Tc07N9uWGa9KQYwMLzdjvTByj55WE9n5bWSQybeeXvloT42efSmGBOlHrmWmdU6fr5OwnxSV1/ngcsJbB8yfTME+UEn+xlIkUOCfmP5ErvHSmWBzNnGnPvDsDAcLRzi8tH3V1RxgWYoFGNfg/MomR/BuY/uBcxTC7ruSrG8FbCrNz0a5m/F6La+OMYYbIUwSZ9+kw8+jwKsw5PVx6nTfKvpJpUdhijy3n8f8Otpg6xdzPM2JMPHpWkFAJp/pCgHxlF+X3CwopdztVYO3IsW2CEIahaeEH4ckDN8w== 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-SenderADCheck; bh=9hwjz+JxwPUJhmJSAaZkZECaVjiCTFHzNNwzbEVHIo4=; b=aXFsVJ5WBwbjoU4Fhzq1aU/x//UCCY1YlWfcFiQVwREnHNqpkdlf0jRfcMFzpJJCiZUuNgB/ovYe2oS49ilBUdDRJahRBE9YVb5YkseuCxCP60wMTg8rZQpiLdrSyfpYB9CGNE1yR+xVh+fkTQ48qiYDHAFcTi9eKJxdrxPdPu3ApafgMNJqTJpWVSAkUntGTiLBGuWWAYIJwLuUa5AuX1GEqWkasGP2BB0wpfiMqOS16ML+IaP1jfTckt5CGkuSRIgVUKII3mM3C5sGDmdP5OXvJA9LNIAZbvMWHnwRY3s0iELjVjNLB3xoVqeFjQ4iv9PX+rjaKWqvkoK+7FvWcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9hwjz+JxwPUJhmJSAaZkZECaVjiCTFHzNNwzbEVHIo4=; b=DUZ5o+melXqOOCJJPqk12VQSU370Wvdx8L4riXR91Kz0BimH/kNzh4sYo7fY6/oLkb9dKYAouIfZgCDwUBgmLfAcDbtffLGK7AFD4Z23NtG+c/W3PNxuPRNSJ1N6PmgoayaDLrBE+C1lcppd6kiF75tDiLmz0mzNvWzIfUeAQYI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=laurentiu.palcu@oss.nxp.com; Received: from VI1PR04MB5775.eurprd04.prod.outlook.com (20.178.126.145) by VI1PR04MB4048.eurprd04.prod.outlook.com (52.133.14.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15; Fri, 6 Mar 2020 11:12:14 +0000 Received: from VI1PR04MB5775.eurprd04.prod.outlook.com ([fe80::8542:a5b7:a83:6ff1]) by VI1PR04MB5775.eurprd04.prod.outlook.com ([fe80::8542:a5b7:a83:6ff1%3]) with mapi id 15.20.2772.019; Fri, 6 Mar 2020 11:12:14 +0000 Date: Fri, 6 Mar 2020 13:12:10 +0200 From: Laurentiu Palcu To: Philipp Zabel Cc: Lucas Stach , Laurentiu Palcu , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, agx@sigxcpu.org, lukas@mntmn.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v3 2/4] drm/imx: Add initial support for DCSS on iMX8MQ Message-ID: <20200306111210.q7fceoahqw3mlxog@fsr-ub1864-141> References: <1575625964-27102-1-git-send-email-laurentiu.palcu@nxp.com> <1575625964-27102-3-git-send-email-laurentiu.palcu@nxp.com> <03b551925d079fcc151239afa735562332cfd557.camel@pengutronix.de> <20200306095830.sa5eig67phngr3fa@fsr-ub1864-141> <69903c69a95902c0ddc8fb9e7a6762abf28aa034.camel@pengutronix.de> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69903c69a95902c0ddc8fb9e7a6762abf28aa034.camel@pengutronix.de> User-Agent: NeoMutt/20171215 X-ClientProxiedBy: AM3PR07CA0107.eurprd07.prod.outlook.com (2603:10a6:207:7::17) To VI1PR04MB5775.eurprd04.prod.outlook.com (2603:10a6:803:e2::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from fsr-ub1864-141 (89.37.124.34) by AM3PR07CA0107.eurprd07.prod.outlook.com (2603:10a6:207:7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.9 via Frontend Transport; Fri, 6 Mar 2020 11:12:12 +0000 X-Originating-IP: [89.37.124.34] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: daab01e8-e2dc-4474-b08a-08d7c1bf391e X-MS-TrafficTypeDiagnostic: VI1PR04MB4048:|VI1PR04MB4048: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0334223192 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(136003)(39860400002)(366004)(396003)(346002)(376002)(189003)(199004)(6496006)(2906002)(26005)(52116002)(81156014)(8676002)(9686003)(81166006)(186003)(66476007)(66946007)(5660300002)(66556008)(6916009)(86362001)(1076003)(8936002)(55016002)(16526019)(316002)(7416002)(478600001)(4326008)(33716001)(54906003)(44832011)(956004)(32563001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4048;H:VI1PR04MB5775.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:0; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uHhxRW8OFh/p1Ky+n7oHcm3BuCPsZ/bJfkrhpZz+P1SLrpeJ1y5Uhj+3gUEaq+4lgUA4oaeDN/Ig1POJSXhQA3l5CJyEDnb51eVidNbjeNKVy9Ahb81zAdXXCnSgSCFG/K+ES1CfCiLTBejwWPkWLdLsFYadmBwEgQ760VK4hFMx46rhthgqX2huZiSYAJ5sytdsZiKa+SjqE9E9N12DIJUj2sMvD6I2ya7B4ln2VFZBiQ0jhnmgQQd1rzbDWBlSNpNY1G+FsknJcDdUzh0TWWjsPFm9GGYI6SxNKt3DjfEGzdGddknFHMTR/o7vsSc1ATTqKCSb01U33alK8xlhZvlb1YlGE1vt229vb52OV4Pf47ZBuKp2tC7lQycy3YhS8Vp+fG3z4qzhIFqWjFnelqJ0Uo52QOJNPSPcIJ1RA0rEcLbZbF6tifji7BL1xKMa/Yr4Nt0Dd7RwqzbRMfL5fhHvbV8BgtH2AjkxKCWygCvO3rPm/Vn29q4lJZw4rw3/ X-MS-Exchange-AntiSpam-MessageData: sqE0XNL5N/ExwJb3T8PEeY9CkkvVa8g2TcrjVhqygFQclbdc9zFStiyy+LdCTYgjoRgP78s4kAVVLLHVc8zRy/0jpX0S3OayDvObJqpmYLodKE3PsF/rQGIHAHrpJGOM3N8ezZqGgppl6OSQ8/7/QA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: daab01e8-e2dc-4474-b08a-08d7c1bf391e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 11:12:14.0039 (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: 06oszKkFTX0zQhDtWj2RpRMDytfD8Xvfo51YtJL+atzYqqif9JxvgYCk7imWNpd5KS3N5wAEQP5fq7KJEGJZqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4048 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Philipp, On Fri, Mar 06, 2020 at 11:20:51AM +0100, Philipp Zabel wrote: > Hi Laurentiu, > > On Fri, 2020-03-06 at 11:58 +0200, Laurentiu Palcu wrote: > > On Wed, Feb 26, 2020 at 02:19:11PM +0100, Lucas Stach wrote: > [...] > > > > +/* This function will be called from interrupt context. */ > > > > +void dcss_scaler_write_sclctrl(struct dcss_scaler *scl) > > > > +{ > > > > + int chnum; > > > > + > > > > + for (chnum = 0; chnum < 3; chnum++) { > > > > + struct dcss_scaler_ch *ch = &scl->ch[chnum]; > > > > + > > > > + if (ch->scaler_ctrl_chgd) { > > > > + dcss_ctxld_write_irqsafe(scl->ctxld, scl->ctx_id, > > > > + ch->scaler_ctrl, > > > > + ch->base_ofs + > > > > + DCSS_SCALER_CTRL); > > > > > > Why is this using the _irqsafe variant without any locking? Won't this > > > lead to potential internal state corruption? dcss_ctxld_write is using > > > the _irqsave locking variants, so it fine with being called from IRQ > > > context. > > > > This is only called from __dcss_ctxld_enable() which is already protected > > by lock/unlock in dcss_ctxld_kick(). > > You could add a lockdep_assert_held() line to the top of this function > to make it clear this depends on the lock being held. Thanks for the suggestion. Will add a check. Thanks, laurentiu