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: <CAAh8qszwWsSTPhK_aLziy8px9hOyixGN50m6YMA_5Rb2w23zaw@mail.gmail.com>
Date:   Sat, 18 Aug 2018 10:37:01 +0200
From:   Simon Goldschmidt <simon.k.r.goldschmidt@...il.com>
To:     tpiepho@...inj.com
Cc:     linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH v2] spi: dw: support 4-16 bits per word

On Fri, Aug 17, 2018 at 6:32 PM Trent Piepho <tpiepho@...inj.com> wrote:
>
> On Fri, 2018-08-17 at 09:01 +0200, Simon Goldschmidt wrote:
> > The spi-dw driver currently only supports 8 or 16 bits per word.
> >
> > Since the hardware supports 4-16 bits per word, adapt the driver
> > to also support this.
> >
> >
>
> > @@ -307,15 +307,13 @@ static int dw_spi_transfer_one(struct spi_controller *master,
> > +
> > +     if ((transfer->bits_per_word < 4) || (transfer->bits_per_word > 16))
> >               return -EINVAL;
> > -     }
>
> You don't need this check as the spi core validates the transfer
> against master->bits_per_word_mask.

Ok.

>
> >       master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LOOP;
> > -     master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16);
> > +     master->bits_per_word_mask =  SPI_BPW_RANGE_MASK(4, 16);
> >       master->bus_num = dws->bus_num;
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ