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 <damien.lemoal@xxxxxxxxxxxxxxxxxx> > >>>> --- > >>>> 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