Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp225736pxa; Fri, 21 Aug 2020 05:52:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuU4zsuDvB/q0xlUqNwKzWAvPexbT0LYblLgtdlAKmOlYIwbJWNLcufz4rm9Z+lzgE3Kcb X-Received: by 2002:aa7:c1ca:: with SMTP id d10mr2634737edp.261.1598014371718; Fri, 21 Aug 2020 05:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598014371; cv=none; d=google.com; s=arc-20160816; b=gJNYJjdVLF0O25Tt58F/qCeyWFBGpcJUa4gsiSxktrd2qlmyu4kL+z3zT7iyBgU8OA KbBusUH6HebiDRAY6bzS1r5vIIWzl9ECmX5EhhLQf31OCWDKUYW2cUIezEw02diqnpVO x3iR32YnzPa0FhR9zcT4SlVw03WFyDloGNOs/R38s27VzWJ5yFpiJKqEpXkq7wd5YNJT bGy+yoMBuszsUMaAR45tS8yVtVVWt3vLs9f2NlBRjKMr7NvD8XEhpg0w9qviWhLu9P+h wf7qWBHzNq3HTk8rEI1z+TGfIXbBz8USgMJS/HTPf4YWdzG/lupI2uilw/GtTeAMdCol NlYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mQgK+SNMvMHD2kMEy8rXU+kpyN6Xvc8FHA+4wVp0ysE=; b=coSNsQgvh5gtkUU+US3z5zbqdU95qM8BB0HWoCOIrWhWCPzB5MKlJLmwEE7hfwzoOj HlNX4cRYEZzEnBtimhDnx4bSPgshyhdP6HeDdgTuwISiQCgSVZCHcB856X0JtH/pijlH YlpLQiE1q7Tjpx2JBL1w19K2xdbfLggq11LOwhWt07+GtLOup0gJgyUBQpG4wXtBNvrx wKch9tcmrYepW9BcB9oqTdQg16S2mRJ+nQWAnPwnJ5sWeMw2xlaavPTtZIai5D6fEcJB /La2Co2Tszwlt5VND7t70/K7rFzEVv266NJqHMWD1Ck3oM/A4TiinEfCn2dtArBt9EMd 977w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gna3F4cQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl4si1124751ejb.512.2020.08.21.05.52.26; Fri, 21 Aug 2020 05:52:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gna3F4cQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728611AbgHUMtV (ORCPT + 99 others); Fri, 21 Aug 2020 08:49:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727839AbgHUMtQ (ORCPT ); Fri, 21 Aug 2020 08:49:16 -0400 Received: from mail-vk1-xa44.google.com (mail-vk1-xa44.google.com [IPv6:2607:f8b0:4864:20::a44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8414C061386 for ; Fri, 21 Aug 2020 05:49:15 -0700 (PDT) Received: by mail-vk1-xa44.google.com with SMTP id i20so382000vkk.2 for ; Fri, 21 Aug 2020 05:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mQgK+SNMvMHD2kMEy8rXU+kpyN6Xvc8FHA+4wVp0ysE=; b=Gna3F4cQeMdRPcx3MCe9fCAP6nafVCC1qEUsyb9rU2Au9Y4znu+61ohEmEmWjcq8JG ssjcV0YRJUQlItcSkspzyh+tjBRXSXFqc4GOnR3eOU6GlzFluiYEtFw+Rh7hZlftS2bt Mhm5S5M5v4SvAYTiEpkiL7NJuppdQklwADY47Oq3DRtqTBJ13lagaF+eTtu9ocArbjHd Pn8d6RL5KZlsZN48xthW2uuAiz9xzoUDO+BCZtfVkNDFYIfdgX+eYWR/M1vKbgdNUA8I by3cIZu6Ls+6ttjTsJcLdN36RJLVg8JdlC0imjFUazgjgyJpZRrldRmHVbLvOiTk5TpV 0Wvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mQgK+SNMvMHD2kMEy8rXU+kpyN6Xvc8FHA+4wVp0ysE=; b=GYqCPtF8W7KT/MG7/WEKQHN7BRX/5hbBvjOrqYTHlwo4AvsFFDVwxs792H0zNIu9Ct pgLSc68l499GYNPNoDkCn4FHKtngJtJs+ZEW/DkcRl3EC1usd2gU9wDsg12PkTQOncZq 3UjuDxE/I2a7hK1C1ojnEnk68H2FwHJ8DK5y6yyEC9txmasstRlboVTZB7Zearaqewiq dHG/IshWhKMkaVcmqFMfhqbnEqwOupWqXjki2ir3TAuFEglj4PSinAR8IDoYYzVOAKls 41hsRLTa1VB2LNRmnsW4YPMI/pIOKToQ0rBKxML7ngAu5FjSX1LBZD/GqMrHgKS0P9vl n/6Q== X-Gm-Message-State: AOAM5303YP/NgdzIq1j5AOrpxGt5DIlrYSVeTFvDDz4qXJQGidhjDCHM QLimaKUtRAqUY6YY9B0Dx6MoIMxz9QD6Zybb4B06LA== X-Received: by 2002:a1f:9d85:: with SMTP id g127mr1445404vke.101.1598014153688; Fri, 21 Aug 2020 05:49:13 -0700 (PDT) MIME-Version: 1.0 References: <20200803072857.8880-1-madhuparnabhowmik10@gmail.com> In-Reply-To: <20200803072857.8880-1-madhuparnabhowmik10@gmail.com> From: Ulf Hansson Date: Fri, 21 Aug 2020 14:48:37 +0200 Message-ID: Subject: Re: [PATCH] drivers: mmc: host: via-sdmmc: Fix data race bug To: madhuparnabhowmik10@gmail.com Cc: Bruce Chang , Harald Welte , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , ldv-project@linuxtesting.org, andrianov@ispras.ru Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 3 Aug 2020 at 09:29, wrote: > > From: Madhuparna Bhowmik > > via_save_pcictrlreg() should be called with host->lock held > as it writes to pm_pcictrl_reg, otherwise there can be a race > condition between via_sd_suspend() and via_sdc_card_detect(). > The same pattern is used in the function via_reset_pcictrl() > as well, where via_save_pcictrlreg() is called with host->lock > held. > > Found by Linux Driver Verification project (linuxtesting.org). > > Signed-off-by: Madhuparna Bhowmik This doesn't apply to my mmc tree, can you please rebase and submit a new version. Kind regards Uffe > --- > drivers/mmc/host/via-sdmmc.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/mmc/host/via-sdmmc.c b/drivers/mmc/host/via-sdmmc.c > index ef95bce50889..e4d8126cd4e5 100644 > --- a/drivers/mmc/host/via-sdmmc.c > +++ b/drivers/mmc/host/via-sdmmc.c > @@ -1259,11 +1259,14 @@ static void via_init_sdc_pm(struct via_crdr_mmc_host *host) > static int via_sd_suspend(struct pci_dev *pcidev, pm_message_t state) > { > struct via_crdr_mmc_host *host; > + unsigned long flags; > > host = pci_get_drvdata(pcidev); > > + spin_lock_irqsave(&host->lock, flags); > via_save_pcictrlreg(host); > via_save_sdcreg(host); > + spin_unlock_irqrestore(&host->lock, flags); > > pci_save_state(pcidev); > pci_enable_wake(pcidev, pci_choose_state(pcidev, state), 0); > -- > 2.17.1 >