Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6676102ybf; Fri, 6 Mar 2020 02:21:43 -0800 (PST) X-Google-Smtp-Source: ADFU+vupYDfL7NuTLzbQUFBQE80X13QoAzI3jwbfYjdzbV2HjWQ67E010SJahDHZt8XycpxTXoEN X-Received: by 2002:a05:6830:3148:: with SMTP id c8mr1838315ots.359.1583490103552; Fri, 06 Mar 2020 02:21:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583490103; cv=none; d=google.com; s=arc-20160816; b=EB2aiej5qZDolDItpOpSwSHb4Wrj8RQDFl96rPrk8GsawcoTSuYBGrwgWXi1cCrGGO q7KL/Co/Lgpp38FCWD5KcoUIP4wjPvTwSdtd52Z7D4SHy0p+v5DqLMVg62J8/FoVjtT1 o/upo8LChbW+2chO+jLVrR8hu/kRMDkwGor1ERtu78jmVzDVBr3TwK6RS3qBv1vykkXY 8ucyq7sIjgNc005UYRtoUCPVl5+MI50tZ3LEkckVRe5Ss+OOsHmWGU3Vheepz5yMw66Z ei41cEvZyAjD9L2jS0BOUuMPzERoUwotENls6MVJwCcajso70HRZL9sLhitQsK7Zb0Av 87oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=1uccMfxz+VKq/wZ135mlKu8Hi0j2DvbWdCVTOYev6uM=; b=zCpyYPF8WQ+nySFtdK7gpeSk2q5p2Uk+PhSIU3Pv0iFu751WcN2Vc629M7Lye253Z6 FnGR2D56RGtE18pmToKrrdPXNXF1jORDO/O2zSOh9KDiXvLJxZ1UfI1FOhzS+5Ndk/fJ 9nFdCWL9boXQ6Ad3uctQU7qpLt/psUtgrmr1yOV8/FfDdgN/xv5QTF90TFm6lHcU3Sl1 RFpdbQmWmJXl6lXob8i9hYpXEFt9BTCQVeDBn7j9HlOhmXS+f4WBUvkEGNOwoDGS4+wx k/UdeKRcQCckTT+C66fh6wsh/iD3fihtFuZREE3ajxzbCQBYVoVxK9bSShE/grACCMGm uO3A== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si1015938otp.98.2020.03.06.02.21.31; Fri, 06 Mar 2020 02:21:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726866AbgCFKU7 convert rfc822-to-8bit (ORCPT + 99 others); Fri, 6 Mar 2020 05:20:59 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:33555 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726368AbgCFKU7 (ORCPT ); Fri, 6 Mar 2020 05:20:59 -0500 Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jAA68-00018D-KZ; Fri, 06 Mar 2020 11:20:52 +0100 Received: from pza by lupine with local (Exim 4.92) (envelope-from ) id 1jAA67-0007hp-HB; Fri, 06 Mar 2020 11:20:51 +0100 Message-ID: <69903c69a95902c0ddc8fb9e7a6762abf28aa034.camel@pengutronix.de> Subject: Re: [PATCH v3 2/4] drm/imx: Add initial support for DCSS on iMX8MQ From: Philipp Zabel To: Laurentiu Palcu , Lucas Stach Cc: 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 Date: Fri, 06 Mar 2020 11:20:51 +0100 In-Reply-To: <20200306095830.sa5eig67phngr3fa@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> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. regards Philipp