From: Hauke Mehrtens <hauke@hauke-m.de>
To: Nathan Hintz <nlhintz@hotmail.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 4/5] bcma: add support for 1 and 2 byte extended config space access
Date: Sat, 12 Jan 2013 15:44:19 +0100 [thread overview]
Message-ID: <50F176C3.2070200@hauke-m.de> (raw)
In-Reply-To: <BLU0-SMTP989EDC8A841E1B9D693EC8AC280@phx.gbl>
On 01/12/2013 11:46 AM, Nathan Hintz wrote:
> The sanity checks allow 1 and 2 byte reads/writes of the extended
> PCI config space to proceed; however, the code only supports 4
> byte reads/writes. This patch adds support for 1 and 2 byte
> reads/writes of the extended PCI config space.
>
> Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
> drivers/bcma/driver_pci_host.c | 15 ++++++++-------
> 1 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c
> index e1381ba..92800b4 100644
> --- a/drivers/bcma/driver_pci_host.c
> +++ b/drivers/bcma/driver_pci_host.c
> @@ -101,7 +101,7 @@ static int bcma_extpci_read_config(struct bcma_drv_pci *pc, unsigned int dev,
> */
> if (off >= PCI_CONFIG_SPACE_SIZE) {
> addr = (func << 12);
> - addr |= (off & 0x0FFF);
> + addr |= (off & 0x0FFC);
> val = bcma_pcie_read_config(pc, addr);
> } else {
> addr = BCMA_CORE_PCI_PCICFG0;
> @@ -164,7 +164,11 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
> /* accesses to config registers with offsets >= 256
> * requires indirect access.
> */
> - if (off < PCI_CONFIG_SPACE_SIZE) {
> + if (off >= PCI_CONFIG_SPACE_SIZE) {
> + addr = (func << 12);
> + addr |= (off & 0x0FFC);
> + val = bcma_pcie_read_config(pc, addr);
> + } else {
> addr = BCMA_CORE_PCI_PCICFG0;
> addr |= (func << 8);
> addr |= (off & 0xfc);
> @@ -202,13 +206,10 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
> /* accesses to config registers with offsets >= 256
> * requires indirect access.
> */
> - if (off >= PCI_CONFIG_SPACE_SIZE) {
> - addr = (func << 12);
> - addr |= (off & 0x0FFF);
> + if (off >= PCI_CONFIG_SPACE_SIZE)
> bcma_pcie_write_config(pc, addr, val);
> - } else {
> + else
> pcicore_write32(pc, addr, val);
> - }
> } else {
> writel(val, mmio);
>
>
next prev parent reply other threads:[~2013-01-12 14:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1357987577-20661-1-git-send-email-nlhintz@hotmail.com>
2013-01-12 10:46 ` [PATCH 1/5] bcma: delete duplicate readl Nathan Hintz
2013-01-12 14:16 ` Hauke Mehrtens
2013-01-12 10:46 ` [PATCH 2/5] bcma: jump to 'out' label for invalid 'func' value Nathan Hintz
2013-01-12 14:18 ` Hauke Mehrtens
2013-01-12 10:46 ` [PATCH 3/5] bcma: don't map/unmap a subset of the PCI config space Nathan Hintz
2013-01-12 14:38 ` Hauke Mehrtens
2013-01-12 14:45 ` Hauke Mehrtens
2013-01-12 10:46 ` [PATCH 4/5] bcma: add support for 1 and 2 byte extended config space access Nathan Hintz
2013-01-12 14:44 ` Hauke Mehrtens [this message]
2013-01-12 10:46 ` [PATCH 5/5] bcma: use consistent case for 'hex' constants Nathan Hintz
2013-01-12 14:05 ` Hauke Mehrtens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50F176C3.2070200@hauke-m.de \
--to=hauke@hauke-m.de \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=nlhintz@hotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).