From mboxrd@z Thu Jan 1 00:00:00 1970 From: jszhang@marvell.com (Jisheng Zhang) Date: Fri, 11 Apr 2014 16:27:16 +0800 Subject: [PATCH RESEND 2/5] pinctrl: berlin: add a pinctrl driver for Marvell Berlin SoCs In-Reply-To: <20140411081839.GB20147@kwain> References: <1397135274-10764-1-git-send-email-antoine.tenart@free-electrons.com> <1397135274-10764-3-git-send-email-antoine.tenart@free-electrons.com> <20140411144431.04fb148d@xhacker> <20140411081839.GB20147@kwain> Message-ID: <20140411162716.74e739e1@xhacker> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Antoine, On Fri, 11 Apr 2014 01:18:39 -0700 Antoine T?nart wrote: > Hi Jisheng, > > On Fri, Apr 11, 2014 at 02:44:31PM +0800, Jisheng Zhang wrote: > > On Thu, 10 Apr 2014 06:07:51 -0700 > > Antoine T?nart wrote: > > > > ... > > > +static int berlin_pinmux_enable(struct pinctrl_dev *pctrl_dev, > > > + unsigned function, > > > + unsigned group) > > > +{ > > > + struct berlin_pinctrl *pctrl = > > > pinctrl_dev_get_drvdata(pctrl_dev); > > > + struct berlin_pinctrl_group *group_desc = pctrl->groups + group; > > > + struct berlin_pinctrl_function *function_desc = > > > + pctrl->functions + function; > > > + unsigned long flags; > > > + u32 regval; > > > + > > > + spin_lock_irqsave(&pctrl->lock, flags); > > > + > > > + regval = readl(group_desc->reg); > > > + regval &= group_desc->mask; > > > + regval |= function_desc->muxval << group_desc->lsb; > > > + writel(regval, group_desc->reg); > > > > Could we use relaxed version instead? > > We could, but this is not a performance issue here at all, so I guess we can > keep writel(). Yes it's not a performance issue here but an issue for the system which is doing PL310 L2 cache maintenance. If pinmux operation hold the l2x0_lock due to writel() the important video/audio process which is cleaning PL310 cache must wait, thus cause jitter. So I'd like relaxed version if we can. Then I don't need to add this patch to mainline kernel when we upgrade internal tree. Thanks, Jisheng From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jisheng Zhang Subject: Re: [PATCH RESEND 2/5] pinctrl: berlin: add a pinctrl driver for Marvell Berlin SoCs Date: Fri, 11 Apr 2014 16:27:16 +0800 Message-ID: <20140411162716.74e739e1@xhacker> References: <1397135274-10764-1-git-send-email-antoine.tenart@free-electrons.com> <1397135274-10764-3-git-send-email-antoine.tenart@free-electrons.com> <20140411144431.04fb148d@xhacker> <20140411081839.GB20147@kwain> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <20140411081839.GB20147@kwain> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Antoine =?UTF-8?B?VMOpbmFydA==?= Cc: "sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" , "linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org" , "alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org" , Jimmy Xu , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: devicetree@vger.kernel.org Hi Antoine, On Fri, 11 Apr 2014 01:18:39 -0700 Antoine T=C3=A9nart wrote: > Hi Jisheng, >=20 > On Fri, Apr 11, 2014 at 02:44:31PM +0800, Jisheng Zhang wrote: > > On Thu, 10 Apr 2014 06:07:51 -0700 > > Antoine T=C3=A9nart wrote: > >=20 > > ... > > > +static int berlin_pinmux_enable(struct pinctrl_dev *pctrl_dev, > > > + unsigned function, > > > + unsigned group) > > > +{ > > > + struct berlin_pinctrl *pctrl =3D > > > pinctrl_dev_get_drvdata(pctrl_dev); > > > + struct berlin_pinctrl_group *group_desc =3D pctrl->groups= + group; > > > + struct berlin_pinctrl_function *function_desc =3D > > > + pctrl->functions + function; > > > + unsigned long flags; > > > + u32 regval; > > > + > > > + spin_lock_irqsave(&pctrl->lock, flags); > > > + > > > + regval =3D readl(group_desc->reg); > > > + regval &=3D group_desc->mask; > > > + regval |=3D function_desc->muxval << group_desc->lsb; > > > + writel(regval, group_desc->reg); > >=20 > > Could we use relaxed version instead? >=20 > We could, but this is not a performance issue here at all, so I guess= we can > keep writel(). Yes it's not a performance issue here but an issue for the system which= is doing PL310 L2 cache maintenance. If pinmux operation hold the l2x0_lock due = to writel() the important video/audio process which is cleaning PL310 cache must wa= it, thus cause jitter. So I'd like relaxed version if we can. Then I don't need = to add this patch to mainline kernel when we upgrade internal tree. Thanks, Jisheng -- To unsubscribe from this list: send the line "unsubscribe devicetree" i= n the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755582AbaDKI3W (ORCPT ); Fri, 11 Apr 2014 04:29:22 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:25457 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750848AbaDKI3U convert rfc822-to-8bit (ORCPT ); Fri, 11 Apr 2014 04:29:20 -0400 Date: Fri, 11 Apr 2014 16:27:16 +0800 From: Jisheng Zhang To: Antoine =?UTF-8?B?VMOpbmFydA==?= CC: "sebastian.hesselbarth@gmail.com" , "linus.walleij@linaro.org" , "alexandre.belloni@free-electrons.com" , Jimmy Xu , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH RESEND 2/5] pinctrl: berlin: add a pinctrl driver for Marvell Berlin SoCs Message-ID: <20140411162716.74e739e1@xhacker> In-Reply-To: <20140411081839.GB20147@kwain> References: <1397135274-10764-1-git-send-email-antoine.tenart@free-electrons.com> <1397135274-10764-3-git-send-email-antoine.tenart@free-electrons.com> <20140411144431.04fb148d@xhacker> <20140411081839.GB20147@kwain> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.96,1.0.14,0.0.0000 definitions=2014-04-11_03:2014-04-11,2014-04-11,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1404110142 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Antoine, On Fri, 11 Apr 2014 01:18:39 -0700 Antoine Ténart wrote: > Hi Jisheng, > > On Fri, Apr 11, 2014 at 02:44:31PM +0800, Jisheng Zhang wrote: > > On Thu, 10 Apr 2014 06:07:51 -0700 > > Antoine Ténart wrote: > > > > ... > > > +static int berlin_pinmux_enable(struct pinctrl_dev *pctrl_dev, > > > + unsigned function, > > > + unsigned group) > > > +{ > > > + struct berlin_pinctrl *pctrl = > > > pinctrl_dev_get_drvdata(pctrl_dev); > > > + struct berlin_pinctrl_group *group_desc = pctrl->groups + group; > > > + struct berlin_pinctrl_function *function_desc = > > > + pctrl->functions + function; > > > + unsigned long flags; > > > + u32 regval; > > > + > > > + spin_lock_irqsave(&pctrl->lock, flags); > > > + > > > + regval = readl(group_desc->reg); > > > + regval &= group_desc->mask; > > > + regval |= function_desc->muxval << group_desc->lsb; > > > + writel(regval, group_desc->reg); > > > > Could we use relaxed version instead? > > We could, but this is not a performance issue here at all, so I guess we can > keep writel(). Yes it's not a performance issue here but an issue for the system which is doing PL310 L2 cache maintenance. If pinmux operation hold the l2x0_lock due to writel() the important video/audio process which is cleaning PL310 cache must wait, thus cause jitter. So I'd like relaxed version if we can. Then I don't need to add this patch to mainline kernel when we upgrade internal tree. Thanks, Jisheng