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]
Message-ID: <CACRpkdbG4q54=j6nbxPmuSOG77zato5StSHdNQ1bSkCmvuQUvQ@mail.gmail.com>
Date:	Sat, 20 Apr 2013 15:31:39 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Jongsung Kim <neidhard.kim@....com>
Cc:	Russell King - ARM Linux <linux@....linux.org.uk>,
	Greg KH <gregkh@...uxfoundation.org>,
	Jiri Slaby <jslaby@...e.cz>,
	"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RESEND][PATCH] ARM: PL011: add support for extended FIFO-size of PL011-r1p5

On Mon, Apr 15, 2013 at 7:45 AM, Jongsung Kim <neidhard.kim@....com> wrote:

At the risk to re-stating what Russell has already said...

> +
> +       unsigned int (*get_fifosize)(unsigned int periphid);
>  };
>
> +static unsigned int get_fifosize_arm(unsigned int periphid)
> +{
> +       unsigned int rev = (periphid >> 20) & 0xf;
> +       return rev < 3 ? 16 : 32;
> +}

This is a very complicated way to to something very simple.

Keep the .fifosize as part of struct vendor_data, define a
new vendor data cunk for your variant, use .id and .mask
to select your variant.

static struct vendor_data vendor_arm_deepfifo = {
     .fifosize = 32,
     (... the rest is the same)
}

(...)

static struct amba_id pl011_ids[] = {
        {
                .id     = 0x00341011,
                .mask   = 0x00ffffff,
                .data   = &vendor_arm_deepfifo,
        },
(...)
};

As you can see in amba_lookup() in
drivers/amba/bus.c the table is traversed from the top,
so for the new "3" variant this entry will match, while the
next entry will match all older versions.

Yours,
Linus Walleij
--
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