From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F13CDC3A5A1 for ; Thu, 22 Aug 2019 16:55:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C372521743 for ; Thu, 22 Aug 2019 16:55:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390181AbfHVQzP (ORCPT ); Thu, 22 Aug 2019 12:55:15 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:36666 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728080AbfHVQzP (ORCPT ); Thu, 22 Aug 2019 12:55:15 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i0qMh-0003xQ-PO; Thu, 22 Aug 2019 18:55:12 +0200 Message-ID: Subject: Re: [PATCH] bcma: fix incorrect update of BCMA_CORE_PCI_MDIO_DATA From: Johannes Berg To: Colin King , Hauke Mehrtens , =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= , linux-wireless@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 22 Aug 2019 18:55:07 +0200 In-Reply-To: <20190822133524.6274-1-colin.king@canonical.com> (sfid-20190822_153601_850332_39AACB50) References: <20190822133524.6274-1-colin.king@canonical.com> (sfid-20190822_153601_850332_39AACB50) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-08-22 at 14:35 +0100, Colin King wrote: > From: Colin Ian King > > 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 > --- > 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