mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Colin King" <colin.king@canonical.com>,
	"Hauke Mehrtens" <hauke@hauke-m.de>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	linux-wireless@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bcma: fix incorrect update of BCMA_CORE_PCI_MDIO_DATA
Date: Thu, 22 Aug 2019 18:55:07 +0200	[thread overview]
Message-ID: <fe3e6a33692a07d15287800749b688e796c43f9a.camel@sipsolutions.net> (raw)
In-Reply-To: <20190822133524.6274-1-colin.king@canonical.com> (sfid-20190822_153601_850332_39AACB50)

On Thu, 2019-08-22 at 14:35 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> An earlier commit re-worked the setting of the bitmask and is now
> assigning v with some bit flags rather than bitwise or-ing them
> into v, consequently the earlier bit-settings of v are being lost.
> Fix this by replacing an assignment with the bitwise or instead.
> 
> Addresses-Coverity: ("Unused value")
> Fixes: 2be25cac8402 ("bcma: add constants for PCI and use them")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/bcma/driver_pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
> index f499a469e66d..d219ee947c07 100644
> --- a/drivers/bcma/driver_pci.c
> +++ b/drivers/bcma/driver_pci.c
> @@ -78,7 +78,7 @@ static u16 bcma_pcie_mdio_read(struct bcma_drv_pci *pc, u16 device, u8 address)
>  		v |= (address << BCMA_CORE_PCI_MDIODATA_REGADDR_SHF_OLD);
>  	}
>  
> -	v = BCMA_CORE_PCI_MDIODATA_START;
> +	v |= BCMA_CORE_PCI_MDIODATA_START;

The same bug/issue is in bcma_pcie_mdio_write() btw.

It *seems* correct to me - otherwise the "address" parameter to the
function is entirely unused, which can't really be right.

There are only two code paths that ever get here:
 * bcma_pcicore_serdes_workaround
 * bcma_core_pci_power_save

The register at 0 is BCMA_CORE_PCI_CTL, which only has a few bits so
even bad values written there by accident might not hurt much ...

So it seems possible that it was just always broken.

johannes


      parent reply	other threads:[~2019-08-22 16:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 13:35 Colin King
2019-08-22 16:03 ` Larry Finger
2019-08-22 16:11   ` Colin Ian King
2019-08-22 16:38     ` Larry Finger
2019-08-27  7:58       ` Colin Ian King
2019-08-25 19:59     ` Rafał Miłecki
2019-08-22 16:55 ` Johannes Berg [this message]

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=fe3e6a33692a07d15287800749b688e796c43f9a.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=colin.king@canonical.com \
    --cc=hauke@hauke-m.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=zajec5@gmail.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

all inboxes | Powered by JetHome®