2020-08-02 13:22:24

by Jia-Ju Bai

[permalink] [raw]
Subject: [BUG] scsi: wd719x: accessing the data mapped to streaming DMA

In wd719x_queuecommand(), "scb" is mapped to streaming DMA:
  scb->phys = dma_map_single(..., scb, ...);

Then "scb" is accessed at many places in this function, such as:
  scb->SCB_options |= WD719X_SCB_FLAGS_AUTO_REQUEST_SENSE;
  ...
  scb->data_length = 0;
  scb->data_p = 0;

These accesses may cause data inconsistency between CPU cache and hardware.

I am not sure how to properly fix this problem, and thus I only report it.


Best wishes,
Jia-Ju Bai