summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/3w-9xxx.h
AgeCommit message (Collapse)AuthorFilesLines
2021-05-15scsi: 3w-9xxx: Fix endianness issues in command packetsSamuel Holland1-55/+56
The controller expects all data it sends/receives to be little-endian. Therefore, the packet struct definitions should use the __le16/32/64 types. Once those are correct, sparse reports several issues with the driver code, which are fixed here as well. The main issue observed was at the call to scsi_set_resid(), where the byteswapped parameter would eventually trigger the alignment check at drivers/scsi/sd.c:2009. At that point, the kernel would continuously complain about an "Unaligned partial completion", and no further I/O could occur. This gets the controller working on big endian powerpc64. Link: https://lore.kernel.org/r/20210427235915.39211-4-samuel@sholland.org Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-05-15scsi: 3w-9xxx: Reduce scope of structure packingSamuel Holland1-8/+10
Currently, all command packet structs used by this driver are packed. However, only one (TW_SG_Entry) actually needs to be packed, because it uses 64-bit addresses at 32-bit alignment. To improve the quality of generated code, stop packing all of the other command packet structs. This requires adjusting the type of one misaligned "reserved" member. After this change, pahole reports that only one type had its layout change: the tw_compat_info member of TW_Device_Extension is now naturally aligned. Link: https://lore.kernel.org/r/20210427235915.39211-3-samuel@sholland.org Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-05-15scsi: 3w-9xxx: Use flexible array members to avoid struct paddingSamuel Holland1-2/+2
In preparation for removing the "#pragma pack(1)" from the driver, fix all instances where a trailing array member could be replaced by a flexible array member. Since a flexible array member has zero size, it introduces no padding, whether or not the struct is packed. Link: https://lore.kernel.org/r/20210427235915.39211-2-samuel@sholland.org Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-05-10scsi: 3w-9xxx: Move * operator to clean up code style warningColin Ian King1-1/+1
Checkpatch is warning that char* text sould be char *text to match the coding style. Fix this. Link: https://lore.kernel.org/r/20210416094713.2033212-1-colin.king@canonical.com Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-01-22scsi: 3w-9xxx: Whitespace cleanupHannes Reinecke1-71/+85
Link: https://lore.kernel.org/r/20210113090500.129644-4-hare@suse.de Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-12-04scsi: 3w-9xxx: rework lock timeoutsArnd Bergmann1-1/+1
The TW_IOCTL_GET_LOCK ioctl uses do_gettimeofday() to check whether a lock has expired. This can misbehave due to a concurrent settimeofday() call, as it is based on 'real' time, and it will overflow in y2038 on 32-bit architectures, producing unexpected results when used across the overflow time. This changes it to using monotonic time, using ktime_get() to simplify the code. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Adam Radford <aradford@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-12-14scsi: Update 3ware driver email addressesadam radford1-6/+3
This change updates the 3ware drivers (3w-xxxx, 3w-9xxx, 3w-sas) email addresses from linuxraid@lsi.com to aradford@gmail.com, since the old email address doesn't exist. This patch was updated to remove www.lsi.com text. [mkp: applied by hand] Signed-off-by: Adam Radford <aradford@gmail.com> Acked-by: Sumit Saxena <sumit.saxena@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-04-273w-9xxx: fix command completion raceChristoph Hellwig1-5/+0
The 3w-9xxx driver needs to tear down the dma mappings before returning the command to the midlayer, as there is no guarantee the sglist and count are valid after that point. Also remove the dma mapping helpers which have another inherent race due to the request_id index. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: stable@vger.kernel.org Acked-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2011-03-31Fix common misspellingsLucas De Marchi1-1/+1
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2010-04-11[SCSI] 3w-xxxx, 3w-9xxx: force 60 second timeoutadam radford1-4/+5
This small patch forces 60 second timeouts for the older 3w-xxxx & 3w-9xxx drivers for systems that don't contain the udev rule for setting scsi timeouts to 60 seconds. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-03-13[SCSI] 3w-9xxx: add power management supportadam radford1-1/+1
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26[SCSI] 3w-9xxx: add MSI support and misc fixesadam radford1-4/+5
This patch for the 3w-9xxx scsi driver applies on top of the BKL-pushdown changes in -git9. This patch does the following: - Increase max AENs drained to 256. - Add MSI support and "use_msi" module parameter. - Fix bug in twa_get_param() on 4GB+. - Use pci_resource_len() for ioremap(). Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2007-07-21[SCSI] 3w-9xxx: add support for 9690SAadam radford1-1/+4
The attached patch updates the 3ware 9000 driver: - Fix dma mask setting to fallback to 32-bit if 64-bit fails. - Add support for 9690SA controllers. Signed-off-by: Adam Radford <linuxraid@amcc.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-11-09[SCSI] 3ware 9000 add support for 9650SEadam radford1-5/+9
Updates the 3ware 9000 driver: - Free irq handler in __twa_shutdown(). - Serialize reset code. - Add support for 9650SE controllers. Signed-off-by: Adam Radford <linuxraid@amcc.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-19[SCSI] 3ware 9000 add big endian supportadam radford1-13/+5
The attached patch updates the 3ware 9000 driver: - Fix 9550SX pchip reset timeout. - Add big endian support. Signed-off-by: Adam Radford <linuxraid@amcc.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-01-14[SCSI] sem2mutex 3w-[x9]xxxJes Sorensen1-1/+1
Convert a the 3w-9xxx.c and 3w-xxxx.c drivers to use mutexes instead of semaphores. Untested, but compiles and looks obviously correct. Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-25[SCSI] 3ware 9000: Add support for 9550SX controllersadam radford1-7/+10
Signed-off-by: Adam Radford <linuxraid@amcc.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-04-16Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds1-0/+682
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!