lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 11 Nov 2014 15:23:40 +0100
From:	Lucas Stach <l.stach@...gutronix.de>
To:	Zubair Lutfullah Kakakhel <Zubair.Kakakhel@...tec.com>
Cc:	Andy Yan <andy.yan@...k-chips.com>, airlied@...ux.ie,
	heiko@...ech.de, fabio.estevam@...escale.com,
	rmk+kernel@....linux.org.uk,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <robh+dt@...nel.org>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Shawn Guo <shawn.guo@...aro.org>,
	Josh Boyer <jwboyer@...hat.com>,
	Sean Paul <seanpaul@...omium.org>,
	Inki Dae <inki.dae@...sung.com>,
	Dave Airlie <airlied@...hat.com>,
	Arnd Bergmann <arnd@...db.de>, djkurtz@...gle.com,
	ykk@...k-chips.com, linux-kernel@...r.kernel.org,
	dri-devel@...ts.freedesktop.org, devel@...verdev.osuosl.org,
	devicetree@...r.kernel.org, linux-rockchip@...ts.infradead.org,
	jay.xu@...k-chips.com
Subject: Re: [PATCH v7 5/7] drm: bridge/dw-hdmi: add support for multi byte
 register width access

Am Dienstag, den 11.11.2014, 14:20 +0000 schrieb Zubair Lutfullah
Kakakhel:
> Hi Andy,
> 
> This patch adds the reg-io-width binding.
> 
> Hence the binding patch should come before it.
> 
> 
> On 11/11/14 12:53, Andy Yan wrote:
> > On rockchip rk3288, only word(32-bit) accesses are
> > permitted for hdmi registers.  Byte width accesses (writeb,
> > readb) generate an imprecise external abort.
> > 
> > Signed-off-by: Andy Yan <andy.yan@...k-chips.com>
> > 
> > ---
> > 
> >  }
> >  
> >  static void hdmi_modb(struct dw_hdmi *hdmi, u8 data, u8 mask, unsigned reg)
> > @@ -1499,6 +1527,23 @@ static int dw_hdmi_bind(struct device *dev, struct device *master, void *data)
> >  	struct device_node *ddc_node;
> >  	struct resource *iores;
> >  	int ret, irq;
> > +	u32 val = 1;
> > +
> > +	of_property_read_u32(np, "reg-io-width", &val);
> > +
> > +	switch (val) {
> > +	case 4:
> > +		hdmi->write = dw_hdmi_writel;
> > +		hdmi->read = dw_hdmi_readl;
> > +		break;
> > +	case 1:
> > +		hdmi->write = dw_hdmi_writeb;
> > +		hdmi->read = dw_hdmi_readb;
> > +		break;
> > +	default:
> > +		dev_err(dev, "reg-io-width must be 1 or 4\n");
> > +		return -EINVAL;
> > +	}
> 
> The binding patch says this is an optional property.
> But here if undefined it returns -EINVAL.
> 
> I would keep it optional and default it to byte access.

That's exactly what the patch does. val is initialized to 1, which is
not changed if the property could not be found in the DT. The default
case will only be taken if the property is present in DT but has any
other value than 1 or 4, which is an error.

Regards,
Lucas

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ