diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index a1125d1..2f6ffe5 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c @@ -2344,6 +2344,10 @@ static int b44_init_one(struct ssb_device *sdev, struct net_device *dev; struct b44 *bp; int err;
- unsigned int dma_desc_align_size = dma_get_cache_alignment(sdev->dma_dev);
- /* Setup paramaters for syncing RX/TX DMA descriptors */
- dma_desc_sync_size = max_t(unsigned int, dma_desc_align_size, sizeof(struct dma_desc));
instance++; @@ -2587,12 +2591,8 @@ static inline void b44_pci_exit(void) static int __init b44_init(void) {
- unsigned int dma_desc_align_size = dma_get_cache_alignment(); int err;
- /* Setup paramaters for syncing RX/TX DMA descriptors */
- dma_desc_sync_size = max_t(unsigned int, dma_desc_align_size, sizeof(struct dma_desc));
This looks wrong - you override a global variable for each probed device.
But in b44_init(), there is no device instances.
------------------ Original ------------------ From: "Christoph Hellwig"hch@lst.de; Date: Fri, Nov 10, 2017 08:30 PM To: "Huacai Chen"chenhc@lemote.com; Cc: "Christoph Hellwig"hch@lst.de; "Marek Szyprowski"m.szyprowski@samsung.com; "Robin Murphy"robin.murphy@arm.com; "Andrew Morton"akpm@linux-foundation.org; "Fuxin Zhang"zhangfx@lemote.com; "linux-kernel"linux-kernel@vger.kernel.org; "Ralf Baechle"ralf@linux-mips.org; "James Hogan"james.hogan@imgtec.com; "linux-mips"linux-mips@linux-mips.org; "James E . J . Bottomley"jejb@linux.vnet.ibm.com; "Martin K . Petersen"martin.petersen@oracle.com; "linux-scsi"linux-scsi@vger.kernel.org; "stable"stable@vger.kernel.org; "Michael S . Tsirkin"mst@redhat.com; "Pawel Osciak"pawel@osciak.com; "Kyungmin Park"kyungmin.park@samsung.com; "Michael Chan"michael.chan@broadcom.com; "Benjamin Herrenschmidt"benh@kernel.crashing.org; "Ivan Mikhaylov"ivan@ru.ibm.com; "Tariq Toukan"tariqt@mellanox.com; "Andy Gross"agross@codeaurora.org; "Mark A . Greer"mgreer@animalcreek.com; "Robert Baldyga"r.baldyga@hackerion.com; Subject: Re: [PATCH V9 1/4] dma-mapping: Rework dma_get_cache_alignment()
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index a1125d1..2f6ffe5 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c @@ -2344,6 +2344,10 @@ static int b44_init_one(struct ssb_device *sdev, struct net_device *dev; struct b44 *bp; int err;
- unsigned int dma_desc_align_size = dma_get_cache_alignment(sdev->dma_dev);
- /* Setup paramaters for syncing RX/TX DMA descriptors */
- dma_desc_sync_size = max_t(unsigned int, dma_desc_align_size, sizeof(struct dma_desc));
instance++; @@ -2587,12 +2591,8 @@ static inline void b44_pci_exit(void) static int __init b44_init(void) {
- unsigned int dma_desc_align_size = dma_get_cache_alignment(); int err;
- /* Setup paramaters for syncing RX/TX DMA descriptors */
- dma_desc_sync_size = max_t(unsigned int, dma_desc_align_size, sizeof(struct dma_desc));
This looks wrong - you override a global variable for each probed device.
linux-stable-mirror@lists.linaro.org