History log of /linux-master/drivers/scsi/isci/sas.h
Revision Date Author Comments
# 5febf6d6 24-Feb-2020 Gustavo A. R. Silva <gustavo@embeddedor.com>

scsi: Replace zero-length array with flexible-array member

The current codebase makes use of the zero-length array language extension
to the C90 standard, but the preferred mechanism to declare variable-length
types such as these ones is a flexible array member[1][2], introduced in
C99:

struct foo {
int stuff;
struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning in
case the flexible array does not occur last in the structure, which will
help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by this
change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Link: https://lore.kernel.org/r/20200224161406.GA21454@embeddedor
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Satish Kharat <satishkh@cisco.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 54b5e3a4 28-Sep-2011 Dan Williams <dan.j.williams@intel.com>

[SCSI] isci: fix support for large smp requests

Kill the local smp response buffer.

Besides being unnecessary, it is too small (currently truncates
responses to 60 bytes). The mid-layer will have already allocated a
sufficiently sized buffer, just kmap and copy into it directly.

Cc: <stable@kernel.org>
Reported-by: Derick Marks <derick.w.marks@intel.com>
Tested-by: Derick Marks <derick.w.marks@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# e9bf7095 16-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: fix support for arbitrarily large smp requests

Instead of duplicating the smp request buffer reuse the one provided by
libsas. This future proofs the driver to support arbitrarily large smp
requests, and shrinks the request structure size by ~700 bytes.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 8694e792 04-May-2011 Dave Jiang <dave.jiang@intel.com>

isci: removing intel_*.h headers

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# d20930a2 04-May-2011 Dave Jiang <dave.jiang@intel.com>

isci: Converting smp_response to Linux native smp_resp

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 2ec53eb4 04-May-2011 Dave Jiang <dave.jiang@intel.com>

isci: Fixup of smp request

The struct smp_request data structure has be fixed up for Linux consumption.
This probably should go to scsi/sas.h eventually.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# af5ae893 04-May-2011 Dave Jiang <dave.jiang@intel.com>

isci: Convert of sci_ssp_response_iu to ssp_response_iu

Converting to Linux native format. However the isci driver does a lot of
the calculation based on the max size of this data structure and the
Linux data structure only has a pointer to the response data. Thus the
sizeof(struct ssp_response_iu) will be incorrect and we need to define
the max size.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 0cfa890e 04-May-2011 Dave Jiang <dave.jiang@intel.com>

isci: Fixup SSP command IU and task IU

Fixup of SSP command IU and SSP task IU to something that looks like Linux

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# e76d6180 04-May-2011 Dave Jiang <dave.jiang@intel.com>

isci: Convert ATA defines to Linux native defines

* Removing all intel_sata and intel_ata defines
* Removing the usage of SAT_PROTOCOL_*. We can get everything from sas_task
* Moved SATA FIS types to local sas.h. These defines will have to go
into include/scsi/sas.h eventually.
* Added offsets for SATA FIS header in order to grab the values

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>