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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66327C636D4 for ; Wed, 15 Feb 2023 13:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233468AbjBONZB (ORCPT ); Wed, 15 Feb 2023 08:25:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230500AbjBONZB (ORCPT ); Wed, 15 Feb 2023 08:25:01 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0B5331E37 for ; Wed, 15 Feb 2023 05:24:35 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 522B361B6B for ; Wed, 15 Feb 2023 13:24:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F900C433EF; Wed, 15 Feb 2023 13:24:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1676467474; bh=6fnE0TBCtFaEXmn9Caf119uGHoUY4UB3VWkbQUraWYs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uVqOClWCAigfwaEVxb4YCesgX1qgmVGesI2jh4vUfAkPt2AtSqL0T899CwBQmRqog n7Xw/vnG8L9wRRyB+NaKs6BzAoWDIdF2SC9amk4nTGYB60QahueTzVWXqA2eLYtQ6/ LphIJott8I4ckhI+ZN4SqswOKs+WXmK4ZpX7BeDA= Date: Wed, 15 Feb 2023 14:24:31 +0100 From: Greg Kroah-Hartman To: Damien Le Moal Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, Rick Wertenbroek , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Kishon Vijay Abraham I , Arnd Bergmann Subject: Re: [PATCH 07/12] pci: epf-test: Add debug and error messages Message-ID: References: <20230215032155.74993-1-damien.lemoal@opensource.wdc.com> <20230215032155.74993-8-damien.lemoal@opensource.wdc.com> <077adda6-ef9f-5c31-c041-97342317f1d2@opensource.wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <077adda6-ef9f-5c31-c041-97342317f1d2@opensource.wdc.com> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Wed, Feb 15, 2023 at 09:18:48PM +0900, Damien Le Moal wrote: > On 2/15/23 21:01, Greg Kroah-Hartman wrote: > > On Wed, Feb 15, 2023 at 08:45:50PM +0900, Damien Le Moal wrote: > >> On 2/15/23 20:34, Greg Kroah-Hartman wrote: > >>> On Wed, Feb 15, 2023 at 12:21:50PM +0900, Damien Le Moal wrote: > >>>> Make the pci-epf-test driver more verbose with dynamic debug messages > >>>> using dev_dbg(). Also add some dev_err() error messages to help > >>>> troubleshoot issues. > >>>> > >>>> Signed-off-by: Damien Le Moal > >>>> --- > >>>> drivers/pci/endpoint/functions/pci-epf-test.c | 69 +++++++++++++++---- > >>>> 1 file changed, 56 insertions(+), 13 deletions(-) > >>>> > >>>> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c > >>>> index f630393e8208..9b791f4a7ffb 100644 > >>>> --- a/drivers/pci/endpoint/functions/pci-epf-test.c > >>>> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c > >>>> @@ -330,6 +330,10 @@ static int pci_epf_test_copy(struct pci_epf_test *epf_test, bool use_dma) > >>>> enum pci_barno test_reg_bar = epf_test->test_reg_bar; > >>>> volatile struct pci_epf_test_reg *reg = epf_test->reg[test_reg_bar]; > >>> > >>> note, volatile is almost always wrong, please fix that up. > >> > >> OK. Will think of something else. > > > > If this is io memory, use the proper accessors to access it. If it is > > not io memory, then why is it marked volatile at all? > > This is a PCI bar memory. So I can simply copy the structure locally with > memcpy_fromio() and memcpy_toio(). Great, please do so instead of trying to access it directly like this, which will break on some platforms. thanks, greg k-h